@gravity-ui/blog-constructor 11.0.1 → 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.
Files changed (105) hide show
  1. package/build/cjs/blocks/Author/schema.d.ts +14 -3
  2. package/build/cjs/blocks/Author/schema.js +1 -1
  3. package/build/cjs/blocks/Author/schema.js.map +1 -1
  4. package/build/cjs/blocks/Banner/Banner.js +5 -2
  5. package/build/cjs/blocks/Banner/Banner.js.map +1 -1
  6. package/build/cjs/blocks/Banner/schema.d.ts +89 -13
  7. package/build/cjs/blocks/CTA/schema.d.ts +89 -13
  8. package/build/cjs/blocks/CTA/schema.js +1 -1
  9. package/build/cjs/blocks/CTA/schema.js.map +1 -1
  10. package/build/cjs/blocks/ColoredText/ColoredText.js +4 -1
  11. package/build/cjs/blocks/ColoredText/ColoredText.js.map +1 -1
  12. package/build/cjs/blocks/ColoredText/schema.d.ts +124 -29
  13. package/build/cjs/blocks/ColoredText/schema.js +4 -4
  14. package/build/cjs/blocks/ColoredText/schema.js.map +1 -1
  15. package/build/cjs/blocks/CompactMedia/schema.d.ts +13 -6
  16. package/build/cjs/blocks/Feed/schema.d.ts +11 -2
  17. package/build/cjs/blocks/Form/schema.d.ts +69 -38
  18. package/build/cjs/blocks/Form/schema.js +5 -22
  19. package/build/cjs/blocks/Form/schema.js.map +1 -1
  20. package/build/cjs/blocks/Header/schema.d.ts +164 -73
  21. package/build/cjs/blocks/Header/schema.js +3 -1
  22. package/build/cjs/blocks/Header/schema.js.map +1 -1
  23. package/build/cjs/blocks/Layout/schema.d.ts +11 -2
  24. package/build/cjs/blocks/Media/schema.d.ts +13 -6
  25. package/build/cjs/blocks/Meta/schema.d.ts +11 -2
  26. package/build/cjs/blocks/SideCardList/schema.d.ts +69 -6
  27. package/build/cjs/blocks/SideCardList/schema.js +16 -19
  28. package/build/cjs/blocks/SideCardList/schema.js.map +1 -1
  29. package/build/cjs/blocks/Suggest/schema.d.ts +11 -2
  30. package/build/cjs/blocks/Take/schema.d.ts +25 -2
  31. package/build/cjs/blocks/Take/schema.js +2 -2
  32. package/build/cjs/blocks/Take/schema.js.map +1 -1
  33. package/build/cjs/blocks/YFM/schema.d.ts +11 -2
  34. package/build/cjs/constructor/blocksMap.d.ts +9 -9
  35. package/build/cjs/constructor/blocksMap.js +9 -9
  36. package/build/cjs/constructor/blocksMap.js.map +1 -1
  37. package/build/cjs/containers/BlogPostPage/BlogPostPage.css +9 -1
  38. package/build/cjs/hooks/useExtendedComponentMap.d.ts +9 -9
  39. package/build/cjs/models/blocks.d.ts +3 -3
  40. package/build/cjs/models/blocks.js.map +1 -1
  41. package/build/cjs/schema/blocks.d.ts +4 -2
  42. package/build/cjs/schema/blocks.js +4 -2
  43. package/build/cjs/schema/blocks.js.map +1 -1
  44. package/build/cjs/schema/common.d.ts +4 -0
  45. package/build/cjs/schema/common.js +8 -10
  46. package/build/cjs/schema/common.js.map +1 -1
  47. package/build/cjs/schema/index.d.ts +1044 -299
  48. package/build/cjs/schema/index.js +5 -3
  49. package/build/cjs/schema/index.js.map +1 -1
  50. package/build/cjs/utils/common.d.ts +1 -2
  51. package/build/esm/blocks/Author/schema.d.ts +14 -3
  52. package/build/esm/blocks/Author/schema.js +1 -1
  53. package/build/esm/blocks/Author/schema.js.map +1 -1
  54. package/build/esm/blocks/Banner/Banner.js +5 -2
  55. package/build/esm/blocks/Banner/Banner.js.map +1 -1
  56. package/build/esm/blocks/Banner/schema.d.ts +89 -13
  57. package/build/esm/blocks/CTA/schema.d.ts +89 -13
  58. package/build/esm/blocks/CTA/schema.js +1 -1
  59. package/build/esm/blocks/CTA/schema.js.map +1 -1
  60. package/build/esm/blocks/ColoredText/ColoredText.js +5 -2
  61. package/build/esm/blocks/ColoredText/ColoredText.js.map +1 -1
  62. package/build/esm/blocks/ColoredText/schema.d.ts +124 -29
  63. package/build/esm/blocks/ColoredText/schema.js +4 -4
  64. package/build/esm/blocks/ColoredText/schema.js.map +1 -1
  65. package/build/esm/blocks/CompactMedia/schema.d.ts +13 -6
  66. package/build/esm/blocks/Feed/schema.d.ts +11 -2
  67. package/build/esm/blocks/Form/schema.d.ts +69 -38
  68. package/build/esm/blocks/Form/schema.js +4 -21
  69. package/build/esm/blocks/Form/schema.js.map +1 -1
  70. package/build/esm/blocks/Header/schema.d.ts +164 -73
  71. package/build/esm/blocks/Header/schema.js +3 -1
  72. package/build/esm/blocks/Header/schema.js.map +1 -1
  73. package/build/esm/blocks/Layout/schema.d.ts +11 -2
  74. package/build/esm/blocks/Media/schema.d.ts +13 -6
  75. package/build/esm/blocks/Meta/schema.d.ts +11 -2
  76. package/build/esm/blocks/SideCardList/schema.d.ts +69 -6
  77. package/build/esm/blocks/SideCardList/schema.js +16 -19
  78. package/build/esm/blocks/SideCardList/schema.js.map +1 -1
  79. package/build/esm/blocks/Suggest/schema.d.ts +11 -2
  80. package/build/esm/blocks/Take/schema.d.ts +25 -2
  81. package/build/esm/blocks/Take/schema.js +3 -3
  82. package/build/esm/blocks/Take/schema.js.map +1 -1
  83. package/build/esm/blocks/YFM/schema.d.ts +11 -2
  84. package/build/esm/constructor/blocksMap.d.ts +9 -9
  85. package/build/esm/constructor/blocksMap.js +9 -9
  86. package/build/esm/constructor/blocksMap.js.map +1 -1
  87. package/build/esm/containers/BlogPostPage/BlogPostPage.css +9 -1
  88. package/build/esm/hooks/useExtendedComponentMap.d.ts +9 -9
  89. package/build/esm/models/blocks.d.ts +3 -3
  90. package/build/esm/models/blocks.js.map +1 -1
  91. package/build/esm/schema/blocks.d.ts +4 -2
  92. package/build/esm/schema/blocks.js +4 -2
  93. package/build/esm/schema/blocks.js.map +1 -1
  94. package/build/esm/schema/common.d.ts +4 -0
  95. package/build/esm/schema/common.js +7 -9
  96. package/build/esm/schema/common.js.map +1 -1
  97. package/build/esm/schema/index.d.ts +1044 -299
  98. package/build/esm/schema/index.js +5 -3
  99. package/build/esm/schema/index.js.map +1 -1
  100. package/build/esm/utils/common.d.ts +1 -2
  101. package/package.json +3 -3
  102. package/server/models/blocks.d.ts +3 -3
  103. package/styles/storybook/common.scss +6 -0
  104. package/styles/styles.css +9 -1
  105. package/styles/yfm.css +9 -1
