@frontegg/types 5.61.0 → 6.0.1-alpha.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/CheckoutDialogOptions.d.ts +6 -6
- package/CheckoutDialogOptions.js +1 -0
- package/Common.d.ts +6 -6
- package/Common.js +1 -0
- package/ContextOptions.d.ts +31 -31
- package/ContextOptions.js +1 -0
- package/CustomComponents.d.ts +19 -19
- package/CustomComponents.js +1 -0
- package/FronteggAppInstance.d.ts +23 -23
- package/FronteggAppInstance.js +1 -0
- package/FronteggAppOptions.d.ts +76 -76
- package/FronteggAppOptions.js +1 -0
- package/FronteggMetadata.d.ts +88 -88
- package/FronteggMetadata.js +1 -0
- package/FronteggStoreOptions.d.ts +13 -13
- package/FronteggStoreOptions.js +1 -0
- package/Localizations/AdminPortalLocalizations/accountSettings.d.ts +216 -216
- package/Localizations/AdminPortalLocalizations/accountSettings.js +1 -0
- package/Localizations/AdminPortalLocalizations/allUsers.d.ts +275 -275
- package/Localizations/AdminPortalLocalizations/allUsers.js +1 -0
- package/Localizations/AdminPortalLocalizations/apiTokens.d.ts +137 -137
- package/Localizations/AdminPortalLocalizations/apiTokens.js +1 -0
- package/Localizations/AdminPortalLocalizations/auditLogs.d.ts +51 -51
- package/Localizations/AdminPortalLocalizations/auditLogs.js +1 -0
- package/Localizations/AdminPortalLocalizations/index.d.ts +29 -29
- package/Localizations/AdminPortalLocalizations/index.js +15 -0
- package/Localizations/AdminPortalLocalizations/navigation.d.ts +85 -85
- package/Localizations/AdminPortalLocalizations/navigation.js +1 -0
- package/Localizations/AdminPortalLocalizations/personalTokens.d.ts +117 -117
- package/Localizations/AdminPortalLocalizations/personalTokens.js +1 -0
- package/Localizations/AdminPortalLocalizations/privacy.d.ts +182 -182
- package/Localizations/AdminPortalLocalizations/privacy.js +1 -0
- package/Localizations/AdminPortalLocalizations/profile.d.ts +243 -243
- package/Localizations/AdminPortalLocalizations/profile.js +1 -0
- package/Localizations/AdminPortalLocalizations/roles.d.ts +88 -88
- package/Localizations/AdminPortalLocalizations/roles.js +1 -0
- package/Localizations/AdminPortalLocalizations/security.d.ts +182 -182
- package/Localizations/AdminPortalLocalizations/security.js +1 -0
- package/Localizations/AdminPortalLocalizations/sso.d.ts +398 -398
- package/Localizations/AdminPortalLocalizations/sso.js +1 -0
- package/Localizations/AdminPortalLocalizations/subscriptions.d.ts +252 -252
- package/Localizations/AdminPortalLocalizations/subscriptions.js +1 -0
- package/Localizations/AdminPortalLocalizations/users.d.ts +288 -288
- package/Localizations/AdminPortalLocalizations/users.js +1 -0
- package/Localizations/AdminPortalLocalizations/webhooks.d.ts +157 -157
- package/Localizations/AdminPortalLocalizations/webhooks.js +1 -0
- package/Localizations/LocalizationOverrides.d.ts +21 -21
- package/Localizations/LocalizationOverrides.js +1 -0
- package/Localizations/LocalizationType.d.ts +45 -45
- package/Localizations/LocalizationType.js +1 -0
- package/Localizations/LoginBoxLocalization/SplitPageTypes/index.d.ts +25 -25
- package/Localizations/LoginBoxLocalization/SplitPageTypes/index.js +1 -0
- package/Localizations/LoginBoxLocalization/acceptInvitation.d.ts +31 -31
- package/Localizations/LoginBoxLocalization/acceptInvitation.js +1 -0
- package/Localizations/LoginBoxLocalization/activateAccount.d.ts +79 -79
- package/Localizations/LoginBoxLocalization/activateAccount.js +1 -0
- package/Localizations/LoginBoxLocalization/forgetPassword.d.ts +35 -35
- package/Localizations/LoginBoxLocalization/forgetPassword.js +1 -0
- package/Localizations/LoginBoxLocalization/index.d.ts +20 -20
- package/Localizations/LoginBoxLocalization/index.js +11 -0
- package/Localizations/LoginBoxLocalization/login.d.ts +307 -335
- package/Localizations/LoginBoxLocalization/login.js +1 -0
- package/Localizations/LoginBoxLocalization/recoveryMfa.d.ts +23 -23
- package/Localizations/LoginBoxLocalization/recoveryMfa.js +1 -0
- package/Localizations/LoginBoxLocalization/resetPassword.d.ts +67 -67
- package/Localizations/LoginBoxLocalization/resetPassword.js +1 -0
- package/Localizations/LoginBoxLocalization/resetPhoneNumber.d.ts +34 -34
- package/Localizations/LoginBoxLocalization/resetPhoneNumber.js +1 -0
- package/Localizations/LoginBoxLocalization/signup.d.ts +186 -186
- package/Localizations/LoginBoxLocalization/signup.js +1 -0
- package/Localizations/LoginBoxLocalization/socialLogins.d.ts +34 -34
- package/Localizations/LoginBoxLocalization/socialLogins.js +1 -0
- package/Localizations/index.d.ts +4 -4
- package/Localizations/index.js +4 -0
- package/Localizations/package.json +6 -0
- package/Metadata/colorManipulator.d.ts +73 -73
- package/Metadata/colorManipulator.js +186 -0
- package/Metadata/getPalette.d.ts +3 -3
- package/Metadata/getPalette.js +58 -0
- package/Metadata/index.d.ts +15 -15
- package/Metadata/index.js +126 -0
- package/Metadata/package.json +6 -0
- package/PrivateOptions.d.ts +25 -25
- package/PrivateOptions.js +1 -0
- package/ThemeOptions/AdminPortalThemeOptions.d.ts +84 -84
- package/ThemeOptions/AdminPortalThemeOptions.js +16 -0
- package/ThemeOptions/BreakpointsOptions.d.ts +17 -17
- package/ThemeOptions/BreakpointsOptions.js +1 -0
- package/ThemeOptions/ComponentsOptions.d.ts +751 -751
- package/ThemeOptions/ComponentsOptions.js +2 -0
- package/ThemeOptions/LoginBoxTheme/AcceptInvitationTheme.d.ts +21 -21
- package/ThemeOptions/LoginBoxTheme/AcceptInvitationTheme.js +1 -0
- package/ThemeOptions/LoginBoxTheme/ActivateAccountPageTheme.d.ts +51 -51
- package/ThemeOptions/LoginBoxTheme/ActivateAccountPageTheme.js +1 -0
- package/ThemeOptions/LoginBoxTheme/CustomLoginComponents.d.ts +12 -12
- package/ThemeOptions/LoginBoxTheme/CustomLoginComponents.js +1 -0
- package/ThemeOptions/LoginBoxTheme/ForgotPasswordTheme.d.ts +45 -45
- package/ThemeOptions/LoginBoxTheme/ForgotPasswordTheme.js +1 -0
- package/ThemeOptions/LoginBoxTheme/LoaderTheme.d.ts +7 -7
- package/ThemeOptions/LoginBoxTheme/LoaderTheme.js +1 -0
- package/ThemeOptions/LoginBoxTheme/LoginBoxCommon.d.ts +226 -226
- package/ThemeOptions/LoginBoxTheme/LoginBoxCommon.js +1 -0
- package/ThemeOptions/LoginBoxTheme/LoginPageTheme.d.ts +136 -148
- package/ThemeOptions/LoginBoxTheme/LoginPageTheme.js +1 -0
- package/ThemeOptions/LoginBoxTheme/ResetPasswordTheme.d.ts +47 -47
- package/ThemeOptions/LoginBoxTheme/ResetPasswordTheme.js +1 -0
- package/ThemeOptions/LoginBoxTheme/ResetPhoneNumberTheme.d.ts +71 -71
- package/ThemeOptions/LoginBoxTheme/ResetPhoneNumberTheme.js +1 -0
- package/ThemeOptions/LoginBoxTheme/SignupPageTheme.d.ts +95 -95
- package/ThemeOptions/LoginBoxTheme/SignupPageTheme.js +1 -0
- package/ThemeOptions/LoginBoxTheme/SocialLoginsTheme.d.ts +64 -64
- package/ThemeOptions/LoginBoxTheme/SocialLoginsTheme.js +1 -0
- package/ThemeOptions/LoginBoxTheme/index.d.ts +53 -53
- package/ThemeOptions/LoginBoxTheme/index.js +11 -0
- package/ThemeOptions/LoginBoxThemeOptions.d.ts +46 -46
- package/ThemeOptions/LoginBoxThemeOptions.js +1 -0
- package/ThemeOptions/Palette.d.ts +85 -85
- package/ThemeOptions/Palette.js +1 -0
- package/ThemeOptions/Shadows.d.ts +1 -1
- package/ThemeOptions/Shadows.js +1 -0
- package/ThemeOptions/SpacingOptions.d.ts +9 -9
- package/ThemeOptions/SpacingOptions.js +1 -0
- package/ThemeOptions/TransitionsOptions.d.ts +23 -23
- package/ThemeOptions/TransitionsOptions.js +1 -0
- package/ThemeOptions/TypographyOptions.d.ts +13 -13
- package/ThemeOptions/TypographyOptions.js +1 -0
- package/ThemeOptions/index.d.ts +41 -41
- package/ThemeOptions/index.js +3 -0
- package/ThemeOptions/package.json +6 -0
- package/index.d.ts +7 -7
- package/index.js +12 -444
- package/node/CheckoutDialogOptions.js +5 -0
- package/node/Common.js +5 -0
- package/node/ContextOptions.js +5 -0
- package/node/CustomComponents.js +5 -0
- package/node/FronteggAppInstance.js +5 -0
- package/node/FronteggAppOptions.js +5 -0
- package/node/FronteggMetadata.js +5 -0
- package/node/FronteggStoreOptions.js +5 -0
- package/node/Localizations/AdminPortalLocalizations/accountSettings.js +5 -0
- package/node/Localizations/AdminPortalLocalizations/allUsers.js +5 -0
- package/node/Localizations/AdminPortalLocalizations/apiTokens.js +5 -0
- package/node/Localizations/AdminPortalLocalizations/auditLogs.js +5 -0
- package/node/Localizations/AdminPortalLocalizations/index.js +187 -0
- package/node/Localizations/AdminPortalLocalizations/navigation.js +5 -0
- package/node/Localizations/AdminPortalLocalizations/personalTokens.js +5 -0
- package/node/Localizations/AdminPortalLocalizations/privacy.js +5 -0
- package/node/Localizations/AdminPortalLocalizations/profile.js +5 -0
- package/node/Localizations/AdminPortalLocalizations/roles.js +5 -0
- package/node/Localizations/AdminPortalLocalizations/security.js +5 -0
- package/node/Localizations/AdminPortalLocalizations/sso.js +5 -0
- package/node/Localizations/AdminPortalLocalizations/subscriptions.js +5 -0
- package/node/Localizations/AdminPortalLocalizations/users.js +5 -0
- package/node/Localizations/AdminPortalLocalizations/webhooks.js +5 -0
- package/node/Localizations/LocalizationOverrides.js +5 -0
- package/node/Localizations/LocalizationType.js +5 -0
- package/node/Localizations/LoginBoxLocalization/SplitPageTypes/index.js +5 -0
- package/node/Localizations/LoginBoxLocalization/acceptInvitation.js +5 -0
- package/node/Localizations/LoginBoxLocalization/activateAccount.js +5 -0
- package/node/Localizations/LoginBoxLocalization/forgetPassword.js +5 -0
- package/node/Localizations/LoginBoxLocalization/index.js +135 -0
- package/node/Localizations/LoginBoxLocalization/login.js +5 -0
- package/node/Localizations/LoginBoxLocalization/recoveryMfa.js +5 -0
- package/node/Localizations/LoginBoxLocalization/resetPassword.js +5 -0
- package/node/Localizations/LoginBoxLocalization/resetPhoneNumber.js +5 -0
- package/node/Localizations/LoginBoxLocalization/signup.js +5 -0
- package/node/Localizations/LoginBoxLocalization/socialLogins.js +5 -0
- package/node/Localizations/index.js +57 -0
- package/node/Metadata/colorManipulator.js +210 -0
- package/node/Metadata/getPalette.js +70 -0
- package/node/Metadata/index.js +140 -0
- package/node/PrivateOptions.js +5 -0
- package/node/ThemeOptions/AdminPortalThemeOptions.js +23 -0
- package/node/ThemeOptions/BreakpointsOptions.js +5 -0
- package/node/ThemeOptions/ComponentsOptions.js +6 -0
- package/node/ThemeOptions/LoginBoxTheme/AcceptInvitationTheme.js +5 -0
- package/node/ThemeOptions/LoginBoxTheme/ActivateAccountPageTheme.js +5 -0
- package/node/ThemeOptions/LoginBoxTheme/CustomLoginComponents.js +5 -0
- package/node/ThemeOptions/LoginBoxTheme/ForgotPasswordTheme.js +5 -0
- package/node/ThemeOptions/LoginBoxTheme/LoaderTheme.js +5 -0
- package/node/ThemeOptions/LoginBoxTheme/LoginBoxCommon.js +5 -0
- package/node/ThemeOptions/LoginBoxTheme/LoginPageTheme.js +5 -0
- package/node/ThemeOptions/LoginBoxTheme/ResetPasswordTheme.js +5 -0
- package/node/ThemeOptions/LoginBoxTheme/ResetPhoneNumberTheme.js +5 -0
- package/node/ThemeOptions/LoginBoxTheme/SignupPageTheme.js +5 -0
- package/node/ThemeOptions/LoginBoxTheme/SocialLoginsTheme.js +5 -0
- package/node/ThemeOptions/LoginBoxTheme/index.js +135 -0
- package/node/ThemeOptions/LoginBoxThemeOptions.js +5 -0
- package/node/ThemeOptions/Palette.js +5 -0
- package/node/ThemeOptions/Shadows.js +5 -0
- package/node/ThemeOptions/SpacingOptions.js +5 -0
- package/node/ThemeOptions/TransitionsOptions.js +5 -0
- package/node/ThemeOptions/TypographyOptions.js +5 -0
- package/node/ThemeOptions/index.js +31 -0
- package/node/index.js +101 -446
- package/package.json +8 -5
- package/ThemeOptions/helpers.d.ts +0 -0
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
export interface SocialLoginsLocalization {
|
|
2
|
-
/**
|
|
3
|
-
* strings in reset password page
|
|
4
|
-
*/
|
|
5
|
-
socialLogins: {
|
|
6
|
-
/**
|
|
7
|
-
* Text to be display in socialLogin buttons if rendering inside login section
|
|
8
|
-
* Ex: 'Continue with {{providerName}}'
|
|
9
|
-
*/
|
|
10
|
-
loginButtonText: string;
|
|
11
|
-
/**
|
|
12
|
-
* Text to be display in socialLogin buttons if rendering inside signup section
|
|
13
|
-
* Ex: 'Login with {{providerName}}'
|
|
14
|
-
*/
|
|
15
|
-
signupButtonText: string;
|
|
16
|
-
/**
|
|
17
|
-
* Text to be display in socialLogin buttons if rendering inside activation section
|
|
18
|
-
* Ex: 'Sign up with {{providerName}}'
|
|
19
|
-
*/
|
|
20
|
-
activationButtonText: string;
|
|
21
|
-
/**
|
|
22
|
-
* String displayed as invalid title
|
|
23
|
-
*/
|
|
24
|
-
invalidTitle: string;
|
|
25
|
-
/**
|
|
26
|
-
* Error title if social login callback is invalid
|
|
27
|
-
*/
|
|
28
|
-
failedInvalidCallbackUrl: string;
|
|
29
|
-
/**
|
|
30
|
-
* Back to login button text in social login invalid section
|
|
31
|
-
*/
|
|
32
|
-
failedBackToLogin: string;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
1
|
+
export interface SocialLoginsLocalization {
|
|
2
|
+
/**
|
|
3
|
+
* strings in reset password page
|
|
4
|
+
*/
|
|
5
|
+
socialLogins: {
|
|
6
|
+
/**
|
|
7
|
+
* Text to be display in socialLogin buttons if rendering inside login section
|
|
8
|
+
* Ex: 'Continue with {{providerName}}'
|
|
9
|
+
*/
|
|
10
|
+
loginButtonText: string;
|
|
11
|
+
/**
|
|
12
|
+
* Text to be display in socialLogin buttons if rendering inside signup section
|
|
13
|
+
* Ex: 'Login with {{providerName}}'
|
|
14
|
+
*/
|
|
15
|
+
signupButtonText: string;
|
|
16
|
+
/**
|
|
17
|
+
* Text to be display in socialLogin buttons if rendering inside activation section
|
|
18
|
+
* Ex: 'Sign up with {{providerName}}'
|
|
19
|
+
*/
|
|
20
|
+
activationButtonText: string;
|
|
21
|
+
/**
|
|
22
|
+
* String displayed as invalid title
|
|
23
|
+
*/
|
|
24
|
+
invalidTitle: string;
|
|
25
|
+
/**
|
|
26
|
+
* Error title if social login callback is invalid
|
|
27
|
+
*/
|
|
28
|
+
failedInvalidCallbackUrl: string;
|
|
29
|
+
/**
|
|
30
|
+
* Back to login button text in social login invalid section
|
|
31
|
+
*/
|
|
32
|
+
failedBackToLogin: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/Localizations/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './LocalizationOverrides';
|
|
2
|
-
export * from './LocalizationType';
|
|
3
|
-
export * from './AdminPortalLocalizations';
|
|
4
|
-
export * from './LoginBoxLocalization';
|
|
1
|
+
export * from './LocalizationOverrides';
|
|
2
|
+
export * from './LocalizationType';
|
|
3
|
+
export * from './AdminPortalLocalizations';
|
|
4
|
+
export * from './LoginBoxLocalization';
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Converts a color from CSS hex format to CSS rgb format.
|
|
3
|
-
* @param {string} color - Hex color, i.e. #nnn or #nnnnnn
|
|
4
|
-
* @returns {string} A CSS rgb color string
|
|
5
|
-
*/
|
|
6
|
-
export declare function hexToRgb(color: string): string;
|
|
7
|
-
/**
|
|
8
|
-
* Returns an object with the type and values of a color.
|
|
9
|
-
*
|
|
10
|
-
* Note: Does not support rgb % values.
|
|
11
|
-
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
|
|
12
|
-
* @returns {object} - A MUI color object: {type: string, values: number[]}
|
|
13
|
-
*/
|
|
14
|
-
export declare function decomposeColor(color: any): any;
|
|
15
|
-
/**
|
|
16
|
-
* Converts a color object with type and values to a string.
|
|
17
|
-
* @param {object} color - Decomposed color
|
|
18
|
-
* @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla'
|
|
19
|
-
* @param {array} color.values - [n,n,n] or [n,n,n,n]
|
|
20
|
-
* @returns {string} A CSS color string
|
|
21
|
-
*/
|
|
22
|
-
export declare function recomposeColor(color: any): string;
|
|
23
|
-
/**
|
|
24
|
-
* Converts a color from CSS rgb format to CSS hex format.
|
|
25
|
-
* @param {string} color - RGB color, i.e. rgb(n, n, n)
|
|
26
|
-
* @returns {string} A CSS rgb color string, i.e. #nnnnnn
|
|
27
|
-
*/
|
|
28
|
-
export declare function rgbToHex(color: any): any;
|
|
29
|
-
/**
|
|
30
|
-
* Converts a color from hsl format to rgb format.
|
|
31
|
-
* @param {string} color - HSL color values
|
|
32
|
-
* @returns {string} rgb color values
|
|
33
|
-
*/
|
|
34
|
-
export declare function hslToRgb(color: any): string;
|
|
35
|
-
/**
|
|
36
|
-
* The relative brightness of any point in a color space,
|
|
37
|
-
* normalized to 0 for darkest black and 1 for lightest white.
|
|
38
|
-
*
|
|
39
|
-
* Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
40
|
-
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
41
|
-
* @returns {number} The relative brightness of the color in the range 0 - 1
|
|
42
|
-
*/
|
|
43
|
-
export declare function getLuminance(color: any): number;
|
|
44
|
-
/**
|
|
45
|
-
* Sets the absolute transparency of a color.
|
|
46
|
-
* Any existing alpha values are overwritten.
|
|
47
|
-
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
48
|
-
* @param {number} value - value to set the alpha channel to in the range 0 - 1
|
|
49
|
-
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
|
50
|
-
*/
|
|
51
|
-
export declare function alpha(color: any, value: any): string;
|
|
52
|
-
/**
|
|
53
|
-
* Darkens a color.
|
|
54
|
-
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
55
|
-
* @param {number} coefficient - multiplier in the range 0 - 1
|
|
56
|
-
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
|
57
|
-
*/
|
|
58
|
-
export declare function darken(color: any, coefficient: any): string;
|
|
59
|
-
/**
|
|
60
|
-
* Lightens a color.
|
|
61
|
-
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
62
|
-
* @param {number} coefficient - multiplier in the range 0 - 1
|
|
63
|
-
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
|
64
|
-
*/
|
|
65
|
-
export declare function lighten(color: any, coefficient: any): string;
|
|
66
|
-
/**
|
|
67
|
-
* Darken or lighten a color, depending on its luminance.
|
|
68
|
-
* Light colors are darkened, dark colors are lightened.
|
|
69
|
-
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
70
|
-
* @param {number} coefficient=0.15 - multiplier in the range 0 - 1
|
|
71
|
-
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
|
72
|
-
*/
|
|
73
|
-
export declare function emphasize(color: any, coefficient?: number): string;
|
|
1
|
+
/**
|
|
2
|
+
* Converts a color from CSS hex format to CSS rgb format.
|
|
3
|
+
* @param {string} color - Hex color, i.e. #nnn or #nnnnnn
|
|
4
|
+
* @returns {string} A CSS rgb color string
|
|
5
|
+
*/
|
|
6
|
+
export declare function hexToRgb(color: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Returns an object with the type and values of a color.
|
|
9
|
+
*
|
|
10
|
+
* Note: Does not support rgb % values.
|
|
11
|
+
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
|
|
12
|
+
* @returns {object} - A MUI color object: {type: string, values: number[]}
|
|
13
|
+
*/
|
|
14
|
+
export declare function decomposeColor(color: any): any;
|
|
15
|
+
/**
|
|
16
|
+
* Converts a color object with type and values to a string.
|
|
17
|
+
* @param {object} color - Decomposed color
|
|
18
|
+
* @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla'
|
|
19
|
+
* @param {array} color.values - [n,n,n] or [n,n,n,n]
|
|
20
|
+
* @returns {string} A CSS color string
|
|
21
|
+
*/
|
|
22
|
+
export declare function recomposeColor(color: any): string;
|
|
23
|
+
/**
|
|
24
|
+
* Converts a color from CSS rgb format to CSS hex format.
|
|
25
|
+
* @param {string} color - RGB color, i.e. rgb(n, n, n)
|
|
26
|
+
* @returns {string} A CSS rgb color string, i.e. #nnnnnn
|
|
27
|
+
*/
|
|
28
|
+
export declare function rgbToHex(color: any): any;
|
|
29
|
+
/**
|
|
30
|
+
* Converts a color from hsl format to rgb format.
|
|
31
|
+
* @param {string} color - HSL color values
|
|
32
|
+
* @returns {string} rgb color values
|
|
33
|
+
*/
|
|
34
|
+
export declare function hslToRgb(color: any): string;
|
|
35
|
+
/**
|
|
36
|
+
* The relative brightness of any point in a color space,
|
|
37
|
+
* normalized to 0 for darkest black and 1 for lightest white.
|
|
38
|
+
*
|
|
39
|
+
* Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
|
|
40
|
+
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
41
|
+
* @returns {number} The relative brightness of the color in the range 0 - 1
|
|
42
|
+
*/
|
|
43
|
+
export declare function getLuminance(color: any): number;
|
|
44
|
+
/**
|
|
45
|
+
* Sets the absolute transparency of a color.
|
|
46
|
+
* Any existing alpha values are overwritten.
|
|
47
|
+
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
48
|
+
* @param {number} value - value to set the alpha channel to in the range 0 - 1
|
|
49
|
+
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
|
50
|
+
*/
|
|
51
|
+
export declare function alpha(color: any, value: any): string;
|
|
52
|
+
/**
|
|
53
|
+
* Darkens a color.
|
|
54
|
+
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
55
|
+
* @param {number} coefficient - multiplier in the range 0 - 1
|
|
56
|
+
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
|
57
|
+
*/
|
|
58
|
+
export declare function darken(color: any, coefficient: any): string;
|
|
59
|
+
/**
|
|
60
|
+
* Lightens a color.
|
|
61
|
+
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
62
|
+
* @param {number} coefficient - multiplier in the range 0 - 1
|
|
63
|
+
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
|
64
|
+
*/
|
|
65
|
+
export declare function lighten(color: any, coefficient: any): string;
|
|
66
|
+
/**
|
|
67
|
+
* Darken or lighten a color, depending on its luminance.
|
|
68
|
+
* Light colors are darkened, dark colors are lightened.
|
|
69
|
+
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
70
|
+
* @param {number} coefficient=0.15 - multiplier in the range 0 - 1
|
|
71
|
+
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
|
72
|
+
*/
|
|
73
|
+
export declare function emphasize(color: any, coefficient?: number): string;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
function clamp(value, min = 0, max = 1) {
|
|
2
|
+
return Math.min(Math.max(min, value), max);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export function hexToRgb(color) {
|
|
6
|
+
color = color.substr(1);
|
|
7
|
+
const re = new RegExp(`.{1,${color.length >= 6 ? 2 : 1}}`, 'g');
|
|
8
|
+
let colors = color.match(re);
|
|
9
|
+
|
|
10
|
+
if (colors && colors[0].length === 1) {
|
|
11
|
+
colors = colors.map(n => n + n);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return colors ? `rgb${colors.length === 4 ? 'a' : ''}(${colors.map((n, index) => {
|
|
15
|
+
return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;
|
|
16
|
+
}).join(', ')})` : '';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function intToHex(int) {
|
|
20
|
+
const hex = int.toString(16);
|
|
21
|
+
return hex.length === 1 ? `0${hex}` : hex;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function decomposeColor(color) {
|
|
25
|
+
if (color.type) {
|
|
26
|
+
return color;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (color.charAt(0) === '#') {
|
|
30
|
+
return decomposeColor(hexToRgb(color));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const marker = color.indexOf('(');
|
|
34
|
+
const type = color.substring(0, marker);
|
|
35
|
+
|
|
36
|
+
if (['rgb', 'rgba', 'hsl', 'hsla', 'color'].indexOf(type) === -1) {
|
|
37
|
+
throw new Error('MUI: Unsupported `%s` color.\n' + 'The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color(). ' + color);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let values = color.substring(marker + 1, color.length - 1);
|
|
41
|
+
let colorSpace;
|
|
42
|
+
|
|
43
|
+
if (type === 'color') {
|
|
44
|
+
values = values.split(' ');
|
|
45
|
+
colorSpace = values.shift();
|
|
46
|
+
|
|
47
|
+
if (values.length === 4 && values[3].charAt(0) === '/') {
|
|
48
|
+
values[3] = values[3].substr(1);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].indexOf(colorSpace) === -1) {
|
|
52
|
+
throw new Error('MUI: unsupported `%s` color space.\n' + 'The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.' + colorSpace);
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
values = values.split(',');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
values = values.map(value => parseFloat(value));
|
|
59
|
+
return {
|
|
60
|
+
type,
|
|
61
|
+
values,
|
|
62
|
+
colorSpace
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export function recomposeColor(color) {
|
|
66
|
+
const {
|
|
67
|
+
type,
|
|
68
|
+
colorSpace
|
|
69
|
+
} = color;
|
|
70
|
+
let {
|
|
71
|
+
values
|
|
72
|
+
} = color;
|
|
73
|
+
|
|
74
|
+
if (type.indexOf('rgb') !== -1) {
|
|
75
|
+
values = values.map((n, i) => i < 3 ? parseInt(n, 10) : n);
|
|
76
|
+
} else if (type.indexOf('hsl') !== -1) {
|
|
77
|
+
values[1] = `${values[1]}%`;
|
|
78
|
+
values[2] = `${values[2]}%`;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (type.indexOf('color') !== -1) {
|
|
82
|
+
values = `${colorSpace} ${values.join(' ')}`;
|
|
83
|
+
} else {
|
|
84
|
+
values = `${values.join(', ')}`;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return `${type}(${values})`;
|
|
88
|
+
}
|
|
89
|
+
export function rgbToHex(color) {
|
|
90
|
+
if (color.indexOf('#') === 0) {
|
|
91
|
+
return color;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const {
|
|
95
|
+
values
|
|
96
|
+
} = decomposeColor(color);
|
|
97
|
+
return `#${values.map((n, i) => intToHex(i === 3 ? Math.round(255 * n) : n)).join('')}`;
|
|
98
|
+
}
|
|
99
|
+
export function hslToRgb(color) {
|
|
100
|
+
color = decomposeColor(color);
|
|
101
|
+
const {
|
|
102
|
+
values
|
|
103
|
+
} = color;
|
|
104
|
+
const h = values[0];
|
|
105
|
+
const s = values[1] / 100;
|
|
106
|
+
const l = values[2] / 100;
|
|
107
|
+
const a = s * Math.min(l, 1 - l);
|
|
108
|
+
|
|
109
|
+
const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
|
|
110
|
+
|
|
111
|
+
let type = 'rgb';
|
|
112
|
+
const rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];
|
|
113
|
+
|
|
114
|
+
if (color.type === 'hsla') {
|
|
115
|
+
type += 'a';
|
|
116
|
+
rgb.push(values[3]);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return recomposeColor({
|
|
120
|
+
type,
|
|
121
|
+
values: rgb
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
export function getLuminance(color) {
|
|
125
|
+
color = decomposeColor(color);
|
|
126
|
+
let rgb = color.type === 'hsl' ? decomposeColor(hslToRgb(color)).values : color.values;
|
|
127
|
+
rgb = rgb.map(val => {
|
|
128
|
+
if (color.type !== 'color') {
|
|
129
|
+
val /= 255;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;
|
|
133
|
+
});
|
|
134
|
+
return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));
|
|
135
|
+
}
|
|
136
|
+
export function alpha(color, value) {
|
|
137
|
+
color = decomposeColor(color);
|
|
138
|
+
value = clamp(value);
|
|
139
|
+
|
|
140
|
+
if (color.type === 'rgb' || color.type === 'hsl') {
|
|
141
|
+
color.type += 'a';
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (color.type === 'color') {
|
|
145
|
+
color.values[3] = `/${value}`;
|
|
146
|
+
} else {
|
|
147
|
+
color.values[3] = value;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return recomposeColor(color);
|
|
151
|
+
}
|
|
152
|
+
export function darken(color, coefficient) {
|
|
153
|
+
color = decomposeColor(color);
|
|
154
|
+
coefficient = clamp(coefficient);
|
|
155
|
+
|
|
156
|
+
if (color.type.indexOf('hsl') !== -1) {
|
|
157
|
+
color.values[2] *= 1 - coefficient;
|
|
158
|
+
} else if (color.type.indexOf('rgb') !== -1 || color.type.indexOf('color') !== -1) {
|
|
159
|
+
for (let i = 0; i < 3; i += 1) {
|
|
160
|
+
color.values[i] *= 1 - coefficient;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return recomposeColor(color);
|
|
165
|
+
}
|
|
166
|
+
export function lighten(color, coefficient) {
|
|
167
|
+
color = decomposeColor(color);
|
|
168
|
+
coefficient = clamp(coefficient);
|
|
169
|
+
|
|
170
|
+
if (color.type.indexOf('hsl') !== -1) {
|
|
171
|
+
color.values[2] += (100 - color.values[2]) * coefficient;
|
|
172
|
+
} else if (color.type.indexOf('rgb') !== -1) {
|
|
173
|
+
for (let i = 0; i < 3; i += 1) {
|
|
174
|
+
color.values[i] += (255 - color.values[i]) * coefficient;
|
|
175
|
+
}
|
|
176
|
+
} else if (color.type.indexOf('color') !== -1) {
|
|
177
|
+
for (let i = 0; i < 3; i += 1) {
|
|
178
|
+
color.values[i] += (1 - color.values[i]) * coefficient;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return recomposeColor(color);
|
|
183
|
+
}
|
|
184
|
+
export function emphasize(color, coefficient = 0.15) {
|
|
185
|
+
return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);
|
|
186
|
+
}
|
package/Metadata/getPalette.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare type DefaultTheme = any;
|
|
2
|
-
export declare const getPalette: (theme: any, defaultTheme: DefaultTheme) => any;
|
|
3
|
-
export {};
|
|
1
|
+
declare type DefaultTheme = any;
|
|
2
|
+
export declare const getPalette: (theme: any, defaultTheme: DefaultTheme) => any;
|
|
3
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { lighten, darken, rgbToHex } from './colorManipulator';
|
|
3
|
+
|
|
4
|
+
const generateMainColorObject = color => {
|
|
5
|
+
if (!!color) {
|
|
6
|
+
return {
|
|
7
|
+
main: color,
|
|
8
|
+
light: rgbToHex(lighten(color, 0.4)),
|
|
9
|
+
dark: rgbToHex(darken(color, 0.15)),
|
|
10
|
+
hover: rgbToHex(darken(color, 0.15)),
|
|
11
|
+
active: rgbToHex(darken(color, 0.20))
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const generateSubColorObject = color => {
|
|
17
|
+
if (!!color) {
|
|
18
|
+
return {
|
|
19
|
+
main: color,
|
|
20
|
+
light: lighten(color, 0.7),
|
|
21
|
+
dark: darken(color, 0.2)
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const getPalette = (theme, defaultTheme) => {
|
|
27
|
+
var _theme$palette, _theme$palette2, _theme$palette$primar, _theme$palette3, _theme$palette4, _theme$palette$second, _theme$palette5, _theme$palette6, _theme$palette7, _theme$palette8, _theme$palette9, _theme$palette10;
|
|
28
|
+
|
|
29
|
+
if (!(theme != null && theme.palette) || typeof (theme == null ? void 0 : (_theme$palette = theme.palette) == null ? void 0 : _theme$palette.primary) !== 'string') {
|
|
30
|
+
return {};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return _extends({}, defaultTheme, {
|
|
34
|
+
palette: {
|
|
35
|
+
primary: _extends({}, generateMainColorObject(theme == null ? void 0 : (_theme$palette2 = theme.palette) == null ? void 0 : _theme$palette2.primary), {
|
|
36
|
+
contrastText: (_theme$palette$primar = theme == null ? void 0 : (_theme$palette3 = theme.palette) == null ? void 0 : _theme$palette3.primaryText) != null ? _theme$palette$primar : '#000000'
|
|
37
|
+
}),
|
|
38
|
+
secondary: _extends({}, generateMainColorObject(theme == null ? void 0 : (_theme$palette4 = theme.palette) == null ? void 0 : _theme$palette4.secondary), {
|
|
39
|
+
contrastText: (_theme$palette$second = theme == null ? void 0 : (_theme$palette5 = theme.palette) == null ? void 0 : _theme$palette5.secondaryText) != null ? _theme$palette$second : '#000000'
|
|
40
|
+
}),
|
|
41
|
+
danger: _extends({}, generateMainColorObject(theme == null ? void 0 : (_theme$palette6 = theme.palette) == null ? void 0 : _theme$palette6.error), {
|
|
42
|
+
contrastText: '#FFF'
|
|
43
|
+
}),
|
|
44
|
+
success: _extends({}, generateSubColorObject(theme == null ? void 0 : (_theme$palette7 = theme.palette) == null ? void 0 : _theme$palette7.success), {
|
|
45
|
+
contrastText: '#FFF'
|
|
46
|
+
}),
|
|
47
|
+
error: _extends({}, generateSubColorObject(theme == null ? void 0 : (_theme$palette8 = theme.palette) == null ? void 0 : _theme$palette8.error), {
|
|
48
|
+
contrastText: '#FFF'
|
|
49
|
+
}),
|
|
50
|
+
warning: _extends({}, generateSubColorObject(theme == null ? void 0 : (_theme$palette9 = theme.palette) == null ? void 0 : _theme$palette9.warning), {
|
|
51
|
+
contrastText: '#FFF'
|
|
52
|
+
}),
|
|
53
|
+
info: _extends({}, generateSubColorObject(theme == null ? void 0 : (_theme$palette10 = theme.palette) == null ? void 0 : _theme$palette10.info), {
|
|
54
|
+
contrastText: '#FFF'
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
};
|
package/Metadata/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { FronteggMetadata } from '../FronteggMetadata';
|
|
2
|
-
export declare class Metadata {
|
|
3
|
-
private _theme;
|
|
4
|
-
private _themeV2;
|
|
5
|
-
private _navigation;
|
|
6
|
-
private _localizations;
|
|
7
|
-
static _instances: Record<string, Metadata>;
|
|
8
|
-
static getInstance(name?: string): Metadata;
|
|
9
|
-
static set(metadata?: FronteggMetadata, name?: string): Metadata;
|
|
10
|
-
get theme(): Required<FronteggMetadata>['theme'];
|
|
11
|
-
get themeV2(): Required<FronteggMetadata>['themeV2'];
|
|
12
|
-
get navigation(): Required<FronteggMetadata>['navigation'];
|
|
13
|
-
get localizations(): Required<FronteggMetadata>['localizations'];
|
|
14
|
-
set(metadata?: FronteggMetadata): void;
|
|
15
|
-
}
|
|
1
|
+
import { FronteggMetadata } from '../FronteggMetadata';
|
|
2
|
+
export declare class Metadata {
|
|
3
|
+
private _theme;
|
|
4
|
+
private _themeV2;
|
|
5
|
+
private _navigation;
|
|
6
|
+
private _localizations;
|
|
7
|
+
static _instances: Record<string, Metadata>;
|
|
8
|
+
static getInstance(name?: string): Metadata;
|
|
9
|
+
static set(metadata?: FronteggMetadata, name?: string): Metadata;
|
|
10
|
+
get theme(): Required<FronteggMetadata>['theme'];
|
|
11
|
+
get themeV2(): Required<FronteggMetadata>['themeV2'];
|
|
12
|
+
get navigation(): Required<FronteggMetadata>['navigation'];
|
|
13
|
+
get localizations(): Required<FronteggMetadata>['localizations'];
|
|
14
|
+
set(metadata?: FronteggMetadata): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import deepMerge from 'deepmerge';
|
|
2
|
+
import { getPalette } from './getPalette';
|
|
3
|
+
const defaultMetadata = {
|
|
4
|
+
theme: {},
|
|
5
|
+
themeV2: {},
|
|
6
|
+
localizations: {},
|
|
7
|
+
navigation: {
|
|
8
|
+
usage: {
|
|
9
|
+
visibility: 'hidden',
|
|
10
|
+
permissions: ['fe.usage.read'],
|
|
11
|
+
featureFlag: 'fe-usage-page'
|
|
12
|
+
},
|
|
13
|
+
webhooks: {
|
|
14
|
+
visibility: 'hidden',
|
|
15
|
+
permissions: ['fe.connectivity.read.webhooks']
|
|
16
|
+
},
|
|
17
|
+
roles: {
|
|
18
|
+
visibility: 'hidden',
|
|
19
|
+
featureFlag: 'fe-roles-page',
|
|
20
|
+
permissions: ['fe.secure.read.roles']
|
|
21
|
+
},
|
|
22
|
+
users: {
|
|
23
|
+
visibility: 'always',
|
|
24
|
+
permissions: ['fe.secure.read.users'],
|
|
25
|
+
inviteDialog: {
|
|
26
|
+
phoneNumberField: 'optional'
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
personalApiTokens: {
|
|
30
|
+
visibility: 'hidden'
|
|
31
|
+
},
|
|
32
|
+
apiTokens: {
|
|
33
|
+
visibility: 'hidden',
|
|
34
|
+
permissions: ['fe.secure.read.tenantApiTokens']
|
|
35
|
+
},
|
|
36
|
+
profile: {
|
|
37
|
+
visibility: 'always'
|
|
38
|
+
},
|
|
39
|
+
privacy: {
|
|
40
|
+
visibility: 'always'
|
|
41
|
+
},
|
|
42
|
+
account: {
|
|
43
|
+
visibility: 'always'
|
|
44
|
+
},
|
|
45
|
+
security: {
|
|
46
|
+
visibility: 'always',
|
|
47
|
+
permissions: ['fe.secure.read.securityPolicy']
|
|
48
|
+
},
|
|
49
|
+
sso: {
|
|
50
|
+
visibility: 'hidden'
|
|
51
|
+
},
|
|
52
|
+
multipleSSO: {
|
|
53
|
+
visibility: 'hidden',
|
|
54
|
+
permissions: ['fe.secure.read.samlConfiguration']
|
|
55
|
+
},
|
|
56
|
+
audits: {
|
|
57
|
+
visibility: 'always',
|
|
58
|
+
permissions: ['fe.secure.read.audits']
|
|
59
|
+
},
|
|
60
|
+
subscriptions: {
|
|
61
|
+
visibility: 'hidden',
|
|
62
|
+
permissions: ['fe.subscriptions.*']
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
export class Metadata {
|
|
67
|
+
constructor() {
|
|
68
|
+
this._theme = defaultMetadata.theme;
|
|
69
|
+
this._themeV2 = defaultMetadata.themeV2;
|
|
70
|
+
this._navigation = defaultMetadata.navigation;
|
|
71
|
+
this._localizations = defaultMetadata.localizations;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
static getInstance(name = 'default') {
|
|
75
|
+
return this._instances[name];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
static set(metadata, name = 'default') {
|
|
79
|
+
const metadataInstance = new Metadata();
|
|
80
|
+
metadataInstance.set(metadata);
|
|
81
|
+
Metadata._instances[name] = metadataInstance;
|
|
82
|
+
return metadataInstance;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
get theme() {
|
|
86
|
+
var _this$_theme;
|
|
87
|
+
|
|
88
|
+
return (_this$_theme = this._theme) != null ? _this$_theme : {};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
get themeV2() {
|
|
92
|
+
var _this$_themeV;
|
|
93
|
+
|
|
94
|
+
return (_this$_themeV = this._themeV2) != null ? _this$_themeV : {};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
get navigation() {
|
|
98
|
+
var _this$_navigation;
|
|
99
|
+
|
|
100
|
+
return (_this$_navigation = this._navigation) != null ? _this$_navigation : {};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
get localizations() {
|
|
104
|
+
var _this$_localizations;
|
|
105
|
+
|
|
106
|
+
return (_this$_localizations = this._localizations) != null ? _this$_localizations : {};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
set(metadata) {
|
|
110
|
+
try {
|
|
111
|
+
var _defaultMetadata$navi, _metadata$navigation, _defaultMetadata$them, _defaultMetadata$them2, _metadata$themeV, _defaultMetadata$loca, _metadata$localizatio;
|
|
112
|
+
|
|
113
|
+
this._navigation = deepMerge.all([(_defaultMetadata$navi = defaultMetadata.navigation) != null ? _defaultMetadata$navi : {}, (_metadata$navigation = metadata == null ? void 0 : metadata.navigation) != null ? _metadata$navigation : {}]);
|
|
114
|
+
this._theme = deepMerge.all([(_defaultMetadata$them = defaultMetadata.theme) != null ? _defaultMetadata$them : {}, getPalette(metadata == null ? void 0 : metadata.theme, defaultMetadata.theme)]);
|
|
115
|
+
this._themeV2 = deepMerge.all([(_defaultMetadata$them2 = defaultMetadata.themeV2) != null ? _defaultMetadata$them2 : {}, (_metadata$themeV = metadata == null ? void 0 : metadata.themeV2) != null ? _metadata$themeV : {}]);
|
|
116
|
+
this._localizations = deepMerge.all([(_defaultMetadata$loca = defaultMetadata.localizations) != null ? _defaultMetadata$loca : {}, (_metadata$localizatio = metadata == null ? void 0 : metadata.localizations) != null ? _metadata$localizatio : {}]);
|
|
117
|
+
} catch (e) {
|
|
118
|
+
this._navigation = defaultMetadata.navigation;
|
|
119
|
+
this._theme = defaultMetadata.theme;
|
|
120
|
+
this._themeV2 = defaultMetadata.themeV2;
|
|
121
|
+
this._localizations = defaultMetadata.localizations;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
}
|
|
126
|
+
Metadata._instances = {};
|