@atlaskit/analytics-next 11.1.0 → 11.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AnalyticsContext/package.json +1 -1
- package/AnalyticsDecorator/package.json +1 -1
- package/AnalyticsDelegate/package.json +1 -1
- package/AnalyticsErrorBoundary/package.json +1 -1
- package/AnalyticsEvent/package.json +1 -1
- package/AnalyticsListener/package.json +1 -1
- package/CHANGELOG.md +14 -0
- package/UIAnalyticsEvent/package.json +1 -1
- package/afm-adminhub/tsconfig.json +32 -0
- package/afm-cc/tsconfig.json +31 -25
- package/afm-dev-agents/tsconfig.json +32 -0
- package/afm-jira/tsconfig.json +7 -1
- package/afm-passionfruit/tsconfig.json +11 -2
- package/afm-post-office/tsconfig.json +7 -1
- package/afm-rovo-extension/tsconfig.json +32 -0
- package/afm-townsquare/tsconfig.json +32 -0
- package/afm-volt/tsconfig.json +32 -0
- package/build/tsconfig.json +23 -14
- package/createAndFireEvents/package.json +1 -1
- package/dist/cjs/hocs/withAnalyticsEvents.js +2 -0
- package/dist/es2019/hocs/withAnalyticsEvents.js +2 -0
- package/dist/esm/hocs/withAnalyticsEvents.js +2 -0
- package/dist/types/components/AnalyticsContext/types.d.ts +0 -1
- package/dist/types/components/AnalyticsDecorator/index.d.ts +4 -4
- package/dist/types/components/AnalyticsDelegate/index.d.ts +1 -1
- package/dist/types/components/AnalyticsErrorBoundary.d.ts +1 -1
- package/dist/types/components/AnalyticsListener/LegacyAnalyticsListener.d.ts +2 -2
- package/dist/types/components/AnalyticsListener/types.d.ts +2 -3
- package/dist/types/hocs/withAnalyticsEvents.d.ts +1 -1
- package/dist/types/hooks/usePlatformLeafEventHandler.d.ts +3 -3
- package/dist/types/hooks/usePlatformLeafSyntheticEventHandler.d.ts +2 -2
- package/dist/types/utils/withAnalytics.d.ts +3 -3
- package/dist/types-ts4.5/components/AnalyticsContext/types.d.ts +0 -1
- package/dist/types-ts4.5/components/AnalyticsDecorator/index.d.ts +4 -4
- package/dist/types-ts4.5/components/AnalyticsDelegate/index.d.ts +1 -1
- package/dist/types-ts4.5/components/AnalyticsErrorBoundary.d.ts +1 -1
- package/dist/types-ts4.5/components/AnalyticsListener/LegacyAnalyticsListener.d.ts +2 -2
- package/dist/types-ts4.5/components/AnalyticsListener/types.d.ts +2 -3
- package/dist/types-ts4.5/hocs/withAnalyticsEvents.d.ts +1 -1
- package/dist/types-ts4.5/hooks/usePlatformLeafEventHandler.d.ts +3 -3
- package/dist/types-ts4.5/hooks/usePlatformLeafSyntheticEventHandler.d.ts +2 -2
- package/dist/types-ts4.5/utils/withAnalytics.d.ts +3 -3
- package/docs/20-usage-with-presentational-components.tsx +3 -0
- package/package.json +4 -25
- package/tsconfig.json +8 -3
- package/types/package.json +1 -1
- package/useAnalyticsEvents/package.json +1 -1
- package/useCallbackWithAnalytics/package.json +1 -1
- package/usePatchedProps/package.json +1 -1
- package/usePlatformLeafEventHandler/package.json +1 -1
- package/withAnalytics/package.json +1 -1
- package/withAnalyticsContext/package.json +1 -1
- package/withAnalyticsEvents/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/analytics-next
|
|
2
2
|
|
|
3
|
+
## 11.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`604dd578f00d9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/604dd578f00d9) -
|
|
8
|
+
Types the withAnalyticsEvents WrappedComponent as allowing a forwardRefExoticComponent
|
|
9
|
+
|
|
10
|
+
## 11.1.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`3298a6307027c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3298a6307027c) -
|
|
15
|
+
Sorted type and interface props to improve Atlaskit docs
|
|
16
|
+
|
|
3
17
|
## 11.1.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../../tsconfig.entry-points.adminhub.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"target": "es5",
|
|
6
|
+
"outDir": "../../../../../adminhub/tsDist/@atlaskit__analytics-next/app",
|
|
7
|
+
"rootDir": "../",
|
|
8
|
+
"composite": true
|
|
9
|
+
},
|
|
10
|
+
"include": [
|
|
11
|
+
"../src/**/*.ts",
|
|
12
|
+
"../src/**/*.tsx"
|
|
13
|
+
],
|
|
14
|
+
"exclude": [
|
|
15
|
+
"../src/**/__tests__/*",
|
|
16
|
+
"../src/**/*.test.*",
|
|
17
|
+
"../src/**/test.*",
|
|
18
|
+
"../src/performance/examples.tsx",
|
|
19
|
+
"../docs/*",
|
|
20
|
+
"../src/**/examples.*",
|
|
21
|
+
"../src/**/examples/*",
|
|
22
|
+
"../src/**/examples/**/*",
|
|
23
|
+
"../src/**/*.stories.*",
|
|
24
|
+
"../src/**/stories/*",
|
|
25
|
+
"../src/**/stories/**/*"
|
|
26
|
+
],
|
|
27
|
+
"references": [
|
|
28
|
+
{
|
|
29
|
+
"path": "../../../platform/feature-flags/afm-adminhub/tsconfig.json"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -1,26 +1,32 @@
|
|
|
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
|
-
|
|
2
|
+
"extends": "../../../../tsconfig.entry-points.confluence.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"target": "es5",
|
|
6
|
+
"outDir": "../../../../../confluence/tsDist/@atlaskit__analytics-next",
|
|
7
|
+
"rootDir": "../",
|
|
8
|
+
"composite": true
|
|
9
|
+
},
|
|
10
|
+
"include": [
|
|
11
|
+
"../src/**/*.ts",
|
|
12
|
+
"../src/**/*.tsx"
|
|
13
|
+
],
|
|
14
|
+
"exclude": [
|
|
15
|
+
"../src/**/__tests__/*",
|
|
16
|
+
"../src/**/*.test.*",
|
|
17
|
+
"../src/**/test.*",
|
|
18
|
+
"../src/performance/examples.tsx",
|
|
19
|
+
"../docs/*",
|
|
20
|
+
"../src/**/examples.*",
|
|
21
|
+
"../src/**/examples/*",
|
|
22
|
+
"../src/**/examples/**/*",
|
|
23
|
+
"../src/**/*.stories.*",
|
|
24
|
+
"../src/**/stories/*",
|
|
25
|
+
"../src/**/stories/**/*"
|
|
26
|
+
],
|
|
27
|
+
"references": [
|
|
28
|
+
{
|
|
29
|
+
"path": "../../../platform/feature-flags/afm-cc/tsconfig.json"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../../tsconfig.entry-points.dev-agents.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"target": "es5",
|
|
6
|
+
"outDir": "../../../../../dev-agents/tsDist/@atlaskit__analytics-next/app",
|
|
7
|
+
"rootDir": "../",
|
|
8
|
+
"composite": true
|
|
9
|
+
},
|
|
10
|
+
"include": [
|
|
11
|
+
"../src/**/*.ts",
|
|
12
|
+
"../src/**/*.tsx"
|
|
13
|
+
],
|
|
14
|
+
"exclude": [
|
|
15
|
+
"../src/**/__tests__/*",
|
|
16
|
+
"../src/**/*.test.*",
|
|
17
|
+
"../src/**/test.*",
|
|
18
|
+
"../src/performance/examples.tsx",
|
|
19
|
+
"../docs/*",
|
|
20
|
+
"../src/**/examples.*",
|
|
21
|
+
"../src/**/examples/*",
|
|
22
|
+
"../src/**/examples/**/*",
|
|
23
|
+
"../src/**/*.stories.*",
|
|
24
|
+
"../src/**/stories/*",
|
|
25
|
+
"../src/**/stories/**/*"
|
|
26
|
+
],
|
|
27
|
+
"references": [
|
|
28
|
+
{
|
|
29
|
+
"path": "../../../platform/feature-flags/afm-dev-agents/tsconfig.json"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
package/afm-jira/tsconfig.json
CHANGED
|
@@ -16,7 +16,13 @@
|
|
|
16
16
|
"../src/**/*.test.*",
|
|
17
17
|
"../src/**/test.*",
|
|
18
18
|
"../src/performance/examples.tsx",
|
|
19
|
-
"../docs/*"
|
|
19
|
+
"../docs/*",
|
|
20
|
+
"../src/**/examples.*",
|
|
21
|
+
"../src/**/examples/*",
|
|
22
|
+
"../src/**/examples/**/*",
|
|
23
|
+
"../src/**/*.stories.*",
|
|
24
|
+
"../src/**/stories/*",
|
|
25
|
+
"../src/**/stories/**/*"
|
|
20
26
|
],
|
|
21
27
|
"references": [
|
|
22
28
|
{
|
|
@@ -7,13 +7,22 @@
|
|
|
7
7
|
"rootDir": "../",
|
|
8
8
|
"composite": true
|
|
9
9
|
},
|
|
10
|
-
"include": [
|
|
10
|
+
"include": [
|
|
11
|
+
"../src/**/*.ts",
|
|
12
|
+
"../src/**/*.tsx"
|
|
13
|
+
],
|
|
11
14
|
"exclude": [
|
|
12
15
|
"../src/**/__tests__/*",
|
|
13
16
|
"../src/**/*.test.*",
|
|
14
17
|
"../src/**/test.*",
|
|
15
18
|
"../src/performance/examples.tsx",
|
|
16
|
-
"../docs/*"
|
|
19
|
+
"../docs/*",
|
|
20
|
+
"../src/**/examples.*",
|
|
21
|
+
"../src/**/examples/*",
|
|
22
|
+
"../src/**/examples/**/*",
|
|
23
|
+
"../src/**/*.stories.*",
|
|
24
|
+
"../src/**/stories/*",
|
|
25
|
+
"../src/**/stories/**/*"
|
|
17
26
|
],
|
|
18
27
|
"references": [
|
|
19
28
|
{
|
|
@@ -16,7 +16,13 @@
|
|
|
16
16
|
"../src/**/*.test.*",
|
|
17
17
|
"../src/**/test.*",
|
|
18
18
|
"../src/performance/examples.tsx",
|
|
19
|
-
"../docs/*"
|
|
19
|
+
"../docs/*",
|
|
20
|
+
"../src/**/examples.*",
|
|
21
|
+
"../src/**/examples/*",
|
|
22
|
+
"../src/**/examples/**/*",
|
|
23
|
+
"../src/**/*.stories.*",
|
|
24
|
+
"../src/**/stories/*",
|
|
25
|
+
"../src/**/stories/**/*"
|
|
20
26
|
],
|
|
21
27
|
"references": [
|
|
22
28
|
{
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../../tsconfig.entry-points.rovo-extension.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"target": "es5",
|
|
6
|
+
"outDir": "../../../../../rovo-extension/tsDist/@atlaskit__analytics-next/app",
|
|
7
|
+
"rootDir": "../",
|
|
8
|
+
"composite": true
|
|
9
|
+
},
|
|
10
|
+
"include": [
|
|
11
|
+
"../src/**/*.ts",
|
|
12
|
+
"../src/**/*.tsx"
|
|
13
|
+
],
|
|
14
|
+
"exclude": [
|
|
15
|
+
"../src/**/__tests__/*",
|
|
16
|
+
"../src/**/*.test.*",
|
|
17
|
+
"../src/**/test.*",
|
|
18
|
+
"../src/performance/examples.tsx",
|
|
19
|
+
"../docs/*",
|
|
20
|
+
"../src/**/examples.*",
|
|
21
|
+
"../src/**/examples/*",
|
|
22
|
+
"../src/**/examples/**/*",
|
|
23
|
+
"../src/**/*.stories.*",
|
|
24
|
+
"../src/**/stories/*",
|
|
25
|
+
"../src/**/stories/**/*"
|
|
26
|
+
],
|
|
27
|
+
"references": [
|
|
28
|
+
{
|
|
29
|
+
"path": "../../../platform/feature-flags/afm-rovo-extension/tsconfig.json"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../../tsconfig.entry-points.townsquare.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"target": "es5",
|
|
6
|
+
"outDir": "../../../../../townsquare/tsDist/@atlaskit__analytics-next/app",
|
|
7
|
+
"rootDir": "../",
|
|
8
|
+
"composite": true
|
|
9
|
+
},
|
|
10
|
+
"include": [
|
|
11
|
+
"../src/**/*.ts",
|
|
12
|
+
"../src/**/*.tsx"
|
|
13
|
+
],
|
|
14
|
+
"exclude": [
|
|
15
|
+
"../src/**/__tests__/*",
|
|
16
|
+
"../src/**/*.test.*",
|
|
17
|
+
"../src/**/test.*",
|
|
18
|
+
"../src/performance/examples.tsx",
|
|
19
|
+
"../docs/*",
|
|
20
|
+
"../src/**/examples.*",
|
|
21
|
+
"../src/**/examples/*",
|
|
22
|
+
"../src/**/examples/**/*",
|
|
23
|
+
"../src/**/*.stories.*",
|
|
24
|
+
"../src/**/stories/*",
|
|
25
|
+
"../src/**/stories/**/*"
|
|
26
|
+
],
|
|
27
|
+
"references": [
|
|
28
|
+
{
|
|
29
|
+
"path": "../../../platform/feature-flags/afm-townsquare/tsconfig.json"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../../tsconfig.entry-points.volt.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"target": "es5",
|
|
6
|
+
"outDir": "../../../../../volt/tsDist/@atlaskit__analytics-next/app",
|
|
7
|
+
"rootDir": "../",
|
|
8
|
+
"composite": true
|
|
9
|
+
},
|
|
10
|
+
"include": [
|
|
11
|
+
"../src/**/*.ts",
|
|
12
|
+
"../src/**/*.tsx"
|
|
13
|
+
],
|
|
14
|
+
"exclude": [
|
|
15
|
+
"../src/**/__tests__/*",
|
|
16
|
+
"../src/**/*.test.*",
|
|
17
|
+
"../src/**/test.*",
|
|
18
|
+
"../src/performance/examples.tsx",
|
|
19
|
+
"../docs/*",
|
|
20
|
+
"../src/**/examples.*",
|
|
21
|
+
"../src/**/examples/*",
|
|
22
|
+
"../src/**/examples/**/*",
|
|
23
|
+
"../src/**/*.stories.*",
|
|
24
|
+
"../src/**/stories/*",
|
|
25
|
+
"../src/**/stories/**/*"
|
|
26
|
+
],
|
|
27
|
+
"references": [
|
|
28
|
+
{
|
|
29
|
+
"path": "../../../platform/feature-flags/afm-volt/tsconfig.json"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
package/build/tsconfig.json
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
"extends": "../tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"target": "es5",
|
|
6
|
+
"paths": {}
|
|
7
|
+
},
|
|
8
|
+
"include": [
|
|
9
|
+
"../src/**/*.ts",
|
|
10
|
+
"../src/**/*.tsx"
|
|
11
|
+
],
|
|
12
|
+
"exclude": [
|
|
13
|
+
"../src/**/__tests__/*",
|
|
14
|
+
"../src/**/*.test.*",
|
|
15
|
+
"../src/**/test.*",
|
|
16
|
+
"../src/performance/examples.tsx",
|
|
17
|
+
"../docs/*",
|
|
18
|
+
"../src/**/examples.*",
|
|
19
|
+
"../src/**/examples/*",
|
|
20
|
+
"../src/**/examples/**/*",
|
|
21
|
+
"../src/**/*.stories.*",
|
|
22
|
+
"../src/**/stories/*",
|
|
23
|
+
"../src/**/stories/**/*"
|
|
24
|
+
]
|
|
16
25
|
}
|
|
@@ -15,6 +15,8 @@ var withAnalyticsEvents = function withAnalyticsEvents() {
|
|
|
15
15
|
var createEventMap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
16
16
|
return function (WrappedComponent) {
|
|
17
17
|
var WithAnalyticsEvents = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
19
|
+
// @ts-ignore: to unblock React 18.2.0 -> 18.3.1 version bump in Jira
|
|
18
20
|
var _usePatchedProps = (0, _usePatchedProps2.usePatchedProps)(createEventMap, props),
|
|
19
21
|
patchedEventProps = _usePatchedProps.patchedEventProps;
|
|
20
22
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
@@ -4,6 +4,8 @@ import { useAnalyticsEvents } from '../hooks/useAnalyticsEvents';
|
|
|
4
4
|
import { usePatchedProps } from '../hooks/usePatchedProps';
|
|
5
5
|
const withAnalyticsEvents = (createEventMap = {}) => WrappedComponent => {
|
|
6
6
|
const WithAnalyticsEvents = /*#__PURE__*/forwardRef((props, ref) => {
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
8
|
+
// @ts-ignore: to unblock React 18.2.0 -> 18.3.1 version bump in Jira
|
|
7
9
|
const {
|
|
8
10
|
patchedEventProps
|
|
9
11
|
} = usePatchedProps(createEventMap, props);
|
|
@@ -6,6 +6,8 @@ var withAnalyticsEvents = function withAnalyticsEvents() {
|
|
|
6
6
|
var createEventMap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
7
|
return function (WrappedComponent) {
|
|
8
8
|
var WithAnalyticsEvents = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
10
|
+
// @ts-ignore: to unblock React 18.2.0 -> 18.3.1 version bump in Jira
|
|
9
11
|
var _usePatchedProps = usePatchedProps(createEventMap, props),
|
|
10
12
|
patchedEventProps = _usePatchedProps.patchedEventProps;
|
|
11
13
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
@@ -5,15 +5,15 @@ type AnalyticsData = {
|
|
|
5
5
|
[key: string]: any;
|
|
6
6
|
};
|
|
7
7
|
type AnalyticsDecoratorProps = {
|
|
8
|
-
|
|
9
|
-
matchPrivate: boolean;
|
|
8
|
+
children: React.ReactNode;
|
|
10
9
|
data?: AnalyticsData;
|
|
11
10
|
getData?: (name: string, data: AnalyticsData) => AnalyticsData;
|
|
12
|
-
|
|
11
|
+
match: Matcher;
|
|
12
|
+
matchPrivate: boolean;
|
|
13
13
|
};
|
|
14
14
|
type AnalyticsDecoratorContext = {
|
|
15
|
-
onAnalyticsEvent?: (name: string, data: AnalyticsData, isPrivate: boolean) => void;
|
|
16
15
|
getParentAnalyticsData?: (name: string, isPrivate: boolean) => AnalyticsData;
|
|
16
|
+
onAnalyticsEvent?: (name: string, data: AnalyticsData, isPrivate: boolean) => void;
|
|
17
17
|
};
|
|
18
18
|
export declare const ContextTypes: {
|
|
19
19
|
onAnalyticsEvent: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
type AnalyticsDelegateProps = {
|
|
4
|
-
delegateAnalyticsEvent?: (name: string, data: any, isPrivate: boolean) => void;
|
|
5
4
|
children: React.ReactNode;
|
|
5
|
+
delegateAnalyticsEvent?: (name: string, data: any, isPrivate: boolean) => void;
|
|
6
6
|
};
|
|
7
7
|
type AnalyticsDelegateContext = {
|
|
8
8
|
onAnalyticsEvent?: (name: string, data: any, isPrivate: boolean) => void;
|
|
@@ -3,9 +3,9 @@ type AnalyticsErrorBoundaryErrorInfo = {
|
|
|
3
3
|
componentStack: string;
|
|
4
4
|
};
|
|
5
5
|
export interface AnalyticsErrorBoundaryProps {
|
|
6
|
+
channel: string;
|
|
6
7
|
/** React component to be wrapped */
|
|
7
8
|
children: ReactNode;
|
|
8
|
-
channel: string;
|
|
9
9
|
data: {};
|
|
10
10
|
ErrorComponent?: React.ComponentType;
|
|
11
11
|
onError?: (error: Error, info?: AnalyticsErrorBoundaryErrorInfo) => void;
|
|
@@ -3,10 +3,10 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
4
4
|
import type { default as UIAnalyticsEvent } from '../../events/UIAnalyticsEvent';
|
|
5
5
|
type Props = {
|
|
6
|
-
/** Children! */
|
|
7
|
-
children?: React.ReactNode;
|
|
8
6
|
/** The channel to listen for events on. */
|
|
9
7
|
channel?: string;
|
|
8
|
+
/** Children! */
|
|
9
|
+
children?: React.ReactNode;
|
|
10
10
|
/** A function which will be called when an event is fired on this Listener's
|
|
11
11
|
* channel. It is passed the event and the channel as arguments. */
|
|
12
12
|
onEvent: (event: UIAnalyticsEvent, channel?: string) => void;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
3
2
|
import type UIAnalyticsEvent from '../../events/UIAnalyticsEvent';
|
|
4
3
|
export type AnalyticsListenerFunction = (props: {
|
|
5
|
-
/** Children! */
|
|
6
|
-
children?: React.ReactNode;
|
|
7
4
|
/** The channel to listen for events on. */
|
|
8
5
|
channel?: string;
|
|
6
|
+
/** Children! */
|
|
7
|
+
children?: React.ReactNode;
|
|
9
8
|
/** A function which will be called when an event is fired on this Listener's
|
|
10
9
|
* channel. It is passed the event and the channel as arguments. */
|
|
11
10
|
onEvent: (event: UIAnalyticsEvent, channel?: string) => void;
|
|
@@ -8,5 +8,5 @@ export interface WithAnalyticsEventsProps {
|
|
|
8
8
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
9
9
|
ref?: React.Ref<any>;
|
|
10
10
|
}
|
|
11
|
-
declare const withAnalyticsEvents: (createEventMap?: CreateEventMap) => <Props, Component>(WrappedComponent: React.ComponentType<WithAnalyticsEventsProps & Props> & Component) => React.ForwardRefExoticComponent<React.PropsWithoutRef<JSX.LibraryManagedAttributes<Component, Omit<Props, keyof WithAnalyticsEventsProps>>> & React.RefAttributes<any>>;
|
|
11
|
+
declare const withAnalyticsEvents: (createEventMap?: CreateEventMap) => <Props, Component>(WrappedComponent: (React.ComponentType<WithAnalyticsEventsProps & Props> | React.ForwardRefExoticComponent<Omit<WithAnalyticsEventsProps, "ref"> & Props>) & Component) => React.ForwardRefExoticComponent<React.PropsWithoutRef<JSX.LibraryManagedAttributes<Component, Omit<Props, keyof WithAnalyticsEventsProps>>> & React.RefAttributes<any>>;
|
|
12
12
|
export default withAnalyticsEvents;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type UIAnalyticsEvent from '../events/UIAnalyticsEvent';
|
|
2
2
|
export type UsePlatformLeafEventHandlerHookArgs<T> = {
|
|
3
|
-
fn: (value: T, analyticsEvent: UIAnalyticsEvent) => void;
|
|
4
3
|
action: string;
|
|
5
|
-
componentName: string;
|
|
6
4
|
actionSubject?: string;
|
|
5
|
+
analyticsData?: Record<string, any>;
|
|
6
|
+
componentName: string;
|
|
7
|
+
fn: (value: T, analyticsEvent: UIAnalyticsEvent) => void;
|
|
7
8
|
packageName: string;
|
|
8
9
|
packageVersion: string;
|
|
9
|
-
analyticsData?: Record<string, any>;
|
|
10
10
|
};
|
|
11
11
|
export type UsePlatformLeafEventHandlerHook<T> = (value: T) => void;
|
|
12
12
|
export declare function usePlatformLeafEventHandler<T>({ fn, action, componentName, actionSubject, packageName, packageVersion, analyticsData, }: UsePlatformLeafEventHandlerHookArgs<T>): (value: T) => void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type UIAnalyticsEvent from '../events/UIAnalyticsEvent';
|
|
2
2
|
export type UsePlatformLeafSyntheticEventHandlerHookArgs = {
|
|
3
|
-
fn: (analyticsEvent: UIAnalyticsEvent) => void;
|
|
4
3
|
action: string;
|
|
4
|
+
analyticsData?: Record<string, any>;
|
|
5
5
|
componentName: string;
|
|
6
|
+
fn: (analyticsEvent: UIAnalyticsEvent) => void;
|
|
6
7
|
packageName: string;
|
|
7
8
|
packageVersion: string;
|
|
8
|
-
analyticsData?: Record<string, any>;
|
|
9
9
|
};
|
|
10
10
|
export type UsePlatformLeafSyntheticEventHandlerHook = () => void;
|
|
11
11
|
export declare function usePlatformLeafSyntheticEventHandler({ fn, action, componentName, packageName, packageVersion, analyticsData, }: UsePlatformLeafSyntheticEventHandlerHookArgs): () => void;
|
|
@@ -4,14 +4,14 @@ type AnalyticsData = {
|
|
|
4
4
|
[key: string]: any;
|
|
5
5
|
};
|
|
6
6
|
type WithAnalyticsProps = {
|
|
7
|
-
|
|
7
|
+
[key: string]: any;
|
|
8
8
|
analyticsData?: AnalyticsData;
|
|
9
|
+
analyticsId?: string;
|
|
10
|
+
delegateAnalyticsEvent?: (analyticsId: string, data: any, isPrivate: boolean) => void;
|
|
9
11
|
fireAnalyticsEvent?: (name: string, data?: AnalyticsData) => void;
|
|
10
12
|
firePrivateAnalyticsEvent?: (name: string, data?: AnalyticsData) => void;
|
|
11
13
|
getParentAnalyticsData?: (name: string) => AnalyticsData;
|
|
12
|
-
delegateAnalyticsEvent?: (analyticsId: string, data: any, isPrivate: boolean) => void;
|
|
13
14
|
innerRef?: React.Ref<any>;
|
|
14
|
-
[key: string]: any;
|
|
15
15
|
};
|
|
16
16
|
type WithAnalyticsState = {
|
|
17
17
|
evaluatedMap: {
|
|
@@ -5,15 +5,15 @@ type AnalyticsData = {
|
|
|
5
5
|
[key: string]: any;
|
|
6
6
|
};
|
|
7
7
|
type AnalyticsDecoratorProps = {
|
|
8
|
-
|
|
9
|
-
matchPrivate: boolean;
|
|
8
|
+
children: React.ReactNode;
|
|
10
9
|
data?: AnalyticsData;
|
|
11
10
|
getData?: (name: string, data: AnalyticsData) => AnalyticsData;
|
|
12
|
-
|
|
11
|
+
match: Matcher;
|
|
12
|
+
matchPrivate: boolean;
|
|
13
13
|
};
|
|
14
14
|
type AnalyticsDecoratorContext = {
|
|
15
|
-
onAnalyticsEvent?: (name: string, data: AnalyticsData, isPrivate: boolean) => void;
|
|
16
15
|
getParentAnalyticsData?: (name: string, isPrivate: boolean) => AnalyticsData;
|
|
16
|
+
onAnalyticsEvent?: (name: string, data: AnalyticsData, isPrivate: boolean) => void;
|
|
17
17
|
};
|
|
18
18
|
export declare const ContextTypes: {
|
|
19
19
|
onAnalyticsEvent: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
type AnalyticsDelegateProps = {
|
|
4
|
-
delegateAnalyticsEvent?: (name: string, data: any, isPrivate: boolean) => void;
|
|
5
4
|
children: React.ReactNode;
|
|
5
|
+
delegateAnalyticsEvent?: (name: string, data: any, isPrivate: boolean) => void;
|
|
6
6
|
};
|
|
7
7
|
type AnalyticsDelegateContext = {
|
|
8
8
|
onAnalyticsEvent?: (name: string, data: any, isPrivate: boolean) => void;
|
|
@@ -3,9 +3,9 @@ type AnalyticsErrorBoundaryErrorInfo = {
|
|
|
3
3
|
componentStack: string;
|
|
4
4
|
};
|
|
5
5
|
export interface AnalyticsErrorBoundaryProps {
|
|
6
|
+
channel: string;
|
|
6
7
|
/** React component to be wrapped */
|
|
7
8
|
children: ReactNode;
|
|
8
|
-
channel: string;
|
|
9
9
|
data: {};
|
|
10
10
|
ErrorComponent?: React.ComponentType;
|
|
11
11
|
onError?: (error: Error, info?: AnalyticsErrorBoundaryErrorInfo) => void;
|
|
@@ -3,10 +3,10 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
4
4
|
import type { default as UIAnalyticsEvent } from '../../events/UIAnalyticsEvent';
|
|
5
5
|
type Props = {
|
|
6
|
-
/** Children! */
|
|
7
|
-
children?: React.ReactNode;
|
|
8
6
|
/** The channel to listen for events on. */
|
|
9
7
|
channel?: string;
|
|
8
|
+
/** Children! */
|
|
9
|
+
children?: React.ReactNode;
|
|
10
10
|
/** A function which will be called when an event is fired on this Listener's
|
|
11
11
|
* channel. It is passed the event and the channel as arguments. */
|
|
12
12
|
onEvent: (event: UIAnalyticsEvent, channel?: string) => void;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
3
2
|
import type UIAnalyticsEvent from '../../events/UIAnalyticsEvent';
|
|
4
3
|
export type AnalyticsListenerFunction = (props: {
|
|
5
|
-
/** Children! */
|
|
6
|
-
children?: React.ReactNode;
|
|
7
4
|
/** The channel to listen for events on. */
|
|
8
5
|
channel?: string;
|
|
6
|
+
/** Children! */
|
|
7
|
+
children?: React.ReactNode;
|
|
9
8
|
/** A function which will be called when an event is fired on this Listener's
|
|
10
9
|
* channel. It is passed the event and the channel as arguments. */
|
|
11
10
|
onEvent: (event: UIAnalyticsEvent, channel?: string) => void;
|
|
@@ -8,5 +8,5 @@ export interface WithAnalyticsEventsProps {
|
|
|
8
8
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
9
9
|
ref?: React.Ref<any>;
|
|
10
10
|
}
|
|
11
|
-
declare const withAnalyticsEvents: (createEventMap?: CreateEventMap) => <Props, Component>(WrappedComponent: React.ComponentType<WithAnalyticsEventsProps & Props> & Component) => React.ForwardRefExoticComponent<React.PropsWithoutRef<JSX.LibraryManagedAttributes<Component, Omit<Props, keyof WithAnalyticsEventsProps>>> & React.RefAttributes<any>>;
|
|
11
|
+
declare const withAnalyticsEvents: (createEventMap?: CreateEventMap) => <Props, Component>(WrappedComponent: (React.ComponentType<WithAnalyticsEventsProps & Props> | React.ForwardRefExoticComponent<Omit<WithAnalyticsEventsProps, "ref"> & Props>) & Component) => React.ForwardRefExoticComponent<React.PropsWithoutRef<JSX.LibraryManagedAttributes<Component, Omit<Props, keyof WithAnalyticsEventsProps>>> & React.RefAttributes<any>>;
|
|
12
12
|
export default withAnalyticsEvents;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type UIAnalyticsEvent from '../events/UIAnalyticsEvent';
|
|
2
2
|
export type UsePlatformLeafEventHandlerHookArgs<T> = {
|
|
3
|
-
fn: (value: T, analyticsEvent: UIAnalyticsEvent) => void;
|
|
4
3
|
action: string;
|
|
5
|
-
componentName: string;
|
|
6
4
|
actionSubject?: string;
|
|
5
|
+
analyticsData?: Record<string, any>;
|
|
6
|
+
componentName: string;
|
|
7
|
+
fn: (value: T, analyticsEvent: UIAnalyticsEvent) => void;
|
|
7
8
|
packageName: string;
|
|
8
9
|
packageVersion: string;
|
|
9
|
-
analyticsData?: Record<string, any>;
|
|
10
10
|
};
|
|
11
11
|
export type UsePlatformLeafEventHandlerHook<T> = (value: T) => void;
|
|
12
12
|
export declare function usePlatformLeafEventHandler<T>({ fn, action, componentName, actionSubject, packageName, packageVersion, analyticsData, }: UsePlatformLeafEventHandlerHookArgs<T>): (value: T) => void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type UIAnalyticsEvent from '../events/UIAnalyticsEvent';
|
|
2
2
|
export type UsePlatformLeafSyntheticEventHandlerHookArgs = {
|
|
3
|
-
fn: (analyticsEvent: UIAnalyticsEvent) => void;
|
|
4
3
|
action: string;
|
|
4
|
+
analyticsData?: Record<string, any>;
|
|
5
5
|
componentName: string;
|
|
6
|
+
fn: (analyticsEvent: UIAnalyticsEvent) => void;
|
|
6
7
|
packageName: string;
|
|
7
8
|
packageVersion: string;
|
|
8
|
-
analyticsData?: Record<string, any>;
|
|
9
9
|
};
|
|
10
10
|
export type UsePlatformLeafSyntheticEventHandlerHook = () => void;
|
|
11
11
|
export declare function usePlatformLeafSyntheticEventHandler({ fn, action, componentName, packageName, packageVersion, analyticsData, }: UsePlatformLeafSyntheticEventHandlerHookArgs): () => void;
|
|
@@ -4,14 +4,14 @@ type AnalyticsData = {
|
|
|
4
4
|
[key: string]: any;
|
|
5
5
|
};
|
|
6
6
|
type WithAnalyticsProps = {
|
|
7
|
-
|
|
7
|
+
[key: string]: any;
|
|
8
8
|
analyticsData?: AnalyticsData;
|
|
9
|
+
analyticsId?: string;
|
|
10
|
+
delegateAnalyticsEvent?: (analyticsId: string, data: any, isPrivate: boolean) => void;
|
|
9
11
|
fireAnalyticsEvent?: (name: string, data?: AnalyticsData) => void;
|
|
10
12
|
firePrivateAnalyticsEvent?: (name: string, data?: AnalyticsData) => void;
|
|
11
13
|
getParentAnalyticsData?: (name: string) => AnalyticsData;
|
|
12
|
-
delegateAnalyticsEvent?: (analyticsId: string, data: any, isPrivate: boolean) => void;
|
|
13
14
|
innerRef?: React.Ref<any>;
|
|
14
|
-
[key: string]: any;
|
|
15
15
|
};
|
|
16
16
|
type WithAnalyticsState = {
|
|
17
17
|
evaluatedMap: {
|
|
@@ -45,6 +45,7 @@ ${(
|
|
|
45
45
|
<td>
|
|
46
46
|
Use{' '}
|
|
47
47
|
<Link href="#use-platform-leaf-event-handler">
|
|
48
|
+
{/* eslint-disable-next-line @atlaskit/design-system/no-html-code */}
|
|
48
49
|
<code>usePlatformLeafEventHandler</code>
|
|
49
50
|
</Link>
|
|
50
51
|
.
|
|
@@ -55,12 +56,14 @@ ${(
|
|
|
55
56
|
<td>
|
|
56
57
|
Use{' '}
|
|
57
58
|
<Link href="#use-callback-with-analytics">
|
|
59
|
+
{/* eslint-disable-next-line @atlaskit/design-system/no-html-code */}
|
|
58
60
|
<code>useCallbackWithAnalytics</code>
|
|
59
61
|
</Link>{' '}
|
|
60
62
|
if you want something basic.
|
|
61
63
|
<br />
|
|
62
64
|
Use{' '}
|
|
63
65
|
<Link href="#use-analytics-events">
|
|
66
|
+
{/* eslint-disable-next-line @atlaskit/design-system/no-html-code */}
|
|
64
67
|
<code>useAnalyticsEvents</code>
|
|
65
68
|
</Link>{' '}
|
|
66
69
|
if you want more control.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/analytics-next",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.2",
|
|
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/"
|
|
@@ -26,29 +26,9 @@
|
|
|
26
26
|
"team": "UIP Frontend Observability",
|
|
27
27
|
"website": {
|
|
28
28
|
"name": "Analytics next"
|
|
29
|
-
}
|
|
30
|
-
"runReact18": true
|
|
29
|
+
}
|
|
31
30
|
},
|
|
32
31
|
"./types": "./src/types.ts",
|
|
33
|
-
"af:exports": {
|
|
34
|
-
"./types": "./src/types.ts",
|
|
35
|
-
"./AnalyticsContext": "./src/components/AnalyticsContext/index.tsx",
|
|
36
|
-
"./AnalyticsDecorator": "./src/components/AnalyticsDecorator/index.ts",
|
|
37
|
-
"./AnalyticsDelegate": "./src/components/AnalyticsDelegate/index.ts",
|
|
38
|
-
"./withAnalytics": "./src/utils/withAnalytics.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
32
|
"dependencies": {
|
|
53
33
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
54
34
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
@@ -62,10 +42,9 @@
|
|
|
62
42
|
},
|
|
63
43
|
"devDependencies": {
|
|
64
44
|
"@atlassian/feature-flags-test-utils": "^0.3.0",
|
|
65
|
-
"@atlassian/ssr-tests": "^0.
|
|
45
|
+
"@atlassian/ssr-tests": "^0.3.0",
|
|
66
46
|
"@testing-library/react": "^13.4.0",
|
|
67
|
-
"storybook-addon-performance": "^0.17.3"
|
|
68
|
-
"typescript": "~5.4.2"
|
|
47
|
+
"storybook-addon-performance": "^0.17.3"
|
|
69
48
|
},
|
|
70
49
|
"overrides": {
|
|
71
50
|
"@atlaskit/analytics-next-stable-react-context": {
|
package/tsconfig.json
CHANGED
|
@@ -8,8 +8,13 @@
|
|
|
8
8
|
"./examples/**/*.ts",
|
|
9
9
|
"./examples/**/*.tsx",
|
|
10
10
|
"./example-helpers/**/*.ts",
|
|
11
|
-
"./example-helpers/**/*.tsx"
|
|
11
|
+
"./example-helpers/**/*.tsx",
|
|
12
|
+
"**/stories.ts",
|
|
13
|
+
"**/stories.tsx",
|
|
14
|
+
"**/stories/*.ts",
|
|
15
|
+
"**/stories/*.tsx",
|
|
16
|
+
"**/stories/**/*.ts",
|
|
17
|
+
"**/stories/**/*.tsx"
|
|
12
18
|
],
|
|
13
|
-
"compilerOptions": {
|
|
14
|
-
}
|
|
19
|
+
"compilerOptions": {}
|
|
15
20
|
}
|
package/types/package.json
CHANGED