@gravity-ui/page-constructor 7.23.0 → 7.25.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 (51) hide show
  1. package/build/cjs/blocks/Questions/QuestionBlockItem/QuestionBlockItem.js +3 -4
  2. package/build/cjs/blocks/Questions/QuestionBlockItem/QuestionBlockItem.js.map +1 -1
  3. package/build/cjs/blocks/Questions/Questions.js +32 -7
  4. package/build/cjs/blocks/Questions/Questions.js.map +1 -1
  5. package/build/cjs/blocks/Table/Table.js +14 -2
  6. package/build/cjs/blocks/Table/Table.js.map +1 -1
  7. package/build/cjs/models/constructor-items/blocks.d.ts +1 -0
  8. package/build/cjs/models/constructor-items/blocks.js.map +1 -1
  9. package/build/cjs/models/constructor-items/sub-blocks.d.ts +3 -0
  10. package/build/cjs/models/constructor-items/sub-blocks.js.map +1 -1
  11. package/build/cjs/sub-blocks/BasicCard/BasicCard.js +3 -1
  12. package/build/cjs/sub-blocks/BasicCard/BasicCard.js.map +1 -1
  13. package/build/cjs/sub-blocks/BasicCard/schema.d.ts +3 -0
  14. package/build/cjs/sub-blocks/BasicCard/schema.js +3 -0
  15. package/build/cjs/sub-blocks/BasicCard/schema.js.map +1 -1
  16. package/build/cjs/text-transform/config.js +10 -0
  17. package/build/cjs/text-transform/config.js.map +1 -1
  18. package/build/esm/blocks/Questions/QuestionBlockItem/QuestionBlockItem.js +3 -4
  19. package/build/esm/blocks/Questions/QuestionBlockItem/QuestionBlockItem.js.map +1 -1
  20. package/build/esm/blocks/Questions/Questions.js +32 -7
  21. package/build/esm/blocks/Questions/Questions.js.map +1 -1
  22. package/build/esm/blocks/Table/Table.js +13 -2
  23. package/build/esm/blocks/Table/Table.js.map +1 -1
  24. package/build/esm/models/constructor-items/blocks.d.ts +1 -0
  25. package/build/esm/models/constructor-items/blocks.js.map +1 -1
  26. package/build/esm/models/constructor-items/sub-blocks.d.ts +3 -0
  27. package/build/esm/models/constructor-items/sub-blocks.js.map +1 -1
  28. package/build/esm/sub-blocks/BasicCard/BasicCard.js +3 -1
  29. package/build/esm/sub-blocks/BasicCard/BasicCard.js.map +1 -1
  30. package/build/esm/sub-blocks/BasicCard/schema.d.ts +3 -0
  31. package/build/esm/sub-blocks/BasicCard/schema.js +3 -0
  32. package/build/esm/sub-blocks/BasicCard/schema.js.map +1 -1
  33. package/build/esm/text-transform/config.js +10 -0
  34. package/build/esm/text-transform/config.js.map +1 -1
  35. package/package.json +1 -1
  36. package/server/models/constructor-items/blocks.d.ts +1 -0
  37. package/server/models/constructor-items/sub-blocks.d.ts +3 -0
  38. package/server/text-transform/config.js +10 -0
  39. package/widget/index.js +1 -1
  40. package/build/cjs/blocks/Questions/models.d.ts +0 -11
  41. package/build/cjs/blocks/Questions/models.js +0 -15
  42. package/build/cjs/blocks/Questions/models.js.map +0 -1
  43. package/build/cjs/blocks/Table/models.d.ts +0 -5
  44. package/build/cjs/blocks/Table/models.js +0 -9
  45. package/build/cjs/blocks/Table/models.js.map +0 -1
  46. package/build/esm/blocks/Questions/models.d.ts +0 -11
  47. package/build/esm/blocks/Questions/models.js +0 -12
  48. package/build/esm/blocks/Questions/models.js.map +0 -1
  49. package/build/esm/blocks/Table/models.d.ts +0 -5
  50. package/build/esm/blocks/Table/models.js +0 -6
  51. package/build/esm/blocks/Table/models.js.map +0 -1
@@ -3,17 +3,16 @@ import { useActionHandlers } from '@gravity-ui/uikit';
3
3
  import { Foldable, ToggleArrow, YFMWrapper } from "../../../components/index.js";
4
4
  import Link from "../../../components/Link/Link.js";
5
5
  import { block } from "../../../utils/index.js";
6
- import { FaqMicrodataValues } from "../models.js";
7
6
  import './QuestionBlockItem.css';
8
7
  const b = block('QuestionsBlockItem');
9
8
  export const QuestionBlockItem = ({ title: itemTitle, text: itemText, link, listStyle = 'dash', isOpened, onClick, }) => {
10
9
  const { onKeyDown } = useActionHandlers(onClick);
11
- return (_jsxs("div", { className: b(), itemScope: true, itemProp: FaqMicrodataValues.QuestionProp, itemType: FaqMicrodataValues.QuestionType, role: 'listitem', children: [_jsx("button", { className: b('button'), onClick: onClick, "aria-expanded": isOpened, onKeyDown: onKeyDown, children: _jsx(YFMWrapper, { tagName: "h3", className: b('title-container'), contentClassName: b('title'), itemProp: FaqMicrodataValues.QuestionNameProp, content: itemTitle, modifiers: {
10
+ return (_jsxs("div", { className: b(), role: 'listitem', children: [_jsx("button", { className: b('button'), onClick: onClick, "aria-expanded": isOpened, onKeyDown: onKeyDown, children: _jsx(YFMWrapper, { tagName: "h3", className: b('title-container'), contentClassName: b('title'), content: itemTitle, modifiers: {
12
11
  constructor: true,
13
- }, onClick: onClick, tabIndex: 0, children: _jsx(ToggleArrow, { open: isOpened, size: 16, type: 'vertical', iconType: "navigation", className: b('arrow') }) }) }), _jsx(Foldable, { isOpened: isOpened, children: _jsxs("div", { className: b('text'), itemScope: true, itemProp: FaqMicrodataValues.AnswerProp, itemType: FaqMicrodataValues.AnswerType, "aria-hidden": !isOpened, children: [_jsx(YFMWrapper, { content: itemText, modifiers: {
12
+ }, onClick: onClick, tabIndex: 0, children: _jsx(ToggleArrow, { open: isOpened, size: 16, type: 'vertical', iconType: "navigation", className: b('arrow') }) }) }), _jsx(Foldable, { isOpened: isOpened, children: _jsxs("div", { className: b('text'), "aria-hidden": !isOpened, children: [_jsx(YFMWrapper, { content: itemText, modifiers: {
14
13
  constructor: true,
15
14
  constructorListStyle: true,
16
15
  constructorListStyleDash: listStyle === 'dash',
17
- }, itemProp: FaqMicrodataValues.QuestionTextProp }), link && _jsx(Link, { ...link, tabIndex: isOpened ? 0 : -1, className: b('link') })] }) })] }));
16
+ } }), link && _jsx(Link, { ...link, tabIndex: isOpened ? 0 : -1, className: b('link') })] }) })] }));
18
17
  };
19
18
  //# sourceMappingURL=QuestionBlockItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"QuestionBlockItem.js","sourceRoot":"../../../../../src","sources":["blocks/Questions/QuestionBlockItem/QuestionBlockItem.tsx"],"names":[],"mappings":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AY,EACrB,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,GACvB,GACO,GACR,EACT,KAAC,QAAQ,IAAC,QAAQ,EAAE,QAAQ,YACxB,eACI,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EACpB,SAAS,QACT,QAAQ,EAAE,kBAAkB,CAAC,UAAU,EACvC,QAAQ,EAAE,kBAAkB,CAAC,UAAU,iBAC1B,CAAC,QAAQ,aAEtB,KAAC,UAAU,IACP,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAE;gCACP,WAAW,EAAE,IAAI;gCACjB,oBAAoB,EAAE,IAAI;gCAC1B,wBAAwB,EAAE,SAAS,KAAK,MAAM;6BACjD,EACD,QAAQ,EAAE,kBAAkB,CAAC,gBAAgB,GAC/C,EACD,IAAI,IAAI,KAAC,IAAI,OAAK,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,GAAI,IAC5E,GACC,IACT,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import {useActionHandlers} from '@gravity-ui/uikit';\n\nimport {Foldable, ToggleArrow, YFMWrapper} from '../../../components';\nimport Link from '../../../components/Link/Link';\nimport {QuestionBlockItemProps} from '../../../models';\nimport {block} from '../../../utils';\nimport {FaqMicrodataValues} from '../models';\n\nimport './QuestionBlockItem.scss';\n\nconst b = block('QuestionsBlockItem');\n\nexport const QuestionBlockItem = ({\n title: itemTitle,\n text: itemText,\n link,\n listStyle = 'dash',\n isOpened,\n onClick,\n}: QuestionBlockItemProps) => {\n const {onKeyDown} = useActionHandlers(onClick);\n\n return (\n <div\n className={b()}\n itemScope\n itemProp={FaqMicrodataValues.QuestionProp}\n itemType={FaqMicrodataValues.QuestionType}\n role={'listitem'}\n >\n <button\n className={b('button')}\n onClick={onClick}\n aria-expanded={isOpened}\n onKeyDown={onKeyDown}\n >\n <YFMWrapper\n tagName=\"h3\"\n className={b('title-container')}\n contentClassName={b('title')}\n itemProp={FaqMicrodataValues.QuestionNameProp}\n content={itemTitle}\n modifiers={{\n constructor: true,\n }}\n onClick={onClick}\n tabIndex={0}\n >\n <ToggleArrow\n open={isOpened}\n size={16}\n type={'vertical'}\n iconType=\"navigation\"\n className={b('arrow')}\n />\n </YFMWrapper>\n </button>\n <Foldable isOpened={isOpened}>\n <div\n className={b('text')}\n itemScope\n itemProp={FaqMicrodataValues.AnswerProp}\n itemType={FaqMicrodataValues.AnswerType}\n aria-hidden={!isOpened}\n >\n <YFMWrapper\n content={itemText}\n modifiers={{\n constructor: true,\n constructorListStyle: true,\n constructorListStyleDash: listStyle === 'dash',\n }}\n itemProp={FaqMicrodataValues.QuestionTextProp}\n />\n {link && <Link {...link} tabIndex={isOpened ? 0 : -1} className={b('link')} />}\n </div>\n </Foldable>\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"QuestionBlockItem.js","sourceRoot":"../../../../../src","sources":["blocks/Questions/QuestionBlockItem/QuestionBlockItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAC,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAC,qCAA4B;AACtE,OAAO,IAAI,yCAAsC;AAEjD,OAAO,EAAC,KAAK,EAAC,gCAAuB;AAErC,OAAO,yBAAyB,CAAC;AAEjC,MAAM,CAAC,GAAG,KAAK,CAAC,oBAAoB,CAAC,CAAC;AAEtC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAC9B,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,QAAQ,EACd,IAAI,EACJ,SAAS,GAAG,MAAM,EAClB,QAAQ,EACR,OAAO,GACc,EAAE,EAAE;IACzB,MAAM,EAAC,SAAS,EAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAE/C,OAAO,CACH,eAAK,SAAS,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,UAAU,aACjC,iBACI,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,EACtB,OAAO,EAAE,OAAO,mBACD,QAAQ,EACvB,SAAS,EAAE,SAAS,YAEpB,KAAC,UAAU,IACP,OAAO,EAAC,IAAI,EACZ,SAAS,EAAE,CAAC,CAAC,iBAAiB,CAAC,EAC/B,gBAAgB,EAAE,CAAC,CAAC,OAAO,CAAC,EAC5B,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE;wBACP,WAAW,EAAE,IAAI;qBACpB,EACD,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,CAAC,YAEX,KAAC,WAAW,IACR,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,EAAE,EACR,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAC,YAAY,EACrB,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,GACvB,GACO,GACR,EACT,KAAC,QAAQ,IAAC,QAAQ,EAAE,QAAQ,YACxB,eAAK,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,iBAAe,CAAC,QAAQ,aAC7C,KAAC,UAAU,IACP,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAE;gCACP,WAAW,EAAE,IAAI;gCACjB,oBAAoB,EAAE,IAAI;gCAC1B,wBAAwB,EAAE,SAAS,KAAK,MAAM;6BACjD,GACH,EACD,IAAI,IAAI,KAAC,IAAI,OAAK,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,GAAI,IAC5E,GACC,IACT,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import {useActionHandlers} from '@gravity-ui/uikit';\n\nimport {Foldable, ToggleArrow, YFMWrapper} from '../../../components';\nimport Link from '../../../components/Link/Link';\nimport {QuestionBlockItemProps} from '../../../models';\nimport {block} from '../../../utils';\n\nimport './QuestionBlockItem.scss';\n\nconst b = block('QuestionsBlockItem');\n\nexport const QuestionBlockItem = ({\n title: itemTitle,\n text: itemText,\n link,\n listStyle = 'dash',\n isOpened,\n onClick,\n}: QuestionBlockItemProps) => {\n const {onKeyDown} = useActionHandlers(onClick);\n\n return (\n <div className={b()} role={'listitem'}>\n <button\n className={b('button')}\n onClick={onClick}\n aria-expanded={isOpened}\n onKeyDown={onKeyDown}\n >\n <YFMWrapper\n tagName=\"h3\"\n className={b('title-container')}\n contentClassName={b('title')}\n content={itemTitle}\n modifiers={{\n constructor: true,\n }}\n onClick={onClick}\n tabIndex={0}\n >\n <ToggleArrow\n open={isOpened}\n size={16}\n type={'vertical'}\n iconType=\"navigation\"\n className={b('arrow')}\n />\n </YFMWrapper>\n </button>\n <Foldable isOpened={isOpened}>\n <div className={b('text')} aria-hidden={!isOpened}>\n <YFMWrapper\n content={itemText}\n modifiers={{\n constructor: true,\n constructorListStyle: true,\n constructorListStyleDash: listStyle === 'dash',\n }}\n />\n {link && <Link {...link} tabIndex={isOpened ? 0 : -1} className={b('link')} />}\n </div>\n </Foldable>\n </div>\n );\n};\n"]}