@@ -5,7 +5,9 @@ export declare const Author: {
5
5
  required: string[];
6
6
  properties: {
7
7
  authorId: {
8
- type: string;
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
- type: string;
47
- enum: string[];
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;
@@ -11,7 +11,7 @@ exports.Author = {
11
11
  additionalProperties: false,
12
12
  required: ['authorId'],
13
13
  properties: Object.assign(Object.assign(Object.assign({}, BlockBaseProps), common_2.BlogBlockBase), { authorId: {
14
- type: 'number',
14
+ oneOf: [{ type: 'number' }, { type: 'string' }],
15
15
  } }),
16
16
  },
17
17
  };
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/Author/schema.ts"],"names":[],"mappings":";;;AAAA,mEAAwD;AAExD,MAAM,EACF,MAAM,EAAE,EAAC,cAAc,EAAC,GAC3B,GAAG,6BAAU,CAAC;AAEf,mDAA8C;AAC9C,mDAAkD;AAErC,QAAA,MAAM,GAAG;IAClB,CAAC,kBAAS,CAAC,MAAM,CAAC,EAAE;QAChB,IAAI,EAAE,QAAQ;QACd,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,UAAU,CAAC;QACtB,UAAU,gDACH,cAAc,GACd,sBAAa,KAChB,QAAQ,EAAE;gBACN,IAAI,EAAE,QAAQ;aACjB,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 type: 'number',\n },\n },\n },\n};\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/Author/schema.ts"],"names":[],"mappings":";;;AAAA,mEAAwD;AAExD,MAAM,EACF,MAAM,EAAE,EAAC,cAAc,EAAC,GAC3B,GAAG,6BAAU,CAAC;AAEf,mDAA8C;AAC9C,mDAAkD;AAErC,QAAA,MAAM,GAAG;IAClB,CAAC,kBAAS,CAAC,MAAM,CAAC,EAAE;QAChB,IAAI,EAAE,QAAQ;QACd,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,UAAU,CAAC;QACtB,UAAU,gDACH,cAAc,GACd,sBAAa,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"]}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Banner = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const React = tslib_1.__importStar(require("react"));
6
7
  const page_constructor_1 = require("@gravity-ui/page-constructor");
