@frontegg/js 6.100.0 → 6.101.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.
@@ -5,7 +5,7 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
5
5
  import _regeneratorRuntime from "@babel/runtime/regenerator";
6
6
  import { createFronteggStore, getEntitlements as _getEntitlements } from '@frontegg/redux-store';
7
7
  import { Metadata } from '@frontegg/types';
8
- import { formatName } from '../utils';
8
+ import { formatName, restoreSearchParams } from '../utils';
9
9
  import { AppHolder } from '../AppHolder';
10
10
  import { fetch as FronteggFetch } from '@frontegg/rest-api';
11
11
  import { RequestSource } from '@frontegg/rest-api';
@@ -360,7 +360,10 @@ export var FronteggApp = /*#__PURE__*/function () {
360
360
  value: function hideAdminPortal() {
361
361
  try {
362
362
  var _this$adminPortalRend;
363
+ var searchParams = new URLSearchParams(window.location.search);
363
364
  (_this$adminPortalRend = this.adminPortalRenderer) == null ? void 0 : _this$adminPortalRend.unmount();
365
+ // unmount is removing url search params, therefore we need to restore them after unmount
366
+ restoreSearchParams(searchParams);
364
367
  FronteggRestApi.ContextHolder.setRequestSource(null);
365
368
  } catch (e) {
366
369
  console.error('Failed to unmount admin portal', e);
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.100.0
1
+ /** @license Frontegg v6.101.0
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -367,7 +367,10 @@ var FronteggApp = /*#__PURE__*/function () {
367
367
  value: function hideAdminPortal() {
368
368
  try {
369
369
  var _this$adminPortalRend;
370
+ var searchParams = new URLSearchParams(window.location.search);
370
371
  (_this$adminPortalRend = this.adminPortalRenderer) == null ? void 0 : _this$adminPortalRend.unmount();
372
+ // unmount is removing url search params, therefore we need to restore them after unmount
373
+ (0, _utils.restoreSearchParams)(searchParams);
371
374
  FronteggRestApi.ContextHolder.setRequestSource(null);
372
375
  } catch (e) {
373
376
  console.error('Failed to unmount admin portal', e);
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.100.0
1
+ /** @license Frontegg v6.101.0
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.waitThemeSetter = exports.formatName = exports.createElement = void 0;
6
+ exports.waitThemeSetter = exports.restoreSearchParams = exports.formatName = exports.createElement = void 0;
7
7
  var formatName = function formatName(name) {
8
8
  return name.replace(/\W+/g, ' ').split(/ |\B(?=[A-Z])/).map(function (word) {
9
9
  return word.toLowerCase();
@@ -38,4 +38,14 @@ var waitThemeSetter = function waitThemeSetter(instance) {
38
38
  }, 50);
39
39
  });
40
40
  };
41
- exports.waitThemeSetter = waitThemeSetter;
41
+ exports.waitThemeSetter = waitThemeSetter;
42
+ var restoreSearchParams = function restoreSearchParams(searchParams) {
43
+ var stringifiedSearchParams = searchParams.toString();
44
+ if (!stringifiedSearchParams) {
45
+ return;
46
+ }
47
+ var url = new URL(window.location.href);
48
+ url.search = stringifiedSearchParams;
49
+ window.history.pushState(null, '', url.toString());
50
+ };
51
+ exports.restoreSearchParams = restoreSearchParams;
package/node/version.js CHANGED
@@ -5,6 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _default = {
8
- cdnVersion: '6.100.0'
8
+ cdnVersion: '6.101.0'
9
9
  };
10
10
  exports["default"] = _default;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@frontegg/js",
3
- "version": "6.100.0",
3
+ "version": "6.101.0",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "author": "Frontegg LTD",
7
7
  "dependencies": {
8
8
  "@babel/runtime": "^7.18.6",
9
- "@frontegg/types": "6.100.0"
9
+ "@frontegg/types": "6.101.0"
10
10
  },
11
11
  "browserslist": {
12
12
  "production": [
@@ -677,7 +677,10 @@ var FronteggApp = /*#__PURE__*/function () {
677
677
  value: function hideAdminPortal() {
678
678
  try {
679
679
  var _this$adminPortalRend;
680
+ var searchParams = new URLSearchParams(window.location.search);
680
681
  (_this$adminPortalRend = this.adminPortalRenderer) == null ? void 0 : _this$adminPortalRend.unmount();
682
+ // unmount is removing url search params, therefore we need to restore them after unmount
683
+ (0,_utils__WEBPACK_IMPORTED_MODULE_5__.restoreSearchParams)(searchParams);
681
684
  _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_15__.ContextHolder.setRequestSource(null);
682
685
  } catch (e) {
683
686
  console.error('Failed to unmount admin portal', e);
@@ -1151,6 +1154,7 @@ __webpack_require__.r(__webpack_exports__);
1151
1154
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1152
1155
  /* harmony export */ "createElement": () => (/* binding */ createElement),
1153
1156
  /* harmony export */ "formatName": () => (/* binding */ formatName),
1157
+ /* harmony export */ "restoreSearchParams": () => (/* binding */ restoreSearchParams),
1154
1158
  /* harmony export */ "waitThemeSetter": () => (/* binding */ waitThemeSetter)
1155
1159
  /* harmony export */ });
1156
1160
  var formatName = function formatName(name) {
@@ -1185,6 +1189,15 @@ var waitThemeSetter = function waitThemeSetter(instance) {
1185
1189
  }, 50);
1186
1190
  });
1187
1191
  };
1192
+ var restoreSearchParams = function restoreSearchParams(searchParams) {
1193
+ var stringifiedSearchParams = searchParams.toString();
1194
+ if (!stringifiedSearchParams) {
1195
+ return;
1196
+ }
1197
+ var url = new URL(window.location.href);
1198
+ url.search = stringifiedSearchParams;
1199
+ window.history.pushState(null, '', url.toString());
1200
+ };
1188
1201
 
1189
1202
  /***/ }),
1190
1203
 
@@ -1222,7 +1235,7 @@ __webpack_require__.r(__webpack_exports__);
1222
1235
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1223
1236
  /* harmony export */ });
