@gravity-ui/page-constructor 2.3.2-alpha.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/build/cjs/blocks/Header/schema.d.ts +0 -390
  3. package/build/cjs/blocks/HeaderSlider/schema.d.ts +0 -156
  4. package/build/cjs/blocks/Media/schema.d.ts +0 -156
  5. package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +0 -78
  6. package/build/cjs/blocks/Security/schema.d.ts +0 -78
  7. package/build/cjs/blocks/Tabs/schema.d.ts +0 -78
  8. package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +7 -3
  9. package/build/cjs/containers/PageConstructor/components/ConstructorFootnotes/ConstructorFootnotes.d.ts +5 -0
  10. package/build/cjs/containers/PageConstructor/components/ConstructorFootnotes/ConstructorFootnotes.js +5 -0
  11. package/build/cjs/index.d.ts +1 -0
  12. package/build/cjs/index.js +1 -0
  13. package/build/cjs/models/common.d.ts +2 -1
  14. package/build/cjs/models/common.js +1 -0
  15. package/build/cjs/schema/index.d.ts +0 -78
  16. package/build/cjs/schema/validators/common.d.ts +0 -234
  17. package/build/cjs/schema/validators/common.js +2 -5
  18. package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +0 -78
  19. package/build/cjs/sub-blocks/MediaCard/schema.d.ts +0 -78
  20. package/build/esm/blocks/Header/schema.d.ts +0 -390
  21. package/build/esm/blocks/HeaderSlider/schema.d.ts +0 -156
  22. package/build/esm/blocks/Media/schema.d.ts +0 -156
  23. package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +0 -78
  24. package/build/esm/blocks/Security/schema.d.ts +0 -78
  25. package/build/esm/blocks/Tabs/schema.d.ts +0 -78
  26. package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +7 -3
  27. package/build/esm/containers/PageConstructor/components/ConstructorFootnotes/ConstructorFootnotes.d.ts +5 -0
  28. package/build/esm/containers/PageConstructor/components/ConstructorFootnotes/ConstructorFootnotes.js +5 -0
  29. package/build/esm/index.d.ts +1 -0
  30. package/build/esm/index.js +1 -0
  31. package/build/esm/models/common.d.ts +2 -1
  32. package/build/esm/models/common.js +1 -0
  33. package/build/esm/schema/index.d.ts +0 -78
  34. package/build/esm/schema/validators/common.d.ts +0 -234
  35. package/build/esm/schema/validators/common.js +2 -5
  36. package/build/esm/sub-blocks/LayoutItem/schema.d.ts +0 -78
  37. package/build/esm/sub-blocks/MediaCard/schema.d.ts +0 -78
  38. package/package.json +1 -4
  39. package/server/models/common.d.ts +2 -1
  40. package/server/models/common.js +1 -0
@@ -99,84 +99,6 @@ export declare const Media: {
99
99
  type: string;
100
100
  enum: string[];
101
101
  };
102
- analyticsEvents: {
103
- anyOf: ({
104
- type: string;
105
- additionalProperties: {
106
- type: string;
107
- };
108
- required: string[];
109
- properties: {
110
- name: {
111
- type: string;
112
- };
113
- type: {
114
- type: string;
115
- };
116
- counters: {
117
- type: string;
118
- additionalProperties: boolean;
119
- required: never[];
120
- properties: {
121
- include: {
122
- type: string;
123
- items: {
124
- type: string;
125
- };
126
- };
127
- exclude: {
128
- type: string;
129
- items: {
130
- type: string;
131
- };
132
- };
133
- };
134
- };
135
- context: {
136
- type: string;
137
- };
138
- };
139
- } | {
140
- type: string;
141
- items: {
142
- type: string;
143
- additionalProperties: {
144
- type: string;
145
- };
146
- required: string[];
147
- properties: {
148
- name: {
149
- type: string;
150
- };
151
- type: {
152
- type: string;
153
- };
154
- counters: {
155
- type: string;
156
- additionalProperties: boolean;
157
- required: never[];
158
- properties: {
159
- include: {
160
- type: string;
161
- items: {
162
- type: string;
163
- };
164
- };
165
- exclude: {
166
- type: string;
167
- items: {
168
- type: string;
169
- };
170
- };
171
- };
172
- };
173
- context: {
174
- type: string;
175
- };
176
- };
177
- };
178
- })[];
179
- };
180
102
  };
