@atlaskit/analytics-next 9.0.0 → 9.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/analytics-next
2
2
 
3
+ ## 9.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7caf968e4cf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7caf968e4cf) - Move analytics-next to maintenance mode
8
+
9
+ ## 9.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`fbff320b423`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fbff320b423) - Move package to continuous model and to push model consumption
14
+
3
15
  ## 9.0.0
4
16
 
5
17
  ### Major Changes
package/README.md CHANGED
@@ -1,7 +1,10 @@
1
1
  # Analytics-next
2
-
3
2
  Tools for tracking interactions with UI components. Easily capture UI context and state when these events occur.
4
3
 
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
+
5
8
  ## Installation
6
9
 
7
10
  ```sh
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/analytics-next",
3
- "version": "9.0.0",
3
+ "version": "9.0.2",
4
4
  "sideEffects": false
5
5
  }
@@ -2,8 +2,7 @@ import React, { Component } from 'react';
2
2
  import AnalyticsContext from './AnalyticsContext/LegacyAnalyticsContext';
3
3
  /**
4
4
  * @deprecated
5
- */
6
- // eslint-disable-next-line @repo/internal/react/no-class-components
5
+ */ // eslint-disable-next-line @repo/internal/react/no-class-components
7
6
  export default class AnalyticsErrorBoundary extends Component {
8
7
  constructor(props) {
9
8
  super(props);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/analytics-next",
3
- "version": "9.0.0",
3
+ "version": "9.0.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/analytics-next",
3
- "version": "9.0.0",
3
+ "version": "9.0.2",
4
4
  "sideEffects": false
5
5
  }
package/docs/0-intro.tsx CHANGED
@@ -1,6 +1,10 @@
1
1
  import { md } from '@atlaskit/docs';
2
2
 
3
3
  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
+
4
8
  This package aims to help assist consumers track the way their React components are being used.
5
9
 
6
10
  ### Contents
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/analytics-next",
3
- "version": "9.0.0",
3
+ "version": "9.0.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/"
@@ -16,7 +16,10 @@
16
16
  "atlaskit:src": "src/index.ts",
17
17
  "atlassian": {
18
18
  "team": "UIP Frontend Observability",
19
- "releaseModel": "scheduled",
19
+ "releaseModel": "continuous",
20
+ "productPushConsumption": [
21
+ "jira"
22
+ ],
20
23
  "website": {
21
24
  "name": "Analytics next"
22
25
  }
@@ -48,7 +51,7 @@
48
51
  "react": "^16.8.0"
49
52
  },
50
53
  "devDependencies": {
51
- "@atlaskit/button": "^16.5.0",
54
+ "@atlaskit/button": "^16.6.0",
52
55
  "@atlaskit/docs": "*",
53
56
  "@atlaskit/ssr": "*",
54
57
  "@atlaskit/textfield": "^5.3.0",
package/report.api.md CHANGED
@@ -19,6 +19,7 @@
19
19
 
20
20
  import { default as AnalyticsReactContext } from '@atlaskit/analytics-next-stable-react-context';
21
21
  import { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
22
+ import { Component } from 'react';
22
23
  import { default as React_2 } from 'react';
23
24
  import { ReactNode } from 'react';
24
25
 
@@ -34,11 +35,17 @@ type AnalyticsContextFunction = (
34
35
  context?: AnalyticsReactContextInterface,
35
36
  ) => JSX.Element;
36
37
 
37
- // @public (undocumented)
38
- export const AnalyticsErrorBoundary: React_2.ForwardRefExoticComponent<
39
- Omit<AnalyticsErrorBoundaryProps, keyof WithAnalyticsEventsProps> &
40
- React_2.RefAttributes<any>
41
- >;
38
+ // @public @deprecated (undocumented)
39
+ export class AnalyticsErrorBoundary extends Component<
40
+ AnalyticsErrorBoundaryProps,
41
+ AnalyticsErrorBoundaryState
42
+ > {
43
+ constructor(props: AnalyticsErrorBoundaryProps);
44
+ // (undocumented)
45
+ componentDidCatch(error: Error, info?: AnalyticsErrorBoundaryErrorInfo): void;
46
+ // (undocumented)
47
+ render(): JSX.Element | null;
48
+ }
42
49
 
43
50
  // @public (undocumented)
44
51
  type AnalyticsErrorBoundaryErrorInfo = {
@@ -46,7 +53,7 @@ type AnalyticsErrorBoundaryErrorInfo = {
46
53
  };
47
54
 
48
55
  // @public (undocumented)
49
- export interface AnalyticsErrorBoundaryProps extends WithAnalyticsEventsProps {
56
+ export interface AnalyticsErrorBoundaryProps {
50
57
  // (undocumented)
51
58
  channel: string;
52
59
  children: ReactNode;
@@ -58,6 +65,11 @@ export interface AnalyticsErrorBoundaryProps extends WithAnalyticsEventsProps {
58
65
  onError?: (error: Error, info?: AnalyticsErrorBoundaryErrorInfo) => void;
59
66
  }
60
67
 
68
+ // @public (undocumented)
69
+ type AnalyticsErrorBoundaryState = {
70
+ hasError: boolean;
71
+ };
72
+
61
73
  // @public (undocumented)
62
74
  export class AnalyticsEvent {
63
75
  constructor(props: AnalyticsEventProps);
@@ -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
+ ```