7
8
  const Wrapper_1 = require("../../components/Wrapper/Wrapper.js");
8
9
  const constants_1 = require("../../constants.js");
@@ -26,8 +27,10 @@ const Banner = (_a) => {
26
27
  }
27
28
  const contentData = (0, common_1.updateContentSizes)(content);
28
29
  (_b = contentData.buttons) === null || _b === void 0 ? void 0 : _b.forEach((button) => {
29
- // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign
30
- button.analyticsEvents = (0, common_1.getMergedAnalyticsEvents)(buttonGoals, button.analyticsEvents);
30
+ if (!React.isValidElement(button)) {
31
+ const buttonConfig = button;
32
+ buttonConfig.analyticsEvents = (0, common_1.getMergedAnalyticsEvents)(buttonGoals, buttonConfig.analyticsEvents);
33
+ }
31
34
  });
32
35
  return ((0, jsx_runtime_1.jsx)(Wrapper_1.Wrapper, { paddings: {
33
36
  [paddings_1.PaddingsDirections.top]: paddingTop,
@@ -1 +1 @@
1
- {"version":3,"file":"Banner.js","sourceRoot":"../../../../src","sources":["blocks/Banner/Banner.tsx"],"names":[],"mappings":";;;;;AAAA,mEAA4D;AAE5D,iEAAyD;AACzD,kDAA+C;AAC/C,mDAAsD;AAEtD,uDAAyD;AACzD,0CAAqC;AACrC,kDAK4B;AAI5B,MAAM,CAAC,GAAG,IAAA,UAAK,EAAC,QAAQ,CAAC,CAAC;AAE1B,MAAM,2BAA2B,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAExD,MAAM,WAAW,GAAG,IAAA,8BAAqB,EAAC;IACtC,IAAI,EAAE,0BAAc,CAAC,YAAY;IACjC,OAAO,EAAE,wBAAgB,CAAC,SAAS;CACtC,CAAC,CAAC;AAEI,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,sBAPS,oEAQtB,CADa;IAEV,MAAM,YAAY,GAA2B,EAAE,CAAC;IAChD,MAAM,YAAY,GAAG,IAAA,wBAAe,EAAC,EAAE,EAAE,2BAA2B,CAAC,CAAC;IAEtE,IAAI,KAAK,EAAE,CAAC;QACR,YAAY,CAAC,eAAe,GAAG,KAAK,CAAC;IACzC,CAAC;IAED,MAAM,WAAW,GAAG,IAAA,2BAAkB,EAAC,OAAO,CAAC,CAAC;IAEhD,MAAA,WAAW,CAAC,OAAO,0CAAE,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACpC,mFAAmF;QACnF,MAAM,CAAC,eAAe,GAAG,IAAA,iCAAwB,EAAC,WAAW,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC;IAC3F,CAAC,CAAC,CAAC;IAEH,OAAO,CACH,uBAAC,iBAAO,IACJ,QAAQ,EAAE;YACN,CAAC,6BAAkB,CAAC,GAAG,CAAC,EAAE,UAAU;YACpC,CAAC,6BAAkB,CAAC,MAAM,CAAC,EAAE,aAAa;SAC7C,EACD,EAAE,EAAE,YAAY,CAAC,OAAO,EACxB,SAAS,EAAE,CAAC,CAAC,WAAW,CAAC,YAEzB,iCAAK,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,YAAY,aAAW,YAAY,CAAC,OAAO,aAC5E,gCAAK,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,YACrB,uBAAC,0BAAO,oBAAK,WAAW,IAAE,EAAE,EAAE,YAAY,CAAC,OAAO,IAAI,GACpD,EACL,KAAK,IAAI,CACN,gCACI,SAAS,EAAE,CAAC,CAAC,iBAAiB,EAAE,EAAC,CAAC,YAAY,CAAC,EAAE,SAAS,EAAC,CAAC,aACnD,YAAY,CAAC,cAAc,YAEpC,uBAAC,wBAAK,IAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,KAAK,GAAI,GAC1C,CACT,IACC,GACA,CACb,CAAC;AACN,CAAC,CAAC;AA/CW,QAAA,MAAM,UA+CjB","sourcesContent":["import {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 // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign\n button.analyticsEvents = getMergedAnalyticsEvents(buttonGoals, button.analyticsEvents);\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"]}
1
+ {"version":3,"file":"Banner.js","sourceRoot":"../../../../src","sources":["blocks/Banner/Banner.tsx"],"names":[],"mappings":";;;;;AAAA,qDAA+B;AAE/B,mEAAyE;AAEzE,iEAAyD;AACzD,kDAA+C;AAC/C,mDAAsD;AAEtD,uDAAyD;AACzD,0CAAqC;AACrC,kDAK4B;AAI5B,MAAM,CAAC,GAAG,IAAA,UAAK,EAAC,QAAQ,CAAC,CAAC;AAE1B,MAAM,2BAA2B,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAExD,MAAM,WAAW,GAAG,IAAA,8BAAqB,EAAC;IACtC,IAAI,EAAE,0BAAc,CAAC,YAAY;IACjC,OAAO,EAAE,wBAAgB,CAAC,SAAS;CACtC,CAAC,CAAC;AAEI,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,sBAPS,oEAQtB,CADa;IAEV,MAAM,YAAY,GAA2B,EAAE,CAAC;IAChD,MAAM,YAAY,GAAG,IAAA,wBAAe,EAAC,EAAE,EAAE,2BAA2B,CAAC,CAAC;IAEtE,IAAI,KAAK,EAAE,CAAC;QACR,YAAY,CAAC,eAAe,GAAG,KAAK,CAAC;IACzC,CAAC;IAED,MAAM,WAAW,GAAG,IAAA,2BAAkB,EAAC,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,IAAA,iCAAwB,EACnD,WAAW,EACX,YAAY,CAAC,eAAe,CAC/B,CAAC;QACN,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,CACH,uBAAC,iBAAO,IACJ,QAAQ,EAAE;YACN,CAAC,6BAAkB,CAAC,GAAG,CAAC,EAAE,UAAU;YACpC,CAAC,6BAAkB,CAAC,MAAM,CAAC,EAAE,aAAa;SAC7C,EACD,EAAE,EAAE,YAAY,CAAC,OAAO,EACxB,SAAS,EAAE,CAAC,CAAC,WAAW,CAAC,YAEzB,iCAAK,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,YAAY,aAAW,YAAY,CAAC,OAAO,aAC5E,gCAAK,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,YACrB,uBAAC,0BAAO,oBAAK,WAAW,IAAE,EAAE,EAAE,YAAY,CAAC,OAAO,IAAI,GACpD,EACL,KAAK,IAAI,CACN,gCACI,SAAS,EAAE,CAAC,CAAC,iBAAiB,EAAE,EAAC,CAAC,YAAY,CAAC,EAAE,SAAS,EAAC,CAAC,aACnD,YAAY,CAAC,cAAc,YAEpC,uBAAC,wBAAK,IAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,KAAK,GAAI,GAC1C,CACT,IACC,GACA,CACb,CAAC;AACN,CAAC,CAAC;AArDW,QAAA,MAAM,UAqDjB","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
- type: string;
151
- enum: string[];
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
- type: string;
151
- enum: string[];
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;
@@ -15,7 +15,7 @@ exports.CTA = {
15
15
  items: {
16
16
  type: 'object',
17
17
  additionalProperties: false,
18
- required: ['title', 'links'],
18
+ required: ['title'],
19
19
  properties: Object.assign({}, ContentBase),
20
20
  },
21
21
  } }),
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/CTA/schema.ts"],"names":[],"mappings":";;;AAAA,mEAAwD;AAExD,mDAA8C;AAC9C,mDAAkD;AAElD,MAAM,EACF,SAAS,EAAE,EAAC,WAAW,EAAC,EACxB,MAAM,EAAE,EAAC,cAAc,EAAC,GAC3B,GAAG,6BAAU,CAAC;AAEF,QAAA,GAAG,GAAG;IACf,CAAC,kBAAS,CAAC,GAAG,CAAC,EAAE;QACb,IAAI,EAAE,QAAQ;QACd,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,OAAO,CAAC;QACnB,UAAU,gDACH,cAAc,GACd,sBAAa,KAChB,KAAK,EAAE;gBACH,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,oBAAoB,EAAE,KAAK;oBAC3B,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;oBAC5B,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', 'links'],\n properties: {\n ...ContentBase,\n },\n },\n },\n },\n },\n};\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/CTA/schema.ts"],"names":[],"mappings":";;;AAAA,mEAAwD;AAExD,mDAA8C;AAC9C,mDAAkD;AAElD,MAAM,EACF,SAAS,EAAE,EAAC,WAAW,EAAC,EACxB,MAAM,EAAE,EAAC,cAAc,EAAC,GAC3B,GAAG,6BAAU,CAAC;AAEF,QAAA,GAAG,GAAG;IACf,CAAC,kBAAS,CAAC,GAAG,CAAC,EAAE;QACb,IAAI,EAAE,QAAQ;QACd,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,OAAO,CAAC;QACnB,UAAU,gDACH,cAAc,GACd,sBAAa,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"]}
@@ -13,10 +13,13 @@ const ColoredText = (_a) => {
13
13
  var { background, paddingTop, paddingBottom, qa } = _a, content = tslib_1.__rest(_a, ["background", "paddingTop", "paddingBottom", "qa"]);
14
14
  const contentData = (0, common_1.updateContentSizes)(content);
15
15
  const qaAttributes = (0, common_1.getQaAttributes)(qa);
16
+ const theme = (0, page_constructor_1.useTheme)();
17
+ const themedColor = (0, page_constructor_1.getThemedValue)(background === null || background === void 0 ? void 0 : background.color, theme);
18
+ const themedImage = (0, page_constructor_1.getThemedValue)(background === null || background === void 0 ? void 0 : background.image, theme);
16
19
  return ((0, jsx_runtime_1.jsx)(Wrapper_1.Wrapper, { paddings: {
17
20
  [paddings_1.PaddingsDirections.top]: paddingTop,
18
21
  [paddings_1.PaddingsDirections.bottom]: paddingBottom,
19
- }, qa: qaAttributes.wrapper, children: (0, jsx_runtime_1.jsxs)("div", { className: b('container'), style: { backgroundColor: (background === null || background === void 0 ? void 0 : background.color) || 'none' }, "data-qa": qaAttributes.container, children: [(0, jsx_runtime_1.jsx)("div", { className: b('picture-container'), children: (background === null || background === void 0 ? void 0 : background.image) && ((0, jsx_runtime_1.jsx)(page_constructor_1.BackgroundImage, { className: b('picture'), alt: background === null || background === void 0 ? void 0 : background.altText, src: background === null || background === void 0 ? void 0 : background.image })) }), (0, jsx_runtime_1.jsx)("div", { className: b('text-content'), children: (0, jsx_runtime_1.jsx)(page_constructor_1.Content, Object.assign({}, contentData, { qa: qaAttributes.content })) })] }) }));
22
+ }, qa: qaAttributes.wrapper, children: (0, jsx_runtime_1.jsxs)("div", { className: b('container'), style: { backgroundColor: themedColor || 'none' }, "data-qa": qaAttributes.container, children: [(0, jsx_runtime_1.jsx)("div", { className: b('picture-container'), children: themedImage && ((0, jsx_runtime_1.jsx)(page_constructor_1.BackgroundImage, { className: b('picture'), alt: background === null || background === void 0 ? void 0 : background.altText, src: themedImage })) }), (0, jsx_runtime_1.jsx)("div", { className: b('text-content'), children: (0, jsx_runtime_1.jsx)(page_constructor_1.Content, Object.assign({}, contentData, { qa: qaAttributes.content })) })] }) }));
20
23
  };