1224
1237
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
1225
- cdnVersion: '6.100.0'
1238
+ cdnVersion: '6.101.0'
1226
1239
  });
1227
1240
 
1228
1241
  /***/ }),
@@ -19993,7 +20006,7 @@ __webpack_require__.r(__webpack_exports__);
19993
20006
  /* harmony export */ });
19994
20007
  /* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
19995
20008
  /* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
19996
- /** @license Frontegg v6.100.0
20009
+ /** @license Frontegg v6.101.0
19997
20010
  *
19998
20011
  * This source code is licensed under the MIT license found in the
19999
20012
  * LICENSE file in the root directory of this source tree.
@@ -30830,6 +30843,7 @@ __webpack_require__.r(__webpack_exports__);
30830
30843
  /* harmony export */ "getThemeByName": () => (/* reexport safe */ _LoginBoxRenderer__WEBPACK_IMPORTED_MODULE_6__.getThemeByName),
30831
30844
  /* harmony export */ "initialize": () => (/* reexport safe */ _initialize__WEBPACK_IMPORTED_MODULE_7__.initialize),
30832
30845
  /* harmony export */ "mockFlagsList": () => (/* reexport safe */ _utils_mockFlagsList__WEBPACK_IMPORTED_MODULE_9__.mockFlagsList),
30846
+ /* harmony export */ "restoreSearchParams": () => (/* reexport safe */ _utils_index__WEBPACK_IMPORTED_MODULE_8__.restoreSearchParams),
30833
30847
  /* harmony export */ "waitThemeSetter": () => (/* reexport safe */ _utils_index__WEBPACK_IMPORTED_MODULE_8__.waitThemeSetter)
30834
30848
  /* harmony export */ });
30835
30849
  /* harmony import */ var _AppHolder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppHolder */ "../../dist/@frontegg/js/AppHolder/index.js");