@gravity-ui/page-constructor 7.11.2 → 7.13.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 (40) hide show
  1. package/build/cjs/blocks/Form/Form.d.ts +2 -2
  2. package/build/cjs/blocks/Form/Form.js +2 -2
  3. package/build/cjs/blocks/Form/Form.js.map +1 -1
  4. package/build/cjs/blocks/Header/Header.css +13 -0
  5. package/build/cjs/blocks/Header/Header.js +5 -4
  6. package/build/cjs/blocks/Header/Header.js.map +1 -1
  7. package/build/cjs/blocks/Header/schema.d.ts +77 -0
  8. package/build/cjs/blocks/Header/schema.js +13 -1
  9. package/build/cjs/blocks/Header/schema.js.map +1 -1
  10. package/build/cjs/blocks/HeaderSlider/schema.d.ts +29 -0
  11. package/build/cjs/components/DefaultVideo/DefaultVideo.js +14 -1
  12. package/build/cjs/components/DefaultVideo/DefaultVideo.js.map +1 -1
  13. package/build/cjs/models/constructor-items/blocks.d.ts +7 -0
  14. package/build/cjs/models/constructor-items/blocks.js.map +1 -1
  15. package/build/cjs/models/constructor-items/common.d.ts +5 -1
  16. package/build/cjs/models/constructor-items/common.js.map +1 -1
  17. package/build/cjs/navigation/hooks/useActiveNavItem.d.ts +6 -7
  18. package/build/cjs/navigation/utils.d.ts +3 -3
  19. package/build/esm/blocks/Form/Form.d.ts +2 -2
  20. package/build/esm/blocks/Form/Form.js +2 -2
  21. package/build/esm/blocks/Form/Form.js.map +1 -1
  22. package/build/esm/blocks/Header/Header.css +13 -0
  23. package/build/esm/blocks/Header/Header.js +5 -4
  24. package/build/esm/blocks/Header/Header.js.map +1 -1
  25. package/build/esm/blocks/Header/schema.d.ts +77 -0
  26. package/build/esm/blocks/Header/schema.js +12 -0
  27. package/build/esm/blocks/Header/schema.js.map +1 -1
  28. package/build/esm/blocks/HeaderSlider/schema.d.ts +29 -0
  29. package/build/esm/components/DefaultVideo/DefaultVideo.js +14 -1
  30. package/build/esm/components/DefaultVideo/DefaultVideo.js.map +1 -1
  31. package/build/esm/models/constructor-items/blocks.d.ts +7 -0
  32. package/build/esm/models/constructor-items/blocks.js.map +1 -1
  33. package/build/esm/models/constructor-items/common.d.ts +5 -1
  34. package/build/esm/models/constructor-items/common.js.map +1 -1
  35. package/build/esm/navigation/hooks/useActiveNavItem.d.ts +6 -7
  36. package/build/esm/navigation/utils.d.ts +3 -3
  37. package/package.json +1 -1
  38. package/schema/index.js +1 -1
  39. package/server/models/constructor-items/blocks.d.ts +7 -0
  40. package/server/models/constructor-items/common.d.ts +5 -1
@@ -1,3 +1,3 @@
1
1
  import type { FormBlockProps } from "../../models/index.js";
2
- declare const FormBlock: (props: FormBlockProps) => import("react/jsx-runtime").JSX.Element | null;
3
- export default FormBlock;
2
+ declare const Form: (props: FormBlockProps) => import("react/jsx-runtime").JSX.Element | null;
3
+ export default Form;
@@ -13,7 +13,7 @@ const sub_blocks_1 = require("../../sub-blocks/index.js");
13
13
  const utils_1 = require("../../utils/index.js");
14
14
  const b = (0, utils_1.block)('form-block');
15
15
  const colSizes = { [grid_1.GridColumnSize.Lg]: 6, [grid_1.GridColumnSize.All]: 12 };
16
- const FormBlock = (props) => {
16
+ const Form = (props) => {
17
17
  const { formData, title, textContent, direction = models_1.FormBlockDirection.Center, background } = props;
18
18
  const [contentLoaded, setContentLoaded] = React.useState(false);
19
19
  const isMobile = React.useContext(mobileContext_1.MobileContext);
@@ -50,5 +50,5 @@ const FormBlock = (props) => {
50
50
  textSize: 's',
51
51
  }, className: b('title', { mobile: isMobile }), colSizes: { all: 12 } })), (0, jsx_runtime_1.jsx)(InnerForm_1.default, { className: b('form'), formData: formData, onContentLoad: onContentLoad })] }) }) })] }) })] }));
52
52
  };
53
- exports.default = FormBlock;
53
+ exports.default = Form;
54
54
  //# 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,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;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,SAAS,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 FormBlock = (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 FormBlock;\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;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;AA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N,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"]}
@@ -145,6 +145,13 @@ unpredictable css rules order in build */
145
145
  object-fit: cover;
146
146
  border-radius: var(--pc-border-radius);
147
147
  }
148
+ .pc-header-block__video-iframe {
149
+ position: absolute;
150
+ top: 50%;
151
+ right: 0;
152
+ left: 0;
153
+ transform: translateY(-50%);
154
+ }
148
155
  .pc-header-block__breadcrumbs {
149
156
  position: absolute;
150
157
  top: 16px;
@@ -220,6 +227,12 @@ unpredictable css rules order in build */
220
227
  left: 50%;
221
228
  transform: translate(-50%, -50%);
222
229
  }
230
+ .pc-header-block_media-view_full .pc-header-block__video-iframe {
231
+ top: 0;
232
+ bottom: 0;
233
+ height: auto !important; /* stylelint-disable-line declaration-no-important */
234
+ transform: none;
235
+ }
223
236
  @media (max-width: 1440px) {
224
237
  .pc-header-block__background, .pc-header-block__background.pc-header-block__background_media {
225
238
  left: 0;
@@ -24,11 +24,11 @@ const Background = ({ background, isMobile }) => {
24
24
  };
25
25
  const FullWidthBackground = ({ background }) => ((0, jsx_runtime_1.jsx)("div", { className: b('background', { ['full-width']: true }), style: { backgroundColor: background?.color } }));
26
26
  const HeaderBlock = (props) => {
27
- const { title, overtitle, description, buttons, image, video, width = 'm', imageSize, offset = 'default', background, theme: textTheme = 'light', verticalOffset = 'm', className, gridClassName, breadcrumbs, status, renderTitle, children, mediaView = 'full', centered, additionalInfo, mediaClassName, contentWrapperClassName, contentInnerClassName, } = props;
27
+ const { title, overtitle, description, buttons, image, video, videoIframe, width = 'm', imageSize, offset = 'default', background, theme: textTheme = 'light', verticalOffset = 'm', className, gridClassName, breadcrumbs, status, renderTitle, children, mediaView = 'full', centered, additionalInfo, mediaClassName, contentWrapperClassName, contentInnerClassName, } = props;
28
28
  const windowWidth = (0, windowWidthContext_1.useWindowWidth)();
29
29
  const isMobile = windowWidth <= constants_1.BREAKPOINTS.sm;
30
30
  const theme = (0, theme_1.useTheme)();
31
- const hasRightSideImage = Boolean((image || video) && !centered);
31
+ const hasRightSideImage = Boolean((image || video || videoIframe) && !centered);
32
32
  const curImageSize = imageSize || (0, utils_3.getImageSize)(width);
33
33
  const titleSizes = hasRightSideImage ? (0, utils_3.titleWithImageSizes)(curImageSize) : (0, utils_3.getTitleSizes)(width);
34
34
  let curVerticalOffset = verticalOffset;
@@ -38,7 +38,8 @@ const HeaderBlock = (props) => {
38
38
  const backgroundThemed = background && (0, utils_2.getThemedValue)(background, theme);
39
39
  const imageThemed = image && (0, utils_2.getThemedValue)(image, theme);
40
40
  const videoThemed = video && (0, utils_2.getThemedValue)(video, theme);
41
- const mediaWithMicrodata = (0, microdata_1.mergeVideoMicrodata)({ video: videoThemed, image: imageThemed }, { name: title, description });
41
+ const { src: videoIframeSrc, ...videoIframeProps } = videoIframe ?? {};
42
+ const mediaWithMicrodata = (0, microdata_1.mergeVideoMicrodata)({ video: videoThemed, image: imageThemed, videoIframe: videoIframeSrc, ...videoIframeProps }, { name: title, description });
42
43
  const fullWidth = backgroundThemed?.fullWidth || backgroundThemed?.fullWidthMedia;
43
44
  const titleId = (0, uikit_1.useUniqId)();
44
45
  return ((0, jsx_runtime_1.jsxs)("header", { className: b({
@@ -59,7 +60,7 @@ const HeaderBlock = (props) => {
59
60
  } }) })), buttons && ((0, jsx_runtime_1.jsx)("div", { className: b('buttons'), "data-qa": "header-buttons", children: buttons.map((button, index) => ((0, jsx_runtime_1.jsx)(components_1.RouterLink, { href: button.url, children: (0, jsx_runtime_1.jsx)(components_1.Button, { className: b('button'), size: "xl", extraProps: {
60
61
  'aria-describedby': titleId,
61
62
  ...button.extraProps,
62
- }, ...button }, index) }, index))) })), children] }) }) }), hasRightSideImage && ((0, jsx_runtime_1.jsx)(components_1.Media, { className: b('media', { [curImageSize]: true }, mediaClassName), videoClassName: b('video'), imageClassName: b('image'), ...mediaWithMicrodata }))] }) })] })] }));
63
+ }, ...button }, index) }, index))) })), children] }) }) }), hasRightSideImage && ((0, jsx_runtime_1.jsx)(components_1.Media, { className: b('media', { [curImageSize]: true }, mediaClassName), videoClassName: b('video'), imageClassName: b('image'), youtubeClassName: b('video-iframe'), ...mediaWithMicrodata }))] }) })] })] }));
63
64
  };
64
65
  exports.HeaderBlock = HeaderBlock;
65
66
  exports.default = exports.HeaderBlock;