@@ -3,14 +3,14 @@ import * as React from 'react';
3
3
  import { Col, Row } from "../../grid/index.js";
4
4
  import { Content } from "../../sub-blocks/index.js";
5
5
  import { block } from "../../utils/index.js";
6
+ import { sanitizeMicrodata } from "../../utils/microdata.js";
6
7
  import { QuestionBlockItem } from "./QuestionBlockItem/QuestionBlockItem.js";
7
- import { FaqMicrodataValues } from "./models.js";
8
8
  import './Questions.css';
9
9
  const b = block('QuestionsBlock');
10
10
  const QuestionsBlock = (props) => {
11
11
  const { title, text, additionalInfo, links, buttons, items, list } = props;
12
12
  const [opened, setOpened] = React.useState([0]);
13
- const toggleItem = (index) => {
13
+ const toggleItem = (index, itemOnClick) => {
14
14
  let newState;
15
15
  if (opened.includes(index)) {
16
16
  newState = opened.filter((itemIndex) => itemIndex !== index);
@@ -18,13 +18,38 @@ const QuestionsBlock = (props) => {
18
18
  else {
19
19
  newState = [...opened, index];
20
20
  }
21
+ if (itemOnClick) {
22
+ itemOnClick(index, !opened.includes(index));
23
+ }
21
24
  setOpened(newState);
22
25
  };
23
- return (_jsx("div", { className: b(), itemScope: true, itemType: FaqMicrodataValues.PageType, itemID: FaqMicrodataValues.PageId, children: _jsxs(Row, { children: [_jsx(Col, { sizes: { all: 12, md: 4 }, children: _jsx("div", { className: b('title'), children: _jsx(Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, list: list, buttons: buttons, colSizes: { all: 12, md: 12 } }) }) }), _jsx(Col, { sizes: { all: 12, md: 8 }, role: 'list', children: items.map(({ title: itemTitle, text: itemText, link, listStyle = 'dash' }, index) => {
24
- const isOpened = opened.includes(index);
25
- const onClick = () => toggleItem(index);
26
- return (_jsx(QuestionBlockItem, { title: itemTitle, text: itemText, link: link, listStyle: listStyle, isOpened: isOpened, onClick: onClick }, itemTitle));
27
- }) })] }) }));
26
+ const faqMicrodataScript = React.useMemo(() => {
27
+ try {
28
+ const json = JSON.stringify({
29
+ '@context': 'https://schema.org',
30
+ '@type': 'FAQPage',
31
+ mainEntity: items.map((item) => ({
32
+ '@type': 'Question',
33
+ name: sanitizeMicrodata(item.title),
34
+ acceptedAnswer: {
35
+ '@type': 'Answer',
36
+ text: sanitizeMicrodata(item.text),
37
+ },
38
+ })),
39
+ });
40
+ return _jsx("script", { type: "application/ld+json", dangerouslySetInnerHTML: { __html: json } });
41
+ }
42
+ catch (error) {
43
+ /*eslint-disable no-console */
44
+ console.warn('Problem with FAQ microdata', error);
45
+ return null;
46
+ }
47
+ }, [items]);
48
+ return (_jsxs("div", { className: b(), children: [faqMicrodataScript, _jsxs(Row, { children: [_jsx(Col, { sizes: { all: 12, md: 4 }, children: _jsx("div", { className: b('title'), children: _jsx(Content, { title: title, text: text, additionalInfo: additionalInfo, links: links, list: list, buttons: buttons, colSizes: { all: 12, md: 12 } }) }) }), _jsx(Col, { sizes: { all: 12, md: 8 }, role: 'list', children: items.map(({ title: itemTitle, text: itemText, link, listStyle = 'dash', onClick: itemOnClick, }, index) => {
49
+ const isOpened = opened.includes(index);
50
+ const onClick = () => toggleItem(index, itemOnClick);
51
+ return (_jsx(QuestionBlockItem, { title: itemTitle, text: itemText, link: link, listStyle: listStyle, isOpened: isOpened, onClick: onClick }, itemTitle));
52
+ }) })] })] }));
28
53
  };
29
54
  export default QuestionsBlock;
30
55
  //# sourceMappingURL=Questions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Questions.js","sourceRoot":"../../../../src","sources":["blocks/Questions/Questions.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,GAAG,EAAE,GAAG,EAAC,4BAAmB;AAEpC,OAAO,EAAC,OAAO,EAAC,kCAAyB;AACzC,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAElC,OAAO,EAAC,iBAAiB,EAAC,iDAA8C;AACxE,OAAO,EAAC,kBAAkB,EAAC,oBAAiB;AAE5C,OAAO,iBAAiB,CAAC;AAEzB,MAAM,CAAC,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAAC;AAElC,MAAM,cAAc,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC7C,MAAM,EAAC,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAC,GAAG,KAAK,CAAC;IACzE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IAE1D,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,EAAE;QACjC,IAAI,QAAQ,CAAC;QAEb,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,SAAiB,EAAE,EAAE,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC;QACzE,CAAC;aAAM,CAAC;YACJ,QAAQ,G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AE,OAAO,IANX,SAAS,CAOhB,CACL,CAAC;oBACN,CAAC,CACJ,GACC,IACJ,GACJ,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {Col, Row} from '../../grid';\nimport {QuestionsProps} from '../../models';\nimport {Content} from '../../sub-blocks';\nimport {block} from '../../utils';\n\nimport {QuestionBlockItem} from './QuestionBlockItem/QuestionBlockItem';\nimport {FaqMicrodataValues} from './models';\n\nimport './Questions.scss';\n\nconst b = block('QuestionsBlock');\n\nconst QuestionsBlock = (props: QuestionsProps) => {\n const {title, text, additionalInfo, links, buttons, items, list} = props;\n const [opened, setOpened] = React.useState<number[]>([0]);\n\n const toggleItem = (index: number) => {\n let newState;\n\n if (opened.includes(index)) {\n newState = opened.filter((itemIndex: number) => itemIndex !== index);\n } else {\n newState = [...opened, index];\n }\n\n setOpened(newState);\n };\n\n return (\n <div\n className={b()}\n itemScope\n itemType={FaqMicrodataValues.PageType}\n itemID={FaqMicrodataValues.PageId}\n >\n <Row>\n <Col sizes={{all: 12, md: 4}}>\n <div className={b('title')}>\n <Content\n title={title}\n text={text}\n additionalInfo={additionalInfo}\n links={links}\n list={list}\n buttons={buttons}\n colSizes={{all: 12, md: 12}}\n />\n </div>\n </Col>\n <Col sizes={{all: 12, md: 8}} role={'list'}>\n {items.map(\n ({title: itemTitle, text: itemText, link, listStyle = 'dash'}, index) => {\n const isOpened = opened.includes(index);\n const onClick = () => toggleItem(index);\n\n return (\n <QuestionBlockItem\n key={itemTitle}\n title={itemTitle}\n text={itemText}\n link={link}\n listStyle={listStyle}\n isOpened={isOpened}\n onClick={onClick}\n />\n );\n },\n )}\n </Col>\n </Row>\n </div>\n );\n};\n\nexport default QuestionsBlock;\n"]}
1
+ {"version":3,"file":"Questions.js","sourceRoot":"../../../../src","sources":["blocks/Questions/Questions.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OA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AAM,YACrC,KAAK,CAAC,GAAG,CACN,CACI,EACI,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,QAAQ,EACd,IAAI,EACJ,SAAS,GAAG,MAAM,EAClB,OAAO,EAAE,WAAW,GACvB,EACD,KAAK,EACP,EAAE;4BACA,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;4BACxC,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;4BAErD,OAAO,CACH,KAAC,iBAAiB,IAEd,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,IANX,SAAS,CAOhB,CACL,CAAC;wBACN,CAAC,CACJ,GACC,IACJ,IACJ,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {Col, Row} from '../../grid';\nimport {QuestionsProps} from '../../models';\nimport {Content} from '../../sub-blocks';\nimport {block} from '../../utils';\nimport {sanitizeMicrodata} from '../../utils/microdata';\n\nimport {QuestionBlockItem} from './QuestionBlockItem/QuestionBlockItem';\n\nimport './Questions.scss';\n\nconst b = block('QuestionsBlock');\n\nconst QuestionsBlock = (props: QuestionsProps) => {\n const {title, text, additionalInfo, links, buttons, items, list} = props;\n const [opened, setOpened] = React.useState<number[]>([0]);\n\n const toggleItem = (\n index: number,\n itemOnClick?: QuestionsProps['items'][number]['onClick'],\n ) => {\n let newState;\n\n if (opened.includes(index)) {\n newState = opened.filter((itemIndex: number) => itemIndex !== index);\n } else {\n newState = [...opened, index];\n }\n\n if (itemOnClick) {\n itemOnClick(index, !opened.includes(index));\n }\n\n setOpened(newState);\n };\n\n const faqMicrodataScript = React.useMemo(() => {\n try {\n const json = JSON.stringify({\n '@context': 'https://schema.org',\n '@type': 'FAQPage',\n mainEntity: items.map((item) => ({\n '@type': 'Question',\n name: sanitizeMicrodata(item.title),\n acceptedAnswer: {\n '@type': 'Answer',\n text: sanitizeMicrodata(item.text),\n },\n })),\n });\n return <script type=\"application/ld+json\" dangerouslySetInnerHTML={{__html: json}} />;\n } catch (error) {\n /*eslint-disable no-console */\n console.warn('Problem with FAQ microdata', error);\n return null;\n }\n }, [items]);\n\n return (\n <div className={b()}>\n {faqMicrodataScript}\n <Row>\n <Col sizes={{all: 12, md: 4}}>\n <div className={b('title')}>\n <Content\n title={title}\n text={text}\n additionalInfo={additionalInfo}\n links={links}\n list={list}\n buttons={buttons}\n colSizes={{all: 12, md: 12}}\n />\n </div>\n </Col>\n <Col sizes={{all: 12, md: 8}} role={'list'}>\n {items.map(\n (\n {\n title: itemTitle,\n text: itemText,\n link,\n listStyle = 'dash',\n onClick: itemOnClick,\n },\n index,\n ) => {\n const isOpened = opened.includes(index);\n const onClick = () => toggleItem(index, itemOnClick);\n\n return (\n <QuestionBlockItem\n key={itemTitle}\n title={itemTitle}\n text={itemText}\n link={link}\n listStyle={listStyle}\n isOpened={isOpened}\n onClick={onClick}\n />\n );\n },\n )}\n </Col>\n </Row>\n </div>\n );\n};\n\nexport default QuestionsBlock;\n"]}
@@ -1,13 +1,24 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from 'react';
2
3
  import { Table, YFMWrapper } from "../../components/index.js";
3
4
  import { Col, Grid, GridColumnSize, Row } from "../../grid/index.js";
4
5
  import { block } from "../../utils/index.js";
5
- import { TableMicrodataValues } from "./models.js";
6
6
  import './Table.css';
7
7
  const b = block('table-block');
8
8
  export const TableBlock = (props) => {
9
9
  const { title, table } = props;
10
- return (_jsxs("div", { className: b(), itemScope: true, itemType: TableMicrodataValues.TableType, children: [_jsx("meta", { itemProp: TableMicrodataValues.accessModeProp, content: "textual" }), _jsx(Grid, { className: b('content'), children: _jsxs(Row, { className: b('row'), children: [_jsx(Col, { sizes: { [GridColumnSize.Md]: 4, [GridColumnSize.All]: 12 }, children: _jsx(YFMWrapper, { tagName: "h2", contentClassName: b('title'), itemProp: TableMicrodataValues.AboutProp, content: title, modifiers: {
10
+ const tableMicrodataScript = React.useMemo(() => {
11
+ const json = JSON.stringify({
12
+ '@context': 'https://schema.org',
13
+ '@type': 'Table',
14
+ name: title,
15
+ description: table.caption,
16
+ accessMode: 'textual',
17
+ accessibilityFeature: 'tableOfContents',
18
+ });
19
+ return _jsx("script", { type: "application/ld+json", dangerouslySetInnerHTML: { __html: json } });
20
+ }, [title, table.caption]);
21
+ return (_jsxs("div", { className: b(), children: [tableMicrodataScript, _jsx(Grid, { className: b('content'), children: _jsxs(Row, { className: b('row'), children: [_jsx(Col, { sizes: { [GridColumnSize.Md]: 4, [GridColumnSize.All]: 12 }, children: _jsx(YFMWrapper, { tagName: "h2", contentClassName: b('title'), content: title, modifiers: {
11
22
  constructor: true,
12
23
  } }) }), _jsx(Col, { sizes: { [GridColumnSize.Md]: 8, [GridColumnSize.All]: 12 }, children: _jsx(Table, { className: b('table'), ...table }) })] }) })] }));
13
24
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","sourceRoot":"../../../../src","sources":["blocks/Table/Table.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,KAAK,EAAE,UAAU,EAAC,kCAAyB;AACnD,OAAO,EAAC,GAAG,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,EAAC,4BAAmB;AAE1D,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAElC,OAAO,EAAC,oBAAoB,EAAC,oBAAiB;AAE9C,OAAO,aAAa,CAAC;AAErB,MAAM,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;AAE/B,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAsB,EAAE,EAAE;IACjD,MAAM,EAAC,KAAK,EAAE,KAAK,EAAC,GAAG,KAAK,CAAC;IAE7B,OAAO,CACH,eAAK,SAAS,EAAE,CAAC,EAAE,EAAE,SAAS,QAAC,QAAQ,EAAE,oBAAoB,CAAC,SAAS,aACnE,eAAM,QAAQ,EAAE,oBAAoB,CAAC,cAAc,EAAE,OAAO,EAAC,SAAS,GAAG,EACzE,KAAC,IAAI,IAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,YACzB,MAAC,GAAG,IAAC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,aACpB,KAAC,GAAG,IAAC,KAAK,EAAE,EAAC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,EAAE,EAAC,YAC1D,KAAC,UAAU,IACP,OAAO,EAAC,IAAI,EACZ,gBAAgB,EAAE,CAAC,CAAC,OAAO,CAAC,EAC5B,QAAQ,EAAE,oBAAoB,CAAC,SAAS,EACxC,OAAO,EAAE,KAAK,EACd,SAAS,EAAE;oCACP,WAAW,EAAE,IAAI;iCACpB,GACH,GACA,EACN,KAAC,GAAG,IAAC,KAAK,EAAE,EAAC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,EAAE,EAAC,YAC1D,KAAC,KAAK,IAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,KAAM,KAAK,GAAI,GACzC,IACJ,GACH,IACL,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import {Table, YFMWrapper} from '../../components';\nimport {Col, Grid, GridColumnSize, Row} from '../../grid';\nimport {TableBlockProps} from '../../models';\nimport {block} from '../../utils';\n\nimport {TableMicrodataValues} from './models';\n\nimport './Table.scss';\n\nconst b = block('table-block');\n\nexport const TableBlock = (props: TableBlockProps) => {\n const {title, table} = props;\n\n return (\n <div className={b()} itemScope itemType={TableMicrodataValues.TableType}>\n <meta itemProp={TableMicrodataValues.accessModeProp} content=\"textual\" />\n <Grid className={b('content')}>\n <Row className={b('row')}>\n <Col sizes={{[GridColumnSize.Md]: 4, [GridColumnSize.All]: 12}}>\n <YFMWrapper\n tagName=\"h2\"\n contentClassName={b('title')}\n itemProp={TableMicrodataValues.AboutProp}\n content={title}\n modifiers={{\n constructor: true,\n }}\n />\n </Col>\n <Col sizes={{[GridColumnSize.Md]: 8, [GridColumnSize.All]: 12}}>\n <Table className={b('table')} {...table} />\n </Col>\n </Row>\n </Grid>\n </div>\n );\n};\n\nexport default TableBlock;\n"]}
1
+ {"version":3,"file":"Table.js","sourceRoot":"../../../../src","sources":["blocks/Table/Table.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,KAAK,EAAE,UAAU,EAAC,kCAAyB;AACnD,OAAO,EAAC,GAAG,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,EAAC,4BAAmB;AAE1D,OAAO,EAAC,KAAK,EAAC,6BAAoB;AAElC,OAAO,aAAa,CAAC;AAErB,MAAM,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC;AAE/B,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAsB,EAAE,EAAE;IACjD,MAAM,EAAC,KAAK,EAAE,KAAK,EAAC,GAAG,KAAK,CAAC;IAE7B,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;YACxB,UAAU,EAAE,oBAAoB;YAChC,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,KAAK;YACX,WAAW,EAAE,KAAK,CAAC,OAAO;YAC1B,UAAU,EAAE,SAAS;YACrB,oBAAoB,EAAE,iBAAiB;SAC1C,CAAC,CAAC;QACH,OAAO,iBAAQ,IAAI,EAAC,qBAAqB,EAAC,uBAAuB,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,GAAI,CAAC;IAC1F,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAE3B,OAAO,CACH,eAAK,SAAS,EAAE,CAAC,EAAE,aACd,oBAAoB,EACrB,KAAC,IAAI,IAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,YACzB,MAAC,GAAG,IAAC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,aACpB,KAAC,GAAG,IAAC,KAAK,EAAE,EAAC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,EAAE,EAAC,YAC1D,KAAC,UAAU,IACP,OAAO,EAAC,IAAI,EACZ,gBAAgB,EAAE,CAAC,CAAC,OAAO,CAAC,EAC5B,OAAO,EAAE,KAAK,EACd,SAAS,EAAE;oCACP,WAAW,EAAE,IAAI;iCACpB,GACH,GACA,EACN,KAAC,GAAG,IAAC,KAAK,EAAE,EAAC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,EAAE,EAAC,YAC1D,KAAC,KAAK,IAAC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,KAAM,KAAK,GAAI,GACzC,IACJ,GACH,IACL,CACT,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {Table, YFMWrapper} from '../../components';\nimport {Col, Grid, GridColumnSize, Row} from '../../grid';\nimport {TableBlockProps} from '../../models';\nimport {block} from '../../utils';\n\nimport './Table.scss';\n\nconst b = block('table-block');\n\nexport const TableBlock = (props: TableBlockProps) => {\n const {title, table} = props;\n\n const tableMicrodataScript = React.useMemo(() => {\n const json = JSON.stringify({\n '@context': 'https://schema.org',\n '@type': 'Table',\n name: title,\n description: table.caption,\n accessMode: 'textual',\n accessibilityFeature: 'tableOfContents',\n });\n return <script type=\"application/ld+json\" dangerouslySetInnerHTML={{__html: json}} />;\n }, [title, table.caption]);\n\n return (\n <div className={b()}>\n {tableMicrodataScript}\n <Grid className={b('content')}>\n <Row className={b('row')}>\n <Col sizes={{[GridColumnSize.Md]: 4, [GridColumnSize.All]: 12}}>\n <YFMWrapper\n tagName=\"h2\"\n contentClassName={b('title')}\n content={title}\n modifiers={{\n constructor: true,\n }}\n />\n </Col>\n <Col sizes={{[GridColumnSize.Md]: 8, [GridColumnSize.All]: 12}}>\n <Table className={b('table')} {...table} />\n </Col>\n </Row>\n </Grid>\n </div>\n );\n};\n\nexport default TableBlock;\n"]}
@@ -174,6 +174,7 @@ export interface QuestionItem {
174
174
  text: string;
175
175
  listStyle?: 'dash' | 'disk';
176
176
  link?: LinkProps;
177
+ onClick?: (index: number, newOpenState: boolean) => void;
177
178
  }
178
179
  export interface QuestionsProps extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'labels'> {
179
180
  items: QuestionItem[];
@@ -1 +1 @@
1
- {"version":3,"file":"blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/blocks.ts"],"names":[],"mappings":"AA6CA,MAAM,CAAN,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,KAAT,SAAS,QAuBpB;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAgCrF,MAAM,CAAN,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC7B,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;AACb,CAAC,EALW,qBAAqB,KAArB,qBAAqB,QAKhC;AAED,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,sCAAwB,CAAA;IACxB,wCAA0B,CAAA;IAC1B,gDAAkC,CAAA;AACtC,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AA2VD,MAAM,CAAN,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC5B,iCAAS,CAAA;IACT,6CAAqB,CAAA;IACrB,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;IACrB,6CAAqB,CAAA;AACzB,CAAC,EANW,oBAAoB,KAApB,oBAAoB,QAM/B;AAOD,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC1B,kDAA4B,CAAA;IAC5B,kDAA4B,CAAA;IAC5B,uCAAiB,CAAA;AACrB,CAAC,EAJW,kBAAkB,KAAlB,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 {DeviceSupporting} from '../../utils/breakpoint';\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<\n ContentBlockProps,\n 'theme' | 'centered' | 'colSizes' | 'size' | 'title' | 'labels'\n > {\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' | 'labels'> {\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' | 'labels'> {\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' | 'theme' | 'centered' | 'labels'> {\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: Omit<MapProps, 'forceAspectRatio' | 'areaMargin' | 'copyrightPosition'>;\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' | 'labels'>;\n rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size' | 'labels'>;\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' | 'labels'>,\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 centered?: boolean;\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 {\n tags: FilterTag[];\n items: FilterItem[];\n title?: TitleItemProps | string;\n description?: string;\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: Omit<ContentBlockProps, 'labels'>;\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 ContentLabelProps {\n text: string;\n icon?: ThemeSupporting<ImageProps | SVGIcon>;\n gravityIcon?: ThemeSupporting<GravityIconProps>;\n}\n\nexport interface ContentLabelsProps {\n labels: ContentLabelProps[];\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 labels?: ContentLabelProps[];\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 FormBlockBackgroundProps extends Omit<BackgroundImageProps, 'style'> {\n style?: DeviceSupporting<React.CSSProperties>;\n}\n\nexport interface FormBlockProps {\n formData: FormBlockData;\n title?: string;\n textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;\n direction?: FormBlockDirection;\n background?: ThemeSupporting<FormBlockBackgroundProps>;\n customFormNode?: React.ReactNode;\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":"AA6CA,MAAM,CAAN,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,KAAT,SAAS,QAuBpB;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAgCrF,MAAM,CAAN,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC7B,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;AACb,CAAC,EALW,qBAAqB,KAArB,qBAAqB,QAKhC;AAED,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,sCAAwB,CAAA;IACxB,wCAA0B,CAAA;IAC1B,gDAAkC,CAAA;AACtC,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AA4VD,MAAM,CAAN,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC5B,iCAAS,CAAA;IACT,6CAAqB,CAAA;IACrB,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;IACrB,6CAAqB,CAAA;AACzB,CAAC,EANW,oBAAoB,KAApB,oBAAoB,QAM/B;AAOD,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC1B,kDAA4B,CAAA;IAC5B,kDAA4B,CAAA;IAC5B,uCAAiB,CAAA;AACrB,CAAC,EAJW,kBAAkB,KAAlB,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 {DeviceSupporting} from '../../utils/breakpoint';\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<\n ContentBlockProps,\n 'theme' | 'centered' | 'colSizes' | 'size' | 'title' | 'labels'\n > {\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 onClick?: (index: number, newOpenState: boolean) => void;\n}\n\nexport interface QuestionsProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'labels'> {\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' | 'labels'> {\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' | 'theme' | 'centered' | 'labels'> {\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: Omit<MapProps, 'forceAspectRatio' | 'areaMargin' | 'copyrightPosition'>;\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' | 'labels'>;\n rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size' | 'labels'>;\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' | 'labels'>,\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 centered?: boolean;\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 {\n tags: FilterTag[];\n items: FilterItem[];\n title?: TitleItemProps | string;\n description?: string;\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: Omit<ContentBlockProps, 'labels'>;\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 ContentLabelProps {\n text: string;\n icon?: ThemeSupporting<ImageProps | SVGIcon>;\n gravityIcon?: ThemeSupporting<GravityIconProps>;\n}\n\nexport interface ContentLabelsProps {\n labels: ContentLabelProps[];\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 labels?: ContentLabelProps[];\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 FormBlockBackgroundProps extends Omit<BackgroundImageProps, 'style'> {\n style?: DeviceSupporting<React.CSSProperties>;\n}\n\nexport interface FormBlockProps {\n formData: FormBlockData;\n title?: string;\n textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;\n direction?: FormBlockDirection;\n background?: ThemeSupporting<FormBlockBackgroundProps>;\n customFormNode?: React.ReactNode;\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"]}
@@ -117,6 +117,9 @@ export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, Card
117
117
  gravityIcon?: ThemeSupporting<GravityIconProps>;
118
118
  target?: string;
119
119
  iconPosition?: IconPosition;
120
+ /**
121
+ * @deprecated This property will be removed in future versions
122
+ */
120
123
  hoverBackgroundColor?: string;
121
124
  }
122
125
  export interface BannerCardProps {
@@ -1 +1 @@
1
- {"version":3,"file":"sub-blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/sub-blocks.ts"],"names":[],"mappings":"AA8BA,MAAM,CAAN,IAAY,YAoBX;AApBD,WAAY,YAAY;IACpB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf;;OAEG;IACH,gDAAgC,CAAA;IAChC,wCAAwB,CAAA;IACxB,0CAA0B,CAAA;IAC1B,0CAA0B,CAAA;IAC1B,kDAAkC,CAAA;IAClC,wCAAwB,CAAA;IACxB,mCAAmB,CAAA;IACnB,4CAA4B,CAAA;IAC5B;;OAEG;IACH,6BAAa,CAAA;IACb,wCAAwB,CAAA;IACxB,wCAAwB,CAAA;AAC5B,CAAC,EApBW,YAAY,KAAZ,YAAY,QAoBvB;AAED,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,2BAAW,CAAA;IACX,6BAAa,CAAA;AACjB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAkBD,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import {ClassNameProps, GravityIconProps, QuoteType} from '../../models';\nimport {ThemeSupporting} from '../../utils';\nimport {\n HubspotEventData,\n HubspotEventHandlers,\n HubspotFormDefaultValues,\n} from '../../utils/hubspot';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {ContentBlockProps} from './blocks';\nimport {\n AuthorItem,\n ButtonProps,\n CardBaseProps,\n CardLayoutProps,\n ContentTheme,\n DividerSize,\n ImageCardMargins,\n ImageObjectProps,\n ImageProps,\n LayoutItemContentMargin,\n LinkProps,\n MediaProps,\n MediaView,\n PriceDetailedProps,\n TextTheme,\n Themable,\n ThemedImage,\n} from './common';\n\nexport enum SubBlockType {\n Divider = 'divider',\n Quote = 'quote',\n /**\n * @deprecated Will be removed\n */\n PriceDetailed = 'price-detailed',\n MediaCard = 'media-card',\n BannerCard = 'banner-card',\n LayoutItem = 'layout-item',\n BackgroundCard = 'background-card',\n BasicCard = 'basic-card',\n Content = 'content',\n HubspotForm = 'hubspot-form',\n /**\n * @deprecated Will be removed, use BasicCard instead\n */\n Card = 'card',\n PriceCard = 'price-card',\n ImageCard = 'image-card',\n}\n\nexport enum IconPosition {\n Top = 'top',\n Left = 'left',\n}\n\nexport interface PositionedIcon {\n value: ImageProps;\n position?: IconPosition;\n}\n\nexport interface PositionedGravityIcon {\n value: GravityIconProps;\n position?: IconPosition;\n}\n\nexport interface IconWrapperProps {\n icon?: PositionedIcon;\n gravityIcon?: PositionedGravityIcon;\n size?: 's' | 'm' | 'l';\n}\n\nexport enum ImageCardDirection {\n Direct = 'direct',\n Reverse = 'reverse',\n}\n\nexport const SubBlockTypes = Object.values(SubBlockType);\n\nexport interface DividerProps {\n size?: DividerSize;\n border?: boolean;\n}\n\nexport interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsBase {\n className?: string;\n theme?: ContentTheme;\n isMobile?: boolean;\n region?: string;\n portalId: string;\n formId: string;\n formInstanceId?: string;\n formClassName?: string;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeLoad?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onLoad?: (arg: HubspotEventData) => void;\n hubspotEvents?: string[];\n createDOMElement?: boolean;\n defaultValues?: HubspotFormDefaultValues;\n}\n\n//cards\nexport interface QuoteProps extends Themable, CardBaseProps {\n text?: string;\n // for backward compatibility, yfmText will become property 'text' in major\n yfmText?: string;\n image: ThemedImage;\n logo: ThemeSupporting<ImageProps>;\n color?: string;\n /**\n * @deprecated use property button instead\n */\n url?: string;\n /**\n * @deprecated use property button instead\n */\n urlTitle?: string;\n author?: AuthorItem;\n /**\n * @deprecated use property button instead\n */\n buttonText?: string;\n theme?: TextTheme;\n quoteType?: QuoteType;\n button?: ButtonProps;\n}\n\nexport interface BackgroundCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, 'centered' | 'controlPosition' | 'labels'> {\n url?: string;\n urlTitle?: string;\n background?: ThemeSupporting<ImageObjectProps>;\n paddingBottom?: 's' | 'm' | 'l' | 'xl';\n backgroundColor?: string;\n}\n\nexport interface BasicCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'theme' | 'controlPosition' | 'labels'> {\n url: string;\n urlTitle?: string;\n icon?: ThemeSupporting<ImageProps>;\n gravityIcon?: ThemeSupporting<GravityIconProps>;\n target?: string;\n iconPosition?: IconPosition;\n hoverBackgroundColor?: string;\n}\n\nexport interface BannerCardProps {\n title: string;\n subtitle?: string;\n className?: string;\n image?: ThemeSupporting<string>;\n disableCompress?: boolean;\n color?: ThemeSupporting<string>;\n theme?: TextTheme;\n button?: Pick<ButtonProps, 'text' | 'url' | 'target' | 'theme'>;\n mediaView?: MediaView;\n}\n\nexport interface MediaCardProps extends MediaProps, AnalyticsEventsBase, CardBaseProps {}\n\nexport interface PriceCardProps extends CardBaseProps, Pick<ContentBlockProps, 'theme' | 'labels'> {\n title: string;\n price: string;\n pricePeriod?: string;\n priceDetails?: string;\n description?: string;\n buttons?: ButtonProps[];\n links?: LinkProps[];\n backgroundColor?: string;\n list?: string[];\n}\n\nexport interface LayoutItemProps extends ClassNameProps, CardLayoutProps, AnalyticsEventsBase {\n content: Omit<ContentBlockProps, 'colSizes' | 'centered' | 'labels'>;\n contentMargin?: LayoutItemContentMargin;\n media?: ThemeSupporting<MediaProps>;\n metaInfo?: string[];\n border?: boolean;\n fullscreen?: boolean;\n icon?: ThemeSupporting<PositionedIcon>;\n}\n\nexport interface ImageCardProps\n extends CardBaseProps,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'controlPosition' | 'labels'> {\n image: ThemeSupporting<ImageProps>;\n enableImageBorderRadius?: boolean;\n margins?: ImageCardMargins;\n direction?: ImageCardDirection;\n backgroundColor?: string;\n url?: string;\n urlTitle?: string;\n target?: string;\n}\n\n// sub-block models\nexport type DividerModel = {\n type: SubBlockType.Divider;\n} & DividerProps;\n\nexport type QuoteModel = {\n type: SubBlockType.Quote;\n} & QuoteProps;\n\nexport type LayoutItemModel = {\n type: SubBlockType.LayoutItem;\n} & LayoutItemProps;\n\nexport type BackgroundCardModel = {\n type: SubBlockType.BackgroundCard;\n} & BackgroundCardProps;\n\n/** @deprecated */\nexport type PriceDetailedModel = {\n type: SubBlockType.PriceDetailed;\n} & PriceDetailedProps;\n\nexport type MediaCardModel = {\n type: SubBlockType.MediaCard;\n} & MediaCardProps;\n\nexport type HubspotFormModel = {\n type: SubBlockType.HubspotForm;\n} & HubspotFormProps;\n\nexport type BannerCardModel = {\n type: SubBlockType.BannerCard;\n} & BannerCardProps;\n\nexport type BasicCardModel = {\n type: SubBlockType.BasicCard;\n} & BasicCardProps;\n\nexport type PriceCardModel = {\n type: SubBlockType.PriceCard;\n} & PriceCardProps;\n\nexport type ImageCardModel = {\n type: SubBlockType.ImageCard;\n} & ImageCardProps;\n\nexport type SubBlockModels =\n | DividerModel\n | QuoteModel\n | PriceDetailedModel\n | MediaCardModel\n | BackgroundCardModel\n | HubspotFormModel\n | BannerCardModel\n | BasicCardModel\n | PriceCardModel\n | LayoutItemModel\n | ImageCardModel;\n\nexport type SubBlock = SubBlockModels;\n"]}
1
+ {"version":3,"file":"sub-blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/sub-blocks.ts"],"names":[],"mappings":"AA8BA,MAAM,CAAN,IAAY,YAoBX;AApBD,WAAY,YAAY;IACpB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf;;OAEG;IACH,gDAAgC,CAAA;IAChC,wCAAwB,CAAA;IACxB,0CAA0B,CAAA;IAC1B,0CAA0B,CAAA;IAC1B,kDAAkC,CAAA;IAClC,wCAAwB,CAAA;IACxB,mCAAmB,CAAA;IACnB,4CAA4B,CAAA;IAC5B;;OAEG;IACH,6BAAa,CAAA;IACb,wCAAwB,CAAA;IACxB,wCAAwB,CAAA;AAC5B,CAAC,EApBW,YAAY,KAAZ,YAAY,QAoBvB;AAED,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,2BAAW,CAAA;IACX,6BAAa,CAAA;AACjB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAkBD,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import {ClassNameProps, GravityIconProps, QuoteType} from '../../models';\nimport {ThemeSupporting} from '../../utils';\nimport {\n HubspotEventData,\n HubspotEventHandlers,\n HubspotFormDefaultValues,\n} from '../../utils/hubspot';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {ContentBlockProps} from './blocks';\nimport {\n AuthorItem,\n ButtonProps,\n CardBaseProps,\n CardLayoutProps,\n ContentTheme,\n DividerSize,\n ImageCardMargins,\n ImageObjectProps,\n ImageProps,\n LayoutItemContentMargin,\n LinkProps,\n MediaProps,\n MediaView,\n PriceDetailedProps,\n TextTheme,\n Themable,\n ThemedImage,\n} from './common';\n\nexport enum SubBlockType {\n Divider = 'divider',\n Quote = 'quote',\n /**\n * @deprecated Will be removed\n */\n PriceDetailed = 'price-detailed',\n MediaCard = 'media-card',\n BannerCard = 'banner-card',\n LayoutItem = 'layout-item',\n BackgroundCard = 'background-card',\n BasicCard = 'basic-card',\n Content = 'content',\n HubspotForm = 'hubspot-form',\n /**\n * @deprecated Will be removed, use BasicCard instead\n */\n Card = 'card',\n PriceCard = 'price-card',\n ImageCard = 'image-card',\n}\n\nexport enum IconPosition {\n Top = 'top',\n Left = 'left',\n}\n\nexport interface PositionedIcon {\n value: ImageProps;\n position?: IconPosition;\n}\n\nexport interface PositionedGravityIcon {\n value: GravityIconProps;\n position?: IconPosition;\n}\n\nexport interface IconWrapperProps {\n icon?: PositionedIcon;\n gravityIcon?: PositionedGravityIcon;\n size?: 's' | 'm' | 'l';\n}\n\nexport enum ImageCardDirection {\n Direct = 'direct',\n Reverse = 'reverse',\n}\n\nexport const SubBlockTypes = Object.values(SubBlockType);\n\nexport interface DividerProps {\n size?: DividerSize;\n border?: boolean;\n}\n\nexport interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsBase {\n className?: string;\n theme?: ContentTheme;\n isMobile?: boolean;\n region?: string;\n portalId: string;\n formId: string;\n formInstanceId?: string;\n formClassName?: string;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeLoad?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onLoad?: (arg: HubspotEventData) => void;\n hubspotEvents?: string[];\n createDOMElement?: boolean;\n defaultValues?: HubspotFormDefaultValues;\n}\n\n//cards\nexport interface QuoteProps extends Themable, CardBaseProps {\n text?: string;\n // for backward compatibility, yfmText will become property 'text' in major\n yfmText?: string;\n image: ThemedImage;\n logo: ThemeSupporting<ImageProps>;\n color?: string;\n /**\n * @deprecated use property button instead\n */\n url?: string;\n /**\n * @deprecated use property button instead\n */\n urlTitle?: string;\n author?: AuthorItem;\n /**\n * @deprecated use property button instead\n */\n buttonText?: string;\n theme?: TextTheme;\n quoteType?: QuoteType;\n button?: ButtonProps;\n}\n\nexport interface BackgroundCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, 'centered' | 'controlPosition' | 'labels'> {\n url?: string;\n urlTitle?: string;\n background?: ThemeSupporting<ImageObjectProps>;\n paddingBottom?: 's' | 'm' | 'l' | 'xl';\n backgroundColor?: string;\n}\n\nexport interface BasicCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'theme' | 'controlPosition' | 'labels'> {\n url: string;\n urlTitle?: string;\n icon?: ThemeSupporting<ImageProps>;\n gravityIcon?: ThemeSupporting<GravityIconProps>;\n target?: string;\n iconPosition?: IconPosition;\n /**\n * @deprecated This property will be removed in future versions\n */\n hoverBackgroundColor?: string;\n}\n\nexport interface BannerCardProps {\n title: string;\n subtitle?: string;\n className?: string;\n image?: ThemeSupporting<string>;\n disableCompress?: boolean;\n color?: ThemeSupporting<string>;\n theme?: TextTheme;\n button?: Pick<ButtonProps, 'text' | 'url' | 'target' | 'theme'>;\n mediaView?: MediaView;\n}\n\nexport interface MediaCardProps extends MediaProps, AnalyticsEventsBase, CardBaseProps {}\n\nexport interface PriceCardProps extends CardBaseProps, Pick<ContentBlockProps, 'theme' | 'labels'> {\n title: string;\n price: string;\n pricePeriod?: string;\n priceDetails?: string;\n description?: string;\n buttons?: ButtonProps[];\n links?: LinkProps[];\n backgroundColor?: string;\n list?: string[];\n}\n\nexport interface LayoutItemProps extends ClassNameProps, CardLayoutProps, AnalyticsEventsBase {\n content: Omit<ContentBlockProps, 'colSizes' | 'centered' | 'labels'>;\n contentMargin?: LayoutItemContentMargin;\n media?: ThemeSupporting<MediaProps>;\n metaInfo?: string[];\n border?: boolean;\n fullscreen?: boolean;\n icon?: ThemeSupporting<PositionedIcon>;\n}\n\nexport interface ImageCardProps\n extends CardBaseProps,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'controlPosition' | 'labels'> {\n image: ThemeSupporting<ImageProps>;\n enableImageBorderRadius?: boolean;\n margins?: ImageCardMargins;\n direction?: ImageCardDirection;\n backgroundColor?: string;\n url?: string;\n urlTitle?: string;\n target?: string;\n}\n\n// sub-block models\nexport type DividerModel = {\n type: SubBlockType.Divider;\n} & DividerProps;\n\nexport type QuoteModel = {\n type: SubBlockType.Quote;\n} & QuoteProps;\n\nexport type LayoutItemModel = {\n type: SubBlockType.LayoutItem;\n} & LayoutItemProps;\n\nexport type BackgroundCardModel = {\n type: SubBlockType.BackgroundCard;\n} & BackgroundCardProps;\n\n/** @deprecated */\nexport type PriceDetailedModel = {\n type: SubBlockType.PriceDetailed;\n} & PriceDetailedProps;\n\nexport type MediaCardModel = {\n type: SubBlockType.MediaCard;\n} & MediaCardProps;\n\nexport type HubspotFormModel = {\n type: SubBlockType.HubspotForm;\n} & HubspotFormProps;\n\nexport type BannerCardModel = {\n type: SubBlockType.BannerCard;\n} & BannerCardProps;\n\nexport type BasicCardModel = {\n type: SubBlockType.BasicCard;\n} & BasicCardProps;\n\nexport type PriceCardModel = {\n type: SubBlockType.PriceCard;\n} & PriceCardProps;\n\nexport type ImageCardModel = {\n type: SubBlockType.ImageCard;\n} & ImageCardProps;\n\nexport type SubBlockModels =\n | DividerModel\n | QuoteModel\n | PriceDetailedModel\n | MediaCardModel\n | BackgroundCardModel\n | HubspotFormModel\n | BannerCardModel\n | BasicCardModel\n | PriceCardModel\n | LayoutItemModel\n | ImageCardModel;\n\nexport type SubBlock = SubBlockModels;\n"]}
@@ -8,7 +8,9 @@ import Content from "../Content/Content.js";
8
8
  import './BasicCard.css';
9
9
  const b = block('basic-card');
10
10
  const BasicCard = (props) => {
11
- const { title, text, icon, additionalInfo, links, list, buttons, iconPosition = IconPosition.Top, controlPosition = 'content', size = 's', gravityIcon, hoverBackgroundColor, ...cardParams } = props;
11
+ const { title, text, icon, additionalInfo, links, list, buttons, iconPosition = IconPosition.Top, controlPosition = 'content', size = 's', gravityIcon,
12
+ /** @deprecated This property will be removed in future versions */
13
+ hoverBackgroundColor, ...cardParams } = props;
12
14
  const titleId = useUniqId();
13
15
  const descriptionId = useUniqId();
14
16
  const areControlsInFooter = controlPosition === 'footer';
@@ -1 +1 @@
1
- {"version":3,"file":"BasicCard.js","sourceRoot":"../../../../src","sources":["sub-blocks/BasicCard/BasicCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAC,QAAQ,EAAE,WAAW,EAAC,kCAAyB;AACvD,OAAO,EAAC,QAAQ,EAAC,qCAA4B;AAE7C,OAAO,EAAC,YAAY,EAAC,qDAAkD;AACvE,OAAO,EAAC,KAAK,EAAE,cAAc,EAAC,6BAAoB;AAClD,OAAO,OAAO,8BAA2B;AAEzC,OAAO,iBAAiB,CAAC;AAEzB,MAAM,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC;AAE9B,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IACxC,MAAM,EACF,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,cAAc,EACd,KAAK,EACL,IAAI,EACJ,OAAO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AAa,EACrB,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,EAAC,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAC,EAC3B,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,GAC7D,GACQ,GACC,GACZ,CACd,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import {useUniqId} from '@gravity-ui/uikit';\n\nimport {CardBase, IconWrapper} from '../../components';\nimport {useTheme} from '../../context/theme';\nimport {BasicCardProps} from '../../models';\nimport {IconPosition} from '../../models/constructor-items/sub-blocks';\nimport {block, getThemedValue} from '../../utils';\nimport Content from '../Content/Content';\n\nimport './BasicCard.scss';\n\nconst b = block('basic-card');\n\nconst BasicCard = (props: BasicCardProps) => {\n const {\n title,\n text,\n icon,\n additionalInfo,\n links,\n list,\n buttons,\n iconPosition = IconPosition.Top,\n controlPosition = 'content',\n size = 's',\n gravityIcon,\n hoverBackgroundColor,\n ...cardParams\n } = props;\n const titleId = useUniqId();\n const descriptionId = useUniqId();\n const areControlsInFooter = controlPosition === 'footer';\n const theme = useTheme();\n const themedIcon = getThemedValue(icon, theme);\n const themedGravityIcon = getThemedValue(gravityIcon, theme);\n\n return (\n <CardBase\n className={b()}\n contentClassName={b('content')}\n {...cardParams}\n extraProps={{\n 'aria-describedby': descriptionId,\n 'aria-labelledby': titleId,\n ...(hoverBackgroundColor && {\n style: {\n '--hover-background-color': hoverBackgroundColor,\n } as React.CSSProperties,\n }),\n }}\n >\n <CardBase.Content>\n <IconWrapper\n icon={themedIcon ? {value: themedIcon, position: iconPosition} : undefined}\n gravityIcon={\n themedGravityIcon\n ? {value: themedGravityIcon, position: iconPosition}\n : undefined\n }\n className={b('wrapper')}\n size={size}\n >\n <Content\n title={title}\n titleId={titleId}\n text={text}\n textId={descriptionId}\n additionalInfo={additionalInfo}\n links={links}\n list={list}\n buttons={buttons}\n size={size}\n colSizes={{all: 12, md: 12}}\n controlPosition={areControlsInFooter ? 'bottom' : 'default'}\n />\n </IconWrapper>\n </CardBase.Content>\n </CardBase>\n );\n};\n\nexport default BasicCard;\n"]}
1
+ {"version":3,"file":"BasicCard.js","sourceRoot":"../../../../src","sources":["sub-blocks/BasicCard/BasicCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAC,QAAQ,EAAE,WAAW,EAAC,kCAAyB;AACvD,OAAO,EAAC,QAAQ,EAAC,qCAA4B;AAE7C,OAAO,EAAC,YAAY,EAAC,qDAAkD;AACvE,OAAO,EAAC,KAAK,EAAE,cAAc,EAAC,6BAAoB;AAClD,OAAO,OAAO,8BAA2B;AAEzC,OAAO,iBAAiB,CAAC;AAEzB,MAAM,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC;AAE9B,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IACxC,MAAM,EACF,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,cAAc,EACd,KAAK,EACL,IAAI,EACJ,OAAO,EACP,YAAY,GAAG,YAAY,CAAC,GAAG,EAC/B,eAAe,GAAG,SAAS,EAC3B,IAAI,GAAG,GAAG,EACV,WAAW;IACX,mEAAmE;IACnE,oBAAoB,EACpB,GAAG,UAAU,EAChB,GAAG,KAAK,CAAC;IACV,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;IAC5B,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC;IAClC,MAAM,mBAAmB,GAAG,eAAe,KAAK,QAAQ,CAAC;IACzD,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/C,MAAM,iBAAiB,GAAG,cAAc,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAE7D,OAAO,CACH,KAAC,QAAQ,IACL,SAAS,EAAE,CAAC,EAAE,EACd,gBAAgB,EAAE,CAAC,CAAC,SAAS,CAAC,KAC1B,UAAU,EACd,UAAU,EAAE;YACR,kBAAkB,EAAE,aAAa;YACjC,iBAAiB,EAAE,OAAO;YAC1B,GAAG,CAAC,oBAAoB,IAAI;gBACxB,KAAK,EAAE;oBACH,0BAA0B,EAAE,oBAAoB;iBAC5B;aAC3B,CAAC;SACL,YAED,KAAC,QAAQ,CAAC,OAAO,cACb,KAAC,WAAW,IACR,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,EAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAC,CAAC,CAAC,CAAC,SAAS,EAC1E,WAAW,EACP,iBAAiB;oBACb,CAAC,CAAC,EAAC,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,YAAY,EAAC;oBACpD,CAAC,CAAC,SAAS,EAEnB,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,EACvB,IAAI,EAAE,IAAI,YAEV,KAAC,OAAO,IACJ,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,aAAa,EACrB,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,EAAC,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAC,EAC3B,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,GAC7D,GACQ,GACC,GACZ,CACd,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import {useUniqId} from '@gravity-ui/uikit';\n\nimport {CardBase, IconWrapper} from '../../components';\nimport {useTheme} from '../../context/theme';\nimport {BasicCardProps} from '../../models';\nimport {IconPosition} from '../../models/constructor-items/sub-blocks';\nimport {block, getThemedValue} from '../../utils';\nimport Content from '../Content/Content';\n\nimport './BasicCard.scss';\n\nconst b = block('basic-card');\n\nconst BasicCard = (props: BasicCardProps) => {\n const {\n title,\n text,\n icon,\n additionalInfo,\n links,\n list,\n buttons,\n iconPosition = IconPosition.Top,\n controlPosition = 'content',\n size = 's',\n gravityIcon,\n /** @deprecated This property will be removed in future versions */\n hoverBackgroundColor,\n ...cardParams\n } = props;\n const titleId = useUniqId();\n const descriptionId = useUniqId();\n const areControlsInFooter = controlPosition === 'footer';\n const theme = useTheme();\n const themedIcon = getThemedValue(icon, theme);\n const themedGravityIcon = getThemedValue(gravityIcon, theme);\n\n return (\n <CardBase\n className={b()}\n contentClassName={b('content')}\n {...cardParams}\n extraProps={{\n 'aria-describedby': descriptionId,\n 'aria-labelledby': titleId,\n ...(hoverBackgroundColor && {\n style: {\n '--hover-background-color': hoverBackgroundColor,\n } as React.CSSProperties,\n }),\n }}\n >\n <CardBase.Content>\n <IconWrapper\n icon={themedIcon ? {value: themedIcon, position: iconPosition} : undefined}\n gravityIcon={\n themedGravityIcon\n ? {value: themedGravityIcon, position: iconPosition}\n : undefined\n }\n className={b('wrapper')}\n size={size}\n >\n <Content\n title={title}\n titleId={titleId}\n text={text}\n textId={descriptionId}\n additionalInfo={additionalInfo}\n links={links}\n list={list}\n buttons={buttons}\n size={size}\n colSizes={{all: 12, md: 12}}\n controlPosition={areControlsInFooter ? 'bottom' : 'default'}\n />\n </IconWrapper>\n </CardBase.Content>\n </CardBase>\n );\n};\n\nexport default BasicCard;\n"]}
@@ -69,6 +69,9 @@ export declare const BasicCard: {
69
69
  type: string;
70
70
  enum: string[];
71
71
  };
72
+ /**
73
+ * @deprecated This property will be removed in future versions
74
+ */
72
75
  hoverBackgroundColor: {
73
76
  type: string;
74
77
  };
@@ -32,6 +32,9 @@ export const BasicCard = {
32
32
  type: 'string',
33
33
  enum: ['content', 'footer'],
34
34
  },
35
+ /**
36
+ * @deprecated This property will be removed in future versions
37
+ */
35
38
  hoverBackgroundColor: {
36
39
  type: 'string',
37
40
  },
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["sub-blocks/BasicCard/schema.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,uBAAoB;AAE/B,OAAO,EAAC,UAAU,EAAC,yCAAsC;AACzD,OAAO,EACH,SAAS,EACT,QAAQ,EACR,eAAe,EACf,gBAAgB,GACnB,0CAAuC;AACxC,OAAO,EAAC,WAAW,EAAC,6BAA0B;AAE9C,MAAM,qBAAqB,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAEtF,MAAM,CAAC,MAAM,SAAS,GAAG;IACrB,YAAY,EAAE;QACV,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE;YACR,GAAG,SAAS;YACZ,GAAG,QAAQ;YACX,GAAG,eAAe;YAClB,GAAG,qBAAqB;YACxB,GAAG,EAAE;gBACD,IAAI,EAAE,QAAQ;aACjB;YACD,QAAQ,EAAE;gBACN,IAAI,EAAE,QAAQ;aACjB;YACD,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,gBAAgB;YAC7B,MAAM,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC;aAC/C;YACD,YAAY,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;aACxB;YACD,eAAe,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;aAC9B;YACD,oBAAoB,EAAE;gBAClB,IAAI,EAAE,QAAQ;aACjB;SACJ;KACJ;CACJ,CAAC","sourcesContent":["import omit from 'lodash/omit';\n\nimport {ImageProps} from '../../components/Image/schema';\nimport {\n BaseProps,\n CardBase,\n CardLayoutProps,\n GravityIconProps,\n} from '../../schema/validators/common';\nimport {ContentBase} from '../Content/schema';\n\nconst BasicCardContentProps = omit(ContentBase, ['size', 'theme', 'controlPosition']);\n\nexport const BasicCard = {\n 'basic-card': {\n additionalProperties: false,\n required: [],\n properties: {\n ...BaseProps,\n ...CardBase,\n ...CardLayoutProps,\n ...BasicCardContentProps,\n url: {\n type: 'string',\n },\n urlTitle: {\n type: 'string',\n },\n icon: ImageProps,\n gravityIcon: GravityIconProps,\n target: {\n type: 'string',\n enum: ['_blank', '_parent', '_top', '_self'],\n },\n iconPosition: {\n type: 'string',\n enum: ['top', 'left'],\n },\n controlPosition: {\n type: 'string',\n enum: ['content', 'footer'],\n },\n hoverBackgroundColor: {\n type: 'string',\n },\n },\n },\n};\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["sub-blocks/BasicCard/schema.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,uBAAoB;AAE/B,OAAO,EAAC,UAAU,EAAC,yCAAsC;AACzD,OAAO,EACH,SAAS,EACT,QAAQ,EACR,eAAe,EACf,gBAAgB,GACnB,0CAAuC;AACxC,OAAO,EAAC,WAAW,EAAC,6BAA0B;AAE9C,MAAM,qBAAqB,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAEtF,MAAM,CAAC,MAAM,SAAS,GAAG;IACrB,YAAY,EAAE;QACV,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE;YACR,GAAG,SAAS;YACZ,GAAG,QAAQ;YACX,GAAG,eAAe;YAClB,GAAG,qBAAqB;YACxB,GAAG,EAAE;gBACD,IAAI,EAAE,QAAQ;aACjB;YACD,QAAQ,EAAE;gBACN,IAAI,EAAE,QAAQ;aACjB;YACD,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,gBAAgB;YAC7B,MAAM,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC;aAC/C;YACD,YAAY,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;aACxB;YACD,eAAe,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;aAC9B;YACD;;eAEG;YACH,oBAAoB,EAAE;gBAClB,IAAI,EAAE,QAAQ;aACjB;SACJ;KACJ;CACJ,CAAC","sourcesContent":["import omit from 'lodash/omit';\n\nimport {ImageProps} from '../../components/Image/schema';\nimport {\n BaseProps,\n CardBase,\n CardLayoutProps,\n GravityIconProps,\n} from '../../schema/validators/common';\nimport {ContentBase} from '../Content/schema';\n\nconst BasicCardContentProps = omit(ContentBase, ['size', 'theme', 'controlPosition']);\n\nexport const BasicCard = {\n 'basic-card': {\n additionalProperties: false,\n required: [],\n properties: {\n ...BaseProps,\n ...CardBase,\n ...CardLayoutProps,\n ...BasicCardContentProps,\n url: {\n type: 'string',\n },\n urlTitle: {\n type: 'string',\n },\n icon: ImageProps,\n gravityIcon: GravityIconProps,\n target: {\n type: 'string',\n enum: ['_blank', '_parent', '_top', '_self'],\n },\n iconPosition: {\n type: 'string',\n enum: ['top', 'left'],\n },\n controlPosition: {\n type: 'string',\n enum: ['content', 'footer'],\n },\n /**\n * @deprecated This property will be removed in future versions\n */\n hoverBackgroundColor: {\n type: 'string',\n },\n },\n },\n};\n"]}
@@ -213,6 +213,11 @@ export const config = {
213
213
  transformer: yfmTransformer,
214
214
  parser: parseFeatures,
215
215
  },
216
+ {
217
+ fields: ['list'],
218
+ transformer: yfmTransformer,
219
+ parser: parseFeatures,
220
+ },
216
221
  ],
217
222
  [BlockType.FoldableListBlock]: [
218
223
  {
@@ -228,6 +233,11 @@ export const config = {
228
233
  transformer: yfmTransformer,
229
234
  parser: parseFeatures,
230
235
  },
236
+ {
237
+ fields: ['list'],
238
+ transformer: yfmTransformer,
239
+ parser: parseFeatures,
240
+ },
231
241
  ],
232
242
  [BlockType.BannerBlock]: [
233
243
  {
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"../../../src","sources":["text-transform/config.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,4EAA4E;AAE5E,OAAO,EACH,SAAS,EAOT,YAAY,GAGf,2BAAkB;AAEnB,OAAO,EAIH,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,GACjB,oBAAiB;AAElB,SAAS,qBAAqB,CAAC,WAAwB,EAAE,OAAmB;IACxE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC;IAE/B,OAAO;QACH,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;QAClB,MAAM,EAAE,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;KAChE,CAAC;AACN,CAAC;AAED,SAAS,sBAAsB,CAAC,WAAwB,EAAE,OAAmB;IACzE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC;IAC/B,MAAM,YAAY,GAAG,OAAO,EAAE,OAAO,CAAC;IAEtC,OAAO;QACH,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;QAClB,OAAO,EACH,YAAY;YACZ,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CACxB,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;gBAChB,IAAI,MAAM,EAAE,CAAC;oBACT,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;wBACrB,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;oBAC7B,CAAC;o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,MAAM,CAAC;YAChB,WAAW,EAAE,cAAc;YAC3B,MAAM,EAAE,iBAAiB,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;SAC/C;KACJ;IACD,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE;QACnB;YACI,MAAM,EAAE,CAAC,aAAa,CAAC;YACvB,WAAW,EAAE,cAAc;YAC3B,MAAM,EAAE,kBAAkB;SAC7B;QACD;YACI,MAAM,EAAE,CAAC,aAAa,CAAC;YACvB,WAAW,EAAE,cAAc;YAC3B,MAAM,EAAE,uBAAuB;YAC/B,YAAY,EAAE,IAAI;SACrB;KACJ;CACJ,CAAC","sourcesContent":["/* eslint-disable no-param-reassign */\n/* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */\n\nimport {\n BlockType,\n ContentBlockProps,\n ExtendedFeaturesItem,\n PriceDetailedProps,\n PriceDetailsListProps,\n PriceDetailsSettingsProps,\n PromoFeaturesItem,\n SubBlockType,\n TableProps,\n TitleItemProps,\n} from '../models';\n\nimport {\n Parser,\n Transformer,\n TransformerRaw,\n createItemsParser,\n typografTransformer,\n yfmTransformer,\n} from './common';\n\nfunction parseTableBlockLegend(transformer: Transformer, content: TableProps) {\n const legend = content?.legend;\n\n return {\n ...(content || {}),\n legend: legend && legend.map((string) => transformer(string)),\n };\n}\n\nfunction parseTableBlockContent(transformer: Transformer, content: TableProps) {\n const legend = content?.legend;\n const tableContent = content?.content;\n\n return {\n ...(content || {}),\n content:\n tableContent &&\n tableContent.map((row, i) =>\n row.map((cell, j) => {\n if (legend) {\n if (i === 0 || j === 0) {\n return transformer(cell);\n }\n return cell;\n } else {\n return transformer(cell);\n }\n }),\n ),\n };\n}\n\nfunction parseFeatures(transformer: Transformer, items: ExtendedFeaturesItem[]) {\n return items.map(({title, text, ...rest}) => ({\n title: title && transformer(title),\n text: text && transformer(text),\n ...rest,\n }));\n}\n\nfunction parsePromoFeatures(transformer: Transformer, items: PromoFeaturesItem[]) {\n return items.map(({text, ...rest}) => ({\n text: transformer(text),\n ...rest,\n }));\n}\n\nconst parseTitle = (transformer: Transformer, title: TitleItemProps | string) =>\n typeof title === 'object' && 'text' in title\n ? {...title, text: transformer(title.text)}\n : title && transformer(title);\n\nconst parseItemsTitle = (transformer: Transformer, items: ExtendedFeaturesItem[]) =>\n items.map(({title, ...rest}) => ({\n title: title && parseTitle(transformer, title),\n ...rest,\n }));\n\nfunction parsePriceDetailedBlock(transformer: Transformer, block: PriceDetailedProps) {\n const {priceType} = block;\n\n /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */\n block.items = block.items.map((item) => {\n const {description, items: details = []} = item;\n\n if (priceType === 'marked-list') {\n item.items = (details as PriceDetailsListProps[]).map((detail) => {\n detail.text = detail.text && transformer(detail.text);\n\n return detail;\n });\n } else {\n item.items = (details as PriceDetailsSettingsProps[]).map((detail) => {\n detail.description = detail.description && transformer(detail.description);\n\n return detail;\n });\n }\n\n item.description = transformer(description);\n\n return item;\n });\n /* eslint-enable no-not-accumulator-reassign/no-not-accumulator-reassign */\n\n return block;\n}\n\nconst parseContentLayout = (transformer: Transformer, content: ContentBlockProps) => {\n if (content) {\n const {text, additionalInfo, list} = content;\n\n /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */\n if (text) {\n content.text = transformer(text);\n }\n\n if (additionalInfo) {\n content.additionalInfo = transformer(additionalInfo);\n }\n\n if (list) {\n content.list = list.map((item) => {\n if (item?.text) {\n return {\n ...item,\n text: transformer(item.text),\n };\n }\n\n return item;\n });\n }\n /* eslint-enable no-not-accumulator-reassign/no-not-accumulator-reassign */\n }\n\n return content;\n};\n\nfunction parseContentLayoutTitle(transformer: Transformer, content: ContentBlockProps) {\n if (content?.title) {\n const {title} = content;\n\n // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign\n content.title = title && parseTitle(transformer, title);\n }\n\n return content;\n}\n\nexport const blockHeaderTransformer = [\n {\n fields: ['title'],\n transformer: yfmTransformer,\n parser: parseTitle,\n renderInline: true,\n },\n {\n fields: ['description'],\n transformer: yfmTransformer,\n },\n];\n\ninterface BlockConfig {\n transformer: TransformerRaw;\n fields?: string[];\n parser?: Parser;\n renderInline?: boolean;\n}\n\nexport type BlocksConfig = Record<string, BlockConfig | BlockConfig[]>;\n\nexport const config: BlocksConfig = {\n [SubBlockType.BasicCard]: [\n {\n fields: ['title'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n {\n fields: ['text', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n ],\n [SubBlockType.BackgroundCard]: [\n {\n fields: ['title', 'text', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n {\n fields: ['list'],\n transformer: yfmTransformer,\n parser: createItemsParser(['text']),\n },\n ],\n [SubBlockType.ImageCard]: [\n {\n fields: ['title', 'text', 'additionalInfo'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n ],\n [SubBlockType.LayoutItem]: [\n {\n fields: ['content'],\n parser: parseContentLayout,\n transformer: yfmTransformer,\n },\n {\n fields: ['content'],\n parser: parseContentLayoutTitle,\n transformer: yfmTransformer,\n renderInline: true,\n },\n {\n fields: ['metaInfo'],\n parser: createItemsParser([]),\n transformer: yfmTransformer,\n },\n ],\n [SubBlockType.Quote]: [\n {\n fields: ['text', 'yfmText'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n ],\n [BlockType.ExtendedFeaturesBlock]: [\n ...blockHeaderTransformer,\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: createItemsParser(['title']),\n renderInline: true,\n },\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: createItemsParser(['text', 'additionalInfo']),\n },\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: createItemsParser(['list.text']),\n renderInline: true,\n },\n ],\n [BlockType.PromoFeaturesBlock]: [\n ...blockHeaderTransformer,\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: parsePromoFeatures,\n },\n ],\n [BlockType.SliderOldBlock]: blockHeaderTransformer,\n [BlockType.SliderBlock]: blockHeaderTransformer,\n [BlockType.CompaniesBlock]: blockHeaderTransformer,\n [BlockType.QuestionsBlock]: [\n {\n fields: ['title', 'text', 'additionalInfo'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: parseFeatures,\n },\n ],\n [BlockType.FoldableListBlock]: [\n {\n fields: ['title'],\n transformer: typografTransformer,\n },\n {\n fields: ['text', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: parseFeatures,\n },\n ],\n\n [BlockType.BannerBlock]: [\n {\n fields: ['title'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n {\n fields: ['subtitle'],\n transformer: yfmTransformer,\n },\n ],\n [SubBlockType.BannerCard]: [\n {\n fields: ['title'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n {\n fields: ['subtitle'],\n transformer: yfmTransformer,\n },\n ],\n [BlockType.MediaBlock]: [\n ...blockHeaderTransformer,\n {\n fields: ['additionalInfo'],\n transformer: yfmTransformer,\n },\n {\n fields: ['list'],\n transformer: yfmTransformer,\n parser: createItemsParser(['text']),\n },\n ],\n [BlockType.MapBlock]: [\n ...blockHeaderTransformer,\n {\n fields: ['title', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n ],\n [BlockType.TabsBlock]: [\n ...blockHeaderTransformer,\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: createItemsParser(['text', 'additionalInfo', 'caption']),\n },\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: parseItemsTitle,\n renderInline: true,\n },\n ],\n [BlockType.TableBlock]: [\n {\n fields: ['title'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n {\n fields: ['table'],\n transformer: yfmTransformer,\n parser: parseTableBlockLegend,\n },\n {\n fields: ['table'],\n transformer: yfmTransformer,\n parser: parseTableBlockContent,\n renderInline: true,\n },\n ],\n [BlockType.HeaderSliderBlock]: [\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: createItemsParser(['title', 'overtitle', 'description']),\n renderInline: true,\n },\n ],\n [SubBlockType.PriceDetailed]: [\n {\n transformer: yfmTransformer,\n parser: parsePriceDetailedBlock,\n },\n ],\n [BlockType.HeaderBlock]: [\n {\n fields: ['description', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n {\n fields: ['overtitle', 'title'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n ],\n [BlockType.ContentLayoutBlock]: [\n {\n fields: ['textContent'],\n transformer: yfmTransformer,\n parser: parseContentLayout,\n },\n {\n fields: ['textContent'],\n transformer: yfmTransformer,\n parser: parseContentLayoutTitle,\n renderInline: true,\n },\n ],\n [SubBlockType.Content]: [\n {\n fields: ['text', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n {\n fields: ['title'],\n transformer: yfmTransformer,\n parser: parseTitle,\n renderInline: true,\n },\n {\n fields: ['list'],\n transformer: yfmTransformer,\n parser: createItemsParser(['title', 'text']),\n },\n ],\n [BlockType.InfoBlock]: [\n {\n fields: ['title'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n {\n fields: ['rightContent', 'leftContent'],\n transformer: yfmTransformer,\n parser: parseContentLayout,\n },\n {\n fields: ['rightContent', 'leftContent'],\n transformer: yfmTransformer,\n parser: parseContentLayoutTitle,\n renderInline: true,\n },\n ],\n [BlockType.ShareBlock]: [\n {\n fields: ['title'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n ],\n [BlockType.CardLayoutBlock]: blockHeaderTransformer,\n [BlockType.FilterBlock]: blockHeaderTransformer,\n [BlockType.IconsBlock]: blockHeaderTransformer,\n [SubBlockType.PriceCard]: [\n {\n fields: ['title'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n {\n fields: ['list'],\n transformer: yfmTransformer,\n parser: createItemsParser(['title', 'text']),\n },\n ],\n [BlockType.FormBlock]: [\n {\n fields: ['textContent'],\n transformer: yfmTransformer,\n parser: parseContentLayout,\n },\n {\n fields: ['textContent'],\n transformer: yfmTransformer,\n parser: parseContentLayoutTitle,\n renderInline: true,\n },\n ],\n};\n"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"../../../src","sources":["text-transform/config.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,4EAA4E;AAE5E,OAAO,EACH,SAAS,EAOT,YAAY,GAGf,2BAAkB;AAEnB,OAAO,EAIH,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,GACjB,oBAAiB;AAElB,SAAS,qBAAqB,CAAC,WAAwB,EAAE,OAAmB;IACxE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC;IAE/B,OAAO;QACH,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;QAClB,MAAM,EAAE,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;KAChE,CAAC;AACN,CAAC;AAED,SAAS,sBAAsB,CAAC,WAAwB,EAAE,OAAmB;IACzE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC;IAC/B,MAAM,YAAY,GAAG,OAAO,EAAE,OAAO,CAAC;IAEtC,OAAO;QACH,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;QAClB,OAAO,EACH,YAAY;YACZ,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CACxB,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;gBAChB,IAAI,MAAM,EAAE,CAAC;oBACT,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;wBACrB,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;oBAC7B,CAAC;oBACD,OAAO,IAAI,CAAC;gBAChB,CAAC;qBAAM,CAAC;oBACJ,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;gBAC7B,CAAC;YACL,CAAC,CAAC,CACL;KACR,CAAC;AACN,CAAC;AAED,SAAS,aAAa,CAA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I,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,WAAW,EAAE,cAAc;YAC3B,MAAM,EAAE,iBAAiB,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;SAC/C;KACJ;IACD,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE;QACnB;YACI,MAAM,EAAE,CAAC,aAAa,CAAC;YACvB,WAAW,EAAE,cAAc;YAC3B,MAAM,EAAE,kBAAkB;SAC7B;QACD;YACI,MAAM,EAAE,CAAC,aAAa,CAAC;YACvB,WAAW,EAAE,cAAc;YAC3B,MAAM,EAAE,uBAAuB;YAC/B,YAAY,EAAE,IAAI;SACrB;KACJ;CACJ,CAAC","sourcesContent":["/* eslint-disable no-param-reassign */\n/* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */\n\nimport {\n BlockType,\n ContentBlockProps,\n ExtendedFeaturesItem,\n PriceDetailedProps,\n PriceDetailsListProps,\n PriceDetailsSettingsProps,\n PromoFeaturesItem,\n SubBlockType,\n TableProps,\n TitleItemProps,\n} from '../models';\n\nimport {\n Parser,\n Transformer,\n TransformerRaw,\n createItemsParser,\n typografTransformer,\n yfmTransformer,\n} from './common';\n\nfunction parseTableBlockLegend(transformer: Transformer, content: TableProps) {\n const legend = content?.legend;\n\n return {\n ...(content || {}),\n legend: legend && legend.map((string) => transformer(string)),\n };\n}\n\nfunction parseTableBlockContent(transformer: Transformer, content: TableProps) {\n const legend = content?.legend;\n const tableContent = content?.content;\n\n return {\n ...(content || {}),\n content:\n tableContent &&\n tableContent.map((row, i) =>\n row.map((cell, j) => {\n if (legend) {\n if (i === 0 || j === 0) {\n return transformer(cell);\n }\n return cell;\n } else {\n return transformer(cell);\n }\n }),\n ),\n };\n}\n\nfunction parseFeatures(transformer: Transformer, items: ExtendedFeaturesItem[]) {\n return items.map(({title, text, ...rest}) => ({\n title: title && transformer(title),\n text: text && transformer(text),\n ...rest,\n }));\n}\n\nfunction parsePromoFeatures(transformer: Transformer, items: PromoFeaturesItem[]) {\n return items.map(({text, ...rest}) => ({\n text: transformer(text),\n ...rest,\n }));\n}\n\nconst parseTitle = (transformer: Transformer, title: TitleItemProps | string) =>\n typeof title === 'object' && 'text' in title\n ? {...title, text: transformer(title.text)}\n : title && transformer(title);\n\nconst parseItemsTitle = (transformer: Transformer, items: ExtendedFeaturesItem[]) =>\n items.map(({title, ...rest}) => ({\n title: title && parseTitle(transformer, title),\n ...rest,\n }));\n\nfunction parsePriceDetailedBlock(transformer: Transformer, block: PriceDetailedProps) {\n const {priceType} = block;\n\n /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */\n block.items = block.items.map((item) => {\n const {description, items: details = []} = item;\n\n if (priceType === 'marked-list') {\n item.items = (details as PriceDetailsListProps[]).map((detail) => {\n detail.text = detail.text && transformer(detail.text);\n\n return detail;\n });\n } else {\n item.items = (details as PriceDetailsSettingsProps[]).map((detail) => {\n detail.description = detail.description && transformer(detail.description);\n\n return detail;\n });\n }\n\n item.description = transformer(description);\n\n return item;\n });\n /* eslint-enable no-not-accumulator-reassign/no-not-accumulator-reassign */\n\n return block;\n}\n\nconst parseContentLayout = (transformer: Transformer, content: ContentBlockProps) => {\n if (content) {\n const {text, additionalInfo, list} = content;\n\n /* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */\n if (text) {\n content.text = transformer(text);\n }\n\n if (additionalInfo) {\n content.additionalInfo = transformer(additionalInfo);\n }\n\n if (list) {\n content.list = list.map((item) => {\n if (item?.text) {\n return {\n ...item,\n text: transformer(item.text),\n };\n }\n\n return item;\n });\n }\n /* eslint-enable no-not-accumulator-reassign/no-not-accumulator-reassign */\n }\n\n return content;\n};\n\nfunction parseContentLayoutTitle(transformer: Transformer, content: ContentBlockProps) {\n if (content?.title) {\n const {title} = content;\n\n // eslint-disable-next-line no-not-accumulator-reassign/no-not-accumulator-reassign\n content.title = title && parseTitle(transformer, title);\n }\n\n return content;\n}\n\nexport const blockHeaderTransformer = [\n {\n fields: ['title'],\n transformer: yfmTransformer,\n parser: parseTitle,\n renderInline: true,\n },\n {\n fields: ['description'],\n transformer: yfmTransformer,\n },\n];\n\ninterface BlockConfig {\n transformer: TransformerRaw;\n fields?: string[];\n parser?: Parser;\n renderInline?: boolean;\n}\n\nexport type BlocksConfig = Record<string, BlockConfig | BlockConfig[]>;\n\nexport const config: BlocksConfig = {\n [SubBlockType.BasicCard]: [\n {\n fields: ['title'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n {\n fields: ['text', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n ],\n [SubBlockType.BackgroundCard]: [\n {\n fields: ['title', 'text', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n {\n fields: ['list'],\n transformer: yfmTransformer,\n parser: createItemsParser(['text']),\n },\n ],\n [SubBlockType.ImageCard]: [\n {\n fields: ['title', 'text', 'additionalInfo'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n ],\n [SubBlockType.LayoutItem]: [\n {\n fields: ['content'],\n parser: parseContentLayout,\n transformer: yfmTransformer,\n },\n {\n fields: ['content'],\n parser: parseContentLayoutTitle,\n transformer: yfmTransformer,\n renderInline: true,\n },\n {\n fields: ['metaInfo'],\n parser: createItemsParser([]),\n transformer: yfmTransformer,\n },\n ],\n [SubBlockType.Quote]: [\n {\n fields: ['text', 'yfmText'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n ],\n [BlockType.ExtendedFeaturesBlock]: [\n ...blockHeaderTransformer,\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: createItemsParser(['title']),\n renderInline: true,\n },\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: createItemsParser(['text', 'additionalInfo']),\n },\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: createItemsParser(['list.text']),\n renderInline: true,\n },\n ],\n [BlockType.PromoFeaturesBlock]: [\n ...blockHeaderTransformer,\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: parsePromoFeatures,\n },\n ],\n [BlockType.SliderOldBlock]: blockHeaderTransformer,\n [BlockType.SliderBlock]: blockHeaderTransformer,\n [BlockType.CompaniesBlock]: blockHeaderTransformer,\n [BlockType.QuestionsBlock]: [\n {\n fields: ['title', 'text', 'additionalInfo'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: parseFeatures,\n },\n {\n fields: ['list'],\n transformer: yfmTransformer,\n parser: parseFeatures,\n },\n ],\n [BlockType.FoldableListBlock]: [\n {\n fields: ['title'],\n transformer: typografTransformer,\n },\n {\n fields: ['text', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: parseFeatures,\n },\n {\n fields: ['list'],\n transformer: yfmTransformer,\n parser: parseFeatures,\n },\n ],\n\n [BlockType.BannerBlock]: [\n {\n fields: ['title'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n {\n fields: ['subtitle'],\n transformer: yfmTransformer,\n },\n ],\n [SubBlockType.BannerCard]: [\n {\n fields: ['title'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n {\n fields: ['subtitle'],\n transformer: yfmTransformer,\n },\n ],\n [BlockType.MediaBlock]: [\n ...blockHeaderTransformer,\n {\n fields: ['additionalInfo'],\n transformer: yfmTransformer,\n },\n {\n fields: ['list'],\n transformer: yfmTransformer,\n parser: createItemsParser(['text']),\n },\n ],\n [BlockType.MapBlock]: [\n ...blockHeaderTransformer,\n {\n fields: ['title', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n ],\n [BlockType.TabsBlock]: [\n ...blockHeaderTransformer,\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: createItemsParser(['text', 'additionalInfo', 'caption']),\n },\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: parseItemsTitle,\n renderInline: true,\n },\n ],\n [BlockType.TableBlock]: [\n {\n fields: ['title'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n {\n fields: ['table'],\n transformer: yfmTransformer,\n parser: parseTableBlockLegend,\n },\n {\n fields: ['table'],\n transformer: yfmTransformer,\n parser: parseTableBlockContent,\n renderInline: true,\n },\n ],\n [BlockType.HeaderSliderBlock]: [\n {\n fields: ['items'],\n transformer: yfmTransformer,\n parser: createItemsParser(['title', 'overtitle', 'description']),\n renderInline: true,\n },\n ],\n [SubBlockType.PriceDetailed]: [\n {\n transformer: yfmTransformer,\n parser: parsePriceDetailedBlock,\n },\n ],\n [BlockType.HeaderBlock]: [\n {\n fields: ['description', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n {\n fields: ['overtitle', 'title'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n ],\n [BlockType.ContentLayoutBlock]: [\n {\n fields: ['textContent'],\n transformer: yfmTransformer,\n parser: parseContentLayout,\n },\n {\n fields: ['textContent'],\n transformer: yfmTransformer,\n parser: parseContentLayoutTitle,\n renderInline: true,\n },\n ],\n [SubBlockType.Content]: [\n {\n fields: ['text', 'additionalInfo'],\n transformer: yfmTransformer,\n },\n {\n fields: ['title'],\n transformer: yfmTransformer,\n parser: parseTitle,\n renderInline: true,\n },\n {\n fields: ['list'],\n transformer: yfmTransformer,\n parser: createItemsParser(['title', 'text']),\n },\n ],\n [BlockType.InfoBlock]: [\n {\n fields: ['title'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n {\n fields: ['rightContent', 'leftContent'],\n transformer: yfmTransformer,\n parser: parseContentLayout,\n },\n {\n fields: ['rightContent', 'leftContent'],\n transformer: yfmTransformer,\n parser: parseContentLayoutTitle,\n renderInline: true,\n },\n ],\n [BlockType.ShareBlock]: [\n {\n fields: ['title'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n ],\n [BlockType.CardLayoutBlock]: blockHeaderTransformer,\n [BlockType.FilterBlock]: blockHeaderTransformer,\n [BlockType.IconsBlock]: blockHeaderTransformer,\n [SubBlockType.PriceCard]: [\n {\n fields: ['title'],\n transformer: yfmTransformer,\n renderInline: true,\n },\n {\n fields: ['list'],\n transformer: yfmTransformer,\n parser: createItemsParser(['title', 'text']),\n },\n ],\n [BlockType.FormBlock]: [\n {\n fields: ['textContent'],\n transformer: yfmTransformer,\n parser: parseContentLayout,\n },\n {\n fields: ['textContent'],\n transformer: yfmTransformer,\n parser: parseContentLayoutTitle,\n renderInline: true,\n },\n ],\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "7.23.0",
3
+ "version": "7.25.0",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -174,6 +174,7 @@ export interface QuestionItem {
174
174
  text: string;
175
175
  listStyle?: 'dash' | 'disk';
176
176
  link?: LinkProps;
177
+ onClick?: (index: number, newOpenState: boolean) => void;
177
178
  }
178
179
  export interface QuestionsProps extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'labels'> {
179
180
  items: QuestionItem[];