21
24
  exports.ColoredText = ColoredText;
22
25
  //# sourceMappingURL=ColoredText.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColoredText.js","sourceRoot":"../../../../src","sources":["blocks/ColoredText/ColoredText.tsx"],"names":[],"mappings":";;;;;AAAA,mEAAsE;AAEtE,iEAAyD;AAEzD,uDAAyD;AACzD,0CAAqC;AACrC,kDAAuE;AAIvE,MAAM,CAAC,GAAG,IAAA,UAAK,EAAC,cAAc,CAAC,CAAC;AAEzB,MAAM,WAAW,GAAG,CAAC,EAMT,EAAE,EAAE;QANK,EACxB,UAAU,EACV,UAAU,EACV,aAAa,EACb,EAAE,OAEa,EADZ,OAAO,sBALc,mDAM3B,CADa;IAEV,MAAM,WAAW,GAAG,IAAA,2BAAkB,EAAC,OAAO,CAAC,CAAC;IAChD,MAAM,YAAY,GAAG,IAAA,wBAAe,EAAC,EAAE,CAAC,CAAC;IAEzC,OAAO,CACH,uBAAC,iBAAO,IACJ,QAAQ,EAAE;YACN,CAAC,6BAAkB,CAAC,GAAG,CAAC,EAAE,UAAU;YACpC,CAAC,6BAAkB,CAAC,MAAM,CAAC,EAAE,aAAa;SAC7C,EACD,EAAE,EAAE,YAAY,CAAC,OAAO,YAExB,iCACI,SAAS,EAAE,CAAC,CAAC,WAAW,CAAC,EACzB,KAAK,EAAE,EAAC,eAAe,EAAE,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,KAAI,MAAM,EAAC,aAC5C,YAAY,CAAC,SAAS,aAE/B,gCAAK,SAAS,EAAE,CAAC,CAAC,mBAAmB,CAAC,YACjC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,KAAI,CAClB,uBAAC,kCAAe,IACZ,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,EACvB,GAAG,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,OAAO,EACxB,GAAG,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,GACxB,CACL,GACC,EACN,gCAAK,SAAS,EAAE,CAAC,CAAC,cAAc,CAAC,YAC7B,uBAAC,0BAAO,oBAAK,WAAW,IAAE,EAAE,EAAE,YAAY,CAAC,OAAO,IAAI,GACpD,IACJ,GACA,CACb,CAAC;AACN,CAAC,CAAC;AAtCW,QAAA,WAAW,eAsCtB","sourcesContent":["import {BackgroundImage, Content} from '@gravity-ui/page-constructor';\n\nimport {Wrapper} from '../../components/Wrapper/Wrapper';\nimport {ColoredTextProps} from '../../models/blocks';\nimport {PaddingsDirections} from '../../models/paddings';\nimport {block} from '../../utils/cn';\nimport {getQaAttributes, updateContentSizes} from '../../utils/common';\n\nimport './ColoredText.scss';\n\nconst b = block('colored-text');\n\nexport const ColoredText = ({\n background,\n paddingTop,\n paddingBottom,\n qa,\n ...content\n}: ColoredTextProps) => {\n const contentData = updateContentSizes(content);\n const qaAttributes = getQaAttributes(qa);\n\n return (\n <Wrapper\n paddings={{\n [PaddingsDirections.top]: paddingTop,\n [PaddingsDirections.bottom]: paddingBottom,\n }}\n qa={qaAttributes.wrapper}\n >\n <div\n className={b('container')}\n style={{backgroundColor: background?.color || 'none'}}\n data-qa={qaAttributes.container}\n >\n <div className={b('picture-container')}>\n {background?.image && (\n <BackgroundImage\n className={b('picture')}\n alt={background?.altText}\n src={background?.image}\n />\n )}\n </div>\n <div className={b('text-content')}>\n <Content {...contentData} qa={qaAttributes.content} />\n </div>\n </div>\n </Wrapper>\n );\n};\n"]}
