@atlaskit/analytics-next 8.3.5 → 9.0.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 (92) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/components/AnalyticsContext/LegacyAnalyticsContext.js +4 -28
  3. package/dist/cjs/components/AnalyticsContext/ModernAnalyticsContext.js +1 -12
  4. package/dist/cjs/components/AnalyticsContext/index.js +0 -7
  5. package/dist/cjs/components/AnalyticsErrorBoundary.js +19 -68
  6. package/dist/cjs/components/AnalyticsListener/LegacyAnalyticsListener.js +6 -32
  7. package/dist/cjs/components/AnalyticsListener/ModernAnalyticsListener.js +2 -14
  8. package/dist/cjs/components/AnalyticsListener/index.js +0 -7
  9. package/dist/cjs/events/AnalyticsEvent.js +2 -18
  10. package/dist/cjs/events/UIAnalyticsEvent.js +3 -31
  11. package/dist/cjs/hocs/withAnalyticsContext.js +5 -17
  12. package/dist/cjs/hocs/withAnalyticsEvents.js +6 -16
  13. package/dist/cjs/hooks/useAnalyticsContext.js +0 -5
  14. package/dist/cjs/hooks/useAnalyticsEvents.js +0 -5
  15. package/dist/cjs/hooks/useCallbackWithAnalytics.js +1 -7
  16. package/dist/cjs/hooks/usePatchedProps.js +3 -19
  17. package/dist/cjs/hooks/usePlatformLeafEventHandler.js +20 -27
  18. package/dist/cjs/hooks/usePlatformLeafSyntheticEventHandler.js +19 -26
  19. package/dist/cjs/hooks/useTrackedRef.js +0 -3
  20. package/dist/cjs/index.js +0 -18
  21. package/dist/cjs/test-utils/useRenderCounter.js +0 -3
  22. package/dist/cjs/utils/cleanProps.js +1 -5
  23. package/dist/cjs/utils/createAndFireEvent.js +0 -4
  24. package/dist/cjs/version.json +1 -1
  25. package/dist/es2019/components/AnalyticsContext/LegacyAnalyticsContext.js +2 -12
  26. package/dist/es2019/components/AnalyticsContext/ModernAnalyticsContext.js +0 -2
  27. package/dist/es2019/components/AnalyticsContext/index.js +0 -3
  28. package/dist/es2019/components/AnalyticsErrorBoundary.js +8 -38
  29. package/dist/es2019/components/AnalyticsListener/LegacyAnalyticsListener.js +2 -14
  30. package/dist/es2019/components/AnalyticsListener/ModernAnalyticsListener.js +0 -3
  31. package/dist/es2019/components/AnalyticsListener/index.js +0 -3
  32. package/dist/es2019/events/AnalyticsEvent.js +6 -10
  33. package/dist/es2019/events/UIAnalyticsEvent.js +3 -15
  34. package/dist/es2019/hocs/withAnalyticsContext.js +6 -5
  35. package/dist/es2019/hocs/withAnalyticsEvents.js +4 -4
  36. package/dist/es2019/hooks/usePatchedProps.js +6 -9
  37. package/dist/es2019/hooks/usePlatformLeafEventHandler.js +14 -10
  38. package/dist/es2019/hooks/usePlatformLeafSyntheticEventHandler.js +14 -10
  39. package/dist/es2019/index.js +2 -1
  40. package/dist/es2019/test-utils/useRenderCounter.js +2 -1
  41. package/dist/es2019/utils/createAndFireEvent.js +0 -2
  42. package/dist/es2019/version.json +1 -1
  43. package/dist/esm/components/AnalyticsContext/LegacyAnalyticsContext.js +4 -21
  44. package/dist/esm/components/AnalyticsContext/ModernAnalyticsContext.js +1 -3
  45. package/dist/esm/components/AnalyticsContext/index.js +0 -3
  46. package/dist/esm/components/AnalyticsErrorBoundary.js +18 -54
  47. package/dist/esm/components/AnalyticsListener/LegacyAnalyticsListener.js +6 -25
  48. package/dist/esm/components/AnalyticsListener/ModernAnalyticsListener.js +2 -5
  49. package/dist/esm/components/AnalyticsListener/index.js +0 -3
  50. package/dist/esm/events/AnalyticsEvent.js +2 -16
  51. package/dist/esm/events/UIAnalyticsEvent.js +3 -27
  52. package/dist/esm/hocs/withAnalyticsContext.js +5 -9
  53. package/dist/esm/hocs/withAnalyticsEvents.js +6 -8
  54. package/dist/esm/hooks/useCallbackWithAnalytics.js +1 -2
  55. package/dist/esm/hooks/usePatchedProps.js +3 -14
  56. package/dist/esm/hooks/usePlatformLeafEventHandler.js +20 -22
  57. package/dist/esm/hooks/usePlatformLeafSyntheticEventHandler.js +19 -21
  58. package/dist/esm/index.js +2 -1
  59. package/dist/esm/test-utils/useRenderCounter.js +2 -1
  60. package/dist/esm/utils/cleanProps.js +1 -2
  61. package/dist/esm/utils/createAndFireEvent.js +0 -2
  62. package/dist/esm/version.json +1 -1
  63. package/dist/types/components/AnalyticsErrorBoundary.d.ts +7 -12
  64. package/package.json +9 -11
  65. package/report.api.md +152 -7410
  66. package/tmp/api-report-tmp.d.ts +225 -0
  67. package/dist/types-ts4.0/components/AnalyticsContext/LegacyAnalyticsContext.d.ts +0 -29
  68. package/dist/types-ts4.0/components/AnalyticsContext/ModernAnalyticsContext.d.ts +0 -3
  69. package/dist/types-ts4.0/components/AnalyticsContext/index.d.ts +0 -3
  70. package/dist/types-ts4.0/components/AnalyticsContext/types.d.ts +0 -9
  71. package/dist/types-ts4.0/components/AnalyticsErrorBoundary.d.ts +0 -29
  72. package/dist/types-ts4.0/components/AnalyticsListener/LegacyAnalyticsListener.d.ts +0 -33
  73. package/dist/types-ts4.0/components/AnalyticsListener/ModernAnalyticsListener.d.ts +0 -3
  74. package/dist/types-ts4.0/components/AnalyticsListener/index.d.ts +0 -3
  75. package/dist/types-ts4.0/components/AnalyticsListener/types.d.ts +0 -12
  76. package/dist/types-ts4.0/events/AnalyticsEvent.d.ts +0 -15
  77. package/dist/types-ts4.0/events/UIAnalyticsEvent.d.ts +0 -20
  78. package/dist/types-ts4.0/hocs/withAnalyticsContext.d.ts +0 -6
  79. package/dist/types-ts4.0/hocs/withAnalyticsEvents.d.ts +0 -12
  80. package/dist/types-ts4.0/hooks/useAnalyticsContext.d.ts +0 -2
  81. package/dist/types-ts4.0/hooks/useAnalyticsEvents.d.ts +0 -5
  82. package/dist/types-ts4.0/hooks/useCallbackWithAnalytics.d.ts +0 -2
  83. package/dist/types-ts4.0/hooks/usePatchedProps.d.ts +0 -5
  84. package/dist/types-ts4.0/hooks/usePlatformLeafEventHandler.d.ts +0 -12
  85. package/dist/types-ts4.0/hooks/usePlatformLeafSyntheticEventHandler.d.ts +0 -11
  86. package/dist/types-ts4.0/hooks/useTrackedRef.d.ts +0 -2
  87. package/dist/types-ts4.0/index.d.ts +0 -25
  88. package/dist/types-ts4.0/performance/examples.d.ts +0 -5
  89. package/dist/types-ts4.0/test-utils/useRenderCounter.d.ts +0 -1
  90. package/dist/types-ts4.0/types.d.ts +0 -6
  91. package/dist/types-ts4.0/utils/cleanProps.d.ts +0 -3
  92. package/dist/types-ts4.0/utils/createAndFireEvent.d.ts +0 -4
