@commercetools-frontend/application-components 24.10.0 → 24.12.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.
@@ -30,6 +30,7 @@ import { featureFlags, GRAPHQL_TARGETS } from '@commercetools-frontend/constants
30
30
  import { jsx, jsxs } from '@emotion/react/jsx-runtime';
31
31
  import '@babel/runtime-corejs3/helpers/objectWithoutProperties';
32
32
  import '@commercetools-uikit/utils';
33
+ import '@babel/runtime-corejs3/core-js-stable/instance/concat';
33
34
  import '@radix-ui/react-dialog';
34
35
  import '@commercetools-uikit/card';
35
36
  import '@commercetools-uikit/secondary-icon-button';
@@ -41,6 +42,7 @@ import 'lodash/omitBy';
41
42
  import '@babel/runtime-corejs3/core-js-stable/promise';
42
43
  import '@babel/runtime-corejs3/core-js-stable/set-timeout';
43
44
  import '@commercetools-uikit/flat-button';
45
+ import '@babel/runtime-corejs3/helpers/taggedTemplateLiteral';
44
46
  import '@commercetools-uikit/icon-button';
45
47
  import '@commercetools-frontend/assets/images/page-not-found.svg';
46
48
  import '@commercetools-frontend/assets/images/doors-closed.svg';
@@ -71,7 +73,7 @@ const useCustomViewLocatorSelector = function () {
71
73
  });
72
74
  });
73
75
  return {
74
- currentCustomViewLocatorCode: customViewLocator?.[0]
76
+ currentCustomViewLocatorCode: customViewLocator === null || customViewLocator === void 0 ? void 0 : customViewLocator[0]
75
77
  };
76
78
  };
77
79
 
@@ -84,11 +86,12 @@ var messages = defineMessages({
84
86
 
85
87
  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 } } } };
86
88
  const useCustomViewsConnector = _ref => {
89
+ var _enableCustomViews$va, _data$allCustomViewsI;
87
90
  let customViewLocatorCode = _ref.customViewLocatorCode;
88
91
  const enableCustomViews = useFlagVariation(featureFlags.CUSTOM_VIEWS);
89
92
  const areCustomViewsEnabled =
90
93
  // @ts-ignore In case it's coming from the MC API, it's an object { value: boolean }.
91
- (enableCustomViews?.value ?? enableCustomViews) && process.env.DISABLE_CUSTOM_VIEWS_FEATURE !== 'true';
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';
92
95
  const _useMcQuery = useMcQuery(FetchCustomViewsQuery, {
93
96
  variables: {
94
97
  customViewLocatorCode
@@ -102,7 +105,7 @@ const useCustomViewsConnector = _ref => {
102
105
  error = _useMcQuery.error,
103
106
  loading = _useMcQuery.loading;
104
107
  return {
105
- customViews: data?.allCustomViewsInstallationsByLocator?.map(installation => installation.customView) || [],
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)) || [],
106
109
  error,
107
110
  loading
108
111
  };
@@ -210,7 +213,7 @@ function CustomViewSelector(props) {
210
213
  const isNotLastItem = index !== customViews.length - 1;
211
214
  return jsxs(Fragment, {
212
215
  children: [jsx(CustomViewSelectorItem, {
213
- selected: selectedCustomView?.id === customView.id,
216
+ selected: (selectedCustomView === null || selectedCustomView === void 0 ? void 0 : selectedCustomView.id) === customView.id,
214
217
  onClick: () => {
215
218
  setSelectedCustomView(customView);
216
219
  },
@@ -233,7 +236,7 @@ CustomViewSelector.displayName = 'CustomViewSelector';
233
236
  const CustomViewSelectorOrNothing = props => {
234
237
  const _useCustomViewLocator = useCustomViewLocatorSelector(props.customViewLocatorCodes),
235
238
  currentCustomViewLocatorCode = _useCustomViewLocator.currentCustomViewLocatorCode;
236
- const locatorCode = currentCustomViewLocatorCode ?? props.customViewLocatorCode;
239
+ const locatorCode = currentCustomViewLocatorCode !== null && currentCustomViewLocatorCode !== void 0 ? currentCustomViewLocatorCode : props.customViewLocatorCode;
237
240
  if (!locatorCode) {
238
241
  return null;
239
242
  }
@@ -81,7 +81,7 @@ const PublicPageLayout = _ref2 => {
81
81
  children: props.legalMessage
82
82
  }), jsx(Text.Detail, {
83
83
  tone: "secondary",
84
- children: `${year} © commercetools`
84
+ children: "".concat(year, " \xA9 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: `${year} © commercetools`
84
+ children: "".concat(year, " \xA9 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: `${year} © commercetools`
93
+ children: "".concat(year, " \xA9 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": "24.10.0",
3
+ "version": "24.12.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": "24.10.0",
40
- "@commercetools-frontend/application-config": "24.10.0",
41
- "@commercetools-frontend/application-shell-connectors": "24.10.0",
42
- "@commercetools-frontend/assets": "24.10.0",
43
- "@commercetools-frontend/constants": "24.10.0",
44
- "@commercetools-frontend/i18n": "24.10.0",
45
- "@commercetools-frontend/l10n": "24.10.0",
46
- "@commercetools-frontend/sentry": "24.10.0",
39
+ "@commercetools-frontend/actions-global": "24.12.0",
40
+ "@commercetools-frontend/application-config": "24.12.0",
41
+ "@commercetools-frontend/application-shell-connectors": "24.12.0",
42
+ "@commercetools-frontend/assets": "24.12.0",
43
+ "@commercetools-frontend/constants": "24.12.0",
44
+ "@commercetools-frontend/i18n": "24.12.0",
45
+ "@commercetools-frontend/l10n": "24.12.0",
46
+ "@commercetools-frontend/sentry": "24.12.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",
@@ -63,7 +63,7 @@
63
63
  "@commercetools-uikit/utils": "^20.3.0",
64
64
  "@emotion/react": "^11.14.0",
65
65
  "@emotion/styled": "^11.14.0",
66
- "@flopflip/react-broadcast": "15.1.3",
66
+ "@flopflip/react-broadcast": "15.1.5",
67
67
  "@radix-ui/react-dialog": "1.1.14",
68
68
  "@react-hook/latest": "1.0.3",
69
69
  "@react-hook/resize-observer": "1.2.6",