181
103
  };
182
104
  youtube: {
@@ -654,84 +576,6 @@ export declare const MediaBlock: {
654
576
  type: string;
655
577
  enum: string[];
656
578
  };
657
- analyticsEvents: {
658
- anyOf: ({
659
- type: string;
660
- additionalProperties: {
661
- type: string;
662
- };
663
- required: string[];
664
- properties: {
665
- name: {
666
- type: string;
667
- };
668
- type: {
669
- type: string;
670
- };
671
- counters: {
672
- type: string;
673
- additionalProperties: boolean;
674
- required: never[];
675
- properties: {
676
- include: {
677
- type: string;
678
- items: {
679
- type: string;
680
- };
681
- };
682
- exclude: {
683
- type: string;
684
- items: {
685
- type: string;
686
- };
687
- };
688
- };
689
- };
690
- context: {
691
- type: string;
692
- };
693
- };
694
- } | {
695
- type: string;
696
- items: {
697
- type: string;
698
- additionalProperties: {
699
- type: string;
700
- };
701
- required: string[];
702
- properties: {
703
- name: {
704
- type: string;
705
- };
706
- type: {
707
- type: string;
708
- };
709
- counters: {
710
- type: string;
711
- additionalProperties: boolean;
712
- required: never[];
713
- properties: {
714
- include: {
715
- type: string;
716
- items: {
717
- type: string;
718
- };
719
- };
720
- exclude: {
721
- type: string;
722
- items: {
723
- type: string;
724
- };
725
- };
726
- };
727
- };
728
- context: {
729
- type: string;
730
- };
731
- };
732
- };
733
- })[];
734
- };
735
579
  };
736
580
  };
737
581
  youtube: {
@@ -114,84 +114,6 @@ export declare const PromoFeaturesItem: {
114
114
  type: string;
115
115
  enum: string[];
116
116
  };
117
- analyticsEvents: {
118
- anyOf: ({
119
- type: string;
120
- additionalProperties: {
121
- type: string;
122
- };
123
- required: string[];
124
- properties: {
125
- name: {
126
- type: string;
127
- };
128
- type: {
129
- type: string;
130
- };
131
- counters: {
132
- type: string;
133
- additionalProperties: boolean;
134
- required: never[];
135
- properties: {
136
- include: {
137
- type: string;
138
- items: {
139
- type: string;
140
- };
141
- };
142
- exclude: {
143
- type: string;
144
- items: {
145
- type: string;
146
- };
147
- };
148
- };
149
- };
150
- context: {
151
- type: string;
152
- };
153
- };
154
- } | {
155
- type: string;
156
- items: {
157
- type: string;
158
- additionalProperties: {
159
- type: string;
160
- };
161
- required: string[];
162
- properties: {
163
- name: {
164
- type: string;
165
- };
166
- type: {
167
- type: string;
168
- };
169
- counters: {
170
- type: string;
171
- additionalProperties: boolean;
172
- required: never[];
173
- properties: {
174
- include: {
175
- type: string;
176
- items: {
177
- type: string;
178
- };
179
- };
180
- exclude: {
181
- type: string;
182
- items: {
183
- type: string;
184
- };
185
- };
186
- };
187
- };
188
- context: {
189
- type: string;
190
- };
191
- };
192
- };
193
- })[];
194
- };
195
117
  };
196
118
  };
