@doyourjob/gravity-ui-page-constructor 5.31.286 → 5.31.287

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 (32) hide show
  1. package/build/cjs/blocks/Header/schema.d.ts +81 -3
  2. package/build/cjs/blocks/HeaderSlider/schema.d.ts +27 -1
  3. package/build/cjs/blocks/Media/schema.d.ts +54 -2
  4. package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +27 -1
  5. package/build/cjs/blocks/Tabs/schema.d.ts +27 -1
  6. package/build/cjs/components/Media/Iframe/Iframe.js +18 -4
  7. package/build/cjs/components/Media/Iframe/utils.d.ts +2 -0
  8. package/build/cjs/components/Media/Iframe/utils.js +29 -0
  9. package/build/cjs/models/constructor-items/common.d.ts +2 -1
  10. package/build/cjs/schema/constants.d.ts +27 -1
  11. package/build/cjs/schema/validators/common.d.ts +27 -1
  12. package/build/cjs/schema/validators/common.js +28 -1
  13. package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +27 -1
  14. package/build/cjs/sub-blocks/MediaCard/schema.d.ts +27 -1
  15. package/build/esm/blocks/Header/schema.d.ts +81 -3
  16. package/build/esm/blocks/HeaderSlider/schema.d.ts +27 -1
  17. package/build/esm/blocks/Media/schema.d.ts +54 -2
  18. package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +27 -1
  19. package/build/esm/blocks/Tabs/schema.d.ts +27 -1
  20. package/build/esm/components/Media/Iframe/Iframe.js +18 -4
  21. package/build/esm/components/Media/Iframe/utils.d.ts +2 -0
  22. package/build/esm/components/Media/Iframe/utils.js +25 -0
  23. package/build/esm/models/constructor-items/common.d.ts +2 -1
  24. package/build/esm/schema/constants.d.ts +27 -1
  25. package/build/esm/schema/validators/common.d.ts +27 -1
  26. package/build/esm/schema/validators/common.js +28 -1
  27. package/build/esm/sub-blocks/LayoutItem/schema.d.ts +27 -1
  28. package/build/esm/sub-blocks/MediaCard/schema.d.ts +27 -1
  29. package/package.json +1 -1
  30. package/schema/index.js +1 -1
  31. package/server/models/constructor-items/common.d.ts +2 -1
  32. package/widget/index.js +1 -1
@@ -306,7 +306,33 @@ export declare const HeaderBackgroundProps: {
306
306
  type: string;
307
307
  };
308
308
  height: {
309
- type: string;
309
+ oneOf: ({
310
+ type: string;
311
+ optionName: string;
312
+ additionalProperties?: undefined;
313
+ properties?: undefined;
314
+ } | {
315
+ type: string;
316
+ additionalProperties: boolean;
317
+ optionName: string;
318
+ properties: {
319
+ all: {
320
+ type: string;
321
+ };
322
+ sm: {
323
+ type: string;
324
+ };
325
+ md: {
326
+ type: string;
327
+ };
328
+ lg: {
329
+ type: string;
330
+ };
331
+ xl: {
332
+ type: string;
333
+ };
334
+ };
335
+ })[];
310
336
  };
