@commercetools-frontend/staff-bar 0.0.0
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/LICENSE +21 -0
- package/README.md +25 -0
- package/dist/commercetools-frontend-staff-bar.cjs.d.ts +2 -0
- package/dist/commercetools-frontend-staff-bar.cjs.dev.js +86 -0
- package/dist/commercetools-frontend-staff-bar.cjs.js +7 -0
- package/dist/commercetools-frontend-staff-bar.cjs.prod.js +86 -0
- package/dist/commercetools-frontend-staff-bar.esm.js +70 -0
- package/dist/declarations/src/index.d.ts +1 -0
- package/dist/declarations/src/staff-bar.async.d.ts +3 -0
- package/dist/declarations/src/types.d.ts +7 -0
- package/dist/staff-bar-60f77ed8.cjs.prod.js +989 -0
- package/dist/staff-bar-a1ddb484.cjs.dev.js +1040 -0
- package/dist/staff-bar-cd682dc4.esm.js +1014 -0
- package/package.json +50 -0
- package/scripts/generate-environments-config.mjs +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) commercetools GmbH
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# @commercetools-frontend/staff-bar
|
|
2
|
+
|
|
3
|
+
> This is a package used internally for Merchant Center applications. We do not provide any guarantees or support for the functionality.
|
|
4
|
+
|
|
5
|
+
This package offers a toolbar that can be seamlessly incorporated into Merchant Center applications. This toolbar simplifies the developer's work by providing easy access to various information and settings.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
$ npm install --save @commercetools-frontend/staff-bar
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Background
|
|
14
|
+
|
|
15
|
+
Staff bar is an experimental feature available only to commercetools employees. It allows to quickly switch environment, toggle different feature flags and other useful actions. This feature is not visible to end customers nor partners.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
Add the StaffBar component to your application's entry point. Specify the feature flags your application uses in the props.
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
import { StaffBar } from '@commercetools-frontend/staff-bar';
|
|
23
|
+
|
|
24
|
+
<StaffBar featureFlags={DEFAULT_SHORT_LIVED_FLAGS} />
|
|
25
|
+
```
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export * from "./declarations/src/index";
|
|
2
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWVyY2V0b29scy1mcm9udGVuZC1zdGFmZi1iYXIuY2pzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuL2RlY2xhcmF0aW9ucy9zcmMvaW5kZXguZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
6
|
+
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
7
|
+
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
8
|
+
var _Object$getOwnPropertyDescriptor = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
|
|
9
|
+
var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
|
|
10
|
+
var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
|
|
11
|
+
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
12
|
+
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
13
|
+
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
14
|
+
var react = require('react');
|
|
15
|
+
var _Reflect$construct = require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
|
|
16
|
+
var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
17
|
+
var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
|
|
18
|
+
var _possibleConstructorReturn = require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
|
|
19
|
+
var _getPrototypeOf = require('@babel/runtime-corejs3/helpers/getPrototypeOf');
|
|
20
|
+
var _inherits = require('@babel/runtime-corejs3/helpers/inherits');
|
|
21
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
22
|
+
|
|
23
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
24
|
+
|
|
25
|
+
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
26
|
+
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
|
|
27
|
+
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
28
|
+
var _Object$getOwnPropertyDescriptor__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptor);
|
|
29
|
+
var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty);
|
|
30
|
+
var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
|
|
31
|
+
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
32
|
+
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
33
|
+
var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
|
|
34
|
+
|
|
35
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
36
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
|
|
37
|
+
let ErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
38
|
+
function ErrorBoundary() {
|
|
39
|
+
var _this;
|
|
40
|
+
_classCallCheck(this, ErrorBoundary);
|
|
41
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
42
|
+
args[_key] = arguments[_key];
|
|
43
|
+
}
|
|
44
|
+
_this = _callSuper(this, ErrorBoundary, [...args]);
|
|
45
|
+
_this.state = {
|
|
46
|
+
hasError: false
|
|
47
|
+
};
|
|
48
|
+
return _this;
|
|
49
|
+
}
|
|
50
|
+
_inherits(ErrorBoundary, _Component);
|
|
51
|
+
return _createClass(ErrorBoundary, [{
|
|
52
|
+
key: "render",
|
|
53
|
+
value: function render() {
|
|
54
|
+
if (this.state.hasError) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
58
|
+
children: this.props.children
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}], [{
|
|
62
|
+
key: "getDerivedStateFromError",
|
|
63
|
+
value: function getDerivedStateFromError( /* error */
|
|
64
|
+
) {
|
|
65
|
+
// Update state so the next render will show the fallback UI.
|
|
66
|
+
return {
|
|
67
|
+
hasError: true
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}]);
|
|
71
|
+
}(react.Component);
|
|
72
|
+
|
|
73
|
+
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
74
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
75
|
+
const StaffBarComponent = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./staff-bar-a1ddb484.cjs.dev.js'); }));
|
|
76
|
+
function StaffBar(props) {
|
|
77
|
+
var _window$sessionStorag;
|
|
78
|
+
if (process.env.NODE_ENV === 'test' || window.Cypress && !((_window$sessionStorag = window.sessionStorage) !== null && _window$sessionStorag !== void 0 && _window$sessionStorag.enableStaffBarForCypress)) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
return jsxRuntime.jsx(ErrorBoundary, {
|
|
82
|
+
children: jsxRuntime.jsx(StaffBarComponent, _objectSpread({}, props))
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
exports.StaffBar = StaffBar;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
6
|
+
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
7
|
+
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
8
|
+
var _Object$getOwnPropertyDescriptor = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
|
|
9
|
+
var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
|
|
10
|
+
var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
|
|
11
|
+
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
12
|
+
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
13
|
+
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
14
|
+
var react = require('react');
|
|
15
|
+
var _Reflect$construct = require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
|
|
16
|
+
var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
17
|
+
var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
|
|
18
|
+
var _possibleConstructorReturn = require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
|
|
19
|
+
var _getPrototypeOf = require('@babel/runtime-corejs3/helpers/getPrototypeOf');
|
|
20
|
+
var _inherits = require('@babel/runtime-corejs3/helpers/inherits');
|
|
21
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
22
|
+
|
|
23
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
24
|
+
|
|
25
|
+
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
26
|
+
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
|
|
27
|
+
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
28
|
+
var _Object$getOwnPropertyDescriptor__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptor);
|
|
29
|
+
var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty);
|
|
30
|
+
var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
|
|
31
|
+
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
32
|
+
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
33
|
+
var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
|
|
34
|
+
|
|
35
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
36
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
|
|
37
|
+
let ErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
38
|
+
function ErrorBoundary() {
|
|
39
|
+
var _this;
|
|
40
|
+
_classCallCheck(this, ErrorBoundary);
|
|
41
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
42
|
+
args[_key] = arguments[_key];
|
|
43
|
+
}
|
|
44
|
+
_this = _callSuper(this, ErrorBoundary, [...args]);
|
|
45
|
+
_this.state = {
|
|
46
|
+
hasError: false
|
|
47
|
+
};
|
|
48
|
+
return _this;
|
|
49
|
+
}
|
|
50
|
+
_inherits(ErrorBoundary, _Component);
|
|
51
|
+
return _createClass(ErrorBoundary, [{
|
|
52
|
+
key: "render",
|
|
53
|
+
value: function render() {
|
|
54
|
+
if (this.state.hasError) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
58
|
+
children: this.props.children
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}], [{
|
|
62
|
+
key: "getDerivedStateFromError",
|
|
63
|
+
value: function getDerivedStateFromError( /* error */
|
|
64
|
+
) {
|
|
65
|
+
// Update state so the next render will show the fallback UI.
|
|
66
|
+
return {
|
|
67
|
+
hasError: true
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}]);
|
|
71
|
+
}(react.Component);
|
|
72
|
+
|
|
73
|
+
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
74
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
75
|
+
const StaffBarComponent = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./staff-bar-60f77ed8.cjs.prod.js'); }));
|
|
76
|
+
function StaffBar(props) {
|
|
77
|
+
var _window$sessionStorag;
|
|
78
|
+
if (window.Cypress && !((_window$sessionStorag = window.sessionStorage) !== null && _window$sessionStorag !== void 0 && _window$sessionStorag.enableStaffBarForCypress)) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
return jsxRuntime.jsx(ErrorBoundary, {
|
|
82
|
+
children: jsxRuntime.jsx(StaffBarComponent, _objectSpread({}, props))
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
exports.StaffBar = StaffBar;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
2
|
+
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
3
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
4
|
+
import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
|
|
5
|
+
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/for-each';
|
|
6
|
+
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
|
|
7
|
+
import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/object/define-properties';
|
|
8
|
+
import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
|
|
9
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
|
|
10
|
+
import { Component, lazy } from 'react';
|
|
11
|
+
import _Reflect$construct from '@babel/runtime-corejs3/core-js-stable/reflect/construct';
|
|
12
|
+
import _classCallCheck from '@babel/runtime-corejs3/helpers/esm/classCallCheck';
|
|
13
|
+
import _createClass from '@babel/runtime-corejs3/helpers/esm/createClass';
|
|
14
|
+
import _possibleConstructorReturn from '@babel/runtime-corejs3/helpers/esm/possibleConstructorReturn';
|
|
15
|
+
import _getPrototypeOf from '@babel/runtime-corejs3/helpers/esm/getPrototypeOf';
|
|
16
|
+
import _inherits from '@babel/runtime-corejs3/helpers/esm/inherits';
|
|
17
|
+
import { jsx, Fragment } from '@emotion/react/jsx-runtime';
|
|
18
|
+
|
|
19
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
20
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
|
|
21
|
+
let ErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
22
|
+
function ErrorBoundary() {
|
|
23
|
+
var _this;
|
|
24
|
+
_classCallCheck(this, ErrorBoundary);
|
|
25
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
26
|
+
args[_key] = arguments[_key];
|
|
27
|
+
}
|
|
28
|
+
_this = _callSuper(this, ErrorBoundary, [...args]);
|
|
29
|
+
_this.state = {
|
|
30
|
+
hasError: false
|
|
31
|
+
};
|
|
32
|
+
return _this;
|
|
33
|
+
}
|
|
34
|
+
_inherits(ErrorBoundary, _Component);
|
|
35
|
+
return _createClass(ErrorBoundary, [{
|
|
36
|
+
key: "render",
|
|
37
|
+
value: function render() {
|
|
38
|
+
if (this.state.hasError) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
return jsx(Fragment, {
|
|
42
|
+
children: this.props.children
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}], [{
|
|
46
|
+
key: "getDerivedStateFromError",
|
|
47
|
+
value: function getDerivedStateFromError( /* error */
|
|
48
|
+
) {
|
|
49
|
+
// Update state so the next render will show the fallback UI.
|
|
50
|
+
return {
|
|
51
|
+
hasError: true
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}]);
|
|
55
|
+
}(Component);
|
|
56
|
+
|
|
57
|
+
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
58
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
59
|
+
const StaffBarComponent = /*#__PURE__*/lazy(() => import('./staff-bar-cd682dc4.esm.js'));
|
|
60
|
+
function StaffBar(props) {
|
|
61
|
+
var _window$sessionStorag;
|
|
62
|
+
if (process.env.NODE_ENV === 'test' || window.Cypress && !((_window$sessionStorag = window.sessionStorage) !== null && _window$sessionStorag !== void 0 && _window$sessionStorag.enableStaffBarForCypress)) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return jsx(ErrorBoundary, {
|
|
66
|
+
children: jsx(StaffBarComponent, _objectSpread({}, props))
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export { StaffBar };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as StaffBar } from "./staff-bar.async.js";
|