1
+ {"version":3,"file":"ColoredText.js","sourceRoot":"../../../../src","sources":["blocks/ColoredText/ColoredText.tsx"],"names":[],"mappings":";;;;;AAAA,mEAAgG;AAEhG,iEAAyD;AAEzD,uDAAyD;AACzD,0CAAqC;AACrC,kDAAuE;AAIvE,MAAM,CAAC,GAAG,IAAA,UAAK,EAAC,cAAc,CAAC,CAAC;AAEzB,MAAM,WAAW,GAAG,CAAC,EAMT,EAAE,EAAE;QANK,EACxB,UAAU,EACV,UAAU,EACV,aAAa,EACb,EAAE,OAEa,EADZ,OAAO,sBALc,mDAM3B,CADa;IAEV,MAAM,WAAW,GAAG,IAAA,2BAAkB,EAAC,OAAO,CAAC,CAAC;IAChD,MAAM,YAAY,GAAG,IAAA,wBAAe,EAAC,EAAE,CAAC,CAAC;IACzC,MAAM,KAAK,GAAG,IAAA,2BAAQ,GAAE,CAAC;IAEzB,MAAM,WAAW,GAAG,IAAA,iCAAc,EAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAC7D,MAAM,WAAW,GAAG,IAAA,iCAAc,EAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAE7D,OAAO,CACH,uBAAC,iBAAO,IACJ,QAAQ,EAAE;YACN,CAAC,6BAAkB,CAAC,GAAG,CAAC,EAAE,UAAU;YACpC,CAAC,6BAAkB,CAAC,MAAM,CAAC,EAAE,aAAa;SAC7C,EACD,EAAE,EAAE,YAAY,CAAC,OAAO,YAExB,iCACI,SAAS,EAAE,CAAC,CAAC,WAAW,CAAC,EACzB,KAAK,EAAE,EAAC,eAAe,EAAE,WAAW,IAAI,MAAM,EAAC,aACtC,YAAY,CAAC,SAAS,aAE/B,gCAAK,SAAS,EAAE,CAAC,CAAC,mBAAmB,CAAC,YACjC,WAAW,IAAI,CACZ,uBAAC,kCAAe,IACZ,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,EACvB,GAAG,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,OAAO,EACxB,GAAG,EAAE,WAAW,GAClB,CACL,GACC,EACN,gCAAK,SAAS,EAAE,CAAC,CAAC,cAAc,CAAC,YAC7B,uBAAC,0BAAO,oBAAK,WAAW,IAAE,EAAE,EAAE,YAAY,CAAC,OAAO,IAAI,GACpD,IACJ,GACA,CACb,CAAC;AACN,CAAC,CAAC;AA1CW,QAAA,WAAW,eA0CtB","sourcesContent":["import {BackgroundImage, Content, getThemedValue, useTheme} from '@gravity-ui/page-constructor';\n\nimport {Wrapper} from '../../components/Wrapper/Wrapper';\nimport {ColoredTextProps} from '../../models/blocks';\nimport {PaddingsDirections} from '../../models/paddings';\nimport {block} from '../../utils/cn';\nimport {getQaAttributes, updateContentSizes} from '../../utils/common';\n\nimport './ColoredText.scss';\n\nconst b = block('colored-text');\n\nexport const ColoredText = ({\n background,\n paddingTop,\n paddingBottom,\n qa,\n ...content\n}: ColoredTextProps) => {\n const contentData = updateContentSizes(content);\n const qaAttributes = getQaAttributes(qa);\n const theme = useTheme();\n\n const themedColor = getThemedValue(background?.color, theme);\n const themedImage = getThemedValue(background?.image, theme);\n\n return (\n <Wrapper\n paddings={{\n [PaddingsDirections.top]: paddingTop,\n [PaddingsDirections.bottom]: paddingBottom,\n }}\n qa={qaAttributes.wrapper}\n >\n <div\n className={b('container')}\n style={{backgroundColor: themedColor || 'none'}}\n data-qa={qaAttributes.container}\n >\n <div className={b('picture-container')}>\n {themedImage && (\n <BackgroundImage\n className={b('picture')}\n alt={background?.altText}\n src={themedImage}\n />\n )}\n </div>\n <div className={b('text-content')}>\n <Content {...contentData} qa={qaAttributes.content} />\n </div>\n </div>\n </Wrapper>\n );\n};\n"]}
@@ -11,32 +11,51 @@ export declare const ColoredText: {
11
11
  image: {
12
12
  oneOf: ({
13
13
  type: string;
14
- properties: {
15
- when: {
16
- type: string;
17
- };
18
- };
19
- } | {
20
- type: string;
21
- pattern: string;
14
+ additionalProperties: boolean;
15
+ required: import("@gravity-ui/page-constructor").Theme[];
16
+ properties: {};
22
17
  optionName: string;
23
- items?: undefined;
24
- } | {
25
- type: string;
26
- items: {
18
+ } | ({
19
+ oneOf: ({
27
20
  type: string;
28
21
  properties: {
29
22
  when: {
30
23
  type: string;
31
24
  };
32
25
  };
33
- };
26
+ } | {
27
+ optionName: string;
28
+ type: string;
29
+ pattern: string;
30
+ items?: undefined;
31
+ } | {
32
+ type: string;
33
+ items: {
34
+ type: string;
35
+ properties: {
36
+ when: {
37
+ type: string;
38
+ };
39
+ };
40
+ };
41
+ optionName: string;
42
+ })[];
43
+ } & {
34
44
  optionName: string;
35
- pattern?: undefined;
36
- })[];
45
+ }))[];
37
46
  };
