@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.
- package/dist/commercetools-frontend-application-components.cjs.dev.js +73 -61
- package/dist/commercetools-frontend-application-components.cjs.prod.js +73 -61
- package/dist/commercetools-frontend-application-components.esm.js +72 -61
- package/dist/{custom-views-selector-7be2d0a2.cjs.dev.js → custom-views-selector-1397a063.cjs.dev.js} +8 -5
- package/dist/{custom-views-selector-96c35463.cjs.prod.js → custom-views-selector-2da0a246.cjs.prod.js} +8 -5
- package/dist/{custom-views-selector-e1672974.esm.js → custom-views-selector-375370c8.esm.js} +8 -5
- package/dist/{public-page-layout-7d1cb99f.esm.js → public-page-layout-2fea64b6.esm.js} +1 -1
- package/dist/{public-page-layout-b182d2dd.cjs.prod.js → public-page-layout-a0d532d4.cjs.prod.js} +1 -1
- package/dist/{public-page-layout-b92fb7e4.cjs.dev.js → public-page-layout-c0f5e884.cjs.dev.js} +1 -1
- package/package.json +10 -10
package/dist/{custom-views-selector-e1672974.esm.js → custom-views-selector-375370c8.esm.js}
RENAMED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
239
|
+
const locatorCode = currentCustomViewLocatorCode !== null && currentCustomViewLocatorCode !== void 0 ? currentCustomViewLocatorCode : props.customViewLocatorCode;
|
|
237
240
|
if (!locatorCode) {
|
|
238
241
|
return null;
|
|
239
242
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/application-components",
|
|
3
|
-
"version": "24.
|
|
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.
|
|
40
|
-
"@commercetools-frontend/application-config": "24.
|
|
41
|
-
"@commercetools-frontend/application-shell-connectors": "24.
|
|
42
|
-
"@commercetools-frontend/assets": "24.
|
|
43
|
-
"@commercetools-frontend/constants": "24.
|
|
44
|
-
"@commercetools-frontend/i18n": "24.
|
|
45
|
-
"@commercetools-frontend/l10n": "24.
|
|
46
|
-
"@commercetools-frontend/sentry": "24.
|
|
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.
|
|
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",
|