311
337
  width: {
312
338
  type: string;
@@ -1047,7 +1073,33 @@ export declare const HeaderProperties: {
1047
1073
  type: string;
1048
1074
  };
1049
1075
  height: {
1050
- type: string;
1076
+ oneOf: ({
1077
+ type: string;
1078
+ optionName: string;
1079
+ additionalProperties?: undefined;
1080
+ properties?: undefined;
1081
+ } | {
1082
+ type: string;
1083
+ additionalProperties: boolean;
1084
+ optionName: string;
1085
+ properties: {
1086
+ all: {
1087
+ type: string;
1088
+ };
1089
+ sm: {
1090
+ type: string;
1091
+ };
1092
+ md: {
1093
+ type: string;
1094
+ };
1095
+ lg: {
1096
+ type: string;
1097
+ };
1098
+ xl: {
1099
+ type: string;
1100
+ };
1101
+ };
1102
+ })[];
1051
1103
  };
1052
1104
  width: {
1053
1105
  type: string;
@@ -1926,7 +1978,33 @@ export declare const HeaderBlock: {
1926
1978
  type: string;
1927
1979
  };
1928
1980
  height: {
1929
- type: string;
1981
+ oneOf: ({
1982
+ type: string;
1983
+ optionName: string;
1984
+ additionalProperties?: undefined;
1985
+ properties?: undefined;
1986
+ } | {
1987
+ type: string;
1988
+ additionalProperties: boolean;
1989
+ optionName: string;
1990
+ properties: {
1991
+ all: {
1992
+ type: string;
1993
+ };
1994
+ sm: {
1995
+ type: string;
1996
+ };
1997
+ md: {
1998
+ type: string;
1999
+ };
2000
+ lg: {
2001
+ type: string;
2002
+ };
2003
+ xl: {
2004
+ type: string;
2005
+ };
2006
+ };
2007
+ })[];
1930
2008
  };
1931
2009
  width: {
1932
2010
  type: string;
@@ -738,7 +738,33 @@ export declare const HeaderSliderBlock: {
738
738
  type: string;
739
739
  };
740
740
  height: {
741
- type: string;
741
+ oneOf: ({
742
+ type: string;
743
+ optionName: string;
744
+ additionalProperties?: undefined;
745
+ properties?: undefined;
746
+ } | {
747
+ type: string;
748
+ additionalProperties: boolean;
749
+ optionName: string;
750
+ properties: {
751
+ all: {
752
+ type: string;
753
+ };
754
+ sm: {
755
+ type: string;
756
+ };
757
+ md: {
758
+ type: string;
759
+ };
760
+ lg: {
761
+ type: string;
762
+ };
763
+ xl: {
764
+ type: string;
765
+ };
766
+ };
767
+ })[];
742
768
  };
743
769
  width: {
744
770
  type: string;
@@ -299,7 +299,33 @@ export declare const Media: {
299
299
  type: string;
300
300
  };
301
301
  height: {
302
- type: string;
302
+ oneOf: ({
303
+ type: string;
304
+ optionName: string;
305
+ additionalProperties?: undefined;
306
+ properties?: undefined;
307
+ } | {
308
+ type: string;
309
+ additionalProperties: boolean;
310
+ optionName: string;
311
+ properties: {
312
+ all: {
313
+ type: string;
314
+ };
315
+ sm: {
316
+ type: string;
317
+ };
318
+ md: {
319
+ type: string;
320
+ };
321
+ lg: {
322
+ type: string;
323
+ };
324
+ xl: {
325
+ type: string;
326
+ };
327
+ };
328
+ })[];
303
329
  };
304
330
  width: {
305
331
  type: string;
@@ -1178,7 +1204,33 @@ export declare const MediaBlock: {
1178
1204
  type: string;
1179
1205
  };
1180
1206
  height: {
1181
- type: string;
1207
+ oneOf: ({
1208
+ type: string;
1209
+ optionName: string;
1210
+ additionalProperties?: undefined;
1211
+ properties?: undefined;
1212
+ } | {
1213
+ type: string;
1214
+ additionalProperties: boolean;
1215
+ optionName: string;
1216
+ properties: {
1217
+ all: {
1218
+ type: string;
1219
+ };
1220
+ sm: {
1221
+ type: string;
1222
+ };
1223
+ md: {
1224
+ type: string;
1225
+ };
1226
+ lg: {
1227
+ type: string;
1228
+ };
1229
+ xl: {
1230
+ type: string;
1231
+ };
1232
+ };
1233
+ })[];
1182
1234
  };
1183
1235
  width: {
1184
1236
  type: string;
@@ -315,7 +315,33 @@ export declare const PromoFeaturesItem: {
315
315
  type: string;
316
316
  };
317
317
  height: {
318
- type: string;
318
+ oneOf: ({
319
+ type: string;
320
+ optionName: string;
321
+ additionalProperties?: undefined;
322
+ properties?: undefined;
323
+ } | {
324
+ type: string;
325
+ additionalProperties: boolean;
326
+ optionName: string;
327
+ properties: {
328
+ all: {
329
+ type: string;
330
+ };
331
+ sm: {
332
+ type: string;
333
+ };
334
+ md: {
335
+ type: string;
336
+ };
337
+ lg: {
338
+ type: string;
339
+ };
340
+ xl: {
341
+ type: string;
342
+ };
343
+ };
344
+ })[];
319
345
  };
320
346
  width: {
321
347
  type: string;
@@ -314,7 +314,33 @@ export declare const tabsItem: {
314
314
  type: string;
315
315
  };
316
316
  height: {
317
- type: string;
317
+ oneOf: ({
318
+ type: string;
319
+ optionName: string;
320
+ additionalProperties?: undefined;
321
+ properties?: undefined;
322
+ } | {
323
+ type: string;
324
+ additionalProperties: boolean;
325
+ optionName: string;
326
+ properties: {
327
+ all: {
328
+ type: string;
329
+ };
330
+ sm: {
331
+ type: string;
332
+ };
333
+ md: {
334
+ type: string;
335
+ };
336
+ lg: {
337
+ type: string;
338
+ };
339
+ xl: {
340
+ type: string;
341
+ };
342
+ };
343
+ })[];
318
344
  };
319
345
  width: {
320
346
  type: string;
@@ -1,15 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const react_1 = tslib_1.__importDefault(require("react"));
4
+ const react_1 = tslib_1.__importStar(require("react"));
5
5
  const utils_1 = require("../../../utils");
6
6
  const i18n_1 = require("./i18n");
7
+ const utils_2 = require("./utils");
7
8
  const b = (0, utils_1.block)('media-component-iframe');
9
+ const getViewportWidth = () => (typeof window === 'undefined' ? 0 : window.innerWidth);
8
10
  const Iframe = (props) => {
9
11
  const { iframe, margins = true } = props;
10
- const { height = 400, src, width, name, title } = iframe;
11
- return iframe ? (react_1.default.createElement("div", { className: b({ margins }), style: { height } },
12
- react_1.default.createElement("iframe", { className: b('item'), loading: "lazy", title: title || (0, i18n_1.i18n)('iframe-title'), frameBorder: 0, src: src, width: width, height: height, name: name,
12
+ const { height, src, width, name, title } = iframe;
13
+ const shouldTrackViewportWidth = typeof height === 'object';
14
+ const [viewportWidth, setViewportWidth] = (0, react_1.useState)(() => shouldTrackViewportWidth ? getViewportWidth() : 0);
15
+ const resolvedHeight = (0, utils_2.getIframeHeight)(height, viewportWidth);
16
+ (0, react_1.useEffect)(() => {
17
+ if (!shouldTrackViewportWidth) {
18
+ return undefined;
19
+ }
20
+ const handleResize = () => setViewportWidth(getViewportWidth());
21
+ handleResize();
22
+ window.addEventListener('resize', handleResize);
23
+ return () => window.removeEventListener('resize', handleResize);
24
+ }, [shouldTrackViewportWidth]);
25
+ return iframe ? (react_1.default.createElement("div", { className: b({ margins }), style: { height: resolvedHeight } },
26
+ react_1.default.createElement("iframe", { className: b('item'), loading: "lazy", title: title || (0, i18n_1.i18n)('iframe-title'), frameBorder: 0, src: src, width: width, height: resolvedHeight, name: name,
13
27
  /*
14
28
  1. allow: дает права на камеру, микрофон, полноэкранный режим
15
29
  и демонстрацию экрана (необходимы для Zoom).
@@ -0,0 +1,2 @@
1
+ import { ResponsiveIframeHeight } from '../../../models';
2
+ export declare const getIframeHeight: (height: number | ResponsiveIframeHeight | undefined, viewportWidth: number) => number;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getIframeHeight = void 0;
4
+ const constants_1 = require("../../../constants");
5
+ const responsiveHeightBreakpoints = [
6
+ ['all', constants_1.BREAKPOINTS.xs],
7
+ ['sm', constants_1.BREAKPOINTS.sm],
8
+ ['md', constants_1.BREAKPOINTS.md],
9
+ ['lg', constants_1.BREAKPOINTS.lg],
10
+ ['xl', constants_1.BREAKPOINTS.xl],
11
+ ];
12
+ const getIframeHeight = (height, viewportWidth) => {
13
+ var _a;
14
+ if (height === undefined) {
15
+ return 400;
16
+ }
17
+ if (typeof height === 'number') {
18
+ return height;
19
+ }
20
+ let result = (_a = height.all) !== null && _a !== void 0 ? _a : 400;
21
+ responsiveHeightBreakpoints.forEach(([breakpoint, minWidth]) => {
22
+ const breakpointHeight = height[breakpoint];
23
+ if (viewportWidth >= minWidth && breakpointHeight !== undefined) {
24
+ result = breakpointHeight;
25
+ }
26
+ });
27
+ return result;
28
+ };
29
+ exports.getIframeHeight = getIframeHeight;
@@ -258,10 +258,11 @@ export interface DataLensObjectProps {
258
258
  id: string;
259
259
  theme: 'dark' | 'light';
260
260
  }
261
+ export type ResponsiveIframeHeight = Partial<Record<'all' | 'sm' | 'md' | 'lg' | 'xl', number>>;
261
262
  export interface IframeProps {
262
263
  src: string;
263
264
  width?: number;
264
- height?: number;
265
+ height?: number | ResponsiveIframeHeight;
265
266
  title?: string;
266
267
  name?: string;
267
268
  }
@@ -4207,7 +4207,33 @@ export declare const cardSchemas: {
4207
4207
  type: string;
4208
4208
  };
4209
4209
  height: {
4210
- type: string;
4210
+ oneOf: ({
4211
+ type: string;
4212
+ optionName: string;
4213
+ additionalProperties?: undefined;
4214
+ properties?: undefined;
4215
+ } | {
4216
+ type: string;
4217
+ additionalProperties: boolean;
4218
+ optionName: string;
4219
+ properties: {
4220
+ all: {
4221
+ type: string;
4222
+ };
4223
+ sm: {
4224
+ type: string;
4225
+ };
4226
+ md: {
4227
+ type: string;
4228
+ };
4229
+ lg: {
4230
+ type: string;
4231
+ };
4232
+ xl: {
4233
+ type: string;
4234
+ };
4235
+ };
4236
+ })[];
4211
4237
  };
4212
4238
  width: {
4213
4239
  type: string;
@@ -1502,7 +1502,33 @@ export declare const MediaProps: {
1502
1502
  type: string;
1503
1503
  };
1504
1504
  height: {
1505
- type: string;
1505
+ oneOf: ({
1506
+ type: string;
1507
+ optionName: string;
1508
+ additionalProperties?: undefined;
1509
+ properties?: undefined;
1510
+ } | {
1511
+ type: string;
1512
+ additionalProperties: boolean;
1513
+ optionName: string;
1514
+ properties: {
1515
+ all: {
1516
+ type: string;
1517
+ };
1518
+ sm: {
1519
+ type: string;
1520
+ };
1521
+ md: {
1522
+ type: string;
1523
+ };
1524
+ lg: {
1525
+ type: string;
1526
+ };
1527
+ xl: {
1528
+ type: string;
1529
+ };
1530
+ };
1531
+ })[];
1506
1532
  };
1507
1533
  width: {
1508
1534
  type: string;
@@ -613,7 +613,34 @@ const IframeProps = {
613
613
  type: 'string',
614
614
  },
615
615
  height: {
616
- type: 'number',
616
+ oneOf: [
617
+ {
618
+ type: 'number',
619
+ optionName: 'constant',
620
+ },
621
+ {
622
+ type: 'object',
623
+ additionalProperties: false,
624
+ optionName: 'responsive',
625
+ properties: {
626
+ all: {
627
+ type: 'number',
628
+ },
629
+ sm: {
630
+ type: 'number',
631
+ },
632
+ md: {
633
+ type: 'number',
634
+ },
635
+ lg: {
636
+ type: 'number',
637
+ },
638
+ xl: {
639
+ type: 'number',
640
+ },
641
+ },
642
+ },
643
+ ],
617
644
  },
618
645
  width: {
619
646
  type: 'number',
@@ -347,7 +347,33 @@ export declare const LayoutItem: {
347
347
  type: string;
348
348
  };
349
349
  height: {
350
- type: string;
350
+ oneOf: ({
351
+ type: string;
352
+ optionName: string;
353
+ additionalProperties?: undefined;
354
+ properties?: undefined;
355
+ } | {
356
+ type: string;
357
+ additionalProperties: boolean;
358
+ optionName: string;
359
+ properties: {
360
+ all: {
361
+ type: string;
362
+ };
363
+ sm: {
364
+ type: string;
365
+ };
366
+ md: {
367
+ type: string;
368
+ };
369
+ lg: {
370
+ type: string;
371
+ };
372
+ xl: {
373
+ type: string;
374
+ };
375
+ };
376
+ })[];
351
377
  };
352
378
  width: {
353
379
  type: string;
@@ -341,7 +341,33 @@ export declare const MediaCardBlock: {
341
341
  type: string;
342
342
  };
343
343
  height: {
344
- type: string;
344
+ oneOf: ({
345
+ type: string;
346
+ optionName: string;
347
+ additionalProperties?: undefined;
348
+ properties?: undefined;
349
+ } | {
350
+ type: string;
351
+ additionalProperties: boolean;
352
+ optionName: string;
353
+ properties: {
354
+ all: {
355
+ type: string;
356
+ };
357
+ sm: {
358
+ type: string;
359
+ };
360
+ md: {
361
+ type: string;
362
+ };
363
+ lg: {
364
+ type: string;
365
+ };
366
+ xl: {
367
+ type: string;
368
+ };
369
+ };
370
+ })[];
345
371
  };
346
372
  width: {
347
373
  type: string;
@@ -306,7 +306,33 @@ export declare const HeaderBackgroundProps: {
306
306
  type: string;
307
307
  };
308
308
  height: {
309
- type: string;
309
+ oneOf: ({
310
+ type: string;
311
+ optionName: string;
312
+ additionalProperties?: undefined;
313
+ properties?: undefined;
314
+ } | {
315
+ type: string;
316
+ additionalProperties: boolean;
317
+ optionName: string;
318
+ properties: {
319
+ all: {
320
+ type: string;
321
+ };
322
+ sm: {
323
+ type: string;
324
+ };
325
+ md: {
326
+ type: string;
327
+ };
328
+ lg: {
329
+ type: string;
330
+ };
331
+ xl: {
332
+ type: string;
333
+ };
334
+ };
335
+ })[];
310
336
  };
311
337
  width: {
312
338
  type: string;
@@ -1047,7 +1073,33 @@ export declare const HeaderProperties: {
1047
1073
  type: string;
1048
1074
  };
1049
1075
  height: {
1050
- type: string;
1076
+ oneOf: ({
1077
+ type: string;
1078
+ optionName: string;
1079
+ additionalProperties?: undefined;
1080
+ properties?: undefined;
1081
+ } | {
1082
+ type: string;
1083
+ additionalProperties: boolean;
1084
+ optionName: string;
1085
+ properties: {
1086
+ all: {
1087
+ type: string;
1088
+ };
1089
+ sm: {
1090
+ type: string;
1091
+ };
1092
+ md: {
1093
+ type: string;
1094
+ };
1095
+ lg: {
1096
+ type: string;
1097
+ };
1098
+ xl: {
1099
+ type: string;
1100
+ };
1101
+ };
1102
+ })[];
1051
1103
  };
1052
1104
  width: {
1053
1105
  type: string;
@@ -1926,7 +1978,33 @@ export declare const HeaderBlock: {
1926
1978
  type: string;
1927
1979
  };
1928
1980
  height: {
1929
- type: string;
1981
+ oneOf: ({
1982
+ type: string;
1983
+ optionName: string;
1984
+ additionalProperties?: undefined;
1985
+ properties?: undefined;
1986
+ } | {
1987
+ type: string;
1988
+ additionalProperties: boolean;
1989
+ optionName: string;
1990
+ properties: {
1991
+ all: {
1992
+ type: string;
1993
+ };
1994
+ sm: {
1995
+ type: string;
1996
+ };
1997
+ md: {
1998
+ type: string;
1999
+ };
2000
+ lg: {
2001
+ type: string;
2002
+ };
2003
+ xl: {
2004
+ type: string;
2005
+ };
2006
+ };
2007
+ })[];
1930
2008
  };
1931
2009
  width: {
1932
2010
  type: string;