@atlaskit/analytics-next 11.1.0 → 11.1.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.
Files changed (48) hide show
  1. package/AnalyticsContext/package.json +1 -1
  2. package/AnalyticsDecorator/package.json +1 -1
  3. package/AnalyticsDelegate/package.json +1 -1
  4. package/AnalyticsErrorBoundary/package.json +1 -1
  5. package/AnalyticsEvent/package.json +1 -1
  6. package/AnalyticsListener/package.json +1 -1
  7. package/CHANGELOG.md +7 -0
  8. package/UIAnalyticsEvent/package.json +1 -1
  9. package/afm-adminhub/tsconfig.json +32 -0
  10. package/afm-cc/tsconfig.json +30 -24
  11. package/afm-dev-agents/tsconfig.json +32 -0
  12. package/afm-jira/tsconfig.json +7 -1
  13. package/afm-passionfruit/tsconfig.json +11 -2
  14. package/afm-post-office/tsconfig.json +7 -1
  15. package/afm-rovo-extension/tsconfig.json +32 -0
  16. package/afm-townsquare/tsconfig.json +32 -0
  17. package/afm-volt/tsconfig.json +32 -0
  18. package/build/tsconfig.json +23 -14
  19. package/createAndFireEvents/package.json +1 -1
  20. package/dist/types/components/AnalyticsContext/types.d.ts +0 -1
  21. package/dist/types/components/AnalyticsDecorator/index.d.ts +4 -4
  22. package/dist/types/components/AnalyticsDelegate/index.d.ts +1 -1
  23. package/dist/types/components/AnalyticsErrorBoundary.d.ts +1 -1
  24. package/dist/types/components/AnalyticsListener/LegacyAnalyticsListener.d.ts +2 -2
  25. package/dist/types/components/AnalyticsListener/types.d.ts +2 -3
  26. package/dist/types/hooks/usePlatformLeafEventHandler.d.ts +3 -3
  27. package/dist/types/hooks/usePlatformLeafSyntheticEventHandler.d.ts +2 -2
  28. package/dist/types/utils/withAnalytics.d.ts +3 -3
  29. package/dist/types-ts4.5/components/AnalyticsContext/types.d.ts +0 -1
  30. package/dist/types-ts4.5/components/AnalyticsDecorator/index.d.ts +4 -4
  31. package/dist/types-ts4.5/components/AnalyticsDelegate/index.d.ts +1 -1
  32. package/dist/types-ts4.5/components/AnalyticsErrorBoundary.d.ts +1 -1
  33. package/dist/types-ts4.5/components/AnalyticsListener/LegacyAnalyticsListener.d.ts +2 -2
  34. package/dist/types-ts4.5/components/AnalyticsListener/types.d.ts +2 -3
  35. package/dist/types-ts4.5/hooks/usePlatformLeafEventHandler.d.ts +3 -3
  36. package/dist/types-ts4.5/hooks/usePlatformLeafSyntheticEventHandler.d.ts +2 -2
  37. package/dist/types-ts4.5/utils/withAnalytics.d.ts +3 -3
  38. package/docs/20-usage-with-presentational-components.tsx +3 -0
  39. package/package.json +4 -6
  40. package/tsconfig.json +8 -3
  41. package/types/package.json +1 -1
  42. package/useAnalyticsEvents/package.json +1 -1
  43. package/useCallbackWithAnalytics/package.json +1 -1
  44. package/usePatchedProps/package.json +1 -1
  45. package/usePlatformLeafEventHandler/package.json +1 -1
  46. package/withAnalytics/package.json +1 -1
  47. package/withAnalyticsContext/package.json +1 -1
  48. package/withAnalyticsEvents/package.json +1 -1
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/components/AnalyticsContext/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/components/AnalyticsContext/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/components/AnalyticsDecorator/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/components/AnalyticsDecorator/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/components/AnalyticsDelegate/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/components/AnalyticsDelegate/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/components/AnalyticsErrorBoundary.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/components/AnalyticsErrorBoundary.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/events/AnalyticsEvent.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/events/AnalyticsEvent.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/components/AnalyticsListener/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/components/AnalyticsListener/index.d.ts"
12
12
  ]
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/analytics-next
2
2
 
