@gravity-ui/page-constructor 8.2.0-alpha.0 → 8.2.1-alpha.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 (59) 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/Header/Header.css +3 -3
  8. package/build/cjs/blocks/Header/Header.js +4 -1
  9. package/build/cjs/blocks/Header/Header.js.map +1 -1
  10. package/build/cjs/blocks/Info/schema.d.ts +156 -0
  11. package/build/cjs/blocks/Map/schema.d.ts +78 -0
  12. package/build/cjs/blocks/Media/schema.d.ts +156 -0
  13. package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +78 -0
  14. package/build/cjs/blocks/Questions/schema.d.ts +78 -0
  15. package/build/cjs/blocks/Slider/schema.d.ts +78 -0
  16. package/build/cjs/blocks/SliderOld/schema.d.ts +78 -0
  17. package/build/cjs/blocks/Tabs/schema.d.ts +156 -0
  18. package/build/cjs/components/Title/TitleItem.js +2 -2
  19. package/build/cjs/components/Title/TitleItem.js.map +1 -1
  20. package/build/cjs/schema/constants.d.ts +234 -0
  21. package/build/cjs/schema/validators/common.d.ts +156 -0
  22. package/build/cjs/schema/validators/common.js +3 -0
  23. package/build/cjs/schema/validators/common.js.map +1 -1
  24. package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +78 -0
  25. package/build/cjs/sub-blocks/BasicCard/schema.d.ts +78 -0
  26. package/build/cjs/sub-blocks/Content/schema.d.ts +156 -0
  27. package/build/cjs/sub-blocks/ImageCard/schema.d.ts +78 -0
  28. package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +78 -0
  29. package/build/esm/blocks/CardLayout/schema.d.ts +156 -0
  30. package/build/esm/blocks/ContentLayout/schema.d.ts +78 -0
  31. package/build/esm/blocks/ExtendedFeatures/schema.d.ts +78 -0
  32. package/build/esm/blocks/FilterBlock/schema.d.ts +156 -0
  33. package/build/esm/blocks/FoldableList/schema.d.ts +78 -0
  34. package/build/esm/blocks/Form/schema.d.ts +78 -0
  35. package/build/esm/blocks/Header/Header.css +3 -3
  36. package/build/esm/blocks/Header/Header.js +4 -1
  37. package/build/esm/blocks/Header/Header.js.map +1 -1
  38. package/build/esm/blocks/Info/schema.d.ts +156 -0
  39. package/build/esm/blocks/Map/schema.d.ts +78 -0
  40. package/build/esm/blocks/Media/schema.d.ts +156 -0
  41. package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +78 -0
  42. package/build/esm/blocks/Questions/schema.d.ts +78 -0
  43. package/build/esm/blocks/Slider/schema.d.ts +78 -0
  44. package/build/esm/blocks/SliderOld/schema.d.ts +78 -0
  45. package/build/esm/blocks/Tabs/schema.d.ts +156 -0
  46. package/build/esm/components/Title/TitleItem.js +2 -2
  47. package/build/esm/components/Title/TitleItem.js.map +1 -1
  48. package/build/esm/schema/constants.d.ts +234 -0
  49. package/build/esm/schema/validators/common.d.ts +156 -0
  50. package/build/esm/schema/validators/common.js +3 -0
  51. package/build/esm/schema/validators/common.js.map +1 -1
  52. package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +78 -0
  53. package/build/esm/sub-blocks/BasicCard/schema.d.ts +78 -0
  54. package/build/esm/sub-blocks/Content/schema.d.ts +156 -0
  55. package/build/esm/sub-blocks/ImageCard/schema.d.ts +78 -0
  56. package/build/esm/sub-blocks/LayoutItem/schema.d.ts +78 -0
  57. package/package.json +1 -1
  58. package/schema/index.js +1 -1
  59. package/widget/index.js +1 -1
@@ -42,6 +42,84 @@ export declare const QuestionsBlock: {
42
42
  resetMargin: {
43
43
  type: string;
44
44
  };
45
+ analyticsEvents: {
46
+ anyOf: ({
47
+ type: string;
48
+ additionalProperties: {
49
+ type: string;
50
+ };
51
+ required: string[];
52
+ properties: {
53
+ name: {
54
+ type: string;
55
+ };
56
+ type: {
57
+ type: string;
58
+ };
59
+ counters: {
60
+ type: string;
61
+ additionalProperties: boolean;
62
+ required: never[];
63
+ properties: {
64
+ include: {
65
+ type: string;
66
+ items: {
67
+ type: string;
68
+ };
69
+ };
70
+ exclude: {
71
+ type: string;
72
+ items: {
73
+ type: string;
74
+ };
75
+ };
76
+ };
77
+ };
78
+ context: {
79
+ type: string;
80
+ };
81
+ };
82
+ } | {
83
+ type: string;
84
+ items: {
85
+ type: string;
86
+ additionalProperties: {
87
+ type: string;
88
+ };
89
+ required: string[];
90
+ properties: {
91
+ name: {
92
+ type: string;
93
+ };
94
+ type: {
95
+ type: string;
96
+ };
97
+ counters: {
98
+ type: string;
99
+ additionalProperties: boolean;
100
+ required: never[];
101
+ properties: {
102
+ include: {
103
+ type: string;
104
+ items: {
105
+ type: string;
106
+ };
107
+ };
108
+ exclude: {
109
+ type: string;
110
+ items: {
111
+ type: string;
112
+ };
113
+ };
114
+ };
115
+ };
116
+ context: {
117
+ type: string;
118
+ };
119
+ };
120
+ };
121
+ })[];
122
+ };
45
123
  };
46
124
  contentType?: undefined;
47
125
  })[];
@@ -124,6 +124,84 @@ export declare const SliderBlock: {
124
124
  resetMargin: {
125
125
  type: string;
126
126
  };
127
+ analyticsEvents: {
128
+ anyOf: ({
129
+ type: string;
130
+ additionalProperties: {
131
+ type: string;
132
+ };
133
+ required: string[];
134
+ properties: {
135
+ name: {
136
+ type: string;
137
+ };
138
+ type: {
139
+ type: string;
140
+ };
141
+ counters: {
142
+ type: string;
143
+ additionalProperties: boolean;
144
+ required: never[];
145
+ properties: {
146
+ include: {
147
+ type: string;
148
+ items: {
149
+ type: string;
150
+ };
151
+ };
152
+ exclude: {
153
+ type: string;
154
+ items: {
155
+ type: string;
156
+ };
157
+ };
158
+ };
159
+ };
160
+ context: {
161
+ type: string;
162
+ };
163
+ };
164
+ } | {
165
+ type: string;
166
+ items: {
167
+ type: string;
168
+ additionalProperties: {
169
+ type: string;
170
+ };
171
+ required: string[];
172
+ properties: {
173
+ name: {
174
+ type: string;
175
+ };
176
+ type: {
177
+ type: string;
178
+ };
179
+ counters: {
180
+ type: string;
181
+ additionalProperties: boolean;
182
+ required: never[];
183
+ properties: {
184
+ include: {
185
+ type: string;
186
+ items: {
187
+ type: string;
188
+ };
189
+ };
190
+ exclude: {
191
+ type: string;
192
+ items: {
193
+ type: string;
194
+ };
195
+ };
196
+ };
197
+ };
198
+ context: {
199
+ type: string;
200
+ };
201
+ };
202
+ };
203
+ })[];
204
+ };
127
205
  };
128
206
  })[];
129
207
  };
@@ -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","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AAS,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,CA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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"]}