@atlaskit/analytics-next 9.1.0 → 9.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/analytics-next
2
2
 
3
+ ## 9.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7cc1e8f18ec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7cc1e8f18ec) - Move analytics-next to maintenance mode
8
+
3
9
  ## 9.1.0
4
10
 
5
11
  ### 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
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/analytics-next",
3
- "version": "9.1.0",
3
+ "version": "9.1.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/analytics-next",
3
- "version": "9.1.0",
3
+ "version": "9.1.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/analytics-next",
3
- "version": "9.1.0",
3
+ "version": "9.1.1",
4
4
  "sideEffects": false
5
5
  }
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
- > **_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. \
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
+
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.0",
3
+ "version": "9.1.1",
4
4
  "description": "React components, HOCs and hooks to assist with tracking user activity with React components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -53,6 +53,7 @@
53
53
  "devDependencies": {
54
54
  "@atlaskit/button": "^16.7.0",
55
55
  "@atlaskit/docs": "*",
56
+ "@atlaskit/section-message": "^6.4.0",
56
57
  "@atlaskit/ssr": "*",
57
58
  "@atlaskit/textfield": "^5.4.0",
58
59
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
@@ -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
+ ```