@atlaskit/analytics-next 9.1.4 → 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.
Files changed (40) hide show
  1. package/CHANGELOG.md +36 -30
  2. package/afm-cc/tsconfig.json +26 -0
  3. package/build/tsconfig.json +2 -1
  4. package/dist/cjs/components/AnalyticsContext/LegacyAnalyticsContext.js +1 -2
  5. package/dist/cjs/components/AnalyticsContext/ModernAnalyticsContext.js +1 -2
  6. package/dist/cjs/components/AnalyticsContext/index.js +8 -9
  7. package/dist/cjs/components/AnalyticsErrorBoundary.js +2 -3
  8. package/dist/cjs/components/AnalyticsListener/LegacyAnalyticsListener.js +1 -2
  9. package/dist/cjs/components/AnalyticsListener/ModernAnalyticsListener.js +1 -2
  10. package/dist/cjs/components/AnalyticsListener/index.js +8 -9
  11. package/dist/cjs/events/AnalyticsEvent.js +6 -8
  12. package/dist/cjs/events/UIAnalyticsEvent.js +4 -6
  13. package/dist/cjs/hocs/withAnalyticsContext.js +3 -4
  14. package/dist/cjs/hocs/withAnalyticsEvents.js +1 -2
  15. package/dist/cjs/hooks/useAnalyticsContext.js +2 -3
  16. package/dist/cjs/hooks/useCallbackWithAnalytics.js +2 -3
  17. package/dist/cjs/hooks/usePatchedProps.js +2 -2
  18. package/dist/cjs/hooks/usePlatformLeafEventHandler.js +2 -2
  19. package/dist/cjs/hooks/usePlatformLeafSyntheticEventHandler.js +2 -2
  20. package/dist/cjs/hooks/useTrackedRef.js +2 -3
  21. package/dist/cjs/test-utils/useRenderCounter.js +2 -3
  22. package/dist/cjs/utils/createAndFireEvent.js +2 -3
  23. package/dist/es2019/components/AnalyticsContext/index.js +7 -7
  24. package/dist/es2019/components/AnalyticsListener/index.js +7 -7
  25. package/dist/esm/components/AnalyticsContext/index.js +7 -7
  26. package/dist/esm/components/AnalyticsListener/index.js +7 -7
  27. package/dist/esm/events/AnalyticsEvent.js +3 -3
  28. package/dist/esm/events/UIAnalyticsEvent.js +1 -1
  29. package/dist/esm/hocs/withAnalyticsContext.js +2 -2
  30. package/dist/esm/hooks/usePatchedProps.js +2 -2
  31. package/dist/esm/hooks/usePlatformLeafEventHandler.js +2 -2
  32. package/dist/esm/hooks/usePlatformLeafSyntheticEventHandler.js +2 -2
  33. package/dist/types/components/AnalyticsContext/index.d.ts +1 -1
  34. package/dist/types/components/AnalyticsListener/index.d.ts +1 -1
  35. package/dist/types-ts4.5/components/AnalyticsContext/index.d.ts +1 -1
  36. package/dist/types-ts4.5/components/AnalyticsListener/index.d.ts +1 -1
  37. package/package.json +10 -3
  38. package/dist/types/performance/examples.d.ts +0 -5
  39. package/dist/types-ts4.5/performance/examples.d.ts +0 -5
  40. package/tmp/api-report-tmp.d.ts +0 -225
package/CHANGELOG.md CHANGED
@@ -1,136 +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
+
3
9
  ## 9.1.4
4
10
 
5
11
  ### Patch Changes
6
12
 