197
119
  youtube: {
@@ -115,84 +115,6 @@ export declare const SecurityBlock: {
115
115
  type: string;
116
116
  enum: string[];
117
117
  };
118
- analyticsEvents: {
119
- anyOf: ({
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
- type: string;
157
- items: {
158
- type: string;
159
- additionalProperties: {
160
- type: string;
161
- };
162
- required: string[];
163
- properties: {
164
- name: {
165
- type: string;
166
- };
167
- type: {
168
- type: string;
169
- };
170
- counters: {
171
- type: string;
172
- additionalProperties: boolean;
173
- required: never[];
174
- properties: {
175
- include: {
176
- type: string;
177
- items: {
178
- type: string;
179
- };
180
- };
181
- exclude: {
182
- type: string;
183
- items: {
184
- type: string;
185
- };
186
- };
187
- };
188
- };
189
- context: {
190
- type: string;
191
- };
192
- };
193
- };
194
- })[];
195
- };
196
118
  };
197
119
  };
198
120
  youtube: {
@@ -110,84 +110,6 @@ export declare const tabsItem: {
110
110
  type: string;
111
111
  enum: string[];
112
112
  };
113
- analyticsEvents: {
114
- anyOf: ({
115
- type: string;
116
- additionalProperties: {
117
- type: string;
118
- };
119
- required: string[];
120
- properties: {
121
- name: {
122
- type: string;
123
- };
124
- type: {
125
- type: string;
126
- };
127
- counters: {
128
- type: string;
129
- additionalProperties: boolean;
130
- required: never[];
131
- properties: {
132
- include: {
133
- type: string;
134
- items: {
135
- type: string;
136
- };
137
- };
138
- exclude: {
139
- type: string;
140
- items: {
141
- type: string;
142
- };
143
- };
144
- };
145
- };
146
- context: {
147
- type: string;
148
- };
149
- };
150
- } | {
151
- type: string;
152
- items: {
153
- type: string;
154
- additionalProperties: {
155
- type: string;
156
- };
157
- required: string[];
158
- properties: {
159
- name: {
160
- type: string;
161
- };
162
- type: {
163
- type: string;
164
- };
165
- counters: {
166
- type: string;
167
- additionalProperties: boolean;
168
- required: never[];
169
- properties: {
170
- include: {
171
- type: string;
172
- items: {
173
- type: string;
174
- };
175
- };
176
- exclude: {
177
- type: string;
178
- items: {
179
- type: string;
180
- };
181
- };
182
- };
183
- };
184
- context: {
185
- type: string;
186
- };
187
- };
188
- };
189
- })[];
190
- };
191
113
  };
192
114
  };
