@frontegg/js 6.69.0-alpha.0 → 6.70.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,6 @@ export var AdminPortal = /*#__PURE__*/function () {
5
5
  function AdminPortal() {
6
6
  _classCallCheck(this, AdminPortal);
7
7
  }
8
-
9
8
  _createClass(AdminPortal, null, [{
10
9
  key: "show",
11
10
  value: function show() {
@@ -19,6 +18,5 @@ export var AdminPortal = /*#__PURE__*/function () {
19
18
  AppHolder.getInstance(name).hideAdminPortal();
20
19
  }
21
20
  }]);
22
-
23
21
  return AdminPortal;
24
22
  }();
@@ -9,7 +9,6 @@ import { FronteggApp } from '../FronteggApp';
9
9
  import { waitThemeSetter } from '../utils';
10
10
  export var getThemeAdminByName = function getThemeAdminByName(name) {
11
11
  var _name;
12
-
13
12
  // Load themes from window chunk to support cdn getThemeByName
14
13
  var adminPortalThemes = window['FronteggAdminPortal'].adminPortalStaticThemesDefaults;
15
14
  return (_name = adminPortalThemes[name]) != null ? _name : undefined;
@@ -17,13 +16,10 @@ export var getThemeAdminByName = function getThemeAdminByName(name) {
17
16
  export var AdminPortalRenderer = /*#__PURE__*/function () {
18
17
  function AdminPortalRenderer(name, themeOptions, store, appOptions) {
19
18
  _classCallCheck(this, AdminPortalRenderer);
20
-
21
19
  this.app = void 0;
22
20
  this.options = void 0;
23
21
  this.store = void 0;
24
-
25
22
  this.setRoute = function () {};
26
-
27
23
  this.themeSetter = void 0;
28
24
  this.themeOptions = {};
29
25
  var contextOptions = {
@@ -44,71 +40,57 @@ export var AdminPortalRenderer = /*#__PURE__*/function () {
44
40
  this.app = new FronteggApp(this.options, name, true);
45
41
  Metadata.set({}, name);
46
42
  }
47
-
48
43
  _createClass(AdminPortalRenderer, [{
49
44
  key: "render",
50
45
  value: function () {
51
46
  var _render = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(adminPortalContainer) {
52
47
  var _this = this;
53
-
54
48
  var adminPortalEl, setThemeSetter, setStaticRouteSetter, FronteggAdminPortal;
55
49
  return _regeneratorRuntime.wrap(function _callee$(_context) {
56
- while (1) {
57
- switch (_context.prev = _context.next) {
58
- case 0:
59
- adminPortalEl = adminPortalContainer.querySelector('#root');
60
-
61
- if (!adminPortalEl) {
62
- adminPortalEl = adminPortalContainer.ownerDocument.createElement('div');
63
- adminPortalEl.setAttribute('id', 'root');
64
- adminPortalContainer.appendChild(adminPortalEl);
65
- }
66
-
67
- this.app.adminPortalContainer = adminPortalContainer;
68
- this.app.adminPortalEl = adminPortalEl;
69
-
70
- setThemeSetter = function setThemeSetter(themeSetter) {
71
- _this.themeSetter = themeSetter;
72
- };
73
-
74
- setStaticRouteSetter = function setStaticRouteSetter(setStaticRoute) {
75
- _this.setRoute = setStaticRoute;
76
- };
77
-
78
- _context.next = 8;
79
- return this.app.loadScript('FronteggAdminPortal');
80
-
81
- case 8:
82
- FronteggAdminPortal = _context.sent;
83
- this.app.adminPortalRenderer = FronteggAdminPortal.renderPage(adminPortalEl, {
84
- options: this.options,
85
- injector: this.app,
86
- setThemeSetter: setThemeSetter,
87
- setStaticRouteSetter: setStaticRouteSetter
88
- });
89
- this.app.loading = false;
90
- _context.next = 13;
91
- return waitThemeSetter(this);
92
-
93
- case 13:
94
- case "end":
95
- return _context.stop();
96
- }
50
+ while (1) switch (_context.prev = _context.next) {
51
+ case 0:
52
+ adminPortalEl = adminPortalContainer.querySelector('#root');
53
+ if (!adminPortalEl) {
54
+ adminPortalEl = adminPortalContainer.ownerDocument.createElement('div');
55
+ adminPortalEl.setAttribute('id', 'root');
56
+ adminPortalContainer.appendChild(adminPortalEl);
57
+ }
58
+ this.app.adminPortalContainer = adminPortalContainer;
59
+ this.app.adminPortalEl = adminPortalEl;
60
+ setThemeSetter = function setThemeSetter(themeSetter) {
61
+ _this.themeSetter = themeSetter;
62
+ };
63
+ setStaticRouteSetter = function setStaticRouteSetter(setStaticRoute) {
64
+ _this.setRoute = setStaticRoute;
65
+ };
66
+ _context.next = 8;
67
+ return this.app.loadScript('FronteggAdminPortal');
68
+ case 8:
69
+ FronteggAdminPortal = _context.sent;
70
+ this.app.adminPortalRenderer = FronteggAdminPortal.renderPage(adminPortalEl, {
71
+ options: this.options,
72
+ injector: this.app,
73
+ setThemeSetter: setThemeSetter,
74
+ setStaticRouteSetter: setStaticRouteSetter
75
+ });
76
+ this.app.loading = false;
77
+ _context.next = 13;
78
+ return waitThemeSetter(this);
79
+ case 13:
80
+ case "end":
81
+ return _context.stop();
97
82
  }
98
83
  }, _callee, this);
99
84
  }));
100
-
101
85
  function render(_x) {
102
86
  return _render.apply(this, arguments);
103
87
  }
104
-
105
88
  return render;
106
89
  }()
107
90
  }, {
108
91
  key: "setStaticRoute",
109
92
  value: function setStaticRoute(staticRoute) {
110
93
  var _this$setRoute;
111
-
112
94
  (_this$setRoute = this.setRoute) == null ? void 0 : _this$setRoute.call(this, staticRoute);
113
95
  }
114
96
  }, {
@@ -116,7 +98,6 @@ export var AdminPortalRenderer = /*#__PURE__*/function () {
116
98
  value: function unmount() {
117
99
  try {
118
100
  var _this$app$adminPortal;
119
-
120
101
  (_this$app$adminPortal = this.app.adminPortalRenderer) == null ? void 0 : _this$app$adminPortal.unmount();
121
102
  } catch (e) {
122
103
  console.error('Failed to unmount admin Portal renderer', e);
@@ -126,17 +107,13 @@ export var AdminPortalRenderer = /*#__PURE__*/function () {
126
107
  key: "setTheme",
127
108
  value: function setTheme(themeOptions) {
128
109
  var _this$themeSetter;
129
-
130
110
  this.themeOptions = themeOptions;
131
-
132
111
  if (!this.themeSetter) {
133
112
  console.warn('this.themeSetter is not defined yet');
134
113
  }
135
-
136
114
  (_this$themeSetter = this.themeSetter) == null ? void 0 : _this$themeSetter.call(this, this.themeOptions);
137
115
  }
138
116
  }]);
139
-
140
117
  return AdminPortalRenderer;
141
118
  }();
142
119
  export default AdminPortalRenderer;
@@ -4,7 +4,6 @@ export var AppHolder = /*#__PURE__*/function () {
4
4
  function AppHolder() {
5
5
  _classCallCheck(this, AppHolder);
6
6
  }
7
-
8
7
  _createClass(AppHolder, null, [{
9
8
  key: "setInstance",
10
9
  value: function setInstance(name, app) {
@@ -14,15 +13,12 @@ export var AppHolder = /*#__PURE__*/function () {
14
13
  key: "getInstance",
15
14
  value: function getInstance(name) {
16
15
  var app = AppHolder._apps[name];
17
-
18
16
  if (!app) {
19
17
  throw Error("[".concat(name, "] FronteggApp not found"));
20
18
  }
21
-
22
19
  return app;
23
20
  }
24
21
  }]);
25
-
26
22
  return AppHolder;
27
23
  }();
28
24
  AppHolder._apps = {};
@@ -5,7 +5,6 @@ export var CheckoutDialog = /*#__PURE__*/function () {
5
5
  function CheckoutDialog() {
6
6
  _classCallCheck(this, CheckoutDialog);
7
7
  }
8
-
9
8
  _createClass(CheckoutDialog, null, [{
10
9
  key: "show",
11
10
  value: function show(opts) {
@@ -19,6 +18,5 @@ export var CheckoutDialog = /*#__PURE__*/function () {
19
18
  AppHolder.getInstance(name).hideCheckoutDialog();
20
19
  }
21
20
  }]);
22
-
23
21
  return CheckoutDialog;
24
22
  }();