@frontegg/types 5.61.0 → 6.0.1-alpha.2
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
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _LoginBoxTheme = require("./LoginBoxTheme");
|
|
8
|
+
|
|
9
|
+
Object.keys(_LoginBoxTheme).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _LoginBoxTheme[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _LoginBoxTheme[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _ComponentsOptions = require("./ComponentsOptions");
|
|
21
|
+
|
|
22
|
+
Object.keys(_ComponentsOptions).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _ComponentsOptions[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _ComponentsOptions[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
package/node/index.js
CHANGED
|
@@ -1,446 +1,101 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function deepmerge(target, source, options) {
|
|
103
|
-
options = options || {};
|
|
104
|
-
options.arrayMerge = options.arrayMerge || defaultArrayMerge;
|
|
105
|
-
options.isMergeableObject = options.isMergeableObject || isMergeableObject;
|
|
106
|
-
// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
|
|
107
|
-
// implementations can use it. The caller may not replace it.
|
|
108
|
-
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
|
|
109
|
-
|
|
110
|
-
var sourceIsArray = Array.isArray(source);
|
|
111
|
-
var targetIsArray = Array.isArray(target);
|
|
112
|
-
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
|
113
|
-
|
|
114
|
-
if (!sourceAndTargetTypesMatch) {
|
|
115
|
-
return cloneUnlessOtherwiseSpecified(source, options)
|
|
116
|
-
} else if (sourceIsArray) {
|
|
117
|
-
return options.arrayMerge(target, source, options)
|
|
118
|
-
} else {
|
|
119
|
-
return mergeObject(target, source, options)
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
deepmerge.all = function deepmergeAll(array, options) {
|
|
124
|
-
if (!Array.isArray(array)) {
|
|
125
|
-
throw new Error('first argument should be an array')
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return array.reduce(function(prev, next) {
|
|
129
|
-
return deepmerge(prev, next, options)
|
|
130
|
-
}, {})
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
var deepmerge_1 = deepmerge;
|
|
134
|
-
|
|
135
|
-
var cjs = deepmerge_1;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Returns a number whose value is limited to the given range.
|
|
139
|
-
* @param {number} value The value to be clamped
|
|
140
|
-
* @param {number} min The lower boundary of the output range
|
|
141
|
-
* @param {number} max The upper boundary of the output range
|
|
142
|
-
* @returns {number} A number in the range [min, max]
|
|
143
|
-
*/
|
|
144
|
-
function clamp(value, min = 0, max = 1) {
|
|
145
|
-
return Math.min(Math.max(min, value), max);
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Converts a color from CSS hex format to CSS rgb format.
|
|
149
|
-
* @param {string} color - Hex color, i.e. #nnn or #nnnnnn
|
|
150
|
-
* @returns {string} A CSS rgb color string
|
|
151
|
-
*/
|
|
152
|
-
function hexToRgb(color) {
|
|
153
|
-
color = color.substr(1);
|
|
154
|
-
const re = new RegExp(`.{1,${color.length >= 6 ? 2 : 1}}`, 'g');
|
|
155
|
-
let colors = color.match(re);
|
|
156
|
-
if (colors && colors[0].length === 1) {
|
|
157
|
-
colors = colors.map((n) => n + n);
|
|
158
|
-
}
|
|
159
|
-
return colors
|
|
160
|
-
? `rgb${colors.length === 4 ? 'a' : ''}(${colors
|
|
161
|
-
.map((n, index) => {
|
|
162
|
-
return index < 3 ? parseInt(n, 16) : Math.round((parseInt(n, 16) / 255) * 1000) / 1000;
|
|
163
|
-
})
|
|
164
|
-
.join(', ')})`
|
|
165
|
-
: '';
|
|
166
|
-
}
|
|
167
|
-
function intToHex(int) {
|
|
168
|
-
const hex = int.toString(16);
|
|
169
|
-
return hex.length === 1 ? `0${hex}` : hex;
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Returns an object with the type and values of a color.
|
|
173
|
-
*
|
|
174
|
-
* Note: Does not support rgb % values.
|
|
175
|
-
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()
|
|
176
|
-
* @returns {object} - A MUI color object: {type: string, values: number[]}
|
|
177
|
-
*/
|
|
178
|
-
function decomposeColor(color) {
|
|
179
|
-
// Idempotent
|
|
180
|
-
if (color.type) {
|
|
181
|
-
return color;
|
|
182
|
-
}
|
|
183
|
-
if (color.charAt(0) === '#') {
|
|
184
|
-
return decomposeColor(hexToRgb(color));
|
|
185
|
-
}
|
|
186
|
-
const marker = color.indexOf('(');
|
|
187
|
-
const type = color.substring(0, marker);
|
|
188
|
-
if (['rgb', 'rgba', 'hsl', 'hsla', 'color'].indexOf(type) === -1) {
|
|
189
|
-
throw new Error('MUI: Unsupported `%s` color.\n' +
|
|
190
|
-
'The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color(). ' + color);
|
|
191
|
-
}
|
|
192
|
-
let values = color.substring(marker + 1, color.length - 1);
|
|
193
|
-
let colorSpace;
|
|
194
|
-
if (type === 'color') {
|
|
195
|
-
values = values.split(' ');
|
|
196
|
-
colorSpace = values.shift();
|
|
197
|
-
if (values.length === 4 && values[3].charAt(0) === '/') {
|
|
198
|
-
values[3] = values[3].substr(1);
|
|
199
|
-
}
|
|
200
|
-
if (['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].indexOf(colorSpace) === -1) {
|
|
201
|
-
throw new Error('MUI: unsupported `%s` color space.\n' +
|
|
202
|
-
'The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.' + colorSpace);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
values = values.split(',');
|
|
207
|
-
}
|
|
208
|
-
values = values.map((value) => parseFloat(value));
|
|
209
|
-
return { type, values, colorSpace };
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Converts a color object with type and values to a string.
|
|
213
|
-
* @param {object} color - Decomposed color
|
|
214
|
-
* @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla'
|
|
215
|
-
* @param {array} color.values - [n,n,n] or [n,n,n,n]
|
|
216
|
-
* @returns {string} A CSS color string
|
|
217
|
-
*/
|
|
218
|
-
function recomposeColor(color) {
|
|
219
|
-
const { type, colorSpace } = color;
|
|
220
|
-
let { values } = color;
|
|
221
|
-
if (type.indexOf('rgb') !== -1) {
|
|
222
|
-
// Only convert the first 3 values to int (i.e. not alpha)
|
|
223
|
-
values = values.map((n, i) => (i < 3 ? parseInt(n, 10) : n));
|
|
224
|
-
}
|
|
225
|
-
else if (type.indexOf('hsl') !== -1) {
|
|
226
|
-
values[1] = `${values[1]}%`;
|
|
227
|
-
values[2] = `${values[2]}%`;
|
|
228
|
-
}
|
|
229
|
-
if (type.indexOf('color') !== -1) {
|
|
230
|
-
values = `${colorSpace} ${values.join(' ')}`;
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
values = `${values.join(', ')}`;
|
|
234
|
-
}
|
|
235
|
-
return `${type}(${values})`;
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Converts a color from CSS rgb format to CSS hex format.
|
|
239
|
-
* @param {string} color - RGB color, i.e. rgb(n, n, n)
|
|
240
|
-
* @returns {string} A CSS rgb color string, i.e. #nnnnnn
|
|
241
|
-
*/
|
|
242
|
-
function rgbToHex(color) {
|
|
243
|
-
// Idempotent
|
|
244
|
-
if (color.indexOf('#') === 0) {
|
|
245
|
-
return color;
|
|
246
|
-
}
|
|
247
|
-
const { values } = decomposeColor(color);
|
|
248
|
-
return `#${values.map((n, i) => intToHex(i === 3 ? Math.round(255 * n) : n)).join('')}`;
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Darkens a color.
|
|
252
|
-
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
253
|
-
* @param {number} coefficient - multiplier in the range 0 - 1
|
|
254
|
-
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
|
255
|
-
*/
|
|
256
|
-
function darken(color, coefficient) {
|
|
257
|
-
color = decomposeColor(color);
|
|
258
|
-
coefficient = clamp(coefficient);
|
|
259
|
-
if (color.type.indexOf('hsl') !== -1) {
|
|
260
|
-
color.values[2] *= 1 - coefficient;
|
|
261
|
-
}
|
|
262
|
-
else if (color.type.indexOf('rgb') !== -1 || color.type.indexOf('color') !== -1) {
|
|
263
|
-
for (let i = 0; i < 3; i += 1) {
|
|
264
|
-
color.values[i] *= 1 - coefficient;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
return recomposeColor(color);
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* Lightens a color.
|
|
271
|
-
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
272
|
-
* @param {number} coefficient - multiplier in the range 0 - 1
|
|
273
|
-
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
|
274
|
-
*/
|
|
275
|
-
function lighten(color, coefficient) {
|
|
276
|
-
color = decomposeColor(color);
|
|
277
|
-
coefficient = clamp(coefficient);
|
|
278
|
-
if (color.type.indexOf('hsl') !== -1) {
|
|
279
|
-
color.values[2] += (100 - color.values[2]) * coefficient;
|
|
280
|
-
}
|
|
281
|
-
else if (color.type.indexOf('rgb') !== -1) {
|
|
282
|
-
for (let i = 0; i < 3; i += 1) {
|
|
283
|
-
color.values[i] += (255 - color.values[i]) * coefficient;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
else if (color.type.indexOf('color') !== -1) {
|
|
287
|
-
for (let i = 0; i < 3; i += 1) {
|
|
288
|
-
color.values[i] += (1 - color.values[i]) * coefficient;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
return recomposeColor(color);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
const generateMainColorObject = (color) => {
|
|
295
|
-
if (!!color) {
|
|
296
|
-
return {
|
|
297
|
-
main: color,
|
|
298
|
-
light: rgbToHex(lighten(color, 0.4)),
|
|
299
|
-
dark: rgbToHex(darken(color, 0.15)),
|
|
300
|
-
hover: rgbToHex(darken(color, 0.15)),
|
|
301
|
-
active: rgbToHex(darken(color, 0.20)),
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
};
|
|
305
|
-
const generateSubColorObject = (color) => {
|
|
306
|
-
if (!!color) {
|
|
307
|
-
return {
|
|
308
|
-
main: color,
|
|
309
|
-
light: lighten(color, 0.7),
|
|
310
|
-
dark: darken(color, 0.2),
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
|
-
};
|
|
314
|
-
const getPalette = (theme, defaultTheme) => {
|
|
315
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
316
|
-
if (!(theme === null || theme === void 0 ? void 0 : theme.palette) || typeof ((_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.primary) !== 'string') {
|
|
317
|
-
return {};
|
|
318
|
-
}
|
|
319
|
-
return Object.assign(Object.assign({}, defaultTheme), { palette: {
|
|
320
|
-
primary: Object.assign(Object.assign({}, generateMainColorObject((_b = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _b === void 0 ? void 0 : _b.primary)), { contrastText: (_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.primaryText) !== null && _d !== void 0 ? _d : '#000000' }),
|
|
321
|
-
secondary: Object.assign(Object.assign({}, generateMainColorObject((_e = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _e === void 0 ? void 0 : _e.secondary)), { contrastText: (_g = (_f = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _f === void 0 ? void 0 : _f.secondaryText) !== null && _g !== void 0 ? _g : '#000000' }),
|
|
322
|
-
danger: Object.assign(Object.assign({}, generateMainColorObject((_h = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _h === void 0 ? void 0 : _h.error)), { contrastText: '#FFF' }),
|
|
323
|
-
success: Object.assign(Object.assign({}, generateSubColorObject((_j = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _j === void 0 ? void 0 : _j.success)), { contrastText: '#FFF' }),
|
|
324
|
-
error: Object.assign(Object.assign({}, generateSubColorObject((_k = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _k === void 0 ? void 0 : _k.error)), { contrastText: '#FFF' }),
|
|
325
|
-
warning: Object.assign(Object.assign({}, generateSubColorObject((_l = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _l === void 0 ? void 0 : _l.warning)), { contrastText: '#FFF' }),
|
|
326
|
-
info: Object.assign(Object.assign({}, generateSubColorObject((_m = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _m === void 0 ? void 0 : _m.info)), { contrastText: '#FFF' }),
|
|
327
|
-
} });
|
|
328
|
-
};
|
|
329
|
-
|
|
330
|
-
const defaultMetadata = {
|
|
331
|
-
theme: {},
|
|
332
|
-
themeV2: {},
|
|
333
|
-
localizations: {},
|
|
334
|
-
navigation: {
|
|
335
|
-
usage: {
|
|
336
|
-
visibility: 'hidden',
|
|
337
|
-
permissions: ['fe.usage.read'],
|
|
338
|
-
featureFlag: 'fe-usage-page',
|
|
339
|
-
},
|
|
340
|
-
webhooks: {
|
|
341
|
-
visibility: 'hidden',
|
|
342
|
-
permissions: ['fe.connectivity.read.webhooks'],
|
|
343
|
-
},
|
|
344
|
-
roles: {
|
|
345
|
-
visibility: 'hidden',
|
|
346
|
-
featureFlag: 'fe-roles-page',
|
|
347
|
-
permissions: ['fe.secure.read.roles'],
|
|
348
|
-
},
|
|
349
|
-
users: {
|
|
350
|
-
visibility: 'always',
|
|
351
|
-
permissions: ['fe.secure.read.users'],
|
|
352
|
-
inviteDialog: {
|
|
353
|
-
phoneNumberField: 'optional',
|
|
354
|
-
},
|
|
355
|
-
},
|
|
356
|
-
personalApiTokens: {
|
|
357
|
-
visibility: 'hidden',
|
|
358
|
-
},
|
|
359
|
-
apiTokens: {
|
|
360
|
-
visibility: 'hidden',
|
|
361
|
-
permissions: ['fe.secure.read.tenantApiTokens'],
|
|
362
|
-
},
|
|
363
|
-
profile: {
|
|
364
|
-
visibility: 'always',
|
|
365
|
-
},
|
|
366
|
-
privacy: {
|
|
367
|
-
visibility: 'always',
|
|
368
|
-
},
|
|
369
|
-
account: {
|
|
370
|
-
visibility: 'always',
|
|
371
|
-
},
|
|
372
|
-
security: {
|
|
373
|
-
visibility: 'always',
|
|
374
|
-
permissions: ['fe.secure.read.securityPolicy'],
|
|
375
|
-
},
|
|
376
|
-
sso: {
|
|
377
|
-
visibility: 'hidden',
|
|
378
|
-
},
|
|
379
|
-
multipleSSO: {
|
|
380
|
-
visibility: 'hidden',
|
|
381
|
-
permissions: ['fe.secure.read.samlConfiguration'],
|
|
382
|
-
},
|
|
383
|
-
audits: {
|
|
384
|
-
visibility: 'always',
|
|
385
|
-
permissions: ['fe.secure.read.audits'],
|
|
386
|
-
},
|
|
387
|
-
subscriptions: {
|
|
388
|
-
visibility: 'hidden',
|
|
389
|
-
permissions: ['fe.subscriptions.*'],
|
|
390
|
-
},
|
|
391
|
-
},
|
|
392
|
-
};
|
|
393
|
-
class Metadata {
|
|
394
|
-
constructor() {
|
|
395
|
-
this._theme = defaultMetadata.theme;
|
|
396
|
-
this._themeV2 = defaultMetadata.themeV2;
|
|
397
|
-
this._navigation = defaultMetadata.navigation;
|
|
398
|
-
this._localizations = defaultMetadata.localizations;
|
|
399
|
-
}
|
|
400
|
-
static getInstance(name = 'default') {
|
|
401
|
-
return this._instances[name];
|
|
402
|
-
}
|
|
403
|
-
static set(metadata, name = 'default') {
|
|
404
|
-
const metadataInstance = new Metadata();
|
|
405
|
-
metadataInstance.set(metadata);
|
|
406
|
-
Metadata._instances[name] = metadataInstance;
|
|
407
|
-
return metadataInstance;
|
|
408
|
-
}
|
|
409
|
-
get theme() {
|
|
410
|
-
var _a;
|
|
411
|
-
return (_a = this._theme) !== null && _a !== void 0 ? _a : {};
|
|
412
|
-
}
|
|
413
|
-
get themeV2() {
|
|
414
|
-
var _a;
|
|
415
|
-
return (_a = this._themeV2) !== null && _a !== void 0 ? _a : {};
|
|
416
|
-
}
|
|
417
|
-
get navigation() {
|
|
418
|
-
var _a;
|
|
419
|
-
return (_a = this._navigation) !== null && _a !== void 0 ? _a : {};
|
|
420
|
-
}
|
|
421
|
-
get localizations() {
|
|
422
|
-
var _a;
|
|
423
|
-
return (_a = this._localizations) !== null && _a !== void 0 ? _a : {};
|
|
424
|
-
}
|
|
425
|
-
set(metadata) {
|
|
426
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
427
|
-
try {
|
|
428
|
-
this._navigation = cjs.all([(_a = defaultMetadata.navigation) !== null && _a !== void 0 ? _a : {}, (_b = metadata === null || metadata === void 0 ? void 0 : metadata.navigation) !== null && _b !== void 0 ? _b : {}]);
|
|
429
|
-
this._theme = cjs.all([
|
|
430
|
-
(_c = defaultMetadata.theme) !== null && _c !== void 0 ? _c : {},
|
|
431
|
-
getPalette(metadata === null || metadata === void 0 ? void 0 : metadata.theme, defaultMetadata.theme),
|
|
432
|
-
]);
|
|
433
|
-
this._themeV2 = cjs.all([(_d = defaultMetadata.themeV2) !== null && _d !== void 0 ? _d : {}, (_e = metadata === null || metadata === void 0 ? void 0 : metadata.themeV2) !== null && _e !== void 0 ? _e : {}]);
|
|
434
|
-
this._localizations = cjs.all([(_f = defaultMetadata.localizations) !== null && _f !== void 0 ? _f : {}, (_g = metadata === null || metadata === void 0 ? void 0 : metadata.localizations) !== null && _g !== void 0 ? _g : {}]);
|
|
435
|
-
}
|
|
436
|
-
catch (e) {
|
|
437
|
-
this._navigation = defaultMetadata.navigation;
|
|
438
|
-
this._theme = defaultMetadata.theme;
|
|
439
|
-
this._themeV2 = defaultMetadata.themeV2;
|
|
440
|
-
this._localizations = defaultMetadata.localizations;
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
Metadata._instances = {};
|
|
445
|
-
|
|
446
|
-
exports.Metadata = Metadata;
|
|
1
|
+
/** @license Frontegg v6.0.1-alpha.2
|
|
2
|
+
*
|
|
3
|
+
* This source code is licensed under the MIT license found in the
|
|
4
|
+
* LICENSE file in the root directory of this source tree.
|
|
5
|
+
*/
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "__esModule", {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
var _FronteggAppInstance = require("./FronteggAppInstance");
|
|
13
|
+
|
|
14
|
+
Object.keys(_FronteggAppInstance).forEach(function (key) {
|
|
15
|
+
if (key === "default" || key === "__esModule") return;
|
|
16
|
+
if (key in exports && exports[key] === _FronteggAppInstance[key]) return;
|
|
17
|
+
Object.defineProperty(exports, key, {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () {
|
|
20
|
+
return _FronteggAppInstance[key];
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
var _FronteggAppOptions = require("./FronteggAppOptions");
|
|
26
|
+
|
|
27
|
+
Object.keys(_FronteggAppOptions).forEach(function (key) {
|
|
28
|
+
if (key === "default" || key === "__esModule") return;
|
|
29
|
+
if (key in exports && exports[key] === _FronteggAppOptions[key]) return;
|
|
30
|
+
Object.defineProperty(exports, key, {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _FronteggAppOptions[key];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
var _FronteggMetadata = require("./FronteggMetadata");
|
|
39
|
+
|
|
40
|
+
Object.keys(_FronteggMetadata).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _FronteggMetadata[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _FronteggMetadata[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
var _ThemeOptions = require("./ThemeOptions");
|
|
52
|
+
|
|
53
|
+
Object.keys(_ThemeOptions).forEach(function (key) {
|
|
54
|
+
if (key === "default" || key === "__esModule") return;
|
|
55
|
+
if (key in exports && exports[key] === _ThemeOptions[key]) return;
|
|
56
|
+
Object.defineProperty(exports, key, {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function () {
|
|
59
|
+
return _ThemeOptions[key];
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
var _Localizations = require("./Localizations");
|
|
65
|
+
|
|
66
|
+
Object.keys(_Localizations).forEach(function (key) {
|
|
67
|
+
if (key === "default" || key === "__esModule") return;
|
|
68
|
+
if (key in exports && exports[key] === _Localizations[key]) return;
|
|
69
|
+
Object.defineProperty(exports, key, {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function () {
|
|
72
|
+
return _Localizations[key];
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
var _Metadata = require("./Metadata");
|
|
78
|
+
|
|
79
|
+
Object.keys(_Metadata).forEach(function (key) {
|
|
80
|
+
if (key === "default" || key === "__esModule") return;
|
|
81
|
+
if (key in exports && exports[key] === _Metadata[key]) return;
|
|
82
|
+
Object.defineProperty(exports, key, {
|
|
83
|
+
enumerable: true,
|
|
84
|
+
get: function () {
|
|
85
|
+
return _Metadata[key];
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
var _CheckoutDialogOptions = require("./CheckoutDialogOptions");
|
|
91
|
+
|
|
92
|
+
Object.keys(_CheckoutDialogOptions).forEach(function (key) {
|
|
93
|
+
if (key === "default" || key === "__esModule") return;
|
|
94
|
+
if (key in exports && exports[key] === _CheckoutDialogOptions[key]) return;
|
|
95
|
+
Object.defineProperty(exports, key, {
|
|
96
|
+
enumerable: true,
|
|
97
|
+
get: function () {
|
|
98
|
+
return _CheckoutDialogOptions[key];
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
});
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.1-alpha.2",
|
|
4
4
|
"main": "./node/index.js",
|
|
5
|
-
"module": "./index.js",
|
|
6
|
-
"types": "./index.d.ts",
|
|
7
|
-
"author": "Frontegg LTD",
|
|
8
5
|
"license": "MIT",
|
|
9
6
|
"dependencies": {
|
|
7
|
+
"@babel/runtime": "^7.17.2",
|
|
8
|
+
"@frontegg/redux-store": "6.0.1-alpha.2",
|
|
10
9
|
"csstype": "^3.0.9"
|
|
11
|
-
}
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"private": false,
|
|
13
|
+
"module": "./index.js",
|
|
14
|
+
"types": "./index.d.ts"
|
|
12
15
|
}
|
|
File without changes
|