@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.
Files changed (197) hide show
  1. package/CheckoutDialogOptions.d.ts +6 -6
  2. package/CheckoutDialogOptions.js +1 -0
  3. package/Common.d.ts +6 -6
  4. package/Common.js +1 -0
  5. package/ContextOptions.d.ts +31 -31
  6. package/ContextOptions.js +1 -0
  7. package/CustomComponents.d.ts +19 -19
  8. package/CustomComponents.js +1 -0
  9. package/FronteggAppInstance.d.ts +23 -23
  10. package/FronteggAppInstance.js +1 -0
  11. package/FronteggAppOptions.d.ts +76 -76
  12. package/FronteggAppOptions.js +1 -0
  13. package/FronteggMetadata.d.ts +88 -88
  14. package/FronteggMetadata.js +1 -0
  15. package/FronteggStoreOptions.d.ts +13 -13
  16. package/FronteggStoreOptions.js +1 -0
  17. package/Localizations/AdminPortalLocalizations/accountSettings.d.ts +216 -216
  18. package/Localizations/AdminPortalLocalizations/accountSettings.js +1 -0
  19. package/Localizations/AdminPortalLocalizations/allUsers.d.ts +275 -275
  20. package/Localizations/AdminPortalLocalizations/allUsers.js +1 -0
  21. package/Localizations/AdminPortalLocalizations/apiTokens.d.ts +137 -137
  22. package/Localizations/AdminPortalLocalizations/apiTokens.js +1 -0
  23. package/Localizations/AdminPortalLocalizations/auditLogs.d.ts +51 -51
  24. package/Localizations/AdminPortalLocalizations/auditLogs.js +1 -0
  25. package/Localizations/AdminPortalLocalizations/index.d.ts +29 -29
  26. package/Localizations/AdminPortalLocalizations/index.js +15 -0
  27. package/Localizations/AdminPortalLocalizations/navigation.d.ts +85 -85
  28. package/Localizations/AdminPortalLocalizations/navigation.js +1 -0
  29. package/Localizations/AdminPortalLocalizations/personalTokens.d.ts +117 -117
  30. package/Localizations/AdminPortalLocalizations/personalTokens.js +1 -0
  31. package/Localizations/AdminPortalLocalizations/privacy.d.ts +182 -182
  32. package/Localizations/AdminPortalLocalizations/privacy.js +1 -0
  33. package/Localizations/AdminPortalLocalizations/profile.d.ts +243 -243
  34. package/Localizations/AdminPortalLocalizations/profile.js +1 -0
  35. package/Localizations/AdminPortalLocalizations/roles.d.ts +88 -88
  36. package/Localizations/AdminPortalLocalizations/roles.js +1 -0
  37. package/Localizations/AdminPortalLocalizations/security.d.ts +182 -182
  38. package/Localizations/AdminPortalLocalizations/security.js +1 -0
  39. package/Localizations/AdminPortalLocalizations/sso.d.ts +398 -398
  40. package/Localizations/AdminPortalLocalizations/sso.js +1 -0
  41. package/Localizations/AdminPortalLocalizations/subscriptions.d.ts +252 -252
  42. package/Localizations/AdminPortalLocalizations/subscriptions.js +1 -0
  43. package/Localizations/AdminPortalLocalizations/users.d.ts +288 -288
  44. package/Localizations/AdminPortalLocalizations/users.js +1 -0
  45. package/Localizations/AdminPortalLocalizations/webhooks.d.ts +157 -157
  46. package/Localizations/AdminPortalLocalizations/webhooks.js +1 -0
  47. package/Localizations/LocalizationOverrides.d.ts +21 -21
  48. package/Localizations/LocalizationOverrides.js +1 -0
  49. package/Localizations/LocalizationType.d.ts +45 -45
  50. package/Localizations/LocalizationType.js +1 -0
  51. package/Localizations/LoginBoxLocalization/SplitPageTypes/index.d.ts +25 -25
  52. package/Localizations/LoginBoxLocalization/SplitPageTypes/index.js +1 -0
  53. package/Localizations/LoginBoxLocalization/acceptInvitation.d.ts +31 -31
  54. package/Localizations/LoginBoxLocalization/acceptInvitation.js +1 -0
  55. package/Localizations/LoginBoxLocalization/activateAccount.d.ts +79 -79
  56. package/Localizations/LoginBoxLocalization/activateAccount.js +1 -0
  57. package/Localizations/LoginBoxLocalization/forgetPassword.d.ts +35 -35
  58. package/Localizations/LoginBoxLocalization/forgetPassword.js +1 -0
  59. package/Localizations/LoginBoxLocalization/index.d.ts +20 -20
  60. package/Localizations/LoginBoxLocalization/index.js +11 -0
  61. package/Localizations/LoginBoxLocalization/login.d.ts +307 -335
  62. package/Localizations/LoginBoxLocalization/login.js +1 -0
  63. package/Localizations/LoginBoxLocalization/recoveryMfa.d.ts +23 -23
  64. package/Localizations/LoginBoxLocalization/recoveryMfa.js +1 -0
  65. package/Localizations/LoginBoxLocalization/resetPassword.d.ts +67 -67
  66. package/Localizations/LoginBoxLocalization/resetPassword.js +1 -0
  67. package/Localizations/LoginBoxLocalization/resetPhoneNumber.d.ts +34 -34
  68. package/Localizations/LoginBoxLocalization/resetPhoneNumber.js +1 -0
  69. package/Localizations/LoginBoxLocalization/signup.d.ts +186 -186
  70. package/Localizations/LoginBoxLocalization/signup.js +1 -0
  71. package/Localizations/LoginBoxLocalization/socialLogins.d.ts +34 -34
  72. package/Localizations/LoginBoxLocalization/socialLogins.js +1 -0
  73. package/Localizations/index.d.ts +4 -4
  74. package/Localizations/index.js +4 -0
  75. package/Localizations/package.json +6 -0
  76. package/Metadata/colorManipulator.d.ts +73 -73
  77. package/Metadata/colorManipulator.js +186 -0
  78. package/Metadata/getPalette.d.ts +3 -3
  79. package/Metadata/getPalette.js +58 -0
  80. package/Metadata/index.d.ts +15 -15
  81. package/Metadata/index.js +126 -0
  82. package/Metadata/package.json +6 -0
  83. package/PrivateOptions.d.ts +25 -25
  84. package/PrivateOptions.js +1 -0
  85. package/ThemeOptions/AdminPortalThemeOptions.d.ts +84 -84
  86. package/ThemeOptions/AdminPortalThemeOptions.js +16 -0
  87. package/ThemeOptions/BreakpointsOptions.d.ts +17 -17
  88. package/ThemeOptions/BreakpointsOptions.js +1 -0
  89. package/ThemeOptions/ComponentsOptions.d.ts +751 -751
  90. package/ThemeOptions/ComponentsOptions.js +2 -0
  91. package/ThemeOptions/LoginBoxTheme/AcceptInvitationTheme.d.ts +21 -21
  92. package/ThemeOptions/LoginBoxTheme/AcceptInvitationTheme.js +1 -0
  93. package/ThemeOptions/LoginBoxTheme/ActivateAccountPageTheme.d.ts +51 -51
  94. package/ThemeOptions/LoginBoxTheme/ActivateAccountPageTheme.js +1 -0
  95. package/ThemeOptions/LoginBoxTheme/CustomLoginComponents.d.ts +12 -12
  96. package/ThemeOptions/LoginBoxTheme/CustomLoginComponents.js +1 -0
  97. package/ThemeOptions/LoginBoxTheme/ForgotPasswordTheme.d.ts +45 -45
  98. package/ThemeOptions/LoginBoxTheme/ForgotPasswordTheme.js +1 -0
  99. package/ThemeOptions/LoginBoxTheme/LoaderTheme.d.ts +7 -7
  100. package/ThemeOptions/LoginBoxTheme/LoaderTheme.js +1 -0
  101. package/ThemeOptions/LoginBoxTheme/LoginBoxCommon.d.ts +226 -226
  102. package/ThemeOptions/LoginBoxTheme/LoginBoxCommon.js +1 -0
  103. package/ThemeOptions/LoginBoxTheme/LoginPageTheme.d.ts +136 -148
  104. package/ThemeOptions/LoginBoxTheme/LoginPageTheme.js +1 -0
  105. package/ThemeOptions/LoginBoxTheme/ResetPasswordTheme.d.ts +47 -47
  106. package/ThemeOptions/LoginBoxTheme/ResetPasswordTheme.js +1 -0
  107. package/ThemeOptions/LoginBoxTheme/ResetPhoneNumberTheme.d.ts +71 -71
  108. package/ThemeOptions/LoginBoxTheme/ResetPhoneNumberTheme.js +1 -0
  109. package/ThemeOptions/LoginBoxTheme/SignupPageTheme.d.ts +95 -95
  110. package/ThemeOptions/LoginBoxTheme/SignupPageTheme.js +1 -0
  111. package/ThemeOptions/LoginBoxTheme/SocialLoginsTheme.d.ts +64 -64
  112. package/ThemeOptions/LoginBoxTheme/SocialLoginsTheme.js +1 -0
  113. package/ThemeOptions/LoginBoxTheme/index.d.ts +53 -53
  114. package/ThemeOptions/LoginBoxTheme/index.js +11 -0
  115. package/ThemeOptions/LoginBoxThemeOptions.d.ts +46 -46
  116. package/ThemeOptions/LoginBoxThemeOptions.js +1 -0
  117. package/ThemeOptions/Palette.d.ts +85 -85
  118. package/ThemeOptions/Palette.js +1 -0
  119. package/ThemeOptions/Shadows.d.ts +1 -1
  120. package/ThemeOptions/Shadows.js +1 -0
  121. package/ThemeOptions/SpacingOptions.d.ts +9 -9
  122. package/ThemeOptions/SpacingOptions.js +1 -0
  123. package/ThemeOptions/TransitionsOptions.d.ts +23 -23
  124. package/ThemeOptions/TransitionsOptions.js +1 -0
  125. package/ThemeOptions/TypographyOptions.d.ts +13 -13
  126. package/ThemeOptions/TypographyOptions.js +1 -0
  127. package/ThemeOptions/index.d.ts +41 -41
  128. package/ThemeOptions/index.js +3 -0
  129. package/ThemeOptions/package.json +6 -0
  130. package/index.d.ts +7 -7
  131. package/index.js +12 -444
  132. package/node/CheckoutDialogOptions.js +5 -0
  133. package/node/Common.js +5 -0
  134. package/node/ContextOptions.js +5 -0
  135. package/node/CustomComponents.js +5 -0
  136. package/node/FronteggAppInstance.js +5 -0
  137. package/node/FronteggAppOptions.js +5 -0
  138. package/node/FronteggMetadata.js +5 -0
  139. package/node/FronteggStoreOptions.js +5 -0
  140. package/node/Localizations/AdminPortalLocalizations/accountSettings.js +5 -0
  141. package/node/Localizations/AdminPortalLocalizations/allUsers.js +5 -0
  142. package/node/Localizations/AdminPortalLocalizations/apiTokens.js +5 -0
  143. package/node/Localizations/AdminPortalLocalizations/auditLogs.js +5 -0
  144. package/node/Localizations/AdminPortalLocalizations/index.js +187 -0
  145. package/node/Localizations/AdminPortalLocalizations/navigation.js +5 -0
  146. package/node/Localizations/AdminPortalLocalizations/personalTokens.js +5 -0
  147. package/node/Localizations/AdminPortalLocalizations/privacy.js +5 -0
  148. package/node/Localizations/AdminPortalLocalizations/profile.js +5 -0
  149. package/node/Localizations/AdminPortalLocalizations/roles.js +5 -0
  150. package/node/Localizations/AdminPortalLocalizations/security.js +5 -0
  151. package/node/Localizations/AdminPortalLocalizations/sso.js +5 -0
  152. package/node/Localizations/AdminPortalLocalizations/subscriptions.js +5 -0
  153. package/node/Localizations/AdminPortalLocalizations/users.js +5 -0
  154. package/node/Localizations/AdminPortalLocalizations/webhooks.js +5 -0
  155. package/node/Localizations/LocalizationOverrides.js +5 -0
  156. package/node/Localizations/LocalizationType.js +5 -0
  157. package/node/Localizations/LoginBoxLocalization/SplitPageTypes/index.js +5 -0
  158. package/node/Localizations/LoginBoxLocalization/acceptInvitation.js +5 -0
  159. package/node/Localizations/LoginBoxLocalization/activateAccount.js +5 -0
  160. package/node/Localizations/LoginBoxLocalization/forgetPassword.js +5 -0
  161. package/node/Localizations/LoginBoxLocalization/index.js +135 -0
  162. package/node/Localizations/LoginBoxLocalization/login.js +5 -0
  163. package/node/Localizations/LoginBoxLocalization/recoveryMfa.js +5 -0
  164. package/node/Localizations/LoginBoxLocalization/resetPassword.js +5 -0
  165. package/node/Localizations/LoginBoxLocalization/resetPhoneNumber.js +5 -0
  166. package/node/Localizations/LoginBoxLocalization/signup.js +5 -0
  167. package/node/Localizations/LoginBoxLocalization/socialLogins.js +5 -0
  168. package/node/Localizations/index.js +57 -0
  169. package/node/Metadata/colorManipulator.js +210 -0
  170. package/node/Metadata/getPalette.js +70 -0
  171. package/node/Metadata/index.js +140 -0
  172. package/node/PrivateOptions.js +5 -0
  173. package/node/ThemeOptions/AdminPortalThemeOptions.js +23 -0
  174. package/node/ThemeOptions/BreakpointsOptions.js +5 -0
  175. package/node/ThemeOptions/ComponentsOptions.js +6 -0
  176. package/node/ThemeOptions/LoginBoxTheme/AcceptInvitationTheme.js +5 -0
  177. package/node/ThemeOptions/LoginBoxTheme/ActivateAccountPageTheme.js +5 -0
  178. package/node/ThemeOptions/LoginBoxTheme/CustomLoginComponents.js +5 -0
  179. package/node/ThemeOptions/LoginBoxTheme/ForgotPasswordTheme.js +5 -0
  180. package/node/ThemeOptions/LoginBoxTheme/LoaderTheme.js +5 -0
  181. package/node/ThemeOptions/LoginBoxTheme/LoginBoxCommon.js +5 -0
  182. package/node/ThemeOptions/LoginBoxTheme/LoginPageTheme.js +5 -0
  183. package/node/ThemeOptions/LoginBoxTheme/ResetPasswordTheme.js +5 -0
  184. package/node/ThemeOptions/LoginBoxTheme/ResetPhoneNumberTheme.js +5 -0
  185. package/node/ThemeOptions/LoginBoxTheme/SignupPageTheme.js +5 -0
  186. package/node/ThemeOptions/LoginBoxTheme/SocialLoginsTheme.js +5 -0
  187. package/node/ThemeOptions/LoginBoxTheme/index.js +135 -0
  188. package/node/ThemeOptions/LoginBoxThemeOptions.js +5 -0
  189. package/node/ThemeOptions/Palette.js +5 -0
  190. package/node/ThemeOptions/Shadows.js +5 -0
  191. package/node/ThemeOptions/SpacingOptions.js +5 -0
  192. package/node/ThemeOptions/TransitionsOptions.js +5 -0
  193. package/node/ThemeOptions/TypographyOptions.js +5 -0
  194. package/node/ThemeOptions/index.js +31 -0
  195. package/node/index.js +101 -446
  196. package/package.json +8 -5
  197. package/ThemeOptions/helpers.d.ts +0 -0
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -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
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var isMergeableObject = function isMergeableObject(value) {
6
- return isNonNullObject(value)
7
- && !isSpecial(value)
8
- };
9
-
10
- function isNonNullObject(value) {
11
- return !!value && typeof value === 'object'
12
- }
13
-
14
- function isSpecial(value) {
15
- var stringValue = Object.prototype.toString.call(value);
16
-
17
- return stringValue === '[object RegExp]'
18
- || stringValue === '[object Date]'
19
- || isReactElement(value)
20
- }
21
-
22
- // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
23
- var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
24
- var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
25
-
26
- function isReactElement(value) {
27
- return value.$$typeof === REACT_ELEMENT_TYPE
28
- }
29
-
30
- function emptyTarget(val) {
31
- return Array.isArray(val) ? [] : {}
32
- }
33
-
34
- function cloneUnlessOtherwiseSpecified(value, options) {
35
- return (options.clone !== false && options.isMergeableObject(value))
36
- ? deepmerge(emptyTarget(value), value, options)
37
- : value
38
- }
39
-
40
- function defaultArrayMerge(target, source, options) {
41
- return target.concat(source).map(function(element) {
42
- return cloneUnlessOtherwiseSpecified(element, options)
43
- })
44
- }
45
-
46
- function getMergeFunction(key, options) {
47
- if (!options.customMerge) {
48
- return deepmerge
49
- }
50
- var customMerge = options.customMerge(key);
51
- return typeof customMerge === 'function' ? customMerge : deepmerge
52
- }
53
-
54
- function getEnumerableOwnPropertySymbols(target) {
55
- return Object.getOwnPropertySymbols
56
- ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
57
- return target.propertyIsEnumerable(symbol)
58
- })
59
- : []
60
- }
61
-
62
- function getKeys(target) {
63
- return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
64
- }
65
-
66
- function propertyIsOnObject(object, property) {
67
- try {
68
- return property in object
69
- } catch(_) {
70
- return false
71
- }
72
- }
73
-
74
- // Protects from prototype poisoning and unexpected merging up the prototype chain.
75
- function propertyIsUnsafe(target, key) {
76
- return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
77
- && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
78
- && Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
79
- }
80
-
81
- function mergeObject(target, source, options) {
82
- var destination = {};
83
- if (options.isMergeableObject(target)) {
84
- getKeys(target).forEach(function(key) {
85
- destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
86
- });
87
- }
88
- getKeys(source).forEach(function(key) {
89
- if (propertyIsUnsafe(target, key)) {
90
- return
91
- }
92
-
93
- if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
94
- destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
95
- } else {
96
- destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
97
- }
98
- });
99
- return destination
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": "5.61.0",
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