@gravity-ui/page-constructor 8.2.0-alpha.0 → 8.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/build/cjs/blocks/CardLayout/schema.d.ts +156 -0
  2. package/build/cjs/blocks/ContentLayout/schema.d.ts +78 -0
  3. package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +78 -0
  4. package/build/cjs/blocks/FilterBlock/schema.d.ts +156 -0
  5. package/build/cjs/blocks/FoldableList/schema.d.ts +78 -0
  6. package/build/cjs/blocks/Form/schema.d.ts +78 -0
  7. package/build/cjs/blocks/Info/schema.d.ts +156 -0
  8. package/build/cjs/blocks/Map/schema.d.ts +78 -0
  9. package/build/cjs/blocks/Media/schema.d.ts +156 -0
  10. package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +78 -0
  11. package/build/cjs/blocks/Questions/schema.d.ts +78 -0
  12. package/build/cjs/blocks/Slider/schema.d.ts +78 -0
  13. package/build/cjs/blocks/SliderOld/schema.d.ts +78 -0
  14. package/build/cjs/blocks/Tabs/schema.d.ts +156 -0
  15. package/build/cjs/components/Title/TitleItem.js +2 -2
  16. package/build/cjs/components/Title/TitleItem.js.map +1 -1
  17. package/build/cjs/schema/constants.d.ts +234 -0
  18. package/build/cjs/schema/validators/common.d.ts +156 -0
  19. package/build/cjs/schema/validators/common.js +3 -0
  20. package/build/cjs/schema/validators/common.js.map +1 -1
  21. package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +78 -0
  22. package/build/cjs/sub-blocks/BasicCard/schema.d.ts +78 -0
  23. package/build/cjs/sub-blocks/Content/schema.d.ts +156 -0
  24. package/build/cjs/sub-blocks/ImageCard/schema.d.ts +78 -0
  25. package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +78 -0
  26. package/build/esm/blocks/CardLayout/schema.d.ts +156 -0
  27. package/build/esm/blocks/ContentLayout/schema.d.ts +78 -0
  28. package/build/esm/blocks/ExtendedFeatures/schema.d.ts +78 -0
  29. package/build/esm/blocks/FilterBlock/schema.d.ts +156 -0
  30. package/build/esm/blocks/FoldableList/schema.d.ts +78 -0
  31. package/build/esm/blocks/Form/schema.d.ts +78 -0
  32. package/build/esm/blocks/Info/schema.d.ts +156 -0
  33. package/build/esm/blocks/Map/schema.d.ts +78 -0
  34. package/build/esm/blocks/Media/schema.d.ts +156 -0
  35. package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +78 -0
  36. package/build/esm/blocks/Questions/schema.d.ts +78 -0
  37. package/build/esm/blocks/Slider/schema.d.ts +78 -0
  38. package/build/esm/blocks/SliderOld/schema.d.ts +78 -0
  39. package/build/esm/blocks/Tabs/schema.d.ts +156 -0
  40. package/build/esm/components/Title/TitleItem.js +2 -2
  41. package/build/esm/components/Title/TitleItem.js.map +1 -1
  42. package/build/esm/schema/constants.d.ts +234 -0
  43. package/build/esm/schema/validators/common.d.ts +156 -0
  44. package/build/esm/schema/validators/common.js +3 -0
  45. package/build/esm/schema/validators/common.js.map +1 -1
  46. package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +78 -0
  47. package/build/esm/sub-blocks/BasicCard/schema.d.ts +78 -0
  48. package/build/esm/sub-blocks/Content/schema.d.ts +156 -0
  49. package/build/esm/sub-blocks/ImageCard/schema.d.ts +78 -0
  50. package/build/esm/sub-blocks/LayoutItem/schema.d.ts +78 -0
  51. package/package.json +1 -1
  52. package/schema/index.js +1 -1
