@frontegg/admin-portal
Advanced tools
Comparing version 0.2.4 to 0.4.0
import Injector from '@frontegg/injector'; | ||
import { ContextOptions } from './types'; | ||
import { ThemeOptions } from '@material-ui/core/styles/createMuiTheme'; | ||
export * from './AdminBoxMetadata'; | ||
@@ -9,3 +8,3 @@ interface FronteggConfigOptions { | ||
contextOptions: ContextOptions; | ||
themeOptions: ThemeOptions; | ||
themeOptions?: any; | ||
} | ||
@@ -19,2 +18,3 @@ declare type Unsubscribe = () => void; | ||
private static _apps; | ||
loaded: boolean; | ||
readonly name: string; | ||
@@ -25,2 +25,4 @@ readonly options: FronteggConfigOptions; | ||
store?: EnhancedStore; | ||
private loadSubscribers; | ||
private storeSubscribers; | ||
protected constructor(name: string, options: FronteggConfigOptions); | ||
@@ -31,2 +33,4 @@ private initInjectors; | ||
static getConfig(name?: string): FronteggApp; | ||
onLoad: (callback: () => void) => void; | ||
onStoreChanged: (callback: (state: any) => void) => void; | ||
mountAdminPortal(): void; | ||
@@ -33,0 +37,0 @@ unmountAdminPortal(): void; |
@@ -68,2 +68,15 @@ "use strict"; | ||
function FronteggApp(name, options) { | ||
var _this = this; | ||
this.loaded = false; | ||
this.loadSubscribers = []; | ||
this.storeSubscribers = []; | ||
this.onLoad = function (callback) { | ||
_this.loadSubscribers.push(callback); | ||
if (_this.loaded) { | ||
callback(); | ||
} | ||
}; | ||
this.onStoreChanged = function (callback) { | ||
_this.storeSubscribers.push(callback); | ||
}; | ||
this.name = name; | ||
@@ -75,12 +88,15 @@ this.options = options; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var adminPortalName, loginBoxName; | ||
var adminPortalName, loginBoxName, waitForLoadingModules; | ||
var _this = this; | ||
return __generator(this, function (_a) { | ||
adminPortalName = this.name + "_admin-portal"; | ||
loginBoxName = this.name + "_login-box"; | ||
injector_1.default.init(__assign({ cdn: 'https://fronteggdeveustorage.blob.core.windows.net/admin-box', | ||
// cdn: 'https://assets.frontegg.com/admin-box', | ||
injector_1.default.init(__assign({ | ||
// cdn: 'https://fronteggdeveustorage.blob.core.windows.net/admin-box', | ||
cdn: 'https://assets.frontegg.com/admin-box', | ||
// cdn: 'http://localhost:5000', | ||
version: 'latest' }, this.options), adminPortalName); | ||
injector_1.default.init(__assign({ cdn: 'https://fronteggdeveustorage.blob.core.windows.net/admin-box/login-box', | ||
// cdn: 'https://assets.frontegg.com/admin-box/login-box', | ||
injector_1.default.init(__assign({ | ||
// cdn: 'https://fronteggdeveustorage.blob.core.windows.net/admin-box/login-box', | ||
cdn: 'https://assets.frontegg.com/login-box', | ||
// cdn: 'http://localhost:5001', | ||
@@ -90,2 +106,17 @@ version: 'latest' }, this.options), loginBoxName); | ||
this.loginBox = injector_1.default.getInstance(loginBoxName); | ||
waitForLoadingModules = setInterval(function () { | ||
var _a, _b, _c; | ||
if (((_a = _this.adminPortal) === null || _a === void 0 ? void 0 : _a.loaded) && ((_b = _this.loginBox) === null || _b === void 0 ? void 0 : _b.loaded)) { | ||
clearInterval(waitForLoadingModules); | ||
_this.loaded = true; | ||
_this.loadSubscribers.forEach(function (c) { return c(); }); | ||
(_c = _this.store) === null || _c === void 0 ? void 0 : _c.subscribe(function () { | ||
_this.storeSubscribers.forEach(function (listener) { | ||
var _a, _b; | ||
var state = (_b = (_a = _this.store) === null || _a === void 0 ? void 0 : _a.getState) === null || _b === void 0 ? void 0 : _b.call(_a); | ||
state && listener(state); | ||
}); | ||
}); | ||
} | ||
}, 50); | ||
// @ts-ignore | ||
@@ -92,0 +123,0 @@ this.adminPortal.app = this; |
@@ -1,2 +0,2 @@ | ||
import { InjectorOptions } from '@frontegg/injector/dist/esm/types'; | ||
import { InjectorOptions } from '@frontegg/injector'; | ||
export interface AdminBoxInjectorOptions extends Partial<Omit<InjectorOptions, 'contextOptions'>> { | ||
@@ -3,0 +3,0 @@ contextOptions?: ContextOptions; |
import Injector from '@frontegg/injector'; | ||
import { ContextOptions } from './types'; | ||
import { ThemeOptions } from '@material-ui/core/styles/createMuiTheme'; | ||
export * from './AdminBoxMetadata'; | ||
@@ -9,3 +8,3 @@ interface FronteggConfigOptions { | ||
contextOptions: ContextOptions; | ||
themeOptions: ThemeOptions; | ||
themeOptions?: any; | ||
} | ||
@@ -19,2 +18,3 @@ declare type Unsubscribe = () => void; | ||
private static _apps; | ||
loaded: boolean; | ||
readonly name: string; | ||
@@ -25,2 +25,4 @@ readonly options: FronteggConfigOptions; | ||
store?: EnhancedStore; | ||
private loadSubscribers; | ||
private storeSubscribers; | ||
protected constructor(name: string, options: FronteggConfigOptions); | ||
@@ -31,2 +33,4 @@ private initInjectors; | ||
static getConfig(name?: string): FronteggApp; | ||
onLoad: (callback: () => void) => void; | ||
onStoreChanged: (callback: (state: any) => void) => void; | ||
mountAdminPortal(): void; | ||
@@ -33,0 +37,0 @@ unmountAdminPortal(): void; |
@@ -14,2 +14,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
constructor(name, options) { | ||
this.loaded = false; | ||
this.loadSubscribers = []; | ||
this.storeSubscribers = []; | ||
this.onLoad = (callback) => { | ||
this.loadSubscribers.push(callback); | ||
if (this.loaded) { | ||
callback(); | ||
} | ||
}; | ||
this.onStoreChanged = (callback) => { | ||
this.storeSubscribers.push(callback); | ||
}; | ||
this.name = name; | ||
@@ -23,8 +35,10 @@ this.options = options; | ||
const loginBoxName = `${this.name}_login-box`; | ||
Injector.init(Object.assign({ cdn: 'https://fronteggdeveustorage.blob.core.windows.net/admin-box', | ||
// cdn: 'https://assets.frontegg.com/admin-box', | ||
Injector.init(Object.assign({ | ||
// cdn: 'https://fronteggdeveustorage.blob.core.windows.net/admin-box', | ||
cdn: 'https://assets.frontegg.com/admin-box', | ||
// cdn: 'http://localhost:5000', | ||
version: 'latest' }, this.options), adminPortalName); | ||
Injector.init(Object.assign({ cdn: 'https://fronteggdeveustorage.blob.core.windows.net/admin-box/login-box', | ||
// cdn: 'https://assets.frontegg.com/admin-box/login-box', | ||
Injector.init(Object.assign({ | ||
// cdn: 'https://fronteggdeveustorage.blob.core.windows.net/admin-box/login-box', | ||
cdn: 'https://assets.frontegg.com/login-box', | ||
// cdn: 'http://localhost:5001', | ||
@@ -34,2 +48,17 @@ version: 'latest' }, this.options), loginBoxName); | ||
this.loginBox = Injector.getInstance(loginBoxName); | ||
const waitForLoadingModules = setInterval(() => { | ||
var _a, _b, _c; | ||
if (((_a = this.adminPortal) === null || _a === void 0 ? void 0 : _a.loaded) && ((_b = this.loginBox) === null || _b === void 0 ? void 0 : _b.loaded)) { | ||
clearInterval(waitForLoadingModules); | ||
this.loaded = true; | ||
this.loadSubscribers.forEach(c => c()); | ||
(_c = this.store) === null || _c === void 0 ? void 0 : _c.subscribe(() => { | ||
this.storeSubscribers.forEach(listener => { | ||
var _a, _b; | ||
const state = (_b = (_a = this.store) === null || _a === void 0 ? void 0 : _a.getState) === null || _b === void 0 ? void 0 : _b.call(_a); | ||
state && listener(state); | ||
}); | ||
}); | ||
} | ||
}, 50); | ||
// @ts-ignore | ||
@@ -36,0 +65,0 @@ this.adminPortal.app = this; |
@@ -1,2 +0,2 @@ | ||
import { InjectorOptions } from '@frontegg/injector/dist/esm/types'; | ||
import { InjectorOptions } from '@frontegg/injector'; | ||
export interface AdminBoxInjectorOptions extends Partial<Omit<InjectorOptions, 'contextOptions'>> { | ||
@@ -3,0 +3,0 @@ contextOptions?: ContextOptions; |
import Injector from '@frontegg/injector'; | ||
import { ContextOptions } from './types'; | ||
import { ThemeOptions } from '@material-ui/core/styles/createMuiTheme'; | ||
export * from './AdminBoxMetadata'; | ||
@@ -9,3 +8,3 @@ interface FronteggConfigOptions { | ||
contextOptions: ContextOptions; | ||
themeOptions: ThemeOptions; | ||
themeOptions?: any; | ||
} | ||
@@ -19,2 +18,3 @@ declare type Unsubscribe = () => void; | ||
private static _apps; | ||
loaded: boolean; | ||
readonly name: string; | ||
@@ -25,2 +25,4 @@ readonly options: FronteggConfigOptions; | ||
store?: EnhancedStore; | ||
private loadSubscribers; | ||
private storeSubscribers; | ||
protected constructor(name: string, options: FronteggConfigOptions); | ||
@@ -31,2 +33,4 @@ private initInjectors; | ||
static getConfig(name?: string): FronteggApp; | ||
onLoad: (callback: () => void) => void; | ||
onStoreChanged: (callback: (state: any) => void) => void; | ||
mountAdminPortal(): void; | ||
@@ -33,0 +37,0 @@ unmountAdminPortal(): void; |
@@ -52,2 +52,15 @@ var __assign = (this && this.__assign) || function () { | ||
function FronteggApp(name, options) { | ||
var _this = this; | ||
this.loaded = false; | ||
this.loadSubscribers = []; | ||
this.storeSubscribers = []; | ||
this.onLoad = function (callback) { | ||
_this.loadSubscribers.push(callback); | ||
if (_this.loaded) { | ||
callback(); | ||
} | ||
}; | ||
this.onStoreChanged = function (callback) { | ||
_this.storeSubscribers.push(callback); | ||
}; | ||
this.name = name; | ||
@@ -59,12 +72,15 @@ this.options = options; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var adminPortalName, loginBoxName; | ||
var adminPortalName, loginBoxName, waitForLoadingModules; | ||
var _this = this; | ||
return __generator(this, function (_a) { | ||
adminPortalName = this.name + "_admin-portal"; | ||
loginBoxName = this.name + "_login-box"; | ||
Injector.init(__assign({ cdn: 'https://fronteggdeveustorage.blob.core.windows.net/admin-box', | ||
// cdn: 'https://assets.frontegg.com/admin-box', | ||
Injector.init(__assign({ | ||
// cdn: 'https://fronteggdeveustorage.blob.core.windows.net/admin-box', | ||
cdn: 'https://assets.frontegg.com/admin-box', | ||
// cdn: 'http://localhost:5000', | ||
version: 'latest' }, this.options), adminPortalName); | ||
Injector.init(__assign({ cdn: 'https://fronteggdeveustorage.blob.core.windows.net/admin-box/login-box', | ||
// cdn: 'https://assets.frontegg.com/admin-box/login-box', | ||
Injector.init(__assign({ | ||
// cdn: 'https://fronteggdeveustorage.blob.core.windows.net/admin-box/login-box', | ||
cdn: 'https://assets.frontegg.com/login-box', | ||
// cdn: 'http://localhost:5001', | ||
@@ -74,2 +90,17 @@ version: 'latest' }, this.options), loginBoxName); | ||
this.loginBox = Injector.getInstance(loginBoxName); | ||
waitForLoadingModules = setInterval(function () { | ||
var _a, _b, _c; | ||
if (((_a = _this.adminPortal) === null || _a === void 0 ? void 0 : _a.loaded) && ((_b = _this.loginBox) === null || _b === void 0 ? void 0 : _b.loaded)) { | ||
clearInterval(waitForLoadingModules); | ||
_this.loaded = true; | ||
_this.loadSubscribers.forEach(function (c) { return c(); }); | ||
(_c = _this.store) === null || _c === void 0 ? void 0 : _c.subscribe(function () { | ||
_this.storeSubscribers.forEach(function (listener) { | ||
var _a, _b; | ||
var state = (_b = (_a = _this.store) === null || _a === void 0 ? void 0 : _a.getState) === null || _b === void 0 ? void 0 : _b.call(_a); | ||
state && listener(state); | ||
}); | ||
}); | ||
} | ||
}, 50); | ||
// @ts-ignore | ||
@@ -76,0 +107,0 @@ this.adminPortal.app = this; |
@@ -1,2 +0,2 @@ | ||
import { InjectorOptions } from '@frontegg/injector/dist/esm/types'; | ||
import { InjectorOptions } from '@frontegg/injector'; | ||
export interface AdminBoxInjectorOptions extends Partial<Omit<InjectorOptions, 'contextOptions'>> { | ||
@@ -3,0 +3,0 @@ contextOptions?: ContextOptions; |
{ | ||
"name": "@frontegg/admin-portal", | ||
"version": "0.2.4", | ||
"version": "0.4.0", | ||
"main": "cjs/index.js", | ||
@@ -20,4 +20,4 @@ "types": "es2015/index.d.ts", | ||
"dependencies": { | ||
"@frontegg/injector": "^0.0.22" | ||
"@frontegg/injector": "^0.0.23" | ||
} | ||
} |
@@ -60,2 +60,15 @@ (function (global, factory) { | ||
function FronteggApp(name, options) { | ||
var _this = this; | ||
this.loaded = false; | ||
this.loadSubscribers = []; | ||
this.storeSubscribers = []; | ||
this.onLoad = function (callback) { | ||
_this.loadSubscribers.push(callback); | ||
if (_this.loaded) { | ||
callback(); | ||
} | ||
}; | ||
this.onStoreChanged = function (callback) { | ||
_this.storeSubscribers.push(callback); | ||
}; | ||
this.name = name; | ||
@@ -67,12 +80,15 @@ this.options = options; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var adminPortalName, loginBoxName; | ||
var adminPortalName, loginBoxName, waitForLoadingModules; | ||
var _this = this; | ||
return __generator(this, function (_a) { | ||
adminPortalName = this.name + "_admin-portal"; | ||
loginBoxName = this.name + "_login-box"; | ||
Injector__default['default'].init(__assign({ cdn: 'https://fronteggdeveustorage.blob.core.windows.net/admin-box', | ||
// cdn: 'https://assets.frontegg.com/admin-box', | ||
Injector__default['default'].init(__assign({ | ||
// cdn: 'https://fronteggdeveustorage.blob.core.windows.net/admin-box', | ||
cdn: 'https://assets.frontegg.com/admin-box', | ||
// cdn: 'http://localhost:5000', | ||
version: 'latest' }, this.options), adminPortalName); | ||
Injector__default['default'].init(__assign({ cdn: 'https://fronteggdeveustorage.blob.core.windows.net/admin-box/login-box', | ||
// cdn: 'https://assets.frontegg.com/admin-box/login-box', | ||
Injector__default['default'].init(__assign({ | ||
// cdn: 'https://fronteggdeveustorage.blob.core.windows.net/admin-box/login-box', | ||
cdn: 'https://assets.frontegg.com/login-box', | ||
// cdn: 'http://localhost:5001', | ||
@@ -82,2 +98,17 @@ version: 'latest' }, this.options), loginBoxName); | ||
this.loginBox = Injector__default['default'].getInstance(loginBoxName); | ||
waitForLoadingModules = setInterval(function () { | ||
var _a, _b, _c; | ||
if (((_a = _this.adminPortal) === null || _a === void 0 ? void 0 : _a.loaded) && ((_b = _this.loginBox) === null || _b === void 0 ? void 0 : _b.loaded)) { | ||
clearInterval(waitForLoadingModules); | ||
_this.loaded = true; | ||
_this.loadSubscribers.forEach(function (c) { return c(); }); | ||
(_c = _this.store) === null || _c === void 0 ? void 0 : _c.subscribe(function () { | ||
_this.storeSubscribers.forEach(function (listener) { | ||
var _a, _b; | ||
var state = (_b = (_a = _this.store) === null || _a === void 0 ? void 0 : _a.getState) === null || _b === void 0 ? void 0 : _b.call(_a); | ||
state && listener(state); | ||
}); | ||
}); | ||
} | ||
}, 50); | ||
// @ts-ignore | ||
@@ -84,0 +115,0 @@ this.adminPortal.app = this; |
@@ -1,1 +0,1 @@ | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@frontegg/injector")):"function"==typeof define&&define.amd?define(["exports","@frontegg/injector"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).AdminBoxInjector={},n.Injector)}(this,function(n,t){"use strict";function o(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var e=o(t),i=window&&window.__assign||function(){return(i=Object.assign||function(n){for(var t,o=1,e=arguments.length;o<e;o++)for(var i in t=arguments[o])Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}).apply(this,arguments)},r=window&&window.__awaiter||function(n,a,u,l){return new(u=u||Promise)(function(o,t){function e(n){try{r(l.next(n))}catch(n){t(n)}}function i(n){try{r(l.throw(n))}catch(n){t(n)}}function r(n){var t;n.done?o(n.value):((t=n.value)instanceof u?t:new u(function(n){n(t)})).then(e,i)}r((l=l.apply(n,a||[])).next())})},a=window&&window.__generator||function(o,e){var i,r,a,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},n={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function t(t){return function(n){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,r&&(a=2&t[0]?r.return:t[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,t[1])).done)return a;switch(r=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,r=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(a=0<(a=u.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){u.label=t[1];break}if(6===t[0]&&u.label<a[1]){u.label=a[1],a=t;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(t);break}a[2]&&u.ops.pop(),u.trys.pop();continue}t=e.call(o,u)}catch(n){t=[6,n],r=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,n])}}},u=(l.prototype.initInjectors=function(){return r(this,void 0,void 0,function(){var t,o;return a(this,function(n){return t=this.name+"_admin-portal",o=this.name+"_login-box",e.default.init(i({cdn:"https://fronteggdeveustorage.blob.core.windows.net/admin-box",version:"latest"},this.options),t),e.default.init(i({cdn:"https://fronteggdeveustorage.blob.core.windows.net/admin-box/login-box",version:"latest"},this.options),o),this.adminPortal=e.default.getInstance(t),this.loginBox=e.default.getInstance(o),(this.adminPortal.app=this).loginBox.app=this,[2]})})},l.getInstance=function(n){var t=l._apps[n];if(!t)throw Error("Frontegg instance not found for name: "+n+".\nFrontegg.initialize(options"+("default"===n?"":", '"+n+"'")+") must be called");return t},l.setConfig=function(n,t){var o=l._apps[t=void 0===t?"default":t];return o?console.warn("Frontegg instance already initialized for name: "+t):(o=new l(t,n),l._apps[t]=o),o},l.getConfig=function(n){return l.getInstance(n=void 0===n?"default":n)},l.prototype.mountAdminPortal=function(){var n;null!==(n=this.adminPortal)&&void 0!==n&&n.open()},l.prototype.unmountAdminPortal=function(){var n;null!==(n=this.adminPortal)&&void 0!==n&&n.close()},l.prototype.mountLoginBox=function(){var n;null!==(n=this.loginBox)&&void 0!==n&&n.open()},l.prototype.unmountLoginBox=function(){var n;null!==(n=this.loginBox)&&void 0!==n&&n.close()},l._apps={},l);function l(n,t){this.name=n,this.options=t,this.initInjectors()}function f(n,t){return void 0===t&&(t="default"),u.setConfig(n,t)}var s={show:function(n){void 0===n&&(n="default"),u.getConfig(n).mountAdminPortal()},hide:function(n){void 0===n&&(n="default"),u.getConfig(n).unmountAdminPortal()}},t={show:function(n){void 0===n&&(n="default"),u.getConfig(n).mountLoginBox()},hide:function(n){void 0===n&&(n="default"),u.getConfig(n).unmountLoginBox()}};Object.assign(window,{FronteggApp:u,AdminPortal:s,LoginBox:t,Frontegg:{initialize:f}}),n.AdminPortal=s,n.LoginBox=t,n.initialize=f,Object.defineProperty(n,"__esModule",{value:!0})}); | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@frontegg/injector")):"function"==typeof define&&define.amd?define(["exports","@frontegg/injector"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).AdminBoxInjector={},n.Injector)}(this,function(n,t){"use strict";function o(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var r=o(t),a=window&&window.__assign||function(){return(a=Object.assign||function(n){for(var t,o=1,e=arguments.length;o<e;o++)for(var i in t=arguments[o])Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}).apply(this,arguments)},e=window&&window.__awaiter||function(n,a,u,l){return new(u=u||Promise)(function(o,t){function e(n){try{r(l.next(n))}catch(n){t(n)}}function i(n){try{r(l.throw(n))}catch(n){t(n)}}function r(n){var t;n.done?o(n.value):((t=n.value)instanceof u?t:new u(function(n){n(t)})).then(e,i)}r((l=l.apply(n,a||[])).next())})},u=window&&window.__generator||function(o,e){var i,r,a,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},n={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function t(t){return function(n){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,r&&(a=2&t[0]?r.return:t[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,t[1])).done)return a;switch(r=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,r=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(a=0<(a=u.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){u.label=t[1];break}if(6===t[0]&&u.label<a[1]){u.label=a[1],a=t;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(t);break}a[2]&&u.ops.pop(),u.trys.pop();continue}t=e.call(o,u)}catch(n){t=[6,n],r=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,n])}}},i=(l.prototype.initInjectors=function(){return e(this,void 0,void 0,function(){var t,o,e,i=this;return u(this,function(n){return t=this.name+"_admin-portal",o=this.name+"_login-box",r.default.init(a({cdn:"https://assets.frontegg.com/admin-box",version:"latest"},this.options),t),r.default.init(a({cdn:"https://assets.frontegg.com/login-box",version:"latest"},this.options),o),this.adminPortal=r.default.getInstance(t),this.loginBox=r.default.getInstance(o),e=setInterval(function(){var n,t;null!==(n=i.adminPortal)&&void 0!==n&&n.loaded&&null!==(t=i.loginBox)&&void 0!==t&&t.loaded&&(clearInterval(e),i.loaded=!0,i.loadSubscribers.forEach(function(n){return n()}),null!==(t=i.store)&&void 0!==t&&t.subscribe(function(){i.storeSubscribers.forEach(function(n){var t,o=null===(t=null===(o=i.store)||void 0===o?void 0:o.getState)||void 0===t?void 0:t.call(o);o&&n(o)})}))},50),(this.adminPortal.app=this).loginBox.app=this,[2]})})},l.getInstance=function(n){var t=l._apps[n];if(!t)throw Error("Frontegg instance not found for name: "+n+".\nFrontegg.initialize(options"+("default"===n?"":", '"+n+"'")+") must be called");return t},l.setConfig=function(n,t){var o=l._apps[t=void 0===t?"default":t];return o?console.warn("Frontegg instance already initialized for name: "+t):(o=new l(t,n),l._apps[t]=o),o},l.getConfig=function(n){return l.getInstance(n=void 0===n?"default":n)},l.prototype.mountAdminPortal=function(){var n;null!==(n=this.adminPortal)&&void 0!==n&&n.open()},l.prototype.unmountAdminPortal=function(){var n;null!==(n=this.adminPortal)&&void 0!==n&&n.close()},l.prototype.mountLoginBox=function(){var n;null!==(n=this.loginBox)&&void 0!==n&&n.open()},l.prototype.unmountLoginBox=function(){var n;null!==(n=this.loginBox)&&void 0!==n&&n.close()},l._apps={},l);function l(n,t){var o=this;this.loaded=!1,this.loadSubscribers=[],this.storeSubscribers=[],this.onLoad=function(n){o.loadSubscribers.push(n),o.loaded&&n()},this.onStoreChanged=function(n){o.storeSubscribers.push(n)},this.name=n,this.options=t,this.initInjectors()}function s(n,t){return void 0===t&&(t="default"),i.setConfig(n,t)}var c={show:function(n){void 0===n&&(n="default"),i.getConfig(n).mountAdminPortal()},hide:function(n){void 0===n&&(n="default"),i.getConfig(n).unmountAdminPortal()}},t={show:function(n){void 0===n&&(n="default"),i.getConfig(n).mountLoginBox()},hide:function(n){void 0===n&&(n="default"),i.getConfig(n).unmountLoginBox()}};Object.assign(window,{FronteggApp:i,AdminPortal:c,LoginBox:t,Frontegg:{initialize:s}}),n.AdminPortal=c,n.LoginBox=t,n.initialize=s,Object.defineProperty(n,"__esModule",{value:!0})}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
99454
1197
+ Added@frontegg/injector@0.0.23(transitive)
- Removed@frontegg/injector@0.0.22(transitive)
Updated@frontegg/injector@^0.0.23