193
115
  youtube: {
@@ -1,16 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const react_1 = tslib_1.__importDefault(require("react"));
4
+ const react_1 = tslib_1.__importStar(require("react"));
5
5
  const utils_1 = require("../../utils");
6
+ const models_1 = require("../../models");
6
7
  const useMetrika_1 = require("../../hooks/useMetrika");
8
+ const hooks_1 = require("../../hooks");
7
9
  const b = (0, utils_1.block)('header-breadcrumbs');
8
10
  function HeaderBreadcrumbs(props) {
9
11
  const { items, metrikaGoals, pixelEvents, theme = 'light', className } = props;
10
12
  const handleMetrika = (0, useMetrika_1.useMetrika)();
11
- const onClick = () => {
13
+ const handleAnalytics = (0, hooks_1.useAnalytics)(models_1.DefaultEventNames.Breadcrumb);
14
+ const onClick = (0, react_1.useCallback)(() => {
15
+ handleAnalytics();
12
16
  handleMetrika({ metrikaGoals, pixelEvents });
13
- };
17
+ }, [handleAnalytics, handleMetrika, metrikaGoals, pixelEvents]);
14
18
  return (react_1.default.createElement("div", { className: b({ theme }, className) }, items.map((item) => (react_1.default.createElement("div", { className: b('item'), key: item.url },
15
19
  react_1.default.createElement("a", { href: item.url, className: b('text'), onClick: onClick }, item.text))))));
16
20
  }
@@ -1,3 +1,8 @@
1
+ /**
2
+ * @deprecated use Content block instead
3
+ *
4
+ * @return - JSX
5
+ */
1
6
  export declare const ConstructorFootnotes: ({ items }: {
2
7
  items: string[];
3
8
  }) => JSX.Element;
@@ -6,6 +6,11 @@ const react_1 = tslib_1.__importDefault(require("react"));
6
6
  const components_1 = require("../../../../components");
7
7
  const utils_1 = require("../../../../utils");
8
8
  const b = (0, utils_1.block)('constructor-footnotes');
9
+ /**
10
+ * @deprecated use Content block instead
11
+ *
12
+ * @return - JSX
13
+ */
9
14
  const ConstructorFootnotes = ({ items }) => (react_1.default.createElement("ol", { className: b() }, items.map((footnote, index) => (react_1.default.createElement("li", { className: b('item'), key: index },
10
15
  react_1.default.createElement(components_1.YFMWrapper, { content: footnote, modifiers: {
11
16
  constructor: true,
@@ -1,4 +1,5 @@
1
1
  export * from './context/theme';
2
+ export * from './context/analyticsContext';
2
3
  export * from './containers/PageConstructor';
3
4
  export * from './grid';
4
5
  export * from './blocks';
@@ -4,6 +4,7 @@ exports.BREAKPOINTS = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  //storybook
6
6
  tslib_1.__exportStar(require("./context/theme"), exports);
7
+ tslib_1.__exportStar(require("./context/analyticsContext"), exports);
7
8
  tslib_1.__exportStar(require("./containers/PageConstructor"), exports);
8
9
  tslib_1.__exportStar(require("./grid"), exports);
9
10
  tslib_1.__exportStar(require("./blocks"), exports);
@@ -78,7 +78,8 @@ export declare enum DefaultEventNames {
78
78
  YandexFormSubmit = "yandex-form-submit",
79
79
  HubspotFormSubmit = "hubspot-form-submit",
80
80
  QuoteButton = "quote-button-click",
81
- BackLink = "back-link-click"
81
+ BackLink = "back-link-click",
82
+ Breadcrumb = "breadcrumb-click"
82
83
  }
83
84
  export type AnalyticsCounters = {
84
85
  include?: string[];
@@ -47,4 +47,5 @@ var DefaultEventNames;
47
47
  DefaultEventNames["HubspotFormSubmit"] = "hubspot-form-submit";
48
48
  DefaultEventNames["QuoteButton"] = "quote-button-click";
49
49
  DefaultEventNames["BackLink"] = "back-link-click";
50
+ DefaultEventNames["Breadcrumb"] = "breadcrumb-click";
50
51
  })(DefaultEventNames = exports.DefaultEventNames || (exports.DefaultEventNames = {}));
@@ -197,84 +197,6 @@ export declare function generateDefaultSchema(config?: SchemaCustomConfig): {
197
197
  type: string;
198
198
  enum: string[];
199
199
  };
200
- analyticsEvents: {
201
- anyOf: ({
202
- type: string;
203
- additionalProperties: {
204
- type: string;
205
- };
206
- required: string[];
207
- properties: {
208
- name: {
209
- type: string;
210
- };
211
- type: {
212
- type: string;
213
- };
214
- counters: {
215
- type: string;
216
- additionalProperties: boolean;
217
- required: never[];
218
- properties: {
219
- include: {
220
- type: string;
221
- items: {
222
- type: string;
223
- };
224
- };
225
- exclude: {
226
- type: string;
227
- items: {
228
- type: string;
229
- };
230
- };
231
- };
232
- };
233
- context: {
234
- type: string;
235
- };
236
- };
237
- } | {
238
- type: string;
239
- items: {
240
- type: string;
241
- additionalProperties: {
242
- type: string;
243
- };
244
- required: string[];
245
- properties: {
246
- name: {
247
- type: string;
248
- };
249
- type: {
250
- type: string;
251
- };
252
- counters: {
253
- type: string;
254
- additionalProperties: boolean;
255
- required: never[];
256
- properties: {
257
- include: {
258
- type: string;
259
- items: {
260
- type: string;
261
- };
262
- };
263
- exclude: {
264
- type: string;
265
- items: {
266
- type: string;
267
- };
268
- };
269
- };
270
- };
271
- context: {
272
- type: string;
273
- };
274
- };
275
- };
276
- })[];
277
- };
278
200
  };
279
201
  };
280
202
  height: {