@@ -116,6 +116,84 @@ export declare const SliderOldBlock: {
116
116
  resetMargin: {
117
117
  type: string;
118
118
  };
119
+ analyticsEvents: {
120
+ anyOf: ({
121
+ type: string;
122
+ additionalProperties: {
123
+ type: string;
124
+ };
125
+ required: string[];
126
+ properties: {
127
+ name: {
128
+ type: string;
129
+ };
130
+ type: {
131
+ type: string;
132
+ };
133
+ counters: {
134
+ type: string;
135
+ additionalProperties: boolean;
136
+ required: never[];
137
+ properties: {
138
+ include: {
139
+ type: string;
140
+ items: {
141
+ type: string;
142
+ };
143
+ };
144
+ exclude: {
145
+ type: string;
146
+ items: {
147
+ type: string;
148
+ };
149
+ };
150
+ };
151
+ };
152
+ context: {
153
+ type: string;
154
+ };
155
+ };
156
+ } | {
157
+ type: string;
158
+ items: {
159
+ type: string;
160
+ additionalProperties: {
161
+ type: string;
162
+ };
163
+ required: string[];
164
+ properties: {
165
+ name: {
166
+ type: string;
167
+ };
168
+ type: {
169
+ type: string;
170
+ };
171
+ counters: {
172
+ type: string;
173
+ additionalProperties: boolean;
174
+ required: never[];
175
+ properties: {
176
+ include: {
177
+ type: string;
178
+ items: {
179
+ type: string;
180
+ };
181
+ };
182
+ exclude: {
183
+ type: string;
184
+ items: {
185
+ type: string;
186
+ };
187
+ };
188
+ };
189
+ };
190
+ context: {
191
+ type: string;
192
+ };
193
+ };
194
+ };
195
+ })[];
196
+ };
119
197
  };
120
198
  })[];
121
199
  };
@@ -517,6 +517,84 @@ export declare const tabsItem: {
517
517
  resetMargin: {
518
518
  type: string;
519
519
  };
520
+ analyticsEvents: {
521
+ anyOf: ({
522
+ type: string;
523
+ additionalProperties: {
524
+ type: string;
525
+ };
526
+ required: string[];
527
+ properties: {
528
+ name: {
529
+ type: string;
530
+ };
531
+ type: {
532
+ type: string;
533
+ };
534
+ counters: {
535
+ type: string;
536
+ additionalProperties: boolean;
537
+ required: never[];
538
+ properties: {
539
+ include: {
540
+ type: string;
541
+ items: {
542
+ type: string;
543
+ };
544
+ };
545
+ exclude: {
546
+ type: string;
547
+ items: {
548
+ type: string;
549
+ };
550
+ };
551
+ };
552
+ };
553
+ context: {
554
+ type: string;
555
+ };
556
+ };
557
+ } | {
558
+ type: string;
559
+ items: {
560
+ type: string;
561
+ additionalProperties: {
562
+ type: string;
563
+ };
564
+ required: string[];
565
+ properties: {
566
+ name: {
567
+ type: string;
568
+ };
569
+ type: {
570
+ type: string;
571
+ };
572
+ counters: {
573
+ type: string;
574
+ additionalProperties: boolean;
575
+ required: never[];
576
+ properties: {
577
+ include: {
578
+ type: string;
579
+ items: {
580
+ type: string;
581
+ };
582
+ };
583
+ exclude: {
584
+ type: string;
585
+ items: {
586
+ type: string;
587
+ };
588
+ };
589
+ };
590
+ };
591
+ context: {
592
+ type: string;
593
+ };
594
+ };
595
+ };
596
+ })[];
597
+ };
520
598
  };
521
599
  contentType?: undefined;
522
600
  })[];
