@gravity-ui/page-constructor 1.2.3-alpha.2 → 1.2.3-alpha.4
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/build/cjs/blocks/Header/Header.css +11 -7
- package/build/cjs/blocks/Header/Header.js +14 -19
- package/build/cjs/blocks/Header/schema.d.ts +196 -244
- package/build/cjs/blocks/Header/schema.js +1 -22
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +98 -122
- package/build/cjs/components/BackgroundMedia/BackgroundMedia.css +2 -0
- package/build/cjs/components/BackgroundMedia/BackgroundMedia.js +2 -2
- package/build/cjs/models/constructor-items/blocks.d.ts +2 -2
- package/build/cjs/models/guards.d.ts +2 -3
- package/build/cjs/models/guards.js +1 -5
- package/build/esm/blocks/Header/Header.css +11 -7
- package/build/esm/blocks/Header/Header.js +15 -20
- package/build/esm/blocks/Header/schema.d.ts +196 -244
- package/build/esm/blocks/Header/schema.js +1 -22
- package/build/esm/blocks/HeaderSlider/schema.d.ts +98 -122
- package/build/esm/components/BackgroundMedia/BackgroundMedia.css +2 -0
- package/build/esm/components/BackgroundMedia/BackgroundMedia.js +2 -2
- package/build/esm/models/constructor-items/blocks.d.ts +2 -2
- package/build/esm/models/guards.d.ts +2 -3
- package/build/esm/models/guards.js +0 -3
- package/package.json +1 -1
- package/server/models/constructor-items/blocks.d.ts +2 -2
- package/server/models/guards.d.ts +2 -3
- package/server/models/guards.js +1 -5
|
@@ -151,163 +151,139 @@ export declare const HeaderSliderBlock: {
|
|
|
151
151
|
};
|
|
152
152
|
background: {
|
|
153
153
|
oneOf: ({
|
|
154
|
-
|
|
154
|
+
fullWidth: {
|
|
155
155
|
type: string;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
anyOf: ({
|
|
167
|
-
oneOf: ({
|
|
168
|
-
type: string;
|
|
169
|
-
properties: {
|
|
170
|
-
when: {
|
|
171
|
-
type: string;
|
|
172
|
-
};
|
|
173
|
-
};
|
|
174
|
-
} | {
|
|
175
|
-
type: string;
|
|
176
|
-
pattern: string;
|
|
177
|
-
})[];
|
|
178
|
-
} | {
|
|
179
|
-
type: string;
|
|
180
|
-
items: {
|
|
181
|
-
oneOf: ({
|
|
182
|
-
type: string;
|
|
183
|
-
properties: {
|
|
184
|
-
when: {
|
|
185
|
-
type: string;
|
|
186
|
-
};
|
|
187
|
-
};
|
|
188
|
-
} | {
|
|
189
|
-
type: string;
|
|
190
|
-
pattern: string;
|
|
191
|
-
})[];
|
|
192
|
-
};
|
|
193
|
-
})[];
|
|
194
|
-
};
|
|
195
|
-
video: {
|
|
156
|
+
};
|
|
157
|
+
fullWidthMedia: {
|
|
158
|
+
type: string;
|
|
159
|
+
};
|
|
160
|
+
color: {
|
|
161
|
+
type: string;
|
|
162
|
+
};
|
|
163
|
+
image: {
|
|
164
|
+
anyOf: ({
|
|
165
|
+
oneOf: ({
|
|
196
166
|
type: string;
|
|
197
|
-
additionalProperties: boolean;
|
|
198
|
-
required: string[];
|
|
199
167
|
properties: {
|
|
200
|
-
|
|
168
|
+
when: {
|
|
201
169
|
type: string;
|
|
202
|
-
items: {
|
|
203
|
-
type: string;
|
|
204
|
-
};
|
|
205
170
|
};
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
};
|
|
219
|
-
} | {
|
|
171
|
+
};
|
|
172
|
+
} | {
|
|
173
|
+
type: string;
|
|
174
|
+
pattern: string;
|
|
175
|
+
})[];
|
|
176
|
+
} | {
|
|
177
|
+
type: string;
|
|
178
|
+
items: {
|
|
179
|
+
oneOf: ({
|
|
180
|
+
type: string;
|
|
181
|
+
properties: {
|
|
182
|
+
when: {
|
|
220
183
|
type: string;
|
|
221
|
-
})[];
|
|
222
|
-
};
|
|
223
|
-
type: {
|
|
224
|
-
type: string;
|
|
225
|
-
enum: string[];
|
|
226
|
-
};
|
|
227
|
-
muted: {
|
|
228
|
-
type: string;
|
|
229
|
-
};
|
|
230
|
-
playing: {
|
|
231
|
-
type: string;
|
|
232
|
-
};
|
|
233
|
-
elapsedTime: {
|
|
234
|
-
type: string;
|
|
235
|
-
};
|
|
236
|
-
playIcon: {
|
|
237
|
-
type: string;
|
|
238
|
-
additionalProperties: boolean;
|
|
239
|
-
properties: {
|
|
240
|
-
type: {
|
|
241
|
-
type: string;
|
|
242
|
-
enum: string[];
|
|
243
|
-
};
|
|
244
|
-
theme: {
|
|
245
|
-
type: string;
|
|
246
|
-
enum: string[];
|
|
247
|
-
};
|
|
248
|
-
text: {
|
|
249
|
-
type: string;
|
|
250
|
-
};
|
|
251
184
|
};
|
|
252
185
|
};
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
};
|
|
258
|
-
};
|
|
259
|
-
youtube: {
|
|
260
|
-
type: string;
|
|
261
|
-
};
|
|
262
|
-
parallax: {
|
|
263
|
-
type: string;
|
|
264
|
-
};
|
|
265
|
-
height: {
|
|
266
|
-
type: string;
|
|
186
|
+
} | {
|
|
187
|
+
type: string;
|
|
188
|
+
pattern: string;
|
|
189
|
+
})[];
|
|
267
190
|
};
|
|
268
|
-
|
|
191
|
+
})[];
|
|
192
|
+
};
|
|
193
|
+
video: {
|
|
194
|
+
type: string;
|
|
195
|
+
additionalProperties: boolean;
|
|
196
|
+
required: string[];
|
|
197
|
+
properties: {
|
|
198
|
+
src: {
|
|
269
199
|
type: string;
|
|
200
|
+
items: {
|
|
201
|
+
type: string;
|
|
202
|
+
};
|
|
270
203
|
};
|
|
271
|
-
|
|
272
|
-
|
|
204
|
+
loop: {
|
|
205
|
+
anyOf: ({
|
|
273
206
|
type: string;
|
|
274
207
|
additionalProperties: boolean;
|
|
275
208
|
required: string[];
|
|
276
209
|
properties: {
|
|
277
|
-
|
|
210
|
+
start: {
|
|
278
211
|
type: string;
|
|
279
212
|
};
|
|
280
|
-
|
|
213
|
+
end: {
|
|
281
214
|
type: string;
|
|
282
|
-
enum: string[];
|
|
283
215
|
};
|
|
284
216
|
};
|
|
285
217
|
} | {
|
|
286
218
|
type: string;
|
|
287
219
|
})[];
|
|
288
220
|
};
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
color: {
|
|
221
|
+
type: {
|
|
222
|
+
type: string;
|
|
223
|
+
enum: string[];
|
|
224
|
+
};
|
|
225
|
+
muted: {
|
|
295
226
|
type: string;
|
|
296
227
|
};
|
|
297
|
-
|
|
228
|
+
playing: {
|
|
298
229
|
type: string;
|
|
299
230
|
};
|
|
300
|
-
|
|
231
|
+
elapsedTime: {
|
|
301
232
|
type: string;
|
|
302
233
|
};
|
|
303
|
-
|
|
234
|
+
playIcon: {
|
|
304
235
|
type: string;
|
|
236
|
+
additionalProperties: boolean;
|
|
237
|
+
properties: {
|
|
238
|
+
type: {
|
|
239
|
+
type: string;
|
|
240
|
+
enum: string[];
|
|
241
|
+
};
|
|
242
|
+
theme: {
|
|
243
|
+
type: string;
|
|
244
|
+
enum: string[];
|
|
245
|
+
};
|
|
246
|
+
text: {
|
|
247
|
+
type: string;
|
|
248
|
+
};
|
|
249
|
+
};
|
|
305
250
|
};
|
|
306
|
-
|
|
251
|
+
controls: {
|
|
307
252
|
type: string;
|
|
253
|
+
enum: string[];
|
|
308
254
|
};
|
|
309
255
|
};
|
|
310
|
-
}
|
|
256
|
+
};
|
|
257
|
+
youtube: {
|
|
258
|
+
type: string;
|
|
259
|
+
};
|
|
260
|
+
parallax: {
|
|
261
|
+
type: string;
|
|
262
|
+
};
|
|
263
|
+
height: {
|
|
264
|
+
type: string;
|
|
265
|
+
};
|
|
266
|
+
previewImg: {
|
|
267
|
+
type: string;
|
|
268
|
+
};
|
|
269
|
+
dataLens: {
|
|
270
|
+
oneOf: ({
|
|
271
|
+
type: string;
|
|
272
|
+
additionalProperties: boolean;
|
|
273
|
+
required: string[];
|
|
274
|
+
properties: {
|
|
275
|
+
id: {
|
|
276
|
+
type: string;
|
|
277
|
+
};
|
|
278
|
+
theme: {
|
|
279
|
+
type: string;
|
|
280
|
+
enum: string[];
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
} | {
|
|
284
|
+
type: string;
|
|
285
|
+
})[];
|
|
286
|
+
};
|
|
311
287
|
} | {
|
|
312
288
|
type: string;
|
|
313
289
|
additionalProperties: boolean;
|
|
@@ -10,6 +10,7 @@ unpredictable css rules order in build */
|
|
|
10
10
|
margin: 0 auto;
|
|
11
11
|
max-width: 1440px;
|
|
12
12
|
text-align: center;
|
|
13
|
+
height: 100%;
|
|
13
14
|
}
|
|
14
15
|
.pc-BackgroundMedia__image {
|
|
15
16
|
height: 100%;
|
|
@@ -17,6 +18,7 @@ unpredictable css rules order in build */
|
|
|
17
18
|
}
|
|
18
19
|
.pc-BackgroundMedia__video {
|
|
19
20
|
position: relative;
|
|
21
|
+
height: 100%;
|
|
20
22
|
}
|
|
21
23
|
.pc-BackgroundMedia__video video {
|
|
22
24
|
position: absolute;
|
|
@@ -10,7 +10,7 @@ const BackgroundMedia = (_a) => {
|
|
|
10
10
|
var { className, color, animated, parallax = true, video, mediaClassName } = _a, props = __rest(_a, ["className", "color", "animated", "parallax", "video", "mediaClassName"]);
|
|
11
11
|
const isMobile = useContext(MobileContext);
|
|
12
12
|
return (React.createElement(AnimateBlock, { className: b(null, className), style: { backgroundColor: color }, animate: animated },
|
|
13
|
-
React.createElement(Media, Object.assign({ className: b('media', mediaClassName), imageClassName: b('image'), videoClassName: b('video'), isBackground: true }, Object.assign({ height: 720, color,
|
|
14
|
-
parallax, video: isMobile ? undefined : video }
|
|
13
|
+
React.createElement(Media, Object.assign({ className: b('media', mediaClassName), imageClassName: b('image'), videoClassName: b('video'), isBackground: true }, Object.assign(Object.assign({}, props), { height: 720, color,
|
|
14
|
+
parallax, video: isMobile ? undefined : video })))));
|
|
15
15
|
};
|
|
16
16
|
export default BackgroundMedia;
|
|
@@ -78,9 +78,9 @@ export interface HeaderSliderBlockProps extends Omit<SliderProps, 'title' | 'des
|
|
|
78
78
|
items: HeaderBlockProps[];
|
|
79
79
|
}
|
|
80
80
|
interface HeaderBackgroundProps {
|
|
81
|
-
|
|
81
|
+
/** @deprecated replaced by Media Props image */
|
|
82
82
|
url?: ImageProps;
|
|
83
|
-
/** @deprecated
|
|
83
|
+
/** @deprecated replaced by Media Props image */
|
|
84
84
|
disableCompress?: boolean;
|
|
85
85
|
}
|
|
86
86
|
export interface HeaderBlockBackground extends Partial<HeaderBackgroundProps>, Partial<MediaProps> {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Block, ConstructorItem
|
|
2
|
-
import {
|
|
1
|
+
import { Block, ConstructorItem } from './';
|
|
2
|
+
import { MetrikaGoal, NewMetrikaGoal } from './index';
|
|
3
3
|
export declare function isBlock(block: ConstructorItem): block is Block;
|
|
4
4
|
export declare function isNewMetrikaFormat(metrika: MetrikaGoal): metrika is NewMetrikaGoal[];
|
|
5
|
-
export declare function headerHasMediaBackground(background: HeaderBlockBackground): background is MediaProps;
|
|
@@ -5,6 +5,3 @@ export function isBlock(block) {
|
|
|
5
5
|
export function isNewMetrikaFormat(metrika) {
|
|
6
6
|
return Boolean(Array.isArray(metrika) && metrika.length && typeof metrika[0] === 'object');
|
|
7
7
|
}
|
|
8
|
-
export function headerHasMediaBackground(background) {
|
|
9
|
-
return 'image' in background || 'video' in background || 'youtube' in background;
|
|
10
|
-
}
|
package/package.json
CHANGED
|
@@ -78,9 +78,9 @@ export interface HeaderSliderBlockProps extends Omit<SliderProps, 'title' | 'des
|
|
|
78
78
|
items: HeaderBlockProps[];
|
|
79
79
|
}
|
|
80
80
|
interface HeaderBackgroundProps {
|
|
81
|
-
|
|
81
|
+
/** @deprecated replaced by Media Props image */
|
|
82
82
|
url?: ImageProps;
|
|
83
|
-
/** @deprecated
|
|
83
|
+
/** @deprecated replaced by Media Props image */
|
|
84
84
|
disableCompress?: boolean;
|
|
85
85
|
}
|
|
86
86
|
export interface HeaderBlockBackground extends Partial<HeaderBackgroundProps>, Partial<MediaProps> {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Block, ConstructorItem
|
|
2
|
-
import {
|
|
1
|
+
import { Block, ConstructorItem } from './';
|
|
2
|
+
import { MetrikaGoal, NewMetrikaGoal } from './index';
|
|
3
3
|
export declare function isBlock(block: ConstructorItem): block is Block;
|
|
4
4
|
export declare function isNewMetrikaFormat(metrika: MetrikaGoal): metrika is NewMetrikaGoal[];
|
|
5
|
-
export declare function headerHasMediaBackground(background: HeaderBlockBackground): background is MediaProps;
|
package/server/models/guards.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isNewMetrikaFormat = exports.isBlock = void 0;
|
|
4
4
|
const _1 = require("./");
|
|
5
5
|
function isBlock(block) {
|
|
6
6
|
return block.type in _1.BlockTypes;
|
|
@@ -10,7 +10,3 @@ function isNewMetrikaFormat(metrika) {
|
|
|
10
10
|
return Boolean(Array.isArray(metrika) && metrika.length && typeof metrika[0] === 'object');
|
|
11
11
|
}
|
|
12
12
|
exports.isNewMetrikaFormat = isNewMetrikaFormat;
|
|
13
|
-
function headerHasMediaBackground(background) {
|
|
14
|
-
return 'image' in background || 'video' in background || 'youtube' in background;
|
|
15
|
-
}
|
|
16
|
-
exports.headerHasMediaBackground = headerHasMediaBackground;
|