@atlaskit/analytics-next 9.3.0 → 9.3.2
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.
- package/CHANGELOG.md +333 -133
- package/afm-jira/tsconfig.json +25 -0
- package/afm-post-office/tsconfig.json +25 -0
- package/dist/types/components/AnalyticsContext/LegacyAnalyticsContext.d.ts +1 -1
- package/dist/types/components/AnalyticsContext/ModernAnalyticsContext.d.ts +1 -1
- package/dist/types/components/AnalyticsContext/index.d.ts +1 -1
- package/dist/types/components/AnalyticsContext/types.d.ts +1 -1
- package/dist/types/components/AnalyticsErrorBoundary.d.ts +2 -2
- package/dist/types/components/AnalyticsListener/LegacyAnalyticsListener.d.ts +2 -2
- package/dist/types/components/AnalyticsListener/ModernAnalyticsListener.d.ts +1 -1
- package/dist/types/components/AnalyticsListener/index.d.ts +1 -1
- package/dist/types/components/AnalyticsListener/types.d.ts +2 -2
- package/dist/types/events/UIAnalyticsEvent.d.ts +1 -1
- package/dist/types/hocs/withAnalyticsEvents.d.ts +1 -1
- package/dist/types/hooks/useAnalyticsContext.d.ts +1 -1
- package/dist/types/hooks/useAnalyticsEvents.d.ts +1 -1
- package/dist/types/hooks/usePatchedProps.d.ts +1 -1
- package/dist/types/hooks/usePlatformLeafEventHandler.d.ts +1 -1
- package/dist/types/hooks/usePlatformLeafSyntheticEventHandler.d.ts +1 -1
- package/dist/types/hooks/useTrackedRef.d.ts +1 -1
- package/dist/types/index.d.ts +4 -4
- package/dist/types/types.d.ts +2 -2
- package/dist/types/utils/createAndFireEvent.d.ts +2 -2
- package/dist/types-ts4.5/components/AnalyticsContext/LegacyAnalyticsContext.d.ts +1 -1
- package/dist/types-ts4.5/components/AnalyticsContext/ModernAnalyticsContext.d.ts +1 -1
- package/dist/types-ts4.5/components/AnalyticsContext/index.d.ts +1 -1
- package/dist/types-ts4.5/components/AnalyticsContext/types.d.ts +1 -1
- package/dist/types-ts4.5/components/AnalyticsErrorBoundary.d.ts +2 -2
- package/dist/types-ts4.5/components/AnalyticsListener/LegacyAnalyticsListener.d.ts +2 -2
- package/dist/types-ts4.5/components/AnalyticsListener/ModernAnalyticsListener.d.ts +1 -1
- package/dist/types-ts4.5/components/AnalyticsListener/index.d.ts +1 -1
- package/dist/types-ts4.5/components/AnalyticsListener/types.d.ts +2 -2
- package/dist/types-ts4.5/events/UIAnalyticsEvent.d.ts +1 -1
- package/dist/types-ts4.5/hocs/withAnalyticsEvents.d.ts +1 -1
- package/dist/types-ts4.5/hooks/useAnalyticsContext.d.ts +1 -1
- package/dist/types-ts4.5/hooks/useAnalyticsEvents.d.ts +1 -1
- package/dist/types-ts4.5/hooks/usePatchedProps.d.ts +1 -1
- package/dist/types-ts4.5/hooks/usePlatformLeafEventHandler.d.ts +1 -1
- package/dist/types-ts4.5/hooks/usePlatformLeafSyntheticEventHandler.d.ts +1 -1
- package/dist/types-ts4.5/hooks/useTrackedRef.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +4 -4
- package/dist/types-ts4.5/types.d.ts +2 -2
- package/dist/types-ts4.5/utils/createAndFireEvent.d.ts +2 -2
- package/docs/0-intro.tsx +17 -17
- package/docs/20-usage-with-presentational-components.tsx +38 -39
- package/docs/40-listeners.tsx +5 -5
- package/docs/50-error-boundary.tsx +5 -5
- package/docs/70-advanced-usage.tsx +21 -21
- package/package.json +99 -100
- package/report.api.md +115 -125
package/package.json
CHANGED
|
@@ -1,101 +1,100 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
2
|
+
"name": "@atlaskit/analytics-next",
|
|
3
|
+
"version": "9.3.2",
|
|
4
|
+
"description": "React components, HOCs and hooks to assist with tracking user activity with React components",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"registry": "https://registry.npmjs.org/"
|
|
7
|
+
},
|
|
8
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
9
|
+
"author": "Atlassian Pty Ltd",
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
|
+
"main": "dist/cjs/index.js",
|
|
12
|
+
"module": "dist/esm/index.js",
|
|
13
|
+
"module:es2019": "dist/es2019/index.js",
|
|
14
|
+
"types": "dist/types/index.d.ts",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
">=4.5 <4.9": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/types-ts4.5/*",
|
|
19
|
+
"dist/types-ts4.5/index.d.ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"atlaskit:src": "src/index.ts",
|
|
25
|
+
"atlassian": {
|
|
26
|
+
"team": "UIP Frontend Observability",
|
|
27
|
+
"releaseModel": "continuous",
|
|
28
|
+
"productPushConsumption": [
|
|
29
|
+
"jira"
|
|
30
|
+
],
|
|
31
|
+
"website": {
|
|
32
|
+
"name": "Analytics next"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"./types": "./src/types.ts",
|
|
36
|
+
"af:exports": {
|
|
37
|
+
"./types": "./src/types.ts",
|
|
38
|
+
"./AnalyticsContext": "./src/components/AnalyticsContext/index.tsx",
|
|
39
|
+
"./AnalyticsListener": "./src/components/AnalyticsListener/index.tsx",
|
|
40
|
+
"./AnalyticsErrorBoundary": "./src/components/AnalyticsErrorBoundary.tsx",
|
|
41
|
+
"./withAnalyticsEvents": "./src/hocs/withAnalyticsEvents.tsx",
|
|
42
|
+
"./withAnalyticsContext": "./src/hocs/withAnalyticsContext.tsx",
|
|
43
|
+
"./usePlatformLeafEventHandler": "./src/hooks/usePlatformLeafEventHandler.ts",
|
|
44
|
+
"./useAnalyticsEvents": "./src/hooks/useAnalyticsEvents.ts",
|
|
45
|
+
"./useCallbackWithAnalytics": "./src/hooks/useCallbackWithAnalytics.ts",
|
|
46
|
+
"./usePatchedProps": "./src/hooks/usePatchedProps.ts",
|
|
47
|
+
"./AnalyticsEvent": "./src/events/AnalyticsEvent.ts",
|
|
48
|
+
"./UIAnalyticsEvent": "./src/events/UIAnalyticsEvent.ts",
|
|
49
|
+
"./createAndFireEvents": "./src/utils/createAndFireEvent.ts",
|
|
50
|
+
".": "./src/index.ts"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
54
|
+
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
55
|
+
"@babel/runtime": "^7.0.0",
|
|
56
|
+
"prop-types": "^15.5.10",
|
|
57
|
+
"use-memo-one": "^1.1.1"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"react": "^16.8.0 || ^17.0.0 || ~18.2.0"
|
|
61
|
+
},
|
|
62
|
+
"runReact18": true,
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@atlaskit/ssr": "*",
|
|
65
|
+
"@atlassian/feature-flags-test-utils": "*",
|
|
66
|
+
"@testing-library/react": "^12.1.5",
|
|
67
|
+
"enzyme": "^3.10.0",
|
|
68
|
+
"react-dom-18": "npm:react-dom@^18.2.0",
|
|
69
|
+
"redux": "^3.7.2",
|
|
70
|
+
"storybook-addon-performance": "^0.16.0",
|
|
71
|
+
"typescript": "~5.4.2"
|
|
72
|
+
},
|
|
73
|
+
"techstack": {
|
|
74
|
+
"@atlassian/frontend": {
|
|
75
|
+
"import-structure": "atlassian-conventions"
|
|
76
|
+
},
|
|
77
|
+
"@repo/internal": {
|
|
78
|
+
"ui-components": [
|
|
79
|
+
"lite-mode"
|
|
80
|
+
],
|
|
81
|
+
"analytics": [
|
|
82
|
+
"analytics-next"
|
|
83
|
+
],
|
|
84
|
+
"design-tokens": [
|
|
85
|
+
"color"
|
|
86
|
+
],
|
|
87
|
+
"theming": [
|
|
88
|
+
"react-context"
|
|
89
|
+
],
|
|
90
|
+
"deprecation": [
|
|
91
|
+
"no-deprecated-imports"
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"platform-feature-flags": {
|
|
96
|
+
"platform.analytics-next-use-modern-context_fqgbx": {
|
|
97
|
+
"type": "boolean"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
package/report.api.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## API Report File for "@atlaskit/analytics-next"
|
|
4
4
|
|
|
5
|
-
> Do not edit this file. This report is auto-generated using
|
|
5
|
+
> Do not edit this file. This report is auto-generated using
|
|
6
|
+
> [API Extractor](https://api-extractor.com/).
|
|
6
7
|
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
8
|
|
|
8
9
|
### Table of contents
|
|
@@ -28,70 +29,68 @@ export let AnalyticsContext: AnalyticsContextFunction;
|
|
|
28
29
|
|
|
29
30
|
// @public (undocumented)
|
|
30
31
|
type AnalyticsContextFunction = (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
props: {
|
|
33
|
+
children: React.ReactNode;
|
|
34
|
+
data: Object;
|
|
35
|
+
},
|
|
36
|
+
context?: AnalyticsReactContextInterface,
|
|
36
37
|
) => JSX.Element;
|
|
37
38
|
|
|
38
39
|
// @public @deprecated (undocumented)
|
|
39
40
|
export class AnalyticsErrorBoundary extends Component<
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
AnalyticsErrorBoundaryProps,
|
|
42
|
+
AnalyticsErrorBoundaryState
|
|
42
43
|
> {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
constructor(props: AnalyticsErrorBoundaryProps);
|
|
45
|
+
// (undocumented)
|
|
46
|
+
componentDidCatch(error: Error, info?: AnalyticsErrorBoundaryErrorInfo): void;
|
|
47
|
+
// (undocumented)
|
|
48
|
+
render(): JSX.Element | null;
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
// @public (undocumented)
|
|
51
52
|
type AnalyticsErrorBoundaryErrorInfo = {
|
|
52
|
-
|
|
53
|
+
componentStack: string;
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
// @public (undocumented)
|
|
56
57
|
export interface AnalyticsErrorBoundaryProps {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
// (undocumented)
|
|
59
|
+
channel: string;
|
|
60
|
+
children: ReactNode;
|
|
61
|
+
// (undocumented)
|
|
62
|
+
data: {};
|
|
63
|
+
// (undocumented)
|
|
64
|
+
ErrorComponent?: React_2.ComponentType;
|
|
65
|
+
// (undocumented)
|
|
66
|
+
onError?: (error: Error, info?: AnalyticsErrorBoundaryErrorInfo) => void;
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
// @public (undocumented)
|
|
69
70
|
type AnalyticsErrorBoundaryState = {
|
|
70
|
-
|
|
71
|
+
hasError: boolean;
|
|
71
72
|
};
|
|
72
73
|
|
|
73
74
|
// @public (undocumented)
|
|
74
75
|
export class AnalyticsEvent {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
76
|
+
constructor(props: AnalyticsEventProps);
|
|
77
|
+
// (undocumented)
|
|
78
|
+
clone: () => AnalyticsEvent | null;
|
|
79
|
+
// (undocumented)
|
|
80
|
+
_isAnalyticsEvent: boolean;
|
|
81
|
+
// (undocumented)
|
|
82
|
+
payload: AnalyticsEventPayload;
|
|
83
|
+
// (undocumented)
|
|
84
|
+
update(updater: AnalyticsEventUpdater): this;
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
// @public (undocumented)
|
|
87
|
-
type AnalyticsEventCallback = (
|
|
88
|
-
payload: AnalyticsEventPayload,
|
|
89
|
-
) => AnalyticsEventPayload;
|
|
88
|
+
type AnalyticsEventCallback = (payload: AnalyticsEventPayload) => AnalyticsEventPayload;
|
|
90
89
|
|
|
91
90
|
// @public (undocumented)
|
|
92
91
|
type AnalyticsEventCreator = (
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
create: CreateUIAnalyticsEvent,
|
|
93
|
+
props: Record<string, any>,
|
|
95
94
|
) => UIAnalyticsEvent | undefined;
|
|
96
95
|
|
|
97
96
|
// @public (undocumented)
|
|
@@ -99,7 +98,7 @@ export type AnalyticsEventPayload = Record<string, any>;
|
|
|
99
98
|
|
|
100
99
|
// @public (undocumented)
|
|
101
100
|
export type AnalyticsEventProps = {
|
|
102
|
-
|
|
101
|
+
payload: AnalyticsEventPayload;
|
|
103
102
|
};
|
|
104
103
|
|
|
105
104
|
// @public (undocumented)
|
|
@@ -110,12 +109,12 @@ export let AnalyticsListener: AnalyticsListenerFunction;
|
|
|
110
109
|
|
|
111
110
|
// @public (undocumented)
|
|
112
111
|
type AnalyticsListenerFunction = (
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
112
|
+
props: {
|
|
113
|
+
children?: React.ReactNode;
|
|
114
|
+
channel?: string;
|
|
115
|
+
onEvent: (event: UIAnalyticsEvent, channel?: string) => void;
|
|
116
|
+
},
|
|
117
|
+
context?: AnalyticsReactContextInterface,
|
|
119
118
|
) => JSX.Element;
|
|
120
119
|
|
|
121
120
|
export { AnalyticsReactContext };
|
|
@@ -127,7 +126,7 @@ type ChannelIdentifier = string;
|
|
|
127
126
|
|
|
128
127
|
// @public (undocumented)
|
|
129
128
|
export function cleanProps(props: Record<string, any>): {
|
|
130
|
-
|
|
129
|
+
[x: string]: any;
|
|
131
130
|
};
|
|
132
131
|
|
|
133
132
|
// @public (undocumented)
|
|
@@ -135,9 +134,9 @@ type Context = Record<string, any>[];
|
|
|
135
134
|
|
|
136
135
|
// @public (undocumented)
|
|
137
136
|
export const createAndFireEvent: (
|
|
138
|
-
|
|
137
|
+
channel?: string,
|
|
139
138
|
) => (
|
|
140
|
-
|
|
139
|
+
payload: AnalyticsEventPayload,
|
|
141
140
|
) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent;
|
|
142
141
|
|
|
143
142
|
// @public (undocumented)
|
|
@@ -147,9 +146,7 @@ type CreateEventMap = Record<string, CreateEventMapValue>;
|
|
|
147
146
|
type CreateEventMapValue = AnalyticsEventCreator | AnalyticsEventPayload;
|
|
148
147
|
|
|
149
148
|
// @public (undocumented)
|
|
150
|
-
export type CreateUIAnalyticsEvent = (
|
|
151
|
-
payload: AnalyticsEventPayload,
|
|
152
|
-
) => UIAnalyticsEvent;
|
|
149
|
+
export type CreateUIAnalyticsEvent = (payload: AnalyticsEventPayload) => UIAnalyticsEvent;
|
|
153
150
|
|
|
154
151
|
// @public (undocumented)
|
|
155
152
|
export const isAnalyticsEvent: (obj: any) => boolean;
|
|
@@ -159,37 +156,35 @@ export const isUIAnalyticsEvent: (obj: any) => boolean;
|
|
|
159
156
|
|
|
160
157
|
// @public (undocumented)
|
|
161
158
|
export class UIAnalyticsEvent extends AnalyticsEvent {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
| Record<string, any>,
|
|
180
|
-
): this;
|
|
159
|
+
constructor(props: UIAnalyticsEventProps);
|
|
160
|
+
// (undocumented)
|
|
161
|
+
clone: () => UIAnalyticsEvent | null;
|
|
162
|
+
// (undocumented)
|
|
163
|
+
context: Context;
|
|
164
|
+
// (undocumented)
|
|
165
|
+
fire: (channel?: string) => void;
|
|
166
|
+
// (undocumented)
|
|
167
|
+
handlers: UIAnalyticsEventHandler[];
|
|
168
|
+
// (undocumented)
|
|
169
|
+
hasFired: boolean;
|
|
170
|
+
// (undocumented)
|
|
171
|
+
_isUIAnalyticsEvent: boolean;
|
|
172
|
+
// (undocumented)
|
|
173
|
+
update(
|
|
174
|
+
updater: ((payload: AnalyticsEventPayload) => AnalyticsEventPayload) | Record<string, any>,
|
|
175
|
+
): this;
|
|
181
176
|
}
|
|
182
177
|
|
|
183
178
|
// @public (undocumented)
|
|
184
179
|
export type UIAnalyticsEventHandler = (
|
|
185
|
-
|
|
186
|
-
|
|
180
|
+
event: UIAnalyticsEvent,
|
|
181
|
+
channel?: ChannelIdentifier,
|
|
187
182
|
) => void;
|
|
188
183
|
|
|
189
184
|
// @public (undocumented)
|
|
190
185
|
export type UIAnalyticsEventProps = AnalyticsEventProps & {
|
|
191
|
-
|
|
192
|
-
|
|
186
|
+
context?: Context;
|
|
187
|
+
handlers?: UIAnalyticsEventHandler[];
|
|
193
188
|
};
|
|
194
189
|
|
|
195
190
|
// @public (undocumented)
|
|
@@ -197,7 +192,7 @@ export function useAnalyticsEvents(): UseAnalyticsEventsHook;
|
|
|
197
192
|
|
|
198
193
|
// @public (undocumented)
|
|
199
194
|
export type UseAnalyticsEventsHook = {
|
|
200
|
-
|
|
195
|
+
createAnalyticsEvent: CreateUIAnalyticsEvent;
|
|
201
196
|
};
|
|
202
197
|
|
|
203
198
|
// @public (undocumented)
|
|
@@ -205,20 +200,20 @@ export const useCallbackWithAnalytics: UseCallbackWithAnalyticsHook;
|
|
|
205
200
|
|
|
206
201
|
// @public (undocumented)
|
|
207
202
|
export type UseCallbackWithAnalyticsHook = (
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
203
|
+
method: (...args: any[]) => void,
|
|
204
|
+
payload: ((...args: any[]) => void) | Record<string, any>,
|
|
205
|
+
channel?: string,
|
|
211
206
|
) => (...args: any[]) => void;
|
|
212
207
|
|
|
213
208
|
// @public (undocumented)
|
|
214
209
|
export function usePlatformLeafEventHandler<T>({
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
210
|
+
fn,
|
|
211
|
+
action,
|
|
212
|
+
componentName,
|
|
213
|
+
actionSubject,
|
|
214
|
+
packageName,
|
|
215
|
+
packageVersion,
|
|
216
|
+
analyticsData,
|
|
222
217
|
}: UsePlatformLeafEventHandlerHookArgs<T>): (value: T) => void;
|
|
223
218
|
|
|
224
219
|
// @public (undocumented)
|
|
@@ -226,23 +221,23 @@ export type UsePlatformLeafEventHandlerHook<T> = (value: T) => void;
|
|
|
226
221
|
|
|
227
222
|
// @public (undocumented)
|
|
228
223
|
export type UsePlatformLeafEventHandlerHookArgs<T> = {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
224
|
+
fn: (value: T, analyticsEvent: UIAnalyticsEvent) => void;
|
|
225
|
+
action: string;
|
|
226
|
+
componentName: string;
|
|
227
|
+
actionSubject?: string;
|
|
228
|
+
packageName: string;
|
|
229
|
+
packageVersion: string;
|
|
230
|
+
analyticsData?: Record<string, any>;
|
|
236
231
|
};
|
|
237
232
|
|
|
238
233
|
// @public (undocumented)
|
|
239
234
|
export function usePlatformLeafSyntheticEventHandler({
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
235
|
+
fn,
|
|
236
|
+
action,
|
|
237
|
+
componentName,
|
|
238
|
+
packageName,
|
|
239
|
+
packageVersion,
|
|
240
|
+
analyticsData,
|
|
246
241
|
}: UsePlatformLeafSyntheticEventHandlerHookArgs): () => void;
|
|
247
242
|
|
|
248
243
|
// @public (undocumented)
|
|
@@ -250,52 +245,47 @@ export type UsePlatformLeafSyntheticEventHandlerHook = () => void;
|
|
|
250
245
|
|
|
251
246
|
// @public (undocumented)
|
|
252
247
|
export type UsePlatformLeafSyntheticEventHandlerHookArgs = {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
248
|
+
fn: (analyticsEvent: UIAnalyticsEvent) => void;
|
|
249
|
+
action: string;
|
|
250
|
+
componentName: string;
|
|
251
|
+
packageName: string;
|
|
252
|
+
packageVersion: string;
|
|
253
|
+
analyticsData?: Record<string, any>;
|
|
259
254
|
};
|
|
260
255
|
|
|
261
256
|
// @public (undocumented)
|
|
262
257
|
export const withAnalyticsContext: (
|
|
263
|
-
|
|
258
|
+
defaultData?: any,
|
|
264
259
|
) => <Props, Component>(
|
|
265
|
-
|
|
260
|
+
WrappedComponent: React_2.JSXElementConstructor<Props> & Component,
|
|
266
261
|
) => React_2.ForwardRefExoticComponent<
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
> &
|
|
270
|
-
React_2.RefAttributes<any>
|
|
262
|
+
React_2.PropsWithoutRef<JSX.LibraryManagedAttributes<Component, Props & WithContextProps>> &
|
|
263
|
+
React_2.RefAttributes<any>
|
|
271
264
|
>;
|
|
272
265
|
|
|
273
266
|
// @public (undocumented)
|
|
274
267
|
export const withAnalyticsEvents: (
|
|
275
|
-
|
|
268
|
+
createEventMap?: CreateEventMap,
|
|
276
269
|
) => <Props extends WithAnalyticsEventsProps, Component>(
|
|
277
|
-
|
|
270
|
+
WrappedComponent: React_2.JSXElementConstructor<Props> & Component,
|
|
278
271
|
) => React_2.ForwardRefExoticComponent<
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
>
|
|
284
|
-
> &
|
|
285
|
-
React_2.RefAttributes<any>
|
|
272
|
+
React_2.PropsWithoutRef<
|
|
273
|
+
JSX.LibraryManagedAttributes<Component, Omit<Props, keyof WithAnalyticsEventsProps>>
|
|
274
|
+
> &
|
|
275
|
+
React_2.RefAttributes<any>
|
|
286
276
|
>;
|
|
287
277
|
|
|
288
278
|
// @public (undocumented)
|
|
289
279
|
export interface WithAnalyticsEventsProps {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
280
|
+
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
281
|
+
// (undocumented)
|
|
282
|
+
ref?: React_2.Ref<any>;
|
|
293
283
|
}
|
|
294
284
|
|
|
295
285
|
// @public (undocumented)
|
|
296
286
|
export interface WithContextProps {
|
|
297
|
-
|
|
298
|
-
|
|
287
|
+
// (undocumented)
|
|
288
|
+
analyticsContext?: Record<string, any>;
|
|
299
289
|
}
|
|
300
290
|
|
|
301
291
|
// (No @packageDocumentation comment for this package)
|
|
@@ -309,7 +299,7 @@ export interface WithContextProps {
|
|
|
309
299
|
|
|
310
300
|
```json
|
|
311
301
|
{
|
|
312
|
-
|
|
302
|
+
"react": "^16.8.0"
|
|
313
303
|
}
|
|
314
304
|
```
|
|
315
305
|
|