@atlaskit/analytics-next 11.1.3 → 11.1.4

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 (51) hide show
  1. package/CHANGELOG.md +7 -20
  2. package/afm-cc/tsconfig.json +3 -2
  3. package/afm-jira/tsconfig.json +4 -3
  4. package/{afm-adminhub → afm-products}/tsconfig.json +5 -4
  5. package/dist/cjs/components/AnalyticsContext/LegacyAnalyticsContext.js +71 -0
  6. package/dist/cjs/components/AnalyticsContext/index.js +9 -1
  7. package/dist/cjs/components/AnalyticsErrorBoundary.js +16 -2
  8. package/dist/cjs/components/AnalyticsListener/LegacyAnalyticsListener.js +79 -0
  9. package/dist/cjs/components/AnalyticsListener/index.js +9 -1
  10. package/dist/cjs/utils/isModernContextEnabledEnv.js +9 -0
  11. package/dist/es2019/components/AnalyticsContext/LegacyAnalyticsContext.js +49 -0
  12. package/dist/es2019/components/AnalyticsContext/index.js +9 -1
  13. package/dist/es2019/components/AnalyticsErrorBoundary.js +16 -2
  14. package/dist/es2019/components/AnalyticsListener/LegacyAnalyticsListener.js +56 -0
  15. package/dist/es2019/components/AnalyticsListener/index.js +9 -1
  16. package/dist/es2019/utils/isModernContextEnabledEnv.js +3 -0
  17. package/dist/esm/components/AnalyticsContext/LegacyAnalyticsContext.js +62 -0
  18. package/dist/esm/components/AnalyticsContext/index.js +9 -1
  19. package/dist/esm/components/AnalyticsErrorBoundary.js +16 -2
  20. package/dist/esm/components/AnalyticsListener/LegacyAnalyticsListener.js +70 -0
  21. package/dist/esm/components/AnalyticsListener/index.js +9 -1
  22. package/dist/esm/utils/isModernContextEnabledEnv.js +3 -0
  23. package/dist/types/components/AnalyticsContext/LegacyAnalyticsContext.d.ts +30 -0
  24. package/dist/types/components/AnalyticsContext/index.d.ts +3 -2
  25. package/dist/types/components/AnalyticsListener/LegacyAnalyticsListener.d.ts +34 -0
  26. package/dist/types/components/AnalyticsListener/index.d.ts +3 -2
  27. package/dist/types/utils/createAndFireEvent.d.ts +2 -1
  28. package/dist/types/utils/isModernContextEnabledEnv.d.ts +2 -0
  29. package/dist/types-ts4.5/components/AnalyticsContext/LegacyAnalyticsContext.d.ts +30 -0
  30. package/dist/types-ts4.5/components/AnalyticsContext/index.d.ts +3 -2
  31. package/dist/types-ts4.5/components/AnalyticsListener/LegacyAnalyticsListener.d.ts +34 -0
  32. package/dist/types-ts4.5/components/AnalyticsListener/index.d.ts +3 -2
  33. package/dist/types-ts4.5/utils/createAndFireEvent.d.ts +2 -1
  34. package/dist/types-ts4.5/utils/isModernContextEnabledEnv.d.ts +2 -0
  35. package/docs/0-intro.tsx +2 -1
  36. package/docs/10-concepts.tsx +2 -1
  37. package/docs/20-usage-with-presentational-components.tsx +2 -1
  38. package/docs/30-usage-for-container-components.tsx +2 -1
  39. package/docs/40-listeners.tsx +2 -1
  40. package/docs/50-error-boundary.tsx +2 -1
  41. package/docs/60-events.tsx +2 -1
  42. package/docs/70-advanced-usage.tsx +2 -1
  43. package/docs/80-upgrade-guide.tsx +2 -1
  44. package/package.json +9 -5
  45. package/afm-dev-agents/tsconfig.json +0 -32
  46. package/afm-passionfruit/tsconfig.json +0 -32
  47. package/afm-post-office/tsconfig.json +0 -32
  48. package/afm-rovo-extension/tsconfig.json +0 -32
  49. package/afm-townsquare/tsconfig.json +0 -32
  50. package/afm-volt/tsconfig.json +0 -32
  51. package/build/tsconfig.json +0 -25
