@gravity-ui/blog-constructor 11.1.0 → 11.2.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/build/cjs/blocks/Author/schema.d.ts +14 -3
- package/build/cjs/blocks/Author/schema.js +1 -1
- package/build/cjs/blocks/Author/schema.js.map +1 -1
- package/build/cjs/blocks/Banner/Banner.js +5 -2
- package/build/cjs/blocks/Banner/Banner.js.map +1 -1
- package/build/cjs/blocks/Banner/schema.d.ts +89 -13
- package/build/cjs/blocks/CTA/schema.d.ts +89 -13
- package/build/cjs/blocks/CTA/schema.js +1 -1
- package/build/cjs/blocks/CTA/schema.js.map +1 -1
- package/build/cjs/blocks/ColoredText/schema.d.ts +90 -15
- package/build/cjs/blocks/CompactMedia/schema.d.ts +13 -6
- package/build/cjs/blocks/Feed/schema.d.ts +11 -2
- package/build/cjs/blocks/Form/schema.d.ts +69 -38
- package/build/cjs/blocks/Form/schema.js +5 -22
- package/build/cjs/blocks/Form/schema.js.map +1 -1
- package/build/cjs/blocks/Header/schema.d.ts +164 -73
- package/build/cjs/blocks/Header/schema.js +3 -1
- package/build/cjs/blocks/Header/schema.js.map +1 -1
- package/build/cjs/blocks/Layout/schema.d.ts +11 -2
- package/build/cjs/blocks/Media/schema.d.ts +13 -6
- package/build/cjs/blocks/Meta/schema.d.ts +11 -2
- package/build/cjs/blocks/SideCardList/schema.d.ts +69 -6
- package/build/cjs/blocks/SideCardList/schema.js +16 -19
- package/build/cjs/blocks/SideCardList/schema.js.map +1 -1
- package/build/cjs/blocks/Suggest/schema.d.ts +11 -2
- package/build/cjs/blocks/Take/schema.d.ts +25 -2
- package/build/cjs/blocks/Take/schema.js +2 -2
- package/build/cjs/blocks/Take/schema.js.map +1 -1
- package/build/cjs/blocks/YFM/schema.d.ts +11 -2
- package/build/cjs/constructor/blocksMap.d.ts +9 -9
- package/build/cjs/constructor/blocksMap.js +9 -9
- package/build/cjs/constructor/blocksMap.js.map +1 -1
- package/build/cjs/containers/BlogPostPage/BlogPostPage.css +9 -1
- package/build/cjs/hooks/useExtendedComponentMap.d.ts +9 -9
- package/build/cjs/schema/blocks.d.ts +4 -2
- package/build/cjs/schema/blocks.js +4 -2
- package/build/cjs/schema/blocks.js.map +1 -1
- package/build/cjs/schema/common.d.ts +4 -0
- package/build/cjs/schema/common.js +8 -10
- package/build/cjs/schema/common.js.map +1 -1
- package/build/cjs/schema/index.d.ts +1009 -284
- package/build/cjs/schema/index.js +5 -3
- package/build/cjs/schema/index.js.map +1 -1
- package/build/cjs/utils/common.d.ts +1 -2
- package/build/esm/blocks/Author/schema.d.ts +14 -3
- package/build/esm/blocks/Author/schema.js +1 -1
- package/build/esm/blocks/Author/schema.js.map +1 -1
- package/build/esm/blocks/Banner/Banner.js +5 -2
- package/build/esm/blocks/Banner/Banner.js.map +1 -1
- package/build/esm/blocks/Banner/schema.d.ts +89 -13
- package/build/esm/blocks/CTA/schema.d.ts +89 -13
- package/build/esm/blocks/CTA/schema.js +1 -1
- package/build/esm/blocks/CTA/schema.js.map +1 -1
- package/build/esm/blocks/ColoredText/schema.d.ts +90 -15
- package/build/esm/blocks/CompactMedia/schema.d.ts +13 -6
- package/build/esm/blocks/Feed/schema.d.ts +11 -2
- package/build/esm/blocks/Form/schema.d.ts +69 -38
- package/build/esm/blocks/Form/schema.js +4 -21
- package/build/esm/blocks/Form/schema.js.map +1 -1
- package/build/esm/blocks/Header/schema.d.ts +164 -73
- package/build/esm/blocks/Header/schema.js +3 -1
- package/build/esm/blocks/Header/schema.js.map +1 -1
- package/build/esm/blocks/Layout/schema.d.ts +11 -2
- package/build/esm/blocks/Media/schema.d.ts +13 -6
- package/build/esm/blocks/Meta/schema.d.ts +11 -2
- package/build/esm/blocks/SideCardList/schema.d.ts +69 -6
- package/build/esm/blocks/SideCardList/schema.js +16 -19
- package/build/esm/blocks/SideCardList/schema.js.map +1 -1
- package/build/esm/blocks/Suggest/schema.d.ts +11 -2
- package/build/esm/blocks/Take/schema.d.ts +25 -2
- package/build/esm/blocks/Take/schema.js +3 -3
- package/build/esm/blocks/Take/schema.js.map +1 -1
- package/build/esm/blocks/YFM/schema.d.ts +11 -2
- package/build/esm/constructor/blocksMap.d.ts +9 -9
- package/build/esm/constructor/blocksMap.js +9 -9
- package/build/esm/constructor/blocksMap.js.map +1 -1
- package/build/esm/containers/BlogPostPage/BlogPostPage.css +9 -1
- package/build/esm/hooks/useExtendedComponentMap.d.ts +9 -9
- package/build/esm/schema/blocks.d.ts +4 -2
- package/build/esm/schema/blocks.js +4 -2
- package/build/esm/schema/blocks.js.map +1 -1
- package/build/esm/schema/common.d.ts +4 -0
- package/build/esm/schema/common.js +7 -9
- package/build/esm/schema/common.js.map +1 -1
- package/build/esm/schema/index.d.ts +1009 -284
- package/build/esm/schema/index.js +5 -3
- package/build/esm/schema/index.js.map +1 -1
- package/build/esm/utils/common.d.ts +1 -2
- package/package.json +3 -3
- package/styles/storybook/common.scss +6 -0
- package/styles/styles.css +9 -1
- package/styles/yfm.css +9 -1
|
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const common_1 = require("../models/common.js");
|
|
6
6
|
const blocks = tslib_1.__importStar(require("./blocks.js"));
|
|
7
7
|
const headers = tslib_1.__importStar(require("./headers.js"));
|
|
8
|
-
const { Author, Banner, ColoredText, CTA, Feed, Layout, Media, Meta,
|
|
8
|
+
const { Author, Banner, ColoredText, CompactMedia, CTA, Feed, Form, Layout, Media, Meta, SideCardList, Suggest, Take, YFM, } = blocks;
|
|
9
9
|
const { Header } = headers;
|
|
10
10
|
exports.validators = {
|
|
11
11
|
blocks,
|
|
@@ -19,15 +19,17 @@ exports.schemasForCustom = {
|
|
|
19
19
|
[common_1.BlockType.Author]: Author,
|
|
20
20
|
[common_1.BlockType.Banner]: Banner,
|
|
21
21
|
[common_1.BlockType.ColoredText]: ColoredText,
|
|
22
|
+
[common_1.BlockType.CompactMedia]: CompactMedia,
|
|
22
23
|
[common_1.BlockType.CTA]: CTA,
|
|
23
24
|
[common_1.BlockType.Feed]: Feed,
|
|
25
|
+
[common_1.BlockType.Form]: Form,
|
|
24
26
|
[common_1.BlockType.Layout]: Layout,
|
|
25
27
|
[common_1.BlockType.Media]: Media,
|
|
26
28
|
[common_1.BlockType.Meta]: Meta,
|
|
29
|
+
[common_1.BlockType.SideCardList]: SideCardList,
|
|
27
30
|
[common_1.BlockType.Suggest]: Suggest,
|
|
28
|
-
[common_1.BlockType.YFM]: YFM,
|
|
29
|
-
[common_1.BlockType.CompactMedia]: CompactMedia,
|
|
30
31
|
[common_1.BlockType.Take]: Take,
|
|
32
|
+
[common_1.BlockType.YFM]: YFM,
|
|
31
33
|
},
|
|
32
34
|
};
|
|
33
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../../../src","sources":["schema/index.ts"],"names":[],"mappings":";;;;AAAA,gDAA2C;AAE3C,4DAAmC;AACnC,8DAAqC;AAErC,MAAM,EACF,MAAM,EACN,MAAM,EACN,WAAW,EACX,GAAG,EACH,IAAI,EACJ,MAAM,EACN,KAAK,EACL,IAAI,EACJ,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../../../src","sources":["schema/index.ts"],"names":[],"mappings":";;;;AAAA,gDAA2C;AAE3C,4DAAmC;AACnC,8DAAqC;AAErC,MAAM,EACF,MAAM,EACN,MAAM,EACN,WAAW,EACX,YAAY,EACZ,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,IAAI,EACJ,GAAG,GACN,GAAG,MAAM,CAAC;AACX,MAAM,EAAC,MAAM,EAAC,GAAG,OAAO,CAAC;AAEZ,QAAA,UAAU,GAAG;IACtB,MAAM;IACN,OAAO;CACV,CAAC;AAEW,QAAA,gBAAgB,GAAG;IAC5B,OAAO,EAAE;QACL,CAAC,kBAAS,CAAC,MAAM,CAAC,EAAE,MAAM;KAC7B;IACD,MAAM,EAAE;QACJ,CAAC,kBAAS,CAAC,MAAM,CAAC,EAAE,MAAM;QAC1B,CAAC,kBAAS,CAAC,MAAM,CAAC,EAAE,MAAM;QAC1B,CAAC,kBAAS,CAAC,WAAW,CAAC,EAAE,WAAW;QACpC,CAAC,kBAAS,CAAC,YAAY,CAAC,EAAE,YAAY;QACtC,CAAC,kBAAS,CAAC,GAAG,CAAC,EAAE,GAAG;QACpB,CAAC,kBAAS,CAAC,IAAI,CAAC,EAAE,IAAI;QACtB,CAAC,kBAAS,CAAC,IAAI,CAAC,EAAE,IAAI;QACtB,CAAC,kBAAS,CAAC,MAAM,CAAC,EAAE,MAAM;QAC1B,CAAC,kBAAS,CAAC,KAAK,CAAC,EAAE,KAAK;QACxB,CAAC,kBAAS,CAAC,IAAI,CAAC,EAAE,IAAI;QACtB,CAAC,kBAAS,CAAC,YAAY,CAAC,EAAE,YAAY;QACtC,CAAC,kBAAS,CAAC,OAAO,CAAC,EAAE,OAAO;QAC5B,CAAC,kBAAS,CAAC,IAAI,CAAC,EAAE,IAAI;QACtB,CAAC,kBAAS,CAAC,GAAG,CAAC,EAAE,GAAG;KACvB;CACJ,CAAC","sourcesContent":["import {BlockType} from '../models/common';\n\nimport * as blocks from './blocks';\nimport * as headers from './headers';\n\nconst {\n Author,\n Banner,\n ColoredText,\n CompactMedia,\n CTA,\n Feed,\n Form,\n Layout,\n Media,\n Meta,\n SideCardList,\n Suggest,\n Take,\n YFM,\n} = blocks;\nconst {Header} = headers;\n\nexport const validators = {\n blocks,\n headers,\n};\n\nexport const schemasForCustom = {\n headers: {\n [BlockType.Header]: Header,\n },\n blocks: {\n [BlockType.Author]: Author,\n [BlockType.Banner]: Banner,\n [BlockType.ColoredText]: ColoredText,\n [BlockType.CompactMedia]: CompactMedia,\n [BlockType.CTA]: CTA,\n [BlockType.Feed]: Feed,\n [BlockType.Form]: Form,\n [BlockType.Layout]: Layout,\n [BlockType.Media]: Media,\n [BlockType.Meta]: Meta,\n [BlockType.SideCardList]: SideCardList,\n [BlockType.Suggest]: Suggest,\n [BlockType.Take]: Take,\n [BlockType.YFM]: YFM,\n },\n};\n"]}
|
|
@@ -28,10 +28,9 @@ export declare const updateContentSizes: ({ size, colSizes, theme, ...contentDat
|
|
|
28
28
|
textId?: string;
|
|
29
29
|
additionalInfo?: string;
|
|
30
30
|
links?: import("@gravity-ui/page-constructor").LinkProps[];
|
|
31
|
-
buttons?: import("@gravity-ui/page-constructor").ButtonProps[];
|
|
31
|
+
buttons?: (import("@gravity-ui/page-constructor").ButtonProps | React.ReactNode)[];
|
|
32
32
|
centered?: boolean;
|
|
33
33
|
list?: import("@gravity-ui/page-constructor").ContentItemProps[];
|
|
34
|
-
labels?: import("@gravity-ui/page-constructor").ContentLabelProps[];
|
|
35
34
|
controlPosition?: "default" | "bottom";
|
|
36
35
|
};
|
|
37
36
|
type GetBreadcrumbsProps = {
|
|
@@ -5,7 +5,9 @@ export declare const Author: {
|
|
|
5
5
|
required: string[];
|
|
6
6
|
properties: {
|
|
7
7
|
authorId: {
|
|
8
|
-
|
|
8
|
+
oneOf: {
|
|
9
|
+
type: string;
|
|
10
|
+
}[];
|
|
9
11
|
};
|
|
10
12
|
paddingTop: {
|
|
11
13
|
type: string;
|
|
@@ -43,8 +45,17 @@ export declare const Author: {
|
|
|
43
45
|
};
|
|
44
46
|
};
|
|
45
47
|
visible: {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
oneOf: ({
|
|
49
|
+
type: string;
|
|
50
|
+
enum: string[];
|
|
51
|
+
additionalProperties?: undefined;
|
|
52
|
+
properties?: undefined;
|
|
53
|
+
} | {
|
|
54
|
+
type: string;
|
|
55
|
+
additionalProperties: boolean;
|
|
56
|
+
properties: {};
|
|
57
|
+
enum?: undefined;
|
|
58
|
+
})[];
|
|
48
59
|
};
|
|
49
60
|
resetPaddings: {
|
|
50
61
|
type: string;
|
|
@@ -8,7 +8,7 @@ export const Author = {
|
|
|
8
8
|
additionalProperties: false,
|
|
9
9
|
required: ['authorId'],
|
|
10
10
|
properties: Object.assign(Object.assign(Object.assign({}, BlockBaseProps), BlogBlockBase), { authorId: {
|
|
11
|
-
type: 'number',
|
|
11
|
+
oneOf: [{ type: 'number' }, { type: 'string' }],
|
|
12
12
|
} }),
|
|
13
13
|
},
|
|
14
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/Author/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,8BAA8B,CAAC;AAExD,MAAM,EACF,MAAM,EAAE,EAAC,cAAc,EAAC,GAC3B,GAAG,UAAU,CAAC;AAEf,OAAO,EAAC,SAAS,EAAC,+BAA4B;AAC9C,OAAO,EAAC,aAAa,EAAC,+BAA4B;AAElD,MAAM,CAAC,MAAM,MAAM,GAAG;IAClB,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;QAChB,IAAI,EAAE,QAAQ;QACd,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,UAAU,CAAC;QACtB,UAAU,gDACH,cAAc,GACd,aAAa,KAChB,QAAQ,EAAE;gBACN,IAAI,EAAE,QAAQ;
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/Author/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,8BAA8B,CAAC;AAExD,MAAM,EACF,MAAM,EAAE,EAAC,cAAc,EAAC,GAC3B,GAAG,UAAU,CAAC;AAEf,OAAO,EAAC,SAAS,EAAC,+BAA4B;AAC9C,OAAO,EAAC,aAAa,EAAC,+BAA4B;AAElD,MAAM,CAAC,MAAM,MAAM,GAAG;IAClB,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;QAChB,IAAI,EAAE,QAAQ;QACd,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,UAAU,CAAC;QACtB,UAAU,gDACH,cAAc,GACd,aAAa,KAChB,QAAQ,EAAE;gBACN,KAAK,EAAE,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAC,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC,CAAC;aAC9C,GACJ;KACJ;CACJ,CAAC","sourcesContent":["import {validators} from '@gravity-ui/page-constructor';\n\nconst {\n common: {BlockBaseProps},\n} = validators;\n\nimport {BlockType} from '../../models/common';\nimport {BlogBlockBase} from '../../schema/common';\n\nexport const Author = {\n [BlockType.Author]: {\n type: 'object',\n additionalProperties: false,\n required: ['authorId'],\n properties: {\n ...BlockBaseProps,\n ...BlogBlockBase,\n authorId: {\n oneOf: [{type: 'number'}, {type: 'string'}],\n },\n },\n },\n};\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
3
4
|
import { Content, Image } from '@gravity-ui/page-constructor';
|
|
4
5
|
import { Wrapper } from "../../components/Wrapper/Wrapper.js";
|
|
5
6
|
import { DefaultGoalIds } from "../../constants.js";
|
|
@@ -24,8 +25,10 @@ export const Banner = (_a) => {
|
|
|
24
25
|
}
|
|
25
26
|
const contentData = updateContentSizes(content);
|
|
26
27
|
(_b = contentData.buttons) === null || _b === void 0 ? void 0 : _b.forEach((button) => {
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
if (!React.isValidElement(button)) {
|
|
29
|
+
const buttonConfig = button;
|
|
30
|
+
buttonConfig.analyticsEvents = getMergedAnalyticsEvents(buttonGoals, buttonConfig.analyticsEvents);
|
|
31
|
+
}
|
|
29
32
|
});
|
|
30
33
|
return (_jsx(Wrapper, { paddings: {
|
|
31
34
|
[PaddingsDirections.top]: paddingTop,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.js","sourceRoot":"../../../../src","sources":["blocks/Banner/Banner.tsx"],"names":[],"mappings":";;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Banner.js","sourceRoot":"../../../../src","sources":["blocks/Banner/Banner.tsx"],"names":[],"mappings":";;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAc,OAAO,EAAE,KAAK,EAAC,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EAAC,OAAO,EAAC,4CAAyC;AACzD,OAAO,EAAC,cAAc,EAAC,2BAAwB;AAC/C,OAAO,EAAC,gBAAgB,EAAC,gCAA6B;AAEtD,OAAO,EAAC,kBAAkB,EAAC,iCAA8B;AACzD,OAAO,EAAC,KAAK,EAAC,0BAAuB;AACrC,OAAO,EACH,wBAAwB,EACxB,eAAe,EACf,qBAAqB,EACrB,kBAAkB,GACrB,8BAA2B;AAE5B,OAAO,cAAc,CAAC;AAEtB,MAAM,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC;AAE1B,MAAM,2BAA2B,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAExD,MAAM,WAAW,GAAG,qBAAqB,CAAC;IACtC,IAAI,EAAE,cAAc,CAAC,YAAY;IACjC,OAAO,EAAE,gBAAgB,CAAC,SAAS;CACtC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAQT,EAAE,EAAE;;QARK,EACnB,KAAK,EACL,SAAS,GAAG,GAAG,EACf,KAAK,EACL,UAAU,EACV,aAAa,EACb,EAAE,OAEQ,EADP,OAAO,cAPS,oEAQtB,CADa;IAEV,MAAM,YAAY,GAA2B,EAAE,CAAC;IAChD,MAAM,YAAY,GAAG,eAAe,CAAC,EAAE,EAAE,2BAA2B,CAAC,CAAC;IAEtE,IAAI,KAAK,EAAE,CAAC;QACR,YAAY,CAAC,eAAe,GAAG,KAAK,CAAC;IACzC,CAAC;IAED,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAEhD,MAAA,WAAW,CAAC,OAAO,0CAAE,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACpC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;YAChC,MAAM,YAAY,GAAG,MAAqB,CAAC;YAE3C,YAAY,CAAC,eAAe,GAAG,wBAAwB,CACnD,WAAW,EACX,YAAY,CAAC,eAAe,CAC/B,CAAC;QACN,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,CACH,KAAC,OAAO,IACJ,QAAQ,EAAE;YACN,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,UAAU;YACpC,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,aAAa;SAC7C,EACD,EAAE,EAAE,YAAY,CAAC,OAAO,EACxB,SAAS,EAAE,CAAC,CAAC,WAAW,CAAC,YAEzB,eAAK,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,YAAY,aAAW,YAAY,CAAC,OAAO,aAC5E,cAAK,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,YACrB,KAAC,OAAO,oBAAK,WAAW,IAAE,EAAE,EAAE,YAAY,CAAC,OAAO,IAAI,GACpD,EACL,KAAK,IAAI,CACN,cACI,SAAS,EAAE,CAAC,CAAC,iBAAiB,EAAE,EAAC,CAAC,YAAY,CAAC,EAAE,SAAS,EAAC,CAAC,aACnD,YAAY,CAAC,cAAc,YAEpC,KAAC,KAAK,IAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,KAAK,GAAI,GAC1C,CACT,IACC,GACA,CACb,CAAC;AACN,CAAC,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {ButtonProps, Content, Image} from '@gravity-ui/page-constructor';\n\nimport {Wrapper} from '../../components/Wrapper/Wrapper';\nimport {DefaultGoalIds} from '../../constants';\nimport {AnalyticsCounter} from '../../counters/utils';\nimport {BannerProps} from '../../models/blocks';\nimport {PaddingsDirections} from '../../models/paddings';\nimport {block} from '../../utils/cn';\nimport {\n getMergedAnalyticsEvents,\n getQaAttributes,\n prepareAnalyticsEvent,\n updateContentSizes,\n} from '../../utils/common';\n\nimport './Banner.scss';\n\nconst b = block('banner');\n\nconst BANNER_CUSTOM_QA_ATTRIBUTES = ['image-container'];\n\nconst buttonGoals = prepareAnalyticsEvent({\n name: DefaultGoalIds.bannerCommon,\n counter: AnalyticsCounter.CrossSite,\n});\n\nexport const Banner = ({\n color,\n imageSize = 's',\n image,\n paddingTop,\n paddingBottom,\n qa,\n ...content\n}: BannerProps) => {\n const contentStyle: Record<string, string> = {};\n const qaAttributes = getQaAttributes(qa, BANNER_CUSTOM_QA_ATTRIBUTES);\n\n if (color) {\n contentStyle.backgroundColor = color;\n }\n\n const contentData = updateContentSizes(content);\n\n contentData.buttons?.forEach((button) => {\n if (!React.isValidElement(button)) {\n const buttonConfig = button as ButtonProps;\n\n buttonConfig.analyticsEvents = getMergedAnalyticsEvents(\n buttonGoals,\n buttonConfig.analyticsEvents,\n );\n }\n });\n\n return (\n <Wrapper\n paddings={{\n [PaddingsDirections.top]: paddingTop,\n [PaddingsDirections.bottom]: paddingBottom,\n }}\n qa={qaAttributes.wrapper}\n className={b('container')}\n >\n <div className={b('content')} style={contentStyle} data-qa={qaAttributes.content}>\n <div className={b('info')}>\n <Content {...contentData} qa={qaAttributes.content} />\n </div>\n {image && (\n <div\n className={b('image-container', {['image-size']: imageSize})}\n data-qa={qaAttributes.imageContainer}\n >\n <Image className={b('image')} src={image} />\n </div>\n )}\n </div>\n </Wrapper>\n );\n};\n"]}
|
|
@@ -42,6 +42,84 @@ export declare const Banner: {
|
|
|
42
42
|
resetMargin: {
|
|
43
43
|
type: string;
|
|
44
44
|
};
|
|
45
|
+
analyticsEvents: {
|
|
46
|
+
anyOf: ({
|
|
47
|
+
type: string;
|
|
48
|
+
additionalProperties: {
|
|
49
|
+
type: string;
|
|
50
|
+
};
|
|
51
|
+
required: string[];
|
|
52
|
+
properties: {
|
|
53
|
+
name: {
|
|
54
|
+
type: string;
|
|
55
|
+
};
|
|
56
|
+
type: {
|
|
57
|
+
type: string;
|
|
58
|
+
};
|
|
59
|
+
counters: {
|
|
60
|
+
type: string;
|
|
61
|
+
additionalProperties: boolean;
|
|
62
|
+
required: never[];
|
|
63
|
+
properties: {
|
|
64
|
+
include: {
|
|
65
|
+
type: string;
|
|
66
|
+
items: {
|
|
67
|
+
type: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
exclude: {
|
|
71
|
+
type: string;
|
|
72
|
+
items: {
|
|
73
|
+
type: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
context: {
|
|
79
|
+
type: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
} | {
|
|
83
|
+
type: string;
|
|
84
|
+
items: {
|
|
85
|
+
type: string;
|
|
86
|
+
additionalProperties: {
|
|
87
|
+
type: string;
|
|
88
|
+
};
|
|
89
|
+
required: string[];
|
|
90
|
+
properties: {
|
|
91
|
+
name: {
|
|
92
|
+
type: string;
|
|
93
|
+
};
|
|
94
|
+
type: {
|
|
95
|
+
type: string;
|
|
96
|
+
};
|
|
97
|
+
counters: {
|
|
98
|
+
type: string;
|
|
99
|
+
additionalProperties: boolean;
|
|
100
|
+
required: never[];
|
|
101
|
+
properties: {
|
|
102
|
+
include: {
|
|
103
|
+
type: string;
|
|
104
|
+
items: {
|
|
105
|
+
type: string;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
exclude: {
|
|
109
|
+
type: string;
|
|
110
|
+
items: {
|
|
111
|
+
type: string;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
context: {
|
|
117
|
+
type: string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
})[];
|
|
122
|
+
};
|
|
45
123
|
};
|
|
46
124
|
contentType?: undefined;
|
|
47
125
|
})[];
|
|
@@ -96,17 +174,6 @@ export declare const Banner: {
|
|
|
96
174
|
};
|
|
97
175
|
};
|
|
98
176
|
};
|
|
99
|
-
labels: {
|
|
100
|
-
type: string;
|
|
101
|
-
items: {
|
|
102
|
-
type: string;
|
|
103
|
-
properties: {
|
|
104
|
-
when: {
|
|
105
|
-
type: string;
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
177
|
controlPosition: {
|
|
111
178
|
type: string;
|
|
112
179
|
enum: string[];
|
|
@@ -147,8 +214,17 @@ export declare const Banner: {
|
|
|
147
214
|
};
|
|
148
215
|
};
|
|
149
216
|
visible: {
|
|
150
|
-
|
|
151
|
-
|
|
217
|
+
oneOf: ({
|
|
218
|
+
type: string;
|
|
219
|
+
enum: string[];
|
|
220
|
+
additionalProperties?: undefined;
|
|
221
|
+
properties?: undefined;
|
|
222
|
+
} | {
|
|
223
|
+
type: string;
|
|
224
|
+
additionalProperties: boolean;
|
|
225
|
+
properties: {};
|
|
226
|
+
enum?: undefined;
|
|
227
|
+
})[];
|
|
152
228
|
};
|
|
153
229
|
resetPaddings: {
|
|
154
230
|
type: string;
|
|
@@ -39,6 +39,84 @@ export declare const CTA: {
|
|
|
39
39
|
resetMargin: {
|
|
40
40
|
type: string;
|
|
41
41
|
};
|
|
42
|
+
analyticsEvents: {
|
|
43
|
+
anyOf: ({
|
|
44
|
+
type: string;
|
|
45
|
+
additionalProperties: {
|
|
46
|
+
type: string;
|
|
47
|
+
};
|
|
48
|
+
required: string[];
|
|
49
|
+
properties: {
|
|
50
|
+
name: {
|
|
51
|
+
type: string;
|
|
52
|
+
};
|
|
53
|
+
type: {
|
|
54
|
+
type: string;
|
|
55
|
+
};
|
|
56
|
+
counters: {
|
|
57
|
+
type: string;
|
|
58
|
+
additionalProperties: boolean;
|
|
59
|
+
required: never[];
|
|
60
|
+
properties: {
|
|
61
|
+
include: {
|
|
62
|
+
type: string;
|
|
63
|
+
items: {
|
|
64
|
+
type: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
exclude: {
|
|
68
|
+
type: string;
|
|
69
|
+
items: {
|
|
70
|
+
type: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
context: {
|
|
76
|
+
type: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
} | {
|
|
80
|
+
type: string;
|
|
81
|
+
items: {
|
|
82
|
+
type: string;
|
|
83
|
+
additionalProperties: {
|
|
84
|
+
type: string;
|
|
85
|
+
};
|
|
86
|
+
required: string[];
|
|
87
|
+
properties: {
|
|
88
|
+
name: {
|
|
89
|
+
type: string;
|
|
90
|
+
};
|
|
91
|
+
type: {
|
|
92
|
+
type: string;
|
|
93
|
+
};
|
|
94
|
+
counters: {
|
|
95
|
+
type: string;
|
|
96
|
+
additionalProperties: boolean;
|
|
97
|
+
required: never[];
|
|
98
|
+
properties: {
|
|
99
|
+
include: {
|
|
100
|
+
type: string;
|
|
101
|
+
items: {
|
|
102
|
+
type: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
exclude: {
|
|
106
|
+
type: string;
|
|
107
|
+
items: {
|
|
108
|
+
type: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
context: {
|
|
114
|
+
type: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
})[];
|
|
119
|
+
};
|
|
42
120
|
};
|
|
43
121
|
contentType?: undefined;
|
|
44
122
|
})[];
|
|
@@ -93,17 +171,6 @@ export declare const CTA: {
|
|
|
93
171
|
};
|
|
94
172
|
};
|
|
95
173
|
};
|
|
96
|
-
labels: {
|
|
97
|
-
type: string;
|
|
98
|
-
items: {
|
|
99
|
-
type: string;
|
|
100
|
-
properties: {
|
|
101
|
-
when: {
|
|
102
|
-
type: string;
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
174
|
controlPosition: {
|
|
108
175
|
type: string;
|
|
109
176
|
enum: string[];
|
|
@@ -147,8 +214,17 @@ export declare const CTA: {
|
|
|
147
214
|
};
|
|
148
215
|
};
|
|
149
216
|
visible: {
|
|
150
|
-
|
|
151
|
-
|
|
217
|
+
oneOf: ({
|
|
218
|
+
type: string;
|
|
219
|
+
enum: string[];
|
|
220
|
+
additionalProperties?: undefined;
|
|
221
|
+
properties?: undefined;
|
|
222
|
+
} | {
|
|
223
|
+
type: string;
|
|
224
|
+
additionalProperties: boolean;
|
|
225
|
+
properties: {};
|
|
226
|
+
enum?: undefined;
|
|
227
|
+
})[];
|
|
152
228
|
};
|
|
153
229
|
resetPaddings: {
|
|
154
230
|
type: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/CTA/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,8BAA8B,CAAC;AAExD,OAAO,EAAC,SAAS,EAAC,+BAA4B;AAC9C,OAAO,EAAC,aAAa,EAAC,+BAA4B;AAElD,MAAM,EACF,SAAS,EAAE,EAAC,WAAW,EAAC,EACxB,MAAM,EAAE,EAAC,cAAc,EAAC,GAC3B,GAAG,UAAU,CAAC;AAEf,MAAM,CAAC,MAAM,GAAG,GAAG;IACf,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE;QACb,IAAI,EAAE,QAAQ;QACd,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,OAAO,CAAC;QACnB,UAAU,gDACH,cAAc,GACd,aAAa,KAChB,KAAK,EAAE;gBACH,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,oBAAoB,EAAE,KAAK;oBAC3B,QAAQ,EAAE,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/CTA/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,8BAA8B,CAAC;AAExD,OAAO,EAAC,SAAS,EAAC,+BAA4B;AAC9C,OAAO,EAAC,aAAa,EAAC,+BAA4B;AAElD,MAAM,EACF,SAAS,EAAE,EAAC,WAAW,EAAC,EACxB,MAAM,EAAE,EAAC,cAAc,EAAC,GAC3B,GAAG,UAAU,CAAC;AAEf,MAAM,CAAC,MAAM,GAAG,GAAG;IACf,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE;QACb,IAAI,EAAE,QAAQ;QACd,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,OAAO,CAAC;QACnB,UAAU,gDACH,cAAc,GACd,aAAa,KAChB,KAAK,EAAE;gBACH,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,oBAAoB,EAAE,KAAK;oBAC3B,QAAQ,EAAE,CAAC,OAAO,CAAC;oBACnB,UAAU,oBACH,WAAW,CACjB;iBACJ;aACJ,GACJ;KACJ;CACJ,CAAC","sourcesContent":["import {validators} from '@gravity-ui/page-constructor';\n\nimport {BlockType} from '../../models/common';\nimport {BlogBlockBase} from '../../schema/common';\n\nconst {\n subBlocks: {ContentBase},\n common: {BlockBaseProps},\n} = validators;\n\nexport const CTA = {\n [BlockType.CTA]: {\n type: 'object',\n additionalProperties: false,\n required: ['items'],\n properties: {\n ...BlockBaseProps,\n ...BlogBlockBase,\n items: {\n type: 'array',\n items: {\n type: 'object',\n additionalProperties: false,\n required: ['title'],\n properties: {\n ...ContentBase,\n },\n },\n },\n },\n },\n};\n"]}
|
|
@@ -24,9 +24,9 @@ export declare const ColoredText: {
|
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
} | {
|
|
27
|
+
optionName: string;
|
|
27
28
|
type: string;
|
|
28
29
|
pattern: string;
|
|
29
|
-
optionName: string;
|
|
30
30
|
items?: undefined;
|
|
31
31
|
} | {
|
|
32
32
|
type: string;
|
|
@@ -39,7 +39,6 @@ export declare const ColoredText: {
|
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
optionName: string;
|
|
42
|
-
pattern?: undefined;
|
|
43
42
|
})[];
|
|
44
43
|
} & {
|
|
45
44
|
optionName: string;
|
|
@@ -92,6 +91,84 @@ export declare const ColoredText: {
|
|
|
92
91
|
resetMargin: {
|
|
93
92
|
type: string;
|
|
94
93
|
};
|
|
94
|
+
analyticsEvents: {
|
|
95
|
+
anyOf: ({
|
|
96
|
+
type: string;
|
|
97
|
+
additionalProperties: {
|
|
98
|
+
type: string;
|
|
99
|
+
};
|
|
100
|
+
required: string[];
|
|
101
|
+
properties: {
|
|
102
|
+
name: {
|
|
103
|
+
type: string;
|
|
104
|
+
};
|
|
105
|
+
type: {
|
|
106
|
+
type: string;
|
|
107
|
+
};
|
|
108
|
+
counters: {
|
|
109
|
+
type: string;
|
|
110
|
+
additionalProperties: boolean;
|
|
111
|
+
required: never[];
|
|
112
|
+
properties: {
|
|
113
|
+
include: {
|
|
114
|
+
type: string;
|
|
115
|
+
items: {
|
|
116
|
+
type: string;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
exclude: {
|
|
120
|
+
type: string;
|
|
121
|
+
items: {
|
|
122
|
+
type: string;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
context: {
|
|
128
|
+
type: string;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
} | {
|
|
132
|
+
type: string;
|
|
133
|
+
items: {
|
|
134
|
+
type: string;
|
|
135
|
+
additionalProperties: {
|
|
136
|
+
type: string;
|
|
137
|
+
};
|
|
138
|
+
required: string[];
|
|
139
|
+
properties: {
|
|
140
|
+
name: {
|
|
141
|
+
type: string;
|
|
142
|
+
};
|
|
143
|
+
type: {
|
|
144
|
+
type: string;
|
|
145
|
+
};
|
|
146
|
+
counters: {
|
|
147
|
+
type: string;
|
|
148
|
+
additionalProperties: boolean;
|
|
149
|
+
required: never[];
|
|
150
|
+
properties: {
|
|
151
|
+
include: {
|
|
152
|
+
type: string;
|
|
153
|
+
items: {
|
|
154
|
+
type: string;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
exclude: {
|
|
158
|
+
type: string;
|
|
159
|
+
items: {
|
|
160
|
+
type: string;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
context: {
|
|
166
|
+
type: string;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
})[];
|
|
171
|
+
};
|
|
95
172
|
};
|
|
96
173
|
contentType?: undefined;
|
|
97
174
|
})[];
|
|
@@ -146,17 +223,6 @@ export declare const ColoredText: {
|
|
|
146
223
|
};
|
|
147
224
|
};
|
|
148
225
|
};
|
|
149
|
-
labels: {
|
|
150
|
-
type: string;
|
|
151
|
-
items: {
|
|
152
|
-
type: string;
|
|
153
|
-
properties: {
|
|
154
|
-
when: {
|
|
155
|
-
type: string;
|
|
156
|
-
};
|
|
157
|
-
};
|
|
158
|
-
};
|
|
159
|
-
};
|
|
160
226
|
controlPosition: {
|
|
161
227
|
type: string;
|
|
162
228
|
enum: string[];
|
|
@@ -197,8 +263,17 @@ export declare const ColoredText: {
|
|
|
197
263
|
};
|
|
198
264
|
};
|
|
199
265
|
visible: {
|
|
200
|
-
|
|
201
|
-
|
|
266
|
+
oneOf: ({
|
|
267
|
+
type: string;
|
|
268
|
+
enum: string[];
|
|
269
|
+
additionalProperties?: undefined;
|
|
270
|
+
properties?: undefined;
|
|
271
|
+
} | {
|
|
272
|
+
type: string;
|
|
273
|
+
additionalProperties: boolean;
|
|
274
|
+
properties: {};
|
|
275
|
+
enum?: undefined;
|
|
276
|
+
})[];
|
|
202
277
|
};
|
|
203
278
|
resetPaddings: {
|
|
204
279
|
type: string;
|
|
@@ -14,9 +14,9 @@ export declare const CompactMedia: {
|
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
} | {
|
|
17
|
+
optionName: string;
|
|
17
18
|
type: string;
|
|
18
19
|
pattern: string;
|
|
19
|
-
optionName: string;
|
|
20
20
|
items?: undefined;
|
|
21
21
|
} | {
|
|
22
22
|
type: string;
|
|
@@ -29,7 +29,6 @@ export declare const CompactMedia: {
|
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
31
|
optionName: string;
|
|
32
|
-
pattern?: undefined;
|
|
33
32
|
})[];
|
|
34
33
|
type?: undefined;
|
|
35
34
|
items?: undefined;
|
|
@@ -44,9 +43,9 @@ export declare const CompactMedia: {
|
|
|
44
43
|
};
|
|
45
44
|
};
|
|
46
45
|
} | {
|
|
46
|
+
optionName: string;
|
|
47
47
|
type: string;
|
|
48
48
|
pattern: string;
|
|
49
|
-
optionName: string;
|
|
50
49
|
items?: undefined;
|
|
51
50
|
} | {
|
|
52
51
|
type: string;
|
|
@@ -59,7 +58,6 @@ export declare const CompactMedia: {
|
|
|
59
58
|
};
|
|
60
59
|
};
|
|
61
60
|
optionName: string;
|
|
62
|
-
pattern?: undefined;
|
|
63
61
|
})[];
|
|
64
62
|
};
|
|
65
63
|
optionName: string;
|
|
@@ -105,8 +103,17 @@ export declare const CompactMedia: {
|
|
|
105
103
|
};
|
|
106
104
|
};
|
|
107
105
|
visible: {
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
oneOf: ({
|
|
107
|
+
type: string;
|
|
108
|
+
enum: string[];
|
|
109
|
+
additionalProperties?: undefined;
|
|
110
|
+
properties?: undefined;
|
|
111
|
+
} | {
|
|
112
|
+
type: string;
|
|
113
|
+
additionalProperties: boolean;
|
|
114
|
+
properties: {};
|
|
115
|
+
enum?: undefined;
|
|
116
|
+
})[];
|
|
110
117
|
};
|
|
111
118
|
resetPaddings: {
|
|
112
119
|
type: string;
|
|
@@ -27,8 +27,17 @@ export declare const Feed: {
|
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
visible: {
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
oneOf: ({
|
|
31
|
+
type: string;
|
|
32
|
+
enum: string[];
|
|
33
|
+
additionalProperties?: undefined;
|
|
34
|
+
properties?: undefined;
|
|
35
|
+
} | {
|
|
36
|
+
type: string;
|
|
37
|
+
additionalProperties: boolean;
|
|
38
|
+
properties: {};
|
|
39
|
+
enum?: undefined;
|
|
40
|
+
})[];
|
|
32
41
|
};
|
|
33
42
|
resetPaddings: {
|
|
34
43
|
type: string;
|