@gravity-ui/page-constructor 1.15.0-alpha.2 → 1.15.0-alpha.3

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.
@@ -18,7 +18,7 @@ const Button = (props) => {
18
18
  const defaultImgPosition = 'left';
19
19
  const onClick = (0, react_1.useCallback)(() => {
20
20
  handleMetrika({ metrikaGoals, pixelEvents });
21
- handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents);
21
+ handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents, { type: 'button', block: 'hz' });
22
22
  if (onClickOrigin) {
23
23
  onClickOrigin();
24
24
  }
@@ -1,2 +1,2 @@
1
- import { AnalyticsEvent } from '../models';
2
- export declare const useAnalytics: () => ((e?: AnalyticsEvent | AnalyticsEvent[], defaults?: Record<string, string | boolean | number>) => void) | undefined;
1
+ import { AnalyticsEvent, DefaultEvent } from '../models';
2
+ export declare const useAnalytics: () => ((e?: AnalyticsEvent | AnalyticsEvent[], defaultEvent?: DefaultEvent) => void) | undefined;
@@ -8,11 +8,11 @@ const useAnalytics = () => {
8
8
  if (!sendEvents) {
9
9
  return undefined;
10
10
  }
11
- return (e, defaults) => {
11
+ return (e, defaultEvent) => {
12
12
  if (!e) {
13
13
  return;
14
14
  }
15
- sendEvents(e, defaults);
15
+ sendEvents(e, defaultEvent);
16
16
  };
17
17
  };
18
18
  exports.useAnalytics = useAnalytics;
@@ -77,4 +77,5 @@ export type AnalyticsEvent<T = {}> = T & {
77
77
  type?: string;
78
78
  counters?: AnalyticsCounters;
79
79
  };
80
+ export type DefaultEvent = Record<string, string | boolean | number>;
80
81
  export {};
@@ -17,7 +17,7 @@ const Button = (props) => {
17
17
  const defaultImgPosition = 'left';
18
18
  const onClick = useCallback(() => {
19
19
  handleMetrika({ metrikaGoals, pixelEvents });
20
- handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents);
20
+ handleAnalytics === null || handleAnalytics === void 0 ? void 0 : handleAnalytics(analyticsEvents, { type: 'button', block: 'hz' });
21
21
  if (onClickOrigin) {
22
22
  onClickOrigin();
23
23
  }
@@ -1,2 +1,2 @@
1
- import { AnalyticsEvent } from '../models';
2
- export declare const useAnalytics: () => ((e?: AnalyticsEvent | AnalyticsEvent[], defaults?: Record<string, string | boolean | number>) => void) | undefined;
1
+ import { AnalyticsEvent, DefaultEvent } from '../models';
2
+ export declare const useAnalytics: () => ((e?: AnalyticsEvent | AnalyticsEvent[], defaultEvent?: DefaultEvent) => void) | undefined;
@@ -5,10 +5,10 @@ export const useAnalytics = () => {
5
5
  if (!sendEvents) {
6
6
  return undefined;
7
7
  }
8
- return (e, defaults) => {
8
+ return (e, defaultEvent) => {
9
9
  if (!e) {
10
10
  return;
11
11
  }
12
- sendEvents(e, defaults);
12
+ sendEvents(e, defaultEvent);
13
13
  };
14
14
  };
@@ -77,4 +77,5 @@ export type AnalyticsEvent<T = {}> = T & {
77
77
  type?: string;
78
78
  counters?: AnalyticsCounters;
79
79
  };
80
+ export type DefaultEvent = Record<string, string | boolean | number>;
80
81
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "1.15.0-alpha.2",
3
+ "version": "1.15.0-alpha.3",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -77,4 +77,5 @@ export type AnalyticsEvent<T = {}> = T & {
77
77
  type?: string;
78
78
  counters?: AnalyticsCounters;
79
79
  };
80
+ export type DefaultEvent = Record<string, string | boolean | number>;
80
81
  export {};