@@ -643,6 +721,84 @@ export declare const TabsBlock: {
643
721
  resetMargin: {
644
722
  type: string;
645
723
  };
724
+ analyticsEvents: {
725
+ anyOf: ({
726
+ type: string;
727
+ additionalProperties: {
728
+ type: string;
729
+ };
730
+ required: string[];
731
+ properties: {
732
+ name: {
733
+ type: string;
734
+ };
735
+ type: {
736
+ type: string;
737
+ };
738
+ counters: {
739
+ type: string;
740
+ additionalProperties: boolean;
741
+ required: never[];
742
+ properties: {
743
+ include: {
744
+ type: string;
745
+ items: {
746
+ type: string;
747
+ };
748
+ };
749
+ exclude: {
750
+ type: string;
751
+ items: {
752
+ type: string;
753
+ };
754
+ };
755
+ };
756
+ };
757
+ context: {
758
+ type: string;
759
+ };
760
+ };
761
+ } | {
762
+ type: string;
763
+ items: {
764
+ type: string;
765
+ additionalProperties: {
766
+ type: string;
767
+ };
768
+ required: string[];
769
+ properties: {
770
+ name: {
771
+ type: string;
772
+ };
773
+ type: {
774
+ type: string;
775
+ };
776
+ counters: {
777
+ type: string;
778
+ additionalProperties: boolean;
779
+ required: never[];
780
+ properties: {
781
+ include: {
782
+ type: string;
783
+ items: {
784
+ type: string;
785
+ };
786
+ };
787
+ exclude: {
788
+ type: string;
789
+ items: {
790
+ type: string;
791
+ };
792
+ };
793
+ };
794
+ };
795
+ context: {
796
+ type: string;
797
+ };
798
+ };
799
+ };
800
+ })[];
801
+ };
646
802
  };
647
803
  })[];
648
804
  };
@@ -36,14 +36,14 @@ const TitleItem = (props) => {
36
36
  } }), custom && ((0, jsx_runtime_1.jsxs)(React.Fragment, { children: ["\u00A0", (0, jsx_runtime_1.jsx)("span", { className: b('custom'), children: custom })] }))] }));
37
37
  let content;
38
38
  const insideClickableContent = ((0, jsx_runtime_1.jsxs)("span", { className: b('wrapper'), children: [textMarkup, "\u00A0", (0, jsx_runtime_1.jsx)(__1.ToggleArrow, { className: b('arrow', { size: textSize }), size: getArrowSize(textSize, isMobile), type: 'horizontal', iconType: "navigation", open: false })] }));
