@gravity-ui/page-constructor 1.2.3-alpha.0 → 1.2.3-alpha.2
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.js +2 -2
- package/build/cjs/components/Image/schema.d.ts +4 -0
- package/build/cjs/components/Image/schema.js +7 -5
- package/build/cjs/schema/validators/common.d.ts +0 -1
- package/build/cjs/schema/validators/common.js +2 -3
- package/build/cjs/sub-blocks/Quote/schema.js +2 -2
- package/build/esm/blocks/Header/Header.js +2 -2
- package/build/esm/components/Image/schema.d.ts +4 -0
- package/build/esm/components/Image/schema.js +4 -2
- package/build/esm/schema/validators/common.d.ts +0 -1
- package/build/esm/schema/validators/common.js +1 -2
- package/build/esm/sub-blocks/Quote/schema.js +2 -2
- package/package.json +1 -1
|
@@ -14,8 +14,8 @@ const ThemeValueContext_1 = require("../../context/theme/ThemeValueContext");
|
|
|
14
14
|
const utils_3 = require("../../components/Media/Image/utils");
|
|
15
15
|
const b = (0, utils_1.block)('header-block');
|
|
16
16
|
const Background = ({ background }) => {
|
|
17
|
-
const { url, color, disableCompress, fullWidth, fullWidthMedia
|
|
18
|
-
const imageObject =
|
|
17
|
+
const { url, color, disableCompress, fullWidth, fullWidthMedia } = background;
|
|
18
|
+
const imageObject = url && (0, utils_3.getMediaImage)(url);
|
|
19
19
|
if (imageObject && disableCompress) {
|
|
20
20
|
imageObject.disableCompress = disableCompress;
|
|
21
21
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const urlPattern = "^((http[s]?|ftp):\\/)?\\/?([^:\\/\\s]+)((\\/\\w+)*\\/)([\\w\\-\\.]+[^#?\\s]+)(.*)?(#[\\w\\-]+)?$";
|
|
1
2
|
export declare const ImageDeviceProps: {
|
|
2
3
|
type: string;
|
|
3
4
|
additionalProperties: boolean;
|
|
@@ -5,12 +6,15 @@ export declare const ImageDeviceProps: {
|
|
|
5
6
|
properties: {
|
|
6
7
|
desktop: {
|
|
7
8
|
type: string;
|
|
9
|
+
pattern: string;
|
|
8
10
|
};
|
|
9
11
|
tablet: {
|
|
10
12
|
type: string;
|
|
13
|
+
pattern: string;
|
|
11
14
|
};
|
|
12
15
|
mobile: {
|
|
13
16
|
type: string;
|
|
17
|
+
pattern: string;
|
|
14
18
|
};
|
|
15
19
|
alt: {
|
|
16
20
|
type: string;
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ImageProps = exports.ImageObjectProps = exports.ImageDeviceProps = void 0;
|
|
3
|
+
exports.ImageProps = exports.ImageObjectProps = exports.ImageDeviceProps = exports.urlPattern = void 0;
|
|
4
4
|
const utils_1 = require("../../schema/validators/utils");
|
|
5
|
-
|
|
5
|
+
exports.urlPattern = '^((http[s]?|ftp):\\/)?\\/?([^:\\/\\s]+)((\\/\\w+)*\\/)([\\w\\-\\.]+[^#?\\s]+)(.*)?(#[\\w\\-]+)?$';
|
|
6
6
|
exports.ImageDeviceProps = {
|
|
7
7
|
type: 'object',
|
|
8
8
|
additionalProperties: false,
|
|
9
9
|
required: ['desktop', 'mobile'],
|
|
10
10
|
properties: {
|
|
11
|
-
desktop: { type: 'string' },
|
|
11
|
+
desktop: { type: 'string', pattern: exports.urlPattern },
|
|
12
12
|
tablet: {
|
|
13
13
|
type: 'string',
|
|
14
|
+
pattern: exports.urlPattern,
|
|
14
15
|
},
|
|
15
16
|
mobile: {
|
|
16
17
|
type: 'string',
|
|
18
|
+
pattern: exports.urlPattern,
|
|
17
19
|
},
|
|
18
20
|
alt: {
|
|
19
21
|
type: 'string',
|
|
@@ -30,7 +32,7 @@ exports.ImageObjectProps = {
|
|
|
30
32
|
properties: {
|
|
31
33
|
src: {
|
|
32
34
|
type: 'string',
|
|
33
|
-
pattern:
|
|
35
|
+
pattern: exports.urlPattern,
|
|
34
36
|
},
|
|
35
37
|
alt: {
|
|
36
38
|
type: 'string',
|
|
@@ -44,7 +46,7 @@ exports.ImageProps = {
|
|
|
44
46
|
oneOf: [
|
|
45
47
|
{
|
|
46
48
|
type: 'string',
|
|
47
|
-
pattern:
|
|
49
|
+
pattern: exports.urlPattern,
|
|
48
50
|
},
|
|
49
51
|
(0, utils_1.filteredItem)(Object.assign({}, exports.ImageObjectProps)),
|
|
50
52
|
(0, utils_1.filteredItem)(Object.assign({}, exports.ImageDeviceProps)),
|
|
@@ -19,7 +19,6 @@ export declare const sizeNumber: {
|
|
|
19
19
|
minimum: number;
|
|
20
20
|
};
|
|
21
21
|
export declare const contentThemes: string[];
|
|
22
|
-
export declare const urlPattern = "^((http[s]?|ftp):\\/)?\\/?([^:\\/\\s]+)((\\/\\w+)*\\/)([\\w\\-\\.]+[^#?\\s]+)(.*)?(#[\\w\\-]+)?$";
|
|
23
22
|
export declare const BaseProps: {
|
|
24
23
|
type: {};
|
|
25
24
|
when: {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MediaProps = exports.ButtonBlock = exports.TitleProps = exports.BlockBaseProps = exports.AnchorProps = exports.withTheme = exports.MenuProps = exports.ButtonProps = exports.authorItem = exports.FileLinkProps = exports.LinkProps = exports.BackgroundProps = exports.DataLensProps = exports.DataLensObjectProps = exports.JustifyProps = exports.ThemeProps = exports.VideoProps = exports.PlayIconProps = exports.LoopProps = exports.ChildrenCardsProps = exports.ChildrenProps = exports.AnimatableProps = exports.sliderSizesObject = exports.containerSizesObject = exports.BaseProps = exports.
|
|
3
|
+
exports.MediaProps = exports.ButtonBlock = exports.TitleProps = exports.BlockBaseProps = exports.AnchorProps = exports.withTheme = exports.MenuProps = exports.ButtonProps = exports.authorItem = exports.FileLinkProps = exports.LinkProps = exports.BackgroundProps = exports.DataLensProps = exports.DataLensObjectProps = exports.JustifyProps = exports.ThemeProps = exports.VideoProps = exports.PlayIconProps = exports.LoopProps = exports.ChildrenCardsProps = exports.ChildrenProps = exports.AnimatableProps = exports.sliderSizesObject = exports.containerSizesObject = exports.BaseProps = exports.contentThemes = exports.sizeNumber = exports.dividerEnum = exports.fileLinkTypes = exports.videoControlsTypes = exports.playIconThemes = exports.playIconTypes = exports.videoTypes = exports.contentTextWidth = exports.contentSizes = exports.sliderSizesArray = exports.containerSizesArray = exports.textSize = exports.mediaDirection = void 0;
|
|
4
4
|
const pixel_1 = require("./pixel");
|
|
5
5
|
const models_1 = require("../../models");
|
|
6
6
|
const schema_1 = require("../../components/Image/schema");
|
|
@@ -18,7 +18,6 @@ exports.fileLinkTypes = ['vertical', 'horizontal'];
|
|
|
18
18
|
exports.dividerEnum = { enum: [0, 'xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl', 'xxxl'] };
|
|
19
19
|
exports.sizeNumber = { type: 'number', maximum: 12, minimum: 1 };
|
|
20
20
|
exports.contentThemes = ['default', 'dark', 'light'];
|
|
21
|
-
exports.urlPattern = '^((http[s]?|ftp):\\/)?\\/?([^:\\/\\s]+)((\\/\\w+)*\\/)([\\w\\-\\.]+[^#?\\s]+)(.*)?(#[\\w\\-]+)?$';
|
|
22
21
|
exports.BaseProps = {
|
|
23
22
|
type: {},
|
|
24
23
|
when: {},
|
|
@@ -215,7 +214,7 @@ exports.authorItem = {
|
|
|
215
214
|
},
|
|
216
215
|
avatar: {
|
|
217
216
|
type: 'string',
|
|
218
|
-
pattern:
|
|
217
|
+
pattern: schema_1.urlPattern,
|
|
219
218
|
},
|
|
220
219
|
description: {
|
|
221
220
|
type: 'string',
|
|
@@ -11,12 +11,12 @@ exports.Quote = {
|
|
|
11
11
|
type: 'string',
|
|
12
12
|
}, image: (0, common_1.withTheme)(schema_1.ImageProps), logo: {
|
|
13
13
|
type: 'string',
|
|
14
|
-
pattern:
|
|
14
|
+
pattern: schema_1.urlPattern,
|
|
15
15
|
}, color: {
|
|
16
16
|
type: 'string',
|
|
17
17
|
}, url: {
|
|
18
18
|
type: 'string',
|
|
19
|
-
pattern:
|
|
19
|
+
pattern: schema_1.urlPattern,
|
|
20
20
|
}, theme: common_1.ThemeProps, author: common_1.authorItem }),
|
|
21
21
|
},
|
|
22
22
|
};
|
|
@@ -11,8 +11,8 @@ import { getMediaImage } from '../../components/Media/Image/utils';
|
|
|
11
11
|
import './Header.css';
|
|
12
12
|
const b = block('header-block');
|
|
13
13
|
const Background = ({ background }) => {
|
|
14
|
-
const { url, color, disableCompress, fullWidth, fullWidthMedia
|
|
15
|
-
const imageObject =
|
|
14
|
+
const { url, color, disableCompress, fullWidth, fullWidthMedia } = background;
|
|
15
|
+
const imageObject = url && getMediaImage(url);
|
|
16
16
|
if (imageObject && disableCompress) {
|
|
17
17
|
imageObject.disableCompress = disableCompress;
|
|
18
18
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const urlPattern = "^((http[s]?|ftp):\\/)?\\/?([^:\\/\\s]+)((\\/\\w+)*\\/)([\\w\\-\\.]+[^#?\\s]+)(.*)?(#[\\w\\-]+)?$";
|
|
1
2
|
export declare const ImageDeviceProps: {
|
|
2
3
|
type: string;
|
|
3
4
|
additionalProperties: boolean;
|
|
@@ -5,12 +6,15 @@ export declare const ImageDeviceProps: {
|
|
|
5
6
|
properties: {
|
|
6
7
|
desktop: {
|
|
7
8
|
type: string;
|
|
9
|
+
pattern: string;
|
|
8
10
|
};
|
|
9
11
|
tablet: {
|
|
10
12
|
type: string;
|
|
13
|
+
pattern: string;
|
|
11
14
|
};
|
|
12
15
|
mobile: {
|
|
13
16
|
type: string;
|
|
17
|
+
pattern: string;
|
|
14
18
|
};
|
|
15
19
|
alt: {
|
|
16
20
|
type: string;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { filteredItem } from '../../schema/validators/utils';
|
|
2
|
-
|
|
2
|
+
export const urlPattern = '^((http[s]?|ftp):\\/)?\\/?([^:\\/\\s]+)((\\/\\w+)*\\/)([\\w\\-\\.]+[^#?\\s]+)(.*)?(#[\\w\\-]+)?$';
|
|
3
3
|
export const ImageDeviceProps = {
|
|
4
4
|
type: 'object',
|
|
5
5
|
additionalProperties: false,
|
|
6
6
|
required: ['desktop', 'mobile'],
|
|
7
7
|
properties: {
|
|
8
|
-
desktop: { type: 'string' },
|
|
8
|
+
desktop: { type: 'string', pattern: urlPattern },
|
|
9
9
|
tablet: {
|
|
10
10
|
type: 'string',
|
|
11
|
+
pattern: urlPattern,
|
|
11
12
|
},
|
|
12
13
|
mobile: {
|
|
13
14
|
type: 'string',
|
|
15
|
+
pattern: urlPattern,
|
|
14
16
|
},
|
|
15
17
|
alt: {
|
|
16
18
|
type: 'string',
|
|
@@ -19,7 +19,6 @@ export declare const sizeNumber: {
|
|
|
19
19
|
minimum: number;
|
|
20
20
|
};
|
|
21
21
|
export declare const contentThemes: string[];
|
|
22
|
-
export declare const urlPattern = "^((http[s]?|ftp):\\/)?\\/?([^:\\/\\s]+)((\\/\\w+)*\\/)([\\w\\-\\.]+[^#?\\s]+)(.*)?(#[\\w\\-]+)?$";
|
|
23
22
|
export declare const BaseProps: {
|
|
24
23
|
type: {};
|
|
25
24
|
when: {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { pixelEvents } from './pixel';
|
|
2
2
|
import { Theme } from '../../models';
|
|
3
|
-
import { ImageProps } from '../../components/Image/schema';
|
|
3
|
+
import { ImageProps, urlPattern } from '../../components/Image/schema';
|
|
4
4
|
export const mediaDirection = ['media-content', 'content-media'];
|
|
5
5
|
export const textSize = ['s', 'm', 'l'];
|
|
6
6
|
export const containerSizesArray = ['sm', 'md', 'lg', 'xl', 'all'];
|
|
@@ -15,7 +15,6 @@ export const fileLinkTypes = ['vertical', 'horizontal'];
|
|
|
15
15
|
export const dividerEnum = { enum: [0, 'xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl', 'xxxl'] };
|
|
16
16
|
export const sizeNumber = { type: 'number', maximum: 12, minimum: 1 };
|
|
17
17
|
export const contentThemes = ['default', 'dark', 'light'];
|
|
18
|
-
export const urlPattern = '^((http[s]?|ftp):\\/)?\\/?([^:\\/\\s]+)((\\/\\w+)*\\/)([\\w\\-\\.]+[^#?\\s]+)(.*)?(#[\\w\\-]+)?$';
|
|
19
18
|
export const BaseProps = {
|
|
20
19
|
type: {},
|
|
21
20
|
when: {},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { authorItem, BaseProps, ThemeProps, withTheme
|
|
2
|
-
import { ImageProps } from '../../components/Image/schema';
|
|
1
|
+
import { authorItem, BaseProps, ThemeProps, withTheme } from '../../schema/validators/common';
|
|
2
|
+
import { ImageProps, urlPattern } from '../../components/Image/schema';
|
|
3
3
|
export const Quote = {
|
|
4
4
|
quote: {
|
|
5
5
|
additionalProperties: false,
|