@commercetools-frontend/application-components 27.9.1 → 27.9.2

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.
@@ -26,13 +26,13 @@ var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entr
26
26
  var reactRouterDom = require('react-router-dom');
27
27
  var dist_commercetoolsFrontendApplicationComponents = require('./commercetools-frontend-application-components.cjs.prod.js');
28
28
  var reactIntl = require('react-intl');
29
+ var _bindInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/bind');
29
30
  var reactBroadcast = require('@flopflip/react-broadcast');
30
31
  var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
31
32
  var constants = require('@commercetools-frontend/constants');
32
33
  var jsxRuntime = require('@emotion/react/jsx-runtime');
33
34
  require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
34
35
  require('@commercetools-uikit/utils');
35
- require('@babel/runtime-corejs3/core-js-stable/instance/concat');
36
36
  require('@radix-ui/react-dialog');
37
37
  require('@commercetools-uikit/card');
38
38
  require('@commercetools-uikit/secondary-icon-button');
@@ -44,7 +44,6 @@ require('lodash/omitBy');
44
44
  require('@babel/runtime-corejs3/core-js-stable/promise');
45
45
  require('@babel/runtime-corejs3/core-js-stable/set-timeout');
46
46
  require('@commercetools-uikit/flat-button');
47
- require('@babel/runtime-corejs3/helpers/taggedTemplateLiteral');
48
47
  require('@commercetools-uikit/icon-button');
49
48
  require('@commercetools-frontend/assets/images/page-not-found.svg');
50
49
  require('@commercetools-frontend/assets/images/doors-closed.svg');
@@ -72,6 +71,7 @@ var Spacings__default = /*#__PURE__*/_interopDefault(Spacings);
72
71
  var Text__default = /*#__PURE__*/_interopDefault(Text);
73
72
  var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
74
73
  var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
74
+ var _bindInstanceProperty__default = /*#__PURE__*/_interopDefault(_bindInstanceProperty);
75
75
 
76
76
  const pathWithoutSearch = path => typeof path === 'string' ? path.split('?')[0] : path.pathname;
77
77
  const useCustomViewLocatorSelector = function () {
@@ -94,7 +94,7 @@ const useCustomViewLocatorSelector = function () {
94
94
  });
95
95
  });
96
96
  return {
97
- currentCustomViewLocatorCode: customViewLocator === null || customViewLocator === void 0 ? void 0 : customViewLocator[0]
97
+ currentCustomViewLocatorCode: customViewLocator?.[0]
98
98
  };
99
99
  };
100
100
 