@@ -0,0 +1,62 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/createClass";
4
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+ import _inherits from "@babel/runtime/helpers/inherits";
7
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
9
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
+ import React, { Component } from 'react';
11
+ import PropTypes from 'prop-types';
12
+ import { default as AnalyticsReactContext } from '@atlaskit/analytics-next-stable-react-context';
13
+ var ContextTypes = {
14
+ getAtlaskitAnalyticsContext: PropTypes.func,
15
+ getAtlaskitAnalyticsEventHandlers: PropTypes.func
16
+ };
17
+ var noop = function noop() {
18
+ return [];
19
+ };
20
+
21
+ // eslint-disable-next-line @repo/internal/react/no-class-components
22
+ var AnalyticsContext = /*#__PURE__*/function (_Component) {
23
+ function AnalyticsContext(props) {
24
+ var _this;
25
+ _classCallCheck(this, AnalyticsContext);
26
+ _this = _callSuper(this, AnalyticsContext, [props]);
27
+ _defineProperty(_this, "getChildContext", function () {
28
+ return {
29
+ getAtlaskitAnalyticsContext: _this.getAnalyticsContext
30
+ };
31
+ });
32
+ _defineProperty(_this, "getAnalyticsContext", function () {
33
+ var data = _this.props.data;
34
+ var _this$context$getAtla = _this.context.getAtlaskitAnalyticsContext,
35
+ getAtlaskitAnalyticsContext = _this$context$getAtla === void 0 ? noop : _this$context$getAtla;
36
+ return [].concat(_toConsumableArray(getAtlaskitAnalyticsContext()), [data]);
37
+ });
38
+ _defineProperty(_this, "getAnalyticsEventHandlers", function () {
39
+ var _this$context$getAtla2 = _this.context.getAtlaskitAnalyticsEventHandlers,
40
+ getAtlaskitAnalyticsEventHandlers = _this$context$getAtla2 === void 0 ? noop : _this$context$getAtla2;
41
+ return getAtlaskitAnalyticsEventHandlers();
42
+ });
43
+ _this.contextValue = {
44
+ getAtlaskitAnalyticsContext: _this.getAnalyticsContext,
45
+ getAtlaskitAnalyticsEventHandlers: _this.getAnalyticsEventHandlers
46
+ };
47
+ return _this;
48
+ }
49
+ _inherits(AnalyticsContext, _Component);
50
+ return _createClass(AnalyticsContext, [{
51
+ key: "render",
52
+ value: function render() {
53
+ var children = this.props.children;
54
+ return /*#__PURE__*/React.createElement(AnalyticsReactContext.Provider, {
55
+ value: this.contextValue
56
+ }, children);
57
+ }
58
+ }]);
59
+ }(Component);
60
+ _defineProperty(AnalyticsContext, "contextTypes", ContextTypes);
61
+ _defineProperty(AnalyticsContext, "childContextTypes", ContextTypes);
62
+ export default AnalyticsContext;
@@ -1,2 +1,10 @@
1
+ import React from 'react';
2
+ import { fg } from '@atlaskit/platform-feature-flags';
3
+ import isModernContextEnabledEnv from '../../utils/isModernContextEnabledEnv';
4
+ import LegacyAnalyticsContext from './LegacyAnalyticsContext';
1
5
  import ModernAnalyticsContext from './ModernAnalyticsContext';
