@gravity-ui/page-constructor 7.21.1 → 7.23.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 (145) hide show
  1. package/build/cjs/blocks/CardLayout/CardLayout.css +6 -0
  2. package/build/cjs/blocks/CardLayout/CardLayout.d.ts +1 -1
  3. package/build/cjs/blocks/CardLayout/CardLayout.js +2 -2
  4. package/build/cjs/blocks/CardLayout/CardLayout.js.map +1 -1
  5. package/build/cjs/blocks/ContentLayout/schema.d.ts +11 -0
  6. package/build/cjs/blocks/FoldableList/schema.d.ts +11 -0
  7. package/build/cjs/blocks/Form/Form.css +5 -2
  8. package/build/cjs/blocks/Form/Form.js +12 -9
  9. package/build/cjs/blocks/Form/Form.js.map +1 -1
  10. package/build/cjs/blocks/Form/schema.d.ts +12 -4
  11. package/build/cjs/blocks/Form/schema.js +1 -4
  12. package/build/cjs/blocks/Form/schema.js.map +1 -1
  13. package/build/cjs/blocks/Form/utils.d.ts +3 -0
  14. package/build/cjs/blocks/Form/utils.js +20 -0
  15. package/build/cjs/blocks/Form/utils.js.map +1 -0
  16. package/build/cjs/blocks/Info/schema.d.ts +22 -0
  17. package/build/cjs/blocks/Map/schema.d.ts +11 -0
  18. package/build/cjs/blocks/Media/schema.d.ts +22 -0
  19. package/build/cjs/blocks/Questions/schema.d.ts +11 -0
  20. package/build/cjs/blocks/Tabs/schema.d.ts +11 -0
  21. package/build/cjs/components/{ContentList/ContentListItemIcon.d.ts → ContentIcon/ContentIcon.d.ts} +3 -3
  22. package/build/cjs/components/{ContentList/ContentListItemIcon.js → ContentIcon/ContentIcon.js} +3 -3
  23. package/build/cjs/components/ContentIcon/ContentIcon.js.map +1 -0
  24. package/build/cjs/components/ContentLabels/ContentLabels.css +53 -0
  25. package/build/cjs/components/ContentLabels/ContentLabels.d.ts +3 -0
  26. package/build/cjs/components/ContentLabels/ContentLabels.js +16 -0
  27. package/build/cjs/components/ContentLabels/ContentLabels.js.map +1 -0
  28. package/build/cjs/components/ContentList/ContentList.js +2 -2
  29. package/build/cjs/components/ContentList/ContentList.js.map +1 -1
  30. package/build/cjs/components/Title/Title.d.ts +3 -2
  31. package/build/cjs/components/Title/Title.js +2 -2
  32. package/build/cjs/components/Title/Title.js.map +1 -1
  33. package/build/cjs/constructor-items.d.ts +1 -1
  34. package/build/cjs/context/windowWidthContext/{BreakpointContext.js → WindowWidthContext.js} +2 -7
  35. package/build/cjs/context/windowWidthContext/WindowWidthContext.js.map +1 -0
  36. package/build/cjs/context/windowWidthContext/index.d.ts +1 -1
  37. package/build/cjs/context/windowWidthContext/index.js +1 -1
  38. package/build/cjs/context/windowWidthContext/index.js.map +1 -1
  39. package/build/cjs/hooks/useDeviceValue.d.ts +2 -0
  40. package/build/cjs/hooks/useDeviceValue.js +33 -0
  41. package/build/cjs/hooks/useDeviceValue.js.map +1 -0
  42. package/build/cjs/models/constructor-items/blocks.d.ts +26 -9
  43. package/build/cjs/models/constructor-items/blocks.js.map +1 -1
  44. package/build/cjs/models/constructor-items/sub-blocks.d.ts +5 -5
  45. package/build/cjs/models/constructor-items/sub-blocks.js.map +1 -1
  46. package/build/cjs/schema/constants.d.ts +33 -0
  47. package/build/cjs/schema/validators/common.d.ts +12 -1
  48. package/build/cjs/schema/validators/common.js +21 -0
  49. package/build/cjs/schema/validators/common.js.map +1 -1
  50. package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +11 -0
  51. package/build/cjs/sub-blocks/BasicCard/schema.d.ts +11 -0
  52. package/build/cjs/sub-blocks/Content/Content.css +16 -0
  53. package/build/cjs/sub-blocks/Content/Content.js +12 -3
  54. package/build/cjs/sub-blocks/Content/Content.js.map +1 -1
  55. package/build/cjs/sub-blocks/Content/schema.d.ts +103 -1
  56. package/build/cjs/sub-blocks/Content/schema.js +22 -2
  57. package/build/cjs/sub-blocks/Content/schema.js.map +1 -1
  58. package/build/cjs/sub-blocks/ImageCard/schema.d.ts +11 -0
  59. package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +11 -0
  60. package/build/cjs/utils/breakpoint.d.ts +7 -0
  61. package/build/cjs/utils/breakpoint.js +12 -0
  62. package/build/cjs/utils/breakpoint.js.map +1 -0
  63. package/build/cjs/utils/index.d.ts +1 -0
  64. package/build/cjs/utils/index.js +1 -0
  65. package/build/cjs/utils/index.js.map +1 -1
  66. package/build/esm/blocks/CardLayout/CardLayout.css +6 -0
  67. package/build/esm/blocks/CardLayout/CardLayout.d.ts +1 -1
  68. package/build/esm/blocks/CardLayout/CardLayout.js +3 -3
  69. package/build/esm/blocks/CardLayout/CardLayout.js.map +1 -1
  70. package/build/esm/blocks/ContentLayout/schema.d.ts +11 -0
  71. package/build/esm/blocks/FoldableList/schema.d.ts +11 -0
  72. package/build/esm/blocks/Form/Form.css +5 -2
  73. package/build/esm/blocks/Form/Form.js +12 -9
  74. package/build/esm/blocks/Form/Form.js.map +1 -1
  75. package/build/esm/blocks/Form/schema.d.ts +12 -4
  76. package/build/esm/blocks/Form/schema.js +1 -4
  77. package/build/esm/blocks/Form/schema.js.map +1 -1
  78. package/build/esm/blocks/Form/utils.d.ts +3 -0
  79. package/build/esm/blocks/Form/utils.js +16 -0
  80. package/build/esm/blocks/Form/utils.js.map +1 -0
  81. package/build/esm/blocks/Info/schema.d.ts +22 -0
  82. package/build/esm/blocks/Map/schema.d.ts +11 -0
  83. package/build/esm/blocks/Media/schema.d.ts +22 -0
  84. package/build/esm/blocks/Questions/schema.d.ts +11 -0
  85. package/build/esm/blocks/Tabs/schema.d.ts +11 -0
  86. package/build/esm/components/{ContentList/ContentListItemIcon.d.ts → ContentIcon/ContentIcon.d.ts} +3 -3
  87. package/build/esm/components/{ContentList/ContentListItemIcon.js → ContentIcon/ContentIcon.js} +3 -3
  88. package/build/esm/components/ContentIcon/ContentIcon.js.map +1 -0
  89. package/build/esm/components/ContentLabels/ContentLabels.css +53 -0
  90. package/build/esm/components/ContentLabels/ContentLabels.d.ts +4 -0
  91. package/build/esm/components/ContentLabels/ContentLabels.js +14 -0
  92. package/build/esm/components/ContentLabels/ContentLabels.js.map +1 -0
  93. package/build/esm/components/ContentList/ContentList.js +2 -2
  94. package/build/esm/components/ContentList/ContentList.js.map +1 -1
  95. package/build/esm/components/Title/Title.d.ts +3 -2
  96. package/build/esm/components/Title/Title.js +2 -2
  97. package/build/esm/components/Title/Title.js.map +1 -1
  98. package/build/esm/constructor-items.d.ts +1 -1
  99. package/build/esm/context/windowWidthContext/{BreakpointContext.js → WindowWidthContext.js} +2 -7
  100. package/build/esm/context/windowWidthContext/WindowWidthContext.js.map +1 -0
  101. package/build/esm/context/windowWidthContext/index.d.ts +1 -1
  102. package/build/esm/context/windowWidthContext/index.js +1 -1
  103. package/build/esm/context/windowWidthContext/index.js.map +1 -1
  104. package/build/esm/hooks/useDeviceValue.d.ts +2 -0
  105. package/build/esm/hooks/useDeviceValue.js +29 -0
  106. package/build/esm/hooks/useDeviceValue.js.map +1 -0
  107. package/build/esm/models/constructor-items/blocks.d.ts +26 -9
  108. package/build/esm/models/constructor-items/blocks.js.map +1 -1
  109. package/build/esm/models/constructor-items/sub-blocks.d.ts +5 -5
  110. package/build/esm/models/constructor-items/sub-blocks.js.map +1 -1
  111. package/build/esm/schema/constants.d.ts +33 -0
  112. package/build/esm/schema/validators/common.d.ts +12 -1
  113. package/build/esm/schema/validators/common.js +21 -1
  114. package/build/esm/schema/validators/common.js.map +1 -1
  115. package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +11 -0
  116. package/build/esm/sub-blocks/BasicCard/schema.d.ts +11 -0
  117. package/build/esm/sub-blocks/Content/Content.css +16 -0
  118. package/build/esm/sub-blocks/Content/Content.js +11 -3
  119. package/build/esm/sub-blocks/Content/Content.js.map +1 -1
  120. package/build/esm/sub-blocks/Content/schema.d.ts +103 -1
  121. package/build/esm/sub-blocks/Content/schema.js +21 -1
  122. package/build/esm/sub-blocks/Content/schema.js.map +1 -1
  123. package/build/esm/sub-blocks/ImageCard/schema.d.ts +11 -0
  124. package/build/esm/sub-blocks/LayoutItem/schema.d.ts +11 -0
  125. package/build/esm/utils/breakpoint.d.ts +7 -0
  126. package/build/esm/utils/breakpoint.js +9 -0
  127. package/build/esm/utils/breakpoint.js.map +1 -0
  128. package/build/esm/utils/index.d.ts +1 -0
  129. package/build/esm/utils/index.js +1 -0
  130. package/build/esm/utils/index.js.map +1 -1
  131. package/package.json +1 -1
  132. package/schema/index.js +1 -1
  133. package/server/models/constructor-items/blocks.d.ts +26 -9
  134. package/server/models/constructor-items/sub-blocks.d.ts +5 -5
  135. package/server/utils/breakpoint.d.ts +7 -0
  136. package/server/utils/breakpoint.js +11 -0
  137. package/server/utils/index.d.ts +1 -0
  138. package/server/utils/index.js +1 -0
  139. package/widget/index.js +1 -1
  140. package/build/cjs/components/ContentList/ContentListItemIcon.js.map +0 -1
  141. package/build/cjs/context/windowWidthContext/BreakpointContext.js.map +0 -1
  142. package/build/esm/components/ContentList/ContentListItemIcon.js.map +0 -1
  143. package/build/esm/context/windowWidthContext/BreakpointContext.js.map +0 -1
  144. /package/build/cjs/context/windowWidthContext/{BreakpointContext.d.ts → WindowWidthContext.d.ts} +0 -0
  145. /package/build/esm/context/windowWidthContext/{BreakpointContext.d.ts → WindowWidthContext.d.ts} +0 -0