38
47
  color: {
39
- type: string;
48
+ oneOf: ({
49
+ type: string;
50
+ additionalProperties: boolean;
51
+ required: import("@gravity-ui/page-constructor").Theme[];
52
+ properties: {};
53
+ optionName: string;
54
+ } | ({
55
+ type: string;
56
+ } & {
57
+ optionName: string;
58
+ }))[];
40
59
  };
41
60
  altText: {
42
61
  type: string;
@@ -72,6 +91,84 @@ export declare const ColoredText: {
72
91
  resetMargin: {
73
92
  type: string;
74
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
+ };
75
172
  };
76
173
  contentType?: undefined;
77
174
  })[];
@@ -126,17 +223,6 @@ export declare const ColoredText: {
126
223
  };
127
224
  };
128
225
  };
129
- labels: {
130
- type: string;
131
- items: {
132
- type: string;
133
- properties: {
134
- when: {
135
- type: string;
136
- };
137
- };
138
- };
139
- };
140
226
  controlPosition: {
141
227
  type: string;
142
228
  enum: string[];
@@ -177,8 +263,17 @@ export declare const ColoredText: {
177
263
  };
178
264
  };
179
265
  visible: {
180
- type: string;
181
- enum: string[];
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
+ })[];
182
277
  };
183
278
  resetPaddings: {
184
279
  type: string;
@@ -4,15 +4,15 @@ exports.ColoredText = void 0;
4
4
  const page_constructor_1 = require("@gravity-ui/page-constructor");
5
5
  const common_1 = require("../../models/common.js");
6
6
  const common_2 = require("../../schema/common.js");
7
- const { subBlocks: { ContentBase }, components: { ImageProps }, common: { BlockBaseProps }, } = page_constructor_1.validators;
7
+ const { subBlocks: { ContentBase }, components: { ImageProps }, common: { BlockBaseProps, withTheme }, } = page_constructor_1.validators;
8
8
  const BackgroundProps = {
9
9
  type: 'object',
10
10
  additionalProperties: false,
11
11
  properties: {
12
- image: ImageProps,
13
- color: {
12
+ image: withTheme(ImageProps),
13
+ color: withTheme({
14
14
  type: 'string',
15
- },
15
+ }),
16
16
  altText: {
17
17
  type: 'string',
18
18
  contentType: 'text',
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/ColoredText/schema.ts"],"names":[],"mappings":";;;AAAA,mEAAwD;AAExD,mDAA8C;AAC9C,mDAAkD;AAElD,MAAM,EACF,SAAS,EAAE,EAAC,WAAW,EAAC,EACxB,UAAU,EAAE,EAAC,UAAU,EAAC,EACxB,MAAM,EAAE,EAAC,cAAc,EAAC,GAC3B,GAAG,6BAAU,CAAC;AAEf,MAAM,eAAe,GAAG;IACpB,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACR,KAAK,EAAE,UAAU;QACjB,KAAK,EAAE;YACH,IAAI,EAAE,QAAQ;SACjB;QACD,OAAO,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,MAAM;SACtB;KACJ;CACJ,CAAC;AAEW,QAAA,WAAW,GAAG;IACvB,CAAC,kBAAS,CAAC,WAAW,CAAC,EAAE;QACrB,IAAI,EAAE,QAAQ;QACd,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,MAAM,CAAC;QAClB,UAAU,8DACH,cAAc,GACd,sBAAa,GACb,WAAW,KACd,UAAU,EAAE,eAAe,GAC9B;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 components: {ImageProps},\n common: {BlockBaseProps},\n} = validators;\n\nconst BackgroundProps = {\n type: 'object',\n additionalProperties: false,\n properties: {\n image: ImageProps,\n color: {\n type: 'string',\n },\n altText: {\n type: 'string',\n contentType: 'text',\n },\n },\n};\n\nexport const ColoredText = {\n [BlockType.ColoredText]: {\n type: 'object',\n additionalProperties: false,\n required: ['text'],\n properties: {\n ...BlockBaseProps,\n ...BlogBlockBase,\n ...ContentBase,\n background: BackgroundProps,\n },\n },\n};\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/ColoredText/schema.ts"],"names":[],"mappings":";;;AAAA,mEAAwD;AAExD,mDAA8C;AAC9C,mDAAkD;AAElD,MAAM,EACF,SAAS,EAAE,EAAC,WAAW,EAAC,EACxB,UAAU,EAAE,EAAC,UAAU,EAAC,EACxB,MAAM,EAAE,EAAC,cAAc,EAAE,SAAS,EAAC,GACtC,GAAG,6BAAU,CAAC;AAEf,MAAM,eAAe,GAAG;IACpB,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACR,KAAK,EAAE,SAAS,CAAC,UAAU,CAAC;QAC5B,KAAK,EAAE,SAAS,CAAC;YACb,IAAI,EAAE,QAAQ;SACjB,CAAC;QACF,OAAO,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,MAAM;SACtB;KACJ;CACJ,CAAC;AAEW,QAAA,WAAW,GAAG;IACvB,CAAC,kBAAS,CAAC,WAAW,CAAC,EAAE;QACrB,IAAI,EAAE,QAAQ;QACd,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,MAAM,CAAC;QAClB,UAAU,8DACH,cAAc,GACd,sBAAa,GACb,WAAW,KACd,UAAU,EAAE,eAAe,GAC9B;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 components: {ImageProps},\n common: {BlockBaseProps, withTheme},\n} = validators;\n\nconst BackgroundProps = {\n type: 'object',\n additionalProperties: false,\n properties: {\n image: withTheme(ImageProps),\n color: withTheme({\n type: 'string',\n }),\n altText: {\n type: 'string',\n contentType: 'text',\n },\n },\n};\n\nexport const ColoredText = {\n [BlockType.ColoredText]: {\n type: 'object',\n additionalProperties: false,\n required: ['text'],\n properties: {\n ...BlockBaseProps,\n ...BlogBlockBase,\n ...ContentBase,\n background: BackgroundProps,\n },\n },\n};\n"]}