2
- export default ModernAnalyticsContext;
6
+ var AnalyticsContext = function AnalyticsContext(props) {
7
+ var isModernContext = isModernContextEnabledEnv || fg('analytics-next-use-legacy-context') === false;
8
+ return isModernContext ? /*#__PURE__*/React.createElement(ModernAnalyticsContext, props) : /*#__PURE__*/React.createElement(LegacyAnalyticsContext, props);
9
+ };
10
+ export default AnalyticsContext;
@@ -6,6 +6,9 @@ import _inherits from "@babel/runtime/helpers/inherits";
6
6
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
7
7
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
8
8
  import React, { Component } from 'react';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
10
+ import isModernContextEnabledEnv from '../utils/isModernContextEnabledEnv';
11
+ import LegacyAnalyticsContext from './AnalyticsContext/LegacyAnalyticsContext';
9
12
  import ModernAnalyticsContext from './AnalyticsContext/ModernAnalyticsContext';
10
13
  /**
11
14
  * @private https://product-fabric.atlassian.net/browse/AFO-815
@@ -40,15 +43,26 @@ var AnalyticsErrorBoundary = /*#__PURE__*/function (_Component) {
40
43
  children = _this$props.children,
41
44
  ErrorComponent = _this$props.ErrorComponent;
42
45
  var hasError = this.state.hasError;
46
+ var isModernContext = isModernContextEnabledEnv || fg('analytics-next-use-legacy-context') === false;
43
47
  if (hasError) {
44
48
  if (ErrorComponent) {
45
- return /*#__PURE__*/React.createElement(ModernAnalyticsContext, {
49
+ if (isModernContext) {
50
+ return /*#__PURE__*/React.createElement(ModernAnalyticsContext, {
51
+ data: data
52
+ }, /*#__PURE__*/React.createElement(ErrorComponent, null));
53
+ }
54
+ return /*#__PURE__*/React.createElement(LegacyAnalyticsContext, {
46
55
  data: data
47
56
  }, /*#__PURE__*/React.createElement(ErrorComponent, null));
48
57
  }
49
58
  return null;
50
59
  }
51
- return /*#__PURE__*/React.createElement(ModernAnalyticsContext, {
60
+ if (isModernContext) {
61
+ return /*#__PURE__*/React.createElement(ModernAnalyticsContext, {
62
+ data: data
63
+ }, children);
64
+ }
65
+ return /*#__PURE__*/React.createElement(LegacyAnalyticsContext, {
52
66
  data: data
53
67
  }, children);
54
68
  }
@@ -0,0 +1,70 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/createClass";
4
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+ import _inherits from "@babel/runtime/helpers/inherits";
7
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
9
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
+ import React, { Component } from 'react';
11
+ import PropTypes from 'prop-types';
12
+ import { default as AnalyticsReactContext } from '@atlaskit/analytics-next-stable-react-context';
13
+ var ContextTypes = {
14
+ getAtlaskitAnalyticsEventHandlers: PropTypes.func,
15
+ getAtlaskitAnalyticsContext: PropTypes.func
16
+ };
17
+ var noop = function noop() {
18
+ return [];
19
+ };
20
+
21
+ // eslint-disable-next-line @repo/internal/react/no-class-components
22
+ var AnalyticsListener = /*#__PURE__*/function (_Component) {
23
+ function AnalyticsListener(props) {
24
+ var _this;
25
+ _classCallCheck(this, AnalyticsListener);
26
+ _this = _callSuper(this, AnalyticsListener, [props]);
27
+ _defineProperty(_this, "getChildContext", function () {
28
+ return {
29
+ getAtlaskitAnalyticsEventHandlers: _this.getAnalyticsEventHandlers,
30
+ getAtlaskitAnalyticsContext: _this.getAtlaskitAnalyticsContext
31
+ };
32
+ });
33
+ _defineProperty(_this, "getAnalyticsEventHandlers", function () {
34
+ var _this$props = _this.props,
35
+ channel = _this$props.channel,
36
+ onEvent = _this$props.onEvent;
37
+ var _this$context$getAtla = _this.context.getAtlaskitAnalyticsEventHandlers,
38
+ getAtlaskitAnalyticsEventHandlers = _this$context$getAtla === void 0 ? noop : _this$context$getAtla;
39
+ var handler = function handler(event, eventChannel) {
40
+ if (channel === '*' || channel === eventChannel) {
41
+ onEvent(event, eventChannel);
42
+ }
43
+ };
44
+ return [handler].concat(_toConsumableArray(getAtlaskitAnalyticsEventHandlers()));
45
+ });
46
+ _defineProperty(_this, "getAtlaskitAnalyticsContext", function () {
47
+ var _this$context$getAtla2 = _this.context.getAtlaskitAnalyticsContext,
48
+ getAtlaskitAnalyticsContext = _this$context$getAtla2 === void 0 ? noop : _this$context$getAtla2;
49
+ return getAtlaskitAnalyticsContext();
50
+ });
51
+ _this.contextValue = {
52
+ getAtlaskitAnalyticsContext: _this.getAtlaskitAnalyticsContext,
53
+ getAtlaskitAnalyticsEventHandlers: _this.getAnalyticsEventHandlers
54
+ };
55
+ return _this;
56
+ }
57
+ _inherits(AnalyticsListener, _Component);
58
+ return _createClass(AnalyticsListener, [{
59
+ key: "render",
60
+ value: function render() {
61
+ var children = this.props.children;
62
+ return /*#__PURE__*/React.createElement(AnalyticsReactContext.Provider, {
63
+ value: this.contextValue
64
+ }, children);
65
+ }
66
+ }]);
67
+ }(Component);
68
+ _defineProperty(AnalyticsListener, "contextTypes", ContextTypes);
69
+ _defineProperty(AnalyticsListener, "childContextTypes", ContextTypes);
70
+ export default AnalyticsListener;
@@ -1,2 +1,10 @@
1
+ import React from 'react';
2
+ import { fg } from '@atlaskit/platform-feature-flags';
3
+ import isModernContextEnabledEnv from '../../utils/isModernContextEnabledEnv';
4
+ import LegacyAnalyticsListener from './LegacyAnalyticsListener';
1
5
  import ModernAnalyticsListener from './ModernAnalyticsListener';
2
- export default ModernAnalyticsListener;
6
+ var AnalyticsListener = function AnalyticsListener(props) {
7
+ var isModernContext = isModernContextEnabledEnv || fg('analytics-next-use-legacy-context') === false;
8
+ return isModernContext ? /*#__PURE__*/React.createElement(ModernAnalyticsListener, props) : /*#__PURE__*/React.createElement(LegacyAnalyticsListener, props);
9
+ };
10
+ export default AnalyticsListener;
@@ -0,0 +1,3 @@
1
+ var _process$env;
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']);
@@ -0,0 +1,30 @@
1
+ import React, { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { type 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
+ context: any;
13
+ static contextTypes: {
14
+ getAtlaskitAnalyticsContext: PropTypes.Requireable<(...args: any[]) => any>;
15
+ getAtlaskitAnalyticsEventHandlers: PropTypes.Requireable<(...args: any[]) => any>;
16
+ };
17
+ static childContextTypes: {
18
+ getAtlaskitAnalyticsContext: PropTypes.Requireable<(...args: any[]) => any>;
19
+ getAtlaskitAnalyticsEventHandlers: PropTypes.Requireable<(...args: any[]) => any>;
20
+ };
21
+ contextValue: AnalyticsReactContextInterface;
22
+ constructor(props: Props);
23
+ getChildContext: () => {
24
+ getAtlaskitAnalyticsContext: () => any[];
25
+ };
26
+ getAnalyticsContext: () => any[];
27
+ getAnalyticsEventHandlers: () => any;
28
+ render(): React.JSX.Element;
29
+ }
30
+ export default AnalyticsContext;
@@ -1,2 +1,3 @@
1
- import ModernAnalyticsContext from './ModernAnalyticsContext';
2
- export default ModernAnalyticsContext;
1
+ import { type AnalyticsContextFunction } from './types';
2
+ declare const AnalyticsContext: AnalyticsContextFunction;
3
+ export default AnalyticsContext;
@@ -0,0 +1,34 @@
1
+ import React, { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
4
+ import type { default as UIAnalyticsEvent } from '../../events/UIAnalyticsEvent';
5
+ type Props = {
6
+ /** The channel to listen for events on. */
7
+ channel?: string;
8
+ /** Children! */
9
+ children?: React.ReactNode;
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
+ context: any;
16
+ static contextTypes: {
17
+ getAtlaskitAnalyticsEventHandlers: PropTypes.Requireable<(...args: any[]) => any>;
18
+ getAtlaskitAnalyticsContext: PropTypes.Requireable<(...args: any[]) => any>;
19
+ };
20
+ static childContextTypes: {
21
+ getAtlaskitAnalyticsEventHandlers: PropTypes.Requireable<(...args: any[]) => any>;
22
+ getAtlaskitAnalyticsContext: PropTypes.Requireable<(...args: any[]) => any>;
23
+ };
24
+ contextValue: AnalyticsReactContextInterface;
25
+ constructor(props: Props);
26
+ getChildContext: () => {
27
+ getAtlaskitAnalyticsEventHandlers: () => any[];
28
+ getAtlaskitAnalyticsContext: () => any;
29
+ };
30
+ getAnalyticsEventHandlers: () => any[];
31
+ getAtlaskitAnalyticsContext: () => any;
32
+ render(): React.JSX.Element;
33
+ }
34
+ export default AnalyticsListener;
@@ -1,2 +1,3 @@
1
- import ModernAnalyticsListener from './ModernAnalyticsListener';
2
- export default ModernAnalyticsListener;
1
+ import { type AnalyticsListenerFunction } from './types';
2
+ declare const AnalyticsListener: AnalyticsListenerFunction;
3
+ export default AnalyticsListener;
@@ -1,4 +1,5 @@
1
1
  import { type AnalyticsEventPayload } from '../events/AnalyticsEvent';
2
+ import type UIAnalyticsEvent from '../events/UIAnalyticsEvent';
2
3
  import { type CreateUIAnalyticsEvent } from '../types';
3
- declare const _default: (channel?: string) => (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => import("..").UIAnalyticsEvent;
4
+ declare const _default: (channel?: string) => (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent;
4
5
  export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: string | false | undefined;
2
+ export default _default;
@@ -0,0 +1,30 @@
1
+ import React, { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { type 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
+ context: any;
13
+ static contextTypes: {
14
+ getAtlaskitAnalyticsContext: PropTypes.Requireable<(...args: any[]) => any>;
15
+ getAtlaskitAnalyticsEventHandlers: PropTypes.Requireable<(...args: any[]) => any>;
16
+ };
17
+ static childContextTypes: {
18
+ getAtlaskitAnalyticsContext: PropTypes.Requireable<(...args: any[]) => any>;
19
+ getAtlaskitAnalyticsEventHandlers: PropTypes.Requireable<(...args: any[]) => any>;
20
+ };
21
+ contextValue: AnalyticsReactContextInterface;
22
+ constructor(props: Props);
23
+ getChildContext: () => {
24
+ getAtlaskitAnalyticsContext: () => any[];
25
+ };
26
+ getAnalyticsContext: () => any[];
27
+ getAnalyticsEventHandlers: () => any;
28
+ render(): React.JSX.Element;
29
+ }
30
+ export default AnalyticsContext;
@@ -1,2 +1,3 @@
1
- import ModernAnalyticsContext from './ModernAnalyticsContext';
2
- export default ModernAnalyticsContext;
1
+ import { type AnalyticsContextFunction } from './types';
2
+ declare const AnalyticsContext: AnalyticsContextFunction;
3
+ export default AnalyticsContext;
@@ -0,0 +1,34 @@
1
+ import React, { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { type AnalyticsReactContextInterface } from '@atlaskit/analytics-next-stable-react-context';
4
+ import type { default as UIAnalyticsEvent } from '../../events/UIAnalyticsEvent';
5
+ type Props = {
6
+ /** The channel to listen for events on. */
7
+ channel?: string;
8
+ /** Children! */
9
+ children?: React.ReactNode;
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
+ context: any;
16
+ static contextTypes: {
17
+ getAtlaskitAnalyticsEventHandlers: PropTypes.Requireable<(...args: any[]) => any>;
18
+ getAtlaskitAnalyticsContext: PropTypes.Requireable<(...args: any[]) => any>;
19
+ };
20
+ static childContextTypes: {
21
+ getAtlaskitAnalyticsEventHandlers: PropTypes.Requireable<(...args: any[]) => any>;
22
+ getAtlaskitAnalyticsContext: PropTypes.Requireable<(...args: any[]) => any>;
23
+ };
24
+ contextValue: AnalyticsReactContextInterface;
25
+ constructor(props: Props);
26
+ getChildContext: () => {
27
+ getAtlaskitAnalyticsEventHandlers: () => any[];
28
+ getAtlaskitAnalyticsContext: () => any;
29
+ };
30
+ getAnalyticsEventHandlers: () => any[];
31
+ getAtlaskitAnalyticsContext: () => any;
32
+ render(): React.JSX.Element;
33
+ }
34
+ export default AnalyticsListener;
@@ -1,2 +1,3 @@
1
- import ModernAnalyticsListener from './ModernAnalyticsListener';
2
- export default ModernAnalyticsListener;
1
+ import { type AnalyticsListenerFunction } from './types';
2
+ declare const AnalyticsListener: AnalyticsListenerFunction;
3
+ export default AnalyticsListener;
@@ -1,4 +1,5 @@
1
1
  import { type AnalyticsEventPayload } from '../events/AnalyticsEvent';
2
+ import type UIAnalyticsEvent from '../events/UIAnalyticsEvent';
2
3
  import { type CreateUIAnalyticsEvent } from '../types';
3
- declare const _default: (channel?: string) => (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => import("..").UIAnalyticsEvent;
4
+ declare const _default: (channel?: string) => (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent;
4
5
  export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: string | false | undefined;
2
+ export default _default;
package/docs/0-intro.tsx CHANGED
@@ -4,7 +4,7 @@ import { md } from '@atlaskit/docs';
4
4
  import Link from '@atlaskit/link';
5
5
  import SectionMessage from '@atlaskit/section-message';
6
6
 
7
- export default md`
7
+ const _default_1: any = md`
8
8
 
9
9
  ${(
10
10
  <SectionMessage
@@ -39,3 +39,4 @@ This package aims to help assist consumers track the way their React components
39
39
  - [Advanced usage](./analytics-next/docs/advanced-usage)
40
40
  - [Ugprade guide](./analytics-next/docs/upgrade-guide)
41
41
  `;
42
+ export default _default_1;
@@ -1,6 +1,6 @@
1
1
  import { code, md } from '@atlaskit/docs';
2
2
 
3
- export default md`
3
+ const _default_1: any = md`
4
4
  There are 3 abstract layers as part of \`@atlaskit/analytics-next\`:
5
5
 
6
6
  - [Analytics Listeners](./listeners) (responsible for sending events over the network)
@@ -119,3 +119,4 @@ ${code`
119
119
  [legacy-context]: https://reactjs.org/docs/legacy-context.html
120
120
  [modern-context]: https://reactjs.org/docs/context.html
121
121
  `;
122
+ export default _default_1;
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { code, md } from '@atlaskit/docs';
4
4
  import Link from '@atlaskit/link';
5
5
 
6
- export default md`
6
+ const _default_1: any = md`
7
7
  This section will guide how to add analytics tracking to presentational and other
8
8
  components that don't fit into the "Container" category.
9
9
 
@@ -358,3 +358,4 @@ export MyButton;
358
358
  `}
359
359
 
360
360
  `;
361
+ export default _default_1;
@@ -1,6 +1,6 @@
1
1
  import { code, md } from '@atlaskit/docs';
2
2
 
3
- export default md`
3
+ const _default_1: any = md`
4
4
  This guide describes how to set up analytics for a React component that is a
5
5
  container for children that fire analytics events, and where you wish to include
6
6
  contextual information to those children about where it is embeded in the event fired.
@@ -61,3 +61,4 @@ While it is possible to use the React context from \`@atlaskit/analytics-next-st
61
61
  we encourage you to use one of these two approaches instead, as they are optimised to ensure the value provided
62
62
  to React Context is a stable reference, and won't introduce unnecessary re-renders.
63
63
  `;
64
+ export default _default_1;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
 
3
3
  import { code, md, Props } from '@atlaskit/docs';
4
4
 
5
- export default md`
5
+ const _default_1: any = md`
6
6
  ${code`import { AnalyticsListener } from '@atlaskit/analytics-next';`}
7
7
 
8
8
  An \`AnalyticsListener\` wraps your app and listens to any events which are fired within it.
@@ -14,3 +14,4 @@ export default md`
14
14
  />
15
15
  )}
16
16
  `;
17
+ export default _default_1;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
 
3
3
  import { code, md, Props } from '@atlaskit/docs';
4
4
 
5
- export default md`
5
+ const _default_1: any = md`
6
6
  ${code`import { AnalyticsErrorBoundary } from '@atlaskit/analytics-next';`}
7
7
 
8
8
  Wrap part of your tree in \`AnalyticsErrorBoundary\` to provide error boundary track to any events created beneath it.
@@ -52,3 +52,4 @@ class ButtonWithAnalyticsErrorBoundary extends React.Component {
52
52
  />
53
53
  )}
54
54
  `;
55
+ export default _default_1;
@@ -1,6 +1,6 @@
1
1
  import { code, md } from '@atlaskit/docs';
2
2
 
3
- export default md`
3
+ const _default_1: any = md`
4
4
  <a name="UIAnalyticsEvent"></a>
5
5
  ### UIAnalyticsEvent
6
6
 
@@ -52,3 +52,4 @@ update(
52
52
 
53
53
  Please see [UIAnalyticsEvent](#UIAnalyticsEvent) for more information.
54
54
  `;
55
+ export default _default_1;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
 
3
3
  import { code, Example, md } from '@atlaskit/docs';
4
4
 
5
- export default md`
5
+ const _default_1: any = md`
6
6
  ### Contents
7
7
 
8
8
  * [Adding more information to an event](#adding-more-information-to-an-event)
@@ -268,3 +268,4 @@ const fetchBacon = async () => {
268
268
  };
269
269
  `}
270
270
  `;
271
+ export default _default_1;
@@ -1,6 +1,6 @@
1
1
  import { code, md } from '@atlaskit/docs';
2
2
 
3
- export default md`
3
+ const _default_1: any = md`
4
4
  ## v5 to v6
5
5
 
6
6
  ### ✨ TypeScript support
@@ -119,3 +119,4 @@ export default withAnalyticsContext({})(
119
119
 
120
120
 
121
121
  `;
122
+ export default _default_1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/analytics-next",
3
- "version": "11.1.3",
3
+ "version": "11.1.4",
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/"
@@ -41,9 +41,9 @@
41
41
  "react-dom": "^18.2.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@atlassian/feature-flags-test-utils": "^0.3.0",
45
- "@atlassian/ssr-tests": "^0.3.0",
46
- "@testing-library/react": "^13.4.0",
44
+ "@atlassian/feature-flags-test-utils": "^1.0.0",
45
+ "@atlassian/ssr-tests": "workspace:^",
46
+ "@testing-library/react": "^16.3.0",
47
47
  "storybook-addon-performance": "^0.17.3"
48
48
  },
49
49
  "overrides": {
@@ -73,5 +73,9 @@
73
73
  ]
74
74
  }
75
75
  },
76
- "platform-feature-flags": {}
76
+ "platform-feature-flags": {
77
+ "analytics-next-use-legacy-context": {
78
+ "type": "boolean"
79
+ }
80
+ }
77
81
  }
@@ -1,32 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.entry-points.dev-agents.json",
3
- "compilerOptions": {
4
- "declaration": true,
5
- "target": "es5",
6
- "outDir": "../../../../../dev-agents/tsDist/@atlaskit__analytics-next/app",
7
- "rootDir": "../",
8
- "composite": true
9
- },
10
- "include": [
11
- "../src/**/*.ts",
12
- "../src/**/*.tsx"
13
- ],
14
- "exclude": [
15
- "../src/**/__tests__/*",
16
- "../src/**/*.test.*",
17
- "../src/**/test.*",
18
- "../src/performance/examples.tsx",
19
- "../docs/*",
20
- "../src/**/examples.*",
21
- "../src/**/examples/*",
22
- "../src/**/examples/**/*",
23
- "../src/**/*.stories.*",
24
- "../src/**/stories/*",
25
- "../src/**/stories/**/*"
26
- ],
27
- "references": [
28
- {
29
- "path": "../../../platform/feature-flags/afm-dev-agents/tsconfig.json"
30
- }
31
- ]
32
- }
@@ -1,32 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.entry-points.passionfruit.json",
3
- "compilerOptions": {
4
- "declaration": true,
5
- "target": "es5",
6
- "outDir": "../../../../../passionfruit/tsDist/@atlaskit__analytics-next/app",
7
- "rootDir": "../",
8
- "composite": true
9
- },
10
- "include": [
11
- "../src/**/*.ts",
12
- "../src/**/*.tsx"
13
- ],
14
- "exclude": [
15
- "../src/**/__tests__/*",
16
- "../src/**/*.test.*",
17
- "../src/**/test.*",
18
- "../src/performance/examples.tsx",
19
- "../docs/*",
20
- "../src/**/examples.*",
21
- "../src/**/examples/*",
22
- "../src/**/examples/**/*",
23
- "../src/**/*.stories.*",
24
- "../src/**/stories/*",
25
- "../src/**/stories/**/*"
26
- ],
27
- "references": [
28
- {
29
- "path": "../../../platform/feature-flags/afm-passionfruit/tsconfig.json"
30
- }
31
- ]
32
- }
@@ -1,32 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.entry-points.post-office.json",
3
- "compilerOptions": {
4
- "declaration": true,
5
- "target": "es5",
6
- "outDir": "../../../../../post-office/tsDist/@atlaskit__analytics-next/app",
7
- "rootDir": "../",
8
- "composite": true
9
- },
10
- "include": [
11
- "../src/**/*.ts",
12
- "../src/**/*.tsx"
13
- ],
14
- "exclude": [
15
- "../src/**/__tests__/*",
16
- "../src/**/*.test.*",
17
- "../src/**/test.*",
18
- "../src/performance/examples.tsx",
19
- "../docs/*",
20
- "../src/**/examples.*",
21
- "../src/**/examples/*",
22
- "../src/**/examples/**/*",
23
- "../src/**/*.stories.*",
24
- "../src/**/stories/*",
25
- "../src/**/stories/**/*"
26
- ],
27
- "references": [
28
- {
29
- "path": "../../../platform/feature-flags/afm-post-office/tsconfig.json"
30
- }
31
- ]
32
- }