@@ -14,6 +14,12 @@ unpredictable css rules order in build */
14
14
  padding: 8px 32px 48px;
15
15
  margin-top: 24px;
16
16
  }
17
+ .pc-card-layout-block__title_centered {
18
+ display: flex;
19
+ flex-direction: column;
20
+ align-items: center;
21
+ text-align: center;
22
+ }
17
23
  .pc-card-layout-block__image {
18
24
  position: absolute;
19
25
  top: 0;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import { CardLayoutBlockProps as CardLayoutBlockParams, ClassNameProps } from "../../models/index.js";
3
3
  export type CardLayoutBlockProps = React.PropsWithChildren<Omit<CardLayoutBlockParams, 'children'>> & ClassNameProps;
4
- declare const CardLayout: ({ title, description, animated, colSizes, children, className, titleClassName, background, }: CardLayoutBlockProps) => import("react/jsx-runtime").JSX.Element;
4
+ declare const CardLayout: ({ title, description, animated, colSizes, children, className, titleClassName, background, centered, }: CardLayoutBlockProps) => import("react/jsx-runtime").JSX.Element;
5
5
  export default CardLayout;
@@ -14,10 +14,10 @@ const DEFAULT_SIZES = {
14
14
  md: 4,
15
15
  };
16
16
  const b = (0, utils_1.block)('card-layout-block');
17
- const CardLayout = ({ title, description, animated, colSizes = DEFAULT_SIZES, children, className, titleClassName, background, }) => {
17
+ const CardLayout = ({ title, description, animated, colSizes = DEFAULT_SIZES, children, className, titleClassName, background, centered = false, }) => {
18
18
  const theme = (0, theme_1.useTheme)();
19
19
  const { border, ...backgroundImageProps } = (0, utils_1.getThemedValue)(background || {}, theme);
20
- return ((0, jsx_runtime_1.jsxs)(components_1.AnimateBlock, { className: b(null, className), animate: animated, children: [(title || description) && ((0, jsx_runtime_1.jsx)(components_1.Title, { title: title, subtitle: description, className: titleClassName })), (0, jsx_runtime_1.jsxs)("div", { className: b('content', {
20
+ return ((0, jsx_runtime_1.jsxs)(components_1.AnimateBlock, { className: b(null, className), animate: animated, children: [(title || description) && ((0, jsx_runtime_1.jsx)(components_1.Title, { title: title, subtitle: description, className: b('title', { centered }, titleClassName), colJustifyContent: centered ? grid_1.GridJustifyContent.Center : grid_1.GridJustifyContent.Start })), (0, jsx_runtime_1.jsxs)("div", { className: b('content', {
21
21
  'with-background': !(0, isEmpty_1.default)(background),
22
22
  }), children: [(0, jsx_runtime_1.jsx)(components_1.BackgroundImage, { className: b('image', { border }), ...backgroundImageProps }), (0, jsx_runtime_1.jsx)(grid_1.Row, { children: React.Children.map(children, (child, index) => ((0, jsx_runtime_1.jsx)(grid_1.Col, { sizes: colSizes, className: b('item'), children: child }, index))) })] })] }));
23
23
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CardLayout.js","sourceRoot":"../../../../src","sources":["blocks/CardLayout/CardLayout.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAE/B,wEAAqC;AAErC,0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AC,YACjD,KAAK,IADA,KAAK,CAET,CACT,CAAC,GACA,IACJ,IACK,CAClB,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,UAAU,CAAC","sourcesContent":["import * as React from 'react';\n\nimport isEmpty from 'lodash/isEmpty';\n\nimport {AnimateBlock, BackgroundImage, Title} from '../../components';\nimport {useTheme} from '../../context/theme';\nimport {Col, GridColumnSizesType, Row} from '../../grid';\nimport {CardLayoutBlockProps as CardLayoutBlockParams, ClassNameProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\n\nimport './CardLayout.scss';\n\nconst DEFAULT_SIZES: GridColumnSizesType = {\n all: 12,\n sm: 6,\n md: 4,\n};\nexport type CardLayoutBlockProps = React.PropsWithChildren<\n Omit<CardLayoutBlockParams, 'children'>\n> &\n ClassNameProps;\n\nconst b = block('card-layout-block');\n\nconst CardLayout = ({\n title,\n description,\n animated,\n colSizes = DEFAULT_SIZES,\n children,\n className,\n titleClassName,\n background,\n}: CardLayoutBlockProps) => {\n const theme = useTheme();\n const {border, ...backgroundImageProps} = getThemedValue(background || {}, theme);\n return (\n <AnimateBlock className={b(null, className)} animate={animated}>\n {(title || description) && (\n <Title title={title} subtitle={description} className={titleClassName} />\n )}\n <div\n className={b('content', {\n 'with-background': !isEmpty(background),\n })}\n >\n <BackgroundImage className={b('image', {border})} {...backgroundImageProps} />\n <Row>\n {React.Children.map(children, (child, index) => (\n <Col key={index} sizes={colSizes} className={b('item')}>\n {child}\n </Col>\n ))}\n </Row>\n </div>\n </AnimateBlock>\n );\n};\n\nexport default CardLayout;\n"]}
1
+ {"version":3,"file":"CardLayout.js","sourceRoot":"../../../../src","sources":["blocks/CardLayout/CardLayout.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAE/B,wEAAqC;AAErC,0DAAsE;AACtE,wDAA6C;AAC7C,8CAA6E;AAE7E,gDAAkD;AAIlD,MAAM,aAAa,GAAwB;IACvC,GAAG,EAAE,EAAE;IACP,EAAE,EAAE,CAAC;IACL,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E,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,YACjD,KAAK,IADA,KAAK,CAET,CACT,CAAC,GACA,IACJ,IACK,CAClB,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,UAAU,CAAC","sourcesContent":["import * as React from 'react';\n\nimport isEmpty from 'lodash/isEmpty';\n\nimport {AnimateBlock, BackgroundImage, Title} from '../../components';\nimport {useTheme} from '../../context/theme';\nimport {Col, GridColumnSizesType, GridJustifyContent, Row} from '../../grid';\nimport {CardLayoutBlockProps as CardLayoutBlockParams, ClassNameProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\n\nimport './CardLayout.scss';\n\nconst DEFAULT_SIZES: GridColumnSizesType = {\n all: 12,\n sm: 6,\n md: 4,\n};\n\nexport type CardLayoutBlockProps = React.PropsWithChildren<\n Omit<CardLayoutBlockParams, 'children'>\n> &\n ClassNameProps;\n\nconst b = block('card-layout-block');\n\nconst CardLayout = ({\n title,\n description,\n animated,\n colSizes = DEFAULT_SIZES,\n children,\n className,\n titleClassName,\n background,\n centered = false,\n}: CardLayoutBlockProps) => {\n const theme = useTheme();\n const {border, ...backgroundImageProps} = getThemedValue(background || {}, theme);\n return (\n <AnimateBlock className={b(null, className)} animate={animated}>\n {(title || description) && (\n <Title\n title={title}\n subtitle={description}\n className={b('title', {centered}, titleClassName)}\n colJustifyContent={\n centered ? GridJustifyContent.Center : GridJustifyContent.Start\n }\n />\n )}\n <div\n className={b('content', {\n 'with-background': !isEmpty(background),\n })}\n >\n <BackgroundImage className={b('image', {border})} {...backgroundImageProps} />\n <Row>\n {React.Children.map(children, (child, index) => (\n <Col key={index} sizes={colSizes} className={b('item')}>\n {child}\n </Col>\n ))}\n </Row>\n </div>\n </AnimateBlock>\n );\n};\n\nexport default CardLayout;\n"]}
@@ -225,6 +225,17 @@ export declare const ContentLayoutBlock: {
225
225
  };
226
226
  };
227
227
  };
228
+ labels: {
229
+ type: string;
230
+ items: {
231
+ type: string;
232
+ properties: {
233
+ when: {
234
+ type: string;
235
+ };
236
+ };
237
+ };
238
+ };
228
239
  controlPosition: {
229
240
  type: string;
230
241
  enum: string[];
@@ -51,6 +51,17 @@ export declare const FoldableListBlock: {
51
51
  contentType: string;
52
52
  inputType: string;
53
53
  };
54
+ labels: {
55
+ type: string;
56
+ items: {
57
+ type: string;
58
+ properties: {
59
+ when: {
60
+ type: string;
61
+ };
62
+ };
63
+ };
64
+ };
54
65
  additionalInfo: {
55
66
  type: string;
56
67
  contentType: string;
@@ -69,7 +69,7 @@ unpredictable css rules order in build */
69
69
  width: fit-content;
70
70
  }
71
71
  }
72
- @media (max-width: 1081px) and (min-width: 769px) {
72
+ @media (max-width: 1080px) and (min-width: 769px) {
73
73
  .pc-form-block__row {
74
74
  flex-direction: column;
75
75
  }
@@ -94,11 +94,14 @@ unpredictable css rules order in build */
94
94
  text-align: center;
95
95
  padding-bottom: 32px;
96
96
  }
97
+ .pc-form-block_with-background .pc-form-block__row .pc-form-block__content-wrapper .pc-content-labels, .pc-form-block:not(.pc-form-block_with-background) .pc-form-block__row .pc-form-block__content-wrapper .pc-content-labels {
98
+ justify-content: center;
99
+ }
97
100
  .pc-form-block:not(.pc-form-block_with-background) .pc-form-block__row .pc-form-block__content-wrapper {
98
101
  padding: 0 0 32px 0;
99
102
  }
100
103
  }
101
- @media (max-width: 769px) {
104
+ @media (max-width: 768px) {
102
105
  .pc-form-block__full-form {
103
106
  padding: 32px;
104
107
  }
@@ -8,25 +8,28 @@ const InnerForm_1 = tslib_1.__importDefault(require("../../components/InnerForm/
8
8
  const mobileContext_1 = require("../../context/mobileContext/index.js");
9
9
  const theme_1 = require("../../context/theme/index.js");
10
10
  const grid_1 = require("../../grid/index.js");
11
+ const useDeviceValue_1 = require("../../hooks/useDeviceValue.js");
11
12
  const models_1 = require("../../models/index.js");
12
13
  const sub_blocks_1 = require("../../sub-blocks/index.js");
13
14
  const utils_1 = require("../../utils/index.js");
15
+ const utils_2 = require("./utils.js");
14
16
  const b = (0, utils_1.block)('form-block');
15
17
  const colSizes = { [grid_1.GridColumnSize.Lg]: 6, [grid_1.GridColumnSize.All]: 12 };
16
18
  const Form = (props) => {
17
- const { formData, title, textContent, direction = models_1.FormBlockDirection.Center, background } = props;
19
+ const { formData, title, textContent, direction = models_1.FormBlockDirection.Center, background, customFormNode, } = props;
18
20
  const [contentLoaded, setContentLoaded] = React.useState(false);
19
21
  const isMobile = React.useContext(mobileContext_1.MobileContext);
20
22
  const theme = (0, theme_1.useTheme)();
21
23
  const themedBackground = (0, utils_1.getThemedValue)(background, theme) || undefined;
24
+ const themedBackgroundStyle = (0, useDeviceValue_1.useDeviceValue)(themedBackground?.style) || undefined;
22
25
  const withBackground = Boolean(themedBackground &&
23
26
  (themedBackground.src ||
24
27
  themedBackground.desktop ||
25
- themedBackground.style?.backgroundColor));
28
+ (0, utils_2.hasBackgroundCSS)(themedBackgroundStyle ?? {})));
26
29
  const onContentLoad = React.useCallback(() => {
27
30
  setContentLoaded(true);
28
31
  }, []);
29
- if (!formData) {
32
+ if (!formData && !customFormNode) {
30
33
  return null;
31
34
  }
32
35
  let formType;
@@ -39,16 +42,16 @@ const Form = (props) => {
39
42
  return ((0, jsx_runtime_1.jsxs)("div", { className: b({
40
43
  'with-background': withBackground,
41
44
  'form-type': formType,
42
- }), children: [themedBackground && ((0, jsx_runtime_1.jsx)(components_1.BackgroundImage, { ...themedBackground, className: b('media'), imageClassName: b('image') })), (0, jsx_runtime_1.jsx)(grid_1.Grid, { children: (0, jsx_runtime_1.jsxs)(grid_1.Row, { alignItems: direction === models_1.FormBlockDirection.Center
45
+ }), children: [themedBackground && ((0, jsx_runtime_1.jsx)(components_1.BackgroundImage, { ...themedBackground, style: themedBackgroundStyle, className: b('media'), imageClassName: b('image') })), (0, jsx_runtime_1.jsx)(grid_1.Grid, { children: (0, jsx_runtime_1.jsxs)(grid_1.Row, { alignItems: direction === models_1.FormBlockDirection.Center
43
46
  ? grid_1.GridAlignItems.Center
44
47
  : grid_1.GridAlignItems.Start, className: b('row', {
45
48
  direction,
46
- }), children: [(0, jsx_runtime_1.jsx)(grid_1.Col, { sizes: colSizes, className: b('content-col'), children: textContent && ((0, jsx_runtime_1.jsx)("div", { className: b('content-wrapper'), children: (0, jsx_runtime_1.jsx)(sub_blocks_1.Content, { theme: "default", ...textContent, centered: direction === models_1.FormBlockDirection.Center, colSizes: { all: 12 }, className: b('content') }) })) }), (0, jsx_runtime_1.jsx)(grid_1.Col, { sizes: colSizes, className: b('form-col'), children: (0, jsx_runtime_1.jsx)("div", { className: b('form-wrapper'), children: (0, jsx_runtime_1.jsxs)("div", { className: b('full-form', {
49
+ }), children: [(0, jsx_runtime_1.jsx)(grid_1.Col, { sizes: colSizes, className: b('content-col'), children: textContent && ((0, jsx_runtime_1.jsx)("div", { className: b('content-wrapper'), children: (0, jsx_runtime_1.jsx)(sub_blocks_1.Content, { theme: "default", ...textContent, centered: direction === models_1.FormBlockDirection.Center, colSizes: { all: 12 }, className: b('content') }) })) }), (0, jsx_runtime_1.jsx)(grid_1.Col, { sizes: colSizes, className: b('form-col'), children: (0, jsx_runtime_1.jsx)("div", { className: b('form-wrapper'), children: (0, jsx_runtime_1.jsx)("div", { className: b('full-form', {
47
50
  hidden: !contentLoaded,
48
- }), children: [title && ((0, jsx_runtime_1.jsx)(components_1.Title, { title: {
49
- text: title,
50
- textSize: 's',
51
- }, className: b('title', { mobile: isMobile }), colSizes: { all: 12 } })), (0, jsx_runtime_1.jsx)(InnerForm_1.default, { className: b('form'), formData: formData, onContentLoad: onContentLoad })] }) }) })] }) })] }));
51
+ }), children: customFormNode || ((0, jsx_runtime_1.jsxs)(React.Fragment, { children: [title && ((0, jsx_runtime_1.jsx)(components_1.Title, { title: {
52
+ text: title,
53
+ textSize: 's',
54
+ }, className: b('title', { mobile: isMobile }), colSizes: { all: 12 } })), (0, jsx_runtime_1.jsx)(InnerForm_1.default, { className: b('form'), formData: formData, onContentLoad: onContentLoad })] })) }) }) })] }) })] }));
52
55
  };
53
56
  exports.default = Form;
54
57
  //# sourceMappingURL=Form.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Form.js","sourceRoot":"../../../../src","sources":["blocks/Form/Form.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAE/B,0DAAwD;AACxD,gGAA6D;AAC7D,wEAA0D;AAC1D,wDAA6C;AAC7C,8CAA0E;AAE1E,kDAKsB;AACtB,0DAAyC;AACzC,gDAAkD;AAIlD,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,YAAY,CAAC,CAAC;AAE9B,MAAM,QAAQ,GAAG,EAAC,CAAC,qBAAc,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,qBAAc,CAAC,GAAG,CAAC,EAAE,EAAE,EAAC,CAAC;AAEpE,MAAM,IAAI,GAAG,CAAC,KAAqB,EAAE,EAAE;IACnC,MAAM,EAAC,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,GAAG,2BAAkB,CAAC,MAAM,EAAE,UAAU,EAAC,GAAG,KAAK,CAAC;IAChG,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChE,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,6BAAa,CAAC,CAAC;IACjD,MAAM,KAAK,GAAG,IAAA,gBAAQ,GAAE,CAAC;IAEzB,MAAM,gBAAgB,GAAG,IAAA,sBAAc,EAAC,UAAU,EAAE,KAAK,CAAC,IAAI,SAAS,CAAC;IAExE,MAAM,cAAc,GAAG,OAAO,CAC1B,gBAAgB;QACZ,CAAC,gBAAgB,CAAC,GAAG;YACjB,gBAAgB,CAAC,OAAO;YACxB,gBAAgB,CAAC,KAAK,EAAE,eAAe,CAAC,CACnD,CAAC;IACF,MAAM,aAAa,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACzC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,EAAE,EAAE,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AAK,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,UAAU,CAAC,YAC1C,gCAAK,SAAS,EAAE,CAAC,CAAC,cAAc,CAAC,YAC7B,iCACI,SAAS,EAAE,CAAC,CAAC,WAAW,EAAE;wCACtB,MAAM,EAAE,CAAC,aAAa;qCACzB,CAAC,aAED,KAAK,IAAI,CACN,uBAAC,kBAAK,IACF,KAAK,EAAE;gDACH,IAAI,EAAE,KAAK;gDACX,QAAQ,EAAE,GAAG;6CAChB,EACD,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,MAAM,EAAE,QAAQ,EAAC,CAAC,EACzC,QAAQ,EAAE,EAAC,GAAG,EAAE,EAAE,EAAC,GACrB,CACL,EACD,uBAAC,mBAAS,IACN,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EACpB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,GAC9B,IACA,GACJ,GACJ,IACJ,GACH,IACL,CACT,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,IAAI,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {BackgroundImage, Title} from '../../components';\nimport InnerForm from '../../components/InnerForm/InnerForm';\nimport {MobileContext} from '../../context/mobileContext';\nimport {useTheme} from '../../context/theme';\nimport {Col, Grid, GridAlignItems, GridColumnSize, Row} from '../../grid';\nimport type {FormBlockProps} from '../../models';\nimport {\n FormBlockDataTypes,\n FormBlockDirection,\n isHubspotDataForm,\n isYandexDataForm,\n} from '../../models';\nimport {Content} from '../../sub-blocks';\nimport {block, getThemedValue} from '../../utils';\n\nimport './Form.scss';\n\nconst b = block('form-block');\n\nconst colSizes = {[GridColumnSize.Lg]: 6, [GridColumnSize.All]: 12};\n\nconst Form = (props: FormBlockProps) => {\n const {formData, title, textContent, direction = FormBlockDirection.Center, background} = props;\n const [contentLoaded, setContentLoaded] = React.useState(false);\n const isMobile = React.useContext(MobileContext);\n const theme = useTheme();\n\n const themedBackground = getThemedValue(background, theme) || undefined;\n\n const withBackground = Boolean(\n themedBackground &&\n (themedBackground.src ||\n themedBackground.desktop ||\n themedBackground.style?.backgroundColor),\n );\n const onContentLoad = React.useCallback(() => {\n setContentLoaded(true);\n }, []);\n\n if (!formData) {\n return null;\n }\n\n let formType;\n\n if (isYandexDataForm(formData)) {\n formType = FormBlockDataTypes.YANDEX;\n } else if (isHubspotDataForm(formData)) {\n formType = FormBlockDataTypes.HUBSPOT;\n }\n\n return (\n <div\n className={b({\n 'with-background': withBackground,\n 'form-type': formType,\n })}\n >\n {themedBackground && (\n <BackgroundImage\n {...themedBackground}\n className={b('media')}\n imageClassName={b('image')}\n />\n )}\n <Grid>\n <Row\n alignItems={\n direction === FormBlockDirection.Center\n ? GridAlignItems.Center\n : GridAlignItems.Start\n }\n className={b('row', {\n direction,\n })}\n >\n <Col sizes={colSizes} className={b('content-col')}>\n {textContent && (\n <div className={b('content-wrapper')}>\n <Content\n theme=\"default\"\n {...textContent}\n centered={direction === FormBlockDirection.Center}\n colSizes={{all: 12}}\n className={b('content')}\n />\n </div>\n )}\n </Col>\n <Col sizes={colSizes} className={b('form-col')}>\n <div className={b('form-wrapper')}>\n <div\n className={b('full-form', {\n hidden: !contentLoaded,\n })}\n >\n {title && (\n <Title\n title={{\n text: title,\n textSize: 's',\n }}\n className={b('title', {mobile: isMobile})}\n colSizes={{all: 12}}\n />\n )}\n <InnerForm\n className={b('form')}\n formData={formData}\n onContentLoad={onContentLoad}\n />\n </div>\n </div>\n </Col>\n </Row>\n </Grid>\n </div>\n );\n};\n\nexport default Form;\n"]}
1
+ {"version":3,"file":"Form.js","sourceRoot":"../../../../src","sources":["blocks/Form/Form.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAE/B,0DAAwD;AACxD,gGAA6D;AAC7D,wEAA0D;AAC1D,wDAA6C;AAC7C,8CAA0E;AAC1E,kEAA0D;AAE1D,kDAKsB;AACtB,0DAAyC;AACzC,gDAAkD;AAElD,sCAAyC;AAIzC,MAAM,CAAC,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E,CAAC,CAAC,WAAW,EAAE;wCACtB,MAAM,EAAE,CAAC,aAAa;qCACzB,CAAC,YAED,cAAc,IAAI,CACf,wBAAC,KAAK,CAAC,QAAQ,eACV,KAAK,IAAI,CACN,uBAAC,kBAAK,IACF,KAAK,EAAE;oDACH,IAAI,EAAE,KAAK;oDACX,QAAQ,EAAE,GAAG;iDAChB,EACD,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,MAAM,EAAE,QAAQ,EAAC,CAAC,EACzC,QAAQ,EAAE,EAAC,GAAG,EAAE,EAAE,EAAC,GACrB,CACL,EACD,uBAAC,mBAAS,IACN,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EACpB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,GAC9B,IACW,CACpB,GACC,GACJ,GACJ,IACJ,GACH,IACL,CACT,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,IAAI,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {BackgroundImage, Title} from '../../components';\nimport InnerForm from '../../components/InnerForm/InnerForm';\nimport {MobileContext} from '../../context/mobileContext';\nimport {useTheme} from '../../context/theme';\nimport {Col, Grid, GridAlignItems, GridColumnSize, Row} from '../../grid';\nimport {useDeviceValue} from '../../hooks/useDeviceValue';\nimport type {FormBlockProps} from '../../models';\nimport {\n FormBlockDataTypes,\n FormBlockDirection,\n isHubspotDataForm,\n isYandexDataForm,\n} from '../../models';\nimport {Content} from '../../sub-blocks';\nimport {block, getThemedValue} from '../../utils';\n\nimport {hasBackgroundCSS} from './utils';\n\nimport './Form.scss';\n\nconst b = block('form-block');\n\nconst colSizes = {[GridColumnSize.Lg]: 6, [GridColumnSize.All]: 12};\n\nconst Form = (props: FormBlockProps) => {\n const {\n formData,\n title,\n textContent,\n direction = FormBlockDirection.Center,\n background,\n customFormNode,\n } = props;\n const [contentLoaded, setContentLoaded] = React.useState(false);\n const isMobile = React.useContext(MobileContext);\n const theme = useTheme();\n\n const themedBackground = getThemedValue(background, theme) || undefined;\n const themedBackgroundStyle = useDeviceValue(themedBackground?.style) || undefined;\n\n const withBackground = Boolean(\n themedBackground &&\n (themedBackground.src ||\n themedBackground.desktop ||\n hasBackgroundCSS(themedBackgroundStyle ?? {})),\n );\n\n const onContentLoad = React.useCallback(() => {\n setContentLoaded(true);\n }, []);\n\n if (!formData && !customFormNode) {\n return null;\n }\n\n let formType;\n\n if (isYandexDataForm(formData)) {\n formType = FormBlockDataTypes.YANDEX;\n } else if (isHubspotDataForm(formData)) {\n formType = FormBlockDataTypes.HUBSPOT;\n }\n\n return (\n <div\n className={b({\n 'with-background': withBackground,\n 'form-type': formType,\n })}\n >\n {themedBackground && (\n <BackgroundImage\n {...themedBackground}\n style={themedBackgroundStyle}\n className={b('media')}\n imageClassName={b('image')}\n />\n )}\n <Grid>\n <Row\n alignItems={\n direction === FormBlockDirection.Center\n ? GridAlignItems.Center\n : GridAlignItems.Start\n }\n className={b('row', {\n direction,\n })}\n >\n <Col sizes={colSizes} className={b('content-col')}>\n {textContent && (\n <div className={b('content-wrapper')}>\n <Content\n theme=\"default\"\n {...textContent}\n centered={direction === FormBlockDirection.Center}\n colSizes={{all: 12}}\n className={b('content')}\n />\n </div>\n )}\n </Col>\n <Col sizes={colSizes} className={b('form-col')}>\n <div className={b('form-wrapper')}>\n <div\n className={b('full-form', {\n hidden: !contentLoaded,\n })}\n >\n {customFormNode || (\n <React.Fragment>\n {title && (\n <Title\n title={{\n text: title,\n textSize: 's',\n }}\n className={b('title', {mobile: isMobile})}\n colSizes={{all: 12}}\n />\n )}\n <InnerForm\n className={b('form')}\n formData={formData}\n onContentLoad={onContentLoad}\n />\n </React.Fragment>\n )}\n </div>\n </div>\n </Col>\n </Row>\n </Grid>\n </div>\n );\n};\n\nexport default Form;\n"]}
@@ -164,6 +164,17 @@ export declare const FormBlock: {
164
164
  };
165
165
  };
166
166
  };
167
+ labels: {
168
+ type: string;
169
+ items: {
170
+ type: string;
171
+ properties: {
172
+ when: {
173
+ type: string;
174
+ };
175
+ };
176
+ };
177
+ };
167
178
  controlPosition: {
168
179
  type: string;
169
180
  enum: string[];
@@ -173,7 +184,7 @@ export declare const FormBlock: {
173
184
  direction: {
174
185
  enum: string[];
175
186
  };
176
- image: {
187
+ background: {
177
188
  oneOf: ({
178
189
  type: string;
179
190
  properties: {
@@ -200,9 +211,6 @@ export declare const FormBlock: {
200
211
  pattern?: undefined;
201
212
  })[];
202
213
  };
203
- backgroundColor: {
204
- type: string;
205
- };
206
214
  anchor: {
207
215
  type: string;
208
216
  additionalProperties: boolean;
@@ -43,10 +43,7 @@ exports.FormBlock = {
43
43
  direction: {
44
44
  enum: ['content-form', 'form-content', 'center'],
45
45
  },
46
- image: schema_1.ImageProps,
47
- backgroundColor: {
48
- type: 'string',
49
- },
46
+ background: schema_1.ImageProps,
50
47
  },
51
48
  },
52
49
  };
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/Form/schema.ts"],"names":[],"mappings":";;;;AAAA,kEAA+B;AAE/B,6DAAyD;AACzD,kEAAmE;AACnE,8DAAyE;AACzE,+DAA4D;AAC5D,mEAAqE;AAErE,MAAM,qBAAqB,GAAG,IAAA,cAAI,EAAC,oBAAW,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;AAErE,QAAA,SAAS,GAAG;IACrB,YAAY,EAAE;QACV,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,UAAU,CAAC;QACtB,UAAU,EAAE;YACR,GAAG,uBAAc;YACjB,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;aACjB;YACD,QAAQ,EAAE;gBACN,KAAK,EAAE;oBACH;wBACI,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE,QAAQ;wBACpB,UAAU,EAAE;4BACR,MAAM,EAAE,IAAA,kBAAS,EAAC,wBAAe,CAAC;yBACrC;qBACJ;oBACD;wBACI,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE,SAAS;wBACrB,UAAU,EAAE;4BACR,OAAO,EAAE,IAAA,kBAAS,EAAC,yBAAgB,CAAC;yBACvC;qBACJ;iBACJ;aACJ;YACD,WAAW,EAAE;gBACT,oBAAoB,EAAE,KAAK;gBAC3B,UAAU,EAAE,qBAAqB;aACpC;YACD,SAAS,EAAE;gBACP,IAAI,EAAE,CAAC,cAAc,EAAE,cAAc,EAAE,QAAQ,CAAC;aACnD;YACD,KAAK,EAAE,mBAAU;YACjB,eAAe,EAAE;gBACb,IAAI,EAAE,QAAQ;aACjB;SACJ;KACJ;CACJ,CAAC","sourcesContent":["import omit from 'lodash/omit';\n\nimport {ImageProps} from '../../components/Image/schema';\nimport {YandexFormProps} from '../../components/YandexForm/schema';\nimport {BlockBaseProps, withTheme} from '../../schema/validators/common';\nimport {ContentBase} from '../../sub-blocks/Content/schema';\nimport {HubspotFormProps} from '../../sub-blocks/HubspotForm/schema';\n\nconst FormBlockContentProps = omit(ContentBase, ['size', 'centered', 'colSizes']);\n\nexport const FormBlock = {\n 'form-block': {\n additionalProperties: false,\n required: ['formData'],\n properties: {\n ...BlockBaseProps,\n title: {\n type: 'string',\n },\n formData: {\n oneOf: [\n {\n type: 'object',\n optionName: 'yandex',\n properties: {\n yandex: withTheme(YandexFormProps),\n },\n },\n {\n type: 'object',\n optionName: 'hubspot',\n properties: {\n hubspot: withTheme(HubspotFormProps),\n },\n },\n ],\n },\n textContent: {\n additionalProperties: false,\n properties: FormBlockContentProps,\n },\n direction: {\n enum: ['content-form', 'form-content', 'center'],\n },\n image: ImageProps,\n backgroundColor: {\n type: 'string',\n },\n },\n },\n};\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/Form/schema.ts"],"names":[],"mappings":";;;;AAAA,kEAA+B;AAE/B,6DAAyD;AACzD,kEAAmE;AACnE,8DAAyE;AACzE,+DAA4D;AAC5D,mEAAqE;AAErE,MAAM,qBAAqB,GAAG,IAAA,cAAI,EAAC,oBAAW,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;AAErE,QAAA,SAAS,GAAG;IACrB,YAAY,EAAE;QACV,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,UAAU,CAAC;QACtB,UAAU,EAAE;YACR,GAAG,uBAAc;YACjB,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;aACjB;YACD,QAAQ,EAAE;gBACN,KAAK,EAAE;oBACH;wBACI,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE,QAAQ;wBACpB,UAAU,EAAE;4BACR,MAAM,EAAE,IAAA,kBAAS,EAAC,wBAAe,CAAC;yBACrC;qBACJ;oBACD;wBACI,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE,SAAS;wBACrB,UAAU,EAAE;4BACR,OAAO,EAAE,IAAA,kBAAS,EAAC,yBAAgB,CAAC;yBACvC;qBACJ;iBACJ;aACJ;YACD,WAAW,EAAE;gBACT,oBAAoB,EAAE,KAAK;gBAC3B,UAAU,EAAE,qBAAqB;aACpC;YACD,SAAS,EAAE;gBACP,IAAI,EAAE,CAAC,cAAc,EAAE,cAAc,EAAE,QAAQ,CAAC;aACnD;YACD,UAAU,EAAE,mBAAU;SACzB;KACJ;CACJ,CAAC","sourcesContent":["import omit from 'lodash/omit';\n\nimport {ImageProps} from '../../components/Image/schema';\nimport {YandexFormProps} from '../../components/YandexForm/schema';\nimport {BlockBaseProps, withTheme} from '../../schema/validators/common';\nimport {ContentBase} from '../../sub-blocks/Content/schema';\nimport {HubspotFormProps} from '../../sub-blocks/HubspotForm/schema';\n\nconst FormBlockContentProps = omit(ContentBase, ['size', 'centered', 'colSizes']);\n\nexport const FormBlock = {\n 'form-block': {\n additionalProperties: false,\n required: ['formData'],\n properties: {\n ...BlockBaseProps,\n title: {\n type: 'string',\n },\n formData: {\n oneOf: [\n {\n type: 'object',\n optionName: 'yandex',\n properties: {\n yandex: withTheme(YandexFormProps),\n },\n },\n {\n type: 'object',\n optionName: 'hubspot',\n properties: {\n hubspot: withTheme(HubspotFormProps),\n },\n },\n ],\n },\n textContent: {\n additionalProperties: false,\n properties: FormBlockContentProps,\n },\n direction: {\n enum: ['content-form', 'form-content', 'center'],\n },\n background: ImageProps,\n },\n },\n};\n"]}
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ export declare const BACKGROUND_STYLE_PROPS: readonly ["background", "backgroundAttachment", "backgroundBlendMode", "backgroundClip", "backgroundColor", "backgroundImage", "backgroundOrigin", "backgroundPositionX", "backgroundPositionY", "backgroundRepeat", "backgroundSize", "backgroundPosition"];
3
+ export declare const hasBackgroundCSS: (style: React.CSSProperties) => boolean;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hasBackgroundCSS = exports.BACKGROUND_STYLE_PROPS = void 0;
4
+ exports.BACKGROUND_STYLE_PROPS = [
5
+ 'background',
6
+ 'backgroundAttachment',
7
+ 'backgroundBlendMode',
8
+ 'backgroundClip',
9
+ 'backgroundColor',
10
+ 'backgroundImage',
11
+ 'backgroundOrigin',
12
+ 'backgroundPositionX',
13
+ 'backgroundPositionY',
14
+ 'backgroundRepeat',
15
+ 'backgroundSize',
16
+ 'backgroundPosition',
17
+ ];
18
+ const hasBackgroundCSS = (style) => exports.BACKGROUND_STYLE_PROPS.some((backgroundStyleProp) => backgroundStyleProp in style);
19
+ exports.hasBackgroundCSS = hasBackgroundCSS;
20
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"../../../../src","sources":["blocks/Form/utils.ts"],"names":[],"mappings":";;;AAEa,QAAA,sBAAsB,GAAG;IAClC,YAAY;IACZ,sBAAsB;IACtB,qBAAqB;IACrB,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,kBAAkB;IAClB,qBAAqB;IACrB,qBAAqB;IACrB,kBAAkB;IAClB,gBAAgB;IAChB,oBAAoB;CACd,CAAC;AAEJ,MAAM,gBAAgB,GAAG,CAAC,KAA0B,EAAE,EAAE,CAC3D,8BAAsB,CAAC,IAAI,CAAC,CAAC,mBAAmB,EAAE,EAAE,CAAC,mBAAmB,IAAI,KAAK,CAAC,CAAC;AAD1E,QAAA,gBAAgB,oBAC0D","sourcesContent":["import * as React from 'react';\n\nexport const BACKGROUND_STYLE_PROPS = [\n 'background',\n 'backgroundAttachment',\n 'backgroundBlendMode',\n 'backgroundClip',\n 'backgroundColor',\n 'backgroundImage',\n 'backgroundOrigin',\n 'backgroundPositionX',\n 'backgroundPositionY',\n 'backgroundRepeat',\n 'backgroundSize',\n 'backgroundPosition',\n] as const;\n\nexport const hasBackgroundCSS = (style: React.CSSProperties) =>\n BACKGROUND_STYLE_PROPS.some((backgroundStyleProp) => backgroundStyleProp in style);\n"]}
@@ -135,6 +135,17 @@ export declare const InfoBlock: {
135
135
  };
136
136
  };
137
137
  };
138
+ labels: {
139
+ type: string;
140
+ items: {
141
+ type: string;
142
+ properties: {
143
+ when: {
144
+ type: string;
145
+ };
146
+ };
147
+ };
148
+ };
138
149
  controlPosition: {
139
150
  type: string;
140
151
  enum: string[];
@@ -226,6 +237,17 @@ export declare const InfoBlock: {
226
237
  };
227
238
  };
228
239
  };
240
+ labels: {
241
+ type: string;
242
+ items: {
243
+ type: string;
244
+ properties: {
245
+ when: {
246
+ type: string;
247
+ };
248
+ };
249
+ };
250
+ };
229
251
  controlPosition: {
230
252
  type: string;
231
253
  enum: string[];
@@ -421,6 +421,17 @@ export declare const MapBlock: {
421
421
  type: string;
422
422
  enum: string[];
423
423
  };
424
+ labels: {
425
+ type: string;
426
+ items: {
427
+ type: string;
428
+ properties: {
429
+ when: {
430
+ type: string;
431
+ };
432
+ };
433
+ };
434
+ };
424
435
  additionalInfo: {
425
436
  type: string;
426
437
  contentType: string;
@@ -537,6 +537,17 @@ export declare const MediaBlockBaseProps: {
537
537
  type: string;
538
538
  enum: string[];
539
539
  };
540
+ labels: {
541
+ type: string;
542
+ items: {
543
+ type: string;
544
+ properties: {
545
+ when: {
546
+ type: string;
547
+ };
548
+ };
549
+ };
550
+ };
540
551
  additionalInfo: {
541
552
  type: string;
542
553
  contentType: string;
@@ -1178,6 +1189,17 @@ export declare const MediaBlock: {
1178
1189
  type: string;
1179
1190
  enum: string[];
1180
1191
  };
1192
+ labels: {
1193
+ type: string;
1194
+ items: {
1195
+ type: string;
1196
+ properties: {
1197
+ when: {
1198
+ type: string;
1199
+ };
1200
+ };
1201
+ };
1202
+ };
1181
1203
  additionalInfo: {
1182
1204
  type: string;
1183
1205
  contentType: string;
@@ -51,6 +51,17 @@ export declare const QuestionsBlock: {
51
51
  contentType: string;
52
52
  inputType: string;
53
53
  };
54
+ labels: {
55
+ type: string;
56
+ items: {
57
+ type: string;
58
+ properties: {
59
+ when: {
60
+ type: string;
61
+ };
62
+ };
63
+ };
64
+ };
54
65
  additionalInfo: {
55
66
  type: string;
56
67
  contentType: string;
@@ -571,6 +571,17 @@ export declare const tabsItem: {
571
571
  };
572
572
  };
573
573
  } | undefined;
574
+ labels?: {
575
+ type: string;
576
+ items: {
577
+ type: string;
578
+ properties: {
579
+ when: {
580
+ type: string;
581
+ };
582
+ };
583
+ };
584
+ } | undefined;
574
585
  controlPosition?: {
575
586
  type: string;
576
587
  enum: string[];
@@ -1,8 +1,8 @@
1
1
  import { ClassNameProps, GravityIconProps, ImageProps, QAProps, SVGIcon } from "../../models/index.js";
2
2
  import { ThemeSupporting } from "../../utils/index.js";
3
- interface ListItemProps extends QAProps, ClassNameProps {
3
+ interface ContentIconProps extends QAProps, ClassNameProps {
4
4
  icon?: ThemeSupporting<ImageProps | SVGIcon>;
5
5
  gravityIcon?: ThemeSupporting<GravityIconProps>;
6
6
  }
7
- declare const ContentListItemIcon: ({ icon, className, qa, gravityIcon }: ListItemProps) => import("react/jsx-runtime").JSX.Element;
8
- export default ContentListItemIcon;
7
+ declare const ContentIcon: ({ icon, className, qa, gravityIcon }: ContentIconProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default ContentIcon;
@@ -8,7 +8,7 @@ const Icon_1 = tslib_1.__importDefault(require("../Icon/Icon.js"));
8
8
  function isIconSvg(icon) {
9
9
  return typeof icon === 'function';
10
10
  }
11
- const ContentListItemIcon = ({ icon, className, qa, gravityIcon }) => {
11
+ const ContentIcon = ({ icon, className, qa, gravityIcon }) => {
12
12
  const theme = (0, theme_1.useTheme)();
13
13
  const iconThemed = (0, utils_1.getThemedValue)(icon, theme);
14
14
  const gravityIconThemed = (0, utils_1.getThemedValue)(gravityIcon, theme);
@@ -18,5 +18,5 @@ const ContentListItemIcon = ({ icon, className, qa, gravityIcon }) => {
18
18
  }
19
19
  return (0, jsx_runtime_1.jsx)(Icon_1.default, { icon: iconThemed, gravityIcon: gravityIconThemed, className: className, qa: qa });
20
20
  };
21
- exports.default = ContentListItemIcon;
22
- //# sourceMappingURL=ContentListItemIcon.js.map
21
+ exports.default = ContentIcon;
22
+ //# sourceMappingURL=ContentIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContentIcon.js","sourceRoot":"../../../../src","sources":["components/ContentIcon/ContentIcon.tsx"],"names":[],"mappings":";;;;AAAA,wDAA6C;AAE7C,gDAA4D;AAC5D,mEAAgC;AAOhC,SAAS,SAAS,CAAC,IAA0B;IACzC,OAAO,OAAO,IAAI,KAAK,UAAU,CAAC;AACtC,CAAC;AAED,MAAM,WAAW,GAAG,CAAC,EAAC,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,WAAW,EAAmB,EAAE,EAAE;IACzE,MAAM,KAAK,GAAG,IAAA,gBAAQ,GAAE,CAAC;IACzB,MAAM,UAAU,GAAG,IAAA,sBAAc,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/C,MAAM,iBAAiB,GAAG,IAAA,sBAAc,EAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAE7D,IAAI,UAAU,IAAI,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;QACtC,MAAM,aAAa,GAAG,UAAU,CAAC;QACjC,OAAO,CACH,0CACI,uBAAC,aAAa,IAAC,SAAS,EAAE,SAAS,GAAI,GACrC,CACT,CAAC;IACN,CAAC;IAED,OAAO,uBAAC,cAAI,IAAC,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,GAAI,CAAC;AACpG,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC","sourcesContent":["import {useTheme} from '../../context/theme';\nimport {ClassNameProps, GravityIconProps, ImageProps, QAProps, SVGIcon} from '../../models';\nimport {ThemeSupporting, getThemedValue} from '../../utils';\nimport Icon from '../Icon/Icon';\n\ninterface ContentIconProps extends QAProps, ClassNameProps {\n icon?: ThemeSupporting<ImageProps | SVGIcon>;\n gravityIcon?: ThemeSupporting<GravityIconProps>;\n}\n\nfunction isIconSvg(icon: ImageProps | SVGIcon): icon is SVGIcon {\n return typeof icon === 'function';\n}\n\nconst ContentIcon = ({icon, className, qa, gravityIcon}: ContentIconProps) => {\n const theme = useTheme();\n const iconThemed = getThemedValue(icon, theme);\n const gravityIconThemed = getThemedValue(gravityIcon, theme);\n\n if (iconThemed && isIconSvg(iconThemed)) {\n const IconComponent = iconThemed;\n return (\n <div>\n <IconComponent className={className} />\n </div>\n );\n }\n\n return <Icon icon={iconThemed} gravityIcon={gravityIconThemed} className={className} qa={qa} />;\n};\n\nexport default ContentIcon;\n"]}
@@ -0,0 +1,53 @@
1
+ /* use this for style redefinitions to awoid problems with
2
+ unpredictable css rules order in build */
3
+ .pc-content-labels {
4
+ display: flex;
5
+ gap: 10px;
6
+ flex-wrap: wrap;
7
+ }
8
+ .pc-content-labels__label {
9
+ display: flex;
10
+ align-items: center;
11
+ flex-wrap: nowrap;
12
+ flex-shrink: 0;
13
+ padding: 5px 11px;
14
+ background-color: var(--g-color-base-generic);
15
+ border-radius: 6px;
16
+ }
17
+ .pc-content-labels__label, .pc-content-labels__label-text {
18
+ color: var(--g-color-text-primary);
19
+ }
20
+ .pc-content-labels__label > .pc-icon, .pc-content-labels__label > picture {
21
+ display: flex;
22
+ }
23
+ .pc-content-labels__label-icon {
24
+ width: 16px;
25
+ height: 16px;
26
+ margin-inline-end: 6px;
27
+ }
28
+ .pc-content-labels__label_theme_light {
29
+ background-color: var(--g-color-private-black-50);
30
+ }
31
+ .pc-content-labels__label_theme_light,
32
+ .pc-content-labels__label_theme_light .pc-content-labels__label-text {
33
+ color: var(--g-color-text-dark-primary);
34
+ }
35
+ .pc-content-labels__label_theme_dark {
36
+ background-color: var(--g-color-private-white-100);
37
+ }
38
+ .pc-content-labels__label_theme_dark,
39
+ .pc-content-labels__label_theme_dark .pc-content-labels__label-text {
40
+ color: var(--g-color-text-light-primary);
41
+ }
42
+ .pc-content-labels_size_l .pc-content-labels__label, .pc-content-labels_size_m .pc-content-labels__label {
43
+ font-family: var(--g-text-body-font-family);
44
+ font-weight: var(--g-text-body-font-weight);
45
+ font-size: var(--g-text-body-3-font-size);
46
+ line-height: var(--g-text-body-3-line-height);
47
+ }
48
+ .pc-content-labels_size_s .pc-content-labels__label {
49
+ font-family: var(--g-text-body-font-family);
50
+ font-weight: var(--g-text-body-font-weight);
51
+ font-size: var(--g-text-body-2-font-size);
52
+ line-height: var(--g-text-body-2-line-height);
53
+ }
@@ -0,0 +1,3 @@
1
+ import { ClassNameProps, ContentLabelsProps, QAProps } from "../../models/index.js";
2
+ declare const ContentLabels: ({ className, labels, theme, size, qa, }: ContentLabelsProps & ClassNameProps & QAProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default ContentLabels;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const utils_1 = require("../../utils/index.js");
6
+ const ContentIcon_1 = tslib_1.__importDefault(require("../ContentIcon/ContentIcon.js"));
7
+ const b = (0, utils_1.block)('content-labels');
8
+ const ContentLabels = ({ className, labels, theme, size = 'l', qa, }) => {
9
+ const qaAttributes = (0, utils_1.getQaAttrubutes)(qa, ['icon', 'text']);
10
+ return ((0, jsx_runtime_1.jsx)("div", { className: b({ size }, className), children: labels.map((label) => {
11
+ const { text, icon, gravityIcon } = label;
12
+ return ((0, jsx_runtime_1.jsxs)("div", { className: b('label', { theme }), children: [(0, jsx_runtime_1.jsx)(ContentIcon_1.default, { className: b('label-icon'), icon: icon, gravityIcon: gravityIcon, qa: qaAttributes.icon }), (0, jsx_runtime_1.jsx)("span", { className: b('label-text'), "data-qa": qaAttributes.text, children: text })] }, text));
13
+ }) }));
14
+ };
15
+ exports.default = ContentLabels;
16
+ //# sourceMappingURL=ContentLabels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContentLabels.js","sourceRoot":"../../../../src","sources":["components/ContentLabels/ContentLabels.tsx"],"names":[],"mappings":";;;;AACA,gDAAmD;AACnD,wFAAqD;AAIrD,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,gBAAgB,CAAC,CAAC;AAElC,MAAM,aAAa,GAAG,CAAC,EACnB,SAAS,EACT,MAAM,EACN,KAAK,EACL,IAAI,GAAG,GAAG,EACV,EAAE,GAC0C,EAAE,EAAE;IAChD,MAAM,YAAY,GAAG,IAAA,uBAAe,EAAC,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAE3D,OAAO,CACH,gCAAK,SAAS,EAAE,CAAC,CAAC,EAAC,IAAI,EAAC,EAAE,SAAS,CAAC,YAC/B,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YAClB,MAAM,EAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAC,GAAG,KAAK,CAAC;YAExC,OAAO,CACH,iCAAgB,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,KAAK,EAAC,CAAC,aAC1C,uBAAC,qBAAW,IACR,SAAS,EAAE,CAAC,CAAC,YAAY,CAAC,EAC1B,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,EAAE,EAAE,YAAY,CAAC,IAAI,GACvB,EACF,iCAAM,SAAS,EAAE,CAAC,CAAC,YAAY,CAAC,aAAW,YAAY,CAAC,IAAI,YACvD,IAAI,GACF,KATD,IAAI,CAUR,CACT,CAAC;QACN,CAAC,CAAC,GACA,CACT,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,aAAa,CAAC","sourcesContent":["import {ClassNameProps, ContentLabelsProps, QAProps} from '../../models';\nimport {block, getQaAttrubutes} from '../../utils';\nimport ContentIcon from '../ContentIcon/ContentIcon';\n\nimport './ContentLabels.scss';\n\nconst b = block('content-labels');\n\nconst ContentLabels = ({\n className,\n labels,\n theme,\n size = 'l',\n qa,\n}: ContentLabelsProps & ClassNameProps & QAProps) => {\n const qaAttributes = getQaAttrubutes(qa, ['icon', 'text']);\n\n return (\n <div className={b({size}, className)}>\n {labels.map((label) => {\n const {text, icon, gravityIcon} = label;\n\n return (\n <div key={text} className={b('label', {theme})}>\n <ContentIcon\n className={b('label-icon')}\n icon={icon}\n gravityIcon={gravityIcon}\n qa={qaAttributes.icon}\n />\n <span className={b('label-text')} data-qa={qaAttributes.text}>\n {text}\n </span>\n </div>\n );\n })}\n </div>\n );\n};\n\nexport default ContentLabels;\n"]}
@@ -6,8 +6,8 @@ const React = tslib_1.__importStar(require("react"));
6
6
  const uuid_1 = require("uuid");
7
7
  const utils_1 = require("../../utils/index.js");
8
8
  const blocks_1 = require("../../utils/blocks.js");
9
+ const ContentIcon_1 = tslib_1.__importDefault(require("../ContentIcon/ContentIcon.js"));
9
10
  const YFMWrapper_1 = tslib_1.__importDefault(require("../YFMWrapper/YFMWrapper.js"));
10
- const ContentListItemIcon_1 = tslib_1.__importDefault(require("./ContentListItemIcon.js"));
11
11
  const b = (0, utils_1.block)('content-list');
12
12
  function getHeadingLevel(size) {
13
13
  switch (size) {
@@ -22,7 +22,7 @@ const ContentList = ({ list, size = 'l', qa, theme }) => {
22
22
  const qaAttributes = (0, blocks_1.getQaAttrubutes)(qa, ['image', 'title', 'text']);
23
23
  return ((0, jsx_runtime_1.jsx)("div", { className: b({ size, theme }), "data-qa": qa, children: list?.map((item) => {
24
24
  const { icon, title, text, gravityIcon } = item;
25
- return ((0, jsx_runtime_1.jsxs)("div", { className: b('item', { 'without-title': !title }), children: [(0, jsx_runtime_1.jsx)(ContentListItemIcon_1.default, { icon: icon, className: b('icon'), qa: qaAttributes.image, gravityIcon: gravityIcon }), (0, jsx_runtime_1.jsxs)("div", { children: [title &&
25
+ return ((0, jsx_runtime_1.jsxs)("div", { className: b('item', { 'without-title': !title }), children: [(0, jsx_runtime_1.jsx)(ContentIcon_1.default, { icon: icon, className: b('icon'), qa: qaAttributes.image, gravityIcon: gravityIcon }), (0, jsx_runtime_1.jsxs)("div", { children: [title &&
26
26
  React.createElement(getHeadingLevel(size), { className: b('title'), 'data-qa': qaAttributes.title }, (0, jsx_runtime_1.jsx)(YFMWrapper_1.default, { content: title, modifiers: { constructor: true } })), text && ((0, jsx_runtime_1.jsx)(YFMWrapper_1.default, { contentClassName: b('text', { 'without-title': !title }), content: text, modifiers: { constructor: true }, qa: qaAttributes.text }))] })] }, (0, uuid_1.v4)()));
27
27
  }) }));
28
28
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ContentList.js","sourceRoot":"../../../../src","sources":["components/ContentList/ContentList.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAE/B,+BAAkC;AAIlC,gDAAkC;AAClC,kDAAmD;AACnD,qFAAkD;AAElD,2FAA6C;AAI7C,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,cAAc,CAAC,CAAC;AAEhC,SAAS,eAAe,CAAC,IAAiB;IACtC,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,GAAG;YACJ,OAAO,IAAI,CAAC;QAChB,KAAK,GAAG,CAAC;QACT;YACI,OAAO,IAAI,CAAC;IACpB,CAAC;AACL,CAA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IAAA,SAAM,GAAE,CAuB7D,CACT,CAAC;QACN,CAAC,CAAC,GACA,CACT,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {v4 as uuidv4} from 'uuid';\n\nimport {ContentListProps, ContentSize} from '../../models';\nimport {QAProps} from '../../models/common';\nimport {block} from '../../utils';\nimport {getQaAttrubutes} from '../../utils/blocks';\nimport YFMWrapper from '../YFMWrapper/YFMWrapper';\n\nimport ItemIcon from './ContentListItemIcon';\n\nimport './ContentList.scss';\n\nconst b = block('content-list');\n\nfunction getHeadingLevel(size: ContentSize) {\n switch (size) {\n case 's':\n return 'h4';\n case 'l':\n default:\n return 'h3';\n }\n}\n\nconst ContentList = ({list, size = 'l', qa, theme}: ContentListProps & QAProps) => {\n const qaAttributes = getQaAttrubutes(qa, ['image', 'title', 'text']);\n\n return (\n <div className={b({size, theme})} data-qa={qa}>\n {list?.map((item) => {\n const {icon, title, text, gravityIcon} = item;\n return (\n <div className={b('item', {'without-title': !title})} key={uuidv4()}>\n <ItemIcon\n icon={icon}\n className={b('icon')}\n qa={qaAttributes.image}\n gravityIcon={gravityIcon}\n />\n <div>\n {title &&\n React.createElement(\n getHeadingLevel(size),\n {className: b('title'), 'data-qa': qaAttributes.title},\n <YFMWrapper content={title} modifiers={{constructor: true}} />,\n )}\n {text && (\n <YFMWrapper\n contentClassName={b('text', {'without-title': !title})}\n content={text}\n modifiers={{constructor: true}}\n qa={qaAttributes.text}\n />\n )}\n </div>\n </div>\n );\n })}\n </div>\n );\n};\n\nexport default ContentList;\n"]}
1
+ {"version":3,"file":"ContentList.js","sourceRoot":"../../../../src","sources":["components/ContentList/ContentList.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAE/B,+BAAkC;AAIlC,gDAAkC;AAClC,kDAAmD;AACnD,wFAAqD;AACrD,qFAAkD;AAIlD,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,cAAc,CAAC,CAAC;AAEhC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,eAAe,EAAE,CAAC,KAAK,EAAC,CAAC,EACtD,OAAO,EAAE,IAAI,EACb,SAAS,EAAE,EAAC,WAAW,EAAE,IAAI,EAAC,EAC9B,EAAE,EAAE,YAAY,CAAC,IAAI,GACvB,CACL,IACC,KAtBiD,IAAA,SAAM,GAAE,CAuB7D,CACT,CAAC;QACN,CAAC,CAAC,GACA,CACT,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {v4 as uuidv4} from 'uuid';\n\nimport {ContentListProps, ContentSize} from '../../models';\nimport {QAProps} from '../../models/common';\nimport {block} from '../../utils';\nimport {getQaAttrubutes} from '../../utils/blocks';\nimport ContentIcon from '../ContentIcon/ContentIcon';\nimport YFMWrapper from '../YFMWrapper/YFMWrapper';\n\nimport './ContentList.scss';\n\nconst b = block('content-list');\n\nfunction getHeadingLevel(size: ContentSize) {\n switch (size) {\n case 's':\n return 'h4';\n case 'l':\n default:\n return 'h3';\n }\n}\n\nconst ContentList = ({list, size = 'l', qa, theme}: ContentListProps & QAProps) => {\n const qaAttributes = getQaAttrubutes(qa, ['image', 'title', 'text']);\n\n return (\n <div className={b({size, theme})} data-qa={qa}>\n {list?.map((item) => {\n const {icon, title, text, gravityIcon} = item;\n return (\n <div className={b('item', {'without-title': !title})} key={uuidv4()}>\n <ContentIcon\n icon={icon}\n className={b('icon')}\n qa={qaAttributes.image}\n gravityIcon={gravityIcon}\n />\n <div>\n {title &&\n React.createElement(\n getHeadingLevel(size),\n {className: b('title'), 'data-qa': qaAttributes.title},\n <YFMWrapper content={title} modifiers={{constructor: true}} />,\n )}\n {text && (\n <YFMWrapper\n contentClassName={b('text', {'without-title': !title})}\n content={text}\n modifiers={{constructor: true}}\n qa={qaAttributes.text}\n />\n )}\n </div>\n </div>\n );\n })}\n </div>\n );\n};\n\nexport default ContentList;\n"]}