@atlaskit/analytics-next 11.1.4 → 11.2.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 (57) hide show
  1. package/AnalyticsReactContext/package.json +15 -0
  2. package/CHANGELOG.md +21 -0
  3. package/afm-cc/tsconfig.json +0 -2
  4. package/afm-products/tsconfig.json +0 -2
  5. package/cleanProps/package.json +15 -0
  6. package/dist/cjs/components/AnalyticsReactContext.js +13 -0
  7. package/dist/cjs/events/UIAnalyticsEvent.js +11 -1
  8. package/dist/cjs/index.js +2 -2
  9. package/dist/cjs/utils/isModernContextEnabledEnv.js +2 -1
  10. package/dist/es2019/components/AnalyticsReactContext.js +1 -0
  11. package/dist/es2019/events/UIAnalyticsEvent.js +13 -1
  12. package/dist/es2019/index.js +1 -1
  13. package/dist/es2019/utils/isModernContextEnabledEnv.js +2 -1
  14. package/dist/esm/components/AnalyticsReactContext.js +1 -0
  15. package/dist/esm/events/UIAnalyticsEvent.js +11 -1
  16. package/dist/esm/index.js +1 -1
  17. package/dist/esm/utils/isModernContextEnabledEnv.js +2 -1
  18. package/dist/types/components/AnalyticsContext/index.d.ts +1 -1
  19. package/dist/types/components/AnalyticsContext/types.d.ts +1 -1
  20. package/dist/types/components/AnalyticsListener/LegacyAnalyticsListener.d.ts +1 -1
  21. package/dist/types/components/AnalyticsListener/index.d.ts +1 -1
  22. package/dist/types/components/AnalyticsListener/types.d.ts +1 -1
  23. package/dist/types/components/AnalyticsReactContext.d.ts +2 -0
  24. package/dist/types/hocs/withAnalyticsEvents.d.ts +1 -1
  25. package/dist/types/hooks/useAnalyticsEvents.d.ts +1 -1
  26. package/dist/types/hooks/usePatchedProps.d.ts +1 -1
  27. package/dist/types/index.d.ts +2 -2
  28. package/dist/types/types.d.ts +1 -1
  29. package/dist/types/utils/createAndFireEvent.d.ts +2 -2
  30. package/dist/types/utils/isModernContextEnabledEnv.d.ts +2 -2
  31. package/dist/types-ts4.5/components/AnalyticsContext/index.d.ts +1 -1
  32. package/dist/types-ts4.5/components/AnalyticsContext/types.d.ts +1 -1
  33. package/dist/types-ts4.5/components/AnalyticsListener/LegacyAnalyticsListener.d.ts +1 -1
  34. package/dist/types-ts4.5/components/AnalyticsListener/index.d.ts +1 -1
  35. package/dist/types-ts4.5/components/AnalyticsListener/types.d.ts +1 -1
  36. package/dist/types-ts4.5/components/AnalyticsReactContext.d.ts +2 -0
  37. package/dist/types-ts4.5/hocs/withAnalyticsEvents.d.ts +1 -1
  38. package/dist/types-ts4.5/hooks/useAnalyticsEvents.d.ts +1 -1
  39. package/dist/types-ts4.5/hooks/usePatchedProps.d.ts +1 -1
  40. package/dist/types-ts4.5/index.d.ts +2 -2
  41. package/dist/types-ts4.5/types.d.ts +1 -1
  42. package/dist/types-ts4.5/utils/createAndFireEvent.d.ts +2 -2
  43. package/dist/types-ts4.5/utils/isModernContextEnabledEnv.d.ts +2 -2
  44. package/docs/0-intro.tsx +68 -37
  45. package/docs/10-concepts.tsx +138 -112
  46. package/docs/20-usage-with-presentational-components.tsx +177 -198
  47. package/docs/30-usage-for-container-components.tsx +69 -53
  48. package/docs/40-listeners.tsx +17 -14
  49. package/docs/50-error-boundary.tsx +28 -22
  50. package/docs/60-events.tsx +27 -19
  51. package/docs/70-advanced-usage.tsx +182 -179
  52. package/docs/80-upgrade-guide.tsx +182 -100
  53. package/docs/DocBlocks.tsx +106 -0
  54. package/package.json +2 -2
  55. package/tsconfig.json +1 -2
  56. package/usePlatformLeafSyntheticEventHandler/package.json +15 -0
  57. package/afm-jira/tsconfig.json +0 -33
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/analytics-next/AnalyticsReactContext",
3
+ "main": "../dist/cjs/components/AnalyticsReactContext.js",
4
+ "module": "../dist/esm/components/AnalyticsReactContext.js",
5
+ "module:es2019": "../dist/es2019/components/AnalyticsReactContext.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/components/AnalyticsReactContext.d.ts",
8
+ "typesVersions": {
9
+ ">=4.5 <5.9": {
10
+ "*": [
11
+ "../dist/types-ts4.5/components/AnalyticsReactContext.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlaskit/analytics-next
2
2
 
3
+ ## 11.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`35a1309b51bea`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/35a1309b51bea) -
8
+ Isolate handler errors in `UIAnalyticsEvent.fire()` so a throwing analytics handler never
9
+ propagates out and crashes the calling product UI.
10
+
11
+ Each handler is now wrapped in a `try/catch`. In non-production environments the error is surfaced
12
+ via `console.error`; in production it is swallowed silently. This prevents analytics from being in
13
+ the critical path of product UI rendering.
14
+
15
+ PIR: PIR-300717 / HOT-301294 (CFIND-6243)
16
+
17
+ ## 11.2.0
18
+
19
+ ### Minor Changes
20
+
21
+ - [`a0a0a9bcde425`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a0a0a9bcde425) -
22
+ Autofix: add explicit package exports (barrel removal)
23
+
3
24
  ## 11.1.4
4
25
 
5
26
  ### Patch Changes
@@ -1,8 +1,6 @@
1
1
  {
2
2
  "extends": "../../../../tsconfig.local-consumption.json",
3
3
  "compilerOptions": {
4
- "declaration": true,
5
- "target": "es5",
6
4
  "outDir": "../../../../../confluence/tsDist/@atlaskit__analytics-next",
7
5
  "rootDir": "../",
8
6
  "composite": true,
@@ -1,8 +1,6 @@
1
1
  {
2
2
  "extends": "../../../../tsconfig.local-consumption.json",
3
3
  "compilerOptions": {
4
- "declaration": true,
5
- "target": "es5",
6
4
  "outDir": "../../../../../tsDist/@atlaskit__analytics-next/app",
7
5
  "rootDir": "../",
8
6
  "composite": true,
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/analytics-next/cleanProps",
3
+ "main": "../dist/cjs/utils/cleanProps.js",
4
+ "module": "../dist/esm/utils/cleanProps.js",
5
+ "module:es2019": "../dist/es2019/utils/cleanProps.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/utils/cleanProps.d.ts",
8
+ "typesVersions": {
9
+ ">=4.5 <5.9": {
10
+ "*": [
11
+ "../dist/types-ts4.5/utils/cleanProps.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ Object.defineProperty(exports, "default", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _analyticsNextStableReactContext.default;
11
+ }
12
+ });
13
+ var _analyticsNextStableReactContext = _interopRequireDefault(require("@atlaskit/analytics-next-stable-react-context"));
@@ -61,7 +61,17 @@ var UIAnalyticsEvent = exports.default = /*#__PURE__*/function (_AnalyticsEvent)
61
61
  return;
62
62
  }
63
63
  _this.handlers.forEach(function (handler) {
64
- return handler(_this, channel);
64
+ try {
65
+ handler(_this, channel);
66
+ } catch (e) {
67
+ // Analytics must never crash product UI. Swallow handler errors in
68
+ // production; surface them in development so misconfigured events are
69
+ // caught early.
70
+ if (process.env.NODE_ENV !== 'production') {
71
+ // eslint-disable-next-line no-console
72
+ console.error('[analytics-next] UIAnalyticsEvent handler threw an error:', e);
73
+ }
74
+ }
65
75
  });
66
76
  _this.hasFired = true;
67
77
  });
package/dist/cjs/index.js CHANGED
@@ -44,7 +44,7 @@ Object.defineProperty(exports, "AnalyticsListener", {
44
44
  Object.defineProperty(exports, "AnalyticsReactContext", {
45
45
  enumerable: true,
46
46
  get: function get() {
47
- return _analyticsNextStableReactContext.default;
47
+ return _AnalyticsReactContext.default;
48
48
  }
49
49
  });
50
50
  Object.defineProperty(exports, "UIAnalyticsEvent", {
@@ -126,7 +126,7 @@ var _index2 = _interopRequireDefault(require("./components/AnalyticsContext/inde
126
126
  var _withAnalyticsContext = _interopRequireDefault(require("./hocs/withAnalyticsContext"));
127
127
  var _AnalyticsErrorBoundary = _interopRequireDefault(require("./components/AnalyticsErrorBoundary"));
128
128
  var _withAnalyticsEvents = _interopRequireDefault(require("./hocs/withAnalyticsEvents"));
129
- var _analyticsNextStableReactContext = _interopRequireDefault(require("@atlaskit/analytics-next-stable-react-context"));
129
+ var _AnalyticsReactContext = _interopRequireDefault(require("./components/AnalyticsReactContext"));
130
130
  var _useAnalyticsEvents = require("./hooks/useAnalyticsEvents");
131
131
  var _useCallbackWithAnalytics = require("./hooks/useCallbackWithAnalytics");
132
132
  var _usePlatformLeafEventHandler = require("./hooks/usePlatformLeafEventHandler");
@@ -6,4 +6,5 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _process$env;
8
8
  /// <reference types="node" />
9
- var _default = exports.default = typeof process !== 'undefined' && process !== null && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']);
9
+ var _default_1 = typeof process !== 'undefined' && process !== null && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']);
10
+ var _default = exports.default = _default_1;
@@ -0,0 +1 @@
1
+ export { default } from '@atlaskit/analytics-next-stable-react-context';
@@ -42,7 +42,19 @@ export default class UIAnalyticsEvent extends AnalyticsEvent {
42
42
  }
43
43
  return;
44
44
  }
45
- this.handlers.forEach(handler => handler(this, channel));
45
+ this.handlers.forEach(handler => {
46
+ try {
47
+ handler(this, channel);
48
+ } catch (e) {
49
+ // Analytics must never crash product UI. Swallow handler errors in
50
+ // production; surface them in development so misconfigured events are
51
+ // caught early.
52
+ if (process.env.NODE_ENV !== 'production') {
53
+ // eslint-disable-next-line no-console
54
+ console.error('[analytics-next] UIAnalyticsEvent handler threw an error:', e);
55
+ }
56
+ }
57
+ });
46
58
  this.hasFired = true;
47
59
  });
48
60
  this.context = props.context || [];
@@ -12,7 +12,7 @@ export { default as AnalyticsErrorBoundary } from './components/AnalyticsErrorBo
12
12
  // createAnalyticsEvent HOC
13
13
  export { default as withAnalyticsEvents } from './hocs/withAnalyticsEvents';
14
14
  // React context
15
- export { default as AnalyticsReactContext } from '@atlaskit/analytics-next-stable-react-context';
15
+ export { default as AnalyticsReactContext } from './components/AnalyticsReactContext';
16
16
  // Hook for creating and firing analytics events
17
17
  export { useAnalyticsEvents } from './hooks/useAnalyticsEvents';
18
18
  export { useCallbackWithAnalytics } from './hooks/useCallbackWithAnalytics';
@@ -1,3 +1,4 @@
1
1
  var _process$env;
2
2
  /// <reference types="node" />
3
- export default typeof process !== 'undefined' && process !== null && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']);
3
+ const _default_1 = typeof process !== 'undefined' && process !== null && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']);
4
+ export default _default_1;
@@ -0,0 +1 @@
1
+ export { default } from '@atlaskit/analytics-next-stable-react-context';
@@ -55,7 +55,17 @@ var UIAnalyticsEvent = /*#__PURE__*/function (_AnalyticsEvent) {
55
55
  return;
56
56
  }
57
57
  _this.handlers.forEach(function (handler) {
58
- return handler(_this, channel);
58
+ try {
59
+ handler(_this, channel);
60
+ } catch (e) {
61
+ // Analytics must never crash product UI. Swallow handler errors in
62
+ // production; surface them in development so misconfigured events are
63
+ // caught early.
64
+ if (process.env.NODE_ENV !== 'production') {
65
+ // eslint-disable-next-line no-console
66
+ console.error('[analytics-next] UIAnalyticsEvent handler threw an error:', e);
67
+ }
68
+ }
59
69
  });
60
70
  _this.hasFired = true;
61
71
  });
package/dist/esm/index.js CHANGED
@@ -12,7 +12,7 @@ export { default as AnalyticsErrorBoundary } from './components/AnalyticsErrorBo
12
12
  // createAnalyticsEvent HOC
13
13
  export { default as withAnalyticsEvents } from './hocs/withAnalyticsEvents';
14
14
  // React context
15
- export { default as AnalyticsReactContext } from '@atlaskit/analytics-next-stable-react-context';
15
+ export { default as AnalyticsReactContext } from './components/AnalyticsReactContext';
16
16
  // Hook for creating and firing analytics events
17
17
  export { useAnalyticsEvents } from './hooks/useAnalyticsEvents';
18
18
  export { useCallbackWithAnalytics } from './hooks/useCallbackWithAnalytics';
@@ -1,3 +1,4 @@
1
1
  var _process$env;
2
2
  /// <reference types="node" />
3
- export default typeof process !== 'undefined' && process !== null && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']);
3
+ var _default_1 = typeof process !== 'undefined' && process !== null && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']);
4
+ export default _default_1;
@@ -1,3 +1,3 @@
1
- import { type AnalyticsContextFunction } from './types';
1
+ import type { AnalyticsContextFunction } from './types';
2
2
  declare const AnalyticsContext: AnalyticsContextFunction;
3
3
  export default AnalyticsContext;
@@ -1,4 +1,4 @@
1
- import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
1
+ import type { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
2
2
  export type AnalyticsContextFunction = (props: {
3
3
  /** Children! */
4
4
  children: React.ReactNode;
@@ -24,8 +24,8 @@ declare class AnalyticsListener extends Component<Props> {
24
24
  contextValue: AnalyticsReactContextInterface;
25
25
  constructor(props: Props);
26
26
  getChildContext: () => {
27
- getAtlaskitAnalyticsEventHandlers: () => any[];
28
27
  getAtlaskitAnalyticsContext: () => any;
28
+ getAtlaskitAnalyticsEventHandlers: () => any[];
29
29
  };
30
30
  getAnalyticsEventHandlers: () => any[];
31
31
  getAtlaskitAnalyticsContext: () => any;
@@ -1,3 +1,3 @@
1
- import { type AnalyticsListenerFunction } from './types';
1
+ import type { AnalyticsListenerFunction } from './types';
2
2
  declare const AnalyticsListener: AnalyticsListenerFunction;
3
3
  export default AnalyticsListener;
@@ -1,4 +1,4 @@
1
- import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
1
+ import type { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
2
2
  import type UIAnalyticsEvent from '../../events/UIAnalyticsEvent';
3
3
  export type AnalyticsListenerFunction = (props: {
4
4
  /** The channel to listen for events on. */
@@ -0,0 +1,2 @@
1
+ export { default } from '@atlaskit/analytics-next-stable-react-context';
2
+ export type { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type CreateEventMap, type CreateUIAnalyticsEvent } from '../types';
2
+ import type { CreateEventMap, CreateUIAnalyticsEvent } from '../types';
3
3
  export interface WithAnalyticsEventsProps {
4
4
  /**
5
5
  * You should not be accessing this prop under any circumstances.
@@ -1,4 +1,4 @@
1
- import { type CreateUIAnalyticsEvent } from '../types';
1
+ import type { CreateUIAnalyticsEvent } from '../types';
2
2
  export type UseAnalyticsEventsHook = {
3
3
  createAnalyticsEvent: CreateUIAnalyticsEvent;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { type CreateEventMap } from '../types';
1
+ import type { CreateEventMap } from '../types';
2
2
  export type PatchedPropsHook = {
3
3
  patchedEventProps: CreateEventMap;
4
4
  };
@@ -11,8 +11,8 @@ export { default as AnalyticsErrorBoundary } from './components/AnalyticsErrorBo
11
11
  export type { AnalyticsErrorBoundaryProps } from './components/AnalyticsErrorBoundary';
12
12
  export { default as withAnalyticsEvents } from './hocs/withAnalyticsEvents';
13
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';
14
+ export { default as AnalyticsReactContext } from './components/AnalyticsReactContext';
15
+ export type { AnalyticsReactContextInterface } from './components/AnalyticsReactContext';
16
16
  export { useAnalyticsEvents } from './hooks/useAnalyticsEvents';
17
17
  export type { UseAnalyticsEventsHook } from './hooks/useAnalyticsEvents';
18
18
  export { useCallbackWithAnalytics } from './hooks/useCallbackWithAnalytics';
@@ -1,4 +1,4 @@
1
- import { type AnalyticsEventPayload } from './events/AnalyticsEvent';
1
+ import type { AnalyticsEventPayload } from './events/AnalyticsEvent';
2
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;
@@ -1,5 +1,5 @@
1
- import { type AnalyticsEventPayload } from '../events/AnalyticsEvent';
1
+ import type { AnalyticsEventPayload } from '../events/AnalyticsEvent';
2
2
  import type UIAnalyticsEvent from '../events/UIAnalyticsEvent';
3
- import { type CreateUIAnalyticsEvent } from '../types';
3
+ import type { CreateUIAnalyticsEvent } from '../types';
4
4
  declare const _default: (channel?: string) => (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent;
5
5
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: string | false | undefined;
2
- export default _default;
1
+ declare const _default_1: string | false | undefined;
2
+ export default _default_1;
@@ -1,3 +1,3 @@
1
- import { type AnalyticsContextFunction } from './types';
1
+ import type { AnalyticsContextFunction } from './types';
2
2
  declare const AnalyticsContext: AnalyticsContextFunction;
3
3
  export default AnalyticsContext;
@@ -1,4 +1,4 @@
1
- import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
1
+ import type { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
2
2
  export type AnalyticsContextFunction = (props: {
3
3
  /** Children! */
4
4
  children: React.ReactNode;
@@ -24,8 +24,8 @@ declare class AnalyticsListener extends Component<Props> {
24
24
  contextValue: AnalyticsReactContextInterface;
25
25
  constructor(props: Props);
26
26
  getChildContext: () => {
27
- getAtlaskitAnalyticsEventHandlers: () => any[];
28
27
  getAtlaskitAnalyticsContext: () => any;
28
+ getAtlaskitAnalyticsEventHandlers: () => any[];
29
29
  };
30
30
  getAnalyticsEventHandlers: () => any[];
31
31
  getAtlaskitAnalyticsContext: () => any;
@@ -1,3 +1,3 @@
1
- import { type AnalyticsListenerFunction } from './types';
1
+ import type { AnalyticsListenerFunction } from './types';
2
2
  declare const AnalyticsListener: AnalyticsListenerFunction;
3
3
  export default AnalyticsListener;
@@ -1,4 +1,4 @@
1
- import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
1
+ import type { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
2
2
  import type UIAnalyticsEvent from '../../events/UIAnalyticsEvent';
3
3
  export type AnalyticsListenerFunction = (props: {
4
4
  /** The channel to listen for events on. */
@@ -0,0 +1,2 @@
1
+ export { default } from '@atlaskit/analytics-next-stable-react-context';
2
+ export type { AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type CreateEventMap, type CreateUIAnalyticsEvent } from '../types';
2
+ import type { CreateEventMap, CreateUIAnalyticsEvent } from '../types';
3
3
  export interface WithAnalyticsEventsProps {
4
4
  /**
5
5
  * You should not be accessing this prop under any circumstances.
@@ -1,4 +1,4 @@
1
- import { type CreateUIAnalyticsEvent } from '../types';
1
+ import type { CreateUIAnalyticsEvent } from '../types';
2
2
  export type UseAnalyticsEventsHook = {
3
3
  createAnalyticsEvent: CreateUIAnalyticsEvent;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { type CreateEventMap } from '../types';
1
+ import type { CreateEventMap } from '../types';
2
2
  export type PatchedPropsHook = {
3
3
  patchedEventProps: CreateEventMap;
4
4
  };
@@ -11,8 +11,8 @@ export { default as AnalyticsErrorBoundary } from './components/AnalyticsErrorBo
11
11
  export type { AnalyticsErrorBoundaryProps } from './components/AnalyticsErrorBoundary';
12
12
  export { default as withAnalyticsEvents } from './hocs/withAnalyticsEvents';
13
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';
14
+ export { default as AnalyticsReactContext } from './components/AnalyticsReactContext';
15
+ export type { AnalyticsReactContextInterface } from './components/AnalyticsReactContext';
16
16
  export { useAnalyticsEvents } from './hooks/useAnalyticsEvents';
17
17
  export type { UseAnalyticsEventsHook } from './hooks/useAnalyticsEvents';
18
18
  export { useCallbackWithAnalytics } from './hooks/useCallbackWithAnalytics';
@@ -1,4 +1,4 @@
1
- import { type AnalyticsEventPayload } from './events/AnalyticsEvent';
1
+ import type { AnalyticsEventPayload } from './events/AnalyticsEvent';
2
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;
@@ -1,5 +1,5 @@
1
- import { type AnalyticsEventPayload } from '../events/AnalyticsEvent';
1
+ import type { AnalyticsEventPayload } from '../events/AnalyticsEvent';
2
2
  import type UIAnalyticsEvent from '../events/UIAnalyticsEvent';
3
- import { type CreateUIAnalyticsEvent } from '../types';
3
+ import type { CreateUIAnalyticsEvent } from '../types';
4
4
  declare const _default: (channel?: string) => (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent;
5
5
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: string | false | undefined;
2
- export default _default;
1
+ declare const _default_1: string | false | undefined;
2
+ export default _default_1;
package/docs/0-intro.tsx CHANGED
@@ -1,42 +1,73 @@
1
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/design-system/use-primitives-text, @atlaskit/design-system/use-heading, @atlaskit/design-system/no-html-anchor -- Legacy analytics-next docs intentionally use plain HTML prose, links, and inline styles after the docs helper cleanup. */
1
2
  import React from 'react';
2
3
 
3
- import { md } from '@atlaskit/docs';
4
- import Link from '@atlaskit/link';
5
- import SectionMessage from '@atlaskit/section-message';
4
+ const warningStyles: React.CSSProperties = {
5
+ backgroundColor: '#fffae6',
6
+ border: '1px solid #f5cd47',
7
+ borderRadius: 3,
8
+ marginBottom: 16,
9
+ padding: 16,
10
+ };
6
11
 
7
- const _default_1: any = md`
12
+ export default function Intro(): React.JSX.Element {
13
+ return (
14
+ <div>
15
+ <div style={warningStyles}>
16
+ <strong>Maintaince Mode: @atlaskit/analytics is in maintenance mode.</strong>
17
+ <p>
18
+ This package is officially in maintenance mode, which means only bugfixes or VULN fixes
19
+ are currently being accepted and no known breaking changes will be approved in the PR
20
+ process.
21
+ </p>
22
+ <p>
23
+ Please refer to this{' '}
24
+ <a
25
+ href="https://hello.atlassian.net/wiki/spaces/APD/pages/2470435075/DACI+analytics-next+in+a+maintenance+mode"
26
+ target="_blank"
27
+ rel="noreferrer"
28
+ >
29
+ DACI
30
+ </a>{' '}
31
+ for more details.
32
+ </p>
33
+ </div>
8
34
 
9
- ${(
10
- <SectionMessage
11
- appearance="warning"
12
- title="Maintaince Mode: @atlaskit/analytics is in maintenance mode."
13
- >
14
- This package is officially in maintenance mode, which means only bugfixes or VULN fixes are
15
- currently being accepted and no known breaking changes will be approved in the PR process.{' '}
16
- <br />
17
- Please refer to this
18
- <Link
19
- href="https://hello.atlassian.net/wiki/spaces/APD/pages/2470435075/DACI+analytics-next+in+a+maintenance+mode"
20
- target="_blank"
21
- >
22
- {' '}
23
- DACI{' '}
24
- </Link>{' '}
25
- for more details.
26
- </SectionMessage>
27
- )}
35
+ <p>
36
+ This package aims to help assist consumers track the way their React components are being
37
+ used.
38
+ </p>
28
39
 
29
- This package aims to help assist consumers track the way their React components are being used.
30
-
31
- ### Contents
32
-
33
- - [Concepts](./analytics-next/docs/concepts) (Read first!)
34
- - [Usage with presentational components](./analytics-next/docs/usage-with-presentational-components)
35
- - [Usage with container components](./analytics-next/docs/usage-for-container-components)
36
- - [Listeners](./analytics-next/docs/listeners)
37
- - [Error Boundary](./analytics-next/docs/error-boundary)
38
- - [Events](./analytics-next/docs/events)
39
- - [Advanced usage](./analytics-next/docs/advanced-usage)
40
- - [Ugprade guide](./analytics-next/docs/upgrade-guide)
41
- `;
42
- export default _default_1;
40
+ <h3>Contents</h3>
41
+ <ul>
42
+ <li>
43
+ <a href="./analytics-next/docs/concepts">Concepts</a> (Read first!)
44
+ </li>
45
+ <li>
46
+ <a href="./analytics-next/docs/usage-with-presentational-components">
47
+ Usage with presentational components
48
+ </a>
49
+ </li>
50
+ <li>
51
+ <a href="./analytics-next/docs/usage-for-container-components">
52
+ Usage with container components
53
+ </a>
54
+ </li>
55
+ <li>
56
+ <a href="./analytics-next/docs/listeners">Listeners</a>
57
+ </li>
58
+ <li>
59
+ <a href="./analytics-next/docs/error-boundary">Error Boundary</a>
60
+ </li>
61
+ <li>
62
+ <a href="./analytics-next/docs/events">Events</a>
63
+ </li>
64
+ <li>
65
+ <a href="./analytics-next/docs/advanced-usage">Advanced usage</a>
66
+ </li>
67
+ <li>
68
+ <a href="./analytics-next/docs/upgrade-guide">Ugprade guide</a>
69
+ </li>
70
+ </ul>
71
+ </div>
72
+ );
73
+ }