@atlaskit/analytics-next 9.1.0 → 9.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 +2 -2
- package/AnalyticsErrorBoundary/package.json +2 -2
- package/AnalyticsEvent/package.json +2 -2
- package/AnalyticsListener/package.json +2 -2
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/UIAnalyticsEvent/package.json +2 -2
- package/createAndFireEvents/package.json +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +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 +1 -1
- package/dist/types/components/AnalyticsListener/types.d.ts +1 -1
- package/dist/types/events/AnalyticsEvent.d.ts +4 -4
- package/dist/types/events/UIAnalyticsEvent.d.ts +5 -5
- package/dist/types/hooks/useAnalyticsEvents.d.ts +1 -1
- package/dist/types/hooks/useCallbackWithAnalytics.d.ts +1 -1
- package/dist/types/hooks/usePatchedProps.d.ts +1 -1
- package/dist/types/hooks/usePlatformLeafEventHandler.d.ts +2 -2
- package/dist/types/hooks/usePlatformLeafSyntheticEventHandler.d.ts +2 -2
- package/dist/types/types.d.ts +4 -4
- package/dist/types/utils/createAndFireEvent.d.ts +1 -1
- package/docs/0-intro.tsx +23 -3
- package/package.json +11 -2
- package/report.api.md +2 -2
- package/tmp/api-report-tmp.d.ts +225 -0
- package/types/package.json +2 -2
- package/useAnalyticsEvents/package.json +2 -2
- package/useCallbackWithAnalytics/package.json +2 -2
- package/usePatchedProps/package.json +2 -2
- package/usePlatformLeafEventHandler/package.json +2 -2
- package/withAnalyticsContext/package.json +2 -2
- package/withAnalyticsEvents/package.json +2 -2
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"types": "../dist/types/components/AnalyticsContext/index.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
|
-
">=4.
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.
|
|
11
|
+
"../dist/types-ts4.5/components/AnalyticsContext/index.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"types": "../dist/types/components/AnalyticsErrorBoundary.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
|
-
">=4.
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.
|
|
11
|
+
"../dist/types-ts4.5/components/AnalyticsErrorBoundary.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"types": "../dist/types/events/AnalyticsEvent.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
|
-
">=4.
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.
|
|
11
|
+
"../dist/types-ts4.5/events/AnalyticsEvent.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"types": "../dist/types/components/AnalyticsListener/index.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
|
-
">=4.
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.
|
|
11
|
+
"../dist/types-ts4.5/components/AnalyticsListener/index.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/analytics-next
|
|
2
2
|
|
|
3
|
+
## 9.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
|
|
8
|
+
|
|
9
|
+
## 9.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`7cc1e8f18ec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7cc1e8f18ec) - Move analytics-next to maintenance mode
|
|
14
|
+
|
|
3
15
|
## 9.1.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Tools for tracking interactions with UI components. Easily capture UI context and state when these events occur.
|
|
3
3
|
|
|
4
4
|
> **_Maintaince Mode:_** \
|
|
5
|
-
This package is officially in maintenance mode, which means only bugfixes or VULN fixes are currently being accepted and no breaking changes will be approved in the PR process. \
|
|
5
|
+
This package is officially in maintenance mode, which means only bugfixes or VULN fixes are currently being accepted and no known breaking changes will be approved in the PR process. \
|
|
6
6
|
Please refer to this [DACI](https://hello.atlassian.net/wiki/spaces/APD/pages/2470435075/DACI+analytics-next+in+a+maintenance+mode) for more details.
|
|
7
7
|
|
|
8
8
|
## Installation
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"types": "../dist/types/events/UIAnalyticsEvent.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
|
-
">=4.
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.
|
|
11
|
+
"../dist/types-ts4.5/events/UIAnalyticsEvent.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"types": "../dist/types/utils/createAndFireEvent.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
|
-
">=4.
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.
|
|
11
|
+
"../dist/types-ts4.5/utils/createAndFireEvent.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/version.json
CHANGED
package/dist/esm/version.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
3
|
-
export
|
|
3
|
+
export type AnalyticsContextFunction = (props: {
|
|
4
4
|
/** Children! */
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
/** Arbitrary data. Any events created below this component in the tree will
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { Component, ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
type AnalyticsErrorBoundaryErrorInfo = {
|
|
3
3
|
componentStack: string;
|
|
4
4
|
};
|
|
5
5
|
export interface AnalyticsErrorBoundaryProps {
|
|
@@ -10,7 +10,7 @@ export interface AnalyticsErrorBoundaryProps {
|
|
|
10
10
|
ErrorComponent?: React.ComponentType;
|
|
11
11
|
onError?: (error: Error, info?: AnalyticsErrorBoundaryErrorInfo) => void;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
type AnalyticsErrorBoundaryState = {
|
|
14
14
|
hasError: boolean;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
4
4
|
import UIAnalyticsEvent from '../../events/UIAnalyticsEvent';
|
|
5
|
-
|
|
5
|
+
type Props = {
|
|
6
6
|
/** Children! */
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
/** The channel to listen for events on. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
3
3
|
import UIAnalyticsEvent from '../../events/UIAnalyticsEvent';
|
|
4
|
-
export
|
|
4
|
+
export type AnalyticsListenerFunction = (props: {
|
|
5
5
|
/** Children! */
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
/** The channel to listen for events on. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
1
|
+
export type AnalyticsEventPayload = Record<string, any>;
|
|
2
|
+
type AnalyticsEventCallback = (payload: AnalyticsEventPayload) => AnalyticsEventPayload;
|
|
3
|
+
type AnalyticsEventUpdater = AnalyticsEventPayload | AnalyticsEventCallback;
|
|
4
|
+
export type AnalyticsEventProps = {
|
|
5
5
|
payload: AnalyticsEventPayload;
|
|
6
6
|
};
|
|
7
7
|
export declare const isAnalyticsEvent: (obj: any) => boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import AnalyticsEvent, { AnalyticsEventPayload, AnalyticsEventProps } from './AnalyticsEvent';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
export
|
|
2
|
+
type ChannelIdentifier = string;
|
|
3
|
+
type Context = Record<string, any>[];
|
|
4
|
+
export type UIAnalyticsEventHandler = (event: UIAnalyticsEvent, channel?: ChannelIdentifier) => void;
|
|
5
|
+
export type UIAnalyticsEventProps = AnalyticsEventProps & {
|
|
6
6
|
context?: Context;
|
|
7
7
|
handlers?: UIAnalyticsEventHandler[];
|
|
8
8
|
};
|
|
@@ -14,7 +14,7 @@ export default class UIAnalyticsEvent extends AnalyticsEvent {
|
|
|
14
14
|
_isUIAnalyticsEvent: boolean;
|
|
15
15
|
constructor(props: UIAnalyticsEventProps);
|
|
16
16
|
clone: () => UIAnalyticsEvent | null;
|
|
17
|
-
fire: (channel?: string
|
|
17
|
+
fire: (channel?: string) => void;
|
|
18
18
|
update(updater: Record<string, any> | ((payload: AnalyticsEventPayload) => AnalyticsEventPayload)): this;
|
|
19
19
|
}
|
|
20
20
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type UseCallbackWithAnalyticsHook = (method: (...args: any[]) => void, payload: Record<string, any> | ((...args: any[]) => void), channel?: string) => (...args: any[]) => void;
|
|
2
2
|
export declare const useCallbackWithAnalytics: UseCallbackWithAnalyticsHook;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CreateEventMap } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export type PatchedPropsHook = {
|
|
3
3
|
patchedEventProps: CreateEventMap;
|
|
4
4
|
};
|
|
5
5
|
export declare function usePatchedProps<Props extends Record<string, any>>(createEventMap: CreateEventMap | undefined, wrappedComponentProps: Props): PatchedPropsHook;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import UIAnalyticsEvent from '../events/UIAnalyticsEvent';
|
|
2
|
-
export
|
|
2
|
+
export type UsePlatformLeafEventHandlerHookArgs<T> = {
|
|
3
3
|
fn: (value: T, analyticsEvent: UIAnalyticsEvent) => void;
|
|
4
4
|
action: string;
|
|
5
5
|
componentName: string;
|
|
@@ -8,5 +8,5 @@ export declare type UsePlatformLeafEventHandlerHookArgs<T> = {
|
|
|
8
8
|
packageVersion: string;
|
|
9
9
|
analyticsData?: Record<string, any>;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import UIAnalyticsEvent from '../events/UIAnalyticsEvent';
|
|
2
|
-
export
|
|
2
|
+
export type UsePlatformLeafSyntheticEventHandlerHookArgs = {
|
|
3
3
|
fn: (analyticsEvent: UIAnalyticsEvent) => void;
|
|
4
4
|
action: string;
|
|
5
5
|
componentName: string;
|
|
@@ -7,5 +7,5 @@ export declare type UsePlatformLeafSyntheticEventHandlerHookArgs = {
|
|
|
7
7
|
packageVersion: string;
|
|
8
8
|
analyticsData?: Record<string, any>;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type UsePlatformLeafSyntheticEventHandlerHook = () => void;
|
|
11
11
|
export declare function usePlatformLeafSyntheticEventHandler({ fn, action, componentName, packageName, packageVersion, analyticsData, }: UsePlatformLeafSyntheticEventHandlerHookArgs): () => void;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnalyticsEventPayload } from './events/AnalyticsEvent';
|
|
2
2
|
import UIAnalyticsEvent from './events/UIAnalyticsEvent';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
3
|
+
export type CreateUIAnalyticsEvent = (payload: AnalyticsEventPayload) => UIAnalyticsEvent;
|
|
4
|
+
export type AnalyticsEventCreator = (create: CreateUIAnalyticsEvent, props: Record<string, any>) => UIAnalyticsEvent | undefined;
|
|
5
|
+
export type CreateEventMapValue = AnalyticsEventPayload | AnalyticsEventCreator;
|
|
6
|
+
export type CreateEventMap = Record<string, CreateEventMapValue>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AnalyticsEventPayload } from '../events/AnalyticsEvent';
|
|
2
2
|
import { CreateUIAnalyticsEvent } from '../types';
|
|
3
|
-
declare const _default: (channel?: string
|
|
3
|
+
declare const _default: (channel?: string) => (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => import("..").UIAnalyticsEvent;
|
|
4
4
|
export default _default;
|
package/docs/0-intro.tsx
CHANGED
|
@@ -1,9 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
1
3
|
import { md } from '@atlaskit/docs';
|
|
4
|
+
import SectionMessage from '@atlaskit/section-message';
|
|
2
5
|
|
|
3
6
|
export default md`
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
|
|
8
|
+
${(
|
|
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
|
|
14
|
+
VULN fixes are currently being accepted and no known breaking changes will
|
|
15
|
+
be approved in the PR process. <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
|
+
)}
|
|
7
27
|
|
|
8
28
|
This package aims to help assist consumers track the way their React components are being used.
|
|
9
29
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/analytics-next",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.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/"
|
|
@@ -12,6 +12,14 @@
|
|
|
12
12
|
"module": "dist/esm/index.js",
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
">=4.5 <4.9": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/types-ts4.5/*",
|
|
19
|
+
"dist/types-ts4.5/index.d.ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
15
23
|
"sideEffects": false,
|
|
16
24
|
"atlaskit:src": "src/index.ts",
|
|
17
25
|
"atlassian": {
|
|
@@ -53,6 +61,7 @@
|
|
|
53
61
|
"devDependencies": {
|
|
54
62
|
"@atlaskit/button": "^16.7.0",
|
|
55
63
|
"@atlaskit/docs": "*",
|
|
64
|
+
"@atlaskit/section-message": "^6.4.0",
|
|
56
65
|
"@atlaskit/ssr": "*",
|
|
57
66
|
"@atlaskit/textfield": "^5.4.0",
|
|
58
67
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
@@ -61,7 +70,7 @@
|
|
|
61
70
|
"react-dom": "^16.8.0",
|
|
62
71
|
"redux": "^3.7.2",
|
|
63
72
|
"storybook-addon-performance": "^0.16.0",
|
|
64
|
-
"typescript": "4.
|
|
73
|
+
"typescript": "~4.9.5"
|
|
65
74
|
},
|
|
66
75
|
"techstack": {
|
|
67
76
|
"@atlassian/frontend": {
|
package/report.api.md
CHANGED
|
@@ -135,7 +135,7 @@ type Context = Record<string, any>[];
|
|
|
135
135
|
|
|
136
136
|
// @public (undocumented)
|
|
137
137
|
export const createAndFireEvent: (
|
|
138
|
-
channel?: string
|
|
138
|
+
channel?: string,
|
|
139
139
|
) => (
|
|
140
140
|
payload: AnalyticsEventPayload,
|
|
141
141
|
) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent;
|
|
@@ -165,7 +165,7 @@ export class UIAnalyticsEvent extends AnalyticsEvent {
|
|
|
165
165
|
// (undocumented)
|
|
166
166
|
context: Context;
|
|
167
167
|
// (undocumented)
|
|
168
|
-
fire: (channel?: string
|
|
168
|
+
fire: (channel?: string) => void;
|
|
169
169
|
// (undocumented)
|
|
170
170
|
handlers: UIAnalyticsEventHandler[];
|
|
171
171
|
// (undocumented)
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/analytics-next"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
/// <reference types="react" />
|
|
8
|
+
|
|
9
|
+
import { default as AnalyticsReactContext } from '@atlaskit/analytics-next-stable-react-context';
|
|
10
|
+
import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
|
|
11
|
+
import { Component } from 'react';
|
|
12
|
+
import { default as React_2 } from 'react';
|
|
13
|
+
import { ReactNode } from 'react';
|
|
14
|
+
|
|
15
|
+
// @public (undocumented)
|
|
16
|
+
export let AnalyticsContext: AnalyticsContextFunction;
|
|
17
|
+
|
|
18
|
+
// @public (undocumented)
|
|
19
|
+
type AnalyticsContextFunction = (props: {
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
data: Object;
|
|
22
|
+
}, context?: AnalyticsReactContextInterface) => JSX.Element;
|
|
23
|
+
|
|
24
|
+
// @public @deprecated (undocumented)
|
|
25
|
+
export class AnalyticsErrorBoundary extends Component<AnalyticsErrorBoundaryProps, AnalyticsErrorBoundaryState> {
|
|
26
|
+
constructor(props: AnalyticsErrorBoundaryProps);
|
|
27
|
+
// (undocumented)
|
|
28
|
+
componentDidCatch(error: Error, info?: AnalyticsErrorBoundaryErrorInfo): void;
|
|
29
|
+
// (undocumented)
|
|
30
|
+
render(): JSX.Element | null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// @public (undocumented)
|
|
34
|
+
type AnalyticsErrorBoundaryErrorInfo = {
|
|
35
|
+
componentStack: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// @public (undocumented)
|
|
39
|
+
export interface AnalyticsErrorBoundaryProps {
|
|
40
|
+
// (undocumented)
|
|
41
|
+
channel: string;
|
|
42
|
+
children: ReactNode;
|
|
43
|
+
// (undocumented)
|
|
44
|
+
data: {};
|
|
45
|
+
// (undocumented)
|
|
46
|
+
ErrorComponent?: React_2.ComponentType;
|
|
47
|
+
// (undocumented)
|
|
48
|
+
onError?: (error: Error, info?: AnalyticsErrorBoundaryErrorInfo) => void;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// @public (undocumented)
|
|
52
|
+
type AnalyticsErrorBoundaryState = {
|
|
53
|
+
hasError: boolean;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// @public (undocumented)
|
|
57
|
+
export class AnalyticsEvent {
|
|
58
|
+
constructor(props: AnalyticsEventProps);
|
|
59
|
+
// (undocumented)
|
|
60
|
+
clone: () => AnalyticsEvent | null;
|
|
61
|
+
// (undocumented)
|
|
62
|
+
_isAnalyticsEvent: boolean;
|
|
63
|
+
// (undocumented)
|
|
64
|
+
payload: AnalyticsEventPayload;
|
|
65
|
+
// (undocumented)
|
|
66
|
+
update(updater: AnalyticsEventUpdater): this;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// @public (undocumented)
|
|
70
|
+
type AnalyticsEventCallback = (payload: AnalyticsEventPayload) => AnalyticsEventPayload;
|
|
71
|
+
|
|
72
|
+
// @public (undocumented)
|
|
73
|
+
type AnalyticsEventCreator = (create: CreateUIAnalyticsEvent, props: Record<string, any>) => UIAnalyticsEvent | undefined;
|
|
74
|
+
|
|
75
|
+
// @public (undocumented)
|
|
76
|
+
export type AnalyticsEventPayload = Record<string, any>;
|
|
77
|
+
|
|
78
|
+
// @public (undocumented)
|
|
79
|
+
export type AnalyticsEventProps = {
|
|
80
|
+
payload: AnalyticsEventPayload;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// @public (undocumented)
|
|
84
|
+
type AnalyticsEventUpdater = AnalyticsEventCallback | AnalyticsEventPayload;
|
|
85
|
+
|
|
86
|
+
// @public (undocumented)
|
|
87
|
+
export let AnalyticsListener: AnalyticsListenerFunction;
|
|
88
|
+
|
|
89
|
+
// @public (undocumented)
|
|
90
|
+
type AnalyticsListenerFunction = (props: {
|
|
91
|
+
children?: React.ReactNode;
|
|
92
|
+
channel?: string;
|
|
93
|
+
onEvent: (event: UIAnalyticsEvent, channel?: string) => void;
|
|
94
|
+
}, context?: AnalyticsReactContextInterface) => JSX.Element;
|
|
95
|
+
|
|
96
|
+
export { AnalyticsReactContext }
|
|
97
|
+
|
|
98
|
+
export { AnalyticsReactContextInterface }
|
|
99
|
+
|
|
100
|
+
// @public (undocumented)
|
|
101
|
+
type ChannelIdentifier = string;
|
|
102
|
+
|
|
103
|
+
// @public (undocumented)
|
|
104
|
+
export function cleanProps(props: Record<string, any>): {
|
|
105
|
+
[x: string]: any;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// @public (undocumented)
|
|
109
|
+
type Context = Record<string, any>[];
|
|
110
|
+
|
|
111
|
+
// @public (undocumented)
|
|
112
|
+
export const createAndFireEvent: (channel?: string) => (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent;
|
|
113
|
+
|
|
114
|
+
// @public (undocumented)
|
|
115
|
+
type CreateEventMap = Record<string, CreateEventMapValue>;
|
|
116
|
+
|
|
117
|
+
// @public (undocumented)
|
|
118
|
+
type CreateEventMapValue = AnalyticsEventCreator | AnalyticsEventPayload;
|
|
119
|
+
|
|
120
|
+
// @public (undocumented)
|
|
121
|
+
export type CreateUIAnalyticsEvent = (payload: AnalyticsEventPayload) => UIAnalyticsEvent;
|
|
122
|
+
|
|
123
|
+
// @public (undocumented)
|
|
124
|
+
export const isAnalyticsEvent: (obj: any) => boolean;
|
|
125
|
+
|
|
126
|
+
// @public (undocumented)
|
|
127
|
+
export const isUIAnalyticsEvent: (obj: any) => boolean;
|
|
128
|
+
|
|
129
|
+
// @public (undocumented)
|
|
130
|
+
export class UIAnalyticsEvent extends AnalyticsEvent {
|
|
131
|
+
constructor(props: UIAnalyticsEventProps);
|
|
132
|
+
// (undocumented)
|
|
133
|
+
clone: () => UIAnalyticsEvent | null;
|
|
134
|
+
// (undocumented)
|
|
135
|
+
context: Context;
|
|
136
|
+
// (undocumented)
|
|
137
|
+
fire: (channel?: string) => void;
|
|
138
|
+
// (undocumented)
|
|
139
|
+
handlers: UIAnalyticsEventHandler[];
|
|
140
|
+
// (undocumented)
|
|
141
|
+
hasFired: boolean;
|
|
142
|
+
// (undocumented)
|
|
143
|
+
_isUIAnalyticsEvent: boolean;
|
|
144
|
+
// (undocumented)
|
|
145
|
+
update(updater: ((payload: AnalyticsEventPayload) => AnalyticsEventPayload) | Record<string, any>): this;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// @public (undocumented)
|
|
149
|
+
export type UIAnalyticsEventHandler = (event: UIAnalyticsEvent, channel?: ChannelIdentifier) => void;
|
|
150
|
+
|
|
151
|
+
// @public (undocumented)
|
|
152
|
+
export type UIAnalyticsEventProps = AnalyticsEventProps & {
|
|
153
|
+
context?: Context;
|
|
154
|
+
handlers?: UIAnalyticsEventHandler[];
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// @public (undocumented)
|
|
158
|
+
export function useAnalyticsEvents(): UseAnalyticsEventsHook;
|
|
159
|
+
|
|
160
|
+
// @public (undocumented)
|
|
161
|
+
export type UseAnalyticsEventsHook = {
|
|
162
|
+
createAnalyticsEvent: CreateUIAnalyticsEvent;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
// @public (undocumented)
|
|
166
|
+
export const useCallbackWithAnalytics: UseCallbackWithAnalyticsHook;
|
|
167
|
+
|
|
168
|
+
// @public (undocumented)
|
|
169
|
+
export type UseCallbackWithAnalyticsHook = (method: (...args: any[]) => void, payload: ((...args: any[]) => void) | Record<string, any>, channel?: string) => (...args: any[]) => void;
|
|
170
|
+
|
|
171
|
+
// @public (undocumented)
|
|
172
|
+
export function usePlatformLeafEventHandler<T>({ fn, action, componentName, actionSubject, packageName, packageVersion, analyticsData, }: UsePlatformLeafEventHandlerHookArgs<T>): (value: T) => void;
|
|
173
|
+
|
|
174
|
+
// @public (undocumented)
|
|
175
|
+
export type UsePlatformLeafEventHandlerHook<T> = (value: T) => void;
|
|
176
|
+
|
|
177
|
+
// @public (undocumented)
|
|
178
|
+
export type UsePlatformLeafEventHandlerHookArgs<T> = {
|
|
179
|
+
fn: (value: T, analyticsEvent: UIAnalyticsEvent) => void;
|
|
180
|
+
action: string;
|
|
181
|
+
componentName: string;
|
|
182
|
+
actionSubject?: string;
|
|
183
|
+
packageName: string;
|
|
184
|
+
packageVersion: string;
|
|
185
|
+
analyticsData?: Record<string, any>;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// @public (undocumented)
|
|
189
|
+
export function usePlatformLeafSyntheticEventHandler({ fn, action, componentName, packageName, packageVersion, analyticsData, }: UsePlatformLeafSyntheticEventHandlerHookArgs): () => void;
|
|
190
|
+
|
|
191
|
+
// @public (undocumented)
|
|
192
|
+
export type UsePlatformLeafSyntheticEventHandlerHook = () => void;
|
|
193
|
+
|
|
194
|
+
// @public (undocumented)
|
|
195
|
+
export type UsePlatformLeafSyntheticEventHandlerHookArgs = {
|
|
196
|
+
fn: (analyticsEvent: UIAnalyticsEvent) => void;
|
|
197
|
+
action: string;
|
|
198
|
+
componentName: string;
|
|
199
|
+
packageName: string;
|
|
200
|
+
packageVersion: string;
|
|
201
|
+
analyticsData?: Record<string, any>;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
// @public (undocumented)
|
|
205
|
+
export const withAnalyticsContext: (defaultData?: any) => <Props, Component>(WrappedComponent: React_2.JSXElementConstructor<Props> & Component) => React_2.ForwardRefExoticComponent<React_2.PropsWithoutRef<JSX.LibraryManagedAttributes<Component, Props & WithContextProps>> & React_2.RefAttributes<any>>;
|
|
206
|
+
|
|
207
|
+
// @public (undocumented)
|
|
208
|
+
export const withAnalyticsEvents: (createEventMap?: CreateEventMap) => <Props extends WithAnalyticsEventsProps, Component>(WrappedComponent: React_2.JSXElementConstructor<Props> & Component) => React_2.ForwardRefExoticComponent<React_2.PropsWithoutRef<JSX.LibraryManagedAttributes<Component, Omit<Props, keyof WithAnalyticsEventsProps>>> & React_2.RefAttributes<any>>;
|
|
209
|
+
|
|
210
|
+
// @public (undocumented)
|
|
211
|
+
export interface WithAnalyticsEventsProps {
|
|
212
|
+
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
213
|
+
// (undocumented)
|
|
214
|
+
ref?: React_2.Ref<any>;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// @public (undocumented)
|
|
218
|
+
export interface WithContextProps {
|
|
219
|
+
// (undocumented)
|
|
220
|
+
analyticsContext?: Record<string, any>;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// (No @packageDocumentation comment for this package)
|
|
224
|
+
|
|
225
|
+
```
|
package/types/package.json
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"types": "../dist/types/hooks/useAnalyticsEvents.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
|
-
">=4.
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.
|
|
11
|
+
"../dist/types-ts4.5/hooks/useAnalyticsEvents.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"types": "../dist/types/hooks/useCallbackWithAnalytics.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
|
-
">=4.
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.
|
|
11
|
+
"../dist/types-ts4.5/hooks/useCallbackWithAnalytics.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"types": "../dist/types/hooks/usePatchedProps.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
|
-
">=4.
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.
|
|
11
|
+
"../dist/types-ts4.5/hooks/usePatchedProps.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"types": "../dist/types/hooks/usePlatformLeafEventHandler.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
|
-
">=4.
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.
|
|
11
|
+
"../dist/types-ts4.5/hooks/usePlatformLeafEventHandler.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"types": "../dist/types/hocs/withAnalyticsContext.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
|
-
">=4.
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.
|
|
11
|
+
"../dist/types-ts4.5/hocs/withAnalyticsContext.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"types": "../dist/types/hocs/withAnalyticsEvents.d.ts",
|
|
8
8
|
"typesVersions": {
|
|
9
|
-
">=4.
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
10
|
"*": [
|
|
11
|
-
"../dist/types-ts4.
|
|
11
|
+
"../dist/types-ts4.5/hocs/withAnalyticsEvents.d.ts"
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
}
|