@commercetools-frontend/application-shell-connectors 21.3.4 → 21.8.1

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020 commercetools GmbH
3
+ Copyright (c) commercetools GmbH
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -22,6 +22,7 @@ var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entr
22
22
  var _valuesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/values');
23
23
  var _URL = require('@babel/runtime-corejs3/core-js-stable/url');
24
24
  var jsxRuntime = require('@emotion/react/jsx-runtime');
25
+ var warning = require('tiny-warning');
25
26
  var react$1 = require('@apollo/client/react');
26
27
  var constants = require('@commercetools-frontend/constants');
27
28
  var sentry = require('@commercetools-frontend/sentry');
@@ -43,9 +44,10 @@ var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInsta
43
44
  var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
44
45
  var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInstanceProperty);
45
46
  var _URL__default = /*#__PURE__*/_interopDefault(_URL);
47
+ var warning__default = /*#__PURE__*/_interopDefault(warning);
46
48
 
47
49
  // NOTE: This string will be replaced on build time with the package version.
48
- var version = "21.3.4";
50
+ var version = "21.8.1";
49
51
 
50
52
  // From https://github.com/acdlite/recompose/blob/master/src/packages/recompose/getDisplayName.js
51
53
  var getDisplayName = function getDisplayName(Component) {
@@ -369,10 +371,28 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["def
369
371
 
370
372
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
371
373
  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 } } } };
374
+
375
+ var useWarning = function useWarning(condition, message) {
376
+ react.useEffect(function () {
377
+ process.env.NODE_ENV !== "production" ? warning__default["default"](condition, message) : void 0; // eslint-disable-next-line react-hooks/exhaustive-deps
378
+ }, []);
379
+ };
380
+
372
381
  var Context = /*#__PURE__*/react.createContext({
373
382
  isLoading: false
374
383
  });
375
384
 