@@ -107,12 +107,12 @@ var messages = reactIntl.defineMessages({
107
107
 
108
108
  var FetchCustomViewsQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchCustomViewsByLocator" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "customViewLocatorCode" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "allCustomViewsInstallationsByLocator" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "locator" }, value: { kind: "Variable", name: { kind: "Name", value: "customViewLocatorCode" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "customView" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "defaultLabel" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "url" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "typeSettings" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "size" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "locators" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "permissions" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "oAuthScopes" }, arguments: [], directives: [] }] } }] } }] } }] } }], loc: { start: 0, end: 405, source: { body: "query FetchCustomViewsByLocator($customViewLocatorCode: String!) {\n allCustomViewsInstallationsByLocator(locator: $customViewLocatorCode) {\n id\n customView {\n id\n defaultLabel\n labelAllLocales {\n locale\n value\n }\n url\n type\n typeSettings {\n size\n }\n locators\n permissions {\n name\n oAuthScopes\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
109
109
  const useCustomViewsConnector = _ref => {
110
- var _enableCustomViews$va, _data$allCustomViewsI;
110
+ var _context, _context2;
111
111
  let customViewLocatorCode = _ref.customViewLocatorCode;
112
112
  const enableCustomViews = reactBroadcast.useFlagVariation(constants.featureFlags.CUSTOM_VIEWS);
113
113
  const areCustomViewsEnabled =
114
114
  // @ts-ignore In case it's coming from the MC API, it's an object { value: boolean }.
115
- ((_enableCustomViews$va = enableCustomViews === null || enableCustomViews === void 0 ? void 0 : enableCustomViews.value) !== null && _enableCustomViews$va !== void 0 ? _enableCustomViews$va : enableCustomViews) && process.env.DISABLE_CUSTOM_VIEWS_FEATURE !== 'true';
115
+ (enableCustomViews?.value ?? enableCustomViews) && process.env.DISABLE_CUSTOM_VIEWS_FEATURE !== 'true';
116
116
  const _useMcQuery = applicationShellConnectors.useMcQuery(FetchCustomViewsQuery, {
117
117
  variables: {
118
118
  customViewLocatorCode
@@ -126,7 +126,7 @@ const useCustomViewsConnector = _ref => {
126
126
  error = _useMcQuery.error,
127
127
  loading = _useMcQuery.loading;
128
128
  return {
129
- customViews: (data === null || data === void 0 || (_data$allCustomViewsI = data.allCustomViewsInstallationsByLocator) === null || _data$allCustomViewsI === void 0 ? void 0 : _mapInstanceProperty__default["default"](_data$allCustomViewsI).call(_data$allCustomViewsI, installation => installation.customView)) || [],
129
+ customViews: ((_context = data?.allCustomViewsInstallationsByLocator) == null ? void 0 : _bindInstanceProperty__default["default"](_context2 = Function.call).call(_context2, _mapInstanceProperty__default["default"](_context), _context))?.(installation => installation.customView) || [],
130
130
  error,
131
131
  loading
132
132
  };
@@ -213,7 +213,7 @@ function CustomViewSelector(props) {
213
213
  const isNotLastItem = index !== customViews.length - 1;
214
214
  return jsxRuntime.jsxs(react$1.Fragment, {
215
215
  children: [jsxRuntime.jsx(CustomViewSelectorItem, {
216
- selected: (selectedCustomView === null || selectedCustomView === void 0 ? void 0 : selectedCustomView.id) === customView.id,
216
+ selected: selectedCustomView?.id === customView.id,
217
217
  onClick: () => {
218
218
  setSelectedCustomView(customView);
219
219
  },
@@ -236,7 +236,7 @@ CustomViewSelector.displayName = 'CustomViewSelector';
236
236
  const CustomViewSelectorOrNothing = props => {
237
237
  const _useCustomViewLocator = useCustomViewLocatorSelector(props.customViewLocatorCodes),
238
238
  currentCustomViewLocatorCode = _useCustomViewLocator.currentCustomViewLocatorCode;
239
- const locatorCode = currentCustomViewLocatorCode !== null && currentCustomViewLocatorCode !== void 0 ? currentCustomViewLocatorCode : props.customViewLocatorCode;
239
+ const locatorCode = currentCustomViewLocatorCode ?? props.customViewLocatorCode;
240
240
  if (!locatorCode) {
241
241
  return null;
242
242
  }
@@ -24,13 +24,13 @@ import _Object$entries from '@babel/runtime-corejs3/core-js-stable/object/entrie
24
24
  import { useLocation, matchPath } from 'react-router-dom';
25
25
  import { CustomViewLoader } from './commercetools-frontend-application-components.esm.js';
26
26
  import { defineMessages } from 'react-intl';
27
+ import _bindInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/bind';
27
28
  import { useFlagVariation } from '@flopflip/react-broadcast';
28
29
  import { useMcQuery } from '@commercetools-frontend/application-shell-connectors';
29
30
  import { featureFlags, GRAPHQL_TARGETS } from '@commercetools-frontend/constants';
30
31
  import { jsx, jsxs } from '@emotion/react/jsx-runtime';
31
32
  import '@babel/runtime-corejs3/helpers/objectWithoutProperties';
32
33
  import '@commercetools-uikit/utils';
33
- import '@babel/runtime-corejs3/core-js-stable/instance/concat';
34
34
  import '@radix-ui/react-dialog';
35
35
  import '@commercetools-uikit/card';
36
36
  import '@commercetools-uikit/secondary-icon-button';
@@ -42,7 +42,6 @@ import 'lodash/omitBy';
42
42
  import '@babel/runtime-corejs3/core-js-stable/promise';
43
43
  import '@babel/runtime-corejs3/core-js-stable/set-timeout';
44
44
  import '@commercetools-uikit/flat-button';
45
- import '@babel/runtime-corejs3/helpers/taggedTemplateLiteral';
46
45
  import '@commercetools-uikit/icon-button';
47
46
  import '@commercetools-frontend/assets/images/page-not-found.svg';
48
47
  import '@commercetools-frontend/assets/images/doors-closed.svg';
@@ -73,7 +72,7 @@ const useCustomViewLocatorSelector = function () {
73
72
  });
74
73
  });
75
74
  return {
76
- currentCustomViewLocatorCode: customViewLocator === null || customViewLocator === void 0 ? void 0 : customViewLocator[0]
75
+ currentCustomViewLocatorCode: customViewLocator?.[0]
77
76
  };
78
77
  };
79
78
 
@@ -86,12 +85,12 @@ var messages = defineMessages({
86
85
 
87
86
  var FetchCustomViewsQuery = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchCustomViewsByLocator" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "customViewLocatorCode" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }, directives: [] }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "allCustomViewsInstallationsByLocator" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "locator" }, value: { kind: "Variable", name: { kind: "Name", value: "customViewLocatorCode" } } }], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "customView" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "defaultLabel" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "url" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "typeSettings" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "size" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "locators" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "permissions" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "oAuthScopes" }, arguments: [], directives: [] }] } }] } }] } }] } }], loc: { start: 0, end: 405, source: { body: "query FetchCustomViewsByLocator($customViewLocatorCode: String!) {\n allCustomViewsInstallationsByLocator(locator: $customViewLocatorCode) {\n id\n customView {\n id\n defaultLabel\n labelAllLocales {\n locale\n value\n }\n url\n type\n typeSettings {\n size\n }\n locators\n permissions {\n name\n oAuthScopes\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
88
87
  const useCustomViewsConnector = _ref => {
89
- var _enableCustomViews$va, _data$allCustomViewsI;
88
+ var _context, _context2;
90
89
  let customViewLocatorCode = _ref.customViewLocatorCode;
91
90
  const enableCustomViews = useFlagVariation(featureFlags.CUSTOM_VIEWS);
92
91
  const areCustomViewsEnabled =
93
92
  // @ts-ignore In case it's coming from the MC API, it's an object { value: boolean }.
94
- ((_enableCustomViews$va = enableCustomViews === null || enableCustomViews === void 0 ? void 0 : enableCustomViews.value) !== null && _enableCustomViews$va !== void 0 ? _enableCustomViews$va : enableCustomViews) && process.env.DISABLE_CUSTOM_VIEWS_FEATURE !== 'true';
93
+ (enableCustomViews?.value ?? enableCustomViews) && process.env.DISABLE_CUSTOM_VIEWS_FEATURE !== 'true';
95
94
  const _useMcQuery = useMcQuery(FetchCustomViewsQuery, {
96
95
  variables: {
97
96
  customViewLocatorCode
@@ -105,7 +104,7 @@ const useCustomViewsConnector = _ref => {
105
104
  error = _useMcQuery.error,
106
105
  loading = _useMcQuery.loading;
107
106
  return {
108
- customViews: (data === null || data === void 0 || (_data$allCustomViewsI = data.allCustomViewsInstallationsByLocator) === null || _data$allCustomViewsI === void 0 ? void 0 : _mapInstanceProperty(_data$allCustomViewsI).call(_data$allCustomViewsI, installation => installation.customView)) || [],
107
+ customViews: ((_context = data?.allCustomViewsInstallationsByLocator) == null ? void 0 : _bindInstanceProperty(_context2 = Function.call).call(_context2, _mapInstanceProperty(_context), _context))?.(installation => installation.customView) || [],
109
108
  error,
110
109
  loading
111
110
  };
@@ -213,7 +212,7 @@ function CustomViewSelector(props) {
213
212
  const isNotLastItem = index !== customViews.length - 1;
214
213
  return jsxs(Fragment, {
215
214
  children: [jsx(CustomViewSelectorItem, {
216
- selected: (selectedCustomView === null || selectedCustomView === void 0 ? void 0 : selectedCustomView.id) === customView.id,
215
+ selected: selectedCustomView?.id === customView.id,
217
216
  onClick: () => {
218
217
  setSelectedCustomView(customView);
219
218
  },
@@ -236,7 +235,7 @@ CustomViewSelector.displayName = 'CustomViewSelector';
236
235
  const CustomViewSelectorOrNothing = props => {
237
236
  const _useCustomViewLocator = useCustomViewLocatorSelector(props.customViewLocatorCodes),
238
237
  currentCustomViewLocatorCode = _useCustomViewLocator.currentCustomViewLocatorCode;
239
- const locatorCode = currentCustomViewLocatorCode !== null && currentCustomViewLocatorCode !== void 0 ? currentCustomViewLocatorCode : props.customViewLocatorCode;
238
+ const locatorCode = currentCustomViewLocatorCode ?? props.customViewLocatorCode;
240
239
  if (!locatorCode) {
241
240
  return null;
242
241
  }
@@ -81,7 +81,7 @@ const PublicPageLayout = _ref2 => {
81
81
  children: props.legalMessage
82
82
  }), jsx(Text.Detail, {
83
83
  tone: "secondary",
84
- children: "".concat(year, " \xA9 commercetools")
84
+ children: `${year} © commercetools`
85
85
  })]
86
86
  })
87
87
  })]
@@ -81,7 +81,7 @@ const PublicPageLayout = _ref2 => {
81
81
  children: props.legalMessage
82
82
  }), jsxRuntime.jsx(Text__default["default"].Detail, {
83
83
  tone: "secondary",
84
- children: "".concat(year, " \xA9 commercetools")
84
+ children: `${year} © commercetools`
85
85
  })]
86
86
  })
87
87
  })]
@@ -90,7 +90,7 @@ const PublicPageLayout = _ref2 => {
90
90
  children: props.legalMessage
91
91
  }), jsxRuntime.jsx(Text__default["default"].Detail, {
92
92
  tone: "secondary",
93
- children: "".concat(year, " \xA9 commercetools")
93
+ children: `${year} © commercetools`
94
94
  })]
95
95
  })
96
96
  })]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/application-components",
3
- "version": "27.9.1",
3
+ "version": "27.9.2",
4
4
  "description": "Generic components for building Merchant Center applications",
5
5
  "bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
6
6
  "repository": {
@@ -69,14 +69,14 @@
69
69
  "lodash": "4.18.1",
70
70
  "prop-types": "15.8.1",
71
71
  "raf-schd": "^4.0.3",
72
- "@commercetools-frontend/actions-global": "^27.9.1",
73
- "@commercetools-frontend/application-config": "^27.9.1",
74
- "@commercetools-frontend/application-shell-connectors": "^27.9.1",
75
- "@commercetools-frontend/assets": "^27.9.1",
76
- "@commercetools-frontend/constants": "^27.9.1",
77
- "@commercetools-frontend/i18n": "^27.9.1",
78
- "@commercetools-frontend/l10n": "^27.9.1",
79
- "@commercetools-frontend/sentry": "^27.9.1"
72
+ "@commercetools-frontend/actions-global": "^27.9.2",
73
+ "@commercetools-frontend/application-config": "^27.9.2",
74
+ "@commercetools-frontend/application-shell-connectors": "^27.9.2",
75
+ "@commercetools-frontend/assets": "^27.9.2",
76
+ "@commercetools-frontend/constants": "^27.9.2",
77
+ "@commercetools-frontend/i18n": "^27.9.2",
78
+ "@commercetools-frontend/l10n": "^27.9.2",
79
+ "@commercetools-frontend/sentry": "^27.9.2"
80
80
  },
81
81
  "devDependencies": {
82
82
  "@apollo/client": "3.14.1",