@commercetools-frontend/application-components 25.0.0 → 25.2.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.
@@ -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.dev.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
  };
@@ -234,7 +234,7 @@ function CustomViewSelector(props) {
234
234
  const isNotLastItem = index !== customViews.length - 1;
235
235
  return jsxRuntime.jsxs(react$1.Fragment, {
236
236
  children: [jsxRuntime.jsx(CustomViewSelectorItem, {
237
- selected: (selectedCustomView === null || selectedCustomView === void 0 ? void 0 : selectedCustomView.id) === customView.id,
237
+ selected: selectedCustomView?.id === customView.id,
238
238
  onClick: () => {
239
239
  setSelectedCustomView(customView);
240
240
  },
@@ -257,7 +257,7 @@ CustomViewSelector.displayName = 'CustomViewSelector';
257
257
  const CustomViewSelectorOrNothing = props => {
258
258
  const _useCustomViewLocator = useCustomViewLocatorSelector(props.customViewLocatorCodes),
259
259
  currentCustomViewLocatorCode = _useCustomViewLocator.currentCustomViewLocatorCode;
260
- const locatorCode = currentCustomViewLocatorCode !== null && currentCustomViewLocatorCode !== void 0 ? currentCustomViewLocatorCode : props.customViewLocatorCode;
260
+ const locatorCode = currentCustomViewLocatorCode ?? props.customViewLocatorCode;
261
261
  if (!locatorCode) {
262
262
  return null;
263
263
  }
@@ -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
  }
@@ -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": "25.0.0",
3
+ "version": "25.2.0",
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": {
@@ -36,14 +36,14 @@
36
36
  "dependencies": {
37
37
  "@babel/runtime": "^7.22.15",
38
38
  "@babel/runtime-corejs3": "^7.22.15",
39
- "@commercetools-frontend/actions-global": "25.0.0",
40
- "@commercetools-frontend/application-config": "25.0.0",
41
- "@commercetools-frontend/application-shell-connectors": "25.0.0",
42
- "@commercetools-frontend/assets": "25.0.0",
43
- "@commercetools-frontend/constants": "25.0.0",
44
- "@commercetools-frontend/i18n": "25.0.0",
45
- "@commercetools-frontend/l10n": "25.0.0",
46
- "@commercetools-frontend/sentry": "25.0.0",
39
+ "@commercetools-frontend/actions-global": "25.2.0",
40
+ "@commercetools-frontend/application-config": "25.2.0",
41
+ "@commercetools-frontend/application-shell-connectors": "25.2.0",
42
+ "@commercetools-frontend/assets": "25.2.0",
43
+ "@commercetools-frontend/constants": "25.2.0",
44
+ "@commercetools-frontend/i18n": "25.2.0",
45
+ "@commercetools-frontend/l10n": "25.2.0",
46
+ "@commercetools-frontend/sentry": "25.2.0",
47
47
  "@commercetools-uikit/accessible-button": "^20.3.0",
48
48
  "@commercetools-uikit/card": "^20.3.0",
49
49
  "@commercetools-uikit/constraints": "^20.3.0",
@@ -74,7 +74,7 @@
74
74
  "@types/react-dom": "^19.0.2",
75
75
  "@types/react-router-dom": "^5.3.3",
76
76
  "history": "4.10.1",
77
- "lodash": "4.17.21",
77
+ "lodash": "4.17.23",
78
78
  "prop-types": "15.8.1",
79
79
  "raf-schd": "^4.0.3"
80
80
  },