@atlaskit/analytics-next 11.1.2 → 11.1.3
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 +8 -0
- package/dist/cjs/components/AnalyticsContext/index.js +1 -9
- package/dist/cjs/components/AnalyticsErrorBoundary.js +2 -16
- package/dist/cjs/components/AnalyticsListener/index.js +1 -9
- package/dist/es2019/components/AnalyticsContext/index.js +1 -9
- package/dist/es2019/components/AnalyticsErrorBoundary.js +2 -16
- package/dist/es2019/components/AnalyticsListener/index.js +1 -9
- package/dist/esm/components/AnalyticsContext/index.js +1 -9
- package/dist/esm/components/AnalyticsErrorBoundary.js +2 -16
- package/dist/esm/components/AnalyticsListener/index.js +1 -9
- package/dist/types/components/AnalyticsContext/index.d.ts +2 -3
- package/dist/types/components/AnalyticsListener/index.d.ts +2 -3
- package/dist/types-ts4.5/components/AnalyticsContext/index.d.ts +2 -3
- package/dist/types-ts4.5/components/AnalyticsListener/index.d.ts +2 -3
- package/docs/40-listeners.tsx +1 -1
- package/package.json +2 -6
- package/dist/cjs/components/AnalyticsContext/LegacyAnalyticsContext.js +0 -71
- package/dist/cjs/components/AnalyticsListener/LegacyAnalyticsListener.js +0 -79
- package/dist/cjs/utils/isModernContextEnabledEnv.js +0 -9
- package/dist/es2019/components/AnalyticsContext/LegacyAnalyticsContext.js +0 -49
- package/dist/es2019/components/AnalyticsListener/LegacyAnalyticsListener.js +0 -56
- package/dist/es2019/utils/isModernContextEnabledEnv.js +0 -3
- package/dist/esm/components/AnalyticsContext/LegacyAnalyticsContext.js +0 -62
- package/dist/esm/components/AnalyticsListener/LegacyAnalyticsListener.js +0 -70
- package/dist/esm/utils/isModernContextEnabledEnv.js +0 -3
- package/dist/types/components/AnalyticsContext/LegacyAnalyticsContext.d.ts +0 -30
- package/dist/types/components/AnalyticsListener/LegacyAnalyticsListener.d.ts +0 -34
- package/dist/types/utils/isModernContextEnabledEnv.d.ts +0 -2
- package/dist/types-ts4.5/components/AnalyticsContext/LegacyAnalyticsContext.d.ts +0 -30
- package/dist/types-ts4.5/components/AnalyticsListener/LegacyAnalyticsListener.d.ts +0 -34
- package/dist/types-ts4.5/utils/isModernContextEnabledEnv.d.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/analytics-next
|
|
2
2
|
|
|
3
|
+
## 11.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`2752a069d8a01`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2752a069d8a01) -
|
|
8
|
+
Cleaning up feature flag changes that remove the legacy contextTypes API, which is deprecated and
|
|
9
|
+
will be removed in the next major React release.
|
|
10
|
+
|
|
3
11
|
## 11.1.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -5,13 +5,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
|
-
var _isModernContextEnabledEnv = _interopRequireDefault(require("../../utils/isModernContextEnabledEnv"));
|
|
11
|
-
var _LegacyAnalyticsContext = _interopRequireDefault(require("./LegacyAnalyticsContext"));
|
|
12
8
|
var _ModernAnalyticsContext = _interopRequireDefault(require("./ModernAnalyticsContext"));
|
|
13
|
-
var
|
|
14
|
-
var isModernContext = _isModernContextEnabledEnv.default || (0, _platformFeatureFlags.fg)('analytics-next-use-modern-context_jira');
|
|
15
|
-
return isModernContext ? /*#__PURE__*/_react.default.createElement(_ModernAnalyticsContext.default, props) : /*#__PURE__*/_react.default.createElement(_LegacyAnalyticsContext.default, props);
|
|
16
|
-
};
|
|
17
|
-
var _default = exports.default = ExportedAnalyticsContext;
|
|
9
|
+
var _default = exports.default = _ModernAnalyticsContext.default;
|
|
@@ -12,9 +12,6 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
12
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
|
-
var _isModernContextEnabledEnv = _interopRequireDefault(require("../utils/isModernContextEnabledEnv"));
|
|
17
|
-
var _LegacyAnalyticsContext = _interopRequireDefault(require("./AnalyticsContext/LegacyAnalyticsContext"));
|
|
18
15
|
var _ModernAnalyticsContext = _interopRequireDefault(require("./AnalyticsContext/ModernAnalyticsContext"));
|
|
19
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
17
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
@@ -52,26 +49,15 @@ var AnalyticsErrorBoundary = exports.default = /*#__PURE__*/function (_Component
|
|
|
52
49
|
children = _this$props.children,
|
|
53
50
|
ErrorComponent = _this$props.ErrorComponent;
|
|
54
51
|
var hasError = this.state.hasError;
|
|
55
|
-
var isModernContext = _isModernContextEnabledEnv.default || (0, _platformFeatureFlags.fg)('analytics-next-use-modern-context_jira');
|
|
56
52
|
if (hasError) {
|
|
57
53
|
if (ErrorComponent) {
|
|
58
|
-
|
|
59
|
-
return /*#__PURE__*/_react.default.createElement(_ModernAnalyticsContext.default, {
|
|
60
|
-
data: data
|
|
61
|
-
}, /*#__PURE__*/_react.default.createElement(ErrorComponent, null));
|
|
62
|
-
}
|
|
63
|
-
return /*#__PURE__*/_react.default.createElement(_LegacyAnalyticsContext.default, {
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_ModernAnalyticsContext.default, {
|
|
64
55
|
data: data
|
|
65
56
|
}, /*#__PURE__*/_react.default.createElement(ErrorComponent, null));
|
|
66
57
|
}
|
|
67
58
|
return null;
|
|
68
59
|
}
|
|
69
|
-
|
|
70
|
-
return /*#__PURE__*/_react.default.createElement(_ModernAnalyticsContext.default, {
|
|
71
|
-
data: data
|
|
72
|
-
}, children);
|
|
73
|
-
}
|
|
74
|
-
return /*#__PURE__*/_react.default.createElement(_LegacyAnalyticsContext.default, {
|
|
60
|
+
return /*#__PURE__*/_react.default.createElement(_ModernAnalyticsContext.default, {
|
|
75
61
|
data: data
|
|
76
62
|
}, children);
|
|
77
63
|
}
|
|
@@ -5,13 +5,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
|
-
var _isModernContextEnabledEnv = _interopRequireDefault(require("../../utils/isModernContextEnabledEnv"));
|
|
11
|
-
var _LegacyAnalyticsListener = _interopRequireDefault(require("./LegacyAnalyticsListener"));
|
|
12
8
|
var _ModernAnalyticsListener = _interopRequireDefault(require("./ModernAnalyticsListener"));
|
|
13
|
-
var
|
|
14
|
-
var isModernContext = _isModernContextEnabledEnv.default || (0, _platformFeatureFlags.fg)('analytics-next-use-modern-context_jira');
|
|
15
|
-
return isModernContext ? /*#__PURE__*/_react.default.createElement(_ModernAnalyticsListener.default, props) : /*#__PURE__*/_react.default.createElement(_LegacyAnalyticsListener.default, props);
|
|
16
|
-
};
|
|
17
|
-
var _default = exports.default = ExportedAnalyticsListener;
|
|
9
|
+
var _default = exports.default = _ModernAnalyticsListener.default;
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
import isModernContextEnabledEnv from '../../utils/isModernContextEnabledEnv';
|
|
4
|
-
import LegacyAnalyticsContext from './LegacyAnalyticsContext';
|
|
5
1
|
import ModernAnalyticsContext from './ModernAnalyticsContext';
|
|
6
|
-
|
|
7
|
-
const isModernContext = isModernContextEnabledEnv || fg('analytics-next-use-modern-context_jira');
|
|
8
|
-
return isModernContext ? /*#__PURE__*/React.createElement(ModernAnalyticsContext, props) : /*#__PURE__*/React.createElement(LegacyAnalyticsContext, props);
|
|
9
|
-
};
|
|
10
|
-
export default ExportedAnalyticsContext;
|
|
2
|
+
export default ModernAnalyticsContext;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
import isModernContextEnabledEnv from '../utils/isModernContextEnabledEnv';
|
|
4
|
-
import LegacyAnalyticsContext from './AnalyticsContext/LegacyAnalyticsContext';
|
|
5
2
|
import ModernAnalyticsContext from './AnalyticsContext/ModernAnalyticsContext';
|
|
6
3
|
/**
|
|
7
4
|
* @private https://product-fabric.atlassian.net/browse/AFO-815
|
|
@@ -33,26 +30,15 @@ export default class AnalyticsErrorBoundary extends Component {
|
|
|
33
30
|
const {
|
|
34
31
|
hasError
|
|
35
32
|
} = this.state;
|
|
36
|
-
const isModernContext = isModernContextEnabledEnv || fg('analytics-next-use-modern-context_jira');
|
|
37
33
|
if (hasError) {
|
|
38
34
|
if (ErrorComponent) {
|
|
39
|
-
|
|
40
|
-
return /*#__PURE__*/React.createElement(ModernAnalyticsContext, {
|
|
41
|
-
data: data
|
|
42
|
-
}, /*#__PURE__*/React.createElement(ErrorComponent, null));
|
|
43
|
-
}
|
|
44
|
-
return /*#__PURE__*/React.createElement(LegacyAnalyticsContext, {
|
|
35
|
+
return /*#__PURE__*/React.createElement(ModernAnalyticsContext, {
|
|
45
36
|
data: data
|
|
46
37
|
}, /*#__PURE__*/React.createElement(ErrorComponent, null));
|
|
47
38
|
}
|
|
48
39
|
return null;
|
|
49
40
|
}
|
|
50
|
-
|
|
51
|
-
return /*#__PURE__*/React.createElement(ModernAnalyticsContext, {
|
|
52
|
-
data: data
|
|
53
|
-
}, children);
|
|
54
|
-
}
|
|
55
|
-
return /*#__PURE__*/React.createElement(LegacyAnalyticsContext, {
|
|
41
|
+
return /*#__PURE__*/React.createElement(ModernAnalyticsContext, {
|
|
56
42
|
data: data
|
|
57
43
|
}, children);
|
|
58
44
|
}
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
import isModernContextEnabledEnv from '../../utils/isModernContextEnabledEnv';
|
|
4
|
-
import LegacyAnalyticsListener from './LegacyAnalyticsListener';
|
|
5
1
|
import ModernAnalyticsListener from './ModernAnalyticsListener';
|
|
6
|
-
|
|
7
|
-
const isModernContext = isModernContextEnabledEnv || fg('analytics-next-use-modern-context_jira');
|
|
8
|
-
return isModernContext ? /*#__PURE__*/React.createElement(ModernAnalyticsListener, props) : /*#__PURE__*/React.createElement(LegacyAnalyticsListener, props);
|
|
9
|
-
};
|
|
10
|
-
export default ExportedAnalyticsListener;
|
|
2
|
+
export default ModernAnalyticsListener;
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
import isModernContextEnabledEnv from '../../utils/isModernContextEnabledEnv';
|
|
4
|
-
import LegacyAnalyticsContext from './LegacyAnalyticsContext';
|
|
5
1
|
import ModernAnalyticsContext from './ModernAnalyticsContext';
|
|
6
|
-
|
|
7
|
-
var isModernContext = isModernContextEnabledEnv || fg('analytics-next-use-modern-context_jira');
|
|
8
|
-
return isModernContext ? /*#__PURE__*/React.createElement(ModernAnalyticsContext, props) : /*#__PURE__*/React.createElement(LegacyAnalyticsContext, props);
|
|
9
|
-
};
|
|
10
|
-
export default ExportedAnalyticsContext;
|
|
2
|
+
export default ModernAnalyticsContext;
|
|
@@ -6,9 +6,6 @@ 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';
|
|
12
9
|
import ModernAnalyticsContext from './AnalyticsContext/ModernAnalyticsContext';
|
|
13
10
|
/**
|
|
14
11
|
* @private https://product-fabric.atlassian.net/browse/AFO-815
|
|
@@ -43,26 +40,15 @@ var AnalyticsErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
|
43
40
|
children = _this$props.children,
|
|
44
41
|
ErrorComponent = _this$props.ErrorComponent;
|
|
45
42
|
var hasError = this.state.hasError;
|
|
46
|
-
var isModernContext = isModernContextEnabledEnv || fg('analytics-next-use-modern-context_jira');
|
|
47
43
|
if (hasError) {
|
|
48
44
|
if (ErrorComponent) {
|
|
49
|
-
|
|
50
|
-
return /*#__PURE__*/React.createElement(ModernAnalyticsContext, {
|
|
51
|
-
data: data
|
|
52
|
-
}, /*#__PURE__*/React.createElement(ErrorComponent, null));
|
|
53
|
-
}
|
|
54
|
-
return /*#__PURE__*/React.createElement(LegacyAnalyticsContext, {
|
|
45
|
+
return /*#__PURE__*/React.createElement(ModernAnalyticsContext, {
|
|
55
46
|
data: data
|
|
56
47
|
}, /*#__PURE__*/React.createElement(ErrorComponent, null));
|
|
57
48
|
}
|
|
58
49
|
return null;
|
|
59
50
|
}
|
|
60
|
-
|
|
61
|
-
return /*#__PURE__*/React.createElement(ModernAnalyticsContext, {
|
|
62
|
-
data: data
|
|
63
|
-
}, children);
|
|
64
|
-
}
|
|
65
|
-
return /*#__PURE__*/React.createElement(LegacyAnalyticsContext, {
|
|
51
|
+
return /*#__PURE__*/React.createElement(ModernAnalyticsContext, {
|
|
66
52
|
data: data
|
|
67
53
|
}, children);
|
|
68
54
|
}
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
import isModernContextEnabledEnv from '../../utils/isModernContextEnabledEnv';
|
|
4
|
-
import LegacyAnalyticsListener from './LegacyAnalyticsListener';
|
|
5
1
|
import ModernAnalyticsListener from './ModernAnalyticsListener';
|
|
6
|
-
|
|
7
|
-
var isModernContext = isModernContextEnabledEnv || fg('analytics-next-use-modern-context_jira');
|
|
8
|
-
return isModernContext ? /*#__PURE__*/React.createElement(ModernAnalyticsListener, props) : /*#__PURE__*/React.createElement(LegacyAnalyticsListener, props);
|
|
9
|
-
};
|
|
10
|
-
export default ExportedAnalyticsListener;
|
|
2
|
+
export default ModernAnalyticsListener;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export default ExportedAnalyticsContext;
|
|
1
|
+
import ModernAnalyticsContext from './ModernAnalyticsContext';
|
|
2
|
+
export default ModernAnalyticsContext;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export default ExportedAnalyticsListener;
|
|
1
|
+
import ModernAnalyticsListener from './ModernAnalyticsListener';
|
|
2
|
+
export default ModernAnalyticsListener;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export default ExportedAnalyticsContext;
|
|
1
|
+
import ModernAnalyticsContext from './ModernAnalyticsContext';
|
|
2
|
+
export default ModernAnalyticsContext;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export default ExportedAnalyticsListener;
|
|
1
|
+
import ModernAnalyticsListener from './ModernAnalyticsListener';
|
|
2
|
+
export default ModernAnalyticsListener;
|
package/docs/40-listeners.tsx
CHANGED
|
@@ -10,7 +10,7 @@ export default md`
|
|
|
10
10
|
${(
|
|
11
11
|
<Props
|
|
12
12
|
heading="AnalyticsListener Props"
|
|
13
|
-
props={require('!!extract-react-types-loader!../src/components/AnalyticsListener/
|
|
13
|
+
props={require('!!extract-react-types-loader!../src/components/AnalyticsListener/ModernAnalyticsListener')}
|
|
14
14
|
/>
|
|
15
15
|
)}
|
|
16
16
|
`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/analytics-next",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.3",
|
|
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/"
|
|
@@ -73,9 +73,5 @@
|
|
|
73
73
|
]
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
|
-
"platform-feature-flags": {
|
|
77
|
-
"analytics-next-use-modern-context_jira": {
|
|
78
|
-
"type": "boolean"
|
|
79
|
-
}
|
|
80
|
-
}
|
|
76
|
+
"platform-feature-flags": {}
|
|
81
77
|
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
18
|
-
var _analyticsNextStableReactContext = _interopRequireDefault(require("@atlaskit/analytics-next-stable-react-context"));
|
|
19
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
|
-
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
21
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
|
-
var ContextTypes = {
|
|
23
|
-
getAtlaskitAnalyticsContext: _propTypes.default.func,
|
|
24
|
-
getAtlaskitAnalyticsEventHandlers: _propTypes.default.func
|
|
25
|
-
};
|
|
26
|
-
var noop = function noop() {
|
|
27
|
-
return [];
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
31
|
-
var AnalyticsContext = /*#__PURE__*/function (_Component) {
|
|
32
|
-
function AnalyticsContext(props) {
|
|
33
|
-
var _this;
|
|
34
|
-
(0, _classCallCheck2.default)(this, AnalyticsContext);
|
|
35
|
-
_this = _callSuper(this, AnalyticsContext, [props]);
|
|
36
|
-
(0, _defineProperty2.default)(_this, "getChildContext", function () {
|
|
37
|
-
return {
|
|
38
|
-
getAtlaskitAnalyticsContext: _this.getAnalyticsContext
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
(0, _defineProperty2.default)(_this, "getAnalyticsContext", function () {
|
|
42
|
-
var data = _this.props.data;
|
|
43
|
-
var _this$context$getAtla = _this.context.getAtlaskitAnalyticsContext,
|
|
44
|
-
getAtlaskitAnalyticsContext = _this$context$getAtla === void 0 ? noop : _this$context$getAtla;
|
|
45
|
-
return [].concat((0, _toConsumableArray2.default)(getAtlaskitAnalyticsContext()), [data]);
|
|
46
|
-
});
|
|
47
|
-
(0, _defineProperty2.default)(_this, "getAnalyticsEventHandlers", function () {
|
|
48
|
-
var _this$context$getAtla2 = _this.context.getAtlaskitAnalyticsEventHandlers,
|
|
49
|
-
getAtlaskitAnalyticsEventHandlers = _this$context$getAtla2 === void 0 ? noop : _this$context$getAtla2;
|
|
50
|
-
return getAtlaskitAnalyticsEventHandlers();
|
|
51
|
-
});
|
|
52
|
-
_this.contextValue = {
|
|
53
|
-
getAtlaskitAnalyticsContext: _this.getAnalyticsContext,
|
|
54
|
-
getAtlaskitAnalyticsEventHandlers: _this.getAnalyticsEventHandlers
|
|
55
|
-
};
|
|
56
|
-
return _this;
|
|
57
|
-
}
|
|
58
|
-
(0, _inherits2.default)(AnalyticsContext, _Component);
|
|
59
|
-
return (0, _createClass2.default)(AnalyticsContext, [{
|
|
60
|
-
key: "render",
|
|
61
|
-
value: function render() {
|
|
62
|
-
var children = this.props.children;
|
|
63
|
-
return /*#__PURE__*/_react.default.createElement(_analyticsNextStableReactContext.default.Provider, {
|
|
64
|
-
value: this.contextValue
|
|
65
|
-
}, children);
|
|
66
|
-
}
|
|
67
|
-
}]);
|
|
68
|
-
}(_react.Component);
|
|
69
|
-
(0, _defineProperty2.default)(AnalyticsContext, "contextTypes", ContextTypes);
|
|
70
|
-
(0, _defineProperty2.default)(AnalyticsContext, "childContextTypes", ContextTypes);
|
|
71
|
-
var _default = exports.default = AnalyticsContext;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
18
|
-
var _analyticsNextStableReactContext = _interopRequireDefault(require("@atlaskit/analytics-next-stable-react-context"));
|
|
19
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
|
-
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
21
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
|
-
var ContextTypes = {
|
|
23
|
-
getAtlaskitAnalyticsEventHandlers: _propTypes.default.func,
|
|
24
|
-
getAtlaskitAnalyticsContext: _propTypes.default.func
|
|
25
|
-
};
|
|
26
|
-
var noop = function noop() {
|
|
27
|
-
return [];
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
31
|
-
var AnalyticsListener = /*#__PURE__*/function (_Component) {
|
|
32
|
-
function AnalyticsListener(props) {
|
|
33
|
-
var _this;
|
|
34
|
-
(0, _classCallCheck2.default)(this, AnalyticsListener);
|
|
35
|
-
_this = _callSuper(this, AnalyticsListener, [props]);
|
|
36
|
-
(0, _defineProperty2.default)(_this, "getChildContext", function () {
|
|
37
|
-
return {
|
|
38
|
-
getAtlaskitAnalyticsEventHandlers: _this.getAnalyticsEventHandlers,
|
|
39
|
-
getAtlaskitAnalyticsContext: _this.getAtlaskitAnalyticsContext
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
(0, _defineProperty2.default)(_this, "getAnalyticsEventHandlers", function () {
|
|
43
|
-
var _this$props = _this.props,
|
|
44
|
-
channel = _this$props.channel,
|
|
45
|
-
onEvent = _this$props.onEvent;
|
|
46
|
-
var _this$context$getAtla = _this.context.getAtlaskitAnalyticsEventHandlers,
|
|
47
|
-
getAtlaskitAnalyticsEventHandlers = _this$context$getAtla === void 0 ? noop : _this$context$getAtla;
|
|
48
|
-
var handler = function handler(event, eventChannel) {
|
|
49
|
-
if (channel === '*' || channel === eventChannel) {
|
|
50
|
-
onEvent(event, eventChannel);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
return [handler].concat((0, _toConsumableArray2.default)(getAtlaskitAnalyticsEventHandlers()));
|
|
54
|
-
});
|
|
55
|
-
(0, _defineProperty2.default)(_this, "getAtlaskitAnalyticsContext", function () {
|
|
56
|
-
var _this$context$getAtla2 = _this.context.getAtlaskitAnalyticsContext,
|
|
57
|
-
getAtlaskitAnalyticsContext = _this$context$getAtla2 === void 0 ? noop : _this$context$getAtla2;
|
|
58
|
-
return getAtlaskitAnalyticsContext();
|
|
59
|
-
});
|
|
60
|
-
_this.contextValue = {
|
|
61
|
-
getAtlaskitAnalyticsContext: _this.getAtlaskitAnalyticsContext,
|
|
62
|
-
getAtlaskitAnalyticsEventHandlers: _this.getAnalyticsEventHandlers
|
|
63
|
-
};
|
|
64
|
-
return _this;
|
|
65
|
-
}
|
|
66
|
-
(0, _inherits2.default)(AnalyticsListener, _Component);
|
|
67
|
-
return (0, _createClass2.default)(AnalyticsListener, [{
|
|
68
|
-
key: "render",
|
|
69
|
-
value: function render() {
|
|
70
|
-
var children = this.props.children;
|
|
71
|
-
return /*#__PURE__*/_react.default.createElement(_analyticsNextStableReactContext.default.Provider, {
|
|
72
|
-
value: this.contextValue
|
|
73
|
-
}, children);
|
|
74
|
-
}
|
|
75
|
-
}]);
|
|
76
|
-
}(_react.Component);
|
|
77
|
-
(0, _defineProperty2.default)(AnalyticsListener, "contextTypes", ContextTypes);
|
|
78
|
-
(0, _defineProperty2.default)(AnalyticsListener, "childContextTypes", ContextTypes);
|
|
79
|
-
var _default = exports.default = AnalyticsListener;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _process$env;
|
|
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']);
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import React, { Component } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { default as AnalyticsReactContext } from '@atlaskit/analytics-next-stable-react-context';
|
|
5
|
-
const ContextTypes = {
|
|
6
|
-
getAtlaskitAnalyticsContext: PropTypes.func,
|
|
7
|
-
getAtlaskitAnalyticsEventHandlers: PropTypes.func
|
|
8
|
-
};
|
|
9
|
-
const noop = () => [];
|
|
10
|
-
|
|
11
|
-
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
12
|
-
class AnalyticsContext extends Component {
|
|
13
|
-
constructor(props) {
|
|
14
|
-
super(props);
|
|
15
|
-
_defineProperty(this, "getChildContext", () => ({
|
|
16
|
-
getAtlaskitAnalyticsContext: this.getAnalyticsContext
|
|
17
|
-
}));
|
|
18
|
-
_defineProperty(this, "getAnalyticsContext", () => {
|
|
19
|
-
const {
|
|
20
|
-
data
|
|
21
|
-
} = this.props;
|
|
22
|
-
const {
|
|
23
|
-
getAtlaskitAnalyticsContext = noop
|
|
24
|
-
} = this.context;
|
|
25
|
-
return [...getAtlaskitAnalyticsContext(), data];
|
|
26
|
-
});
|
|
27
|
-
_defineProperty(this, "getAnalyticsEventHandlers", () => {
|
|
28
|
-
const {
|
|
29
|
-
getAtlaskitAnalyticsEventHandlers = noop
|
|
30
|
-
} = this.context;
|
|
31
|
-
return getAtlaskitAnalyticsEventHandlers();
|
|
32
|
-
});
|
|
33
|
-
this.contextValue = {
|
|
34
|
-
getAtlaskitAnalyticsContext: this.getAnalyticsContext,
|
|
35
|
-
getAtlaskitAnalyticsEventHandlers: this.getAnalyticsEventHandlers
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
render() {
|
|
39
|
-
const {
|
|
40
|
-
children
|
|
41
|
-
} = this.props;
|
|
42
|
-
return /*#__PURE__*/React.createElement(AnalyticsReactContext.Provider, {
|
|
43
|
-
value: this.contextValue
|
|
44
|
-
}, children);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
_defineProperty(AnalyticsContext, "contextTypes", ContextTypes);
|
|
48
|
-
_defineProperty(AnalyticsContext, "childContextTypes", ContextTypes);
|
|
49
|
-
export default AnalyticsContext;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import React, { Component } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { default as AnalyticsReactContext } from '@atlaskit/analytics-next-stable-react-context';
|
|
5
|
-
const ContextTypes = {
|
|
6
|
-
getAtlaskitAnalyticsEventHandlers: PropTypes.func,
|
|
7
|
-
getAtlaskitAnalyticsContext: PropTypes.func
|
|
8
|
-
};
|
|
9
|
-
const noop = () => [];
|
|
10
|
-
|
|
11
|
-
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
12
|
-
class AnalyticsListener extends Component {
|
|
13
|
-
constructor(props) {
|
|
14
|
-
super(props);
|
|
15
|
-
_defineProperty(this, "getChildContext", () => ({
|
|
16
|
-
getAtlaskitAnalyticsEventHandlers: this.getAnalyticsEventHandlers,
|
|
17
|
-
getAtlaskitAnalyticsContext: this.getAtlaskitAnalyticsContext
|
|
18
|
-
}));
|
|
19
|
-
_defineProperty(this, "getAnalyticsEventHandlers", () => {
|
|
20
|
-
const {
|
|
21
|
-
channel,
|
|
22
|
-
onEvent
|
|
23
|
-
} = this.props;
|
|
24
|
-
const {
|
|
25
|
-
getAtlaskitAnalyticsEventHandlers = noop
|
|
26
|
-
} = this.context;
|
|
27
|
-
const handler = (event, eventChannel) => {
|
|
28
|
-
if (channel === '*' || channel === eventChannel) {
|
|
29
|
-
onEvent(event, eventChannel);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
return [handler, ...getAtlaskitAnalyticsEventHandlers()];
|
|
33
|
-
});
|
|
34
|
-
_defineProperty(this, "getAtlaskitAnalyticsContext", () => {
|
|
35
|
-
const {
|
|
36
|
-
getAtlaskitAnalyticsContext = noop
|
|
37
|
-
} = this.context;
|
|
38
|
-
return getAtlaskitAnalyticsContext();
|
|
39
|
-
});
|
|
40
|
-
this.contextValue = {
|
|
41
|
-
getAtlaskitAnalyticsContext: this.getAtlaskitAnalyticsContext,
|
|
42
|
-
getAtlaskitAnalyticsEventHandlers: this.getAnalyticsEventHandlers
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
render() {
|
|
46
|
-
const {
|
|
47
|
-
children
|
|
48
|
-
} = this.props;
|
|
49
|
-
return /*#__PURE__*/React.createElement(AnalyticsReactContext.Provider, {
|
|
50
|
-
value: this.contextValue
|
|
51
|
-
}, children);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
_defineProperty(AnalyticsListener, "contextTypes", ContextTypes);
|
|
55
|
-
_defineProperty(AnalyticsListener, "childContextTypes", ContextTypes);
|
|
56
|
-
export default AnalyticsListener;
|
|
@@ -1,62 +0,0 @@
|
|
|
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,70 +0,0 @@
|
|
|
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,30 +0,0 @@
|
|
|
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,34 +0,0 @@
|
|
|
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,30 +0,0 @@
|
|
|
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,34 +0,0 @@
|
|
|
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;
|