39
- const handleClick = () => {
39
+ const handleClick = React.useCallback(() => {
40
40
  if (analyticsEvents) {
41
41
  handleAnalytics(analyticsEvents);
42
42
  }
43
43
  if (onClick) {
44
44
  onClick();
45
45
  }
46
- };
46
+ }, [analyticsEvents, handleAnalytics, onClick]);
47
47
  if (!url && !onClick) {
48
48
  content = textMarkup;
49
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TitleItem.js","sourceRoot":"../../../../src","sources":["components/Title/TitleItem.tsx"],"names":[],"mappings":";;AAcA,oCAcC;;;AA5BD,qDAA+B;AAE/B,mCAA4C;AAC5C,4EAA8D;AAC9D,wEAA0D;AAC1D,gDAAyC;AAEzC,gDAA8D;AAC9D,yEAAsC;AAItC,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,YAAY,CAAC,CAAC;AAE9B,SAAgB,YAAY,CAAC,IAAc,EAAE,QAAiB;IAC1D,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,IAAI;YACL,OAAO,EAAE,CAAC;QACd,KAAK,GAAG;YACJ,OAAO,EAAE,CAAC;QACd,KAAK,IAAI,CAAC;QACV,KAAK,GAAG;YACJ,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9B,KAAK,GAAG;YACJ,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9B;YACI,OAAO,EAAE,CAAC;IAClB,CAAC;AACL,CAAC;AAQD,MAAM,SAAS,GAAG,CAAC,KAAyB,EAAE,EAAE;IAC5C,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,6BAAa,CAAC,CAA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AAE,CAAC;QACd,CAAC;IACL,CAAC,CAAC;IAEF,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,GAAG,UAAU,CAAC;IACzB,CAAC;SAAM,IAAI,GAAG,EAAE,CAAC;QACb,OAAO,GAAG,CACN,8BACI,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EACpB,IAAI,EAAE,GAAG,KACL,IAAA,oBAAY,EAAC,GAAG,EAAE,QAAQ,CAAC,EAC/B,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,QAAQ,YAEd,sBAAsB,GACvB,CACP,CAAC;IACN,CAAC;SAAM,IAAI,OAAO,EAAE,CAAC;QACjB,OAAO,GAAG,CACN,mCAAQ,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,YAC9D,sBAAsB,GAClB,CACZ,CAAC;IACN,CAAC;IAED,OAAO,CACH,wBAAC,KAAK,CAAC,QAAQ,eACV,MAAM,IAAI,uBAAC,gBAAM,IAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAI,EACxD,KAAK,CAAC,aAAa,CAChB,IAAA,oBAAY,EAAC,QAAQ,CAAC,EACtB;gBACI,SAAS,EAAE,CAAC,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAC,EAAE,SAAS,CAAC;gBAC/E,SAAS,EAAE,GAAG,EAAE,SAAS;aAC5B,EACD,OAAO,CACV,IACY,CACpB,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {ToggleArrow, YFMWrapper} from '../';\nimport {LocationContext} from '../../context/locationContext';\nimport {MobileContext} from '../../context/mobileContext';\nimport {useAnalytics} from '../../hooks';\nimport {AnalyticsEventsBase, QAProps, TextSize, TitleItemProps} from '../../models';\nimport {block, getHeaderTag, getLinkProps} from '../../utils';\nimport Anchor from '../Anchor/Anchor';\n\nimport './TitleItem.scss';\n\nconst b = block('title-item');\n\nexport function getArrowSize(size: TextSize, isMobile: boolean) {\n switch (size) {\n case 'xs':\n return 13;\n case 's':\n return 16;\n case 'sm':\n case 'm':\n return isMobile ? 22 : 24;\n case 'l':\n return isMobile ? 26 : 38;\n default:\n return 20;\n }\n}\n\nexport interface TitleItemFullProps extends TitleItemProps, QAProps, AnalyticsEventsBase {\n className?: string;\n onClick?: () => void;\n resetMargin?: boolean;\n}\n\nconst TitleItem = (props: TitleItemFullProps) => {\n const isMobile = React.useContext(MobileContext);\n\n const {\n textSize = 'm',\n text,\n anchor,\n justify,\n url,\n onClick,\n custom,\n className,\n qa,\n resetMargin = true,\n urlTitle,\n analyticsEvents,\n } = props;\n\n const handleAnalytics = useAnalytics();\n\n const {hostname} = React.useContext(LocationContext);\n const textMarkup = (\n <React.Fragment>\n <YFMWrapper\n className={b('text')}\n contentClassName={b('text')}\n content={text}\n modifiers={{\n constructor: true,\n }}\n />\n {custom && (\n <React.Fragment>\n &nbsp;\n <span className={b('custom')}>{custom}</span>\n </React.Fragment>\n )}\n </React.Fragment>\n );\n let content: React.ReactNode;\n\n const insideClickableContent = (\n <span className={b('wrapper')}>\n {textMarkup}\n &nbsp;\n <ToggleArrow\n className={b('arrow', {size: textSize})}\n size={getArrowSize(textSize, isMobile)}\n type={'horizontal'}\n iconType=\"navigation\"\n open={false}\n />\n </span>\n );\n\n const handleClick = () => {\n if (analyticsEvents) {\n handleAnalytics(analyticsEvents);\n }\n\n if (onClick) {\n onClick();\n }\n };\n\n if (!url && !onClick) {\n content = textMarkup;\n } else if (url) {\n content = (\n <a\n className={b('link')}\n href={url}\n {...getLinkProps(url, hostname)}\n onClick={handleClick}\n title={urlTitle}\n >\n {insideClickableContent}\n </a>\n );\n } else if (onClick) {\n content = (\n <button className={b('link')} onClick={handleClick} title={urlTitle}>\n {insideClickableContent}\n </button>\n );\n }\n\n return (\n <React.Fragment>\n {anchor && <Anchor id={anchor} className={b('anchor')} />}\n {React.createElement(\n getHeaderTag(textSize),\n {\n className: b({size: textSize, justify, 'reset-margin': resetMargin}, className),\n 'data-qa': `${qa}-header`,\n },\n content,\n )}\n </React.Fragment>\n );\n};\n\nexport default TitleItem;\n"]}
1
+ {"version":3,"file":"TitleItem.js","sourceRoot":"../../../../src","sources":["components/Title/TitleItem.tsx"],"names":[],"mappings":";;AAcA,oCAcC;;;AA5BD,qDAA+B;AAE/B,mCAA4C;AAC5C,4EAA8D;AAC9D,wEAA0D;AAC1D,gDAAyC;AAEzC,gDAA8D;AAC9D,yEAAsC;AAItC,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,YAAY,CAAC,CAAC;AAE9B,SAAgB,YAAY,CAAC,IAAc,EAAE,QAAiB;IAC1D,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,IAAI;YACL,OAAO,EAAE,CAAC;QACd,KAAK,GAAG;YACJ,OAAO,EAAE,CAAC;QACd,KAAK,IAAI,CAAC;QACV,KAAK,GAAG;YACJ,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9B,KAAK,GAAG;YACJ,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9B;YACI,OAAO,EAAE,CAAC;IAClB,CAAC;AACL,CAAC;AAQD,MAAM,SAAS,GAAG,CAAC,KAAyB,EAAE,EAAE;IAC5C,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,6BAAa,CAAC,CAAC;IAEjD,MAAM,EACF,QAAQ,GAAG,GAAG,EACd,IAAI,EACJ,MAAM,EACN,OAAO,EACP,GAAG,EACH,OAAO,EACP,MAAM,EACN,SAAS,EACT,EAAE,EACF,WAAW,GAAG,IAAI,EAClB,QAAQ,EACR,eAAe,GAClB,GAAG,KAAK,CAAC;IAEV,MAAM,eAAe,GAAG,IAAA,oBAAY,G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,CAAC;QACb,OAAO,GAAG,CACN,8BACI,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EACpB,IAAI,EAAE,GAAG,KACL,IAAA,oBAAY,EAAC,GAAG,EAAE,QAAQ,CAAC,EAC/B,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,QAAQ,YAEd,sBAAsB,GACvB,CACP,CAAC;IACN,CAAC;SAAM,IAAI,OAAO,EAAE,CAAC;QACjB,OAAO,GAAG,CACN,mCAAQ,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,YAC9D,sBAAsB,GAClB,CACZ,CAAC;IACN,CAAC;IAED,OAAO,CACH,wBAAC,KAAK,CAAC,QAAQ,eACV,MAAM,IAAI,uBAAC,gBAAM,IAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAI,EACxD,KAAK,CAAC,aAAa,CAChB,IAAA,oBAAY,EAAC,QAAQ,CAAC,EACtB;gBACI,SAAS,EAAE,CAAC,CAAC,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAC,EAAE,SAAS,CAAC;gBAC/E,SAAS,EAAE,GAAG,EAAE,SAAS;aAC5B,EACD,OAAO,CACV,IACY,CACpB,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {ToggleArrow, YFMWrapper} from '../';\nimport {LocationContext} from '../../context/locationContext';\nimport {MobileContext} from '../../context/mobileContext';\nimport {useAnalytics} from '../../hooks';\nimport {AnalyticsEventsBase, QAProps, TextSize, TitleItemProps} from '../../models';\nimport {block, getHeaderTag, getLinkProps} from '../../utils';\nimport Anchor from '../Anchor/Anchor';\n\nimport './TitleItem.scss';\n\nconst b = block('title-item');\n\nexport function getArrowSize(size: TextSize, isMobile: boolean) {\n switch (size) {\n case 'xs':\n return 13;\n case 's':\n return 16;\n case 'sm':\n case 'm':\n return isMobile ? 22 : 24;\n case 'l':\n return isMobile ? 26 : 38;\n default:\n return 20;\n }\n}\n\nexport interface TitleItemFullProps extends TitleItemProps, QAProps, AnalyticsEventsBase {\n className?: string;\n onClick?: () => void;\n resetMargin?: boolean;\n}\n\nconst TitleItem = (props: TitleItemFullProps) => {\n const isMobile = React.useContext(MobileContext);\n\n const {\n textSize = 'm',\n text,\n anchor,\n justify,\n url,\n onClick,\n custom,\n className,\n qa,\n resetMargin = true,\n urlTitle,\n analyticsEvents,\n } = props;\n\n const handleAnalytics = useAnalytics();\n\n const {hostname} = React.useContext(LocationContext);\n const textMarkup = (\n <React.Fragment>\n <YFMWrapper\n className={b('text')}\n contentClassName={b('text')}\n content={text}\n modifiers={{\n constructor: true,\n }}\n />\n {custom && (\n <React.Fragment>\n &nbsp;\n <span className={b('custom')}>{custom}</span>\n </React.Fragment>\n )}\n </React.Fragment>\n );\n let content: React.ReactNode;\n\n const insideClickableContent = (\n <span className={b('wrapper')}>\n {textMarkup}\n &nbsp;\n <ToggleArrow\n className={b('arrow', {size: textSize})}\n size={getArrowSize(textSize, isMobile)}\n type={'horizontal'}\n iconType=\"navigation\"\n open={false}\n />\n </span>\n );\n\n const handleClick = React.useCallback(() => {\n if (analyticsEvents) {\n handleAnalytics(analyticsEvents);\n }\n\n if (onClick) {\n onClick();\n }\n }, [analyticsEvents, handleAnalytics, onClick]);\n\n if (!url && !onClick) {\n content = textMarkup;\n } else if (url) {\n content = (\n <a\n className={b('link')}\n href={url}\n {...getLinkProps(url, hostname)}\n onClick={handleClick}\n title={urlTitle}\n >\n {insideClickableContent}\n </a>\n );\n } else if (onClick) {\n content = (\n <button className={b('link')} onClick={handleClick} title={urlTitle}>\n {insideClickableContent}\n </button>\n );\n }\n\n return (\n <React.Fragment>\n {anchor && <Anchor id={anchor} className={b('anchor')} />}\n {React.createElement(\n getHeaderTag(textSize),\n {\n className: b({size: textSize, justify, 'reset-margin': resetMargin}, className),\n 'data-qa': `${qa}-header`,\n },\n content,\n )}\n </React.Fragment>\n );\n};\n\nexport default TitleItem;\n"]}
@@ -77,6 +77,84 @@ export declare const cardSchemas: {
77
77
  resetMargin: {
78
78
  type: string;
79
79
  };
80
+ analyticsEvents: {
81
+ anyOf: ({
82
+ type: string;
83
+ additionalProperties: {
84
+ type: string;
85
+ };
86
+ required: string[];
87
+ properties: {
88
+ name: {
89
+ type: string;
90
+ };
91
+ type: {
92
+ type: string;
93
+ };
94
+ counters: {
95
+ type: string;
96
+ additionalProperties: boolean;
97
+ required: never[];
98
+ properties: {
99
+ include: {
100
+ type: string;
101
+ items: {
102
+ type: string;
103
+ };
104
+ };
105
+ exclude: {
106
+ type: string;
107
+ items: {
108
+ type: string;
109
+ };
110
+ };
111
+ };
112
+ };
113
+ context: {
114
+ type: string;
115
+ };
116
+ };
117
+ } | {
118
+ type: string;
119
+ items: {
120
+ type: string;
121
+ additionalProperties: {
122
+ type: string;
123
+ };
124
+ required: string[];
125
+ properties: {
126
+ name: {
127
+ type: string;
128
+ };
129
+ type: {
130
+ type: string;
131
+ };
132
+ counters: {
133
+ type: string;
134
+ additionalProperties: boolean;
135
+ required: never[];
136
+ properties: {
137
+ include: {
138
+ type: string;
139
+ items: {
140
+ type: string;
141
+ };
142
+ };
143
+ exclude: {
144
+ type: string;
145
+ items: {
146
+ type: string;
147
+ };
148
+ };
149
+ };
150
+ };
151
+ context: {
152
+ type: string;
153
+ };
154
+ };
155
+ };
156
+ })[];
157
+ };
80
158
  };