@@ -1 +1 @@
1
- {"version":3,"file":"Header.js","sourceRoot":"../../../../src","sources":["blocks/Header/Header.tsx"],"names":[],"mappings":";;;;;AAGA,6CAA4C;AAE5C,0DAA2D;AAC3D,wHAAqF;AACrF,iEAAiE;AACjE,mGAAgE;AAChE,kDAA4C;AAC5C,wDAA6C;AAC7C,kFAAgE;AAChE,8CAA0C;AAE1C,gDAAkD;AAClD,wDAA0D;AAE1D,sCAAyE;AAIzE,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,cAAc,CAAC,CAAC;AAgBhC,MAAM,UAAU,GAAG,CAAC,EAAC,UAAU,EAAE,QAAQ,EAAkB,EAAE,EAAE;IAC3D,MAAM,EAAC,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAC,GAAG,UAAU,CAAC;IAC9D,MAAM,WAAW,GAAG,GAAG,CAAC,CAAC,CAAC,IAAA,qBAAa,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CA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,GAAG,YACxB,uBAAC,mBAAM,IAEH,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,EACtB,IAAI,EAAC,IAAI,EACT,UAAU,EAAE;gEACR,kBAAkB,EAAE,OAAO;gEAC3B,GAAG,MAAM,CAAC,UAAU;6DACvB,KACG,MAAM,IAPL,KAAK,CAQZ,IAV6B,KAAK,CAW3B,CAChB,CAAC,GACA,CACT,EACA,QAAQ,IACP,GACJ,GACJ,EACL,iBAAiB,IAAI,CAClB,uBAAC,kBAAK,IACF,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAC,EAAE,cAAc,CAAC,EAC7D,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,EAC1B,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,KACtB,kBAAkB,GACxB,CACL,IACC,GACJ,IACH,IACF,CACZ,CAAC;AACN,CAAC,CAAC;AA3KW,QAAA,WAAW,eA2KtB;AAEF,kBAAe,mBAAW,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport * as React from 'react';\n\nimport {useUniqId} from '@gravity-ui/uikit';\n\nimport {Button, Media, RouterLink} from '../../components';\nimport HeaderBreadcrumbs from '../../components/HeaderBreadcrumbs/HeaderBreadcrumbs';\nimport {getMediaImage} from '../../components/Media/Image/utils';\nimport YFMWrapper from '../../components/YFMWrapper/YFMWrapper';\nimport {BREAKPOINTS} from '../../constants';\nimport {useTheme} from '../../context/theme';\nimport {useWindowWidth} from '../../context/windowWidthContext';\nimport {Col, Grid, Row} from '../../grid';\nimport {ClassNameProps, HeaderBlockBackground, HeaderBlockProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\nimport {mergeVideoMicrodata} from '../../utils/microdata';\n\nimport {getImageSize, getTitleSizes, titleWithImageSizes} from './utils';\n\nimport './Header.scss';\n\nconst b = block('header-block');\n\ntype ElementsClassName = {\n gridClassName?: string;\n mediaClassName?: string;\n contentWrapperClassName?: string;\n contentInnerClassName?: string;\n};\n\nexport type HeaderBlockFullProps = HeaderBlockProps & ClassNameProps & ElementsClassName;\n\ninterface BackgroundProps {\n background: HeaderBlockBackground;\n isMobile: boolean;\n}\n\nconst Background = ({background, isMobile}: BackgroundProps) => {\n const {url, image, fullWidthMedia, video, color} = background;\n const imageObject = url ? getMediaImage(url) : image;\n const renderMedia = !isMobile || (typeof image === 'object' && 'mobile' in image);\n\n return (\n <div\n className={b('background', {media: true, 'full-width-media': fullWidthMedia})}\n style={{backgroundColor: color}}\n >\n {renderMedia && (\n <Media\n {...background}\n className={b('background-media')}\n imageClassName={b('image')}\n videoClassName={b('video')}\n isBackground={true}\n parallax={false}\n video={isMobile ? undefined : video}\n image={imageObject}\n />\n )}\n </div>\n );\n};\n\ninterface FullWidthBackgroundProps {\n background: HeaderBlockBackground;\n}\n\nconst FullWidthBackground = ({background}: FullWidthBackgroundProps) => (\n <div\n className={b('background', {['full-width']: true})}\n style={{backgroundColor: background?.color}}\n />\n);\n\nexport const HeaderBlock = (props: React.PropsWithChildren<HeaderBlockFullProps>) => {\n const {\n title,\n overtitle,\n description,\n buttons,\n image,\n video,\n width = 'm',\n imageSize,\n offset = 'default',\n background,\n theme: textTheme = 'light',\n verticalOffset = 'm',\n className,\n gridClassName,\n breadcrumbs,\n status,\n renderTitle,\n children,\n mediaView = 'full',\n centered,\n additionalInfo,\n mediaClassName,\n contentWrapperClassName,\n contentInnerClassName,\n } = props;\n const windowWidth = useWindowWidth();\n const isMobile = windowWidth <= BREAKPOINTS.sm;\n const theme = useTheme();\n const hasRightSideImage = Boolean((image || video) && !centered);\n const curImageSize = imageSize || getImageSize(width);\n const titleSizes = hasRightSideImage ? titleWithImageSizes(curImageSize) : getTitleSizes(width);\n let curVerticalOffset = verticalOffset;\n\n if (hasRightSideImage && !verticalOffset) {\n curVerticalOffset = 'm';\n }\n\n const backgroundThemed = background && getThemedValue(background, theme);\n const imageThemed = image && getThemedValue(image, theme);\n const videoThemed = video && getThemedValue(video, theme);\n const mediaWithMicrodata = mergeVideoMicrodata(\n {video: videoThemed, image: imageThemed},\n {name: title, description},\n );\n const fullWidth = backgroundThemed?.fullWidth || backgroundThemed?.fullWidthMedia;\n const titleId = useUniqId();\n\n return (\n <header\n className={b(\n {\n ['has-media']: hasRightSideImage,\n ['full-width']: fullWidth,\n ['media-view']: mediaView,\n ['controls-view']: textTheme,\n },\n className,\n )}\n >\n {backgroundThemed && fullWidth && <FullWidthBackground background={backgroundThemed} />}\n {backgroundThemed && <Background background={backgroundThemed} isMobile={isMobile} />}\n <Grid containerClass={b('container-fluid')} className={b(null, gridClassName)}>\n {breadcrumbs && (\n <Row className={b('breadcrumbs')}>\n <Col>\n <HeaderBreadcrumbs {...breadcrumbs} theme={textTheme} />\n </Col>\n </Row>\n )}\n <Row>\n <Col reset className={b('content-wrapper', contentWrapperClassName)}>\n <Row>\n <Col\n className={b('content', {\n offset,\n theme: textTheme,\n 'vertical-offset': curVerticalOffset,\n })}\n >\n <Col\n sizes={titleSizes}\n className={b(\n 'content-inner',\n {centered},\n contentInnerClassName,\n )}\n >\n {overtitle && (\n <div className={b('overtitle')}>\n {typeof overtitle === 'string' ? (\n <YFMWrapper\n tagName=\"div\"\n className={b('overtitle')}\n content={overtitle}\n modifiers={{constructor: true}}\n />\n ) : (\n overtitle\n )}\n </div>\n )}\n <YFMWrapper\n content={title}\n contentClassName={b('title')}\n className={b('title-container')}\n modifiers={{constructor: true, constructorTheme: textTheme}}\n tagName=\"h1\"\n contentPosition=\"end\"\n >\n {status}\n {renderTitle ? renderTitle(title) : null}\n </YFMWrapper>\n {description && (\n <div className={b('description', {theme: textTheme})}>\n <YFMWrapper\n content={description}\n modifiers={{\n constructor: true,\n constructorTheme: textTheme,\n }}\n />\n </div>\n )}\n {additionalInfo && (\n <div className={b('additional-info', {theme: textTheme})}>\n <YFMWrapper\n content={additionalInfo}\n modifiers={{\n constructor: true,\n constructorTheme: textTheme,\n }}\n />\n </div>\n )}\n {buttons && (\n <div className={b('buttons')} data-qa=\"header-buttons\">\n {buttons.map((button, index) => (\n <RouterLink href={button.url} key={index}>\n <Button\n key={index}\n className={b('button')}\n size=\"xl\"\n extraProps={{\n 'aria-describedby': titleId,\n ...button.extraProps,\n }}\n {...button}\n />\n </RouterLink>\n ))}\n </div>\n )}\n {children}\n </Col>\n </Col>\n </Row>\n {hasRightSideImage && (\n <Media\n className={b('media', {[curImageSize]: true}, mediaClassName)}\n videoClassName={b('video')}\n imageClassName={b('image')}\n {...mediaWithMicrodata}\n />\n )}\n </Col>\n </Row>\n </Grid>\n </header>\n );\n};\n\nexport default HeaderBlock;\n"]}
1
+ {"version":3,"file":"Header.js","sourceRoot":"../../../../src","sources":["blocks/Header/Header.tsx"],"names":[],"mappings":";;;;;AAGA,6CAA4C;AAE5C,0DAA2D;AAC3D,wHAAqF;AACrF,iEAAiE;AACjE,mGAAgE;AAChE,kDAA4C;AAC5C,wDAA6C;AAC7C,kFAAgE;AAChE,8CAA0C;AAE1C,gDAAkD;AAClD,wDAA0D;AAE1D,sCAAyE;AAIzE,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,cAAc,CAAC,CAAC;AAgBhC,MAAM,UAAU,GAAG,CAAC,EAAC,UAAU,EAAE,QAAQ,EAAkB,EAAE,EAAE;IAC3D,MAAM,EAAC,GAAG,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAC,GAAG,UAAU,CAAC;IAC9D,MAAM,WAAW,GAAG,GAAG,CAAC,CAAC,CAAC,IAAA,qBAAa,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACrD,MAAM,WAAW,GAAG,CAAC,QAAQ,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,IAAI,KAAK,CAAC,CAAC;IAElF,OAAO,CACH,gCACI,SAAS,EAAE,CAAC,CAAC,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE,cAAc,EAAC,CAAC,EAC7E,KAA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C,IAAI,EACT,UAAU,EAAE;gEACR,kBAAkB,EAAE,OAAO;gEAC3B,GAAG,MAAM,CAAC,UAAU;6DACvB,KACG,MAAM,IAPL,KAAK,CAQZ,IAV6B,KAAK,CAW3B,CAChB,CAAC,GACA,CACT,EACA,QAAQ,IACP,GACJ,GACJ,EACL,iBAAiB,IAAI,CAClB,uBAAC,kBAAK,IACF,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,EAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAC,EAAE,cAAc,CAAC,EAC7D,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,EAC1B,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,EAC1B,gBAAgB,EAAE,CAAC,CAAC,cAAc,CAAC,KAC/B,kBAAkB,GACxB,CACL,IACC,GACJ,IACH,IACF,CACZ,CAAC;AACN,CAAC,CAAC;AA9KW,QAAA,WAAW,eA8KtB;AAEF,kBAAe,mBAAW,CAAC","sourcesContent":["/* eslint-disable complexity */\nimport * as React from 'react';\n\nimport {useUniqId} from '@gravity-ui/uikit';\n\nimport {Button, Media, RouterLink} from '../../components';\nimport HeaderBreadcrumbs from '../../components/HeaderBreadcrumbs/HeaderBreadcrumbs';\nimport {getMediaImage} from '../../components/Media/Image/utils';\nimport YFMWrapper from '../../components/YFMWrapper/YFMWrapper';\nimport {BREAKPOINTS} from '../../constants';\nimport {useTheme} from '../../context/theme';\nimport {useWindowWidth} from '../../context/windowWidthContext';\nimport {Col, Grid, Row} from '../../grid';\nimport {ClassNameProps, HeaderBlockBackground, HeaderBlockProps} from '../../models';\nimport {block, getThemedValue} from '../../utils';\nimport {mergeVideoMicrodata} from '../../utils/microdata';\n\nimport {getImageSize, getTitleSizes, titleWithImageSizes} from './utils';\n\nimport './Header.scss';\n\nconst b = block('header-block');\n\ntype ElementsClassName = {\n gridClassName?: string;\n mediaClassName?: string;\n contentWrapperClassName?: string;\n contentInnerClassName?: string;\n};\n\nexport type HeaderBlockFullProps = HeaderBlockProps & ClassNameProps & ElementsClassName;\n\ninterface BackgroundProps {\n background: HeaderBlockBackground;\n isMobile: boolean;\n}\n\nconst Background = ({background, isMobile}: BackgroundProps) => {\n const {url, image, fullWidthMedia, video, color} = background;\n const imageObject = url ? getMediaImage(url) : image;\n const renderMedia = !isMobile || (typeof image === 'object' && 'mobile' in image);\n\n return (\n <div\n className={b('background', {media: true, 'full-width-media': fullWidthMedia})}\n style={{backgroundColor: color}}\n >\n {renderMedia && (\n <Media\n {...background}\n className={b('background-media')}\n imageClassName={b('image')}\n videoClassName={b('video')}\n isBackground={true}\n parallax={false}\n video={isMobile ? undefined : video}\n image={imageObject}\n />\n )}\n </div>\n );\n};\n\ninterface FullWidthBackgroundProps {\n background: HeaderBlockBackground;\n}\n\nconst FullWidthBackground = ({background}: FullWidthBackgroundProps) => (\n <div\n className={b('background', {['full-width']: true})}\n style={{backgroundColor: background?.color}}\n />\n);\n\nexport const HeaderBlock = (props: React.PropsWithChildren<HeaderBlockFullProps>) => {\n const {\n title,\n overtitle,\n description,\n buttons,\n image,\n video,\n videoIframe,\n width = 'm',\n imageSize,\n offset = 'default',\n background,\n theme: textTheme = 'light',\n verticalOffset = 'm',\n className,\n gridClassName,\n breadcrumbs,\n status,\n renderTitle,\n children,\n mediaView = 'full',\n centered,\n additionalInfo,\n mediaClassName,\n contentWrapperClassName,\n contentInnerClassName,\n } = props;\n const windowWidth = useWindowWidth();\n const isMobile = windowWidth <= BREAKPOINTS.sm;\n const theme = useTheme();\n const hasRightSideImage = Boolean((image || video || videoIframe) && !centered);\n const curImageSize = imageSize || getImageSize(width);\n const titleSizes = hasRightSideImage ? titleWithImageSizes(curImageSize) : getTitleSizes(width);\n let curVerticalOffset = verticalOffset;\n\n if (hasRightSideImage && !verticalOffset) {\n curVerticalOffset = 'm';\n }\n\n const backgroundThemed = background && getThemedValue(background, theme);\n const imageThemed = image && getThemedValue(image, theme);\n const videoThemed = video && getThemedValue(video, theme);\n const {src: videoIframeSrc, ...videoIframeProps} = videoIframe ?? {};\n const mediaWithMicrodata = mergeVideoMicrodata(\n {video: videoThemed, image: imageThemed, videoIframe: videoIframeSrc, ...videoIframeProps},\n {name: title, description},\n );\n const fullWidth = backgroundThemed?.fullWidth || backgroundThemed?.fullWidthMedia;\n const titleId = useUniqId();\n\n return (\n <header\n className={b(\n {\n ['has-media']: hasRightSideImage,\n ['full-width']: fullWidth,\n ['media-view']: mediaView,\n ['controls-view']: textTheme,\n },\n className,\n )}\n >\n {backgroundThemed && fullWidth && <FullWidthBackground background={backgroundThemed} />}\n {backgroundThemed && <Background background={backgroundThemed} isMobile={isMobile} />}\n <Grid containerClass={b('container-fluid')} className={b(null, gridClassName)}>\n {breadcrumbs && (\n <Row className={b('breadcrumbs')}>\n <Col>\n <HeaderBreadcrumbs {...breadcrumbs} theme={textTheme} />\n </Col>\n </Row>\n )}\n <Row>\n <Col reset className={b('content-wrapper', contentWrapperClassName)}>\n <Row>\n <Col\n className={b('content', {\n offset,\n theme: textTheme,\n 'vertical-offset': curVerticalOffset,\n })}\n >\n <Col\n sizes={titleSizes}\n className={b(\n 'content-inner',\n {centered},\n contentInnerClassName,\n )}\n >\n {overtitle && (\n <div className={b('overtitle')}>\n {typeof overtitle === 'string' ? (\n <YFMWrapper\n tagName=\"div\"\n className={b('overtitle')}\n content={overtitle}\n modifiers={{constructor: true}}\n />\n ) : (\n overtitle\n )}\n </div>\n )}\n <YFMWrapper\n content={title}\n contentClassName={b('title')}\n className={b('title-container')}\n modifiers={{constructor: true, constructorTheme: textTheme}}\n tagName=\"h1\"\n contentPosition=\"end\"\n >\n {status}\n {renderTitle ? renderTitle(title) : null}\n </YFMWrapper>\n {description && (\n <div className={b('description', {theme: textTheme})}>\n <YFMWrapper\n content={description}\n modifiers={{\n constructor: true,\n constructorTheme: textTheme,\n }}\n />\n </div>\n )}\n {additionalInfo && (\n <div className={b('additional-info', {theme: textTheme})}>\n <YFMWrapper\n content={additionalInfo}\n modifiers={{\n constructor: true,\n constructorTheme: textTheme,\n }}\n />\n </div>\n )}\n {buttons && (\n <div className={b('buttons')} data-qa=\"header-buttons\">\n {buttons.map((button, index) => (\n <RouterLink href={button.url} key={index}>\n <Button\n key={index}\n className={b('button')}\n size=\"xl\"\n extraProps={{\n 'aria-describedby': titleId,\n ...button.extraProps,\n }}\n {...button}\n />\n </RouterLink>\n ))}\n </div>\n )}\n {children}\n </Col>\n </Col>\n </Row>\n {hasRightSideImage && (\n <Media\n className={b('media', {[curImageSize]: true}, mediaClassName)}\n videoClassName={b('video')}\n imageClassName={b('image')}\n youtubeClassName={b('video-iframe')}\n {...mediaWithMicrodata}\n />\n )}\n </Col>\n </Row>\n </Grid>\n </header>\n );\n};\n\nexport default HeaderBlock;\n"]}
@@ -1,3 +1,22 @@
1
+ export declare const HeaderVideoIframeProps: {
2
+ type: string;
3
+ additionalProperties: boolean;
4
+ required: string[];
5
+ properties: {
6
+ src: {
7
+ type: string;
8
+ };
9
+ autoplay: {
10
+ type: string;
11
+ };
12
+ previewImg: {
13
+ type: string;
14
+ };
15
+ height: {
16
+ type: string;
17
+ };
18
+ };
19
+ };
1
20
  export declare const HeaderBackgroundProps: {
2
21
  type: string;
3
22
  additionalProperties: boolean;
@@ -492,6 +511,35 @@ export declare const HeaderProperties: {
492
511
  optionName: string;
493
512
  })[];