385
+ var useProjectExtensionImageRegex = function useProjectExtensionImageRegex() {
386
+ var _useContext = react.useContext(Context),
387
+ isLoading = _useContext.isLoading,
388
+ imageRegex = _useContext.imageRegex;
389
+
390
+ return {
391
+ isLoading: isLoading,
392
+ imageRegex: imageRegex
393
+ };
394
+ };
395
+
376
396
  var ProjectExtensionProviderForImageRegex = function ProjectExtensionProviderForImageRegex(props) {
377
397
  var _useQuery = react$1.useQuery(FetchProjectExtensionImageRegex, {
378
398
  skip: props.skip,
@@ -400,6 +420,7 @@ ProjectExtensionProviderForImageRegex.propTypes = process.env.NODE_ENV !== "prod
400
420
  ProjectExtensionProviderForImageRegex.displayName = 'ProjectExtensionProviderForImageRegex';
401
421
 
402
422
  var GetProjectExtensionImageRegex = function GetProjectExtensionImageRegex(props) {
423
+ useWarning(false, "@commercetools-frontend/application-shell-connectors: It is not recommended to use the 'GetProjectExtensionImageRegex' anymore. Please use the 'useProjectExtensionImageRegex' hook instead.");
403
424
  return jsxRuntime.jsx(Context.Consumer, {
404
425
  children: function children(imageRegexContext) {
405
426
  return props.render(imageRegexContext);
@@ -416,9 +437,11 @@ function withProjectExtensionImageRegex() {
416
437
  var propKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'imageRegexData';
417
438
  return function (Component) {
418
439
  var WrappedComponent = function WrappedComponent(props) {
440
+ useWarning(false, "@commercetools-frontend/application-shell-connectors: It is not recommended to use the 'withProjectExtensionImageRegex' high order component anymore. Please use the 'useProjectExtensionImageRegex' hook instead.");
441
+ var imageregexContext = useProjectExtensionImageRegex();
419
442
  return jsxRuntime.jsx(GetProjectExtensionImageRegex, {
420
- render: function render(imageRegexData) {
421
- return jsxRuntime.jsx(Component, _objectSpread(_objectSpread({}, props), _defineProperty({}, propKey, imageRegexData)));
443
+ render: function render() {
444
+ return jsxRuntime.jsx(Component, _objectSpread(_objectSpread({}, props), _defineProperty({}, propKey, imageregexContext)));
422
445
  }
423
446
  });
424
447
  };
@@ -438,6 +461,7 @@ exports.normalizeAllAppliedDataFences = normalizeAllAppliedDataFences;
438
461
  exports.normalizeAllAppliedMenuVisibilities = normalizeAllAppliedMenuVisibilities;
439
462
  exports.normalizeAllAppliedPermissions = normalizeAllAppliedPermissions;
440
463
  exports.useApplicationContext = useApplicationContext;
464
+ exports.useProjectExtensionImageRegex = useProjectExtensionImageRegex;
441
465
  exports.version = version;
442
466
  exports.withApplicationContext = withApplicationContext;
443
467
  exports.withProjectExtensionImageRegex = withProjectExtensionImageRegex;
@@ -22,6 +22,7 @@ var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entr
22
22
  var _valuesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/values');
23
23
  var _URL = require('@babel/runtime-corejs3/core-js-stable/url');
24
24
  var jsxRuntime = require('@emotion/react/jsx-runtime');
25
+ require('tiny-warning');
25
26
  var react$1 = require('@apollo/client/react');
26
27
  var constants = require('@commercetools-frontend/constants');
27
28
  var sentry = require('@commercetools-frontend/sentry');
@@ -44,7 +45,7 @@ var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInsta
44
45
  var _URL__default = /*#__PURE__*/_interopDefault(_URL);
45
46
 
46
47
  // NOTE: This string will be replaced on build time with the package version.
47
- var version = "21.3.4";
48
+ var version = "21.8.1";
48
49
 
49
50
  // From https://github.com/acdlite/recompose/blob/master/src/packages/recompose/getDisplayName.js
50
51
  var getDisplayName = function getDisplayName(Component) {
@@ -363,10 +364,27 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["def
363
364
 
364
365
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
365
366
  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 } } } };
367
+
368
+ var useWarning = function useWarning(condition, message) {
369
+ react.useEffect(function () {
370
+ }, []);
371
+ };
372
+
366
373
  var Context = /*#__PURE__*/react.createContext({
367
374
  isLoading: false
368
375
  });
369
376
 
377
+ var useProjectExtensionImageRegex = function useProjectExtensionImageRegex() {
378
+ var _useContext = react.useContext(Context),
379
+ isLoading = _useContext.isLoading,
380
+ imageRegex = _useContext.imageRegex;
381
+
382
+ return {
383
+ isLoading: isLoading,
384
+ imageRegex: imageRegex
385
+ };
386
+ };
387
+
370
388
  var ProjectExtensionProviderForImageRegex = function ProjectExtensionProviderForImageRegex(props) {
371
389
  var _useQuery = react$1.useQuery(FetchProjectExtensionImageRegex, {
372
390
  skip: props.skip,
@@ -391,6 +409,7 @@ ProjectExtensionProviderForImageRegex.propTypes = {};
391
409
  ProjectExtensionProviderForImageRegex.displayName = 'ProjectExtensionProviderForImageRegex';
392
410
 
393
411
  var GetProjectExtensionImageRegex = function GetProjectExtensionImageRegex(props) {
412
+ useWarning();
394
413
  return jsxRuntime.jsx(Context.Consumer, {
395
414
  children: function children(imageRegexContext) {
396
415
  return props.render(imageRegexContext);
@@ -405,9 +424,11 @@ function withProjectExtensionImageRegex() {
405
424
  var propKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'imageRegexData';
406
425
  return function (Component) {
407
426
  var WrappedComponent = function WrappedComponent(props) {
427
+ useWarning();
428
+ var imageregexContext = useProjectExtensionImageRegex();
408
429
  return jsxRuntime.jsx(GetProjectExtensionImageRegex, {
409
- render: function render(imageRegexData) {
410
- return jsxRuntime.jsx(Component, _objectSpread(_objectSpread({}, props), _defineProperty({}, propKey, imageRegexData)));
430
+ render: function render() {
431
+ return jsxRuntime.jsx(Component, _objectSpread(_objectSpread({}, props), _defineProperty({}, propKey, imageregexContext)));
411
432
  }
412
433
  });
413
434
  };
@@ -427,6 +448,7 @@ exports.normalizeAllAppliedDataFences = normalizeAllAppliedDataFences;
427
448
  exports.normalizeAllAppliedMenuVisibilities = normalizeAllAppliedMenuVisibilities;
428
449
  exports.normalizeAllAppliedPermissions = normalizeAllAppliedPermissions;
429
450
  exports.useApplicationContext = useApplicationContext;
451
+ exports.useProjectExtensionImageRegex = useProjectExtensionImageRegex;
430
452
  exports.version = version;
431
453
  exports.withApplicationContext = withApplicationContext;
432
454
  exports.withProjectExtensionImageRegex = withProjectExtensionImageRegex;
@@ -8,7 +8,7 @@ import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/obje
8
8
  import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
9
9
  import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
10
10
  import _pt from 'prop-types';
11
- import { createContext, useContext } from 'react';
11
+ import { createContext, useContext, useEffect } from 'react';
12
12
  import moment from 'moment-timezone';
13
13
  import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
14
14
  import _toConsumableArray from '@babel/runtime-corejs3/helpers/esm/toConsumableArray';
@@ -18,12 +18,13 @@ import _Object$entries from '@babel/runtime-corejs3/core-js-stable/object/entrie
18
18
  import _valuesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/values';
19
19
  import _URL from '@babel/runtime-corejs3/core-js-stable/url';
20
20
  import { jsx } from '@emotion/react/jsx-runtime';
21
+ import warning from 'tiny-warning';
21
22
  import { useQuery } from '@apollo/client/react';
22
23
  import { GRAPHQL_TARGETS } from '@commercetools-frontend/constants';
23
24
  import { reportErrorToSentry } from '@commercetools-frontend/sentry';
24
25
 
25
26
  // NOTE: This string will be replaced on build time with the package version.
26
- var version = "21.3.4";
27
+ var version = "21.8.1";
27
28
 
28
29
  // From https://github.com/acdlite/recompose/blob/master/src/packages/recompose/getDisplayName.js
29
30
  var getDisplayName = function getDisplayName(Component) {
@@ -347,10 +348,28 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
347
348
 
348
349
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
349
350
  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 } } } };
351
+
352
+ var useWarning = function useWarning(condition, message) {
353
+ useEffect(function () {
354
+ process.env.NODE_ENV !== "production" ? warning(condition, message) : void 0; // eslint-disable-next-line react-hooks/exhaustive-deps
355
+ }, []);
356
+ };
357
+
350
358
  var Context = /*#__PURE__*/createContext({
351
359
  isLoading: false
352
360
  });
353
361
 
362
+ var useProjectExtensionImageRegex = function useProjectExtensionImageRegex() {
363
+ var _useContext = useContext(Context),
364
+ isLoading = _useContext.isLoading,
365
+ imageRegex = _useContext.imageRegex;
366
+
367
+ return {
368
+ isLoading: isLoading,
369
+ imageRegex: imageRegex
370
+ };
371
+ };
372
+
354
373
  var ProjectExtensionProviderForImageRegex = function ProjectExtensionProviderForImageRegex(props) {
355
374
  var _useQuery = useQuery(FetchProjectExtensionImageRegex, {
356
375
  skip: props.skip,
@@ -378,6 +397,7 @@ ProjectExtensionProviderForImageRegex.propTypes = process.env.NODE_ENV !== "prod
378
397
  ProjectExtensionProviderForImageRegex.displayName = 'ProjectExtensionProviderForImageRegex';
379
398
 
380
399
  var GetProjectExtensionImageRegex = function GetProjectExtensionImageRegex(props) {
400
+ useWarning(false, "@commercetools-frontend/application-shell-connectors: It is not recommended to use the 'GetProjectExtensionImageRegex' anymore. Please use the 'useProjectExtensionImageRegex' hook instead.");
381
401
  return jsx(Context.Consumer, {
382
402
  children: function children(imageRegexContext) {
383
403
  return props.render(imageRegexContext);
@@ -394,9 +414,11 @@ function withProjectExtensionImageRegex() {
394
414
  var propKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'imageRegexData';
395
415
  return function (Component) {
396
416
  var WrappedComponent = function WrappedComponent(props) {
417
+ useWarning(false, "@commercetools-frontend/application-shell-connectors: It is not recommended to use the 'withProjectExtensionImageRegex' high order component anymore. Please use the 'useProjectExtensionImageRegex' hook instead.");
418
+ var imageregexContext = useProjectExtensionImageRegex();
397
419
  return jsx(GetProjectExtensionImageRegex, {
398
- render: function render(imageRegexData) {
399
- return jsx(Component, _objectSpread(_objectSpread({}, props), _defineProperty({}, propKey, imageRegexData)));
420
+ render: function render() {
421
+ return jsx(Component, _objectSpread(_objectSpread({}, props), _defineProperty({}, propKey, imageregexContext)));
400
422
  }
401
423
  });
402
424
  };
@@ -406,4 +428,4 @@ function withProjectExtensionImageRegex() {
406
428
  };
407
429
  } // Exports
408
430
 
409
- export { ApplicationContext, ApplicationContextProvider, Context$1 as Context, GetProjectExtensionImageRegex, ProjectExtensionProviderForImageRegex, normalizeAllAppliedActionRights, normalizeAllAppliedDataFences, normalizeAllAppliedMenuVisibilities, normalizeAllAppliedPermissions, useApplicationContext, version, withApplicationContext, withProjectExtensionImageRegex };
431
+ export { ApplicationContext, ApplicationContextProvider, Context$1 as Context, GetProjectExtensionImageRegex, ProjectExtensionProviderForImageRegex, normalizeAllAppliedActionRights, normalizeAllAppliedDataFences, normalizeAllAppliedMenuVisibilities, normalizeAllAppliedPermissions, useApplicationContext, useProjectExtensionImageRegex, version, withApplicationContext, withProjectExtensionImageRegex };
@@ -1 +1,3 @@
1
- export { GetProjectExtensionImageRegex, ProjectExtensionProviderForImageRegex, withProjectExtensionImageRegex, } from './project-extension-image-regex';
1
+ import type { TImageRegexContext as ImageRegexContext } from './project-extension-image-regex';
2
+ export declare type TImageRegexContext = ImageRegexContext;
3
+ export { GetProjectExtensionImageRegex, ProjectExtensionProviderForImageRegex, withProjectExtensionImageRegex, useProjectExtensionImageRegex, } from './project-extension-image-regex';
@@ -1,5 +1,5 @@
1
1
  import type { TImageRegexOptions } from '../../types/generated/settings';
2
- import { ComponentType, ReactNode } from 'react';
2
+ import { type ComponentType, type ReactNode } from 'react';
3
3
  export declare type TImageRegexContext = {
4
4
  isLoading: boolean;
5
5
  imageRegex?: {
@@ -15,6 +15,13 @@ declare type ConsumerProps = {
15
15
  render: (imageRegex: TImageRegexContext) => ReactNode;
16
16
  children?: never;
17
17
  };
18
+ declare const useProjectExtensionImageRegex: () => {
19
+ isLoading: boolean;
20
+ imageRegex: {
21
+ small?: Pick<TImageRegexOptions, "replace" | "search" | "flag"> | null | undefined;
22
+ thumb?: Pick<TImageRegexOptions, "replace" | "search" | "flag"> | null | undefined;
23
+ } | null | undefined;
24
+ };
18
25
  declare const ProjectExtensionProviderForImageRegex: {
19
26
  (props: ProviderProps): import("@emotion/react/jsx-runtime").JSX.Element;
20
27
  displayName: string;
@@ -27,4 +34,4 @@ declare function withProjectExtensionImageRegex<Props extends {}>(propKey?: stri
27
34
  (props: Props): import("@emotion/react/jsx-runtime").JSX.Element;
28
35
  displayName: string;
29
36
  };
30
- export { GetProjectExtensionImageRegex, ProjectExtensionProviderForImageRegex, withProjectExtensionImageRegex, };
37
+ export { GetProjectExtensionImageRegex, ProjectExtensionProviderForImageRegex, withProjectExtensionImageRegex, useProjectExtensionImageRegex, };
@@ -1,7 +1,9 @@
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 { TImageRegexContext as ImageRegexContext } from './components/project-extension-image-regex';
2
3
  export declare type TProviderProps<AdditionalEnvironmentProperties extends {}> = ProviderProps<AdditionalEnvironmentProperties>;
3
4
  export declare type TApplicationContext<AdditionalEnvironmentProperties extends {}> = ApplicationContext<AdditionalEnvironmentProperties>;
4
5
  export declare type TNormalizedMenuVisibilities = NormalizedMenuVisibilities;
5
6
  export declare type TNormalizedPermissions = NormalizedPermissions;
6
7
  export declare type TNormalizedActionRights = NormalizedActionRights;
7
8
  export declare type TNormalizedDataFences = NormalizedDataFences;
9
+ export declare type TImageRegexContext = ImageRegexContext;
@@ -1,4 +1,4 @@
1
1
  export { default as version } from './version';
2
2
  export * from './export-types';
3
3
  export { Context, ApplicationContext, ApplicationContextProvider, withApplicationContext, useApplicationContext, normalizeAllAppliedActionRights, normalizeAllAppliedDataFences, normalizeAllAppliedMenuVisibilities, normalizeAllAppliedPermissions, } from './components/application-context';
4
- export { GetProjectExtensionImageRegex, ProjectExtensionProviderForImageRegex, withProjectExtensionImageRegex, } from './components/project-extension-image-regex';
4
+ export { GetProjectExtensionImageRegex, ProjectExtensionProviderForImageRegex, withProjectExtensionImageRegex, useProjectExtensionImageRegex, } from './components/project-extension-image-regex';
@@ -1,4 +1,5 @@
1
1
  export declare type Maybe<T> = T | null;
2
+ export declare type InputMaybe<T> = Maybe<T>;
2
3
  export declare type Exact<T extends {
3
4
  [key: string]: unknown;
4
5
  }> = {
@@ -51,7 +52,7 @@ export declare type TCartClassificationValue = {
51
52
  key: Scalars['String'];
52
53
  };
53
54
  export declare type TChangeUserBusinessRole = {
54
- businessRole?: Maybe<Scalars['String']>;
55
+ businessRole?: InputMaybe<Scalars['String']>;
55
56
  };
56
57
  export declare type TChangeUserLanguage = {
57
58
  language: Scalars['String'];
@@ -90,7 +91,7 @@ export declare type TInvitationInput = {
90
91
  };
91
92
  export declare type TInvitationOrganizationInput = {
92
93
  id: Scalars['ID'];
93
- name?: Maybe<Scalars['String']>;
94
+ name?: InputMaybe<Scalars['String']>;
94
95
  version: Scalars['Int'];
95
96
  };
96
97
  export declare type TInvitationQueryResult = {
@@ -158,14 +159,13 @@ export declare type TMutation_CreateOAuthClientArgs = {
158
159
  };
159
160
  export declare type TMutation_DeleteAccountArgs = {
160
161
  jwt: Scalars['String'];
161
- origin?: Maybe<Scalars['String']>;
162
162
  };
163
163
  export declare type TMutation_DeleteOAuthClientArgs = {
164
164
  id: Scalars['ID'];
165
165
  };
166
166
  export declare type TMutation_InviteArgs = {
167
167
  draft: TInvitationInput;
168
- origin?: Maybe<Scalars['String']>;
168
+ origin?: InputMaybe<Scalars['String']>;
169
169
  };
170
170
  export declare type TMutation_RandomArgs = {
171
171
  byteLength: Scalars['Int'];
@@ -173,20 +173,14 @@ export declare type TMutation_RandomArgs = {
173
173
  export declare type TMutation_ResetPasswordArgs = {
174
174
  draft: TResetPasswordDraft;
175
175
  jwt: Scalars['String'];
176
- origin?: Maybe<Scalars['String']>;
177
- };
178
- export declare type TMutation_SendLinkToDeleteAccountArgs = {
179
- origin?: Maybe<Scalars['String']>;
180
176
  };
181
177
  export declare type TMutation_SendLinkToResetPasswordArgs = {
182
178
  email: Scalars['String'];
183
- origin?: Maybe<Scalars['String']>;
184
179
  };
185
180
  export declare type TMutation_SendLinkToSignUpArgs = {
186
- additionalInfo?: Maybe<TAdditionalUserInfo>;
181
+ additionalInfo?: InputMaybe<TAdditionalUserInfo>;
187
182
  email: Scalars['String'];
188
- language?: Maybe<Scalars['String']>;
189
- origin?: Maybe<Scalars['String']>;
183
+ language?: InputMaybe<Scalars['String']>;
190
184
  };
191
185
  export declare type TMutation_SignUpArgs = {
192
186
  draft: TUserDraft;
@@ -252,6 +246,7 @@ export declare enum TPermissionScope {
252
246
  GetPermissionForAnyProject = "get_permission_for_any_project",
253
247
  IntrospectOauthTokens = "introspect_oauth_tokens",
254
248
  ManageApiClients = "manage_api_clients",
249
+ ManageAttributeGroups = "manage_attribute_groups",
255
250
  ManageAuditLog = "manage_audit_log",
256
251
  ManageCartDiscounts = "manage_cart_discounts",
257
252
  ManageCategories = "manage_categories",
@@ -271,17 +266,20 @@ export declare enum TPermissionScope {
271
266
  ManageOrderEdits = "manage_order_edits",
272
267
  ManageOrders = "manage_orders",
273
268
  ManagePayments = "manage_payments",
269
+ ManageProductSelections = "manage_product_selections",
274
270
  ManageProducts = "manage_products",
275
271
  ManageProject = "manage_project",
276
272
  ManageProjectSettings = "manage_project_settings",
277
273
  ManageShippingMethods = "manage_shipping_methods",
278
274
  ManageShoppingLists = "manage_shopping_lists",
275
+ ManageStandalonePrices = "manage_standalone_prices",
279
276
  ManageStates = "manage_states",
280
277
  ManageStores = "manage_stores",
281
278
  ManageSubscriptions = "manage_subscriptions",
282
279
  ManageTaxCategories = "manage_tax_categories",
283
280
  ManageTypes = "manage_types",
284
281
  ViewApiClients = "view_api_clients",
282
+ ViewAttributeGroups = "view_attribute_groups",
285
283
  ViewAuditLog = "view_audit_log",
286
284
  ViewCartDiscounts = "view_cart_discounts",
287
285
  ViewCategories = "view_categories",
@@ -296,12 +294,14 @@ export declare enum TPermissionScope {
296
294
  ViewOrderEdits = "view_order_edits",
297
295
  ViewOrders = "view_orders",
298
296
  ViewPayments = "view_payments",
297
+ ViewProductSelections = "view_product_selections",
299
298
  ViewProducts = "view_products",
300
299
  ViewProjectSettings = "view_project_settings",
301
300
  ViewProjects = "view_projects",
302
301
  ViewPublishedProducts = "view_published_products",
303
302
  ViewShippingMethods = "view_shipping_methods",
304
303
  ViewShoppingLists = "view_shopping_lists",
304
+ ViewStandalonePrices = "view_standalone_prices",
305
305
  ViewStates = "view_states",
306
306
  ViewStores = "view_stores",
307
307
  ViewTaxCategories = "view_tax_categories",
@@ -334,10 +334,10 @@ export declare type TProject = TMetaData & {
334
334
  export declare type TProjectDraftType = {
335
335
  countries: Array<Scalars['String']>;
336
336
  currencies: Array<Scalars['String']>;
337
- deleteDaysAfterCreation?: Maybe<Scalars['Int']>;
337
+ deleteDaysAfterCreation?: InputMaybe<Scalars['Int']>;
338
338
  key: Scalars['String'];
339
339
  languages: Array<Scalars['String']>;
340
- messagesEnabled?: Maybe<Scalars['Boolean']>;
340
+ messagesEnabled?: InputMaybe<Scalars['Boolean']>;
341
341
  name: Scalars['String'];
342
342
  ownerId: Scalars['String'];
343
343
  };
@@ -361,8 +361,8 @@ export declare type TProjectPermission = {
361
361
  };
362
362
  export declare type TProjectPermissionInput = {
363
363
  key: TPermissionScope;
364
- projectKey?: Maybe<Scalars['String']>;
365
- storeKey?: Maybe<Scalars['String']>;
364
+ projectKey?: InputMaybe<Scalars['String']>;
365
+ storeKey?: InputMaybe<Scalars['String']>;
366
366
  };
367
367
  export declare type TProjectQueryResult = TQueryResult & {
368
368
  __typename?: 'ProjectQueryResult';
@@ -403,26 +403,26 @@ export declare type TQuery = {
403
403
  storeOAuthScopes: Array<TPermissionScope>;
404
404
  };
405
405
  export declare type TQuery_AllImpliedOAuthScopesArgs = {
406
- onlyConfiguredOnTrustedClient?: Maybe<Scalars['Boolean']>;
406
+ onlyConfiguredOnTrustedClient?: InputMaybe<Scalars['Boolean']>;
407
407
  resourceAccessPermissions: Array<Scalars['String']>;
408
408
  };
409
409
  export declare type TQuery_InvitationArgs = {
410
- where?: Maybe<TInvitationWhereInput>;
410
+ where?: InputMaybe<TInvitationWhereInput>;
411
411
  };
412
412
  export declare type TQuery_OAuthClientArgs = {
413
413
  id: Scalars['String'];
414
414
  };
415
415
  export declare type TQuery_OAuthClientsArgs = {
416
- limit?: Maybe<Scalars['Int']>;
417
- offset?: Maybe<Scalars['Int']>;
418
- sort?: Maybe<Array<Scalars['String']>>;
416
+ limit?: InputMaybe<Scalars['Int']>;
417
+ offset?: InputMaybe<Scalars['Int']>;
418
+ sort?: InputMaybe<Array<Scalars['String']>>;
419
419
  };
420
420
  export declare type TQuery_ProjectArgs = {
421
- key?: Maybe<Scalars['String']>;
421
+ key?: InputMaybe<Scalars['String']>;
422
422
  };
423
423
  export declare type TQuery_ReleasesArgs = {
424
- limit?: Maybe<Scalars['Int']>;
425
- offset?: Maybe<Scalars['Int']>;
424
+ limit?: InputMaybe<Scalars['Int']>;
425
+ offset?: InputMaybe<Scalars['Int']>;
426
426
  origin: TReleaseOrigin;
427
427
  };
428
428
  export declare type TQueryResult = {
@@ -455,8 +455,8 @@ export declare type TReleaseHistory = {
455
455
  title: Scalars['String'];
456
456
  };
457
457
  export declare type TReleaseHistory_EntriesArgs = {
458
- limit?: Maybe<Scalars['Int']>;
459
- offset?: Maybe<Scalars['Int']>;
458
+ limit?: InputMaybe<Scalars['Int']>;
459
+ offset?: InputMaybe<Scalars['Int']>;
460
460
  };
461
461
  export declare enum TReleaseOrigin {
462
462
  Ctp = "ctp",
@@ -481,7 +481,7 @@ export declare type TResetUser = {
481
481
  id: Scalars['String'];
482
482
  };
483
483
  export declare type TSetUserTimeZone = {
484
- timeZone?: Maybe<Scalars['String']>;
484
+ timeZone?: InputMaybe<Scalars['String']>;
485
485
  };
486
486
  export declare type TShippingRateInputType = {
487
487
  __typename?: 'ShippingRateInputType';
@@ -554,18 +554,18 @@ export declare type TUser = TMetaData & {
554
554
  version?: Maybe<Scalars['Int']>;
555
555
  };
556
556
  export declare type TUserDraft = {
557
- businessRole?: Maybe<Scalars['String']>;
557
+ businessRole?: InputMaybe<Scalars['String']>;
558
558
  firstName: Scalars['String'];
559
559
  lastName: Scalars['String'];
560
560
  password: Scalars['String'];
561
561
  };
562
562
  export declare type TUserUpdateAction = {
563
- changeBusinessRole?: Maybe<TChangeUserBusinessRole>;
564
- changeLanguage?: Maybe<TChangeUserLanguage>;
565
- changeName?: Maybe<TChangeUserName>;
566
- changeNumberFormat?: Maybe<TChangeUserNumberFormat>;
567
- changePassword?: Maybe<TChangeUserPassword>;
568
- setTimeZone?: Maybe<TSetUserTimeZone>;
563
+ changeBusinessRole?: InputMaybe<TChangeUserBusinessRole>;
564
+ changeLanguage?: InputMaybe<TChangeUserLanguage>;
565
+ changeName?: InputMaybe<TChangeUserName>;
566
+ changeNumberFormat?: InputMaybe<TChangeUserNumberFormat>;
567
+ changePassword?: InputMaybe<TChangeUserPassword>;
568
+ setTimeZone?: InputMaybe<TSetUserTimeZone>;
569
569
  };
570
570
  export declare type TAmILoggedInQueryVariables = Exact<{
571
571
  [key: string]: never;
@@ -582,7 +582,7 @@ export declare type TFetchProjectQuery = {
582
582
  project?: {
583
583
  __typename?: 'Project';
584
584
  key: string;
585
- version?: number | null | undefined;
585
+ version?: number | null;
586
586
  name: string;
587
587
  countries: Array<string>;
588
588
  currencies: Array<string>;
@@ -591,12 +591,12 @@ export declare type TFetchProjectQuery = {
591
591
  expiry: {
592
592
  __typename?: 'ProjectExpiry';
593
593
  isActive: boolean;
594
- daysLeft?: number | null | undefined;
594
+ daysLeft?: number | null;
595
595
  };
596
596
  suspension: {
597
597
  __typename?: 'ProjectSuspension';
598
598
  isActive: boolean;
599
- reason?: TProjectSuspensionReason | null | undefined;
599
+ reason?: TProjectSuspensionReason | null;
600
600
  };
601
601
  allAppliedPermissions: Array<{
602
602
  __typename?: 'AppliedPermission';
@@ -647,7 +647,7 @@ export declare type TFetchProjectQuery = {
647
647
  id: string;
648
648
  name: string;
649
649
  };
650
- } | null | undefined;
650
+ } | null;
651
651
  };
652
652
  export declare type TFetchLoggedInUserQueryVariables = Exact<{
653
653
  [key: string]: never;
@@ -663,14 +663,14 @@ export declare type TFetchLoggedInUserQuery = {
663
663
  lastName: string;
664
664
  language: string;
665
665
  numberFormat: string;
666
- timeZone?: string | null | undefined;
666
+ timeZone?: string | null;
667
667
  launchdarklyTrackingId: string;
668
668
  launchdarklyTrackingGroup: string;
669
- launchdarklyTrackingSubgroup?: string | null | undefined;
670
- launchdarklyTrackingTeam?: Array<string> | null | undefined;
669
+ launchdarklyTrackingSubgroup?: string | null;
670
+ launchdarklyTrackingTeam?: Array<string> | null;
671
671
  launchdarklyTrackingTenant: string;
672
- defaultProjectKey?: string | null | undefined;
673
- businessRole?: string | null | undefined;
672
+ defaultProjectKey?: string | null;
673
+ businessRole?: string | null;
674
674
  projects: {
675
675
  __typename?: 'ProjectQueryResult';
676
676
  total: number;
@@ -688,7 +688,7 @@ export declare type TFetchLoggedInUserQuery = {
688
688
  };
689
689
  }>;
690
690
  };
691
- } | null | undefined;
691
+ } | null;
692
692
  };
693
693
  export declare type TFetchUserProjectsQueryVariables = Exact<{
694
694
  [key: string]: never;
@@ -714,7 +714,7 @@ export declare type TFetchUserProjectsQuery = {
714
714
  };
715
715
  }>;
716
716
  };
717
- } | null | undefined;
717
+ } | null;
718
718
  };
719
719
  export declare type TAllFeaturesQueryVariables = Exact<{
720
720
  [key: string]: never;
@@ -725,7 +725,7 @@ export declare type TAllFeaturesQuery = {
725
725
  __typename?: 'Feature';
726
726
  name: string;
727
727
  value: boolean;
728
- reason?: string | null | undefined;
728
+ reason?: string | null;
729
729
  }>;
730
730
  };
731
731
  export declare type TFetchUserIdQueryVariables = Exact<{
@@ -736,5 +736,5 @@ export declare type TFetchUserIdQuery = {
736
736
  user?: {
737
737
  __typename?: 'User';
738
738
  id: string;
739
- } | null | undefined;
739
+ } | null;
740
740
  };
@@ -332,6 +332,7 @@ export declare type TDashboardView = {
332
332
  layout?: Maybe<Array<TLayoutCard>>;
333
333
  nameAllLocales?: Maybe<Array<TLocalizedField>>;
334
334
  projectKey: Scalars['String'];
335
+ timeZone?: Maybe<Scalars['String']>;
335
336
  updatedAt: Scalars['DateTime'];
336
337
  userId: Scalars['String'];
337
338
  };
@@ -357,6 +358,7 @@ export declare type TDashboardViewInput = {
357
358
  currencyCode?: InputMaybe<Scalars['String']>;
358
359
  layout: Array<TLayoutCardInput>;
359
360
  nameAllLocales: Array<TLocalizedFieldCreateInput>;
361
+ timeZone?: InputMaybe<Scalars['String']>;
360
362
  };
361
363
  export declare enum TDateFilterType {
362
364
  Custom = "CUSTOM",
@@ -1172,6 +1174,29 @@ export declare type TMutation_UpdateVariantPricesListViewArgs = {
1172
1174
  export declare type TMutation_VerifyCustomApplicationsMaintainerContactEmailArgs = {
1173
1175
  token: Scalars['String'];
1174
1176
  };
1177
+ export declare type TMyCustomApplication = {
1178
+ __typename?: 'MyCustomApplication';
1179
+ createdAt: Scalars['DateTime'];
1180
+ description?: Maybe<Scalars['String']>;
1181
+ entryPointUriPath: Scalars['String'];
1182
+ icon: Scalars['String'];
1183
+ id: Scalars['ID'];
1184
+ mainMenuLink: TCustomApplicationMenuLink;
1185
+ name: Scalars['String'];
1186
+ organizationId: Scalars['String'];
1187
+ organizationName: Scalars['String'];
1188
+ permissions: Array<TCustomApplicationPermission>;
1189
+ status: TCustomApplicationStatus;
1190
+ submenuLinks: Array<TCustomApplicationSubmenuLink>;
1191
+ updatedAt: Scalars['DateTime'];
1192
+ url: Scalars['String'];
1193
+ };
1194
+ export declare type TMyCustomApplicationQueryInput = {
1195
+ where?: InputMaybe<TMyCustomApplicationQueryWhereInput>;
1196
+ };
1197
+ export declare type TMyCustomApplicationQueryWhereInput = {
1198
+ status?: InputMaybe<TCustomApplicationStatus>;
1199
+ };
1175
1200
  export declare type TNavbarMenu = {
1176
1201
  __typename?: 'NavbarMenu';
1177
1202
  createdAt: Scalars['DateTime'];
@@ -1513,6 +1538,7 @@ export declare type TOrganizationExtensionForCustomApplication = {
1513
1538
  application: TRestrictedCustomApplicationForOrganization;
1514
1539
  id: Scalars['ID'];
1515
1540
  organizationId: Scalars['String'];
1541
+ organizationName?: Maybe<Scalars['String']>;
1516
1542
  };
1517
1543
  export declare type TPimSearchListView = {
1518
1544
  __typename?: 'PimSearchListView';
@@ -1650,6 +1676,7 @@ export declare type TQuery = {
1650
1676
  discountCodesListView?: Maybe<TDiscountCodesListView>;
1651
1677
  globalOrganizationExtension?: Maybe<TOrganizationExtension>;
1652
1678
  legacyCustomApplication?: Maybe<TLegacyCustomApplication>;
1679
+ myCustomApplications: Array<TMyCustomApplication>;
1653
1680
  ordersListView?: Maybe<TOrdersListView>;
1654
1681
  ordersListViews: Array<Maybe<TOrdersListView>>;
1655
1682
  organizationExtension?: Maybe<TOrganizationExtension>;
@@ -1703,6 +1730,9 @@ export declare type TQuery_GlobalOrganizationExtensionArgs = {
1703
1730
  export declare type TQuery_LegacyCustomApplicationArgs = {
1704
1731
  applicationId: Scalars['ID'];
1705
1732
  };
1733
+ export declare type TQuery_MyCustomApplicationsArgs = {
1734
+ params?: InputMaybe<TMyCustomApplicationQueryInput>;
1735
+ };
1706
1736
  export declare type TQuery_OrdersListViewArgs = {
1707
1737
  id: Scalars['ID'];
1708
1738
  };
@@ -2306,6 +2336,7 @@ export declare type TFetchCustomApplicationFromCliQuery = {
2306
2336
  mainMenuLink: {
2307
2337
  __typename?: 'CustomApplicationMenuLink';
2308
2338
  defaultLabel: string;
2339
+ permissions: Array<string>;
2309
2340
  labelAllLocales: Array<{
2310
2341
  __typename?: 'LocalizedField';
2311
2342
  locale: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/application-shell-connectors",
3
- "version": "21.3.4",
3
+ "version": "21.8.1",
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": {
@@ -23,8 +23,8 @@
23
23
  "dependencies": {
24
24
  "@babel/runtime": "^7.17.9",
25
25
  "@babel/runtime-corejs3": "^7.17.9",
26
- "@commercetools-frontend/constants": "21.3.4",
27
- "@commercetools-frontend/sentry": "21.3.4",
26
+ "@commercetools-frontend/constants": "21.8.1",
27
+ "@commercetools-frontend/sentry": "21.8.1",
28
28
  "@emotion/react": "11.9.0",
29
29
  "@types/lodash": "^4.14.181",
30
30
  "@types/prop-types": "^15.7.5",
@@ -32,10 +32,11 @@
32
32
  "graphql": "15.8.0",
33
33
  "lodash": "4.17.21",
34
34
  "moment-timezone": "^0.5.34",
35
- "prop-types": "15.8.1"
35
+ "prop-types": "15.8.1",
36
+ "tiny-warning": "1.0.3"
36
37
  },
37
38
  "devDependencies": {
38
- "@apollo/client": "3.5.10",
39
+ "@apollo/client": "3.6.2",
39
40
  "@testing-library/react": "12.1.5",
40
41
  "react": "17.0.2"
41
42
  },