@atlaskit/analytics-next 9.2.3 → 9.3.1
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 +330 -132
- package/afm-jira/tsconfig.json +25 -0
- package/dist/cjs/hocs/withAnalyticsContext.js +1 -5
- package/dist/cjs/hocs/withAnalyticsEvents.js +1 -5
- package/dist/es2019/hocs/withAnalyticsContext.js +1 -5
- package/dist/es2019/hocs/withAnalyticsEvents.js +1 -5
- package/dist/esm/hocs/withAnalyticsContext.js +1 -5
- package/dist/esm/hocs/withAnalyticsEvents.js +1 -5
- package/dist/types/components/AnalyticsContext/LegacyAnalyticsContext.d.ts +1 -1
- package/dist/types/components/AnalyticsContext/ModernAnalyticsContext.d.ts +1 -1
- package/dist/types/components/AnalyticsContext/index.d.ts +1 -1
- package/dist/types/components/AnalyticsContext/types.d.ts +1 -1
- package/dist/types/components/AnalyticsErrorBoundary.d.ts +2 -2
- package/dist/types/components/AnalyticsListener/LegacyAnalyticsListener.d.ts +2 -2
- package/dist/types/components/AnalyticsListener/ModernAnalyticsListener.d.ts +1 -1
- package/dist/types/components/AnalyticsListener/index.d.ts +1 -1
- package/dist/types/components/AnalyticsListener/types.d.ts +2 -2
- package/dist/types/events/UIAnalyticsEvent.d.ts +1 -1
- package/dist/types/hocs/withAnalyticsContext.d.ts +1 -1
- package/dist/types/hocs/withAnalyticsEvents.d.ts +2 -2
- package/dist/types/hooks/useAnalyticsContext.d.ts +1 -1
- package/dist/types/hooks/useAnalyticsEvents.d.ts +1 -1
- package/dist/types/hooks/usePatchedProps.d.ts +1 -1
- package/dist/types/hooks/usePlatformLeafEventHandler.d.ts +1 -1
- package/dist/types/hooks/usePlatformLeafSyntheticEventHandler.d.ts +1 -1
- package/dist/types/hooks/useTrackedRef.d.ts +1 -1
- package/dist/types/index.d.ts +4 -4
- package/dist/types/types.d.ts +2 -2
- package/dist/types/utils/createAndFireEvent.d.ts +2 -2
- package/dist/types-ts4.5/components/AnalyticsContext/LegacyAnalyticsContext.d.ts +1 -1
- package/dist/types-ts4.5/components/AnalyticsContext/ModernAnalyticsContext.d.ts +1 -1
- package/dist/types-ts4.5/components/AnalyticsContext/index.d.ts +1 -1
- package/dist/types-ts4.5/components/AnalyticsContext/types.d.ts +1 -1
- package/dist/types-ts4.5/components/AnalyticsErrorBoundary.d.ts +2 -2
- package/dist/types-ts4.5/components/AnalyticsListener/LegacyAnalyticsListener.d.ts +2 -2
- package/dist/types-ts4.5/components/AnalyticsListener/ModernAnalyticsListener.d.ts +1 -1
- package/dist/types-ts4.5/components/AnalyticsListener/index.d.ts +1 -1
- package/dist/types-ts4.5/components/AnalyticsListener/types.d.ts +2 -2
- package/dist/types-ts4.5/events/UIAnalyticsEvent.d.ts +1 -1
- package/dist/types-ts4.5/hocs/withAnalyticsContext.d.ts +1 -1
- package/dist/types-ts4.5/hocs/withAnalyticsEvents.d.ts +2 -2
- package/dist/types-ts4.5/hooks/useAnalyticsContext.d.ts +1 -1
- package/dist/types-ts4.5/hooks/useAnalyticsEvents.d.ts +1 -1
- package/dist/types-ts4.5/hooks/usePatchedProps.d.ts +1 -1
- package/dist/types-ts4.5/hooks/usePlatformLeafEventHandler.d.ts +1 -1
- package/dist/types-ts4.5/hooks/usePlatformLeafSyntheticEventHandler.d.ts +1 -1
- package/dist/types-ts4.5/hooks/useTrackedRef.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +4 -4
- package/dist/types-ts4.5/types.d.ts +2 -2
- package/dist/types-ts4.5/utils/createAndFireEvent.d.ts +2 -2
- package/docs/0-intro.tsx +17 -17
- package/docs/20-usage-with-presentational-components.tsx +38 -39
- package/docs/40-listeners.tsx +5 -5
- package/docs/50-error-boundary.tsx +5 -5
- package/docs/70-advanced-usage.tsx +21 -21
- package/package.json +98 -100
- package/report.api.md +115 -125
package/docs/40-listeners.tsx
CHANGED
|
@@ -8,9 +8,9 @@ export default md`
|
|
|
8
8
|
An \`AnalyticsListener\` wraps your app and listens to any events which are fired within it.
|
|
9
9
|
|
|
10
10
|
${(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
<Props
|
|
12
|
+
heading="AnalyticsListener Props"
|
|
13
|
+
props={require('!!extract-react-types-loader!../src/components/AnalyticsListener/LegacyAnalyticsListener')}
|
|
14
|
+
/>
|
|
15
|
+
)}
|
|
16
16
|
`;
|
|
@@ -46,9 +46,9 @@ class ButtonWithAnalyticsErrorBoundary extends React.Component {
|
|
|
46
46
|
`}
|
|
47
47
|
|
|
48
48
|
${(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
<Props
|
|
50
|
+
heading="AnalyticsErrorBoundary Props"
|
|
51
|
+
props={require('!!extract-react-types-loader!../src/components/AnalyticsErrorBoundary')}
|
|
52
|
+
/>
|
|
53
|
+
)}
|
|
54
54
|
`;
|
|
@@ -52,13 +52,13 @@ const SaveButton = ({ onClick }) => (
|
|
|
52
52
|
Below is a fleshed out example demonstrating how to add extra information to the event's payload.
|
|
53
53
|
|
|
54
54
|
${(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
<Example
|
|
56
|
+
packageName="@atlaskit/analytics-next"
|
|
57
|
+
Component={require('../examples/40-updating-an-event').default}
|
|
58
|
+
title="Updating an event's payload"
|
|
59
|
+
source={require('!!raw-loader!../examples/40-updating-an-event')}
|
|
60
|
+
/>
|
|
61
|
+
)}
|
|
62
62
|
|
|
63
63
|
<a name="using-a-channel"></a>
|
|
64
64
|
## Using a channel
|
|
@@ -162,13 +162,13 @@ const ButtonWithAnalytics = withAnalyticsEvents({
|
|
|
162
162
|
`}
|
|
163
163
|
|
|
164
164
|
${(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
165
|
+
<Example
|
|
166
|
+
packageName="@atlaskit/analytics-next"
|
|
167
|
+
Component={require('../examples/30-passing-events-to-a-callback').default}
|
|
168
|
+
title="Passing events through callbacks"
|
|
169
|
+
source={require('!!raw-loader!../examples/30-passing-events-to-a-callback')}
|
|
170
|
+
/>
|
|
171
|
+
)}
|
|
172
172
|
|
|
173
173
|
<a name="cloning-an-event"></a>
|
|
174
174
|
## Cloning an event
|
|
@@ -220,13 +220,13 @@ const FormWithAnalytics = withAnalyticsEvents({
|
|
|
220
220
|
and return a clone of the event.
|
|
221
221
|
|
|
222
222
|
${(
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
223
|
+
<Example
|
|
224
|
+
packageName="@atlaskit/analytics-next"
|
|
225
|
+
Component={require('../examples/50-cloning-an-event').default}
|
|
226
|
+
title="Cloning an event"
|
|
227
|
+
source={require('!!raw-loader!../examples/50-cloning-an-event')}
|
|
228
|
+
/>
|
|
229
|
+
)}
|
|
230
230
|
|
|
231
231
|
<a name="tracking-events-outside-the-ui"></a>
|
|
232
232
|
## Tracking events outside the UI
|
package/package.json
CHANGED
|
@@ -1,101 +1,99 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
101
|
-
}
|
|
2
|
+
"name": "@atlaskit/analytics-next",
|
|
3
|
+
"version": "9.3.1",
|
|
4
|
+
"description": "React components, HOCs and hooks to assist with tracking user activity with React components",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"registry": "https://registry.npmjs.org/"
|
|
7
|
+
},
|
|
8
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
9
|
+
"author": "Atlassian Pty Ltd",
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
|
+
"main": "dist/cjs/index.js",
|
|
12
|
+
"module": "dist/esm/index.js",
|
|
13
|
+
"module:es2019": "dist/es2019/index.js",
|
|
14
|
+
"types": "dist/types/index.d.ts",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
">=4.5 <4.9": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/types-ts4.5/*",
|
|
19
|
+
"dist/types-ts4.5/index.d.ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"atlaskit:src": "src/index.ts",
|
|
25
|
+
"atlassian": {
|
|
26
|
+
"team": "UIP Frontend Observability",
|
|
27
|
+
"releaseModel": "continuous",
|
|
28
|
+
"productPushConsumption": [
|
|
29
|
+
"jira"
|
|
30
|
+
],
|
|
31
|
+
"website": {
|
|
32
|
+
"name": "Analytics next"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"./types": "./src/types.ts",
|
|
36
|
+
"af:exports": {
|
|
37
|
+
"./types": "./src/types.ts",
|
|
38
|
+
"./AnalyticsContext": "./src/components/AnalyticsContext/index.tsx",
|
|
39
|
+
"./AnalyticsListener": "./src/components/AnalyticsListener/index.tsx",
|
|
40
|
+
"./AnalyticsErrorBoundary": "./src/components/AnalyticsErrorBoundary.tsx",
|
|
41
|
+
"./withAnalyticsEvents": "./src/hocs/withAnalyticsEvents.tsx",
|
|
42
|
+
"./withAnalyticsContext": "./src/hocs/withAnalyticsContext.tsx",
|
|
43
|
+
"./usePlatformLeafEventHandler": "./src/hooks/usePlatformLeafEventHandler.ts",
|
|
44
|
+
"./useAnalyticsEvents": "./src/hooks/useAnalyticsEvents.ts",
|
|
45
|
+
"./useCallbackWithAnalytics": "./src/hooks/useCallbackWithAnalytics.ts",
|
|
46
|
+
"./usePatchedProps": "./src/hooks/usePatchedProps.ts",
|
|
47
|
+
"./AnalyticsEvent": "./src/events/AnalyticsEvent.ts",
|
|
48
|
+
"./UIAnalyticsEvent": "./src/events/UIAnalyticsEvent.ts",
|
|
49
|
+
"./createAndFireEvents": "./src/utils/createAndFireEvent.ts",
|
|
50
|
+
".": "./src/index.ts"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
54
|
+
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
55
|
+
"@babel/runtime": "^7.0.0",
|
|
56
|
+
"prop-types": "^15.5.10",
|
|
57
|
+
"use-memo-one": "^1.1.1"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"react": "^16.8.0"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@atlaskit/ssr": "*",
|
|
64
|
+
"@atlassian/feature-flags-test-utils": "*",
|
|
65
|
+
"@testing-library/react": "^12.1.5",
|
|
66
|
+
"enzyme": "^3.10.0",
|
|
67
|
+
"react-dom": "^16.8.0",
|
|
68
|
+
"redux": "^3.7.2",
|
|
69
|
+
"storybook-addon-performance": "^0.16.0",
|
|
70
|
+
"typescript": "~5.4.2"
|
|
71
|
+
},
|
|
72
|
+
"techstack": {
|
|
73
|
+
"@atlassian/frontend": {
|
|
74
|
+
"import-structure": "atlassian-conventions"
|
|
75
|
+
},
|
|
76
|
+
"@repo/internal": {
|
|
77
|
+
"ui-components": [
|
|
78
|
+
"lite-mode"
|
|
79
|
+
],
|
|
80
|
+
"analytics": [
|
|
81
|
+
"analytics-next"
|
|
82
|
+
],
|
|
83
|
+
"design-tokens": [
|
|
84
|
+
"color"
|
|
85
|
+
],
|
|
86
|
+
"theming": [
|
|
87
|
+
"react-context"
|
|
88
|
+
],
|
|
89
|
+
"deprecation": [
|
|
90
|
+
"no-deprecated-imports"
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"platform-feature-flags": {
|
|
95
|
+
"platform.analytics-next-use-modern-context_fqgbx": {
|
|
96
|
+
"type": "boolean"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|