@atlaskit/analytics-next 9.3.0 → 9.3.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/CHANGELOG.md +333 -133
- package/afm-jira/tsconfig.json +25 -0
- package/afm-post-office/tsconfig.json +25 -0
- 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/withAnalyticsEvents.d.ts +1 -1
- 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/withAnalyticsEvents.d.ts +1 -1
- 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 +99 -100
- package/report.api.md +115 -125
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../../tsconfig.entry-points.jira.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"target": "es5",
|
|
6
|
+
"outDir": "../../../../../tsDist/@atlaskit__analytics-next/app",
|
|
7
|
+
"composite": true,
|
|
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
|
+
],
|
|
20
|
+
"references": [
|
|
21
|
+
{
|
|
22
|
+
"path": "../../../platform/feature-flags/afm-jira/tsconfig.json"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../../tsconfig.entry-points.post-office.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"target": "es5",
|
|
6
|
+
"outDir": "../../../../../tsDist/@atlaskit__analytics-next/app",
|
|
7
|
+
"composite": true,
|
|
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
|
+
],
|
|
20
|
+
"references": [
|
|
21
|
+
{
|
|
22
|
+
"path": "../../../platform/feature-flags/afm-post-office/tsconfig.json"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
3
|
+
import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
4
4
|
interface Props {
|
|
5
5
|
/** Children! */
|
|
6
6
|
children: React.ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
2
|
+
import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
3
3
|
export type AnalyticsContextFunction = (props: {
|
|
4
4
|
/** Children! */
|
|
5
5
|
children: React.ReactNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { Component, ReactNode } from 'react';
|
|
1
|
+
import React, { Component, type ReactNode } from 'react';
|
|
2
2
|
type AnalyticsErrorBoundaryErrorInfo = {
|
|
3
3
|
componentStack: string;
|
|
4
4
|
};
|
|
@@ -18,7 +18,7 @@ type AnalyticsErrorBoundaryState = {
|
|
|
18
18
|
*/
|
|
19
19
|
export default class AnalyticsErrorBoundary extends Component<AnalyticsErrorBoundaryProps, AnalyticsErrorBoundaryState> {
|
|
20
20
|
constructor(props: AnalyticsErrorBoundaryProps);
|
|
21
|
-
componentDidCatch(error: Error, info
|
|
21
|
+
componentDidCatch(error: Error, info: AnalyticsErrorBoundaryErrorInfo): void;
|
|
22
22
|
render(): JSX.Element | null;
|
|
23
23
|
}
|
|
24
24
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
4
|
-
import UIAnalyticsEvent from '../../events/UIAnalyticsEvent';
|
|
3
|
+
import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
4
|
+
import type { default as UIAnalyticsEvent } from '../../events/UIAnalyticsEvent';
|
|
5
5
|
type Props = {
|
|
6
6
|
/** Children! */
|
|
7
7
|
children?: React.ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
3
|
-
import UIAnalyticsEvent from '../../events/UIAnalyticsEvent';
|
|
2
|
+
import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
3
|
+
import type UIAnalyticsEvent from '../../events/UIAnalyticsEvent';
|
|
4
4
|
export type AnalyticsListenerFunction = (props: {
|
|
5
5
|
/** Children! */
|
|
6
6
|
children?: React.ReactNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import AnalyticsEvent, { AnalyticsEventPayload, AnalyticsEventProps } from './AnalyticsEvent';
|
|
1
|
+
import AnalyticsEvent, { type AnalyticsEventPayload, type AnalyticsEventProps } from './AnalyticsEvent';
|
|
2
2
|
type ChannelIdentifier = string;
|
|
3
3
|
type Context = Record<string, any>[];
|
|
4
4
|
export type UIAnalyticsEventHandler = (event: UIAnalyticsEvent, channel?: ChannelIdentifier) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CreateEventMap, CreateUIAnalyticsEvent } from '../types';
|
|
2
|
+
import { type CreateEventMap, type CreateUIAnalyticsEvent } from '../types';
|
|
3
3
|
export interface WithAnalyticsEventsProps {
|
|
4
4
|
/**
|
|
5
5
|
* You should not be accessing this prop under any circumstances.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
1
|
+
import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
2
2
|
export declare const useAnalyticsContext: () => AnalyticsReactContextInterface;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { MutableRefObject } from 'react';
|
|
1
|
+
import { type MutableRefObject } from 'react';
|
|
2
2
|
export declare const useTrackedRef: <T>(value: T) => MutableRefObject<T>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export type { CreateUIAnalyticsEvent } from './types';
|
|
2
|
-
export { default as AnalyticsEvent, isAnalyticsEvent
|
|
3
|
-
export type { AnalyticsEventPayload, AnalyticsEventProps
|
|
4
|
-
export { default as UIAnalyticsEvent, isUIAnalyticsEvent
|
|
5
|
-
export type { UIAnalyticsEventProps, UIAnalyticsEventHandler
|
|
2
|
+
export { default as AnalyticsEvent, isAnalyticsEvent } from './events/AnalyticsEvent';
|
|
3
|
+
export type { AnalyticsEventPayload, AnalyticsEventProps } from './events/AnalyticsEvent';
|
|
4
|
+
export { default as UIAnalyticsEvent, isUIAnalyticsEvent } from './events/UIAnalyticsEvent';
|
|
5
|
+
export type { UIAnalyticsEventProps, UIAnalyticsEventHandler } from './events/UIAnalyticsEvent';
|
|
6
6
|
export { default as AnalyticsListener } from './components/AnalyticsListener/index';
|
|
7
7
|
export { default as AnalyticsContext } from './components/AnalyticsContext/index';
|
|
8
8
|
export { default as withAnalyticsContext } from './hocs/withAnalyticsContext';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnalyticsEventPayload } from './events/AnalyticsEvent';
|
|
2
|
-
import UIAnalyticsEvent from './events/UIAnalyticsEvent';
|
|
1
|
+
import { type AnalyticsEventPayload } from './events/AnalyticsEvent';
|
|
2
|
+
import type UIAnalyticsEvent from './events/UIAnalyticsEvent';
|
|
3
3
|
export type CreateUIAnalyticsEvent = (payload: AnalyticsEventPayload) => UIAnalyticsEvent;
|
|
4
4
|
export type AnalyticsEventCreator = (create: CreateUIAnalyticsEvent, props: Record<string, any>) => UIAnalyticsEvent | undefined;
|
|
5
5
|
export type CreateEventMapValue = AnalyticsEventPayload | AnalyticsEventCreator;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalyticsEventPayload } from '../events/AnalyticsEvent';
|
|
2
|
-
import { CreateUIAnalyticsEvent } from '../types';
|
|
1
|
+
import { type AnalyticsEventPayload } from '../events/AnalyticsEvent';
|
|
2
|
+
import { type CreateUIAnalyticsEvent } from '../types';
|
|
3
3
|
declare const _default: (channel?: string) => (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => import("..").UIAnalyticsEvent;
|
|
4
4
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
3
|
+
import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
4
4
|
interface Props {
|
|
5
5
|
/** Children! */
|
|
6
6
|
children: React.ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
2
|
+
import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
3
3
|
export type AnalyticsContextFunction = (props: {
|
|
4
4
|
/** Children! */
|
|
5
5
|
children: React.ReactNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { Component, ReactNode } from 'react';
|
|
1
|
+
import React, { Component, type ReactNode } from 'react';
|
|
2
2
|
type AnalyticsErrorBoundaryErrorInfo = {
|
|
3
3
|
componentStack: string;
|
|
4
4
|
};
|
|
@@ -18,7 +18,7 @@ type AnalyticsErrorBoundaryState = {
|
|
|
18
18
|
*/
|
|
19
19
|
export default class AnalyticsErrorBoundary extends Component<AnalyticsErrorBoundaryProps, AnalyticsErrorBoundaryState> {
|
|
20
20
|
constructor(props: AnalyticsErrorBoundaryProps);
|
|
21
|
-
componentDidCatch(error: Error, info
|
|
21
|
+
componentDidCatch(error: Error, info: AnalyticsErrorBoundaryErrorInfo): void;
|
|
22
22
|
render(): JSX.Element | null;
|
|
23
23
|
}
|
|
24
24
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
4
|
-
import UIAnalyticsEvent from '../../events/UIAnalyticsEvent';
|
|
3
|
+
import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
4
|
+
import type { default as UIAnalyticsEvent } from '../../events/UIAnalyticsEvent';
|
|
5
5
|
type Props = {
|
|
6
6
|
/** Children! */
|
|
7
7
|
children?: React.ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
3
|
-
import UIAnalyticsEvent from '../../events/UIAnalyticsEvent';
|
|
2
|
+
import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
3
|
+
import type UIAnalyticsEvent from '../../events/UIAnalyticsEvent';
|
|
4
4
|
export type AnalyticsListenerFunction = (props: {
|
|
5
5
|
/** Children! */
|
|
6
6
|
children?: React.ReactNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import AnalyticsEvent, { AnalyticsEventPayload, AnalyticsEventProps } from './AnalyticsEvent';
|
|
1
|
+
import AnalyticsEvent, { type AnalyticsEventPayload, type AnalyticsEventProps } from './AnalyticsEvent';
|
|
2
2
|
type ChannelIdentifier = string;
|
|
3
3
|
type Context = Record<string, any>[];
|
|
4
4
|
export type UIAnalyticsEventHandler = (event: UIAnalyticsEvent, channel?: ChannelIdentifier) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { CreateEventMap, CreateUIAnalyticsEvent } from '../types';
|
|
2
|
+
import { type CreateEventMap, type CreateUIAnalyticsEvent } from '../types';
|
|
3
3
|
export interface WithAnalyticsEventsProps {
|
|
4
4
|
/**
|
|
5
5
|
* You should not be accessing this prop under any circumstances.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
1
|
+
import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
2
2
|
export declare const useAnalyticsContext: () => AnalyticsReactContextInterface;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { MutableRefObject } from 'react';
|
|
1
|
+
import { type MutableRefObject } from 'react';
|
|
2
2
|
export declare const useTrackedRef: <T>(value: T) => MutableRefObject<T>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export type { CreateUIAnalyticsEvent } from './types';
|
|
2
|
-
export { default as AnalyticsEvent, isAnalyticsEvent
|
|
3
|
-
export type { AnalyticsEventPayload, AnalyticsEventProps
|
|
4
|
-
export { default as UIAnalyticsEvent, isUIAnalyticsEvent
|
|
5
|
-
export type { UIAnalyticsEventProps, UIAnalyticsEventHandler
|
|
2
|
+
export { default as AnalyticsEvent, isAnalyticsEvent } from './events/AnalyticsEvent';
|
|
3
|
+
export type { AnalyticsEventPayload, AnalyticsEventProps } from './events/AnalyticsEvent';
|
|
4
|
+
export { default as UIAnalyticsEvent, isUIAnalyticsEvent } from './events/UIAnalyticsEvent';
|
|
5
|
+
export type { UIAnalyticsEventProps, UIAnalyticsEventHandler } from './events/UIAnalyticsEvent';
|
|
6
6
|
export { default as AnalyticsListener } from './components/AnalyticsListener/index';
|
|
7
7
|
export { default as AnalyticsContext } from './components/AnalyticsContext/index';
|
|
8
8
|
export { default as withAnalyticsContext } from './hocs/withAnalyticsContext';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnalyticsEventPayload } from './events/AnalyticsEvent';
|
|
2
|
-
import UIAnalyticsEvent from './events/UIAnalyticsEvent';
|
|
1
|
+
import { type AnalyticsEventPayload } from './events/AnalyticsEvent';
|
|
2
|
+
import type UIAnalyticsEvent from './events/UIAnalyticsEvent';
|
|
3
3
|
export type CreateUIAnalyticsEvent = (payload: AnalyticsEventPayload) => UIAnalyticsEvent;
|
|
4
4
|
export type AnalyticsEventCreator = (create: CreateUIAnalyticsEvent, props: Record<string, any>) => UIAnalyticsEvent | undefined;
|
|
5
5
|
export type CreateEventMapValue = AnalyticsEventPayload | AnalyticsEventCreator;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalyticsEventPayload } from '../events/AnalyticsEvent';
|
|
2
|
-
import { CreateUIAnalyticsEvent } from '../types';
|
|
1
|
+
import { type AnalyticsEventPayload } from '../events/AnalyticsEvent';
|
|
2
|
+
import { type CreateUIAnalyticsEvent } from '../types';
|
|
3
3
|
declare const _default: (channel?: string) => (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => import("..").UIAnalyticsEvent;
|
|
4
4
|
export default _default;
|
package/docs/0-intro.tsx
CHANGED
|
@@ -6,23 +6,23 @@ import SectionMessage from '@atlaskit/section-message';
|
|
|
6
6
|
export default md`
|
|
7
7
|
|
|
8
8
|
${(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
<SectionMessage
|
|
10
|
+
appearance="warning"
|
|
11
|
+
title="Maintaince Mode: @atlaskit/analytics is in maintenance mode."
|
|
12
|
+
>
|
|
13
|
+
This package is officially in maintenance mode, which means only bugfixes or VULN fixes are
|
|
14
|
+
currently being accepted and no known breaking changes will be approved in the PR process.{' '}
|
|
15
|
+
<br />
|
|
16
|
+
Please refer to this
|
|
17
|
+
<a
|
|
18
|
+
href="https://hello.atlassian.net/wiki/spaces/APD/pages/2470435075/DACI+analytics-next+in+a+maintenance+mode"
|
|
19
|
+
target="_blank"
|
|
20
|
+
>
|
|
21
|
+
{' '}
|
|
22
|
+
DACI{' '}
|
|
23
|
+
</a>{' '}
|
|
24
|
+
for more details.
|
|
25
|
+
</SectionMessage>
|
|
26
26
|
)}
|
|
27
27
|
|
|
28
28
|
This package aims to help assist consumers track the way their React components are being used.
|
|
@@ -28,45 +28,44 @@ our suggested approach.
|
|
|
28
28
|
### Recommended Usage
|
|
29
29
|
|
|
30
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
|
-
</table>
|
|
31
|
+
<table>
|
|
32
|
+
<tr>
|
|
33
|
+
<th>Component Type</th>
|
|
34
|
+
<th>Recommendation</th>
|
|
35
|
+
</tr>
|
|
36
|
+
<tr>
|
|
37
|
+
<td>Class components</td>
|
|
38
|
+
<td>
|
|
39
|
+
You have only the <a href="#with-analytics-events">HOC option</a> available.
|
|
40
|
+
</td>
|
|
41
|
+
</tr>
|
|
42
|
+
<tr>
|
|
43
|
+
<td>Atlaskit function components</td>
|
|
44
|
+
<td>
|
|
45
|
+
Use{' '}
|
|
46
|
+
<a href="#use-platform-leaf-event-handler">
|
|
47
|
+
<code>usePlatformLeafEventHandler</code>
|
|
48
|
+
</a>
|
|
49
|
+
.
|
|
50
|
+
</td>
|
|
51
|
+
</tr>
|
|
52
|
+
<tr>
|
|
53
|
+
<td>Other function components</td>
|
|
54
|
+
<td>
|
|
55
|
+
Use{' '}
|
|
56
|
+
<a href="#use-callback-with-analytics">
|
|
57
|
+
<code>useCallbackWithAnalytics</code>
|
|
58
|
+
</a>{' '}
|
|
59
|
+
if you want something basic.
|
|
60
|
+
<br />
|
|
61
|
+
Use{' '}
|
|
62
|
+
<a href="#use-analytics-events">
|
|
63
|
+
<code>useAnalyticsEvents</code>
|
|
64
|
+
</a>{' '}
|
|
65
|
+
if you want more control.
|
|
66
|
+
</td>
|
|
67
|
+
</tr>
|
|
68
|
+
</table>
|
|
70
69
|
)}
|
|
71
70
|
|
|
72
71
|
### Examples
|
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
|