494
513
  };
514
+ videoIframe: {
515
+ oneOf: (({
516
+ type: string;
517
+ additionalProperties: boolean;
518
+ required: string[];
519
+ properties: {
520
+ src: {
521
+ type: string;
522
+ };
523
+ autoplay: {
524
+ type: string;
525
+ };
526
+ previewImg: {
527
+ type: string;
528
+ };
529
+ height: {
530
+ type: string;
531
+ };
532
+ };
533
+ } & {
534
+ optionName: string;
535
+ }) | {
536
+ type: string;
537
+ additionalProperties: boolean;
538
+ required: import("../../index.js").Theme[];
539
+ properties: {};
540
+ optionName: string;
541
+ })[];
542
+ };
495
543
  mediaView: {
496
544
  type: string;
497
545
  enum: string[];
@@ -1064,6 +1112,35 @@ export declare const HeaderBlock: {
1064
1112
  optionName: string;
1065
1113
  })[];
1066
1114
  };
1115
+ videoIframe: {
1116
+ oneOf: (({
1117
+ type: string;
1118
+ additionalProperties: boolean;
1119
+ required: string[];
1120
+ properties: {
1121
+ src: {
1122
+ type: string;
1123
+ };
1124
+ autoplay: {
1125
+ type: string;
1126
+ };
1127
+ previewImg: {
1128
+ type: string;
1129
+ };
1130
+ height: {
1131
+ type: string;
1132
+ };
1133
+ };
1134
+ } & {
1135
+ optionName: string;
1136
+ }) | {
1137
+ type: string;
1138
+ additionalProperties: boolean;
1139
+ required: import("../../index.js").Theme[];
1140
+ properties: {};
1141
+ optionName: string;
1142
+ })[];
1143
+ };
1067
1144
  mediaView: {
1068
1145
  type: string;
1069
1146
  enum: string[];
@@ -1,9 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HeaderBlock = exports.HeaderProperties = exports.HeaderBackgroundProps = void 0;
3
+ exports.HeaderBlock = exports.HeaderProperties = exports.HeaderBackgroundProps = exports.HeaderVideoIframeProps = void 0;
4
4
  const schema_1 = require("../../components/Image/schema.js");
5
5
  const common_1 = require("../../schema/validators/common.js");
6
6
  const utils_1 = require("../../schema/validators/utils.js");
7
+ exports.HeaderVideoIframeProps = {
8
+ type: 'object',
9
+ additionalProperties: false,
10
+ required: ['src'],
11
+ properties: {
12
+ src: { type: 'string' },
13
+ autoplay: { type: 'boolean' },
14
+ previewImg: { type: 'string' },
15
+ height: { type: 'number' },
16
+ },
17
+ };
7
18
  exports.HeaderBackgroundProps = {
8
19
  type: 'object',
9
20
  additionalProperties: false,
@@ -44,6 +55,7 @@ exports.HeaderProperties = {
44
55
  },
45
56
  image: (0, common_1.withTheme)(schema_1.ImageProps),
46
57
  video: (0, common_1.withTheme)(common_1.VideoProps),
58
+ videoIframe: (0, common_1.withTheme)(exports.HeaderVideoIframeProps),
47
59
  mediaView: {
48
60
  type: 'string',
49
61
  enum: common_1.mediaView,
@@ -1 +1 @@
1
- {"version":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c,EAAE;QACZ,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,OAAO,CAAC;QACnB,UAAU,EAAE;YACR,GAAG,uBAAc;YACjB,GAAG,wBAAgB;SACtB;KACJ;CACJ,CAAC","sourcesContent":["import {ImageProps} from '../../components/Image/schema';\nimport {\n BlockBaseProps,\n ButtonBlock,\n MediaProps,\n VideoProps,\n mediaView,\n withTheme,\n} from '../../schema/validators/common';\nimport {filteredArray} from '../../schema/validators/utils';\n\nexport const HeaderBackgroundProps = {\n type: 'object',\n additionalProperties: false,\n required: [],\n properties: {\n ...MediaProps,\n fullWidth: {type: 'boolean'},\n fullWidthMedia: {type: 'boolean'},\n },\n};\n\nexport const HeaderProperties = {\n title: {\n type: 'string',\n contentType: 'text',\n },\n overtitle: {\n type: 'string',\n contentType: 'text',\n },\n description: {\n type: 'string',\n contentType: 'yfm',\n inputType: 'textarea',\n },\n additionalInfo: {\n type: 'string',\n contentType: 'yfm',\n inputType: 'textarea',\n },\n width: {\n type: 'string',\n enum: ['s', 'm', 'l'],\n },\n buttons: filteredArray(ButtonBlock),\n offset: {\n type: 'string',\n enum: ['default', 'large'],\n },\n image: withTheme(ImageProps),\n video: withTheme(VideoProps),\n mediaView: {\n type: 'string',\n enum: mediaView,\n },\n backLink: {\n type: 'object',\n required: ['url', 'title'],\n properties: {\n url: {\n type: 'string',\n },\n title: {\n type: 'string',\n contentType: 'text',\n },\n },\n },\n imageSize: {\n type: 'string',\n enum: ['s', 'm'],\n },\n verticalOffset: {\n type: 'string',\n enum: ['0', 's', 'm', 'l', 'xl'],\n },\n background: withTheme(HeaderBackgroundProps),\n theme: {\n type: 'string',\n enum: ['default', 'dark'],\n },\n breadcrumbs: {\n type: 'object',\n additionalProperties: false,\n required: ['items'],\n properties: {\n items: {\n type: 'array',\n items: {\n type: 'object',\n additionalProperties: false,\n required: ['url', 'text'],\n properties: {\n url: {\n type: 'string',\n },\n text: {\n type: 'string',\n contentType: 'text',\n },\n },\n },\n },\n theme: {type: 'string', enum: ['light', 'dark']},\n },\n },\n status: {\n type: 'string',\n },\n centered: {\n type: 'boolean',\n },\n};\n\nexport const HeaderBlock = {\n 'header-block': {\n additionalProperties: false,\n required: ['title'],\n properties: {\n ...BlockBaseProps,\n ...HeaderProperties,\n },\n },\n};\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["blocks/Header/schema.ts"],"names":[],"mappings":";;;AAAA,6DAAyD;AACzD,8DAOwC;AACxC,4DAA4D;AAE/C,QAAA,sBAAsB,GAAG;IAClC,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,KAAK,CAAC;IACjB,UAAU,EAAE;QACR,GAAG,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;QACrB,QAAQ,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC;QAC3B,UAAU,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;QAC5B,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;KAC3B;CACJ,CAAC;AAEW,QAAA,qBAAqB,GAAG;IACjC,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE;QACR,GAAG,mBAAU;QACb,SAAS,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC;QAC5B,cAAc,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC;KACpC;CACJ,CAAC;AAEW,QAAA,gBAAgB,GAAG;IAC5B,KAAK,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,MAAM;KACtB;IACD,SAAS,EAAE;QACP,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,MAAM;KACtB;IACD,WAAW,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,KAAK;QAClB,SAAS,EAAE,UAAU;KACxB;IACD,cAAc,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,WAA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OAAO,CAAC;QACnB,UAAU,EAAE;YACR,KAAK,EAAE;gBACH,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,oBAAoB,EAAE,KAAK;oBAC3B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;oBACzB,UAAU,EAAE;wBACR,GAAG,EAAE;4BACD,IAAI,EAAE,QAAQ;yBACjB;wBACD,IAAI,EAAE;4BACF,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,MAAM;yBACtB;qBACJ;iBACJ;aACJ;YACD,KAAK,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,EAAC;SACnD;KACJ;IACD,MAAM,EAAE;QACJ,IAAI,EAAE,QAAQ;KACjB;IACD,QAAQ,EAAE;QACN,IAAI,EAAE,SAAS;KAClB;CACJ,CAAC;AAEW,QAAA,WAAW,GAAG;IACvB,cAAc,EAAE;QACZ,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,OAAO,CAAC;QACnB,UAAU,EAAE;YACR,GAAG,uBAAc;YACjB,GAAG,wBAAgB;SACtB;KACJ;CACJ,CAAC","sourcesContent":["import {ImageProps} from '../../components/Image/schema';\nimport {\n BlockBaseProps,\n ButtonBlock,\n MediaProps,\n VideoProps,\n mediaView,\n withTheme,\n} from '../../schema/validators/common';\nimport {filteredArray} from '../../schema/validators/utils';\n\nexport const HeaderVideoIframeProps = {\n type: 'object',\n additionalProperties: false,\n required: ['src'],\n properties: {\n src: {type: 'string'},\n autoplay: {type: 'boolean'},\n previewImg: {type: 'string'},\n height: {type: 'number'},\n },\n};\n\nexport const HeaderBackgroundProps = {\n type: 'object',\n additionalProperties: false,\n required: [],\n properties: {\n ...MediaProps,\n fullWidth: {type: 'boolean'},\n fullWidthMedia: {type: 'boolean'},\n },\n};\n\nexport const HeaderProperties = {\n title: {\n type: 'string',\n contentType: 'text',\n },\n overtitle: {\n type: 'string',\n contentType: 'text',\n },\n description: {\n type: 'string',\n contentType: 'yfm',\n inputType: 'textarea',\n },\n additionalInfo: {\n type: 'string',\n contentType: 'yfm',\n inputType: 'textarea',\n },\n width: {\n type: 'string',\n enum: ['s', 'm', 'l'],\n },\n buttons: filteredArray(ButtonBlock),\n offset: {\n type: 'string',\n enum: ['default', 'large'],\n },\n image: withTheme(ImageProps),\n video: withTheme(VideoProps),\n videoIframe: withTheme(HeaderVideoIframeProps),\n mediaView: {\n type: 'string',\n enum: mediaView,\n },\n backLink: {\n type: 'object',\n required: ['url', 'title'],\n properties: {\n url: {\n type: 'string',\n },\n title: {\n type: 'string',\n contentType: 'text',\n },\n },\n },\n imageSize: {\n type: 'string',\n enum: ['s', 'm'],\n },\n verticalOffset: {\n type: 'string',\n enum: ['0', 's', 'm', 'l', 'xl'],\n },\n background: withTheme(HeaderBackgroundProps),\n theme: {\n type: 'string',\n enum: ['default', 'dark'],\n },\n breadcrumbs: {\n type: 'object',\n additionalProperties: false,\n required: ['items'],\n properties: {\n items: {\n type: 'array',\n items: {\n type: 'object',\n additionalProperties: false,\n required: ['url', 'text'],\n properties: {\n url: {\n type: 'string',\n },\n text: {\n type: 'string',\n contentType: 'text',\n },\n },\n },\n },\n theme: {type: 'string', enum: ['light', 'dark']},\n },\n },\n status: {\n type: 'string',\n },\n centered: {\n type: 'boolean',\n },\n};\n\nexport const HeaderBlock = {\n 'header-block': {\n additionalProperties: false,\n required: ['title'],\n properties: {\n ...BlockBaseProps,\n ...HeaderProperties,\n },\n },\n};\n"]}
@@ -184,6 +184,35 @@ export declare const HeaderSliderBlock: {
184
184
  optionName: string;
185
185
  })[];
186
186
  };
187
+ videoIframe: {
188
+ oneOf: (({
189
+ type: string;
190
+ additionalProperties: boolean;
191
+ required: string[];
192
+ properties: {
193
+ src: {
194
+ type: string;
195
+ };
196
+ autoplay: {
197
+ type: string;
198
+ };
199
+ previewImg: {
200
+ type: string;
201
+ };
202
+ height: {
203
+ type: string;
204
+ };
205
+ };
206
+ } & {
207
+ optionName: string;
208
+ }) | {
209
+ type: string;
210
+ additionalProperties: boolean;
211
+ required: import("../../index.js").Theme[];
212
+ properties: {};
213
+ optionName: string;
214
+ })[];
215
+ };
187
216
  mediaView: {
188
217
  type: string;
189
218
  enum: string[];
@@ -11,7 +11,7 @@ const CustomBarControls_1 = tslib_1.__importDefault(require("../ReactPlayer/Cust
11
11
  const b = (0, utils_1.block)('default-video');
12
12
  exports.DefaultVideo = React.forwardRef((props, ref) => {
13
13
  const { video, qa, customBarControlsClassName } = props;
14
- const { controls, customControlsOptions, muted: initiallyMuted = true } = video;
14
+ const { controls, customControlsOptions, muted: initiallyMuted = true, onVideoEnd } = video;
15
15
  const { muteButtonShown, positioning, type: customControlsType, } = customControlsOptions || {};
16
16
  const [isPaused, setIsPaused] = React.useState(false);
17
17
  const [isMuted, setIsMuted] = React.useState(initiallyMuted);
@@ -28,6 +28,19 @@ exports.DefaultVideo = React.forwardRef((props, ref) => {
28
28
  }
29
29
  return videoRef.current;
30
30
  }, [videoRef]);
31
+ React.useEffect(() => {
32
+ const videoElement = videoRef.current;
33
+ if (!videoElement || !onVideoEnd) {
34
+ return undefined;
35
+ }
36
+ const handleVideoEnd = () => {
37
+ onVideoEnd?.();
38
+ };
39
+ videoElement.addEventListener('ended', handleVideoEnd);
40
+ return () => {
41
+ videoElement.removeEventListener('ended', handleVideoEnd);
42
+ };
43
+ }, [videoRef, onVideoEnd]);
31
44
  const onPlayToggle = React.useCallback(() => {
32
45
  setIsPaused((value) => {
33
46
  if (value) {
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultVideo.js","sourceRoot":"../../../../src","sources":["components/DefaultVideo/DefaultVideo.tsx"],"names":[],"mappings":";;;;;AAAA,qDAA+B;AAE/B,kDAAyF;AACzF,gDAAkC;AAClC,mDAA+D;AAC/D,oGAAiE;AAIjE,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,eAAe,CAAC,CAAC;AAWpB,QAAA,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AAE,WAAW,EACxB,IAAI,EAAE;oBACF,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;oBACzB,UAAU,EAAE,YAAY;iBAC3B,GACH,CACL,IACY,CACpB,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,oBAAY,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {CustomControlsType, MediaVideoControlsType, MediaVideoProps} from '../../models';\nimport {block} from '../../utils';\nimport {getVideoTypesWithPriority} from '../Media/Video/utils';\nimport CustomBarControls from '../ReactPlayer/CustomBarControls';\n\nimport './DefaultVideo.scss';\n\nconst b = block('default-video');\n\ntype DefaultVideoRefType = HTMLVideoElement | undefined;\n\ninterface DefaultVideoProps {\n video: MediaVideoProps;\n qa?: string;\n customBarControlsClassName?: string;\n className?: string;\n}\n\nexport const DefaultVideo = React.forwardRef<DefaultVideoRefType, DefaultVideoProps>(\n (props, ref) => {\n const {video, qa, customBarControlsClassName} = props;\n const {controls, customControlsOptions, muted: initiallyMuted = true} = video;\n const {\n muteButtonShown,\n positioning,\n type: customControlsType,\n } = customControlsOptions || {};\n const [isPaused, setIsPaused] = React.useState(false);\n const [isMuted, setIsMuted] = React.useState(initiallyMuted);\n const videoRef = React.useRef<HTMLVideoElement>(null);\n\n // one may not use this hook and work with `ref` variable only, but\n // in this case one should support both function type and object type,\n // according to ForwardedRef type.\n // Currently used way with extra ref and useImperativeHandle is more\n // convenient and allows us to work with object typed ref only,\n // avoiding typeof ref === 'function' statements\n React.useImperativeHandle(ref, () => {\n if (!videoRef?.current) {\n return undefined;\n }\n\n return videoRef.current;\n }, [videoRef]);\n const onPlayToggle = React.useCallback(() => {\n setIsPaused((value) => {\n if (value) {\n videoRef?.current?.play();\n } else {\n videoRef?.current?.pause();\n }\n\n return !value;\n });\n }, [videoRef]);\n const onMuteToggle = React.useCallback(() => {\n setIsMuted((value) => !value);\n }, []);\n\n const onClick = React.useCallback(() => {\n if (customControlsType === CustomControlsType.WithPlayPauseButton) {\n onPlayToggle();\n }\n }, [onPlayToggle, customControlsType]);\n\n return (\n <React.Fragment>\n <video\n disablePictureInPicture\n playsInline\n // @ts-ignore\n // eslint-disable-next-line react/no-unknown-property\n pip=\"false\"\n className={b()}\n ref={videoRef}\n preload=\"metadata\"\n muted={isMuted}\n aria-label={video.ariaLabel}\n onClick={onClick}\n >\n {getVideoTypesWithPriority(video.src).map(({src, type}, index) => (\n <source key={index} src={src} type={type} data-qa={qa} />\n ))}\n <track default kind=\"captions\" />\n </video>\n\n {controls === MediaVideoControlsType.Custom && (\n <CustomBarControls\n className={customBarControlsClassName}\n type={customControlsType}\n isPaused={isPaused}\n onPlayClick={onPlayToggle}\n muteButtonShown={muteButtonShown}\n shown\n positioning={positioning}\n mute={{\n isMuted: Boolean(isMuted),\n changeMute: onMuteToggle,\n }}\n />\n )}\n </React.Fragment>\n );\n },\n);\n\nDefaultVideo.displayName = 'DefaultVideo';\n"]}
1
+ {"version":3,"file":"DefaultVideo.js","sourceRoot":"../../../../src","sources":["components/DefaultVideo/DefaultVideo.tsx"],"names":[],"mappings":";;;;;AAAA,qDAA+B;AAE/B,kDAAyF;AACzF,gDAAkC;AAClC,mDAA+D;AAC/D,oGAAiE;AAIjE,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,eAAe,CAAC,CAAC;AAWpB,QAAA,YAAY,GAAG,KAAK,CAAC,UAAU,CACxC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACX,MAAM,EAAC,KAAK,EAAE,EAAE,EAAE,0BAA0B,EAAC,GAAG,KAAK,CAAC;IACtD,MAAM,EAAC,QAAQ,EAAE,qBAAqB,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,EAAE,UAAU,EAAC,GAAG,KAAK,CAAC;IAC1F,MAAM,EACF,eAAe,EACf,WAAW,EACX,IAAI,EAAE,kBAAkB,GAC3B,GAAG,qBAAqB,IAAI,EAAE,CAAC;IAChC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAA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AkB,EACxB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,YAAY,EACzB,eAAe,EAAE,eAAe,EAChC,KAAK,QACL,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE;oBACF,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;oBACzB,UAAU,EAAE,YAAY;iBAC3B,GACH,CACL,IACY,CACpB,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,oBAAY,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {CustomControlsType, MediaVideoControlsType, MediaVideoProps} from '../../models';\nimport {block} from '../../utils';\nimport {getVideoTypesWithPriority} from '../Media/Video/utils';\nimport CustomBarControls from '../ReactPlayer/CustomBarControls';\n\nimport './DefaultVideo.scss';\n\nconst b = block('default-video');\n\ntype DefaultVideoRefType = HTMLVideoElement | undefined;\n\ninterface DefaultVideoProps {\n video: MediaVideoProps;\n qa?: string;\n customBarControlsClassName?: string;\n className?: string;\n}\n\nexport const DefaultVideo = React.forwardRef<DefaultVideoRefType, DefaultVideoProps>(\n (props, ref) => {\n const {video, qa, customBarControlsClassName} = props;\n const {controls, customControlsOptions, muted: initiallyMuted = true, onVideoEnd} = video;\n const {\n muteButtonShown,\n positioning,\n type: customControlsType,\n } = customControlsOptions || {};\n const [isPaused, setIsPaused] = React.useState(false);\n const [isMuted, setIsMuted] = React.useState(initiallyMuted);\n const videoRef = React.useRef<HTMLVideoElement>(null);\n\n // one may not use this hook and work with `ref` variable only, but\n // in this case one should support both function type and object type,\n // according to ForwardedRef type.\n // Currently used way with extra ref and useImperativeHandle is more\n // convenient and allows us to work with object typed ref only,\n // avoiding typeof ref === 'function' statements\n React.useImperativeHandle(ref, () => {\n if (!videoRef?.current) {\n return undefined;\n }\n\n return videoRef.current;\n }, [videoRef]);\n\n React.useEffect(() => {\n const videoElement = videoRef.current;\n if (!videoElement || !onVideoEnd) {\n return undefined;\n }\n\n const handleVideoEnd = () => {\n onVideoEnd?.();\n };\n\n videoElement.addEventListener('ended', handleVideoEnd);\n return () => {\n videoElement.removeEventListener('ended', handleVideoEnd);\n };\n }, [videoRef, onVideoEnd]);\n\n const onPlayToggle = React.useCallback(() => {\n setIsPaused((value) => {\n if (value) {\n videoRef?.current?.play();\n } else {\n videoRef?.current?.pause();\n }\n\n return !value;\n });\n }, [videoRef]);\n const onMuteToggle = React.useCallback(() => {\n setIsMuted((value) => !value);\n }, []);\n\n const onClick = React.useCallback(() => {\n if (customControlsType === CustomControlsType.WithPlayPauseButton) {\n onPlayToggle();\n }\n }, [onPlayToggle, customControlsType]);\n\n return (\n <React.Fragment>\n <video\n disablePictureInPicture\n playsInline\n // @ts-ignore\n // eslint-disable-next-line react/no-unknown-property\n pip=\"false\"\n className={b()}\n ref={videoRef}\n preload=\"metadata\"\n muted={isMuted}\n aria-label={video.ariaLabel}\n onClick={onClick}\n >\n {getVideoTypesWithPriority(video.src).map(({src, type}, index) => (\n <source key={index} src={src} type={type} data-qa={qa} />\n ))}\n <track default kind=\"captions\" />\n </video>\n\n {controls === MediaVideoControlsType.Custom && (\n <CustomBarControls\n className={customBarControlsClassName}\n type={customControlsType}\n isPaused={isPaused}\n onPlayClick={onPlayToggle}\n muteButtonShown={muteButtonShown}\n shown\n positioning={positioning}\n mute={{\n isMuted: Boolean(isMuted),\n changeMute: onMuteToggle,\n }}\n />\n )}\n </React.Fragment>\n );\n },\n);\n\nDefaultVideo.displayName = 'DefaultVideo';\n"]}
@@ -111,6 +111,12 @@ export interface HeaderBlockBackground extends Partial<HeaderBackgroundProps>, P
111
111
  fullWidthMedia?: boolean;
112
112
  }
113
113
  export type ThemedHeaderBlockBackground = ThemeSupporting<HeaderBlockBackground>;
114
+ export interface HeaderBlockVideoIframe {
115
+ src: string;
116
+ autoplay?: boolean;
117
+ previewImg?: string;
118
+ height?: number;
119
+ }
114
120
  export interface HeaderBlockProps {
115
121
  title: string;
116
122
  overtitle?: string | JSX.Element;
@@ -127,6 +133,7 @@ export interface HeaderBlockProps {
127
133
  offset?: HeaderOffset;
128
134
  image?: ThemedImage;
129
135
  video?: ThemedMediaVideoProps;
136
+ videoIframe?: HeaderBlockVideoIframe;
130
137
  mediaView?: MediaView;
131
138
  centered?: boolean;
132
139
  background?: ThemedHeaderBlockBackground;
@@ -1 +1 @@
1
- {"version":3,"file":"blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/blocks.ts"],"names":[],"mappings":";;;AA4CA,IAAY,SAuBX;AAvBD,WAAY,SAAS;IACjB,wDAA2C,CAAA;IAC3C,8DAAiD,CAAA;IACjD,kBAAkB;IAClB,gDAAmC,CAAA;IACnC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,sDAAyC,CAAA;IACzC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,sDAAyC,CAAA;IACzC,yCAA4B,CAAA;IAC5B,uCAA0B,CAAA;IAC1B,kDAAqC,CAAA;IACrC,wDAA2C,CAAA;IAC3C,uCAA0B,CAAA;IAC1B,mCAAsB,CAAA;IACtB,yCAA4B,CAAA;IAC5B,qCAAwB,CAAA;AAC5B,CAAC,EAvBW,SAAS,yBAAT,SAAS,QAuBpB;AAEY,QAAA,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACtC,QAAA,gBAAgB,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAgCrF,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC7B,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;AACb,CAAC,EALW,qBAAqB,qCAArB,qBAAqB,QAKhC;AAED,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,sCAAwB,CAAA;IACxB,wCAA0B,CAAA;IAC1B,gDAAkC,CAAA;AACtC,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB;AAmUD,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC5B,iCAAS,CAAA;IACT,6CAAqB,CAAA;IACrB,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;IACrB,6CAAqB,CAAA;AACzB,CAAC,EANW,oBAAoB,oCAApB,oBAAoB,QAM/B;AAOD,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAED,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC1B,kDAA4B,CAAA;IAC5B,kDAA4B,CAAA;IAC5B,uCAAiB,CAAA;AACrB,CAAC,EAJW,kBAAkB,kCAAlB,kBAAkB,QAI7B","sourcesContent":["import * as React from 'react';\n\nimport {ButtonSize} from '@gravity-ui/uikit';\n\nimport {GridColumnSize, GridColumnSizesType, IndentValue} from '../../grid/types';\nimport {ThemeSupporting} from '../../utils';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {\n AnchorProps,\n Animatable,\n BackgroundImageProps,\n ButtonProps,\n CardBorder,\n ContentSize,\n ContentTextSize,\n ContentTheme,\n FileLinkProps,\n GravityIconProps,\n HeaderBreadCrumbsProps,\n HeaderImageSize,\n HeaderOffset,\n HeaderWidth,\n ImageDeviceProps,\n ImageProps,\n Justify,\n LegendTableMarkerType,\n LinkProps,\n MapProps,\n MediaDirection,\n MediaProps,\n MediaView,\n TextSize,\n TextTheme,\n ThemedImage,\n ThemedMediaProps,\n ThemedMediaVideoProps,\n TitleItemBaseProps,\n TitleItemProps,\n WithBorder,\n YandexFormProps,\n} from './common';\nimport {BannerCardProps, HubspotFormProps, SubBlock, SubBlockModels} from './sub-blocks';\n\nexport enum BlockType {\n PromoFeaturesBlock = 'promo-features-block',\n ExtendedFeaturesBlock = 'extended-features-block',\n /** @deprecated */\n SliderOldBlock = 'slider-old-block',\n SliderBlock = 'slider-block',\n QuestionsBlock = 'questions-block',\n FoldableListBlock = 'foldable-list-block',\n BannerBlock = 'banner-block',\n CompaniesBlock = 'companies-block',\n MediaBlock = 'media-block',\n InfoBlock = 'info-block',\n TableBlock = 'table-block',\n TabsBlock = 'tabs-block',\n HeaderSliderBlock = 'header-slider-block',\n HeaderBlock = 'header-block',\n IconsBlock = 'icons-block',\n CardLayoutBlock = 'card-layout-block',\n ContentLayoutBlock = 'content-layout-block',\n ShareBlock = 'share-block',\n MapBlock = 'map-block',\n FilterBlock = 'filter-block',\n FormBlock = 'form-block',\n}\n\nexport const BlockTypes = Object.values(BlockType);\nexport const HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];\n\nexport interface Childable {\n children?: SubBlock[];\n}\n\n//block props\nexport interface BlockBaseProps {\n anchor?: AnchorProps;\n visible?: GridColumnSize;\n /** @deprecated */\n resetPaddings?: boolean;\n indent?: {\n top?: IndentValue;\n bottom?: IndentValue;\n };\n qa?: string;\n}\n\nexport interface LoadableProps {\n source: string;\n /**\n * @deprecated Will be moved to params\n */\n serviceId?: number;\n params?: Record<string, string | number | boolean | object>;\n}\n\nexport interface LoadableChildren {\n loadable?: LoadableProps;\n}\n\nexport enum SliderBreakpointNames {\n Sm = 'sm',\n Md = 'md',\n Lg = 'lg',\n Xl = 'xl',\n}\n\nexport enum SliderType {\n MediaCard = 'media-card',\n HeaderCard = 'header-card',\n FullscreenCard = 'fullscreen-card',\n}\n\nexport type SliderBreakpointParams = Record<SliderBreakpointNames, number>;\nexport type SlidesToShow = Partial<SliderBreakpointParams> | number;\n\nexport interface SliderOldProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps | string;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface SliderProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps | string;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface HeaderSliderBlockProps extends Omit<SliderOldProps, 'title' | 'description'> {\n items: HeaderBlockProps[];\n}\n\ninterface HeaderBackgroundProps {\n /** @deprecated replaced by Media Props image */\n url?: string;\n /** @deprecated replaced by Media Props image */\n disableCompress?: boolean;\n}\n\nexport interface HeaderBlockBackground extends Partial<HeaderBackgroundProps>, Partial<MediaProps> {\n fullWidth?: boolean;\n fullWidthMedia?: boolean;\n}\n\nexport type ThemedHeaderBlockBackground = ThemeSupporting<HeaderBlockBackground>;\n\nexport interface HeaderBlockProps {\n title: string;\n overtitle?: string | JSX.Element;\n description?: string;\n additionalInfo?: string;\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme' | 'primary' | 'size' | 'extraProps'>[];\n width?: HeaderWidth;\n /** @deprecated imageSize now depends on width */\n imageSize?: HeaderImageSize;\n /**\n * @deprecated used only on the main page\n * TODO: delete after the possibility to remove padding-bottom in the block\n */\n offset?: HeaderOffset;\n image?: ThemedImage;\n video?: ThemedMediaVideoProps;\n mediaView?: MediaView;\n centered?: boolean;\n background?: ThemedHeaderBlockBackground;\n theme?: 'light' | 'dark';\n verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';\n breadcrumbs?: HeaderBreadCrumbsProps;\n status?: JSX.Element;\n renderTitle?: (title: string) => React.ReactNode;\n}\n\nexport interface ExtendedFeaturesItem\n extends Omit<ContentBlockProps, 'theme' | 'centered' | 'colSizes' | 'size' | 'title'> {\n title: string;\n label?: string;\n icon?: ThemedImage;\n /** @deprecated **/\n link?: LinkProps;\n}\n\nexport interface ExtendedFeaturesProps extends Animatable {\n items: ExtendedFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n colSizes?: GridColumnSizesType;\n}\n\nexport interface PromoFeaturesItem {\n title: string;\n text: string;\n theme?: 'accent' | 'accent-light' | 'primary';\n media?: ThemeSupporting<MediaProps>;\n}\n\nexport interface PromoFeaturesProps extends Animatable {\n items: PromoFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n theme?: 'grey' | 'default';\n}\n\nexport interface QuestionItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface QuestionsProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {\n items: QuestionItem[];\n}\n\nexport interface QuestionBlockItemProps extends QuestionItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface FoldableListItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface FoldableListProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {\n items: FoldableListItem[];\n}\n\nexport interface FoldableListBlockItemProps extends FoldableListItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface BannerBlockProps extends BannerCardProps, Animatable {}\n\nexport interface CompaniesBlockProps extends Animatable {\n title: string;\n description?: string;\n images: ThemeSupporting<ImageDeviceProps>;\n}\n\nexport interface MediaBaseBlockProps extends Animatable, MediaContentProps {\n direction?: MediaDirection;\n mobileDirection?: MediaDirection;\n largeMedia?: boolean;\n mediaOnly?: boolean;\n mediaOnlyColSizes?: GridColumnSizesType;\n}\n\nexport interface MediaContentProps\n extends Omit<ContentBlockProps, 'colSizes' | 'text' | 'title' | 'theme' | 'centered'> {\n title: string;\n description?: string;\n /** @deprecated Use array of buttons from ContentBlockProps instead**/\n button?: ButtonProps;\n}\n\nexport interface MediaBlockProps extends MediaBaseBlockProps, WithBorder {\n media: ThemeSupporting<MediaProps>;\n}\n\nexport interface MapBlockProps extends MediaBaseBlockProps, WithBorder {\n map: MapProps;\n}\n\nexport interface InfoBlockProps {\n theme?: TextTheme;\n backgroundColor?: ThemeSupporting<string>;\n /** @deprecated **/\n title?: string;\n /** @deprecated **/\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme'>[];\n /** @deprecated **/\n sectionsTitle?: string;\n /** @deprecated **/\n links?: Pick<LinkProps, 'text' | 'url'>[];\n leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;\n rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;\n}\n\nexport interface TableProps {\n content: string[][];\n legend?: string[];\n hideLegend?: boolean;\n justify?: Justify[];\n marker?: LegendTableMarkerType;\n /**\n * Only as accessible name, not displayed explicitly\n */\n caption?: string;\n}\n\nexport interface TableBlockProps {\n title: string;\n table: TableProps;\n}\n\nexport interface TabsBlockItem\n extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme'>,\n WithBorder {\n tabName: string;\n /**\n * @deprecated Use array links from ContentBlockProps instead\n */\n link?: LinkProps;\n image?: ThemedImage;\n caption?: string;\n media?: ThemedMediaProps;\n}\n\nexport interface TabsBlockProps extends Animatable {\n title?: TitleItemProps | string;\n description?: string;\n tabsColSizes?: GridColumnSizesType;\n centered?: boolean;\n direction?: MediaDirection;\n items: TabsBlockItem[];\n contentSize?: ContentSize;\n}\n\nexport interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n titleClassName?: string;\n description?: string;\n colSizes?: GridColumnSizesType;\n background?: ThemeSupporting<\n BackgroundImageProps & {\n border?: CardBorder;\n }\n >;\n}\n\nexport type FilterTag = {\n id: string;\n label: string;\n};\n\nexport type FilterItem = {\n tags: string[];\n card: SubBlockModels;\n};\n\nexport interface FilterBlockProps extends Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n description?: string;\n tags: FilterTag[];\n items: FilterItem[];\n tagButtonSize?: ButtonSize;\n allTag?: boolean | string;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n}\n\nexport interface IconsBlockItemProps extends AnalyticsEventsBase {\n url: string;\n text: string;\n src: ThemeSupporting<string>;\n}\n\nexport interface IconsBlockProps {\n title?: string;\n description?: string;\n size?: 's' | 'm' | 'l';\n items: IconsBlockItemProps[];\n colSizes?: GridColumnSizesType;\n}\n\ninterface ContentLayoutBlockParams {\n size?: ContentSize;\n background?: ThemeSupporting<BackgroundImageProps>;\n centered?: boolean;\n theme?: ContentTheme;\n textWidth?: ContentTextSize;\n}\n\nexport interface ContentLayoutBlockProps extends ContentLayoutBlockParams {\n textContent: ContentBlockProps;\n fileContent?: FileLinkProps[];\n}\n\nexport type SVGIcon = (props: React.SVGProps<SVGSVGElement>) => React.ReactNode;\n\nexport interface ContentItemProps {\n title?: string;\n text?: string;\n icon?: ThemeSupporting<ImageProps | SVGIcon>;\n gravityIcon?: ThemeSupporting<GravityIconProps>;\n}\n\nexport interface ContentListProps {\n list: ContentItemProps[];\n size: ContentSize;\n theme?: ContentTheme;\n}\n\nexport interface ContentBlockProps {\n title?: TitleItemBaseProps | string;\n titleId?: string;\n text?: string;\n textId?: string;\n additionalInfo?: string;\n links?: LinkProps[];\n buttons?: ButtonProps[];\n size?: ContentSize;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n theme?: ContentTheme;\n list?: ContentItemProps[];\n controlPosition?: 'default' | 'bottom';\n}\n\nexport enum PCShareSocialNetwork {\n Vk = 'vk',\n Telegram = 'telegram',\n Twitter = 'twitter',\n Facebook = 'facebook',\n LinkedIn = 'linkedin',\n}\n\nexport interface ShareBlockProps {\n items: PCShareSocialNetwork[];\n title?: string;\n}\n\nexport enum FormBlockDataTypes {\n YANDEX = 'yandex',\n HUBSPOT = 'hubspot',\n}\n\nexport enum FormBlockDirection {\n FormContent = 'form-content',\n ContentForm = 'content-form',\n Center = 'center',\n}\n\nexport interface FormBlockYandexData {\n yandex: ThemeSupporting<YandexFormProps>;\n}\n\nexport interface FormBlockHubspotData {\n hubspot: ThemeSupporting<HubspotFormProps>;\n}\n\nexport type FormBlockData = FormBlockYandexData | FormBlockHubspotData;\n\nexport interface FormBlockProps {\n formData: FormBlockData;\n title?: string;\n textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;\n direction?: FormBlockDirection;\n background?: ThemeSupporting<BackgroundImageProps>;\n}\n\n//block models\nexport type HeaderBlockModel = {\n type: BlockType.HeaderBlock;\n} & HeaderBlockProps;\n\nexport type SliderOldBlockModel = {\n type: BlockType.SliderOldBlock;\n} & SliderOldProps;\n\nexport type ExtendedFeaturesBlockModel = {\n type: BlockType.ExtendedFeaturesBlock;\n} & ExtendedFeaturesProps;\n\nexport type PromoFeaturesBlockModel = {\n type: BlockType.PromoFeaturesBlock;\n} & PromoFeaturesProps;\n\nexport type QuestionsBlockModel = {\n type: BlockType.QuestionsBlock;\n} & QuestionsProps;\n\nexport type FoldableListBlockModel = {\n type: BlockType.FoldableListBlock;\n} & FoldableListProps;\n\nexport type BannerBlockModel = {\n type: BlockType.BannerBlock;\n} & BannerBlockProps;\n\nexport type CompaniesBlockModel = {\n type: BlockType.CompaniesBlock;\n} & CompaniesBlockProps;\n\nexport type MediaBlockModel = {\n type: BlockType.MediaBlock;\n} & MediaBlockProps;\n\nexport type MapBlockModel = {\n type: BlockType.MapBlock;\n} & MapBlockProps;\n\nexport type InfoBlockModel = {\n type: BlockType.InfoBlock;\n} & InfoBlockProps;\n\nexport type TableBlockModel = {\n type: BlockType.TableBlock;\n} & TableBlockProps;\n\nexport type TabsBlockModel = {\n type: BlockType.TabsBlock;\n} & TabsBlockProps;\n\nexport type CardLayoutBlockModel = {\n type: BlockType.CardLayoutBlock;\n} & CardLayoutBlockProps;\n\nexport type FilterBlockModel = {\n type: BlockType.FilterBlock;\n} & FilterBlockProps;\n\nexport type IconsBlockModel = {\n type: BlockType.IconsBlock;\n} & IconsBlockProps;\n\nexport type HeaderSliderBlockModel = {\n type: BlockType.HeaderSliderBlock;\n} & HeaderSliderBlockProps;\n\nexport type ContentLayoutBlockModel = {\n type: BlockType.ContentLayoutBlock;\n} & ContentLayoutBlockProps;\n\nexport type ShareBLockModel = {\n type: BlockType.ShareBlock;\n} & ShareBlockProps;\n\nexport type FormBlockModel = {\n type: BlockType.FormBlock;\n} & FormBlockProps;\n\nexport type SliderBlockModel = {\n type: BlockType.SliderBlock;\n} & SliderProps;\n\ntype BlockModels =\n | SliderOldBlockModel\n | SliderBlockModel\n | ExtendedFeaturesBlockModel\n | PromoFeaturesBlockModel\n | QuestionsBlockModel\n | FoldableListBlockModel\n | BannerBlockModel\n | CompaniesBlockModel\n | MediaBlockModel\n | MapBlockModel\n | InfoBlockModel\n | TableBlockModel\n | TabsBlockModel\n | HeaderBlockModel\n | IconsBlockModel\n | HeaderSliderBlockModel\n | CardLayoutBlockModel\n | ContentLayoutBlockModel\n | ShareBLockModel\n | FilterBlockModel\n | FormBlockModel;\n\nexport type Block = BlockModels & BlockBaseProps;\n"]}
1
+ {"version":3,"file":"blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/blocks.ts"],"names":[],"mappings":";;;AA4CA,IAAY,SAuBX;AAvBD,WAAY,SAAS;IACjB,wDAA2C,CAAA;IAC3C,8DAAiD,CAAA;IACjD,kBAAkB;IAClB,gDAAmC,CAAA;IACnC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,sDAAyC,CAAA;IACzC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,sDAAyC,CAAA;IACzC,yCAA4B,CAAA;IAC5B,uCAA0B,CAAA;IAC1B,kDAAqC,CAAA;IACrC,wDAA2C,CAAA;IAC3C,uCAA0B,CAAA;IAC1B,mCAAsB,CAAA;IACtB,yCAA4B,CAAA;IAC5B,qCAAwB,CAAA;AAC5B,CAAC,EAvBW,SAAS,yBAAT,SAAS,QAuBpB;AAEY,QAAA,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACtC,QAAA,gBAAgB,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAgCrF,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC7B,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;AACb,CAAC,EALW,qBAAqB,qCAArB,qBAAqB,QAKhC;AAED,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,sCAAwB,CAAA;IACxB,wCAA0B,CAAA;IAC1B,gDAAkC,CAAA;AACtC,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB;AA2UD,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC5B,iCAAS,CAAA;IACT,6CAAqB,CAAA;IACrB,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;IACrB,6CAAqB,CAAA;AACzB,CAAC,EANW,oBAAoB,oCAApB,oBAAoB,QAM/B;AAOD,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAED,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC1B,kDAA4B,CAAA;IAC5B,kDAA4B,CAAA;IAC5B,uCAAiB,CAAA;AACrB,CAAC,EAJW,kBAAkB,kCAAlB,kBAAkB,QAI7B","sourcesContent":["import * as React from 'react';\n\nimport {ButtonSize} from '@gravity-ui/uikit';\n\nimport {GridColumnSize, GridColumnSizesType, IndentValue} from '../../grid/types';\nimport {ThemeSupporting} from '../../utils';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {\n AnchorProps,\n Animatable,\n BackgroundImageProps,\n ButtonProps,\n CardBorder,\n ContentSize,\n ContentTextSize,\n ContentTheme,\n FileLinkProps,\n GravityIconProps,\n HeaderBreadCrumbsProps,\n HeaderImageSize,\n HeaderOffset,\n HeaderWidth,\n ImageDeviceProps,\n ImageProps,\n Justify,\n LegendTableMarkerType,\n LinkProps,\n MapProps,\n MediaDirection,\n MediaProps,\n MediaView,\n TextSize,\n TextTheme,\n ThemedImage,\n ThemedMediaProps,\n ThemedMediaVideoProps,\n TitleItemBaseProps,\n TitleItemProps,\n WithBorder,\n YandexFormProps,\n} from './common';\nimport {BannerCardProps, HubspotFormProps, SubBlock, SubBlockModels} from './sub-blocks';\n\nexport enum BlockType {\n PromoFeaturesBlock = 'promo-features-block',\n ExtendedFeaturesBlock = 'extended-features-block',\n /** @deprecated */\n SliderOldBlock = 'slider-old-block',\n SliderBlock = 'slider-block',\n QuestionsBlock = 'questions-block',\n FoldableListBlock = 'foldable-list-block',\n BannerBlock = 'banner-block',\n CompaniesBlock = 'companies-block',\n MediaBlock = 'media-block',\n InfoBlock = 'info-block',\n TableBlock = 'table-block',\n TabsBlock = 'tabs-block',\n HeaderSliderBlock = 'header-slider-block',\n HeaderBlock = 'header-block',\n IconsBlock = 'icons-block',\n CardLayoutBlock = 'card-layout-block',\n ContentLayoutBlock = 'content-layout-block',\n ShareBlock = 'share-block',\n MapBlock = 'map-block',\n FilterBlock = 'filter-block',\n FormBlock = 'form-block',\n}\n\nexport const BlockTypes = Object.values(BlockType);\nexport const HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];\n\nexport interface Childable {\n children?: SubBlock[];\n}\n\n//block props\nexport interface BlockBaseProps {\n anchor?: AnchorProps;\n visible?: GridColumnSize;\n /** @deprecated */\n resetPaddings?: boolean;\n indent?: {\n top?: IndentValue;\n bottom?: IndentValue;\n };\n qa?: string;\n}\n\nexport interface LoadableProps {\n source: string;\n /**\n * @deprecated Will be moved to params\n */\n serviceId?: number;\n params?: Record<string, string | number | boolean | object>;\n}\n\nexport interface LoadableChildren {\n loadable?: LoadableProps;\n}\n\nexport enum SliderBreakpointNames {\n Sm = 'sm',\n Md = 'md',\n Lg = 'lg',\n Xl = 'xl',\n}\n\nexport enum SliderType {\n MediaCard = 'media-card',\n HeaderCard = 'header-card',\n FullscreenCard = 'fullscreen-card',\n}\n\nexport type SliderBreakpointParams = Record<SliderBreakpointNames, number>;\nexport type SlidesToShow = Partial<SliderBreakpointParams> | number;\n\nexport interface SliderOldProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps | string;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface SliderProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps | string;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface HeaderSliderBlockProps extends Omit<SliderOldProps, 'title' | 'description'> {\n items: HeaderBlockProps[];\n}\n\ninterface HeaderBackgroundProps {\n /** @deprecated replaced by Media Props image */\n url?: string;\n /** @deprecated replaced by Media Props image */\n disableCompress?: boolean;\n}\n\nexport interface HeaderBlockBackground extends Partial<HeaderBackgroundProps>, Partial<MediaProps> {\n fullWidth?: boolean;\n fullWidthMedia?: boolean;\n}\n\nexport type ThemedHeaderBlockBackground = ThemeSupporting<HeaderBlockBackground>;\n\nexport interface HeaderBlockVideoIframe {\n src: string;\n autoplay?: boolean;\n previewImg?: string;\n height?: number;\n}\n\nexport interface HeaderBlockProps {\n title: string;\n overtitle?: string | JSX.Element;\n description?: string;\n additionalInfo?: string;\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme' | 'primary' | 'size' | 'extraProps'>[];\n width?: HeaderWidth;\n /** @deprecated imageSize now depends on width */\n imageSize?: HeaderImageSize;\n /**\n * @deprecated used only on the main page\n * TODO: delete after the possibility to remove padding-bottom in the block\n */\n offset?: HeaderOffset;\n image?: ThemedImage;\n video?: ThemedMediaVideoProps;\n videoIframe?: HeaderBlockVideoIframe;\n mediaView?: MediaView;\n centered?: boolean;\n background?: ThemedHeaderBlockBackground;\n theme?: 'light' | 'dark';\n verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';\n breadcrumbs?: HeaderBreadCrumbsProps;\n status?: JSX.Element;\n renderTitle?: (title: string) => React.ReactNode;\n}\n\nexport interface ExtendedFeaturesItem\n extends Omit<ContentBlockProps, 'theme' | 'centered' | 'colSizes' | 'size' | 'title'> {\n title: string;\n label?: string;\n icon?: ThemedImage;\n /** @deprecated **/\n link?: LinkProps;\n}\n\nexport interface ExtendedFeaturesProps extends Animatable {\n items: ExtendedFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n colSizes?: GridColumnSizesType;\n}\n\nexport interface PromoFeaturesItem {\n title: string;\n text: string;\n theme?: 'accent' | 'accent-light' | 'primary';\n media?: ThemeSupporting<MediaProps>;\n}\n\nexport interface PromoFeaturesProps extends Animatable {\n items: PromoFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n theme?: 'grey' | 'default';\n}\n\nexport interface QuestionItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface QuestionsProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {\n items: QuestionItem[];\n}\n\nexport interface QuestionBlockItemProps extends QuestionItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface FoldableListItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface FoldableListProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {\n items: FoldableListItem[];\n}\n\nexport interface FoldableListBlockItemProps extends FoldableListItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface BannerBlockProps extends BannerCardProps, Animatable {}\n\nexport interface CompaniesBlockProps extends Animatable {\n title: string;\n description?: string;\n images: ThemeSupporting<ImageDeviceProps>;\n}\n\nexport interface MediaBaseBlockProps extends Animatable, MediaContentProps {\n direction?: MediaDirection;\n mobileDirection?: MediaDirection;\n largeMedia?: boolean;\n mediaOnly?: boolean;\n mediaOnlyColSizes?: GridColumnSizesType;\n}\n\nexport interface MediaContentProps\n extends Omit<ContentBlockProps, 'colSizes' | 'text' | 'title' | 'theme' | 'centered'> {\n title: string;\n description?: string;\n /** @deprecated Use array of buttons from ContentBlockProps instead**/\n button?: ButtonProps;\n}\n\nexport interface MediaBlockProps extends MediaBaseBlockProps, WithBorder {\n media: ThemeSupporting<MediaProps>;\n}\n\nexport interface MapBlockProps extends MediaBaseBlockProps, WithBorder {\n map: MapProps;\n}\n\nexport interface InfoBlockProps {\n theme?: TextTheme;\n backgroundColor?: ThemeSupporting<string>;\n /** @deprecated **/\n title?: string;\n /** @deprecated **/\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme'>[];\n /** @deprecated **/\n sectionsTitle?: string;\n /** @deprecated **/\n links?: Pick<LinkProps, 'text' | 'url'>[];\n leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;\n rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;\n}\n\nexport interface TableProps {\n content: string[][];\n legend?: string[];\n hideLegend?: boolean;\n justify?: Justify[];\n marker?: LegendTableMarkerType;\n /**\n * Only as accessible name, not displayed explicitly\n */\n caption?: string;\n}\n\nexport interface TableBlockProps {\n title: string;\n table: TableProps;\n}\n\nexport interface TabsBlockItem\n extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme'>,\n WithBorder {\n tabName: string;\n /**\n * @deprecated Use array links from ContentBlockProps instead\n */\n link?: LinkProps;\n image?: ThemedImage;\n caption?: string;\n media?: ThemedMediaProps;\n}\n\nexport interface TabsBlockProps extends Animatable {\n title?: TitleItemProps | string;\n description?: string;\n tabsColSizes?: GridColumnSizesType;\n centered?: boolean;\n direction?: MediaDirection;\n items: TabsBlockItem[];\n contentSize?: ContentSize;\n}\n\nexport interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n titleClassName?: string;\n description?: string;\n colSizes?: GridColumnSizesType;\n background?: ThemeSupporting<\n BackgroundImageProps & {\n border?: CardBorder;\n }\n >;\n}\n\nexport type FilterTag = {\n id: string;\n label: string;\n};\n\nexport type FilterItem = {\n tags: string[];\n card: SubBlockModels;\n};\n\nexport interface FilterBlockProps extends Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n description?: string;\n tags: FilterTag[];\n items: FilterItem[];\n tagButtonSize?: ButtonSize;\n allTag?: boolean | string;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n}\n\nexport interface IconsBlockItemProps extends AnalyticsEventsBase {\n url: string;\n text: string;\n src: ThemeSupporting<string>;\n}\n\nexport interface IconsBlockProps {\n title?: string;\n description?: string;\n size?: 's' | 'm' | 'l';\n items: IconsBlockItemProps[];\n colSizes?: GridColumnSizesType;\n}\n\ninterface ContentLayoutBlockParams {\n size?: ContentSize;\n background?: ThemeSupporting<BackgroundImageProps>;\n centered?: boolean;\n theme?: ContentTheme;\n textWidth?: ContentTextSize;\n}\n\nexport interface ContentLayoutBlockProps extends ContentLayoutBlockParams {\n textContent: ContentBlockProps;\n fileContent?: FileLinkProps[];\n}\n\nexport type SVGIcon = (props: React.SVGProps<SVGSVGElement>) => React.ReactNode;\n\nexport interface ContentItemProps {\n title?: string;\n text?: string;\n icon?: ThemeSupporting<ImageProps | SVGIcon>;\n gravityIcon?: ThemeSupporting<GravityIconProps>;\n}\n\nexport interface ContentListProps {\n list: ContentItemProps[];\n size: ContentSize;\n theme?: ContentTheme;\n}\n\nexport interface ContentBlockProps {\n title?: TitleItemBaseProps | string;\n titleId?: string;\n text?: string;\n textId?: string;\n additionalInfo?: string;\n links?: LinkProps[];\n buttons?: ButtonProps[];\n size?: ContentSize;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n theme?: ContentTheme;\n list?: ContentItemProps[];\n controlPosition?: 'default' | 'bottom';\n}\n\nexport enum PCShareSocialNetwork {\n Vk = 'vk',\n Telegram = 'telegram',\n Twitter = 'twitter',\n Facebook = 'facebook',\n LinkedIn = 'linkedin',\n}\n\nexport interface ShareBlockProps {\n items: PCShareSocialNetwork[];\n title?: string;\n}\n\nexport enum FormBlockDataTypes {\n YANDEX = 'yandex',\n HUBSPOT = 'hubspot',\n}\n\nexport enum FormBlockDirection {\n FormContent = 'form-content',\n ContentForm = 'content-form',\n Center = 'center',\n}\n\nexport interface FormBlockYandexData {\n yandex: ThemeSupporting<YandexFormProps>;\n}\n\nexport interface FormBlockHubspotData {\n hubspot: ThemeSupporting<HubspotFormProps>;\n}\n\nexport type FormBlockData = FormBlockYandexData | FormBlockHubspotData;\n\nexport interface FormBlockProps {\n formData: FormBlockData;\n title?: string;\n textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;\n direction?: FormBlockDirection;\n background?: ThemeSupporting<BackgroundImageProps>;\n}\n\n//block models\nexport type HeaderBlockModel = {\n type: BlockType.HeaderBlock;\n} & HeaderBlockProps;\n\nexport type SliderOldBlockModel = {\n type: BlockType.SliderOldBlock;\n} & SliderOldProps;\n\nexport type ExtendedFeaturesBlockModel = {\n type: BlockType.ExtendedFeaturesBlock;\n} & ExtendedFeaturesProps;\n\nexport type PromoFeaturesBlockModel = {\n type: BlockType.PromoFeaturesBlock;\n} & PromoFeaturesProps;\n\nexport type QuestionsBlockModel = {\n type: BlockType.QuestionsBlock;\n} & QuestionsProps;\n\nexport type FoldableListBlockModel = {\n type: BlockType.FoldableListBlock;\n} & FoldableListProps;\n\nexport type BannerBlockModel = {\n type: BlockType.BannerBlock;\n} & BannerBlockProps;\n\nexport type CompaniesBlockModel = {\n type: BlockType.CompaniesBlock;\n} & CompaniesBlockProps;\n\nexport type MediaBlockModel = {\n type: BlockType.MediaBlock;\n} & MediaBlockProps;\n\nexport type MapBlockModel = {\n type: BlockType.MapBlock;\n} & MapBlockProps;\n\nexport type InfoBlockModel = {\n type: BlockType.InfoBlock;\n} & InfoBlockProps;\n\nexport type TableBlockModel = {\n type: BlockType.TableBlock;\n} & TableBlockProps;\n\nexport type TabsBlockModel = {\n type: BlockType.TabsBlock;\n} & TabsBlockProps;\n\nexport type CardLayoutBlockModel = {\n type: BlockType.CardLayoutBlock;\n} & CardLayoutBlockProps;\n\nexport type FilterBlockModel = {\n type: BlockType.FilterBlock;\n} & FilterBlockProps;\n\nexport type IconsBlockModel = {\n type: BlockType.IconsBlock;\n} & IconsBlockProps;\n\nexport type HeaderSliderBlockModel = {\n type: BlockType.HeaderSliderBlock;\n} & HeaderSliderBlockProps;\n\nexport type ContentLayoutBlockModel = {\n type: BlockType.ContentLayoutBlock;\n} & ContentLayoutBlockProps;\n\nexport type ShareBLockModel = {\n type: BlockType.ShareBlock;\n} & ShareBlockProps;\n\nexport type FormBlockModel = {\n type: BlockType.FormBlock;\n} & FormBlockProps;\n\nexport type SliderBlockModel = {\n type: BlockType.SliderBlock;\n} & SliderProps;\n\ntype BlockModels =\n | SliderOldBlockModel\n | SliderBlockModel\n | ExtendedFeaturesBlockModel\n | PromoFeaturesBlockModel\n | QuestionsBlockModel\n | FoldableListBlockModel\n | BannerBlockModel\n | CompaniesBlockModel\n | MediaBlockModel\n | MapBlockModel\n | InfoBlockModel\n | TableBlockModel\n | TabsBlockModel\n | HeaderBlockModel\n | IconsBlockModel\n | HeaderSliderBlockModel\n | CardLayoutBlockModel\n | ContentLayoutBlockModel\n | ShareBLockModel\n | FilterBlockModel\n | FormBlockModel;\n\nexport type Block = BlockModels & BlockBaseProps;\n"]}
@@ -144,6 +144,7 @@ export interface MediaVideoProps extends AnalyticsEventsBase {
144
144
  customControlsOptions?: CustomControlsOptions;
145
145
  ariaLabel?: string;
146
146
  contain?: boolean;
147
+ onVideoEnd?: () => void;
147
148
  }
148
149
  export interface LinkProps extends AnalyticsEventsBase, Stylable, Tabbable {
149
150
  url: string;
@@ -167,7 +168,7 @@ export interface FileLinkProps extends ClassNameProps, Tabbable {
167
168
  extraProps?: React.HTMLProps<HTMLAnchorElement>;
168
169
  }
169
170
  export type ButtonTheme = ButtonView | 'github' | 'app-store' | 'google-play' | 'scale' | 'monochrome';
170
- export interface ButtonProps extends AnalyticsEventsBase, Pick<UikitButtonProps, 'size' | 'width' | 'extraProps'> {
171
+ export interface ButtonProps extends AnalyticsEventsBase {
171
172
  text: string;
172
173
  url: string;
173
174
  urlTitle?: string;
@@ -175,6 +176,9 @@ export interface ButtonProps extends AnalyticsEventsBase, Pick<UikitButtonProps,
175
176
  theme?: ButtonTheme;
176
177
  img?: ButtonImageProps | string;
177
178
  target?: string;
179
+ size?: UikitButtonProps['size'];
180
+ width?: UikitButtonProps['width'];
181
+ extraProps?: UikitButtonProps['extraProps'];
178
182
  }
179
183
  export type ButtonImagePosition = 'left' | 'right';
180
184
  export interface ButtonImageProps {