@commercetools-frontend/application-shell-connectors 22.7.1 → 22.8.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-shell-connectors.cjs.dev.js +50 -12
- package/dist/commercetools-frontend-application-shell-connectors.cjs.prod.js +46 -12
- package/dist/commercetools-frontend-application-shell-connectors.esm.js +49 -13
- package/dist/declarations/src/components/application-context/application-context.d.ts +4 -24
- package/dist/declarations/src/components/custom-view-context/custom-view-context.d.ts +17 -0
- package/dist/declarations/src/components/custom-view-context/index.d.ts +4 -0
- package/dist/declarations/src/export-types.d.ts +3 -0
- package/dist/declarations/src/index.d.ts +1 -0
- package/dist/declarations/src/types/generated/settings.d.ts +78 -2
- package/package.json +9 -9
- package/test-utils/dist/commercetools-frontend-application-shell-connectors-test-utils.cjs.dev.js +2 -2
- package/test-utils/dist/commercetools-frontend-application-shell-connectors-test-utils.cjs.prod.js +2 -2
- package/test-utils/dist/commercetools-frontend-application-shell-connectors-test-utils.esm.js +2 -2
|
@@ -46,7 +46,7 @@ var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInsta
|
|
|
46
46
|
var warning__default = /*#__PURE__*/_interopDefault(warning);
|
|
47
47
|
|
|
48
48
|
// NOTE: This string will be replaced on build time with the package version.
|
|
49
|
-
var version = "22.
|
|
49
|
+
var version = "22.8.0";
|
|
50
50
|
|
|
51
51
|
const mcHostnameRegex = /^mc(-(\d){4,})?\.(.*)$/;
|
|
52
52
|
const mcPreviewHostnameRegex = /^.*\.mc-preview\.(.*)$/;
|
|
@@ -91,8 +91,8 @@ const getDisplayName = Component => {
|
|
|
91
91
|
return Component.displayName || Component.name || 'Component';
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
-
function ownKeys$2(
|
|
95
|
-
function _objectSpread$2(
|
|
94
|
+
function ownKeys$2(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; }
|
|
95
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$2(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$2(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
96
96
|
// Menu visibilities
|
|
97
97
|
|
|
98
98
|
// Permissions
|
|
@@ -233,9 +233,9 @@ const normalizeAllAppliedDataFences = allAppliedDataFences => {
|
|
|
233
233
|
return null;
|
|
234
234
|
};
|
|
235
235
|
|
|
236
|
-
function ownKeys$1(
|
|
237
|
-
function _objectSpread$1(
|
|
238
|
-
const Context$
|
|
236
|
+
function ownKeys$1(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; }
|
|
237
|
+
function _objectSpread$1(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$1(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$1(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
238
|
+
const Context$2 = /*#__PURE__*/react.createContext({});
|
|
239
239
|
const defaultTimeZone = moment__default["default"].tz.guess() || 'Etc/UTC';
|
|
240
240
|
|
|
241
241
|
// Expose only certain fields as some of them are only meant to
|
|
@@ -306,7 +306,7 @@ const createApplicationContext = (environment, user, project, projectDataLocale)
|
|
|
306
306
|
dataFences: normalizeAllAppliedDataFences(project === null || project === void 0 ? void 0 : project.allAppliedDataFences),
|
|
307
307
|
dataLocale: projectDataLocale || null
|
|
308
308
|
});
|
|
309
|
-
const ApplicationContextProvider = props => jsxRuntime.jsx(Context$
|
|
309
|
+
const ApplicationContextProvider = props => jsxRuntime.jsx(Context$2.Provider, {
|
|
310
310
|
value: createApplicationContext(props.environment, props.user, props.project, props.projectDataLocale),
|
|
311
311
|
children: props.children
|
|
312
312
|
});
|
|
@@ -315,7 +315,7 @@ ApplicationContextProvider.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
315
315
|
children: _pt__default["default"].node.isRequired
|
|
316
316
|
} : {};
|
|
317
317
|
ApplicationContextProvider.displayName = 'ApplicationContextProvider';
|
|
318
|
-
const ApplicationContext = props => jsxRuntime.jsx(Context$
|
|
318
|
+
const ApplicationContext = props => jsxRuntime.jsx(Context$2.Consumer, {
|
|
319
319
|
children: context => {
|
|
320
320
|
// Because of the way the ApplicationShell configures the Context.Provider,
|
|
321
321
|
// we ensure that, when we read from the context, we always get actual
|
|
@@ -349,7 +349,7 @@ function withApplicationContext(mapApplicationContextToProps) {
|
|
|
349
349
|
// Then implement the function. Typescript will pick the appropriate signature
|
|
350
350
|
// based on the function arguments.
|
|
351
351
|
function useApplicationContextHook(selector) {
|
|
352
|
-
const context = react.useContext(Context$
|
|
352
|
+
const context = react.useContext(Context$2);
|
|
353
353
|
// Because of the way the ApplicationShell configures the Context.Provider,
|
|
354
354
|
// we ensure that, when we read from the context, we always get actual
|
|
355
355
|
// context object and not the initial value.
|
|
@@ -363,8 +363,44 @@ function useApplicationContextHook(selector) {
|
|
|
363
363
|
// See related issue: https://github.com/babel/babel/issues/8361
|
|
364
364
|
const useApplicationContext = useApplicationContextHook;
|
|
365
365
|
|
|
366
|
-
|
|
367
|
-
|
|
366
|
+
const Context$1 = /*#__PURE__*/react.createContext({});
|
|
367
|
+
const CustomViewContextProvider = props => {
|
|
368
|
+
const contextValue = react.useMemo(() => ({
|
|
369
|
+
hostUrl: props.hostUrl,
|
|
370
|
+
config: props.customViewConfig
|
|
371
|
+
}), [props.hostUrl, props.customViewConfig]);
|
|
372
|
+
return jsxRuntime.jsx(Context$1.Provider, {
|
|
373
|
+
value: contextValue,
|
|
374
|
+
children: props.children
|
|
375
|
+
});
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
// Use function overloading to declare two possible signatures with two
|
|
379
|
+
// distict return types, based on the selector function argument.
|
|
380
|
+
CustomViewContextProvider.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
381
|
+
hostUrl: _pt__default["default"].string.isRequired,
|
|
382
|
+
customViewConfig: _pt__default["default"].any.isRequired,
|
|
383
|
+
children: _pt__default["default"].node.isRequired
|
|
384
|
+
} : {};
|
|
385
|
+
// Then implement the function. Typescript will pick the appropriate signature
|
|
386
|
+
// based on the function arguments.
|
|
387
|
+
function useCustomViewContextHook(selector) {
|
|
388
|
+
const context = react.useContext(Context$1);
|
|
389
|
+
// Because of the way the CustomViewShell configures the Context.Provider,
|
|
390
|
+
// we ensure that, when we read from the context, we always get actual
|
|
391
|
+
// context object and not the initial value.
|
|
392
|
+
// Therefore, we can safely cast the value to be out `TCustomViewContext` type.
|
|
393
|
+
const customViewContext = context;
|
|
394
|
+
return selector ? selector(customViewContext) : customViewContext;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// This is a workaround to trick babel/rollup to correctly export the function.
|
|
398
|
+
// Most likely the problem arises with the use of overloading.
|
|
399
|
+
// See related issue: https://github.com/babel/babel/issues/8361
|
|
400
|
+
const useCustomViewContext = useCustomViewContextHook;
|
|
401
|
+
|
|
402
|
+
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; }
|
|
403
|
+
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; }
|
|
368
404
|
var FetchProjectExtensionImageRegex = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProjectExtensionImageRegex" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "projectExtension" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "imageRegex" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "thumb" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "ImageRegex" }, directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "small" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "ImageRegex" }, directives: [] }] } }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "ImageRegex" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ImageRegexOptions" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "flag" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "search" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "replace" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 256, source: { body: "query FetchProjectExtensionImageRegex {\n projectExtension {\n id\n imageRegex {\n thumb {\n ...ImageRegex\n }\n small {\n ...ImageRegex\n }\n }\n }\n}\nfragment ImageRegex on ImageRegexOptions {\n flag\n search\n replace\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
369
405
|
const useWarning = (condition, message) => {
|
|
370
406
|
react.useEffect(() => {
|
|
@@ -436,7 +472,8 @@ function withProjectExtensionImageRegex() {
|
|
|
436
472
|
|
|
437
473
|
exports.ApplicationContext = ApplicationContext;
|
|
438
474
|
exports.ApplicationContextProvider = ApplicationContextProvider;
|
|
439
|
-
exports.Context = Context$
|
|
475
|
+
exports.Context = Context$2;
|
|
476
|
+
exports.CustomViewContextProvider = CustomViewContextProvider;
|
|
440
477
|
exports.GetProjectExtensionImageRegex = GetProjectExtensionImageRegex;
|
|
441
478
|
exports.ProjectExtensionProviderForImageRegex = ProjectExtensionProviderForImageRegex;
|
|
442
479
|
exports.getMcApiUrl = getMcApiUrl;
|
|
@@ -445,6 +482,7 @@ exports.normalizeAllAppliedDataFences = normalizeAllAppliedDataFences;
|
|
|
445
482
|
exports.normalizeAllAppliedMenuVisibilities = normalizeAllAppliedMenuVisibilities;
|
|
446
483
|
exports.normalizeAllAppliedPermissions = normalizeAllAppliedPermissions;
|
|
447
484
|
exports.useApplicationContext = useApplicationContext;
|
|
485
|
+
exports.useCustomViewContext = useCustomViewContext;
|
|
448
486
|
exports.useProjectExtensionImageRegex = useProjectExtensionImageRegex;
|
|
449
487
|
exports.version = version;
|
|
450
488
|
exports.withApplicationContext = withApplicationContext;
|
|
@@ -44,7 +44,7 @@ var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
|
|
|
44
44
|
var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInstanceProperty);
|
|
45
45
|
|
|
46
46
|
// NOTE: This string will be replaced on build time with the package version.
|
|
47
|
-
var version = "22.
|
|
47
|
+
var version = "22.8.0";
|
|
48
48
|
|
|
49
49
|
const mcHostnameRegex = /^mc(-(\d){4,})?\.(.*)$/;
|
|
50
50
|
const mcPreviewHostnameRegex = /^.*\.mc-preview\.(.*)$/;
|
|
@@ -89,8 +89,8 @@ const getDisplayName = Component => {
|
|
|
89
89
|
return Component.displayName || Component.name || 'Component';
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
-
function ownKeys$2(
|
|
93
|
-
function _objectSpread$2(
|
|
92
|
+
function ownKeys$2(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; }
|
|
93
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$2(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$2(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
94
94
|
// Menu visibilities
|
|
95
95
|
|
|
96
96
|
// Permissions
|
|
@@ -231,9 +231,9 @@ const normalizeAllAppliedDataFences = allAppliedDataFences => {
|
|
|
231
231
|
return null;
|
|
232
232
|
};
|
|
233
233
|
|
|
234
|
-
function ownKeys$1(
|
|
235
|
-
function _objectSpread$1(
|
|
236
|
-
const Context$
|
|
234
|
+
function ownKeys$1(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; }
|
|
235
|
+
function _objectSpread$1(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$1(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$1(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
236
|
+
const Context$2 = /*#__PURE__*/react.createContext({});
|
|
237
237
|
const defaultTimeZone = moment__default["default"].tz.guess() || 'Etc/UTC';
|
|
238
238
|
|
|
239
239
|
// Expose only certain fields as some of them are only meant to
|
|
@@ -304,13 +304,13 @@ const createApplicationContext = (environment, user, project, projectDataLocale)
|
|
|
304
304
|
dataFences: normalizeAllAppliedDataFences(project === null || project === void 0 ? void 0 : project.allAppliedDataFences),
|
|
305
305
|
dataLocale: projectDataLocale || null
|
|
306
306
|
});
|
|
307
|
-
const ApplicationContextProvider = props => jsxRuntime.jsx(Context$
|
|
307
|
+
const ApplicationContextProvider = props => jsxRuntime.jsx(Context$2.Provider, {
|
|
308
308
|
value: createApplicationContext(props.environment, props.user, props.project, props.projectDataLocale),
|
|
309
309
|
children: props.children
|
|
310
310
|
});
|
|
311
311
|
ApplicationContextProvider.propTypes = {};
|
|
312
312
|
ApplicationContextProvider.displayName = 'ApplicationContextProvider';
|
|
313
|
-
const ApplicationContext = props => jsxRuntime.jsx(Context$
|
|
313
|
+
const ApplicationContext = props => jsxRuntime.jsx(Context$2.Consumer, {
|
|
314
314
|
children: context => {
|
|
315
315
|
// Because of the way the ApplicationShell configures the Context.Provider,
|
|
316
316
|
// we ensure that, when we read from the context, we always get actual
|
|
@@ -342,7 +342,7 @@ function withApplicationContext(mapApplicationContextToProps) {
|
|
|
342
342
|
// Then implement the function. Typescript will pick the appropriate signature
|
|
343
343
|
// based on the function arguments.
|
|
344
344
|
function useApplicationContextHook(selector) {
|
|
345
|
-
const context = react.useContext(Context$
|
|
345
|
+
const context = react.useContext(Context$2);
|
|
346
346
|
// Because of the way the ApplicationShell configures the Context.Provider,
|
|
347
347
|
// we ensure that, when we read from the context, we always get actual
|
|
348
348
|
// context object and not the initial value.
|
|
@@ -356,8 +356,40 @@ function useApplicationContextHook(selector) {
|
|
|
356
356
|
// See related issue: https://github.com/babel/babel/issues/8361
|
|
357
357
|
const useApplicationContext = useApplicationContextHook;
|
|
358
358
|
|
|
359
|
-
|
|
360
|
-
|
|
359
|
+
const Context$1 = /*#__PURE__*/react.createContext({});
|
|
360
|
+
const CustomViewContextProvider = props => {
|
|
361
|
+
const contextValue = react.useMemo(() => ({
|
|
362
|
+
hostUrl: props.hostUrl,
|
|
363
|
+
config: props.customViewConfig
|
|
364
|
+
}), [props.hostUrl, props.customViewConfig]);
|
|
365
|
+
return jsxRuntime.jsx(Context$1.Provider, {
|
|
366
|
+
value: contextValue,
|
|
367
|
+
children: props.children
|
|
368
|
+
});
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
// Use function overloading to declare two possible signatures with two
|
|
372
|
+
// distict return types, based on the selector function argument.
|
|
373
|
+
CustomViewContextProvider.propTypes = {};
|
|
374
|
+
// Then implement the function. Typescript will pick the appropriate signature
|
|
375
|
+
// based on the function arguments.
|
|
376
|
+
function useCustomViewContextHook(selector) {
|
|
377
|
+
const context = react.useContext(Context$1);
|
|
378
|
+
// Because of the way the CustomViewShell configures the Context.Provider,
|
|
379
|
+
// we ensure that, when we read from the context, we always get actual
|
|
380
|
+
// context object and not the initial value.
|
|
381
|
+
// Therefore, we can safely cast the value to be out `TCustomViewContext` type.
|
|
382
|
+
const customViewContext = context;
|
|
383
|
+
return selector ? selector(customViewContext) : customViewContext;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// This is a workaround to trick babel/rollup to correctly export the function.
|
|
387
|
+
// Most likely the problem arises with the use of overloading.
|
|
388
|
+
// See related issue: https://github.com/babel/babel/issues/8361
|
|
389
|
+
const useCustomViewContext = useCustomViewContextHook;
|
|
390
|
+
|
|
391
|
+
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; }
|
|
392
|
+
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; }
|
|
361
393
|
var FetchProjectExtensionImageRegex = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProjectExtensionImageRegex" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "projectExtension" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "imageRegex" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "thumb" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "ImageRegex" }, directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "small" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "ImageRegex" }, directives: [] }] } }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "ImageRegex" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ImageRegexOptions" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "flag" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "search" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "replace" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 256, source: { body: "query FetchProjectExtensionImageRegex {\n projectExtension {\n id\n imageRegex {\n thumb {\n ...ImageRegex\n }\n small {\n ...ImageRegex\n }\n }\n }\n}\nfragment ImageRegex on ImageRegexOptions {\n flag\n search\n replace\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
362
394
|
const useWarning = (condition, message) => {
|
|
363
395
|
react.useEffect(() => {
|
|
@@ -423,7 +455,8 @@ function withProjectExtensionImageRegex() {
|
|
|
423
455
|
|
|
424
456
|
exports.ApplicationContext = ApplicationContext;
|
|
425
457
|
exports.ApplicationContextProvider = ApplicationContextProvider;
|
|
426
|
-
exports.Context = Context$
|
|
458
|
+
exports.Context = Context$2;
|
|
459
|
+
exports.CustomViewContextProvider = CustomViewContextProvider;
|
|
427
460
|
exports.GetProjectExtensionImageRegex = GetProjectExtensionImageRegex;
|
|
428
461
|
exports.ProjectExtensionProviderForImageRegex = ProjectExtensionProviderForImageRegex;
|
|
429
462
|
exports.getMcApiUrl = getMcApiUrl;
|
|
@@ -432,6 +465,7 @@ exports.normalizeAllAppliedDataFences = normalizeAllAppliedDataFences;
|
|
|
432
465
|
exports.normalizeAllAppliedMenuVisibilities = normalizeAllAppliedMenuVisibilities;
|
|
433
466
|
exports.normalizeAllAppliedPermissions = normalizeAllAppliedPermissions;
|
|
434
467
|
exports.useApplicationContext = useApplicationContext;
|
|
468
|
+
exports.useCustomViewContext = useCustomViewContext;
|
|
435
469
|
exports.useProjectExtensionImageRegex = useProjectExtensionImageRegex;
|
|
436
470
|
exports.version = version;
|
|
437
471
|
exports.withApplicationContext = withApplicationContext;
|
|
@@ -10,7 +10,7 @@ import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/obje
|
|
|
10
10
|
import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
|
|
11
11
|
import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
|
|
12
12
|
import _pt from 'prop-types';
|
|
13
|
-
import { createContext, useContext, useEffect } from 'react';
|
|
13
|
+
import { createContext, useContext, useMemo, useEffect } from 'react';
|
|
14
14
|
import moment from 'moment-timezone';
|
|
15
15
|
import { reportErrorToSentry } from '@commercetools-frontend/sentry';
|
|
16
16
|
import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
|
|
@@ -23,7 +23,7 @@ import warning from 'tiny-warning';
|
|
|
23
23
|
import { GRAPHQL_TARGETS } from '@commercetools-frontend/constants';
|
|
24
24
|
|
|
25
25
|
// NOTE: This string will be replaced on build time with the package version.
|
|
26
|
-
var version = "22.
|
|
26
|
+
var version = "22.8.0";
|
|
27
27
|
|
|
28
28
|
const mcHostnameRegex = /^mc(-(\d){4,})?\.(.*)$/;
|
|
29
29
|
const mcPreviewHostnameRegex = /^.*\.mc-preview\.(.*)$/;
|
|
@@ -68,8 +68,8 @@ const getDisplayName = Component => {
|
|
|
68
68
|
return Component.displayName || Component.name || 'Component';
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
function ownKeys$2(
|
|
72
|
-
function _objectSpread$2(
|
|
71
|
+
function ownKeys$2(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; }
|
|
72
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys$2(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys$2(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
73
73
|
// Menu visibilities
|
|
74
74
|
|
|
75
75
|
// Permissions
|
|
@@ -210,9 +210,9 @@ const normalizeAllAppliedDataFences = allAppliedDataFences => {
|
|
|
210
210
|
return null;
|
|
211
211
|
};
|
|
212
212
|
|
|
213
|
-
function ownKeys$1(
|
|
214
|
-
function _objectSpread$1(
|
|
215
|
-
const Context$
|
|
213
|
+
function ownKeys$1(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; }
|
|
214
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$1(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$1(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
215
|
+
const Context$2 = /*#__PURE__*/createContext({});
|
|
216
216
|
const defaultTimeZone = moment.tz.guess() || 'Etc/UTC';
|
|
217
217
|
|
|
218
218
|
// Expose only certain fields as some of them are only meant to
|
|
@@ -283,7 +283,7 @@ const createApplicationContext = (environment, user, project, projectDataLocale)
|
|
|
283
283
|
dataFences: normalizeAllAppliedDataFences(project === null || project === void 0 ? void 0 : project.allAppliedDataFences),
|
|
284
284
|
dataLocale: projectDataLocale || null
|
|
285
285
|
});
|
|
286
|
-
const ApplicationContextProvider = props => jsx(Context$
|
|
286
|
+
const ApplicationContextProvider = props => jsx(Context$2.Provider, {
|
|
287
287
|
value: createApplicationContext(props.environment, props.user, props.project, props.projectDataLocale),
|
|
288
288
|
children: props.children
|
|
289
289
|
});
|
|
@@ -292,7 +292,7 @@ ApplicationContextProvider.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
292
292
|
children: _pt.node.isRequired
|
|
293
293
|
} : {};
|
|
294
294
|
ApplicationContextProvider.displayName = 'ApplicationContextProvider';
|
|
295
|
-
const ApplicationContext = props => jsx(Context$
|
|
295
|
+
const ApplicationContext = props => jsx(Context$2.Consumer, {
|
|
296
296
|
children: context => {
|
|
297
297
|
// Because of the way the ApplicationShell configures the Context.Provider,
|
|
298
298
|
// we ensure that, when we read from the context, we always get actual
|
|
@@ -326,7 +326,7 @@ function withApplicationContext(mapApplicationContextToProps) {
|
|
|
326
326
|
// Then implement the function. Typescript will pick the appropriate signature
|
|
327
327
|
// based on the function arguments.
|
|
328
328
|
function useApplicationContextHook(selector) {
|
|
329
|
-
const context = useContext(Context$
|
|
329
|
+
const context = useContext(Context$2);
|
|
330
330
|
// Because of the way the ApplicationShell configures the Context.Provider,
|
|
331
331
|
// we ensure that, when we read from the context, we always get actual
|
|
332
332
|
// context object and not the initial value.
|
|
@@ -340,8 +340,44 @@ function useApplicationContextHook(selector) {
|
|
|
340
340
|
// See related issue: https://github.com/babel/babel/issues/8361
|
|
341
341
|
const useApplicationContext = useApplicationContextHook;
|
|
342
342
|
|
|
343
|
-
|
|
344
|
-
|
|
343
|
+
const Context$1 = /*#__PURE__*/createContext({});
|
|
344
|
+
const CustomViewContextProvider = props => {
|
|
345
|
+
const contextValue = useMemo(() => ({
|
|
346
|
+
hostUrl: props.hostUrl,
|
|
347
|
+
config: props.customViewConfig
|
|
348
|
+
}), [props.hostUrl, props.customViewConfig]);
|
|
349
|
+
return jsx(Context$1.Provider, {
|
|
350
|
+
value: contextValue,
|
|
351
|
+
children: props.children
|
|
352
|
+
});
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
// Use function overloading to declare two possible signatures with two
|
|
356
|
+
// distict return types, based on the selector function argument.
|
|
357
|
+
CustomViewContextProvider.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
358
|
+
hostUrl: _pt.string.isRequired,
|
|
359
|
+
customViewConfig: _pt.any.isRequired,
|
|
360
|
+
children: _pt.node.isRequired
|
|
361
|
+
} : {};
|
|
362
|
+
// Then implement the function. Typescript will pick the appropriate signature
|
|
363
|
+
// based on the function arguments.
|
|
364
|
+
function useCustomViewContextHook(selector) {
|
|
365
|
+
const context = useContext(Context$1);
|
|
366
|
+
// Because of the way the CustomViewShell configures the Context.Provider,
|
|
367
|
+
// we ensure that, when we read from the context, we always get actual
|
|
368
|
+
// context object and not the initial value.
|
|
369
|
+
// Therefore, we can safely cast the value to be out `TCustomViewContext` type.
|
|
370
|
+
const customViewContext = context;
|
|
371
|
+
return selector ? selector(customViewContext) : customViewContext;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// This is a workaround to trick babel/rollup to correctly export the function.
|
|
375
|
+
// Most likely the problem arises with the use of overloading.
|
|
376
|
+
// See related issue: https://github.com/babel/babel/issues/8361
|
|
377
|
+
const useCustomViewContext = useCustomViewContextHook;
|
|
378
|
+
|
|
379
|
+
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; }
|
|
380
|
+
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; }
|
|
345
381
|
var FetchProjectExtensionImageRegex = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProjectExtensionImageRegex" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "projectExtension" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "imageRegex" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "thumb" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "ImageRegex" }, directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "small" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "ImageRegex" }, directives: [] }] } }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "ImageRegex" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ImageRegexOptions" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "flag" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "search" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "replace" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 256, source: { body: "query FetchProjectExtensionImageRegex {\n projectExtension {\n id\n imageRegex {\n thumb {\n ...ImageRegex\n }\n small {\n ...ImageRegex\n }\n }\n }\n}\nfragment ImageRegex on ImageRegexOptions {\n flag\n search\n replace\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
346
382
|
const useWarning = (condition, message) => {
|
|
347
383
|
useEffect(() => {
|
|
@@ -411,4 +447,4 @@ function withProjectExtensionImageRegex() {
|
|
|
411
447
|
};
|
|
412
448
|
}
|
|
413
449
|
|
|
414
|
-
export { ApplicationContext, ApplicationContextProvider, Context$
|
|
450
|
+
export { ApplicationContext, ApplicationContextProvider, Context$2 as Context, CustomViewContextProvider, GetProjectExtensionImageRegex, ProjectExtensionProviderForImageRegex, getMcApiUrl, normalizeAllAppliedActionRights, normalizeAllAppliedDataFences, normalizeAllAppliedMenuVisibilities, normalizeAllAppliedPermissions, useApplicationContext, useCustomViewContext, useProjectExtensionImageRegex, version, withApplicationContext, withProjectExtensionImageRegex };
|
|
@@ -32,30 +32,13 @@ type TApplicationContextUser = Pick<NonNullable<TFetchedUser>, 'id' | 'email' |
|
|
|
32
32
|
};
|
|
33
33
|
declare const Context: import("react").Context<{}>;
|
|
34
34
|
export declare const mapUserToApplicationContextUser: (user?: TFetchedUser) => TApplicationContextUser | null;
|
|
35
|
-
export declare const mapEnvironmentToApplicationContextEnvironment: <AdditionalEnvironmentProperties extends {}>(environment: AdditionalEnvironmentProperties & {
|
|
36
|
-
applicationId: string;
|
|
37
|
-
customViewId?: string | undefined;
|
|
38
|
-
applicationName: string;
|
|
39
|
-
entryPointUriPath: string;
|
|
40
|
-
revision: string;
|
|
41
|
-
env: string;
|
|
42
|
-
location: string;
|
|
43
|
-
cdnUrl: string;
|
|
44
|
-
mcApiUrl: string;
|
|
45
|
-
frontendHost: string;
|
|
46
|
-
servedByProxy: boolean;
|
|
47
|
-
ldClientSideId?: string | undefined;
|
|
48
|
-
trackingSentry?: string | undefined;
|
|
49
|
-
__DEVELOPMENT__?: {
|
|
50
|
-
oidc?: import("@commercetools-frontend/constants").ApplicationOidcForDevelopmentConfig | undefined;
|
|
51
|
-
menuLinks?: import("@commercetools-frontend/constants").ApplicationMenuLinksForDevelopmentConfig | undefined;
|
|
52
|
-
} | undefined;
|
|
53
|
-
}, origin?: string) => AdditionalEnvironmentProperties & {
|
|
35
|
+
export declare const mapEnvironmentToApplicationContextEnvironment: <AdditionalEnvironmentProperties extends {}>(environment: AdditionalEnvironmentProperties & import("@commercetools-frontend/constants").ApplicationRuntimeEnvironment, origin?: string) => AdditionalEnvironmentProperties & {
|
|
54
36
|
mcApiUrl: string;
|
|
55
37
|
applicationId: string;
|
|
56
|
-
|
|
38
|
+
applicationIdentifier: string;
|
|
57
39
|
applicationName: string;
|
|
58
40
|
entryPointUriPath: string;
|
|
41
|
+
customViewId?: string | undefined;
|
|
59
42
|
revision: string;
|
|
60
43
|
env: string;
|
|
61
44
|
location: string;
|
|
@@ -64,10 +47,7 @@ export declare const mapEnvironmentToApplicationContextEnvironment: <AdditionalE
|
|
|
64
47
|
servedByProxy: boolean;
|
|
65
48
|
ldClientSideId?: string | undefined;
|
|
66
49
|
trackingSentry?: string | undefined;
|
|
67
|
-
__DEVELOPMENT__?:
|
|
68
|
-
oidc?: import("@commercetools-frontend/constants").ApplicationOidcForDevelopmentConfig | undefined;
|
|
69
|
-
menuLinks?: import("@commercetools-frontend/constants").ApplicationMenuLinksForDevelopmentConfig | undefined;
|
|
70
|
-
} | undefined;
|
|
50
|
+
__DEVELOPMENT__?: import("@commercetools-frontend/constants").ApplicationRuntimeEnvironmentForDevelopment | undefined;
|
|
71
51
|
};
|
|
72
52
|
export declare const mapProjectToApplicationContextProject: (project?: TFetchedProject) => {
|
|
73
53
|
key: string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { CustomViewData } from '@commercetools-frontend/constants';
|
|
3
|
+
export type TCustomViewContext = {
|
|
4
|
+
hostUrl: string;
|
|
5
|
+
config: CustomViewData;
|
|
6
|
+
};
|
|
7
|
+
export type TCustomViewContextProviderProps = {
|
|
8
|
+
hostUrl: string;
|
|
9
|
+
customViewConfig: CustomViewData;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
declare const Context: import("react").Context<{}>;
|
|
13
|
+
declare const CustomViewContextProvider: (props: TCustomViewContextProviderProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
|
|
14
|
+
declare function useCustomViewContextHook(): TCustomViewContext;
|
|
15
|
+
declare function useCustomViewContextHook<SelectedContext>(selector: (context: TCustomViewContext) => SelectedContext): SelectedContext;
|
|
16
|
+
declare const useCustomViewContext: typeof useCustomViewContextHook;
|
|
17
|
+
export { Context, CustomViewContextProvider, useCustomViewContext };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TCustomViewContextProviderProps as CustomViewContextProviderProps, TCustomViewContext as CustomViewContext } from './custom-view-context';
|
|
2
|
+
export type TCustomViewContextProviderProps = CustomViewContextProviderProps;
|
|
3
|
+
export type TCustomViewContext = CustomViewContext;
|
|
4
|
+
export { CustomViewContextProvider, useCustomViewContext, } from './custom-view-context';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TProviderProps as ProviderProps, TApplicationContext as ApplicationContext, TNormalizedMenuVisibilities as NormalizedMenuVisibilities, TNormalizedPermissions as NormalizedPermissions, TNormalizedActionRights as NormalizedActionRights, TNormalizedDataFences as NormalizedDataFences } from './components/application-context';
|
|
2
|
+
import type { TCustomViewContextProviderProps as CustomViewContextProviderProps, TCustomViewContext as CustomViewContext } from './components/custom-view-context';
|
|
2
3
|
import type { TImageRegexContext as ImageRegexContext } from './components/project-extension-image-regex';
|
|
3
4
|
export type TProviderProps<AdditionalEnvironmentProperties extends {}> = ProviderProps<AdditionalEnvironmentProperties>;
|
|
4
5
|
export type TApplicationContext<AdditionalEnvironmentProperties extends {}> = ApplicationContext<AdditionalEnvironmentProperties>;
|
|
@@ -6,4 +7,6 @@ export type TNormalizedMenuVisibilities = NormalizedMenuVisibilities;
|
|
|
6
7
|
export type TNormalizedPermissions = NormalizedPermissions;
|
|
7
8
|
export type TNormalizedActionRights = NormalizedActionRights;
|
|
8
9
|
export type TNormalizedDataFences = NormalizedDataFences;
|
|
10
|
+
export type TCustomViewContextProviderProps = CustomViewContextProviderProps;
|
|
11
|
+
export type TCustomViewContext = CustomViewContext;
|
|
9
12
|
export type TImageRegexContext = ImageRegexContext;
|
|
@@ -2,4 +2,5 @@ export { default as version } from './version';
|
|
|
2
2
|
export * from './export-types';
|
|
3
3
|
export { default as getMcApiUrl } from './utils/get-mc-api-url';
|
|
4
4
|
export { Context, ApplicationContext, ApplicationContextProvider, withApplicationContext, useApplicationContext, normalizeAllAppliedActionRights, normalizeAllAppliedDataFences, normalizeAllAppliedMenuVisibilities, normalizeAllAppliedPermissions, } from './components/application-context';
|
|
5
|
+
export { CustomViewContextProvider, useCustomViewContext, } from './components/custom-view-context';
|
|
5
6
|
export { GetProjectExtensionImageRegex, ProjectExtensionProviderForImageRegex, withProjectExtensionImageRegex, useProjectExtensionImageRegex, } from './components/project-extension-image-regex';
|
|
@@ -249,7 +249,7 @@ export type TCustomView = {
|
|
|
249
249
|
description?: Maybe<Scalars['String']>;
|
|
250
250
|
id: Scalars['ID'];
|
|
251
251
|
installedBy: Array<TCustomViewInstallation>;
|
|
252
|
-
labelAllLocales:
|
|
252
|
+
labelAllLocales: Array<TLocalizedField>;
|
|
253
253
|
locators: Array<Scalars['String']>;
|
|
254
254
|
owner: TOrganizationExtension;
|
|
255
255
|
ownerId: Scalars['String'];
|
|
@@ -263,7 +263,7 @@ export type TCustomView = {
|
|
|
263
263
|
export type TCustomViewDraftDataInput = {
|
|
264
264
|
defaultLabel: Scalars['String'];
|
|
265
265
|
description?: InputMaybe<Scalars['String']>;
|
|
266
|
-
labelAllLocales:
|
|
266
|
+
labelAllLocales: Array<TLocalizedFieldDataInput>;
|
|
267
267
|
locators: Array<Scalars['String']>;
|
|
268
268
|
permissions: Array<TCustomViewPermissionDataInput>;
|
|
269
269
|
type: TCustomViewType;
|
|
@@ -549,6 +549,7 @@ export type TMutation = {
|
|
|
549
549
|
activatePimSearchListView?: Maybe<TPimSearchListView>;
|
|
550
550
|
activateProductDiscountsCustomView?: Maybe<TDiscountsCustomView>;
|
|
551
551
|
activateProductTypeAttributesView?: Maybe<TProductTypeAttributesView>;
|
|
552
|
+
activateProjectSettingsStoresView?: Maybe<TProjectSettingsStoresView>;
|
|
552
553
|
changeCustomApplicationStatus?: Maybe<TRestrictedCustomApplicationForOrganization>;
|
|
553
554
|
changeCustomViewStatus?: Maybe<TCustomView>;
|
|
554
555
|
createCartDiscountsCustomView: TDiscountsCustomView;
|
|
@@ -562,6 +563,7 @@ export type TMutation = {
|
|
|
562
563
|
createPimSearchListView: TPimSearchListView;
|
|
563
564
|
createProductDiscountsCustomView: TDiscountsCustomView;
|
|
564
565
|
createProductTypeAttributesView: TProductTypeAttributesView;
|
|
566
|
+
createProjectSettingsStoresView: TProjectSettingsStoresView;
|
|
565
567
|
createVariantPricesListView?: Maybe<TVariantPricesListView>;
|
|
566
568
|
deactivateCartDiscountsCustomView?: Maybe<TDiscountsCustomView>;
|
|
567
569
|
deactivateCustomersListView?: Maybe<TOrdersListView>;
|
|
@@ -572,6 +574,7 @@ export type TMutation = {
|
|
|
572
574
|
deactivatePimSearchListView?: Maybe<TPimSearchListView>;
|
|
573
575
|
deactivateProductDiscountsCustomView?: Maybe<TDiscountsCustomView>;
|
|
574
576
|
deactivateProductTypeAttributesView?: Maybe<TProductTypeAttributesView>;
|
|
577
|
+
deactivateProjectSettingsStoresView?: Maybe<TProjectSettingsStoresView>;
|
|
575
578
|
deleteAllDashboardViews: Array<TDashboardView>;
|
|
576
579
|
deleteAllOrdersListViews: Array<TOrdersListView>;
|
|
577
580
|
deleteCartDiscountsCustomView?: Maybe<TDiscountsCustomView>;
|
|
@@ -584,7 +587,9 @@ export type TMutation = {
|
|
|
584
587
|
deletePimSearchListView?: Maybe<TPimSearchListView>;
|
|
585
588
|
deleteProductDiscountsCustomView?: Maybe<TDiscountsCustomView>;
|
|
586
589
|
deleteProductTypeAttributesView?: Maybe<TProductTypeAttributesView>;
|
|
590
|
+
deleteProjectSettingsStoresView?: Maybe<TProjectSettingsStoresView>;
|
|
587
591
|
installCustomApplication?: Maybe<TRestrictedCustomApplicationInstallationForOrganization>;
|
|
592
|
+
installCustomView?: Maybe<TRestrictedCustomViewInstallationForOrganization>;
|
|
588
593
|
random: Scalars['String'];
|
|
589
594
|
sendLinkToVerifyCustomApplicationsMaintainerContactEmail?: Maybe<TCustomApplicationsMaintainerContactEmailVerificationRequest>;
|
|
590
595
|
setCustomApplicationsMaintainerContactInformation?: Maybe<TOrganizationExtension>;
|
|
@@ -595,11 +600,13 @@ export type TMutation = {
|
|
|
595
600
|
setProjectExtensionOrderStatesVisibility?: Maybe<TProjectExtension>;
|
|
596
601
|
setProjectExtensionRichTextEditorSettings?: Maybe<TProjectExtension>;
|
|
597
602
|
uninstallCustomApplication?: Maybe<TRestrictedCustomApplicationInstallationForOrganization>;
|
|
603
|
+
uninstallCustomView?: Maybe<TRestrictedCustomViewInstallationForOrganization>;
|
|
598
604
|
updateCartDiscountsCustomView?: Maybe<TDiscountsCustomView>;
|
|
599
605
|
updateCustomApplication?: Maybe<TRestrictedCustomApplicationForOrganization>;
|
|
600
606
|
updateCustomApplicationDeploymentPreview: TCustomApplicationDeploymentPreview;
|
|
601
607
|
updateCustomApplicationProjectsInstallation?: Maybe<TRestrictedCustomApplicationInstallationForOrganization>;
|
|
602
608
|
updateCustomView?: Maybe<TCustomView>;
|
|
609
|
+
updateCustomViewProjectsInstallation?: Maybe<TRestrictedCustomViewInstallationForOrganization>;
|
|
603
610
|
updateCustomersListView?: Maybe<TCustomersListView>;
|
|
604
611
|
updateDashboardView?: Maybe<TDashboardView>;
|
|
605
612
|
updateDiscountCodesCustomView?: Maybe<TDiscountsCustomView>;
|
|
@@ -607,6 +614,7 @@ export type TMutation = {
|
|
|
607
614
|
updatePimSearchListView?: Maybe<TPimSearchListView>;
|
|
608
615
|
updateProductDiscountsCustomView?: Maybe<TDiscountsCustomView>;
|
|
609
616
|
updateProductTypeAttributesView: TProductTypeAttributesView;
|
|
617
|
+
updateProjectSettingsStoresView?: Maybe<TProjectSettingsStoresView>;
|
|
610
618
|
updateRuleBuilderQuickSelectionValues?: Maybe<TRuleBuilderQuickSelectionValues>;
|
|
611
619
|
updateVariantPricesListView?: Maybe<TVariantPricesListView>;
|
|
612
620
|
verifyCustomApplicationsMaintainerContactEmail?: Maybe<TCustomApplicationsMaintainerContactEmailVerificationConfirmation>;
|
|
@@ -640,6 +648,9 @@ export type TMutation_ActivateProductTypeAttributesViewArgs = {
|
|
|
640
648
|
isVariant: Scalars['Boolean'];
|
|
641
649
|
productTypeId: Scalars['String'];
|
|
642
650
|
};
|
|
651
|
+
export type TMutation_ActivateProjectSettingsStoresViewArgs = {
|
|
652
|
+
id: Scalars['ID'];
|
|
653
|
+
};
|
|
643
654
|
export type TMutation_ChangeCustomApplicationStatusArgs = {
|
|
644
655
|
applicationId: Scalars['ID'];
|
|
645
656
|
organizationId: Scalars['String'];
|
|
@@ -687,6 +698,9 @@ export type TMutation_CreateProductDiscountsCustomViewArgs = {
|
|
|
687
698
|
export type TMutation_CreateProductTypeAttributesViewArgs = {
|
|
688
699
|
data: TProductTypeAttributesViewInput;
|
|
689
700
|
};
|
|
701
|
+
export type TMutation_CreateProjectSettingsStoresViewArgs = {
|
|
702
|
+
data: TProjectSettingsStoresViewInput;
|
|
703
|
+
};
|
|
690
704
|
export type TMutation_CreateVariantPricesListViewArgs = {
|
|
691
705
|
data: TVariantPricesListViewInput;
|
|
692
706
|
};
|
|
@@ -717,6 +731,9 @@ export type TMutation_DeactivateProductDiscountsCustomViewArgs = {
|
|
|
717
731
|
export type TMutation_DeactivateProductTypeAttributesViewArgs = {
|
|
718
732
|
id: Scalars['ID'];
|
|
719
733
|
};
|
|
734
|
+
export type TMutation_DeactivateProjectSettingsStoresViewArgs = {
|
|
735
|
+
id: Scalars['ID'];
|
|
736
|
+
};
|
|
720
737
|
export type TMutation_DeleteCartDiscountsCustomViewArgs = {
|
|
721
738
|
id: Scalars['ID'];
|
|
722
739
|
};
|
|
@@ -749,11 +766,19 @@ export type TMutation_DeleteProductDiscountsCustomViewArgs = {
|
|
|
749
766
|
export type TMutation_DeleteProductTypeAttributesViewArgs = {
|
|
750
767
|
id: Scalars['ID'];
|
|
751
768
|
};
|
|
769
|
+
export type TMutation_DeleteProjectSettingsStoresViewArgs = {
|
|
770
|
+
id: Scalars['ID'];
|
|
771
|
+
};
|
|
752
772
|
export type TMutation_InstallCustomApplicationArgs = {
|
|
753
773
|
applicationId: Scalars['ID'];
|
|
754
774
|
organizationId: Scalars['String'];
|
|
755
775
|
projectKeys?: InputMaybe<Array<InputMaybe<Scalars['String']>>>;
|
|
756
776
|
};
|
|
777
|
+
export type TMutation_InstallCustomViewArgs = {
|
|
778
|
+
customViewId: Scalars['ID'];
|
|
779
|
+
organizationId: Scalars['String'];
|
|
780
|
+
projectKeys?: InputMaybe<Array<InputMaybe<Scalars['String']>>>;
|
|
781
|
+
};
|
|
757
782
|
export type TMutation_RandomArgs = {
|
|
758
783
|
byteLength: Scalars['Int'];
|
|
759
784
|
};
|
|
@@ -787,6 +812,10 @@ export type TMutation_UninstallCustomApplicationArgs = {
|
|
|
787
812
|
installedApplicationId: Scalars['ID'];
|
|
788
813
|
organizationId: Scalars['String'];
|
|
789
814
|
};
|
|
815
|
+
export type TMutation_UninstallCustomViewArgs = {
|
|
816
|
+
installedCustomViewId: Scalars['ID'];
|
|
817
|
+
organizationId: Scalars['String'];
|
|
818
|
+
};
|
|
790
819
|
export type TMutation_UpdateCartDiscountsCustomViewArgs = {
|
|
791
820
|
data: TDiscountsCustomViewInput;
|
|
792
821
|
id: Scalars['ID'];
|
|
@@ -811,6 +840,11 @@ export type TMutation_UpdateCustomViewArgs = {
|
|
|
811
840
|
data: TCustomViewDraftDataInput;
|
|
812
841
|
organizationId: Scalars['String'];
|
|
813
842
|
};
|
|
843
|
+
export type TMutation_UpdateCustomViewProjectsInstallationArgs = {
|
|
844
|
+
installedCustomViewId: Scalars['ID'];
|
|
845
|
+
organizationId: Scalars['String'];
|
|
846
|
+
projectKeys?: InputMaybe<Array<InputMaybe<Scalars['String']>>>;
|
|
847
|
+
};
|
|
814
848
|
export type TMutation_UpdateCustomersListViewArgs = {
|
|
815
849
|
data: TCustomersListViewInput;
|
|
816
850
|
id: Scalars['ID'];
|
|
@@ -839,6 +873,10 @@ export type TMutation_UpdateProductTypeAttributesViewArgs = {
|
|
|
839
873
|
data: TProductTypeAttributesViewUpdateInput;
|
|
840
874
|
id: Scalars['ID'];
|
|
841
875
|
};
|
|
876
|
+
export type TMutation_UpdateProjectSettingsStoresViewArgs = {
|
|
877
|
+
data: TProjectSettingsStoresViewInput;
|
|
878
|
+
id: Scalars['ID'];
|
|
879
|
+
};
|
|
842
880
|
export type TMutation_UpdateRuleBuilderQuickSelectionValuesArgs = {
|
|
843
881
|
data: TRuleBuilderQuickSelectionInput;
|
|
844
882
|
id?: InputMaybe<Scalars['ID']>;
|
|
@@ -1084,6 +1122,26 @@ export type TProjectExtension_ApplicationsArgs = {
|
|
|
1084
1122
|
export type TProjectExtension_InstalledApplicationsArgs = {
|
|
1085
1123
|
where?: InputMaybe<TRestrictedCustomApplicationInstallationForProjectWhereInput>;
|
|
1086
1124
|
};
|
|
1125
|
+
export type TProjectSettingsStoresView = {
|
|
1126
|
+
__typename?: 'ProjectSettingsStoresView';
|
|
1127
|
+
createdAt: Scalars['DateTime'];
|
|
1128
|
+
id: Scalars['ID'];
|
|
1129
|
+
isActive?: Maybe<Scalars['Boolean']>;
|
|
1130
|
+
nameAllLocales?: Maybe<Array<TLocalizedField>>;
|
|
1131
|
+
projectKey: Scalars['String'];
|
|
1132
|
+
sort?: Maybe<TSort>;
|
|
1133
|
+
table?: Maybe<TTable>;
|
|
1134
|
+
updatedAt: Scalars['DateTime'];
|
|
1135
|
+
userId: Scalars['String'];
|
|
1136
|
+
};
|
|
1137
|
+
export type TProjectSettingsStoresViewInput = {
|
|
1138
|
+
nameAllLocales: Array<TLocalizedFieldCreateInput>;
|
|
1139
|
+
sort: TSortCreateInput;
|
|
1140
|
+
table?: InputMaybe<TProjectSettingsStoresViewTableInput>;
|
|
1141
|
+
};
|
|
1142
|
+
export type TProjectSettingsStoresViewTableInput = {
|
|
1143
|
+
visibleColumns: Array<Scalars['String']>;
|
|
1144
|
+
};
|
|
1087
1145
|
export type TPublicCustomApplicationDevelopedByCommercetools = {
|
|
1088
1146
|
__typename?: 'PublicCustomApplicationDevelopedByCommercetools';
|
|
1089
1147
|
createdAt: Scalars['DateTime'];
|
|
@@ -1111,6 +1169,7 @@ export type TQuery = {
|
|
|
1111
1169
|
activeProductTypeAttributesView?: Maybe<TProductTypeAttributesView>;
|
|
1112
1170
|
allAppliedCustomApplicationPermissions: Array<TCustomApplicationInstallationPermission>;
|
|
1113
1171
|
allCustomApplications: TCustomApplicationsPagedQueryResult;
|
|
1172
|
+
allCustomViewInstallationByOrganization?: Maybe<TCustomViewInstallation>;
|
|
1114
1173
|
allCustomViewsByOrganization: Array<Maybe<TCustomView>>;
|
|
1115
1174
|
allFeatures: Array<TFeature>;
|
|
1116
1175
|
allOrganizationExtensions: Array<TOrganizationExtension>;
|
|
@@ -1120,6 +1179,7 @@ export type TQuery = {
|
|
|
1120
1179
|
cartDiscountsCustomViews: Array<Maybe<TDiscountsCustomView>>;
|
|
1121
1180
|
customApplication?: Maybe<TCustomApplication>;
|
|
1122
1181
|
customView?: Maybe<TCustomView>;
|
|
1182
|
+
customViewInstallation?: Maybe<TCustomViewInstallation>;
|
|
1123
1183
|
customersListView?: Maybe<TCustomersListView>;
|
|
1124
1184
|
customersListViews: Array<Maybe<TCustomersListView>>;
|
|
1125
1185
|
dashboardView?: Maybe<TDashboardView>;
|
|
@@ -1154,6 +1214,9 @@ export type TQuery_AllAppliedCustomApplicationPermissionsArgs = {
|
|
|
1154
1214
|
export type TQuery_AllCustomApplicationsArgs = {
|
|
1155
1215
|
params?: InputMaybe<TCustomApplicationQueryInput>;
|
|
1156
1216
|
};
|
|
1217
|
+
export type TQuery_AllCustomViewInstallationByOrganizationArgs = {
|
|
1218
|
+
organizationId: Scalars['ID'];
|
|
1219
|
+
};
|
|
1157
1220
|
export type TQuery_AllCustomViewsByOrganizationArgs = {
|
|
1158
1221
|
organizationId: Scalars['ID'];
|
|
1159
1222
|
};
|
|
@@ -1175,6 +1238,9 @@ export type TQuery_CustomApplicationArgs = {
|
|
|
1175
1238
|
export type TQuery_CustomViewArgs = {
|
|
1176
1239
|
customViewId: Scalars['ID'];
|
|
1177
1240
|
};
|
|
1241
|
+
export type TQuery_CustomViewInstallationArgs = {
|
|
1242
|
+
customViewInstallationId: Scalars['ID'];
|
|
1243
|
+
};
|
|
1178
1244
|
export type TQuery_CustomersListViewArgs = {
|
|
1179
1245
|
id: Scalars['ID'];
|
|
1180
1246
|
};
|
|
@@ -1297,6 +1363,16 @@ export type TRestrictedCustomApplicationInstallationForProject = {
|
|
|
1297
1363
|
export type TRestrictedCustomApplicationInstallationForProjectWhereInput = {
|
|
1298
1364
|
entryPointUriPath?: InputMaybe<Scalars['String']>;
|
|
1299
1365
|
};
|
|
1366
|
+
export type TRestrictedCustomViewInstallationForOrganization = {
|
|
1367
|
+
__typename?: 'RestrictedCustomViewInstallationForOrganization';
|
|
1368
|
+
acceptedPermissions: Array<TCustomViewInstallationPermission>;
|
|
1369
|
+
createdAt: Scalars['DateTime'];
|
|
1370
|
+
customView: TCustomView;
|
|
1371
|
+
id: Scalars['ID'];
|
|
1372
|
+
installInAllProjects: Scalars['Boolean'];
|
|
1373
|
+
projects?: Maybe<Array<TProjectExtension>>;
|
|
1374
|
+
updatedAt: Scalars['DateTime'];
|
|
1375
|
+
};
|
|
1300
1376
|
export type TRichTextEditorSettingsInput = {
|
|
1301
1377
|
isRichTextEditorEnabled: Scalars['Boolean'];
|
|
1302
1378
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/application-shell-connectors",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.8.0",
|
|
4
4
|
"description": "Contains complementary tools for @commercetools-frontend/application-shell",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
]
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@babel/runtime": "^7.
|
|
39
|
-
"@babel/runtime-corejs3": "^7.
|
|
40
|
-
"@commercetools-frontend/constants": "22.
|
|
41
|
-
"@commercetools-frontend/sentry": "22.
|
|
38
|
+
"@babel/runtime": "^7.22.15",
|
|
39
|
+
"@babel/runtime-corejs3": "^7.22.15",
|
|
40
|
+
"@commercetools-frontend/constants": "22.8.0",
|
|
41
|
+
"@commercetools-frontend/sentry": "22.8.0",
|
|
42
42
|
"@emotion/react": "11.11.0",
|
|
43
|
-
"@types/lodash": "^4.14.
|
|
43
|
+
"@types/lodash": "^4.14.198",
|
|
44
44
|
"@types/prop-types": "^15.7.5",
|
|
45
|
-
"@types/react": "^17.0.
|
|
46
|
-
"graphql": "16.
|
|
45
|
+
"@types/react": "^17.0.56",
|
|
46
|
+
"graphql": "16.8.1",
|
|
47
47
|
"lodash": "4.17.21",
|
|
48
48
|
"moment-timezone": "^0.5.40",
|
|
49
49
|
"prop-types": "15.8.1",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@apollo/client": "3.7.14",
|
|
54
54
|
"@testing-library/react": "12.1.5",
|
|
55
|
-
"@types/jest": "^29.5.
|
|
55
|
+
"@types/jest": "^29.5.4",
|
|
56
56
|
"jest": "29.5.0",
|
|
57
57
|
"jest-mock": "29.5.0",
|
|
58
58
|
"react": "17.0.2"
|
package/test-utils/dist/commercetools-frontend-application-shell-connectors-test-utils.cjs.dev.js
CHANGED
|
@@ -24,8 +24,8 @@ var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_O
|
|
|
24
24
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
25
25
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
26
26
|
|
|
27
|
-
function ownKeys(
|
|
28
|
-
function _objectSpread(
|
|
27
|
+
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; }
|
|
28
|
+
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; }
|
|
29
29
|
var FetchProjectExtensionImageRegex = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProjectExtensionImageRegex" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "projectExtension" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "imageRegex" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "thumb" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "ImageRegex" }, directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "small" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "ImageRegex" }, directives: [] }] } }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "ImageRegex" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ImageRegexOptions" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "flag" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "search" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "replace" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 256, source: { body: "query FetchProjectExtensionImageRegex {\n projectExtension {\n id\n imageRegex {\n thumb {\n ...ImageRegex\n }\n small {\n ...ImageRegex\n }\n }\n }\n}\nfragment ImageRegex on ImageRegexOptions {\n flag\n search\n replace\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
30
30
|
const createGraphqlResponseForProjectExtensionImageRegexQuery = function () {
|
|
31
31
|
let customResponse = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
package/test-utils/dist/commercetools-frontend-application-shell-connectors-test-utils.cjs.prod.js
CHANGED
|
@@ -24,8 +24,8 @@ var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_O
|
|
|
24
24
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
25
25
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
26
26
|
|
|
27
|
-
function ownKeys(
|
|
28
|
-
function _objectSpread(
|
|
27
|
+
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; }
|
|
28
|
+
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; }
|
|
29
29
|
var FetchProjectExtensionImageRegex = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProjectExtensionImageRegex" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "projectExtension" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "imageRegex" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "thumb" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "ImageRegex" }, directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "small" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "ImageRegex" }, directives: [] }] } }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "ImageRegex" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ImageRegexOptions" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "flag" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "search" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "replace" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 256, source: { body: "query FetchProjectExtensionImageRegex {\n projectExtension {\n id\n imageRegex {\n thumb {\n ...ImageRegex\n }\n small {\n ...ImageRegex\n }\n }\n }\n}\nfragment ImageRegex on ImageRegexOptions {\n flag\n search\n replace\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
30
30
|
const createGraphqlResponseForProjectExtensionImageRegexQuery = function () {
|
|
31
31
|
let customResponse = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
package/test-utils/dist/commercetools-frontend-application-shell-connectors-test-utils.esm.js
CHANGED
|
@@ -9,8 +9,8 @@ import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object
|
|
|
9
9
|
import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
|
|
10
10
|
import { GRAPHQL_TARGETS } from '@commercetools-frontend/constants';
|
|
11
11
|
|
|
12
|
-
function ownKeys(
|
|
13
|
-
function _objectSpread(
|
|
12
|
+
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; }
|
|
13
|
+
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; }
|
|
14
14
|
var FetchProjectExtensionImageRegex = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchProjectExtensionImageRegex" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "projectExtension" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "imageRegex" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "thumb" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "ImageRegex" }, directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "small" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "FragmentSpread", name: { kind: "Name", value: "ImageRegex" }, directives: [] }] } }] } }] } }] } }, { kind: "FragmentDefinition", name: { kind: "Name", value: "ImageRegex" }, typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ImageRegexOptions" } }, directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "flag" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "search" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "replace" }, arguments: [], directives: [] }] } }], loc: { start: 0, end: 256, source: { body: "query FetchProjectExtensionImageRegex {\n projectExtension {\n id\n imageRegex {\n thumb {\n ...ImageRegex\n }\n small {\n ...ImageRegex\n }\n }\n }\n}\nfragment ImageRegex on ImageRegexOptions {\n flag\n search\n replace\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
|
|
15
15
|
const createGraphqlResponseForProjectExtensionImageRegexQuery = function () {
|
|
16
16
|
let customResponse = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|