@atlaskit/analytics-next 9.1.3 → 9.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.
- package/CHANGELOG.md +41 -29
- package/afm-cc/tsconfig.json +26 -0
- package/build/tsconfig.json +2 -1
- package/dist/cjs/components/AnalyticsContext/LegacyAnalyticsContext.js +1 -2
- package/dist/cjs/components/AnalyticsContext/ModernAnalyticsContext.js +1 -2
- package/dist/cjs/components/AnalyticsContext/index.js +8 -9
- package/dist/cjs/components/AnalyticsErrorBoundary.js +2 -3
- package/dist/cjs/components/AnalyticsListener/LegacyAnalyticsListener.js +1 -2
- package/dist/cjs/components/AnalyticsListener/ModernAnalyticsListener.js +1 -2
- package/dist/cjs/components/AnalyticsListener/index.js +8 -9
- package/dist/cjs/events/AnalyticsEvent.js +6 -8
- package/dist/cjs/events/UIAnalyticsEvent.js +4 -6
- package/dist/cjs/hocs/withAnalyticsContext.js +3 -4
- package/dist/cjs/hocs/withAnalyticsEvents.js +1 -2
- package/dist/cjs/hooks/useAnalyticsContext.js +2 -3
- package/dist/cjs/hooks/useCallbackWithAnalytics.js +2 -3
- package/dist/cjs/hooks/usePatchedProps.js +2 -2
- package/dist/cjs/hooks/usePlatformLeafEventHandler.js +2 -2
- package/dist/cjs/hooks/usePlatformLeafSyntheticEventHandler.js +2 -2
- package/dist/cjs/hooks/useTrackedRef.js +2 -3
- package/dist/cjs/test-utils/useRenderCounter.js +2 -3
- package/dist/cjs/utils/createAndFireEvent.js +2 -3
- package/dist/es2019/components/AnalyticsContext/index.js +7 -7
- package/dist/es2019/components/AnalyticsListener/index.js +7 -7
- package/dist/esm/components/AnalyticsContext/index.js +7 -7
- package/dist/esm/components/AnalyticsListener/index.js +7 -7
- package/dist/esm/events/AnalyticsEvent.js +3 -3
- package/dist/esm/events/UIAnalyticsEvent.js +1 -1
- package/dist/esm/hocs/withAnalyticsContext.js +2 -2
- package/dist/esm/hooks/usePatchedProps.js +2 -2
- package/dist/esm/hooks/usePlatformLeafEventHandler.js +2 -2
- package/dist/esm/hooks/usePlatformLeafSyntheticEventHandler.js +2 -2
- package/dist/types/components/AnalyticsContext/index.d.ts +1 -1
- package/dist/types/components/AnalyticsListener/index.d.ts +1 -1
- package/dist/types-ts4.5/components/AnalyticsContext/index.d.ts +1 -1
- package/dist/types-ts4.5/components/AnalyticsListener/index.d.ts +1 -1
- package/package.json +9 -6
- package/dist/cjs/version.json +0 -5
- package/dist/es2019/version.json +0 -5
- package/dist/esm/version.json +0 -5
- package/dist/types/performance/examples.d.ts +0 -5
- package/dist/types-ts4.5/performance/examples.d.ts +0 -5
- package/tmp/api-report-tmp.d.ts +0 -225
package/CHANGELOG.md
CHANGED
|
@@ -1,130 +1,142 @@
|
|
|
1
1
|
# @atlaskit/analytics-next
|
|
2
2
|
|
|
3
|
+
## 9.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#69804](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69804) [`0443b2194bd9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0443b2194bd9) - Allow using modern react context via platform feature flags
|
|
8
|
+
|
|
9
|
+
## 9.1.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#38731](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38731) [`9af31f3c1ae`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9af31f3c1ae) - Delete version.json
|
|
14
|
+
|
|
3
15
|
## 9.1.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
6
18
|
|
|
7
|
-
- [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
19
|
+
- [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793) [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
8
20
|
|
|
9
21
|
## 9.1.2
|
|
10
22
|
|
|
11
23
|
### Patch Changes
|
|
12
24
|
|
|
13
|
-
- [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
|
|
25
|
+
- [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649) [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
|
|
14
26
|
|
|
15
27
|
## 9.1.1
|
|
16
28
|
|
|
17
29
|
### Patch Changes
|
|
18
30
|
|
|
19
|
-
- [`7cc1e8f18ec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7cc1e8f18ec) - Move analytics-next to maintenance mode
|
|
31
|
+
- [#33292](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33292) [`7cc1e8f18ec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7cc1e8f18ec) - Move analytics-next to maintenance mode
|
|
20
32
|
|
|
21
33
|
## 9.1.0
|
|
22
34
|
|
|
23
35
|
### Minor Changes
|
|
24
36
|
|
|
25
|
-
- [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
|
|
37
|
+
- [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258) [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
|
|
26
38
|
|
|
27
39
|
## 9.0.2
|
|
28
40
|
|
|
29
41
|
### Patch Changes
|
|
30
42
|
|
|
31
|
-
- [`7caf968e4cf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7caf968e4cf) - Move analytics-next to maintenance mode
|
|
43
|
+
- [#33013](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33013) [`7caf968e4cf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7caf968e4cf) - Move analytics-next to maintenance mode
|
|
32
44
|
|
|
33
45
|
## 9.0.1
|
|
34
46
|
|
|
35
47
|
### Patch Changes
|
|
36
48
|
|
|
37
|
-
- [`fbff320b423`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fbff320b423) - Move package to continuous model and to push model consumption
|
|
49
|
+
- [#32312](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32312) [`fbff320b423`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fbff320b423) - Move package to continuous model and to push model consumption
|
|
38
50
|
|
|
39
51
|
## 9.0.0
|
|
40
52
|
|
|
41
53
|
### Major Changes
|
|
42
54
|
|
|
43
|
-
- [`cf21f06ff72`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf21f06ff72) - Bugfix, removed sending event fn and deprecated AnalyticErrorBoundary
|
|
55
|
+
- [#29470](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/29470) [`cf21f06ff72`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf21f06ff72) - Bugfix, removed sending event fn and deprecated AnalyticErrorBoundary
|
|
44
56
|
|
|
45
57
|
## 8.3.5
|
|
46
58
|
|
|
47
59
|
### Patch Changes
|
|
48
60
|
|
|
49
|
-
- [`ccdc8e150f9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ccdc8e150f9) - AFO-771 Analytics next - fix node process check
|
|
61
|
+
- [#26436](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/26436) [`ccdc8e150f9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ccdc8e150f9) - AFO-771 Analytics next - fix node process check
|
|
50
62
|
|
|
51
63
|
## 8.3.4
|
|
52
64
|
|
|
53
65
|
### Patch Changes
|
|
54
66
|
|
|
55
|
-
- [`2cbb787f8b3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2cbb787f8b3) - AFO-711 Analytics-next: nullable check for context
|
|
67
|
+
- [#26220](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/26220) [`2cbb787f8b3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2cbb787f8b3) - AFO-711 Analytics-next: nullable check for context
|
|
56
68
|
|
|
57
69
|
## 8.3.3
|
|
58
70
|
|
|
59
71
|
### Patch Changes
|
|
60
72
|
|
|
61
|
-
- [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
|
|
73
|
+
- [#24874](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24874) [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
|
|
62
74
|
|
|
63
75
|
## 8.3.2
|
|
64
76
|
|
|
65
77
|
### Patch Changes
|
|
66
78
|
|
|
67
|
-
- [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
|
|
79
|
+
- [#24492](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24492) [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
|
|
68
80
|
|
|
69
81
|
## 8.3.1
|
|
70
82
|
|
|
71
83
|
### Patch Changes
|
|
72
84
|
|
|
73
|
-
- [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
|
|
85
|
+
- [#20650](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/20650) [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
|
|
74
86
|
|
|
75
87
|
## 8.3.0
|
|
76
88
|
|
|
77
89
|
### Minor Changes
|
|
78
90
|
|
|
79
|
-
- [`37fd554209e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/37fd554209e) - Add instance checks for analytics events in analytics-next. Update check in mpt-analytics for events too.
|
|
91
|
+
- [#14012](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/14012) [`37fd554209e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/37fd554209e) - Add instance checks for analytics events in analytics-next. Update check in mpt-analytics for events too.
|
|
80
92
|
|
|
81
93
|
## 8.2.1
|
|
82
94
|
|
|
83
95
|
### Patch Changes
|
|
84
96
|
|
|
85
|
-
- [`a4420ad5104`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a4420ad5104) - Improves referential stability of analytics-next wrapped callbacks
|
|
97
|
+
- [#12837](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/12837) [`a4420ad5104`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a4420ad5104) - Improves referential stability of analytics-next wrapped callbacks
|
|
86
98
|
|
|
87
99
|
## 8.2.0
|
|
88
100
|
|
|
89
101
|
### Minor Changes
|
|
90
102
|
|
|
91
|
-
- [`0dbf0427287`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0dbf0427287) - [ux] Added new optional props to allow executing on catching error and rendering an error screen on error
|
|
103
|
+
- [#12328](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/12328) [`0dbf0427287`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0dbf0427287) - [ux] Added new optional props to allow executing on catching error and rendering an error screen on error
|
|
92
104
|
|
|
93
105
|
## 8.1.4
|
|
94
106
|
|
|
95
107
|
### Patch Changes
|
|
96
108
|
|
|
97
|
-
- [`d6f7ff383cf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d6f7ff383cf) - Updates to development dependency `storybook-addon-performance`
|
|
109
|
+
- [#12167](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/12167) [`d6f7ff383cf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d6f7ff383cf) - Updates to development dependency `storybook-addon-performance`
|
|
98
110
|
|
|
99
111
|
## 8.1.3
|
|
100
112
|
|
|
101
113
|
### Patch Changes
|
|
102
114
|
|
|
103
|
-
- [`5a9b102eef0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5a9b102eef0) - Add optional actionSubject parameter to usePlatformLeafHandlerHook
|
|
115
|
+
- [#10230](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/10230) [`5a9b102eef0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5a9b102eef0) - Add optional actionSubject parameter to usePlatformLeafHandlerHook
|
|
104
116
|
|
|
105
117
|
## 8.1.2
|
|
106
118
|
|
|
107
119
|
### Patch Changes
|
|
108
120
|
|
|
109
|
-
- [`b290f591719`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b290f591719) - Add process type check in analytics next
|
|
121
|
+
- [#9083](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/9083) [`b290f591719`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b290f591719) - Add process type check in analytics next
|
|
110
122
|
|
|
111
123
|
## 8.1.1
|
|
112
124
|
|
|
113
125
|
### Patch Changes
|
|
114
126
|
|
|
115
|
-
- [`d3265f19be`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d3265f19be) - Transpile packages using babel rather than tsc
|
|
127
|
+
- [#5857](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/5857) [`d3265f19be`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d3265f19be) - Transpile packages using babel rather than tsc
|
|
116
128
|
|
|
117
129
|
## 8.1.0
|
|
118
130
|
|
|
119
131
|
### Minor Changes
|
|
120
132
|
|
|
121
|
-
- [`4eb71695b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4eb71695b5) - Added usePlatformLeafSyntheticEventHandler, which acts similarly to usePlatformLeafEventHandler but is used for synthetic events where the event handler takes no `value` prop
|
|
133
|
+
- [#5693](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/5693) [`4eb71695b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4eb71695b5) - Added usePlatformLeafSyntheticEventHandler, which acts similarly to usePlatformLeafEventHandler but is used for synthetic events where the event handler takes no `value` prop
|
|
122
134
|
|
|
123
135
|
## 8.0.2
|
|
124
136
|
|
|
125
137
|
### Patch Changes
|
|
126
138
|
|
|
127
|
-
- [`5f58283e1f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f58283e1f) - Export types using Typescript's new "export type" syntax to satisfy Typescript's --isolatedModules compiler option.
|
|
139
|
+
- [#5497](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/5497) [`5f58283e1f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f58283e1f) - Export types using Typescript's new "export type" syntax to satisfy Typescript's --isolatedModules compiler option.
|
|
128
140
|
This requires version 3.8 of Typescript, read more about how we handle Typescript versions here: https://atlaskit.atlassian.com/get-started
|
|
129
141
|
Also add `typescript` to `devDependencies` to denote version that the package was built with.
|
|
130
142
|
|
|
@@ -132,13 +144,13 @@
|
|
|
132
144
|
|
|
133
145
|
### Patch Changes
|
|
134
146
|
|
|
135
|
-
- [`b6af9198dd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b6af9198dd) - Restructure back to original lite mode file structure
|
|
147
|
+
- [#5412](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/5412) [`b6af9198dd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b6af9198dd) - Restructure back to original lite mode file structure
|
|
136
148
|
|
|
137
149
|
## 8.0.0
|
|
138
150
|
|
|
139
151
|
### Major Changes
|
|
140
152
|
|
|
141
|
-
- [`b485472340`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b485472340) - Export WithContextProps type to prevent deep import path references in dependent packages declaration output.
|
|
153
|
+
- [#5344](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/5344) [`b485472340`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b485472340) - Export WithContextProps type to prevent deep import path references in dependent packages declaration output.
|
|
142
154
|
|
|
143
155
|
Released as a major to prevent existing Atlaskit dependencies that use analytics-next from breaking when analytics-next file structure changes in the future.
|
|
144
156
|
|
|
@@ -146,13 +158,13 @@
|
|
|
146
158
|
|
|
147
159
|
### Patch Changes
|
|
148
160
|
|
|
149
|
-
- [`2ac834240e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2ac834240e) - Undo analytics-next file restructure to allow external ts definitions to continue working
|
|
161
|
+
- [#5164](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/5164) [`2ac834240e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2ac834240e) - Undo analytics-next file restructure to allow external ts definitions to continue working
|
|
150
162
|
|
|
151
163
|
## 7.1.0
|
|
152
164
|
|
|
153
165
|
### Minor Changes
|
|
154
166
|
|
|
155
|
-
- [`0e2a914932`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0e2a914932) - ### Additions
|
|
167
|
+
- [#4749](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/4749) [`0e2a914932`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0e2a914932) - ### Additions
|
|
156
168
|
|
|
157
169
|
- Added a new hook `useAnalyticsEventHandler` for sole use in Atlaskit components
|
|
158
170
|
|
|
@@ -207,7 +219,7 @@
|
|
|
207
219
|
|
|
208
220
|
### Patch Changes
|
|
209
221
|
|
|
210
|
-
- [`6c525a8229`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6c525a8229) - Upgraded to TypeScript 3.9.6 and tslib to 2.0.0
|
|
222
|
+
- [#3885](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/3885) [`6c525a8229`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6c525a8229) - Upgraded to TypeScript 3.9.6 and tslib to 2.0.0
|
|
211
223
|
|
|
212
224
|
Since tslib is a dependency for all our packages we recommend that products also follow this tslib upgrade
|
|
213
225
|
to prevent duplicates of tslib being bundled.
|
|
@@ -218,19 +230,19 @@
|
|
|
218
230
|
|
|
219
231
|
### Patch Changes
|
|
220
232
|
|
|
221
|
-
- [`723a322186`](https://bitbucket.org/atlassian/atlassian-frontend/commits/723a322186) - Hotfix to have a stable react context across multiple versions of @atlaskit/analytics-next
|
|
233
|
+
- [#4344](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/4344) [`723a322186`](https://bitbucket.org/atlassian/atlassian-frontend/commits/723a322186) - Hotfix to have a stable react context across multiple versions of @atlaskit/analytics-next
|
|
222
234
|
|
|
223
235
|
## 7.0.1
|
|
224
236
|
|
|
225
237
|
### Patch Changes
|
|
226
238
|
|
|
227
|
-
- [`bff2f273bf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bff2f273bf) - useAnalyticsEvents will no longer log errors when used without an AnalyticsListerner or AnalyticsContext
|
|
239
|
+
- [#3428](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/3428) [`bff2f273bf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bff2f273bf) - useAnalyticsEvents will no longer log errors when used without an AnalyticsListerner or AnalyticsContext
|
|
228
240
|
|
|
229
241
|
## 7.0.0
|
|
230
242
|
|
|
231
243
|
### Major Changes
|
|
232
244
|
|
|
233
|
-
- [`87f4720f27`](https://bitbucket.org/atlassian/atlassian-frontend/commits/87f4720f27) - Officially dropping IE11 support, from this version onwards there are no warranties of the package working in IE11.
|
|
245
|
+
- [#3335](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/3335) [`87f4720f27`](https://bitbucket.org/atlassian/atlassian-frontend/commits/87f4720f27) - Officially dropping IE11 support, from this version onwards there are no warranties of the package working in IE11.
|
|
234
246
|
For more information see: https://community.developer.atlassian.com/t/atlaskit-to-drop-support-for-internet-explorer-11-from-1st-july-2020/39534
|
|
235
247
|
|
|
236
248
|
## 6.3.6
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../../tsconfig.entry-points.confluence.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"target": "es5",
|
|
6
|
+
"composite": true,
|
|
7
|
+
"outDir": "../dist",
|
|
8
|
+
"rootDir": "../",
|
|
9
|
+
"baseUrl": "../"
|
|
10
|
+
},
|
|
11
|
+
"include": [
|
|
12
|
+
"../src/**/*.ts",
|
|
13
|
+
"../src/**/*.tsx"
|
|
14
|
+
],
|
|
15
|
+
"exclude": [
|
|
16
|
+
"../src/**/__tests__/*",
|
|
17
|
+
"../src/**/*.test.*",
|
|
18
|
+
"../src/**/test.*",
|
|
19
|
+
"../src/performance/examples.tsx"
|
|
20
|
+
],
|
|
21
|
+
"references": [
|
|
22
|
+
{
|
|
23
|
+
"path": "../../../platform/feature-flags/afm-cc/tsconfig.json"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
package/build/tsconfig.json
CHANGED
|
@@ -72,5 +72,4 @@ var AnalyticsContext = /*#__PURE__*/function (_Component) {
|
|
|
72
72
|
}(_react.Component);
|
|
73
73
|
(0, _defineProperty2.default)(AnalyticsContext, "contextTypes", ContextTypes);
|
|
74
74
|
(0, _defineProperty2.default)(AnalyticsContext, "childContextTypes", ContextTypes);
|
|
75
|
-
var _default = AnalyticsContext;
|
|
76
|
-
exports.default = _default;
|
|
75
|
+
var _default = exports.default = AnalyticsContext;
|
|
@@ -5,14 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
10
|
var _LegacyAnalyticsContext = _interopRequireDefault(require("./LegacyAnalyticsContext"));
|
|
9
11
|
var _ModernAnalyticsContext = _interopRequireDefault(require("./ModernAnalyticsContext"));
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
var _default = ExportedAnalyticsContext;
|
|
18
|
-
exports.default = _default;
|
|
12
|
+
var ExportedAnalyticsContext = function ExportedAnalyticsContext(props) {
|
|
13
|
+
var _process$env;
|
|
14
|
+
var isModernContextEnabledEnv = typeof process !== 'undefined' && process !== null && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']);
|
|
15
|
+
return isModernContextEnabledEnv || (0, _platformFeatureFlags.getBooleanFF)('platform.analytics-next-use-modern-context_fqgbx') ? /*#__PURE__*/_react.default.createElement(_ModernAnalyticsContext.default, props) : /*#__PURE__*/_react.default.createElement(_LegacyAnalyticsContext.default, props);
|
|
16
|
+
};
|
|
17
|
+
var _default = exports.default = ExportedAnalyticsContext;
|
|
@@ -21,7 +21,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
21
21
|
* @deprecated
|
|
22
22
|
*/
|
|
23
23
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
24
|
-
var AnalyticsErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
24
|
+
var AnalyticsErrorBoundary = exports.default = /*#__PURE__*/function (_Component) {
|
|
25
25
|
(0, _inherits2.default)(AnalyticsErrorBoundary, _Component);
|
|
26
26
|
var _super = _createSuper(AnalyticsErrorBoundary);
|
|
27
27
|
function AnalyticsErrorBoundary(props) {
|
|
@@ -61,5 +61,4 @@ var AnalyticsErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
|
61
61
|
}
|
|
62
62
|
}]);
|
|
63
63
|
return AnalyticsErrorBoundary;
|
|
64
|
-
}(_react.Component);
|
|
65
|
-
exports.default = AnalyticsErrorBoundary;
|
|
64
|
+
}(_react.Component);
|
|
@@ -80,5 +80,4 @@ var AnalyticsListener = /*#__PURE__*/function (_Component) {
|
|
|
80
80
|
}(_react.Component);
|
|
81
81
|
(0, _defineProperty2.default)(AnalyticsListener, "contextTypes", ContextTypes);
|
|
82
82
|
(0, _defineProperty2.default)(AnalyticsListener, "childContextTypes", ContextTypes);
|
|
83
|
-
var _default = AnalyticsListener;
|
|
84
|
-
exports.default = _default;
|
|
83
|
+
var _default = exports.default = AnalyticsListener;
|
|
@@ -5,14 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
10
|
var _LegacyAnalyticsListener = _interopRequireDefault(require("./LegacyAnalyticsListener"));
|
|
9
11
|
var _ModernAnalyticsListener = _interopRequireDefault(require("./ModernAnalyticsListener"));
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
var _default = ExportedAnalyticsListener;
|
|
18
|
-
exports.default = _default;
|
|
12
|
+
var ExportedAnalyticsListener = function ExportedAnalyticsListener(props) {
|
|
13
|
+
var _process$env;
|
|
14
|
+
var isModernContextEnabledEnv = typeof process !== 'undefined' && process !== null && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']);
|
|
15
|
+
return isModernContextEnabledEnv || (0, _platformFeatureFlags.getBooleanFF)('platform.analytics-next-use-modern-context_fqgbx') ? /*#__PURE__*/_react.default.createElement(_ModernAnalyticsListener.default, props) : /*#__PURE__*/_react.default.createElement(_LegacyAnalyticsListener.default, props);
|
|
16
|
+
};
|
|
17
|
+
var _default = exports.default = ExportedAnalyticsListener;
|
|
@@ -9,16 +9,15 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
-
function ownKeys(
|
|
13
|
-
function _objectSpread(
|
|
14
|
-
var isAnalyticsEvent = function isAnalyticsEvent(obj) {
|
|
12
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
|
+
var isAnalyticsEvent = exports.isAnalyticsEvent = function isAnalyticsEvent(obj) {
|
|
15
15
|
var _obj$constructor;
|
|
16
16
|
return obj instanceof AnalyticsEvent || !!(obj !== null && obj !== void 0 && obj._isAnalyticsEvent) ||
|
|
17
17
|
// Backwards compatibility with older analytics-next packages
|
|
18
|
-
(obj === null || obj === void 0
|
|
18
|
+
(obj === null || obj === void 0 || (_obj$constructor = obj.constructor) === null || _obj$constructor === void 0 ? void 0 : _obj$constructor.name) === 'AnalyticsEvent';
|
|
19
19
|
};
|
|
20
|
-
exports.
|
|
21
|
-
var AnalyticsEvent = /*#__PURE__*/function () {
|
|
20
|
+
var AnalyticsEvent = exports.default = /*#__PURE__*/function () {
|
|
22
21
|
function AnalyticsEvent(props) {
|
|
23
22
|
var _this = this;
|
|
24
23
|
(0, _classCallCheck2.default)(this, AnalyticsEvent);
|
|
@@ -46,5 +45,4 @@ var AnalyticsEvent = /*#__PURE__*/function () {
|
|
|
46
45
|
}
|
|
47
46
|
}]);
|
|
48
47
|
return AnalyticsEvent;
|
|
49
|
-
}();
|
|
50
|
-
exports.default = AnalyticsEvent;
|
|
48
|
+
}();
|
|
@@ -17,14 +17,13 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
17
17
|
var _AnalyticsEvent2 = _interopRequireDefault(require("./AnalyticsEvent"));
|
|
18
18
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
19
19
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
|
-
var isUIAnalyticsEvent = function isUIAnalyticsEvent(obj) {
|
|
20
|
+
var isUIAnalyticsEvent = exports.isUIAnalyticsEvent = function isUIAnalyticsEvent(obj) {
|
|
21
21
|
var _obj$constructor;
|
|
22
22
|
return obj instanceof UIAnalyticsEvent || !!(obj !== null && obj !== void 0 && obj._isUIAnalyticsEvent) ||
|
|
23
23
|
// Backwards compatibility with older analytics-next packages
|
|
24
|
-
(obj === null || obj === void 0
|
|
24
|
+
(obj === null || obj === void 0 || (_obj$constructor = obj.constructor) === null || _obj$constructor === void 0 ? void 0 : _obj$constructor.name) === 'UIAnalyticsEvent';
|
|
25
25
|
};
|
|
26
|
-
exports.
|
|
27
|
-
var UIAnalyticsEvent = /*#__PURE__*/function (_AnalyticsEvent) {
|
|
26
|
+
var UIAnalyticsEvent = exports.default = /*#__PURE__*/function (_AnalyticsEvent) {
|
|
28
27
|
(0, _inherits2.default)(UIAnalyticsEvent, _AnalyticsEvent);
|
|
29
28
|
var _super = _createSuper(UIAnalyticsEvent);
|
|
30
29
|
function UIAnalyticsEvent(props) {
|
|
@@ -87,5 +86,4 @@ var UIAnalyticsEvent = /*#__PURE__*/function (_AnalyticsEvent) {
|
|
|
87
86
|
}
|
|
88
87
|
}]);
|
|
89
88
|
return UIAnalyticsEvent;
|
|
90
|
-
}(_AnalyticsEvent2.default);
|
|
91
|
-
exports.default = UIAnalyticsEvent;
|
|
89
|
+
}(_AnalyticsEvent2.default);
|
|
@@ -14,8 +14,8 @@ var _AnalyticsContext = _interopRequireDefault(require("../components/AnalyticsC
|
|
|
14
14
|
var _excluded = ["analyticsContext"];
|
|
15
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
function ownKeys(
|
|
18
|
-
function _objectSpread(
|
|
17
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
19
|
var withAnalyticsContext = function withAnalyticsContext(defaultData) {
|
|
20
20
|
return function (WrappedComponent) {
|
|
21
21
|
var WithAnalyticsContext = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
@@ -38,5 +38,4 @@ var withAnalyticsContext = function withAnalyticsContext(defaultData) {
|
|
|
38
38
|
return WithAnalyticsContext;
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
|
-
var _default = withAnalyticsContext;
|
|
42
|
-
exports.default = _default;
|
|
41
|
+
var _default = exports.default = withAnalyticsContext;
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.useAnalyticsContext = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _analyticsNextStableReactContext = _interopRequireDefault(require("@atlaskit/analytics-next-stable-react-context"));
|
|
10
|
-
var useAnalyticsContext = function useAnalyticsContext() {
|
|
10
|
+
var useAnalyticsContext = exports.useAnalyticsContext = function useAnalyticsContext() {
|
|
11
11
|
return (0, _react.useContext)(_analyticsNextStableReactContext.default);
|
|
12
|
-
};
|
|
13
|
-
exports.useAnalyticsContext = useAnalyticsContext;
|
|
12
|
+
};
|
|
@@ -7,7 +7,7 @@ exports.useCallbackWithAnalytics = void 0;
|
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _useAnalyticsEvents2 = require("./useAnalyticsEvents");
|
|
9
9
|
var _useTrackedRef = require("./useTrackedRef");
|
|
10
|
-
var useCallbackWithAnalytics = function useCallbackWithAnalytics(method, payload, channel) {
|
|
10
|
+
var useCallbackWithAnalytics = exports.useCallbackWithAnalytics = function useCallbackWithAnalytics(method, payload, channel) {
|
|
11
11
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
12
12
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
13
13
|
var methodRef = (0, _useTrackedRef.useTrackedRef)(method);
|
|
@@ -17,5 +17,4 @@ var useCallbackWithAnalytics = function useCallbackWithAnalytics(method, payload
|
|
|
17
17
|
createAnalyticsEvent(pload).fire(channel);
|
|
18
18
|
methodRef.current.apply(methodRef, arguments);
|
|
19
19
|
}, [createAnalyticsEvent, methodRef, payloadRef, channel]);
|
|
20
|
-
};
|
|
21
|
-
exports.useCallbackWithAnalytics = useCallbackWithAnalytics;
|
|
20
|
+
};
|
|
@@ -9,8 +9,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var _useAnalyticsEvents2 = require("./useAnalyticsEvents");
|
|
12
|
-
function ownKeys(
|
|
13
|
-
function _objectSpread(
|
|
12
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
14
|
function usePatchedProps() {
|
|
15
15
|
var createEventMap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
16
16
|
var wrappedComponentProps = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -9,8 +9,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _useAnalyticsEvents2 = require("./useAnalyticsEvents");
|
|
11
11
|
var _useTrackedRef = require("./useTrackedRef");
|
|
12
|
-
function ownKeys(
|
|
13
|
-
function _objectSpread(
|
|
12
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
14
|
// WARNING: This hook will only function correctly for leaf node components - as in
|
|
15
15
|
// no children inside the component will require analytics themselves.
|
|
16
16
|
// Ignoring this warning will mean the analytics context of child components will not
|
|
@@ -9,8 +9,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _useAnalyticsEvents2 = require("./useAnalyticsEvents");
|
|
11
11
|
var _useTrackedRef = require("./useTrackedRef");
|
|
12
|
-
function ownKeys(
|
|
13
|
-
function _objectSpread(
|
|
12
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
14
|
// WARNING: This hook will only function correctly for leaf node components - as in
|
|
15
15
|
// no children inside the component will require analytics themselves.
|
|
16
16
|
// Ignoring this warning will mean the analytics context of child components will not
|
|
@@ -5,11 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useTrackedRef = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
var useTrackedRef = function useTrackedRef(value) {
|
|
8
|
+
var useTrackedRef = exports.useTrackedRef = function useTrackedRef(value) {
|
|
9
9
|
var ref = (0, _react.useRef)(value);
|
|
10
10
|
(0, _react.useEffect)(function () {
|
|
11
11
|
ref.current = value;
|
|
12
12
|
}, [value]);
|
|
13
13
|
return ref;
|
|
14
|
-
};
|
|
15
|
-
exports.useTrackedRef = useTrackedRef;
|
|
14
|
+
};
|
|
@@ -6,11 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useRenderCounter = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
// Hook to track the number of renders in tests
|
|
9
|
-
var useRenderCounter = function useRenderCounter() {
|
|
9
|
+
var useRenderCounter = exports.useRenderCounter = function useRenderCounter() {
|
|
10
10
|
var ref = (0, _react.useRef)(1);
|
|
11
11
|
(0, _react.useEffect)(function () {
|
|
12
12
|
ref.current++;
|
|
13
13
|
});
|
|
14
14
|
return ref.current;
|
|
15
|
-
};
|
|
16
|
-
exports.useRenderCounter = useRenderCounter;
|
|
15
|
+
};
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _default = function _default(channel) {
|
|
7
|
+
var _default = exports.default = function _default(channel) {
|
|
8
8
|
return function (payload) {
|
|
9
9
|
return function (createAnalyticsEvent) {
|
|
10
10
|
var consumerEvent = createAnalyticsEvent(payload);
|
|
@@ -15,5 +15,4 @@ var _default = function _default(channel) {
|
|
|
15
15
|
return consumerEvent;
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
};
|
|
19
|
-
exports.default = _default;
|
|
18
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import LegacyAnalyticsContext from './LegacyAnalyticsContext';
|
|
3
4
|
import ModernAnalyticsContext from './ModernAnalyticsContext';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
5
|
+
const ExportedAnalyticsContext = props => {
|
|
6
|
+
var _process$env;
|
|
7
|
+
const isModernContextEnabledEnv = typeof process !== 'undefined' && process !== null && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']);
|
|
8
|
+
return isModernContextEnabledEnv || getBooleanFF('platform.analytics-next-use-modern-context_fqgbx') ? /*#__PURE__*/React.createElement(ModernAnalyticsContext, props) : /*#__PURE__*/React.createElement(LegacyAnalyticsContext, props);
|
|
9
|
+
};
|
|
10
10
|
export default ExportedAnalyticsContext;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import LegacyAnalyticsListener from './LegacyAnalyticsListener';
|
|
3
4
|
import ModernAnalyticsListener from './ModernAnalyticsListener';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
5
|
+
const ExportedAnalyticsListener = props => {
|
|
6
|
+
var _process$env;
|
|
7
|
+
const isModernContextEnabledEnv = typeof process !== 'undefined' && process !== null && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']);
|
|
8
|
+
return isModernContextEnabledEnv || getBooleanFF('platform.analytics-next-use-modern-context_fqgbx') ? /*#__PURE__*/React.createElement(ModernAnalyticsListener, props) : /*#__PURE__*/React.createElement(LegacyAnalyticsListener, props);
|
|
9
|
+
};
|
|
10
10
|
export default ExportedAnalyticsListener;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import LegacyAnalyticsContext from './LegacyAnalyticsContext';
|
|
3
4
|
import ModernAnalyticsContext from './ModernAnalyticsContext';
|
|
4
|
-
var ExportedAnalyticsContext
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
5
|
+
var ExportedAnalyticsContext = function ExportedAnalyticsContext(props) {
|
|
6
|
+
var _process$env;
|
|
7
|
+
var isModernContextEnabledEnv = typeof process !== 'undefined' && process !== null && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']);
|
|
8
|
+
return isModernContextEnabledEnv || getBooleanFF('platform.analytics-next-use-modern-context_fqgbx') ? /*#__PURE__*/React.createElement(ModernAnalyticsContext, props) : /*#__PURE__*/React.createElement(LegacyAnalyticsContext, props);
|
|
9
|
+
};
|
|
10
10
|
export default ExportedAnalyticsContext;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import LegacyAnalyticsListener from './LegacyAnalyticsListener';
|
|
3
4
|
import ModernAnalyticsListener from './ModernAnalyticsListener';
|
|
4
|
-
var ExportedAnalyticsListener
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
5
|
+
var ExportedAnalyticsListener = function ExportedAnalyticsListener(props) {
|
|
6
|
+
var _process$env;
|
|
7
|
+
var isModernContextEnabledEnv = typeof process !== 'undefined' && process !== null && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']);
|
|
8
|
+
return isModernContextEnabledEnv || getBooleanFF('platform.analytics-next-use-modern-context_fqgbx') ? /*#__PURE__*/React.createElement(ModernAnalyticsListener, props) : /*#__PURE__*/React.createElement(LegacyAnalyticsListener, props);
|
|
9
|
+
};
|
|
10
10
|
export default ExportedAnalyticsListener;
|
|
@@ -2,13 +2,13 @@ import _typeof from "@babel/runtime/helpers/typeof";
|
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
-
function ownKeys(
|
|
6
|
-
function _objectSpread(
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
export var isAnalyticsEvent = function isAnalyticsEvent(obj) {
|
|
8
8
|
var _obj$constructor;
|
|
9
9
|
return obj instanceof AnalyticsEvent || !!(obj !== null && obj !== void 0 && obj._isAnalyticsEvent) ||
|
|
10
10
|
// Backwards compatibility with older analytics-next packages
|
|
11
|
-
(obj === null || obj === void 0
|
|
11
|
+
(obj === null || obj === void 0 || (_obj$constructor = obj.constructor) === null || _obj$constructor === void 0 ? void 0 : _obj$constructor.name) === 'AnalyticsEvent';
|
|
12
12
|
};
|
|
13
13
|
var AnalyticsEvent = /*#__PURE__*/function () {
|
|
14
14
|
function AnalyticsEvent(props) {
|
|
@@ -14,7 +14,7 @@ export var isUIAnalyticsEvent = function isUIAnalyticsEvent(obj) {
|
|
|
14
14
|
var _obj$constructor;
|
|
15
15
|
return obj instanceof UIAnalyticsEvent || !!(obj !== null && obj !== void 0 && obj._isUIAnalyticsEvent) ||
|
|
16
16
|
// Backwards compatibility with older analytics-next packages
|
|
17
|
-
(obj === null || obj === void 0
|
|
17
|
+
(obj === null || obj === void 0 || (_obj$constructor = obj.constructor) === null || _obj$constructor === void 0 ? void 0 : _obj$constructor.name) === 'UIAnalyticsEvent';
|
|
18
18
|
};
|
|
19
19
|
var UIAnalyticsEvent = /*#__PURE__*/function (_AnalyticsEvent) {
|
|
20
20
|
_inherits(UIAnalyticsEvent, _AnalyticsEvent);
|
|
@@ -2,8 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["analyticsContext"];
|
|
5
|
-
function ownKeys(
|
|
6
|
-
function _objectSpread(
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
import React, { forwardRef, useMemo } from 'react';
|
|
8
8
|
import AnalyticsContext from '../components/AnalyticsContext';
|
|
9
9
|
var withAnalyticsContext = function withAnalyticsContext(defaultData) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
3
|
-
function ownKeys(
|
|
4
|
-
function _objectSpread(
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
import { useMemo, useRef } from 'react';
|
|
6
6
|
import { useAnalyticsEvents } from './useAnalyticsEvents';
|
|
7
7
|
export function usePatchedProps() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import { useCallback } from 'react';
|
|
5
5
|
import { useAnalyticsEvents } from './useAnalyticsEvents';
|
|
6
6
|
import { useTrackedRef } from './useTrackedRef';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import { useCallback } from 'react';
|
|
5
5
|
import { useAnalyticsEvents } from './useAnalyticsEvents';
|
|
6
6
|
import { useTrackedRef } from './useTrackedRef';
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/analytics-next",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.2.0",
|
|
4
4
|
"description": "React components, HOCs and hooks to assist with tracking user activity with React components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
7
7
|
},
|
|
8
|
-
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
8
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
9
9
|
"author": "Atlassian Pty Ltd",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "dist/cjs/index.js",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
54
|
+
"@atlaskit/platform-feature-flags": "^0.2.2",
|
|
54
55
|
"@babel/runtime": "^7.0.0",
|
|
55
56
|
"prop-types": "^15.5.10",
|
|
56
57
|
"use-memo-one": "^1.1.1"
|
|
@@ -59,12 +60,9 @@
|
|
|
59
60
|
"react": "^16.8.0"
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
|
62
|
-
"@atlaskit/button": "^16.7.0",
|
|
63
|
-
"@atlaskit/docs": "*",
|
|
64
|
-
"@atlaskit/section-message": "^6.4.0",
|
|
65
63
|
"@atlaskit/ssr": "*",
|
|
66
|
-
"@atlaskit/textfield": "^5.4.0",
|
|
67
64
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
65
|
+
"@atlassian/feature-flags-test-utils": "*",
|
|
68
66
|
"@testing-library/react": "^12.1.5",
|
|
69
67
|
"enzyme": "^3.10.0",
|
|
70
68
|
"react-dom": "^16.8.0",
|
|
@@ -94,5 +92,10 @@
|
|
|
94
92
|
]
|
|
95
93
|
}
|
|
96
94
|
},
|
|
95
|
+
"platform-feature-flags": {
|
|
96
|
+
"platform.analytics-next-use-modern-context_fqgbx": {
|
|
97
|
+
"type": "boolean"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
97
100
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
98
101
|
}
|
package/dist/cjs/version.json
DELETED
package/dist/es2019/version.json
DELETED
package/dist/esm/version.json
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const UsePlatformLeafEventHandlerHookTest: () => JSX.Element;
|
|
3
|
-
export declare const UseAnalyticsEventHookTest: () => JSX.Element;
|
|
4
|
-
export declare const UseCallbackWithAnalyticsHookTest: () => JSX.Element;
|
|
5
|
-
export declare const HOCSTest: () => JSX.Element;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const UsePlatformLeafEventHandlerHookTest: () => JSX.Element;
|
|
3
|
-
export declare const UseAnalyticsEventHookTest: () => JSX.Element;
|
|
4
|
-
export declare const UseCallbackWithAnalyticsHookTest: () => JSX.Element;
|
|
5
|
-
export declare const HOCSTest: () => JSX.Element;
|
package/tmp/api-report-tmp.d.ts
DELETED
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
## API Report File for "@atlaskit/analytics-next"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
/// <reference types="react" />
|
|
8
|
-
|
|
9
|
-
import { default as AnalyticsReactContext } from '@atlaskit/analytics-next-stable-react-context';
|
|
10
|
-
import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
11
|
-
import { Component } from 'react';
|
|
12
|
-
import { default as React_2 } from 'react';
|
|
13
|
-
import { ReactNode } from 'react';
|
|
14
|
-
|
|
15
|
-
// @public (undocumented)
|
|
16
|
-
export let AnalyticsContext: AnalyticsContextFunction;
|
|
17
|
-
|
|
18
|
-
// @public (undocumented)
|
|
19
|
-
type AnalyticsContextFunction = (props: {
|
|
20
|
-
children: React.ReactNode;
|
|
21
|
-
data: Object;
|
|
22
|
-
}, context?: AnalyticsReactContextInterface) => JSX.Element;
|
|
23
|
-
|
|
24
|
-
// @public @deprecated (undocumented)
|
|
25
|
-
export class AnalyticsErrorBoundary extends Component<AnalyticsErrorBoundaryProps, AnalyticsErrorBoundaryState> {
|
|
26
|
-
constructor(props: AnalyticsErrorBoundaryProps);
|
|
27
|
-
// (undocumented)
|
|
28
|
-
componentDidCatch(error: Error, info?: AnalyticsErrorBoundaryErrorInfo): void;
|
|
29
|
-
// (undocumented)
|
|
30
|
-
render(): JSX.Element | null;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// @public (undocumented)
|
|
34
|
-
type AnalyticsErrorBoundaryErrorInfo = {
|
|
35
|
-
componentStack: string;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
// @public (undocumented)
|
|
39
|
-
export interface AnalyticsErrorBoundaryProps {
|
|
40
|
-
// (undocumented)
|
|
41
|
-
channel: string;
|
|
42
|
-
children: ReactNode;
|
|
43
|
-
// (undocumented)
|
|
44
|
-
data: {};
|
|
45
|
-
// (undocumented)
|
|
46
|
-
ErrorComponent?: React_2.ComponentType;
|
|
47
|
-
// (undocumented)
|
|
48
|
-
onError?: (error: Error, info?: AnalyticsErrorBoundaryErrorInfo) => void;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// @public (undocumented)
|
|
52
|
-
type AnalyticsErrorBoundaryState = {
|
|
53
|
-
hasError: boolean;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
// @public (undocumented)
|
|
57
|
-
export class AnalyticsEvent {
|
|
58
|
-
constructor(props: AnalyticsEventProps);
|
|
59
|
-
// (undocumented)
|
|
60
|
-
clone: () => AnalyticsEvent | null;
|
|
61
|
-
// (undocumented)
|
|
62
|
-
_isAnalyticsEvent: boolean;
|
|
63
|
-
// (undocumented)
|
|
64
|
-
payload: AnalyticsEventPayload;
|
|
65
|
-
// (undocumented)
|
|
66
|
-
update(updater: AnalyticsEventUpdater): this;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// @public (undocumented)
|
|
70
|
-
type AnalyticsEventCallback = (payload: AnalyticsEventPayload) => AnalyticsEventPayload;
|
|
71
|
-
|
|
72
|
-
// @public (undocumented)
|
|
73
|
-
type AnalyticsEventCreator = (create: CreateUIAnalyticsEvent, props: Record<string, any>) => UIAnalyticsEvent | undefined;
|
|
74
|
-
|
|
75
|
-
// @public (undocumented)
|
|
76
|
-
export type AnalyticsEventPayload = Record<string, any>;
|
|
77
|
-
|
|
78
|
-
// @public (undocumented)
|
|
79
|
-
export type AnalyticsEventProps = {
|
|
80
|
-
payload: AnalyticsEventPayload;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
// @public (undocumented)
|
|
84
|
-
type AnalyticsEventUpdater = AnalyticsEventCallback | AnalyticsEventPayload;
|
|
85
|
-
|
|
86
|
-
// @public (undocumented)
|
|
87
|
-
export let AnalyticsListener: AnalyticsListenerFunction;
|
|
88
|
-
|
|
89
|
-
// @public (undocumented)
|
|
90
|
-
type AnalyticsListenerFunction = (props: {
|
|
91
|
-
children?: React.ReactNode;
|
|
92
|
-
channel?: string;
|
|
93
|
-
onEvent: (event: UIAnalyticsEvent, channel?: string) => void;
|
|
94
|
-
}, context?: AnalyticsReactContextInterface) => JSX.Element;
|
|
95
|
-
|
|
96
|
-
export { AnalyticsReactContext }
|
|
97
|
-
|
|
98
|
-
export { AnalyticsReactContextInterface }
|
|
99
|
-
|
|
100
|
-
// @public (undocumented)
|
|
101
|
-
type ChannelIdentifier = string;
|
|
102
|
-
|
|
103
|
-
// @public (undocumented)
|
|
104
|
-
export function cleanProps(props: Record<string, any>): {
|
|
105
|
-
[x: string]: any;
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
// @public (undocumented)
|
|
109
|
-
type Context = Record<string, any>[];
|
|
110
|
-
|
|
111
|
-
// @public (undocumented)
|
|
112
|
-
export const createAndFireEvent: (channel?: string) => (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent;
|
|
113
|
-
|
|
114
|
-
// @public (undocumented)
|
|
115
|
-
type CreateEventMap = Record<string, CreateEventMapValue>;
|
|
116
|
-
|
|
117
|
-
// @public (undocumented)
|
|
118
|
-
type CreateEventMapValue = AnalyticsEventCreator | AnalyticsEventPayload;
|
|
119
|
-
|
|
120
|
-
// @public (undocumented)
|
|
121
|
-
export type CreateUIAnalyticsEvent = (payload: AnalyticsEventPayload) => UIAnalyticsEvent;
|
|
122
|
-
|
|
123
|
-
// @public (undocumented)
|
|
124
|
-
export const isAnalyticsEvent: (obj: any) => boolean;
|
|
125
|
-
|
|
126
|
-
// @public (undocumented)
|
|
127
|
-
export const isUIAnalyticsEvent: (obj: any) => boolean;
|
|
128
|
-
|
|
129
|
-
// @public (undocumented)
|
|
130
|
-
export class UIAnalyticsEvent extends AnalyticsEvent {
|
|
131
|
-
constructor(props: UIAnalyticsEventProps);
|
|
132
|
-
// (undocumented)
|
|
133
|
-
clone: () => UIAnalyticsEvent | null;
|
|
134
|
-
// (undocumented)
|
|
135
|
-
context: Context;
|
|
136
|
-
// (undocumented)
|
|
137
|
-
fire: (channel?: string) => void;
|
|
138
|
-
// (undocumented)
|
|
139
|
-
handlers: UIAnalyticsEventHandler[];
|
|
140
|
-
// (undocumented)
|
|
141
|
-
hasFired: boolean;
|
|
142
|
-
// (undocumented)
|
|
143
|
-
_isUIAnalyticsEvent: boolean;
|
|
144
|
-
// (undocumented)
|
|
145
|
-
update(updater: ((payload: AnalyticsEventPayload) => AnalyticsEventPayload) | Record<string, any>): this;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// @public (undocumented)
|
|
149
|
-
export type UIAnalyticsEventHandler = (event: UIAnalyticsEvent, channel?: ChannelIdentifier) => void;
|
|
150
|
-
|
|
151
|
-
// @public (undocumented)
|
|
152
|
-
export type UIAnalyticsEventProps = AnalyticsEventProps & {
|
|
153
|
-
context?: Context;
|
|
154
|
-
handlers?: UIAnalyticsEventHandler[];
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
// @public (undocumented)
|
|
158
|
-
export function useAnalyticsEvents(): UseAnalyticsEventsHook;
|
|
159
|
-
|
|
160
|
-
// @public (undocumented)
|
|
161
|
-
export type UseAnalyticsEventsHook = {
|
|
162
|
-
createAnalyticsEvent: CreateUIAnalyticsEvent;
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
// @public (undocumented)
|
|
166
|
-
export const useCallbackWithAnalytics: UseCallbackWithAnalyticsHook;
|
|
167
|
-
|
|
168
|
-
// @public (undocumented)
|
|
169
|
-
export type UseCallbackWithAnalyticsHook = (method: (...args: any[]) => void, payload: ((...args: any[]) => void) | Record<string, any>, channel?: string) => (...args: any[]) => void;
|
|
170
|
-
|
|
171
|
-
// @public (undocumented)
|
|
172
|
-
export function usePlatformLeafEventHandler<T>({ fn, action, componentName, actionSubject, packageName, packageVersion, analyticsData, }: UsePlatformLeafEventHandlerHookArgs<T>): (value: T) => void;
|
|
173
|
-
|
|
174
|
-
// @public (undocumented)
|
|
175
|
-
export type UsePlatformLeafEventHandlerHook<T> = (value: T) => void;
|
|
176
|
-
|
|
177
|
-
// @public (undocumented)
|
|
178
|
-
export type UsePlatformLeafEventHandlerHookArgs<T> = {
|
|
179
|
-
fn: (value: T, analyticsEvent: UIAnalyticsEvent) => void;
|
|
180
|
-
action: string;
|
|
181
|
-
componentName: string;
|
|
182
|
-
actionSubject?: string;
|
|
183
|
-
packageName: string;
|
|
184
|
-
packageVersion: string;
|
|
185
|
-
analyticsData?: Record<string, any>;
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
// @public (undocumented)
|
|
189
|
-
export function usePlatformLeafSyntheticEventHandler({ fn, action, componentName, packageName, packageVersion, analyticsData, }: UsePlatformLeafSyntheticEventHandlerHookArgs): () => void;
|
|
190
|
-
|
|
191
|
-
// @public (undocumented)
|
|
192
|
-
export type UsePlatformLeafSyntheticEventHandlerHook = () => void;
|
|
193
|
-
|
|
194
|
-
// @public (undocumented)
|
|
195
|
-
export type UsePlatformLeafSyntheticEventHandlerHookArgs = {
|
|
196
|
-
fn: (analyticsEvent: UIAnalyticsEvent) => void;
|
|
197
|
-
action: string;
|
|
198
|
-
componentName: string;
|
|
199
|
-
packageName: string;
|
|
200
|
-
packageVersion: string;
|
|
201
|
-
analyticsData?: Record<string, any>;
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
// @public (undocumented)
|
|
205
|
-
export const withAnalyticsContext: (defaultData?: any) => <Props, Component>(WrappedComponent: React_2.JSXElementConstructor<Props> & Component) => React_2.ForwardRefExoticComponent<React_2.PropsWithoutRef<JSX.LibraryManagedAttributes<Component, Props & WithContextProps>> & React_2.RefAttributes<any>>;
|
|
206
|
-
|
|
207
|
-
// @public (undocumented)
|
|
208
|
-
export const withAnalyticsEvents: (createEventMap?: CreateEventMap) => <Props extends WithAnalyticsEventsProps, Component>(WrappedComponent: React_2.JSXElementConstructor<Props> & Component) => React_2.ForwardRefExoticComponent<React_2.PropsWithoutRef<JSX.LibraryManagedAttributes<Component, Omit<Props, keyof WithAnalyticsEventsProps>>> & React_2.RefAttributes<any>>;
|
|
209
|
-
|
|
210
|
-
// @public (undocumented)
|
|
211
|
-
export interface WithAnalyticsEventsProps {
|
|
212
|
-
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
213
|
-
// (undocumented)
|
|
214
|
-
ref?: React_2.Ref<any>;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// @public (undocumented)
|
|
218
|
-
export interface WithContextProps {
|
|
219
|
-
// (undocumented)
|
|
220
|
-
analyticsContext?: Record<string, any>;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// (No @packageDocumentation comment for this package)
|
|
224
|
-
|
|
225
|
-
```
|