3
+ ## 11.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3298a6307027c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3298a6307027c) -
8
+ Sorted type and interface props to improve Atlaskit docs
9
+
3
10
  ## 11.1.0
4
11
 
5
12
  ### Minor Changes
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/events/UIAnalyticsEvent.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/events/UIAnalyticsEvent.d.ts"
12
12
  ]
@@ -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
+ }
@@ -1,26 +1,32 @@
1
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
- },
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
- ],
21
- "references": [
22
- {
23
- "path": "../../../platform/feature-flags/afm-cc/tsconfig.json"
24
- }
25
- ]
2
+ "extends": "../../../../tsconfig.entry-points.confluence.json",
3
+ "compilerOptions": {
4
+ "declaration": true,
5
+ "target": "es5",
6
+ "composite": true,
7
+ "outDir": "../../../../../confluence/tsDist/@atlaskit__analytics-next",
8
+ "rootDir": "../"
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
+ ]
26
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
+ }
@@ -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": ["../src/**/*.ts", "../src/**/*.tsx"],
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
+ }
@@ -1,16 +1,25 @@
1
1
  {
2
- "extends": "../tsconfig",
3
- "compilerOptions": {
4
- "declaration": true,
5
- "target": "es5",
6
- "paths": {}
7
- },
8
- "include": ["../src/**/*.ts", "../src/**/*.tsx"],
9
- "exclude": [
10
- "../src/**/__tests__/*",
11
- "../src/**/*.test.*",
12
- "../src/**/test.*",
13
- "../src/performance/examples.tsx",
14
- "../docs/*"
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
  }
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/utils/createAndFireEvent.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/utils/createAndFireEvent.d.ts"
12
12
  ]
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
3
2
  export type AnalyticsContextFunction = (props: {
4
3
  /** Children! */
@@ -5,15 +5,15 @@ type AnalyticsData = {
5
5
  [key: string]: any;
6
6
  };
7
7
  type AnalyticsDecoratorProps = {
8
- match: Matcher;
9
- matchPrivate: boolean;
8
+ children: React.ReactNode;
10
9
  data?: AnalyticsData;
11
10
  getData?: (name: string, data: AnalyticsData) => AnalyticsData;
12
- children: React.ReactNode;
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;
@@ -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
- analyticsId?: string;
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: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
3
2
  export type AnalyticsContextFunction = (props: {
4
3
  /** Children! */
@@ -5,15 +5,15 @@ type AnalyticsData = {
5
5
  [key: string]: any;
6
6
  };
7
7
  type AnalyticsDecoratorProps = {
8
- match: Matcher;
9
- matchPrivate: boolean;
8
+ children: React.ReactNode;
10
9
  data?: AnalyticsData;
11
10
  getData?: (name: string, data: AnalyticsData) => AnalyticsData;
12
- children: React.ReactNode;
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;
@@ -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
- analyticsId?: string;
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.0",
3
+ "version": "11.1.1",
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,8 +26,7 @@
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
32
  "af:exports": {
@@ -62,10 +61,9 @@
62
61
  },
63
62
  "devDependencies": {
64
63
  "@atlassian/feature-flags-test-utils": "^0.3.0",
65
- "@atlassian/ssr-tests": "^0.2.0",
64
+ "@atlassian/ssr-tests": "^0.3.0",
66
65
  "@testing-library/react": "^13.4.0",
67
- "storybook-addon-performance": "^0.17.3",
68
- "typescript": "~5.4.2"
66
+ "storybook-addon-performance": "^0.17.3"
69
67
  },
70
68
  "overrides": {
71
69
  "@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
  }
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/types.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/types.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/hooks/useAnalyticsEvents.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/hooks/useAnalyticsEvents.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/hooks/useCallbackWithAnalytics.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/hooks/useCallbackWithAnalytics.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/hooks/usePatchedProps.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/hooks/usePatchedProps.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/hooks/usePlatformLeafEventHandler.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/hooks/usePlatformLeafEventHandler.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/utils/withAnalytics.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/utils/withAnalytics.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/hocs/withAnalyticsContext.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/hocs/withAnalyticsContext.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/hocs/withAnalyticsEvents.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/hocs/withAnalyticsEvents.d.ts"
12
12
  ]