81
159
  contentType?: undefined;
82
160
  })[];
@@ -582,6 +660,84 @@ export declare const cardSchemas: {
582
660
  resetMargin: {
583
661
  type: string;
584
662
  };
663
+ analyticsEvents: {
664
+ anyOf: ({
665
+ type: string;
666
+ additionalProperties: {
667
+ type: string;
668
+ };
669
+ required: string[];
670
+ properties: {
671
+ name: {
672
+ type: string;
673
+ };
674
+ type: {
675
+ type: string;
676
+ };
677
+ counters: {
678
+ type: string;
679
+ additionalProperties: boolean;
680
+ required: never[];
681
+ properties: {
682
+ include: {
683
+ type: string;
684
+ items: {
685
+ type: string;
686
+ };
687
+ };
688
+ exclude: {
689
+ type: string;
690
+ items: {
691
+ type: string;
692
+ };
693
+ };
694
+ };
695
+ };
696
+ context: {
697
+ type: string;
698
+ };
699
+ };
700
+ } | {
701
+ type: string;
702
+ items: {
703
+ type: string;
704
+ additionalProperties: {
705
+ type: string;
706
+ };
707
+ required: string[];
708
+ properties: {
709
+ name: {
710
+ type: string;
711
+ };
712
+ type: {
713
+ type: string;
714
+ };
715
+ counters: {
716
+ type: string;
717
+ additionalProperties: boolean;
718
+ required: never[];
719
+ properties: {
720
+ include: {
721
+ type: string;
722
+ items: {
723
+ type: string;
724
+ };
725
+ };
726
+ exclude: {
727
+ type: string;
728
+ items: {
729
+ type: string;
730
+ };
731
+ };
732
+ };
733
+ };
734
+ context: {
735
+ type: string;
736
+ };
737
+ };
738
+ };
739
+ })[];
740
+ };
585
741
  };
