@commercetools-frontend/application-shell-connectors 21.23.6 → 21.23.8
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 +1 -1
- package/dist/commercetools-frontend-application-shell-connectors.cjs.prod.js +1 -1
- package/dist/commercetools-frontend-application-shell-connectors.esm.js +1 -1
- package/dist/declarations/src/components/application-context/application-context.d.ts +14 -14
- package/dist/declarations/src/components/application-context/index.d.ts +6 -6
- package/dist/declarations/src/components/application-context/normalizers.d.ts +9 -9
- package/dist/declarations/src/components/project-extension-image-regex/index.d.ts +1 -1
- package/dist/declarations/src/components/project-extension-image-regex/project-extension-image-regex.d.ts +3 -3
- package/dist/declarations/src/export-types.d.ts +7 -7
- package/dist/declarations/src/types/generated/mc.d.ts +103 -103
- package/dist/declarations/src/types/generated/settings.d.ts +248 -248
- package/package.json +10 -10
|
@@ -47,7 +47,7 @@ var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInsta
|
|
|
47
47
|
var warning__default = /*#__PURE__*/_interopDefault(warning);
|
|
48
48
|
|
|
49
49
|
// NOTE: This string will be replaced on build time with the package version.
|
|
50
|
-
var version = "21.23.
|
|
50
|
+
var version = "21.23.8";
|
|
51
51
|
|
|
52
52
|
var mcHostnameRegex = /^mc(-(\d){4,})?\.(.*)$/;
|
|
53
53
|
var mcPreviewHostnameRegex = /^.*\.mc-preview\.(.*)$/;
|
|
@@ -45,7 +45,7 @@ var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
|
|
|
45
45
|
var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInstanceProperty);
|
|
46
46
|
|
|
47
47
|
// NOTE: This string will be replaced on build time with the package version.
|
|
48
|
-
var version = "21.23.
|
|
48
|
+
var version = "21.23.8";
|
|
49
49
|
|
|
50
50
|
var mcHostnameRegex = /^mc(-(\d){4,})?\.(.*)$/;
|
|
51
51
|
var mcPreviewHostnameRegex = /^.*\.mc-preview\.(.*)$/;
|
|
@@ -24,7 +24,7 @@ import { useQuery } from '@apollo/client/react';
|
|
|
24
24
|
import { GRAPHQL_TARGETS } from '@commercetools-frontend/constants';
|
|
25
25
|
|
|
26
26
|
// NOTE: This string will be replaced on build time with the package version.
|
|
27
|
-
var version = "21.23.
|
|
27
|
+
var version = "21.23.8";
|
|
28
28
|
|
|
29
29
|
var mcHostnameRegex = /^mc(-(\d){4,})?\.(.*)$/;
|
|
30
30
|
var mcPreviewHostnameRegex = /^.*\.mc-preview\.(.*)$/;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import type { ApplicationWindow } from '@commercetools-frontend/constants';
|
|
2
2
|
import type { TFetchLoggedInUserQuery, TFetchProjectQuery, TIdTokenUserInfo } from '../../types/generated/mc';
|
|
3
3
|
import { ComponentType, ReactNode } from 'react';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
type TFetchedUser = TFetchLoggedInUserQuery['user'];
|
|
5
|
+
type TFetchedProject = TFetchProjectQuery['project'];
|
|
6
|
+
type TApplicationContextPermissions = {
|
|
7
7
|
[key: string]: boolean;
|
|
8
8
|
};
|
|
9
|
-
|
|
9
|
+
type TActionRight = {
|
|
10
10
|
[key: string]: boolean;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
type TApplicationContextActionRights = {
|
|
13
13
|
[key: string]: TActionRight;
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
type TApplicationContextGroupedByPermission = {
|
|
16
16
|
[key: string]: {
|
|
17
17
|
values: string[];
|
|
18
18
|
} | null;
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
type TApplicationContextGroupedByResourceType = {
|
|
21
21
|
[key: string]: TApplicationContextGroupedByPermission | null;
|
|
22
22
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
type TApplicationContextDataFenceType = 'store';
|
|
24
|
+
type TApplicationContextDataFences = Partial<Record<TApplicationContextDataFenceType, TApplicationContextGroupedByResourceType>>;
|
|
25
|
+
type TApplicationContextEnvironment = ApplicationWindow['app'];
|
|
26
|
+
type TApplicationContextUser = Pick<NonNullable<TFetchedUser>, 'id' | 'email' | 'createdAt' | 'firstName' | 'lastName' | 'businessRole' | 'projects'> & {
|
|
27
27
|
locale: string;
|
|
28
28
|
timeZone: string;
|
|
29
29
|
idTokenUserInfo?: Omit<TIdTokenUserInfo, 'additionalClaims'> & {
|
|
@@ -87,7 +87,7 @@ export declare const mapProjectToApplicationContextProject: (project?: TFetchedP
|
|
|
87
87
|
ownerId: string;
|
|
88
88
|
ownerName: string;
|
|
89
89
|
} | null;
|
|
90
|
-
export
|
|
90
|
+
export type TApplicationContext<AdditionalEnvironmentProperties extends {}> = {
|
|
91
91
|
environment: AdditionalEnvironmentProperties & TApplicationContextEnvironment;
|
|
92
92
|
user: ReturnType<typeof mapUserToApplicationContextUser>;
|
|
93
93
|
project: ReturnType<typeof mapProjectToApplicationContextProject>;
|
|
@@ -96,14 +96,14 @@ export declare type TApplicationContext<AdditionalEnvironmentProperties extends
|
|
|
96
96
|
dataFences: TApplicationContextDataFences | null;
|
|
97
97
|
dataLocale: string | null;
|
|
98
98
|
};
|
|
99
|
-
export
|
|
99
|
+
export type ProviderProps<AdditionalEnvironmentProperties extends {}> = {
|
|
100
100
|
environment: AdditionalEnvironmentProperties & TApplicationContextEnvironment;
|
|
101
101
|
user?: TFetchedUser;
|
|
102
102
|
project?: TFetchedProject;
|
|
103
103
|
projectDataLocale?: string;
|
|
104
104
|
children: ReactNode;
|
|
105
105
|
};
|
|
106
|
-
|
|
106
|
+
type ConsumerProps<AdditionalEnvironmentProperties extends {}> = {
|
|
107
107
|
render: (context: TApplicationContext<AdditionalEnvironmentProperties>) => ReactNode;
|
|
108
108
|
children?: never;
|
|
109
109
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ProviderProps, TApplicationContext as ApplicationContext } from './application-context';
|
|
2
2
|
import type { TMenuVisibilities as NormalizedMenuVisibilities, TPermissions as NormalizedPermissions, TActionRights as NormalizedActionRights, TDataFences as NormalizedDataFences } from './normalizers';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
3
|
+
export type TProviderProps<AdditionalEnvironmentProperties extends {}> = ProviderProps<AdditionalEnvironmentProperties>;
|
|
4
|
+
export type TApplicationContext<AdditionalEnvironmentProperties extends {}> = ApplicationContext<AdditionalEnvironmentProperties>;
|
|
5
|
+
export type TNormalizedMenuVisibilities = NormalizedMenuVisibilities;
|
|
6
|
+
export type TNormalizedPermissions = NormalizedPermissions;
|
|
7
|
+
export type TNormalizedActionRights = NormalizedActionRights;
|
|
8
|
+
export type TNormalizedDataFences = NormalizedDataFences;
|
|
9
9
|
export { Context, ApplicationContext, ApplicationContextProvider, withApplicationContext, useApplicationContext, } from './application-context';
|
|
10
10
|
export { normalizeAllAppliedActionRights, normalizeAllAppliedDataFences, normalizeAllAppliedMenuVisibilities, normalizeAllAppliedPermissions, } from './normalizers';
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import type { TAppliedPermission, TAppliedActionRight, TAppliedMenuVisibilities, TStoreDataFence } from '../../types/generated/mc';
|
|
2
|
-
export
|
|
2
|
+
export type TMenuVisibilities = {
|
|
3
3
|
[key: string]: boolean;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type TPermissions = {
|
|
6
6
|
[key: string]: boolean;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type TActionRight = {
|
|
9
9
|
[key: string]: boolean;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type TActionRights = {
|
|
12
12
|
[key: string]: TActionRight;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type TDataFenceGroupedByPermission = {
|
|
15
15
|
[key: string]: {
|
|
16
16
|
values: string[];
|
|
17
17
|
} | null;
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type TDataFenceGroupedByResourceType = {
|
|
20
20
|
[key: string]: TDataFenceGroupedByPermission | null;
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type TDataFenceStoresGroupByResourceType = {
|
|
23
23
|
[key: string]: TStoreDataFence[];
|
|
24
24
|
};
|
|
25
|
-
export
|
|
26
|
-
export
|
|
25
|
+
export type TDataFenceType = 'store';
|
|
26
|
+
export type TDataFences = Partial<Record<TDataFenceType, TDataFenceGroupedByResourceType>>;
|
|
27
27
|
export declare const normalizeAllAppliedPermissions: (allAppliedPermissions?: TAppliedPermission[]) => TPermissions | null;
|
|
28
28
|
export declare const normalizeAllAppliedMenuVisibilities: (allAppliedMenuVisibilities?: TAppliedMenuVisibilities[]) => TMenuVisibilities | null;
|
|
29
29
|
export declare const normalizeAllAppliedActionRights: (allAppliedActionRights?: TAppliedActionRight[]) => TActionRights | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { TImageRegexContext as ImageRegexContext } from './project-extension-image-regex';
|
|
2
|
-
export
|
|
2
|
+
export type TImageRegexContext = ImageRegexContext;
|
|
3
3
|
export { GetProjectExtensionImageRegex, ProjectExtensionProviderForImageRegex, withProjectExtensionImageRegex, useProjectExtensionImageRegex, } from './project-extension-image-regex';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { TImageRegexOptions } from '../../types/generated/settings';
|
|
2
2
|
import { type ComponentType, type ReactNode } from 'react';
|
|
3
|
-
export
|
|
3
|
+
export type TImageRegexContext = {
|
|
4
4
|
isLoading: boolean;
|
|
5
5
|
imageRegex?: {
|
|
6
6
|
small?: Pick<TImageRegexOptions, 'flag' | 'replace' | 'search'> | null;
|
|
7
7
|
thumb?: Pick<TImageRegexOptions, 'flag' | 'replace' | 'search'> | null;
|
|
8
8
|
} | null;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
type ProviderProps = {
|
|
11
11
|
skip?: boolean;
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
type ConsumerProps = {
|
|
15
15
|
render: (imageRegex: TImageRegexContext) => ReactNode;
|
|
16
16
|
children?: never;
|
|
17
17
|
};
|
|
@@ -1,9 +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
2
|
import type { TImageRegexContext as ImageRegexContext } from './components/project-extension-image-regex';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
3
|
+
export type TProviderProps<AdditionalEnvironmentProperties extends {}> = ProviderProps<AdditionalEnvironmentProperties>;
|
|
4
|
+
export type TApplicationContext<AdditionalEnvironmentProperties extends {}> = ApplicationContext<AdditionalEnvironmentProperties>;
|
|
5
|
+
export type TNormalizedMenuVisibilities = NormalizedMenuVisibilities;
|
|
6
|
+
export type TNormalizedPermissions = NormalizedPermissions;
|
|
7
|
+
export type TNormalizedActionRights = NormalizedActionRights;
|
|
8
|
+
export type TNormalizedDataFences = NormalizedDataFences;
|
|
9
|
+
export type TImageRegexContext = ImageRegexContext;
|