7
- - [`9af31f3c1ae`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9af31f3c1ae) - Delete version.json
13
+ - [#38731](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38731) [`9af31f3c1ae`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9af31f3c1ae) - Delete version.json
8
14
 
9
15
  ## 9.1.3
10
16
 
11
17
  ### Patch Changes
12
18
 
13
- - [`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
14
20
 
15
21
  ## 9.1.2
16
22
 
17
23
  ### Patch Changes
18
24
 
19
- - [`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`
20
26
 
21
27
  ## 9.1.1
22
28
 
23
29
  ### Patch Changes
24
30
 
25
- - [`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
26
32
 
27
33
  ## 9.1.0
28
34
 
29
35
  ### Minor Changes
30
36
 
31
- - [`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
32
38
 
33
39
  ## 9.0.2
34
40
 
35
41
  ### Patch Changes
36
42
 
37
- - [`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
38
44
 
39
45
  ## 9.0.1
40
46
 
41
47
  ### Patch Changes
42
48
 
43
- - [`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
44
50
 
45
51
  ## 9.0.0
46
52
 
47
53
  ### Major Changes
48
54
 
49
- - [`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
50
56
 
51
57
  ## 8.3.5
52
58
 
53
59
  ### Patch Changes
54
60
 
55
- - [`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
56
62
 
57
63
  ## 8.3.4
58
64
 
59
65
  ### Patch Changes
60
66
 
61
- - [`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
62
68
 
63
69
  ## 8.3.3
64
70
 
65
71
  ### Patch Changes
66
72
 
67
- - [`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`
68
74
 
69
75
  ## 8.3.2
70
76
 
71
77
  ### Patch Changes
72
78
 
73
- - [`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`.
74
80
 
75
81
  ## 8.3.1
76
82
 
77
83
  ### Patch Changes
78
84
 
79
- - [`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
80
86
 
81
87
  ## 8.3.0
82
88
 
83
89
  ### Minor Changes
84
90
 
85
- - [`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.
86
92
 
87
93
  ## 8.2.1
88
94
 
89
95
  ### Patch Changes
90
96
 
91
- - [`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
92
98
 
93
99
  ## 8.2.0
94
100
 
95
101
  ### Minor Changes
96
102
 
97
- - [`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
98
104
 
99
105
  ## 8.1.4
100
106
 
101
107
  ### Patch Changes
102
108
 
103
- - [`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`
104
110
 
105
111
  ## 8.1.3
106
112
 
107
113
  ### Patch Changes
108
114
 
109
- - [`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
110
116
 
111
117
  ## 8.1.2
112
118
 
113
119
  ### Patch Changes
114
120
 
115
- - [`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
116
122
 
117
123
  ## 8.1.1
118
124
 
119
125
  ### Patch Changes
120
126
 
121
- - [`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
122
128
 
123
129
  ## 8.1.0
124
130
 
125
131
  ### Minor Changes
126
132
 
127
- - [`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
128
134
 
129
135
  ## 8.0.2
130
136
 
131
137
  ### Patch Changes
132
138
 
133
- - [`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.
134
140
  This requires version 3.8 of Typescript, read more about how we handle Typescript versions here: https://atlaskit.atlassian.com/get-started
135
141
  Also add `typescript` to `devDependencies` to denote version that the package was built with.
136
142
 
@@ -138,13 +144,13 @@
138
144
 
139
145
  ### Patch Changes
140
146
 
141
- - [`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
142
148
 
143
149
  ## 8.0.0
144
150
 
145
151
  ### Major Changes
146
152
 
147
- - [`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.
148
154
 
149
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.
150
156
 
@@ -152,13 +158,13 @@
152
158
 
153
159
  ### Patch Changes
154
160
 
155
- - [`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
156
162
 
157
163
  ## 7.1.0
158
164
 
159
165
  ### Minor Changes
160
166
 
161
- - [`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
162
168
 
163
169
  - Added a new hook `useAnalyticsEventHandler` for sole use in Atlaskit components
164
170
 
@@ -213,7 +219,7 @@
213
219
 
214
220
  ### Patch Changes
215
221
 
216
- - [`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
217
223
 
218
224
  Since tslib is a dependency for all our packages we recommend that products also follow this tslib upgrade
219
225
  to prevent duplicates of tslib being bundled.
@@ -224,19 +230,19 @@
224
230
 
225
231
  ### Patch Changes
226
232
 
227
- - [`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
228
234
 
229
235
  ## 7.0.1
230
236
 
231
237
  ### Patch Changes
232
238
 
233
- - [`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
234
240
 
235
241
  ## 7.0.0
236
242
 
237
243
  ### Major Changes
238
244
 
239
- - [`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.
240
246
  For more information see: https://community.developer.atlassian.com/t/atlaskit-to-drop-support-for-internet-explorer-11-from-1st-july-2020/39534
241
247
 
242
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
+ }
@@ -12,6 +12,7 @@
12
12
  "exclude": [
13
13
  "../src/**/__tests__/*",
14
14
  "../src/**/*.test.*",
15
- "../src/**/test.*"
15
+ "../src/**/test.*",
16
+ "../src/performance/examples.tsx"
16
17
  ]
17
18
  }
@@ -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;
@@ -31,5 +31,4 @@ var AnalyticsContext = function AnalyticsContext(_ref) {
31
31
  value: value
32
32
  }, children);
33
33
  };
34
- var _default = AnalyticsContext;
35
- exports.default = _default;
34
+ 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 _process$env;
11
- var ExportedAnalyticsContext;
12
- if (typeof process !== 'undefined' && process !== null && (_process$env = process.env) !== null && _process$env !== void 0 && _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']) {
13
- ExportedAnalyticsContext = _ModernAnalyticsContext.default;
14
- } else {
15
- ExportedAnalyticsContext = _LegacyAnalyticsContext.default;
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;
@@ -38,5 +38,4 @@ var AnalyticsListener = function AnalyticsListener(_ref) {
38
38
  value: value
39
39
  }, children);
40
40
  };
41
- var _default = AnalyticsListener;
42
- exports.default = _default;
41
+ 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 _process$env;
11
- var ExportedAnalyticsListener;
12
- if (typeof process !== 'undefined' && process !== null && (_process$env = process.env) !== null && _process$env !== void 0 && _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']) {
13
- ExportedAnalyticsListener = _ModernAnalyticsListener.default;
14
- } else {
15
- ExportedAnalyticsListener = _LegacyAnalyticsListener.default;
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(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
13
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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 ? void 0 : (_obj$constructor = obj.constructor) === null || _obj$constructor === void 0 ? void 0 : _obj$constructor.name) === 'AnalyticsEvent';
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.isAnalyticsEvent = isAnalyticsEvent;
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 ? void 0 : (_obj$constructor = obj.constructor) === null || _obj$constructor === void 0 ? void 0 : _obj$constructor.name) === 'UIAnalyticsEvent';
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.isUIAnalyticsEvent = isUIAnalyticsEvent;
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(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
18
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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;
@@ -33,5 +33,4 @@ var withAnalyticsEvents = function withAnalyticsEvents() {
33
33
  return WithAnalyticsEvents;
34
34
  };
35
35
  };
36
- var _default = withAnalyticsEvents;
37
- exports.default = _default;
36
+ var _default = exports.default = withAnalyticsEvents;
@@ -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(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
13
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
13
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
13
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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
- var _process$env;
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
- let ExportedAnalyticsContext;
5
- if (typeof process !== 'undefined' && process !== null && (_process$env = process.env) !== null && _process$env !== void 0 && _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']) {
6
- ExportedAnalyticsContext = ModernAnalyticsContext;
7
- } else {
8
- ExportedAnalyticsContext = LegacyAnalyticsContext;
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
- var _process$env;
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
- let ExportedAnalyticsListener;
5
- if (typeof process !== 'undefined' && process !== null && (_process$env = process.env) !== null && _process$env !== void 0 && _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']) {
6
- ExportedAnalyticsListener = ModernAnalyticsListener;
7
- } else {
8
- ExportedAnalyticsListener = LegacyAnalyticsListener;
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
- var _process$env;
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
- if (typeof process !== 'undefined' && process !== null && (_process$env = process.env) !== null && _process$env !== void 0 && _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']) {
6
- ExportedAnalyticsContext = ModernAnalyticsContext;
7
- } else {
8
- ExportedAnalyticsContext = LegacyAnalyticsContext;
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
- var _process$env;
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
- if (typeof process !== 'undefined' && process !== null && (_process$env = process.env) !== null && _process$env !== void 0 && _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']) {
6
- ExportedAnalyticsListener = ModernAnalyticsListener;
7
- } else {
8
- ExportedAnalyticsListener = LegacyAnalyticsListener;
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(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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 ? void 0 : (_obj$constructor = obj.constructor) === null || _obj$constructor === void 0 ? void 0 : _obj$constructor.name) === 'AnalyticsEvent';
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 ? void 0 : (_obj$constructor = obj.constructor) === null || _obj$constructor === void 0 ? void 0 : _obj$constructor.name) === 'UIAnalyticsEvent';
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(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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,3 +1,3 @@
1
1
  import { AnalyticsContextFunction } from './types';
2
- declare let ExportedAnalyticsContext: AnalyticsContextFunction;
2
+ declare const ExportedAnalyticsContext: AnalyticsContextFunction;
3
3
  export default ExportedAnalyticsContext;
@@ -1,3 +1,3 @@
1
1
  import { AnalyticsListenerFunction } from './types';
2
- declare let ExportedAnalyticsListener: AnalyticsListenerFunction;
2
+ declare const ExportedAnalyticsListener: AnalyticsListenerFunction;
3
3
  export default ExportedAnalyticsListener;
@@ -1,3 +1,3 @@
1
1
  import { AnalyticsContextFunction } from './types';
2
- declare let ExportedAnalyticsContext: AnalyticsContextFunction;
2
+ declare const ExportedAnalyticsContext: AnalyticsContextFunction;
3
3
  export default ExportedAnalyticsContext;
@@ -1,3 +1,3 @@
1
1
  import { AnalyticsListenerFunction } from './types';
2
- declare let ExportedAnalyticsListener: AnalyticsListenerFunction;
2
+ declare const ExportedAnalyticsListener: AnalyticsListenerFunction;
3
3
  export default ExportedAnalyticsListener;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@atlaskit/analytics-next",
3
- "version": "9.1.4",
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"
@@ -61,6 +62,7 @@
61
62
  "devDependencies": {
62
63
  "@atlaskit/ssr": "*",
63
64
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
65
+ "@atlassian/feature-flags-test-utils": "*",
64
66
  "@testing-library/react": "^12.1.5",
65
67
  "enzyme": "^3.10.0",
66
68
  "react-dom": "^16.8.0",
@@ -90,5 +92,10 @@
90
92
  ]
91
93
  }
92
94
  },
95
+ "platform-feature-flags": {
96
+ "platform.analytics-next-use-modern-context_fqgbx": {
97
+ "type": "boolean"
98
+ }
99
+ },
93
100
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
94
- }
101
+ }
@@ -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;
@@ -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
- ```