586
742
  contentType?: undefined;
587
743
  })[];
@@ -1005,6 +1161,84 @@ export declare const cardSchemas: {
1005
1161
  resetMargin: {
1006
1162
  type: string;
1007
1163
  };
1164
+ analyticsEvents: {
1165
+ anyOf: ({
1166
+ type: string;
1167
+ additionalProperties: {
1168
+ type: string;
1169
+ };
1170
+ required: string[];
1171
+ properties: {
1172
+ name: {
1173
+ type: string;
1174
+ };
1175
+ type: {
1176
+ type: string;
1177
+ };
1178
+ counters: {
1179
+ type: string;
1180
+ additionalProperties: boolean;
1181
+ required: never[];
1182
+ properties: {
1183
+ include: {
1184
+ type: string;
1185
+ items: {
1186
+ type: string;
1187
+ };
1188
+ };
1189
+ exclude: {
1190
+ type: string;
1191
+ items: {
1192
+ type: string;
1193
+ };
1194
+ };
1195
+ };
1196
+ };
1197
+ context: {
1198
+ type: string;
1199
+ };
1200
+ };
1201
+ } | {
1202
+ type: string;
1203
+ items: {
1204
+ type: string;
1205
+ additionalProperties: {
1206
+ type: string;
1207
+ };
1208
+ required: string[];
1209
+ properties: {
1210
+ name: {
1211
+ type: string;
1212
+ };
1213
+ type: {
1214
+ type: string;
1215
+ };
1216
+ counters: {
1217
+ type: string;
1218
+ additionalProperties: boolean;
1219
+ required: never[];
1220
+ properties: {
1221
+ include: {
1222
+ type: string;
1223
+ items: {
1224
+ type: string;
1225
+ };
1226
+ };
1227
+ exclude: {
1228
+ type: string;
1229
+ items: {
1230
+ type: string;
1231
+ };
1232
+ };
1233
+ };
1234
+ };
1235
+ context: {
1236
+ type: string;
1237
+ };
1238
+ };
1239
+ };
1240
+ })[];
1241
+ };
1008
1242
  };
1009
1243
  contentType?: undefined;
1010
1244
  })[];