@gravity-ui/page-constructor 1.15.0-alpha.21 → 1.15.0-alpha.23
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 +88 -0
- package/README.md +3 -15
- package/build/cjs/blocks/Banner/schema.d.ts +0 -9
- package/build/cjs/blocks/Banner/schema.js +1 -3
- package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +78 -0
- package/build/cjs/blocks/Header/schema.d.ts +0 -156
- package/build/cjs/blocks/Header/schema.js +0 -4
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +0 -78
- package/build/cjs/blocks/Info/schema.d.ts +0 -3
- package/build/cjs/blocks/Info/schema.js +0 -2
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.d.ts +1 -2
- package/build/cjs/blocks/Preview/schema.d.ts +0 -3
- package/build/cjs/blocks/Preview/schema.js +1 -3
- package/build/cjs/blocks/Security/schema.d.ts +0 -3
- package/build/cjs/blocks/Security/schema.js +1 -3
- package/build/cjs/blocks/Slider/Arrow/Arrow.js +2 -2
- package/build/cjs/blocks/Slider/Slider.css +0 -4
- package/build/cjs/blocks/Tabs/schema.d.ts +78 -0
- package/build/cjs/components/BackLink/BackLink.d.ts +0 -1
- package/build/cjs/components/BackLink/BackLink.js +4 -2
- package/build/cjs/components/Button/Button.js +1 -4
- package/build/cjs/components/ButtonTabs/ButtonTabs.d.ts +0 -1
- package/build/cjs/components/CardBase/CardBase.d.ts +2 -4
- package/build/cjs/components/Foldable/Foldable.css +4 -1
- package/build/cjs/components/Foldable/Foldable.js +7 -10
- package/build/cjs/components/FullscreenImage/FullscreenImage.js +8 -6
- package/build/cjs/components/FullscreenMedia/FullScreenMedia.css +70 -0
- package/build/cjs/components/FullscreenMedia/FullScreenMedia.d.ts +9 -0
- package/build/cjs/components/FullscreenMedia/FullScreenMedia.js +40 -0
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.css +30 -0
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +7 -2
- package/build/cjs/components/HeightCalculator/HeightCalculator.d.ts +4 -0
- package/build/cjs/components/HeightCalculator/HeightCalculator.js +4 -0
- package/build/cjs/components/Link/Link.js +1 -1
- package/build/cjs/components/Media/Media.js +3 -2
- package/build/cjs/components/MetaInfo/MetaInfo.css +13 -0
- package/build/cjs/components/MetaInfo/MetaInfo.d.ts +6 -0
- package/build/cjs/components/MetaInfo/MetaInfo.js +8 -0
- package/build/cjs/components/MetaInfo/schema.d.ts +8 -0
- package/build/cjs/components/MetaInfo/schema.js +10 -0
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +1 -1
- package/build/cjs/components/VideoBlock/VideoBlock.d.ts +1 -0
- package/build/cjs/components/VideoBlock/VideoBlock.js +6 -10
- package/build/cjs/components/YandexForm/YandexForm.d.ts +2 -4
- package/build/cjs/components/YandexForm/YandexForm.js +2 -2
- package/build/cjs/components/index.d.ts +2 -0
- package/build/cjs/components/index.js +5 -1
- package/build/cjs/constructor-items.d.ts +4 -0
- package/build/cjs/constructor-items.js +4 -0
- package/build/cjs/containers/PageConstructor/PageConstructor.css +1 -0
- package/build/cjs/hooks/useHeightCalculator.d.ts +6 -0
- package/build/cjs/hooks/useHeightCalculator.js +27 -0
- package/build/cjs/models/common.d.ts +3 -0
- package/build/cjs/models/constructor-items/blocks.d.ts +0 -10
- package/build/cjs/models/constructor-items/common.d.ts +6 -30
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +18 -7
- package/build/cjs/models/constructor-items/sub-blocks.js +4 -0
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +5 -3
- package/build/cjs/schema/index.js +1 -0
- package/build/cjs/schema/validators/common.d.ts +78 -0
- package/build/cjs/schema/validators/common.js +2 -0
- package/build/cjs/schema/validators/sub-blocks.d.ts +1 -0
- package/build/cjs/schema/validators/sub-blocks.js +1 -0
- package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +0 -3
- package/build/cjs/sub-blocks/BackgroundCard/schema.js +0 -2
- package/build/cjs/sub-blocks/BannerCard/BannerCard.js +2 -1
- package/build/cjs/sub-blocks/HubspotForm/HubspotForm.css +14 -9
- package/build/cjs/sub-blocks/HubspotForm/HubspotFormContainer.d.ts +1 -1
- package/build/cjs/sub-blocks/HubspotForm/HubspotFormContainer.js +26 -8
- package/build/cjs/sub-blocks/HubspotForm/index.js +5 -3
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.css +16 -0
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.d.ts +3 -0
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +21 -0
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +218 -0
- package/build/cjs/sub-blocks/LayoutItem/schema.js +18 -0
- package/build/cjs/sub-blocks/LayoutItem/utils.d.ts +29 -0
- package/build/cjs/sub-blocks/LayoutItem/utils.js +12 -0
- package/build/cjs/sub-blocks/Quote/Quote.js +2 -2
- package/build/cjs/sub-blocks/Quote/schema.d.ts +0 -3
- package/build/cjs/sub-blocks/Quote/schema.js +1 -3
- package/build/cjs/sub-blocks/index.d.ts +1 -0
- package/build/cjs/sub-blocks/index.js +3 -1
- package/build/cjs/text-transform/blocks.js +17 -0
- package/build/cjs/utils/hubspot.d.ts +2 -1
- package/build/cjs/utils/hubspot.js +5 -1
- package/build/esm/blocks/Banner/schema.d.ts +0 -9
- package/build/esm/blocks/Banner/schema.js +1 -3
- package/build/esm/blocks/ExtendedFeatures/schema.d.ts +78 -0
- package/build/esm/blocks/Header/schema.d.ts +0 -156
- package/build/esm/blocks/Header/schema.js +0 -4
- package/build/esm/blocks/HeaderSlider/schema.d.ts +0 -78
- package/build/esm/blocks/Info/schema.d.ts +0 -3
- package/build/esm/blocks/Info/schema.js +0 -2
- package/build/esm/blocks/Preview/MediaContent/MediaContent.d.ts +1 -2
- package/build/esm/blocks/Preview/schema.d.ts +0 -3
- package/build/esm/blocks/Preview/schema.js +1 -3
- package/build/esm/blocks/Security/schema.d.ts +0 -3
- package/build/esm/blocks/Security/schema.js +1 -3
- package/build/esm/blocks/Slider/Arrow/Arrow.js +2 -2
- package/build/esm/blocks/Slider/Slider.css +0 -4
- package/build/esm/blocks/Tabs/schema.d.ts +78 -0
- package/build/esm/components/BackLink/BackLink.d.ts +0 -1
- package/build/esm/components/BackLink/BackLink.js +4 -2
- package/build/esm/components/Button/Button.js +1 -4
- package/build/esm/components/ButtonTabs/ButtonTabs.d.ts +0 -1
- package/build/esm/components/CardBase/CardBase.d.ts +2 -4
- package/build/esm/components/Foldable/Foldable.css +4 -1
- package/build/esm/components/Foldable/Foldable.js +8 -11
- package/build/esm/components/FullscreenImage/FullscreenImage.js +9 -7
- package/build/esm/components/FullscreenMedia/FullScreenMedia.css +70 -0
- package/build/esm/components/FullscreenMedia/FullScreenMedia.d.ts +10 -0
- package/build/esm/components/FullscreenMedia/FullScreenMedia.js +38 -0
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.css +30 -0
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +7 -2
- package/build/esm/components/HeightCalculator/HeightCalculator.d.ts +4 -0
- package/build/esm/components/HeightCalculator/HeightCalculator.js +4 -0
- package/build/esm/components/Link/Link.js +1 -1
- package/build/esm/components/Media/Media.js +3 -2
- package/build/esm/components/MetaInfo/MetaInfo.css +13 -0
- package/build/esm/components/MetaInfo/MetaInfo.d.ts +7 -0
- package/build/esm/components/MetaInfo/MetaInfo.js +6 -0
- package/build/esm/components/MetaInfo/schema.d.ts +8 -0
- package/build/esm/components/MetaInfo/schema.js +8 -0
- package/build/esm/components/ReactPlayer/ReactPlayer.js +1 -1
- package/build/esm/components/VideoBlock/VideoBlock.d.ts +1 -0
- package/build/esm/components/VideoBlock/VideoBlock.js +6 -10
- package/build/esm/components/YandexForm/YandexForm.d.ts +2 -4
- package/build/esm/components/YandexForm/YandexForm.js +2 -2
- package/build/esm/components/index.d.ts +2 -0
- package/build/esm/components/index.js +2 -0
- package/build/esm/constructor-items.d.ts +4 -0
- package/build/esm/constructor-items.js +5 -1
- package/build/esm/containers/PageConstructor/PageConstructor.css +1 -0
- package/build/esm/hooks/useHeightCalculator.d.ts +6 -0
- package/build/esm/hooks/useHeightCalculator.js +24 -0
- package/build/esm/models/common.d.ts +3 -0
- package/build/esm/models/constructor-items/blocks.d.ts +0 -10
- package/build/esm/models/constructor-items/common.d.ts +6 -30
- package/build/esm/models/constructor-items/sub-blocks.d.ts +18 -7
- package/build/esm/models/constructor-items/sub-blocks.js +4 -0
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js +5 -3
- package/build/esm/schema/index.js +1 -0
- package/build/esm/schema/validators/common.d.ts +78 -0
- package/build/esm/schema/validators/common.js +2 -0
- package/build/esm/schema/validators/sub-blocks.d.ts +1 -0
- package/build/esm/schema/validators/sub-blocks.js +1 -0
- package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +0 -3
- package/build/esm/sub-blocks/BackgroundCard/schema.js +0 -2
- package/build/esm/sub-blocks/BannerCard/BannerCard.js +3 -2
- package/build/esm/sub-blocks/HubspotForm/HubspotForm.css +14 -9
- package/build/esm/sub-blocks/HubspotForm/HubspotFormContainer.d.ts +1 -1
- package/build/esm/sub-blocks/HubspotForm/HubspotFormContainer.js +26 -8
- package/build/esm/sub-blocks/HubspotForm/index.js +5 -3
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.css +16 -0
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.d.ts +4 -0
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +20 -0
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +218 -0
- package/build/esm/sub-blocks/LayoutItem/schema.js +14 -0
- package/build/esm/sub-blocks/LayoutItem/utils.d.ts +29 -0
- package/build/esm/sub-blocks/LayoutItem/utils.js +6 -0
- package/build/esm/sub-blocks/Quote/Quote.js +2 -2
- package/build/esm/sub-blocks/Quote/schema.d.ts +0 -3
- package/build/esm/sub-blocks/Quote/schema.js +1 -3
- package/build/esm/sub-blocks/index.d.ts +1 -0
- package/build/esm/sub-blocks/index.js +1 -0
- package/build/esm/text-transform/blocks.js +17 -0
- package/build/esm/utils/hubspot.d.ts +2 -1
- package/build/esm/utils/hubspot.js +5 -1
- package/package.json +5 -2
- package/server/models/common.d.ts +3 -0
- package/server/models/constructor-items/blocks.d.ts +0 -10
- package/server/models/constructor-items/common.d.ts +6 -30
- package/server/models/constructor-items/sub-blocks.d.ts +18 -7
- package/server/models/constructor-items/sub-blocks.js +4 -0
- package/server/text-transform/blocks.js +17 -0
- package/server/utils/hubspot.d.ts +2 -1
- package/server/utils/hubspot.js +5 -1
- package/styles/root.scss +1 -0
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.css +0 -30
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.d.ts +0 -12
- package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.js +0 -28
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.css +0 -30
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.d.ts +0 -13
- package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbsItem.js +0 -25
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { block } from '../../utils';
|
|
4
|
+
import { FullScreenMedia, Media, MetaInfo } from '../../components';
|
|
5
|
+
import { getLayoutItemLinks, hasFullScreen, showFullScreenIcon } from './utils';
|
|
6
|
+
import { Content } from '..';
|
|
7
|
+
import './LayoutItem.css';
|
|
8
|
+
const b = block('layout-item');
|
|
9
|
+
const LayoutItem = (_a) => {
|
|
10
|
+
var _b = _a.content, { links } = _b, content = __rest(_b, ["links"]), { metaInfo, media, border, fullScreen, className } = _a;
|
|
11
|
+
return (React.createElement("div", { className: b(null, className) },
|
|
12
|
+
fullScreen && hasFullScreen(media) ? (React.createElement(FullScreenMedia, { showFullScreenIcon: showFullScreenIcon(media) }, (_a = {}) => {
|
|
13
|
+
var { className: mediaClassName } = _a, fullScreenMediaProps = __rest(_a, ["className"]);
|
|
14
|
+
return (React.createElement(Media, Object.assign({}, media, fullScreenMediaProps, { className: b('media', { border }, mediaClassName) })));
|
|
15
|
+
})) : (React.createElement(Media, Object.assign({}, media, { className: b('media', { border }) }))),
|
|
16
|
+
metaInfo && React.createElement(MetaInfo, { items: metaInfo, className: b('meta-info') }),
|
|
17
|
+
React.createElement("div", { className: b('content') },
|
|
18
|
+
React.createElement(Content, Object.assign({}, content, { links: getLayoutItemLinks(links), size: "s", colSizes: { all: 12, md: 12 } })))));
|
|
19
|
+
};
|
|
20
|
+
export default LayoutItem;
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
export declare const LayoutItem: {
|
|
2
|
+
type: string;
|
|
3
|
+
additionalProperties: boolean;
|
|
4
|
+
required: string[];
|
|
5
|
+
properties: {
|
|
6
|
+
media: {
|
|
7
|
+
color: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
image: {
|
|
11
|
+
anyOf: ({
|
|
12
|
+
oneOf: ({
|
|
13
|
+
type: string;
|
|
14
|
+
properties: {
|
|
15
|
+
when: {
|
|
16
|
+
type: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
} | {
|
|
20
|
+
type: string;
|
|
21
|
+
pattern: string;
|
|
22
|
+
})[];
|
|
23
|
+
} | {
|
|
24
|
+
type: string;
|
|
25
|
+
items: {
|
|
26
|
+
oneOf: ({
|
|
27
|
+
type: string;
|
|
28
|
+
properties: {
|
|
29
|
+
when: {
|
|
30
|
+
type: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
} | {
|
|
34
|
+
type: string;
|
|
35
|
+
pattern: string;
|
|
36
|
+
})[];
|
|
37
|
+
};
|
|
38
|
+
})[];
|
|
39
|
+
};
|
|
40
|
+
video: {
|
|
41
|
+
type: string;
|
|
42
|
+
additionalProperties: boolean;
|
|
43
|
+
required: string[];
|
|
44
|
+
properties: {
|
|
45
|
+
src: {
|
|
46
|
+
type: string;
|
|
47
|
+
items: {
|
|
48
|
+
type: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
loop: {
|
|
52
|
+
anyOf: ({
|
|
53
|
+
type: string;
|
|
54
|
+
additionalProperties: boolean;
|
|
55
|
+
required: string[];
|
|
56
|
+
properties: {
|
|
57
|
+
start: {
|
|
58
|
+
type: string;
|
|
59
|
+
};
|
|
60
|
+
end: {
|
|
61
|
+
type: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
} | {
|
|
65
|
+
type: string;
|
|
66
|
+
})[];
|
|
67
|
+
};
|
|
68
|
+
type: {
|
|
69
|
+
type: string;
|
|
70
|
+
enum: string[];
|
|
71
|
+
};
|
|
72
|
+
muted: {
|
|
73
|
+
type: string;
|
|
74
|
+
};
|
|
75
|
+
playing: {
|
|
76
|
+
type: string;
|
|
77
|
+
};
|
|
78
|
+
elapsedTime: {
|
|
79
|
+
type: string;
|
|
80
|
+
};
|
|
81
|
+
playIcon: {
|
|
82
|
+
type: string;
|
|
83
|
+
additionalProperties: boolean;
|
|
84
|
+
properties: {
|
|
85
|
+
type: {
|
|
86
|
+
type: string;
|
|
87
|
+
enum: string[];
|
|
88
|
+
};
|
|
89
|
+
theme: {
|
|
90
|
+
type: string;
|
|
91
|
+
enum: string[];
|
|
92
|
+
};
|
|
93
|
+
text: {
|
|
94
|
+
type: string;
|
|
95
|
+
contentType: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
controls: {
|
|
100
|
+
type: string;
|
|
101
|
+
enum: string[];
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
youtube: {
|
|
106
|
+
type: string;
|
|
107
|
+
};
|
|
108
|
+
parallax: {
|
|
109
|
+
type: string;
|
|
110
|
+
};
|
|
111
|
+
height: {
|
|
112
|
+
type: string;
|
|
113
|
+
};
|
|
114
|
+
previewImg: {
|
|
115
|
+
type: string;
|
|
116
|
+
};
|
|
117
|
+
dataLens: {
|
|
118
|
+
oneOf: ({
|
|
119
|
+
type: string;
|
|
120
|
+
additionalProperties: boolean;
|
|
121
|
+
required: string[];
|
|
122
|
+
properties: {
|
|
123
|
+
id: {
|
|
124
|
+
type: string;
|
|
125
|
+
};
|
|
126
|
+
theme: {
|
|
127
|
+
type: string;
|
|
128
|
+
enum: string[];
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
} | {
|
|
132
|
+
type: string;
|
|
133
|
+
})[];
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
content: Partial<{
|
|
137
|
+
title: {
|
|
138
|
+
oneOf: ({
|
|
139
|
+
type: string;
|
|
140
|
+
additionalProperties: boolean;
|
|
141
|
+
required: string[];
|
|
142
|
+
properties: {
|
|
143
|
+
text: {
|
|
144
|
+
type: string;
|
|
145
|
+
contentType: string;
|
|
146
|
+
};
|
|
147
|
+
textSize: {
|
|
148
|
+
type: string;
|
|
149
|
+
enum: string[];
|
|
150
|
+
};
|
|
151
|
+
url: {
|
|
152
|
+
type: string;
|
|
153
|
+
};
|
|
154
|
+
resetMargin: {
|
|
155
|
+
type: string;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
} | {
|
|
159
|
+
type: string;
|
|
160
|
+
contentType: string;
|
|
161
|
+
})[];
|
|
162
|
+
};
|
|
163
|
+
text: {
|
|
164
|
+
type: string;
|
|
165
|
+
contentType: string;
|
|
166
|
+
};
|
|
167
|
+
additionalInfo: {
|
|
168
|
+
type: string;
|
|
169
|
+
contentType: string;
|
|
170
|
+
};
|
|
171
|
+
size: {
|
|
172
|
+
type: string;
|
|
173
|
+
enum: string[];
|
|
174
|
+
};
|
|
175
|
+
links: {
|
|
176
|
+
type: string;
|
|
177
|
+
items: {
|
|
178
|
+
type: string;
|
|
179
|
+
properties: {
|
|
180
|
+
when: {
|
|
181
|
+
type: string;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
buttons: {
|
|
187
|
+
type: string;
|
|
188
|
+
items: {
|
|
189
|
+
type: string;
|
|
190
|
+
properties: {
|
|
191
|
+
when: {
|
|
192
|
+
type: string;
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
theme: {
|
|
198
|
+
type: string;
|
|
199
|
+
enum: string[];
|
|
200
|
+
};
|
|
201
|
+
}>;
|
|
202
|
+
metaInfo: {
|
|
203
|
+
type: string;
|
|
204
|
+
items: {
|
|
205
|
+
type: string;
|
|
206
|
+
contentType: string;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
border: {
|
|
210
|
+
type: string;
|
|
211
|
+
};
|
|
212
|
+
fullScreen: {
|
|
213
|
+
type: string;
|
|
214
|
+
};
|
|
215
|
+
type: {};
|
|
216
|
+
when: {};
|
|
217
|
+
};
|
|
218
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { omit } from 'lodash';
|
|
2
|
+
import { BaseProps, MediaProps } from '../../schema/validators/common';
|
|
3
|
+
import { ContentBase } from '../../sub-blocks/Content/schema';
|
|
4
|
+
import metaInfo from '../../components/MetaInfo/schema';
|
|
5
|
+
export const LayoutItem = {
|
|
6
|
+
type: 'object',
|
|
7
|
+
additionalProperties: false,
|
|
8
|
+
required: ['content', 'media'],
|
|
9
|
+
properties: Object.assign(Object.assign({}, BaseProps), { media: MediaProps, content: omit(ContentBase, ['colSize', 'size', 'centered']), metaInfo: metaInfo, border: {
|
|
10
|
+
type: 'boolean',
|
|
11
|
+
}, fullScreen: {
|
|
12
|
+
type: 'boolean',
|
|
13
|
+
} }),
|
|
14
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { LayoutItemProps, LinkTheme, MediaProps } from '../../models';
|
|
2
|
+
export declare const getLayoutItemLinks: (links: LayoutItemProps['content']['links']) => {
|
|
3
|
+
url: string;
|
|
4
|
+
text?: string | undefined;
|
|
5
|
+
textSize?: import("../../models").TextSize | undefined;
|
|
6
|
+
theme: LinkTheme;
|
|
7
|
+
colorTheme?: import("../../models").TextTheme | undefined;
|
|
8
|
+
arrow?: boolean | undefined;
|
|
9
|
+
target?: string | undefined;
|
|
10
|
+
metrikaGoals?: import("../../models").MetrikaGoal | undefined;
|
|
11
|
+
pixelEvents?: import("../../models").ButtonPixel | undefined;
|
|
12
|
+
context?: string | undefined;
|
|
13
|
+
analyticsEvents?: {
|
|
14
|
+
name: string;
|
|
15
|
+
type?: string | undefined;
|
|
16
|
+
counters?: import("../../models").AnalyticsCounters | undefined;
|
|
17
|
+
context?: string | undefined;
|
|
18
|
+
target?: string | undefined;
|
|
19
|
+
} | {
|
|
20
|
+
name: string;
|
|
21
|
+
type?: string | undefined;
|
|
22
|
+
counters?: import("../../models").AnalyticsCounters | undefined;
|
|
23
|
+
context?: string | undefined;
|
|
24
|
+
target?: string | undefined;
|
|
25
|
+
}[] | undefined;
|
|
26
|
+
className?: string | undefined;
|
|
27
|
+
}[] | undefined;
|
|
28
|
+
export declare const hasFullScreen: ({ dataLens, image }: MediaProps) => boolean;
|
|
29
|
+
export declare const showFullScreenIcon: ({ youtube }: MediaProps) => boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const getLayoutItemLinks = (links) => links === null || links === void 0 ? void 0 : links.map((link) => (Object.assign({ theme: 'normal' }, link)));
|
|
2
|
+
export const hasFullScreen = ({ dataLens, image }) => {
|
|
3
|
+
// datalens and slider media card don't support fullScreen mode
|
|
4
|
+
return !(dataLens || Array.isArray(image));
|
|
5
|
+
};
|
|
6
|
+
export const showFullScreenIcon = ({ youtube }) => !youtube;
|
|
@@ -4,17 +4,17 @@ import { block, getThemedValue } from '../../utils';
|
|
|
4
4
|
import { AuthorType, PredefinedEventTypes } from '../../models';
|
|
5
5
|
import { Author, Image, HTML } from '../../components';
|
|
6
6
|
import { ThemeValueContext } from '../../context/theme/ThemeValueContext';
|
|
7
|
+
import { BlockPositionContext } from '../../context/blockPositionContext';
|
|
7
8
|
import { getMediaImage } from '../../components/Media/Image/utils';
|
|
8
9
|
import { useAnalytics } from '../../hooks';
|
|
9
|
-
import { BlockPositionContext } from '../../context/blockPositionContext';
|
|
10
10
|
import './Quote.css';
|
|
11
11
|
const b = block('quote');
|
|
12
12
|
const Quote = (props) => {
|
|
13
13
|
const { theme: textTheme = 'light', color, image, border = 'shadow', text, logo, author, url, buttonText, } = props;
|
|
14
14
|
const { themeValue: theme } = useContext(ThemeValueContext);
|
|
15
|
+
const context = useContext(BlockPositionContext);
|
|
15
16
|
const imageThemed = getThemedValue(image, theme);
|
|
16
17
|
const imageData = getMediaImage(imageThemed);
|
|
17
|
-
const context = useContext(BlockPositionContext);
|
|
18
18
|
const defaultEvent = useMemo(() => ({
|
|
19
19
|
name: 'quote-button-click',
|
|
20
20
|
type: PredefinedEventTypes.Default,
|
|
@@ -7,6 +7,7 @@ export { default as MediaCard } from './MediaCard/MediaCard';
|
|
|
7
7
|
export { default as BannerCard } from './BannerCard/BannerCard';
|
|
8
8
|
export { default as TutorialCard } from './TutorialCard/TutorialCard';
|
|
9
9
|
export { default as CardWithImage } from './CardWithImage/CardWithImage';
|
|
10
|
+
export { default as LayoutItem } from './LayoutItem/LayoutItem';
|
|
10
11
|
export { default as BackgroundCard } from './BackgroundCard/BackgroundCard';
|
|
11
12
|
export { default as BasicCard } from './BasicCard/BasicCard';
|
|
12
13
|
export { default as Content } from './Content/Content';
|
|
@@ -7,6 +7,7 @@ export { default as MediaCard } from './MediaCard/MediaCard';
|
|
|
7
7
|
export { default as BannerCard } from './BannerCard/BannerCard';
|
|
8
8
|
export { default as TutorialCard } from './TutorialCard/TutorialCard';
|
|
9
9
|
export { default as CardWithImage } from './CardWithImage/CardWithImage';
|
|
10
|
+
export { default as LayoutItem } from './LayoutItem/LayoutItem';
|
|
10
11
|
export { default as BackgroundCard } from './BackgroundCard/BackgroundCard';
|
|
11
12
|
export { default as BasicCard } from './BasicCard/BasicCard';
|
|
12
13
|
export { default as Content } from './Content/Content';
|
|
@@ -138,6 +138,23 @@ const config = {
|
|
|
138
138
|
transformer: typografTransformer,
|
|
139
139
|
},
|
|
140
140
|
],
|
|
141
|
+
[SubBlockType.LayoutItem]: [
|
|
142
|
+
{
|
|
143
|
+
fields: ['content'],
|
|
144
|
+
parser: parseContentLayout,
|
|
145
|
+
transformer: yfmTransformer,
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
fields: ['content'],
|
|
149
|
+
parser: parseContentLayoutTitle,
|
|
150
|
+
transformer: typografTransformer,
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
fields: ['metaInfo'],
|
|
154
|
+
parser: createItemsParser([]),
|
|
155
|
+
transformer: typografTransformer,
|
|
156
|
+
},
|
|
157
|
+
],
|
|
141
158
|
[SubBlockType.Quote]: {
|
|
142
159
|
fields: ['text'],
|
|
143
160
|
transformer: typografTransformer,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type HubspotEventName = 'onBeforeFormInit' | 'onFormReady' | 'onFormSubmit' | 'onFormSubmitted' | `_${string}`;
|
|
1
|
+
export type HubspotEventName = 'onBeforeFormInit' | 'onFormReady' | 'onFormSubmit' | 'onFormSubmitted' | 'onFormError' | `_${string}`;
|
|
2
2
|
export interface HubspotEventData {
|
|
3
3
|
type: HubspotEventName | string;
|
|
4
4
|
eventName: HubspotEventName;
|
|
@@ -11,6 +11,7 @@ export interface HubspotEventHandlers {
|
|
|
11
11
|
onBeforeSubmit?: (arg: HubspotEventData) => void;
|
|
12
12
|
onSubmit?: (arg: HubspotEventData) => void;
|
|
13
13
|
onLoad?: (arg: HubspotEventData) => void;
|
|
14
|
+
onSubmitError?: (arg: HubspotEventData) => void;
|
|
14
15
|
}
|
|
15
16
|
export declare function loopBackHabspotEvents(formId: string): ({ data, source, origin }: MessageEvent) => void;
|
|
16
17
|
export declare function handleHubspotEvents(handlers: HubspotEventHandlers, formId: string): ({ data }: MessageEvent) => void;
|
|
@@ -20,7 +20,7 @@ export function loopBackHabspotEvents(formId) {
|
|
|
20
20
|
}
|
|
21
21
|
export function handleHubspotEvents(handlers, formId) {
|
|
22
22
|
return ({ data }) => {
|
|
23
|
-
var _a, _b, _c, _d;
|
|
23
|
+
var _a, _b, _c, _d, _e;
|
|
24
24
|
if (!isHubspotEventData(data)) {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
@@ -44,6 +44,10 @@ export function handleHubspotEvents(handlers, formId) {
|
|
|
44
44
|
(_d = handlers.onSubmit) === null || _d === void 0 ? void 0 : _d.call(handlers, data);
|
|
45
45
|
break;
|
|
46
46
|
}
|
|
47
|
+
case 'onFormError': {
|
|
48
|
+
(_e = handlers.onSubmitError) === null || _e === void 0 ? void 0 : _e.call(handlers, data);
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
47
51
|
default:
|
|
48
52
|
break;
|
|
49
53
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/page-constructor",
|
|
3
|
-
"version": "1.15.0-alpha.
|
|
3
|
+
"version": "1.15.0-alpha.23",
|
|
4
4
|
"description": "Gravity UI Page Constructor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -56,7 +56,8 @@
|
|
|
56
56
|
"react-waypoint": "^10.1.0",
|
|
57
57
|
"sanitize-html": "^2.6.1",
|
|
58
58
|
"snakecase-keys": "^5.1.0",
|
|
59
|
-
"typograf": "^6.14.0"
|
|
59
|
+
"typograf": "^6.14.0",
|
|
60
|
+
"uuid": "^9.0.0"
|
|
60
61
|
},
|
|
61
62
|
"peerDependencies": {
|
|
62
63
|
"react": "^16.0.0 || ^17.0.0",
|
|
@@ -87,6 +88,8 @@
|
|
|
87
88
|
"@types/react-slick": "^0.23.7",
|
|
88
89
|
"@types/react-transition-group": "^4.4.4",
|
|
89
90
|
"@types/sanitize-html": "^2.6.0",
|
|
91
|
+
"@types/uuid": "^9.0.0",
|
|
92
|
+
"es5-ext": "0.10.53",
|
|
90
93
|
"eslint": "^7.32.0",
|
|
91
94
|
"eslint-plugin-local": "./eslint-plugin-local",
|
|
92
95
|
"eslint-plugin-testing-library": "^5.9.1",
|
|
@@ -109,7 +109,6 @@ export interface HeaderBlockProps {
|
|
|
109
109
|
verticalOffset?: 's' | 'm' | 'l' | 'xl';
|
|
110
110
|
breadcrumbs?: HeaderBreadCrumbsProps;
|
|
111
111
|
status?: JSX.Element;
|
|
112
|
-
context?: string;
|
|
113
112
|
}
|
|
114
113
|
export type CalculatorProps = Animatable;
|
|
115
114
|
export interface SimpleBlockProps extends Animatable, Childable {
|
|
@@ -128,7 +127,6 @@ export interface ExtendedFeaturesProps extends Animatable {
|
|
|
128
127
|
title?: TitleProps | string;
|
|
129
128
|
description?: string;
|
|
130
129
|
colSizes?: GridColumnSizesType;
|
|
131
|
-
context?: string;
|
|
132
130
|
}
|
|
133
131
|
export interface PromoFeaturesItem {
|
|
134
132
|
title: string;
|
|
@@ -141,7 +139,6 @@ export interface PromoFeaturesProps extends Animatable {
|
|
|
141
139
|
title?: TitleProps | string;
|
|
142
140
|
description?: string;
|
|
143
141
|
theme?: 'grey' | 'default';
|
|
144
|
-
context?: string;
|
|
145
142
|
}
|
|
146
143
|
export interface QuestionItem {
|
|
147
144
|
title: string;
|
|
@@ -166,7 +163,6 @@ export interface MediaContentProps {
|
|
|
166
163
|
links?: LinkProps[];
|
|
167
164
|
buttons?: ButtonProps[];
|
|
168
165
|
size?: ContentSize;
|
|
169
|
-
context?: string;
|
|
170
166
|
}
|
|
171
167
|
export interface MediaBlockProps extends Animatable, MediaContentProps {
|
|
172
168
|
media: ThemeSupporting<MediaProps>;
|
|
@@ -184,7 +180,6 @@ export interface PreviewBlockProps extends Animatable {
|
|
|
184
180
|
ratioMediaContent?: PreviewRatioMediaContent;
|
|
185
181
|
stopVideo?: boolean;
|
|
186
182
|
showImmediately?: boolean;
|
|
187
|
-
context?: string;
|
|
188
183
|
}
|
|
189
184
|
export interface InfoBlockProps {
|
|
190
185
|
theme?: TextTheme;
|
|
@@ -199,7 +194,6 @@ export interface InfoBlockProps {
|
|
|
199
194
|
links?: Pick<LinkProps, 'text' | 'url'>[];
|
|
200
195
|
leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;
|
|
201
196
|
rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;
|
|
202
|
-
context?: string;
|
|
203
197
|
}
|
|
204
198
|
export interface SecurityBlockPoint {
|
|
205
199
|
img: string;
|
|
@@ -215,7 +209,6 @@ export interface SecurityBlockProps extends Animatable {
|
|
|
215
209
|
title: string;
|
|
216
210
|
points?: SecurityBlockPoint[];
|
|
217
211
|
media: MediaProps;
|
|
218
|
-
context?: string;
|
|
219
212
|
}
|
|
220
213
|
export interface TableProps {
|
|
221
214
|
content: string[][];
|
|
@@ -242,7 +235,6 @@ export interface TabsBlockProps extends BlockHeaderProps, Animatable {
|
|
|
242
235
|
centered?: boolean;
|
|
243
236
|
direction?: MediaDirection;
|
|
244
237
|
items: TabsBlockItem[];
|
|
245
|
-
context?: string;
|
|
246
238
|
}
|
|
247
239
|
export interface LinkTableBlockProps extends BlockHeaderProps {
|
|
248
240
|
items: LinkProps[][];
|
|
@@ -272,7 +264,6 @@ export interface ContentLayoutBlockProps {
|
|
|
272
264
|
};
|
|
273
265
|
textContent: ContentBlockProps;
|
|
274
266
|
fileContent?: FileLinkProps[];
|
|
275
|
-
context?: string;
|
|
276
267
|
}
|
|
277
268
|
export interface ContentBlockProps {
|
|
278
269
|
title?: TitleBaseProps | string;
|
|
@@ -284,7 +275,6 @@ export interface ContentBlockProps {
|
|
|
284
275
|
colSizes?: GridColumnSizesType;
|
|
285
276
|
centered?: boolean;
|
|
286
277
|
theme?: ContentTheme;
|
|
287
|
-
context?: string;
|
|
288
278
|
}
|
|
289
279
|
export declare enum PCShareSocialNetwork {
|
|
290
280
|
Vk = "vk",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { ButtonSize, ButtonView } from '@gravity-ui/uikit';
|
|
3
3
|
import { ThemeSupporting } from '../../utils/theme';
|
|
4
|
-
import {
|
|
4
|
+
import { AnalyticsEventsBase, ClassNameProps, PixelEventType } from '../common';
|
|
5
5
|
export declare enum AuthorType {
|
|
6
6
|
Column = "column",
|
|
7
7
|
Line = "line"
|
|
@@ -100,7 +100,7 @@ export interface BackgroundImageProps extends React.HTMLProps<HTMLDivElement>, P
|
|
|
100
100
|
imageClassName?: string;
|
|
101
101
|
hide?: boolean;
|
|
102
102
|
}
|
|
103
|
-
export interface MediaVideoProps {
|
|
103
|
+
export interface MediaVideoProps extends AnalyticsEventsBase {
|
|
104
104
|
src: string[];
|
|
105
105
|
type?: MediaVideoType;
|
|
106
106
|
loop?: LoopProps | boolean;
|
|
@@ -110,10 +110,8 @@ export interface MediaVideoProps {
|
|
|
110
110
|
playButton?: PlayButtonProps;
|
|
111
111
|
controls?: MediaVideoControlsType;
|
|
112
112
|
metrika?: MetrikaVideo;
|
|
113
|
-
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
114
|
-
context?: string;
|
|
115
113
|
}
|
|
116
|
-
export interface LinkProps extends Stylable {
|
|
114
|
+
export interface LinkProps extends AnalyticsEventsBase, Stylable {
|
|
117
115
|
url: string;
|
|
118
116
|
text?: string;
|
|
119
117
|
textSize?: TextSize;
|
|
@@ -123,7 +121,6 @@ export interface LinkProps extends Stylable {
|
|
|
123
121
|
target?: string;
|
|
124
122
|
metrikaGoals?: MetrikaGoal;
|
|
125
123
|
pixelEvents?: ButtonPixel;
|
|
126
|
-
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
127
124
|
context?: string;
|
|
128
125
|
}
|
|
129
126
|
export interface FileLinkProps extends ClassNameProps {
|
|
@@ -134,7 +131,7 @@ export interface FileLinkProps extends ClassNameProps {
|
|
|
134
131
|
theme?: ContentTheme;
|
|
135
132
|
onClick?: () => void;
|
|
136
133
|
}
|
|
137
|
-
export interface ButtonProps {
|
|
134
|
+
export interface ButtonProps extends AnalyticsEventsBase {
|
|
138
135
|
text: string;
|
|
139
136
|
url: string;
|
|
140
137
|
primary?: boolean;
|
|
@@ -143,7 +140,6 @@ export interface ButtonProps {
|
|
|
143
140
|
img?: ButtonImageProps | string;
|
|
144
141
|
metrikaGoals?: MetrikaGoal;
|
|
145
142
|
pixelEvents?: ButtonPixel;
|
|
146
|
-
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
147
143
|
target?: string;
|
|
148
144
|
context?: string;
|
|
149
145
|
}
|
|
@@ -169,17 +165,16 @@ export interface MediaVideoProps {
|
|
|
169
165
|
metrika?: MetrikaVideo;
|
|
170
166
|
}
|
|
171
167
|
export type ThemedMediaVideoProps = ThemeSupporting<MediaVideoProps>;
|
|
172
|
-
export interface MediaComponentVideoProps {
|
|
168
|
+
export interface MediaComponentVideoProps extends AnalyticsEventsBase {
|
|
173
169
|
video: MediaVideoProps;
|
|
174
170
|
height?: number;
|
|
175
171
|
metrika?: MetrikaVideo;
|
|
176
|
-
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
177
|
-
context?: string;
|
|
178
172
|
previewImg?: string;
|
|
179
173
|
}
|
|
180
174
|
export interface MediaComponentYoutubeProps {
|
|
181
175
|
youtube: string;
|
|
182
176
|
previewImg?: string;
|
|
177
|
+
fullScreen?: boolean;
|
|
183
178
|
}
|
|
184
179
|
export interface MediaComponentImageProps {
|
|
185
180
|
image: ImageProps | ImageProps[] | ImageDeviceProps;
|
|
@@ -226,12 +221,10 @@ export interface HeaderBreadCrumbsProps extends ClassNameProps {
|
|
|
226
221
|
items: {
|
|
227
222
|
url: string;
|
|
228
223
|
text: ReactNode;
|
|
229
|
-
analyticsEvents?: AnalyticsEvent | AnalyticsEvent[];
|
|
230
224
|
}[];
|
|
231
225
|
theme?: TextTheme;
|
|
232
226
|
metrikaGoals?: MetrikaGoal;
|
|
233
227
|
pixelEvents?: ButtonPixel;
|
|
234
|
-
context?: string;
|
|
235
228
|
}
|
|
236
229
|
export interface PreviewContentItemProps {
|
|
237
230
|
title: string;
|
|
@@ -253,27 +246,10 @@ export interface TitleBaseProps {
|
|
|
253
246
|
custom?: string | ReactNode;
|
|
254
247
|
onClick?: () => void;
|
|
255
248
|
}
|
|
256
|
-
export interface CardData {
|
|
257
|
-
header?: CardHeader;
|
|
258
|
-
text?: string;
|
|
259
|
-
title?: string;
|
|
260
|
-
link?: LinkProps;
|
|
261
|
-
footer?: string;
|
|
262
|
-
url?: string;
|
|
263
|
-
service?: {
|
|
264
|
-
slug: string;
|
|
265
|
-
name: string;
|
|
266
|
-
};
|
|
267
|
-
links?: LinkProps[];
|
|
268
|
-
}
|
|
269
249
|
export type CardBorder = 'shadow' | 'line' | 'none';
|
|
270
250
|
export interface CardBaseProps {
|
|
271
251
|
border?: CardBorder;
|
|
272
252
|
}
|
|
273
|
-
export interface CardHeader {
|
|
274
|
-
title?: string;
|
|
275
|
-
image?: ImageProps;
|
|
276
|
-
}
|
|
277
253
|
export interface PriceDescriptionProps {
|
|
278
254
|
title: string;
|
|
279
255
|
detailedTitle?: string;
|