@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
|
@@ -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
|
+
}
|
|
@@ -30,11 +30,7 @@ var withAnalyticsContext = function withAnalyticsContext(defaultData) {
|
|
|
30
30
|
ref: ref
|
|
31
31
|
})));
|
|
32
32
|
});
|
|
33
|
-
|
|
34
|
-
// @ts-ignore
|
|
35
|
-
WithAnalyticsContext.displayName = "WithAnalyticsContext(".concat(
|
|
36
|
-
// @ts-ignore disneyName doesn't exist on type
|
|
37
|
-
WrappedComponent.displayName || WrappedComponent.name, ")");
|
|
33
|
+
WithAnalyticsContext.displayName = "WithAnalyticsContext(".concat(WrappedComponent.displayName || WrappedComponent.name, ")");
|
|
38
34
|
return WithAnalyticsContext;
|
|
39
35
|
};
|
|
40
36
|
};
|
|
@@ -25,11 +25,7 @@ var withAnalyticsEvents = function withAnalyticsEvents() {
|
|
|
25
25
|
ref: ref
|
|
26
26
|
}));
|
|
27
27
|
});
|
|
28
|
-
|
|
29
|
-
// @ts-ignore
|
|
30
|
-
WithAnalyticsEvents.displayName = "WithAnalyticsEvents(".concat(
|
|
31
|
-
// @ts-ignore disneyName doesn't exist on type
|
|
32
|
-
WrappedComponent.displayName || WrappedComponent.name, ")");
|
|
28
|
+
WithAnalyticsEvents.displayName = "WithAnalyticsEvents(".concat(WrappedComponent.displayName || WrappedComponent.name, ")");
|
|
33
29
|
return WithAnalyticsEvents;
|
|
34
30
|
};
|
|
35
31
|
};
|
|
@@ -16,11 +16,7 @@ const withAnalyticsContext = defaultData => WrappedComponent => {
|
|
|
16
16
|
ref: ref
|
|
17
17
|
})));
|
|
18
18
|
});
|
|
19
|
-
|
|
20
|
-
// @ts-ignore
|
|
21
|
-
WithAnalyticsContext.displayName = `WithAnalyticsContext(${
|
|
22
|
-
// @ts-ignore disneyName doesn't exist on type
|
|
23
|
-
WrappedComponent.displayName || WrappedComponent.name})`;
|
|
19
|
+
WithAnalyticsContext.displayName = `WithAnalyticsContext(${WrappedComponent.displayName || WrappedComponent.name})`;
|
|
24
20
|
return WithAnalyticsContext;
|
|
25
21
|
};
|
|
26
22
|
export default withAnalyticsContext;
|
|
@@ -15,11 +15,7 @@ const withAnalyticsEvents = (createEventMap = {}) => WrappedComponent => {
|
|
|
15
15
|
ref: ref
|
|
16
16
|
}));
|
|
17
17
|
});
|
|
18
|
-
|
|
19
|
-
// @ts-ignore
|
|
20
|
-
WithAnalyticsEvents.displayName = `WithAnalyticsEvents(${
|
|
21
|
-
// @ts-ignore disneyName doesn't exist on type
|
|
22
|
-
WrappedComponent.displayName || WrappedComponent.name})`;
|
|
18
|
+
WithAnalyticsEvents.displayName = `WithAnalyticsEvents(${WrappedComponent.displayName || WrappedComponent.name})`;
|
|
23
19
|
return WithAnalyticsEvents;
|
|
24
20
|
};
|
|
25
21
|
export default withAnalyticsEvents;
|
|
@@ -20,11 +20,7 @@ var withAnalyticsContext = function withAnalyticsContext(defaultData) {
|
|
|
20
20
|
ref: ref
|
|
21
21
|
})));
|
|
22
22
|
});
|
|
23
|
-
|
|
24
|
-
// @ts-ignore
|
|
25
|
-
WithAnalyticsContext.displayName = "WithAnalyticsContext(".concat(
|
|
26
|
-
// @ts-ignore disneyName doesn't exist on type
|
|
27
|
-
WrappedComponent.displayName || WrappedComponent.name, ")");
|
|
23
|
+
WithAnalyticsContext.displayName = "WithAnalyticsContext(".concat(WrappedComponent.displayName || WrappedComponent.name, ")");
|
|
28
24
|
return WithAnalyticsContext;
|
|
29
25
|
};
|
|
30
26
|
};
|
|
@@ -15,11 +15,7 @@ var withAnalyticsEvents = function withAnalyticsEvents() {
|
|
|
15
15
|
ref: ref
|
|
16
16
|
}));
|
|
17
17
|
});
|
|
18
|
-
|
|
19
|
-
// @ts-ignore
|
|
20
|
-
WithAnalyticsEvents.displayName = "WithAnalyticsEvents(".concat(
|
|
21
|
-
// @ts-ignore disneyName doesn't exist on type
|
|
22
|
-
WrappedComponent.displayName || WrappedComponent.name, ")");
|
|
18
|
+
WithAnalyticsEvents.displayName = "WithAnalyticsEvents(".concat(WrappedComponent.displayName || WrappedComponent.name, ")");
|
|
23
19
|
return WithAnalyticsEvents;
|
|
24
20
|
};
|
|
25
21
|
};
|
|
@@ -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;
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
export interface WithContextProps {
|
|
3
3
|
analyticsContext?: Record<string, any>;
|
|
4
4
|
}
|
|
5
|
-
declare const withAnalyticsContext: (defaultData?: any) => <Props, Component>(WrappedComponent: React.
|
|
5
|
+
declare const withAnalyticsContext: (defaultData?: any) => <Props, Component>(WrappedComponent: React.ComponentType<Props> & Component) => React.ForwardRefExoticComponent<React.PropsWithoutRef<JSX.LibraryManagedAttributes<Component, Props & WithContextProps>> & React.RefAttributes<any>>;
|
|
6
6
|
export default withAnalyticsContext;
|
|
@@ -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.
|
|
@@ -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 extends WithAnalyticsEventsProps, Component>(WrappedComponent: React.
|
|
11
|
+
declare const withAnalyticsEvents: (createEventMap?: CreateEventMap) => <Props extends WithAnalyticsEventsProps, Component>(WrappedComponent: React.ComponentType<Props> & Component) => React.ForwardRefExoticComponent<React.PropsWithoutRef<JSX.LibraryManagedAttributes<Component, Omit<Props, keyof WithAnalyticsEventsProps>>> & React.RefAttributes<any>>;
|
|
12
12
|
export default withAnalyticsEvents;
|
|
@@ -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;
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
export interface WithContextProps {
|
|
3
3
|
analyticsContext?: Record<string, any>;
|
|
4
4
|
}
|
|
5
|
-
declare const withAnalyticsContext: (defaultData?: any) => <Props, Component>(WrappedComponent: React.
|
|
5
|
+
declare const withAnalyticsContext: (defaultData?: any) => <Props, Component>(WrappedComponent: React.ComponentType<Props> & Component) => React.ForwardRefExoticComponent<React.PropsWithoutRef<JSX.LibraryManagedAttributes<Component, Props & WithContextProps>> & React.RefAttributes<any>>;
|
|
6
6
|
export default withAnalyticsContext;
|
|
@@ -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.
|
|
@@ -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 extends WithAnalyticsEventsProps, Component>(WrappedComponent: React.
|
|
11
|
+
declare const withAnalyticsEvents: (createEventMap?: CreateEventMap) => <Props extends WithAnalyticsEventsProps, Component>(WrappedComponent: React.ComponentType<Props> & Component) => React.ForwardRefExoticComponent<React.PropsWithoutRef<JSX.LibraryManagedAttributes<Component, Omit<Props, keyof WithAnalyticsEventsProps>>> & React.RefAttributes<any>>;
|
|
12
12
|
export default withAnalyticsEvents;
|
|
@@ -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
|