@atlaskit/analytics-next 9.3.2 → 9.3.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/AnalyticsErrorBoundary.js +26 -3
- package/dist/es2019/components/AnalyticsErrorBoundary.js +29 -4
- package/dist/esm/components/AnalyticsErrorBoundary.js +29 -4
- package/dist/types/components/AnalyticsErrorBoundary.d.ts +1 -0
- package/dist/types-ts4.5/components/AnalyticsErrorBoundary.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/analytics-next
|
|
2
2
|
|
|
3
|
+
## 9.3.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#125281](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/125281)
|
|
8
|
+
[`69348340269b2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/69348340269b2) -
|
|
9
|
+
Switch AnalyticsErrorBoundary between Modern and Legacy context
|
|
10
|
+
|
|
3
11
|
## 9.3.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -12,12 +12,15 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
12
12
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _LegacyAnalyticsContext = _interopRequireDefault(require("./AnalyticsContext/LegacyAnalyticsContext"));
|
|
17
|
+
var _ModernAnalyticsContext = _interopRequireDefault(require("./AnalyticsContext/ModernAnalyticsContext"));
|
|
16
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
20
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
19
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } // eslint-disable-next-line @atlaskit/platform/prefer-fg
|
|
20
22
|
/**
|
|
23
|
+
* @private https://product-fabric.atlassian.net/browse/AFO-815
|
|
21
24
|
* @deprecated
|
|
22
25
|
*/
|
|
23
26
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
@@ -45,15 +48,35 @@ var AnalyticsErrorBoundary = exports.default = /*#__PURE__*/function (_Component
|
|
|
45
48
|
}, {
|
|
46
49
|
key: "render",
|
|
47
50
|
value: function render() {
|
|
51
|
+
var _process$env;
|
|
52
|
+
var isModernContextEnabledEnv = typeof process !== 'undefined' && process !== null && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']);
|
|
48
53
|
var _this$props = this.props,
|
|
49
54
|
data = _this$props.data,
|
|
50
55
|
children = _this$props.children,
|
|
51
56
|
ErrorComponent = _this$props.ErrorComponent;
|
|
52
57
|
var hasError = this.state.hasError;
|
|
53
58
|
if (hasError) {
|
|
54
|
-
|
|
59
|
+
if (ErrorComponent) {
|
|
60
|
+
if (isModernContextEnabledEnv ||
|
|
61
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-fg
|
|
62
|
+
(0, _platformFeatureFlags.getBooleanFF)('platform.analytics-next-use-modern-context_fqgbx')) {
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(_ModernAnalyticsContext.default, {
|
|
64
|
+
data: data
|
|
65
|
+
}, /*#__PURE__*/_react.default.createElement(ErrorComponent, null));
|
|
66
|
+
} else {
|
|
67
|
+
return /*#__PURE__*/_react.default.createElement(_LegacyAnalyticsContext.default, {
|
|
68
|
+
data: data
|
|
69
|
+
}, /*#__PURE__*/_react.default.createElement(ErrorComponent, null));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
if (isModernContextEnabledEnv ||
|
|
75
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-fg
|
|
76
|
+
(0, _platformFeatureFlags.getBooleanFF)('platform.analytics-next-use-modern-context_fqgbx')) {
|
|
77
|
+
return /*#__PURE__*/_react.default.createElement(_ModernAnalyticsContext.default, {
|
|
55
78
|
data: data
|
|
56
|
-
},
|
|
79
|
+
}, children);
|
|
57
80
|
}
|
|
58
81
|
return /*#__PURE__*/_react.default.createElement(_LegacyAnalyticsContext.default, {
|
|
59
82
|
data: data
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-fg
|
|
4
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
|
+
import LegacyAnalyticsContext from './AnalyticsContext/LegacyAnalyticsContext';
|
|
6
|
+
import ModernAnalyticsContext from './AnalyticsContext/ModernAnalyticsContext';
|
|
3
7
|
/**
|
|
8
|
+
* @private https://product-fabric.atlassian.net/browse/AFO-815
|
|
4
9
|
* @deprecated
|
|
5
10
|
*/
|
|
6
11
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
@@ -21,6 +26,8 @@ export default class AnalyticsErrorBoundary extends Component {
|
|
|
21
26
|
});
|
|
22
27
|
}
|
|
23
28
|
render() {
|
|
29
|
+
var _process$env;
|
|
30
|
+
const isModernContextEnabledEnv = typeof process !== 'undefined' && process !== null && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']);
|
|
24
31
|
const {
|
|
25
32
|
data,
|
|
26
33
|
children,
|
|
@@ -30,11 +37,29 @@ export default class AnalyticsErrorBoundary extends Component {
|
|
|
30
37
|
hasError
|
|
31
38
|
} = this.state;
|
|
32
39
|
if (hasError) {
|
|
33
|
-
|
|
40
|
+
if (ErrorComponent) {
|
|
41
|
+
if (isModernContextEnabledEnv ||
|
|
42
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-fg
|
|
43
|
+
getBooleanFF('platform.analytics-next-use-modern-context_fqgbx')) {
|
|
44
|
+
return /*#__PURE__*/React.createElement(ModernAnalyticsContext, {
|
|
45
|
+
data: data
|
|
46
|
+
}, /*#__PURE__*/React.createElement(ErrorComponent, null));
|
|
47
|
+
} else {
|
|
48
|
+
return /*#__PURE__*/React.createElement(LegacyAnalyticsContext, {
|
|
49
|
+
data: data
|
|
50
|
+
}, /*#__PURE__*/React.createElement(ErrorComponent, null));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
if (isModernContextEnabledEnv ||
|
|
56
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-fg
|
|
57
|
+
getBooleanFF('platform.analytics-next-use-modern-context_fqgbx')) {
|
|
58
|
+
return /*#__PURE__*/React.createElement(ModernAnalyticsContext, {
|
|
34
59
|
data: data
|
|
35
|
-
},
|
|
60
|
+
}, children);
|
|
36
61
|
}
|
|
37
|
-
return /*#__PURE__*/React.createElement(
|
|
62
|
+
return /*#__PURE__*/React.createElement(LegacyAnalyticsContext, {
|
|
38
63
|
data: data
|
|
39
64
|
}, children);
|
|
40
65
|
}
|
|
@@ -6,8 +6,13 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
6
6
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
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
|
-
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-fg
|
|
11
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
12
|
+
import LegacyAnalyticsContext from './AnalyticsContext/LegacyAnalyticsContext';
|
|
13
|
+
import ModernAnalyticsContext from './AnalyticsContext/ModernAnalyticsContext';
|
|
10
14
|
/**
|
|
15
|
+
* @private https://product-fabric.atlassian.net/browse/AFO-815
|
|
11
16
|
* @deprecated
|
|
12
17
|
*/
|
|
13
18
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
@@ -35,17 +40,37 @@ var AnalyticsErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
|
35
40
|
}, {
|
|
36
41
|
key: "render",
|
|
37
42
|
value: function render() {
|
|
43
|
+
var _process$env;
|
|
44
|
+
var isModernContextEnabledEnv = typeof process !== 'undefined' && process !== null && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env['ANALYTICS_NEXT_MODERN_CONTEXT']);
|
|
38
45
|
var _this$props = this.props,
|
|
39
46
|
data = _this$props.data,
|
|
40
47
|
children = _this$props.children,
|
|
41
48
|
ErrorComponent = _this$props.ErrorComponent;
|
|
42
49
|
var hasError = this.state.hasError;
|
|
43
50
|
if (hasError) {
|
|
44
|
-
|
|
51
|
+
if (ErrorComponent) {
|
|
52
|
+
if (isModernContextEnabledEnv ||
|
|
53
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-fg
|
|
54
|
+
getBooleanFF('platform.analytics-next-use-modern-context_fqgbx')) {
|
|
55
|
+
return /*#__PURE__*/React.createElement(ModernAnalyticsContext, {
|
|
56
|
+
data: data
|
|
57
|
+
}, /*#__PURE__*/React.createElement(ErrorComponent, null));
|
|
58
|
+
} else {
|
|
59
|
+
return /*#__PURE__*/React.createElement(LegacyAnalyticsContext, {
|
|
60
|
+
data: data
|
|
61
|
+
}, /*#__PURE__*/React.createElement(ErrorComponent, null));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
if (isModernContextEnabledEnv ||
|
|
67
|
+
// eslint-disable-next-line @atlaskit/platform/prefer-fg
|
|
68
|
+
getBooleanFF('platform.analytics-next-use-modern-context_fqgbx')) {
|
|
69
|
+
return /*#__PURE__*/React.createElement(ModernAnalyticsContext, {
|
|
45
70
|
data: data
|
|
46
|
-
},
|
|
71
|
+
}, children);
|
|
47
72
|
}
|
|
48
|
-
return /*#__PURE__*/React.createElement(
|
|
73
|
+
return /*#__PURE__*/React.createElement(LegacyAnalyticsContext, {
|
|
49
74
|
data: data
|
|
50
75
|
}, children);
|
|
51
76
|
}
|
|
@@ -14,6 +14,7 @@ type AnalyticsErrorBoundaryState = {
|
|
|
14
14
|
hasError: boolean;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
|
+
* @private https://product-fabric.atlassian.net/browse/AFO-815
|
|
17
18
|
* @deprecated
|
|
18
19
|
*/
|
|
19
20
|
export default class AnalyticsErrorBoundary extends Component<AnalyticsErrorBoundaryProps, AnalyticsErrorBoundaryState> {
|
|
@@ -14,6 +14,7 @@ type AnalyticsErrorBoundaryState = {
|
|
|
14
14
|
hasError: boolean;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
|
+
* @private https://product-fabric.atlassian.net/browse/AFO-815
|
|
17
18
|
* @deprecated
|
|
18
19
|
*/
|
|
19
20
|
export default class AnalyticsErrorBoundary extends Component<AnalyticsErrorBoundaryProps, AnalyticsErrorBoundaryState> {
|
package/package.json
CHANGED