@commercetools-frontend/staff-bar 1.0.4 → 1.0.6
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/dist/commercetools-frontend-staff-bar.cjs.dev.js +1 -1
- package/dist/commercetools-frontend-staff-bar.cjs.prod.js +1 -1
- package/dist/commercetools-frontend-staff-bar.esm.js +1 -1
- package/dist/{staff-bar-5756fad2.esm.js → staff-bar-58f6b90f.esm.js} +12 -7
- package/dist/{staff-bar-c9712f6b.cjs.dev.js → staff-bar-61bfb340.cjs.dev.js} +14 -7
- package/dist/{staff-bar-5a56b00a.cjs.prod.js → staff-bar-64a8a160.cjs.prod.js} +14 -7
- package/package.json +6 -6
|
@@ -72,7 +72,7 @@ let ErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
|
72
72
|
|
|
73
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
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-
|
|
75
|
+
const StaffBarComponent = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./staff-bar-61bfb340.cjs.dev.js'); }));
|
|
76
76
|
function StaffBar(props) {
|
|
77
77
|
if (process.env.NODE_ENV === 'test' || window.Cypress && !window.sessionStorage?.enableStaffBarForCypress) {
|
|
78
78
|
return null;
|
|
@@ -72,7 +72,7 @@ let ErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
|
72
72
|
|
|
73
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
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-
|
|
75
|
+
const StaffBarComponent = /*#__PURE__*/react.lazy(() => Promise.resolve().then(function () { return require('./staff-bar-64a8a160.cjs.prod.js'); }));
|
|
76
76
|
function StaffBar(props) {
|
|
77
77
|
if (window.Cypress && !window.sessionStorage?.enableStaffBarForCypress) {
|
|
78
78
|
return null;
|
|
@@ -56,7 +56,7 @@ let ErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
|
56
56
|
|
|
57
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
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-
|
|
59
|
+
const StaffBarComponent = /*#__PURE__*/lazy(() => import('./staff-bar-58f6b90f.esm.js'));
|
|
60
60
|
function StaffBar(props) {
|
|
61
61
|
if (process.env.NODE_ENV === 'test' || window.Cypress && !window.sessionStorage?.enableStaffBarForCypress) {
|
|
62
62
|
return null;
|
|
@@ -23,6 +23,8 @@ import isEqual from 'lodash/isEqual';
|
|
|
23
23
|
import { useModalState, InfoDialog } from '@commercetools-frontend/application-components';
|
|
24
24
|
import { useMcQuery } from '@commercetools-frontend/application-shell';
|
|
25
25
|
import { GRAPHQL_TARGETS } from '@commercetools-frontend/constants';
|
|
26
|
+
import _someInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/some';
|
|
27
|
+
import _bindInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/bind';
|
|
26
28
|
import { useApplicationContext } from '@commercetools-frontend/application-shell-connectors';
|
|
27
29
|
import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
28
30
|
import '@babel/runtime-corejs3/core-js-stable/reflect/construct';
|
|
@@ -220,7 +222,10 @@ const defaultTeam = {
|
|
|
220
222
|
};
|
|
221
223
|
const onlyTeamsWithMembership = function (userId) {
|
|
222
224
|
let teams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
223
|
-
return teams.length ? _filterInstanceProperty(teams).call(teams, team =>
|
|
225
|
+
return teams.length ? _filterInstanceProperty(teams).call(teams, team => {
|
|
226
|
+
var _context, _context2;
|
|
227
|
+
return ((_context = team.membersRef) == null ? void 0 : _bindInstanceProperty(_context2 = Function.call).call(_context2, _someInstanceProperty(_context), _context))?.(memberRef => memberRef.id === userId);
|
|
228
|
+
}) : [];
|
|
224
229
|
};
|
|
225
230
|
const getAdminTeamId = function () {
|
|
226
231
|
let teams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
@@ -470,9 +475,9 @@ const FeatureFlagToggler = props => {
|
|
|
470
475
|
setOptions(newOptions);
|
|
471
476
|
}, [options]);
|
|
472
477
|
const handleRevert = () => {
|
|
473
|
-
_forEachInstanceProperty(originalValues).call(originalValues, (
|
|
474
|
-
let featureName =
|
|
475
|
-
toggleValue =
|
|
478
|
+
_forEachInstanceProperty(originalValues).call(originalValues, (_ref0, index) => {
|
|
479
|
+
let featureName = _ref0.featureName,
|
|
480
|
+
toggleValue = _ref0.toggleValue;
|
|
476
481
|
toggleAndGenerateNewOption({
|
|
477
482
|
featureName,
|
|
478
483
|
toggleValue: typeof toggleValue === 'boolean' ? !toggleValue : {
|
|
@@ -516,9 +521,9 @@ const FeatureFlagToggler = props => {
|
|
|
516
521
|
})]
|
|
517
522
|
}), jsx(Spacings.Stack, {
|
|
518
523
|
scale: "m",
|
|
519
|
-
children: _mapInstanceProperty(options).call(options, (
|
|
520
|
-
let featureName =
|
|
521
|
-
toggleValue =
|
|
524
|
+
children: _mapInstanceProperty(options).call(options, (_ref1, index) => {
|
|
525
|
+
let featureName = _ref1.featureName,
|
|
526
|
+
toggleValue = _ref1.toggleValue;
|
|
522
527
|
return jsx(Constraints.Horizontal, {
|
|
523
528
|
max: 'scale',
|
|
524
529
|
children: jsxs(Spacings.Stack, {
|
|
@@ -25,6 +25,8 @@ var isEqual = require('lodash/isEqual');
|
|
|
25
25
|
var applicationComponents = require('@commercetools-frontend/application-components');
|
|
26
26
|
var applicationShell = require('@commercetools-frontend/application-shell');
|
|
27
27
|
var constants = require('@commercetools-frontend/constants');
|
|
28
|
+
var _someInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/some');
|
|
29
|
+
var _bindInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/bind');
|
|
28
30
|
var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
|
|
29
31
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
30
32
|
require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
|
|
@@ -55,6 +57,8 @@ var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
|
55
57
|
var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty);
|
|
56
58
|
var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanceProperty);
|
|
57
59
|
var isEqual__default = /*#__PURE__*/_interopDefault(isEqual);
|
|
60
|
+
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
61
|
+
var _bindInstanceProperty__default = /*#__PURE__*/_interopDefault(_bindInstanceProperty);
|
|
58
62
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
59
63
|
var _URLSearchParams__default = /*#__PURE__*/_interopDefault(_URLSearchParams);
|
|
60
64
|
var sortBy__default = /*#__PURE__*/_interopDefault(sortBy);
|
|
@@ -244,7 +248,10 @@ const defaultTeam = {
|
|
|
244
248
|
};
|
|
245
249
|
const onlyTeamsWithMembership = function (userId) {
|
|
246
250
|
let teams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
247
|
-
return teams.length ? _filterInstanceProperty__default["default"](teams).call(teams, team =>
|
|
251
|
+
return teams.length ? _filterInstanceProperty__default["default"](teams).call(teams, team => {
|
|
252
|
+
var _context, _context2;
|
|
253
|
+
return ((_context = team.membersRef) == null ? void 0 : _bindInstanceProperty__default["default"](_context2 = Function.call).call(_context2, _someInstanceProperty__default["default"](_context), _context))?.(memberRef => memberRef.id === userId);
|
|
254
|
+
}) : [];
|
|
248
255
|
};
|
|
249
256
|
const getAdminTeamId = function () {
|
|
250
257
|
let teams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
@@ -494,9 +501,9 @@ const FeatureFlagToggler = props => {
|
|
|
494
501
|
setOptions(newOptions);
|
|
495
502
|
}, [options]);
|
|
496
503
|
const handleRevert = () => {
|
|
497
|
-
_forEachInstanceProperty__default["default"](originalValues).call(originalValues, (
|
|
498
|
-
let featureName =
|
|
499
|
-
toggleValue =
|
|
504
|
+
_forEachInstanceProperty__default["default"](originalValues).call(originalValues, (_ref0, index) => {
|
|
505
|
+
let featureName = _ref0.featureName,
|
|
506
|
+
toggleValue = _ref0.toggleValue;
|
|
500
507
|
toggleAndGenerateNewOption({
|
|
501
508
|
featureName,
|
|
502
509
|
toggleValue: typeof toggleValue === 'boolean' ? !toggleValue : {
|
|
@@ -540,9 +547,9 @@ const FeatureFlagToggler = props => {
|
|
|
540
547
|
})]
|
|
541
548
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
542
549
|
scale: "m",
|
|
543
|
-
children: _mapInstanceProperty__default["default"](options).call(options, (
|
|
544
|
-
let featureName =
|
|
545
|
-
toggleValue =
|
|
550
|
+
children: _mapInstanceProperty__default["default"](options).call(options, (_ref1, index) => {
|
|
551
|
+
let featureName = _ref1.featureName,
|
|
552
|
+
toggleValue = _ref1.toggleValue;
|
|
546
553
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
547
554
|
max: 'scale',
|
|
548
555
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -25,6 +25,8 @@ var isEqual = require('lodash/isEqual');
|
|
|
25
25
|
var applicationComponents = require('@commercetools-frontend/application-components');
|
|
26
26
|
var applicationShell = require('@commercetools-frontend/application-shell');
|
|
27
27
|
var constants = require('@commercetools-frontend/constants');
|
|
28
|
+
var _someInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/some');
|
|
29
|
+
var _bindInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/bind');
|
|
28
30
|
var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
|
|
29
31
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
30
32
|
require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
|
|
@@ -55,6 +57,8 @@ var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
|
55
57
|
var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty);
|
|
56
58
|
var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanceProperty);
|
|
57
59
|
var isEqual__default = /*#__PURE__*/_interopDefault(isEqual);
|
|
60
|
+
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
61
|
+
var _bindInstanceProperty__default = /*#__PURE__*/_interopDefault(_bindInstanceProperty);
|
|
58
62
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
59
63
|
var _URLSearchParams__default = /*#__PURE__*/_interopDefault(_URLSearchParams);
|
|
60
64
|
var sortBy__default = /*#__PURE__*/_interopDefault(sortBy);
|
|
@@ -239,7 +243,10 @@ const defaultTeam = {
|
|
|
239
243
|
};
|
|
240
244
|
const onlyTeamsWithMembership = function (userId) {
|
|
241
245
|
let teams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
242
|
-
return teams.length ? _filterInstanceProperty__default["default"](teams).call(teams, team =>
|
|
246
|
+
return teams.length ? _filterInstanceProperty__default["default"](teams).call(teams, team => {
|
|
247
|
+
var _context, _context2;
|
|
248
|
+
return ((_context = team.membersRef) == null ? void 0 : _bindInstanceProperty__default["default"](_context2 = Function.call).call(_context2, _someInstanceProperty__default["default"](_context), _context))?.(memberRef => memberRef.id === userId);
|
|
249
|
+
}) : [];
|
|
243
250
|
};
|
|
244
251
|
const getAdminTeamId = function () {
|
|
245
252
|
let teams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
@@ -484,9 +491,9 @@ const FeatureFlagToggler = props => {
|
|
|
484
491
|
setOptions(newOptions);
|
|
485
492
|
}, [options]);
|
|
486
493
|
const handleRevert = () => {
|
|
487
|
-
_forEachInstanceProperty__default["default"](originalValues).call(originalValues, (
|
|
488
|
-
let featureName =
|
|
489
|
-
toggleValue =
|
|
494
|
+
_forEachInstanceProperty__default["default"](originalValues).call(originalValues, (_ref0, index) => {
|
|
495
|
+
let featureName = _ref0.featureName,
|
|
496
|
+
toggleValue = _ref0.toggleValue;
|
|
490
497
|
toggleAndGenerateNewOption({
|
|
491
498
|
featureName,
|
|
492
499
|
toggleValue: typeof toggleValue === 'boolean' ? !toggleValue : {
|
|
@@ -530,9 +537,9 @@ const FeatureFlagToggler = props => {
|
|
|
530
537
|
})]
|
|
531
538
|
}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
532
539
|
scale: "m",
|
|
533
|
-
children: _mapInstanceProperty__default["default"](options).call(options, (
|
|
534
|
-
let featureName =
|
|
535
|
-
toggleValue =
|
|
540
|
+
children: _mapInstanceProperty__default["default"](options).call(options, (_ref1, index) => {
|
|
541
|
+
let featureName = _ref1.featureName,
|
|
542
|
+
toggleValue = _ref1.toggleValue;
|
|
536
543
|
return jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
537
544
|
max: 'scale',
|
|
538
545
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/staff-bar",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Toolbar that makes testing inside Merchant Center easier",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/commercetools-frontend-staff-bar.cjs.js",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"@apollo/client": "3.7.10",
|
|
17
17
|
"@babel/core": "^7.22.11",
|
|
18
18
|
"@babel/runtime-corejs3": "^7.21.0",
|
|
19
|
-
"@commercetools-frontend/application-components": "npm:@commercetools-frontend/application-components@^23.
|
|
20
|
-
"@commercetools-frontend/application-shell": "npm:@commercetools-frontend/application-shell@^23.
|
|
21
|
-
"@commercetools-frontend/ui-kit": "npm:@commercetools-frontend/ui-kit@^19.
|
|
19
|
+
"@commercetools-frontend/application-components": "npm:@commercetools-frontend/application-components@^23.3.0",
|
|
20
|
+
"@commercetools-frontend/application-shell": "npm:@commercetools-frontend/application-shell@^23.3.0",
|
|
21
|
+
"@commercetools-frontend/ui-kit": "npm:@commercetools-frontend/ui-kit@^19.25.1",
|
|
22
22
|
"@flopflip/types": "14.0.1",
|
|
23
23
|
"lodash": "4.17.21",
|
|
24
24
|
"prop-types": "15.8.1",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"typescript": "5.2.2"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@commercetools-frontend/application-shell-connectors": "23.
|
|
31
|
-
"@commercetools-frontend/constants": "23.
|
|
30
|
+
"@commercetools-frontend/application-shell-connectors": "23.3.0",
|
|
31
|
+
"@commercetools-frontend/constants": "23.3.0",
|
|
32
32
|
"@emotion/react": "11.14.0",
|
|
33
33
|
"@manypkg/find-root": "2.2.3",
|
|
34
34
|
"@types/react": "17.0.83",
|