@@ -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 | undefined) => (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 | undefined) => 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
+ ```
@@ -1,29 +0,0 @@
1
- import React, { Component } from 'react';
2
- import PropTypes from 'prop-types';
3
- import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
4
- interface Props {
5
- /** Children! */
6
- children: React.ReactNode;
7
- /** Arbitrary data. Any events created below this component in the tree will
8
- * have this added as an item in their context array. */
9
- data: Object;
10
- }
11
- declare class AnalyticsContext extends Component<Props, AnalyticsReactContextInterface> {
12
- static contextTypes: {
13
- getAtlaskitAnalyticsContext: PropTypes.Requireable<(...args: any[]) => any>;
14
- getAtlaskitAnalyticsEventHandlers: PropTypes.Requireable<(...args: any[]) => any>;
15
- };
16
- static childContextTypes: {
17
- getAtlaskitAnalyticsContext: PropTypes.Requireable<(...args: any[]) => any>;
18
- getAtlaskitAnalyticsEventHandlers: PropTypes.Requireable<(...args: any[]) => any>;
19
- };
20
- contextValue: AnalyticsReactContextInterface;
21
- constructor(props: Props);
22
- getChildContext: () => {
23
- getAtlaskitAnalyticsContext: () => any[];
24
- };
25
- getAnalyticsContext: () => any[];
26
- getAnalyticsEventHandlers: () => any;
27
- render(): JSX.Element;
28
- }
29
- export default AnalyticsContext;
@@ -1,3 +0,0 @@
1
- import { AnalyticsContextFunction } from './types';
2
- declare const AnalyticsContext: AnalyticsContextFunction;
3
- export default AnalyticsContext;
@@ -1,3 +0,0 @@
1
- import { AnalyticsContextFunction } from './types';
2
- declare let ExportedAnalyticsContext: AnalyticsContextFunction;
3
- export default ExportedAnalyticsContext;
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
3
- export declare type AnalyticsContextFunction = (props: {
4
- /** Children! */
5
- children: React.ReactNode;
6
- /** Arbitrary data. Any events created below this component in the tree will
7
- * have this added as an item in their context array. */
8
- data: Object;
9
- }, context?: AnalyticsReactContextInterface) => JSX.Element;
@@ -1,29 +0,0 @@
1
- import React, { Component, ReactNode } from 'react';
2
- import { WithAnalyticsEventsProps } from '../hocs/withAnalyticsEvents';
3
- declare type AnalyticsErrorBoundaryErrorInfo = {
4
- componentStack: string;
5
- };
6
- export interface AnalyticsErrorBoundaryProps extends WithAnalyticsEventsProps {
7
- /** React component to be wrapped */
8
- children: ReactNode;
9
- channel: string;
10
- data: {};
11
- ErrorComponent?: React.ComponentType;
12
- onError?: (error: Error, info?: AnalyticsErrorBoundaryErrorInfo) => void;
13
- }
14
- declare type AnalyticsErrorBoundaryPayload = {
15
- error: Error | string;
16
- info?: AnalyticsErrorBoundaryErrorInfo;
17
- [key: string]: any;
18
- };
19
- declare type AnalyticsErrorBoundaryState = {
20
- hasError: boolean;
21
- };
22
- export declare class BaseAnalyticsErrorBoundary extends Component<AnalyticsErrorBoundaryProps, AnalyticsErrorBoundaryState> {
23
- constructor(props: AnalyticsErrorBoundaryProps);
24
- fireAnalytics: (analyticsErrorPayload: AnalyticsErrorBoundaryPayload) => void;
25
- componentDidCatch(error: Error, info?: AnalyticsErrorBoundaryErrorInfo): void;
26
- render(): JSX.Element;
27
- }
28
- declare const AnalyticsErrorBoundary: React.ForwardRefExoticComponent<Omit<AnalyticsErrorBoundaryProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
29
- export default AnalyticsErrorBoundary;
@@ -1,33 +0,0 @@
1
- import React, { Component } from 'react';
2
- import PropTypes from 'prop-types';
3
- import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
4
- import UIAnalyticsEvent from '../../events/UIAnalyticsEvent';
5
- declare type Props = {
6
- /** Children! */
7
- children?: React.ReactNode;
8
- /** The channel to listen for events on. */
9
- channel?: string;
10
- /** A function which will be called when an event is fired on this Listener's
11
- * channel. It is passed the event and the channel as arguments. */
12
- onEvent: (event: UIAnalyticsEvent, channel?: string) => void;
13
- };
14
- declare class AnalyticsListener extends Component<Props> {
15
- static contextTypes: {
16
- getAtlaskitAnalyticsEventHandlers: PropTypes.Requireable<(...args: any[]) => any>;
17
- getAtlaskitAnalyticsContext: PropTypes.Requireable<(...args: any[]) => any>;
18
- };
19
- static childContextTypes: {
20
- getAtlaskitAnalyticsEventHandlers: PropTypes.Requireable<(...args: any[]) => any>;
21
- getAtlaskitAnalyticsContext: PropTypes.Requireable<(...args: any[]) => any>;
22
- };
23
- contextValue: AnalyticsReactContextInterface;
24
- constructor(props: Props);
25
- getChildContext: () => {
26
- getAtlaskitAnalyticsEventHandlers: () => any[];
27
- getAtlaskitAnalyticsContext: () => any;
28
- };
29
- getAnalyticsEventHandlers: () => any[];
30
- getAtlaskitAnalyticsContext: () => any;
31
- render(): JSX.Element;
32
- }
33
- export default AnalyticsListener;
@@ -1,3 +0,0 @@
1
- import { AnalyticsListenerFunction } from './types';
2
- declare const AnalyticsListener: AnalyticsListenerFunction;
3
- export default AnalyticsListener;
@@ -1,3 +0,0 @@
1
- import { AnalyticsListenerFunction } from './types';
2
- declare let ExportedAnalyticsListener: AnalyticsListenerFunction;
3
- export default ExportedAnalyticsListener;
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
3
- import UIAnalyticsEvent from '../../events/UIAnalyticsEvent';
4
- export declare type AnalyticsListenerFunction = (props: {
5
- /** Children! */
6
- children?: React.ReactNode;
7
- /** The channel to listen for events on. */
8
- channel?: string;
9
- /** A function which will be called when an event is fired on this Listener's
10
- * channel. It is passed the event and the channel as arguments. */
11
- onEvent: (event: UIAnalyticsEvent, channel?: string) => void;
12
- }, context?: AnalyticsReactContextInterface) => JSX.Element;
@@ -1,15 +0,0 @@
1
- export declare type AnalyticsEventPayload = Record<string, any>;
2
- declare type AnalyticsEventCallback = (payload: AnalyticsEventPayload) => AnalyticsEventPayload;
3
- declare type AnalyticsEventUpdater = AnalyticsEventPayload | AnalyticsEventCallback;
4
- export declare type AnalyticsEventProps = {
5
- payload: AnalyticsEventPayload;
6
- };
7
- export declare const isAnalyticsEvent: (obj: any) => boolean;
8
- export default class AnalyticsEvent {
9
- payload: AnalyticsEventPayload;
10
- _isAnalyticsEvent: boolean;
11
- constructor(props: AnalyticsEventProps);
12
- clone: () => AnalyticsEvent | null;
13
- update(updater: AnalyticsEventUpdater): this;
14
- }
15
- export {};
@@ -1,20 +0,0 @@
1
- import AnalyticsEvent, { AnalyticsEventPayload, AnalyticsEventProps } from './AnalyticsEvent';
2
- declare type ChannelIdentifier = string;
3
- declare type Context = Record<string, any>[];
4
- export declare type UIAnalyticsEventHandler = (event: UIAnalyticsEvent, channel?: ChannelIdentifier) => void;
5
- export declare type UIAnalyticsEventProps = AnalyticsEventProps & {
6
- context?: Context;
7
- handlers?: UIAnalyticsEventHandler[];
8
- };
9
- export declare const isUIAnalyticsEvent: (obj: any) => boolean;
10
- export default class UIAnalyticsEvent extends AnalyticsEvent {
11
- context: Context;
12
- handlers: UIAnalyticsEventHandler[];
13
- hasFired: boolean;
14
- _isUIAnalyticsEvent: boolean;
15
- constructor(props: UIAnalyticsEventProps);
16
- clone: () => UIAnalyticsEvent | null;
17
- fire: (channel?: string | undefined) => void;
18
- update(updater: Record<string, any> | ((payload: AnalyticsEventPayload) => AnalyticsEventPayload)): this;
19
- }
20
- export {};
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- export interface WithContextProps {
3
- analyticsContext?: Record<string, any>;
4
- }
5
- declare const withAnalyticsContext: (defaultData?: any) => <Props, Component>(WrappedComponent: React.JSXElementConstructor<Props> & Component) => React.ForwardRefExoticComponent<React.PropsWithoutRef<JSX.LibraryManagedAttributes<Component, Props & WithContextProps>> & React.RefAttributes<any>>;
6
- export default withAnalyticsContext;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import { CreateEventMap, CreateUIAnalyticsEvent } from '../types';
3
- export interface WithAnalyticsEventsProps {
4
- /**
5
- * You should not be accessing this prop under any circumstances.
6
- * It is provided by `@atlaskit/analytics-next` and integrated in the component
7
- */
8
- createAnalyticsEvent?: CreateUIAnalyticsEvent;
9
- ref?: React.Ref<any>;
10
- }
11
- declare const withAnalyticsEvents: (createEventMap?: CreateEventMap) => <Props extends WithAnalyticsEventsProps, Component>(WrappedComponent: React.JSXElementConstructor<Props> & Component) => React.ForwardRefExoticComponent<React.PropsWithoutRef<JSX.LibraryManagedAttributes<Component, Omit<Props, keyof WithAnalyticsEventsProps>>> & React.RefAttributes<any>>;
12
- export default withAnalyticsEvents;
@@ -1,2 +0,0 @@
1
- import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
2
- export declare const useAnalyticsContext: () => AnalyticsReactContextInterface;
@@ -1,5 +0,0 @@
1
- import { CreateUIAnalyticsEvent } from '../types';
2
- export declare type UseAnalyticsEventsHook = {
3
- createAnalyticsEvent: CreateUIAnalyticsEvent;
4
- };
5
- export declare function useAnalyticsEvents(): UseAnalyticsEventsHook;
@@ -1,2 +0,0 @@
1
- export declare type UseCallbackWithAnalyticsHook = (method: (...args: any[]) => void, payload: Record<string, any> | ((...args: any[]) => void), channel?: string) => (...args: any[]) => void;
2
- export declare const useCallbackWithAnalytics: UseCallbackWithAnalyticsHook;
@@ -1,5 +0,0 @@
1
- import { CreateEventMap } from '../types';
2
- export declare type PatchedPropsHook = {
3
- patchedEventProps: CreateEventMap;
4
- };
5
- export declare function usePatchedProps<Props extends Record<string, any>>(createEventMap: CreateEventMap | undefined, wrappedComponentProps: Props): PatchedPropsHook;
@@ -1,12 +0,0 @@
1
- import UIAnalyticsEvent from '../events/UIAnalyticsEvent';
2
- export declare type UsePlatformLeafEventHandlerHookArgs<T> = {
3
- fn: (value: T, analyticsEvent: UIAnalyticsEvent) => void;
4
- action: string;
5
- componentName: string;
6
- actionSubject?: string;
7
- packageName: string;
8
- packageVersion: string;
9
- analyticsData?: Record<string, any>;
10
- };
11
- export declare type UsePlatformLeafEventHandlerHook<T> = (value: T) => void;
12
- export declare function usePlatformLeafEventHandler<T>({ fn, action, componentName, actionSubject, packageName, packageVersion, analyticsData, }: UsePlatformLeafEventHandlerHookArgs<T>): (value: T) => void;
@@ -1,11 +0,0 @@
1
- import UIAnalyticsEvent from '../events/UIAnalyticsEvent';
2
- export declare type UsePlatformLeafSyntheticEventHandlerHookArgs = {
3
- fn: (analyticsEvent: UIAnalyticsEvent) => void;
4
- action: string;
5
- componentName: string;
6
- packageName: string;
7
- packageVersion: string;
8
- analyticsData?: Record<string, any>;
9
- };
10
- export declare type UsePlatformLeafSyntheticEventHandlerHook = () => void;
11
- export declare function usePlatformLeafSyntheticEventHandler({ fn, action, componentName, packageName, packageVersion, analyticsData, }: UsePlatformLeafSyntheticEventHandlerHookArgs): () => void;
@@ -1,2 +0,0 @@
1
- import { MutableRefObject } from 'react';
2
- export declare const useTrackedRef: <T>(value: T) => MutableRefObject<T>;
@@ -1,25 +0,0 @@
1
- export type { CreateUIAnalyticsEvent } from './types';
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
- export { default as AnalyticsListener } from './components/AnalyticsListener/index';
7
- export { default as AnalyticsContext } from './components/AnalyticsContext/index';
8
- export { default as withAnalyticsContext } from './hocs/withAnalyticsContext';
9
- export type { WithContextProps } from './hocs/withAnalyticsContext';
10
- export { default as AnalyticsErrorBoundary } from './components/AnalyticsErrorBoundary';
11
- export type { AnalyticsErrorBoundaryProps } from './components/AnalyticsErrorBoundary';
12
- export { default as withAnalyticsEvents } from './hocs/withAnalyticsEvents';
13
- export type { WithAnalyticsEventsProps } from './hocs/withAnalyticsEvents';
14
- export { default as AnalyticsReactContext } from '@atlaskit/analytics-next-stable-react-context';
15
- export type { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
16
- export { useAnalyticsEvents } from './hooks/useAnalyticsEvents';
17
- export type { UseAnalyticsEventsHook } from './hooks/useAnalyticsEvents';
18
- export { useCallbackWithAnalytics } from './hooks/useCallbackWithAnalytics';
19
- export type { UseCallbackWithAnalyticsHook } from './hooks/useCallbackWithAnalytics';
20
- export { usePlatformLeafEventHandler } from './hooks/usePlatformLeafEventHandler';
21
- export type { UsePlatformLeafEventHandlerHookArgs, UsePlatformLeafEventHandlerHook, } from './hooks/usePlatformLeafEventHandler';
22
- export { usePlatformLeafSyntheticEventHandler } from './hooks/usePlatformLeafSyntheticEventHandler';
23
- export type { UsePlatformLeafSyntheticEventHandlerHookArgs, UsePlatformLeafSyntheticEventHandlerHook, } from './hooks/usePlatformLeafSyntheticEventHandler';
24
- export { default as createAndFireEvent } from './utils/createAndFireEvent';
25
- export { default as cleanProps } from './utils/cleanProps';
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const UsePlatformLeafEventHandlerHookTest: () => JSX.Element;
3
- export declare const UseAnalyticsEventHookTest: () => JSX.Element;
4
- export declare const UseCallbackWithAnalyticsHookTest: () => JSX.Element;
5
- export declare const HOCSTest: () => JSX.Element;
@@ -1 +0,0 @@
1
- export declare const useRenderCounter: () => number;
@@ -1,6 +0,0 @@
1
- import { AnalyticsEventPayload } from './events/AnalyticsEvent';
2
- import UIAnalyticsEvent from './events/UIAnalyticsEvent';
3
- export declare type CreateUIAnalyticsEvent = (payload: AnalyticsEventPayload) => UIAnalyticsEvent;
4
- export declare type AnalyticsEventCreator = (create: CreateUIAnalyticsEvent, props: Record<string, any>) => UIAnalyticsEvent | undefined;
5
- export declare type CreateEventMapValue = AnalyticsEventPayload | AnalyticsEventCreator;
6
- export declare type CreateEventMap = Record<string, CreateEventMapValue>;
@@ -1,3 +0,0 @@
1
- export default function cleanProps(props: Record<string, any>): {
2
- [x: string]: any;
3
- };
@@ -1,4 +0,0 @@
1
- import { AnalyticsEventPayload } from '../events/AnalyticsEvent';
2
- import { CreateUIAnalyticsEvent } from '../types';
3
- declare const _default: (channel?: string | undefined) => (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => import("..").UIAnalyticsEvent;
4
- export default _default;