@backstage/core-app-api 1.8.2-next.1 → 1.9.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @backstage/core-app-api
2
2
 
3
+ ## 1.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a77ddf7ccd71: add login in popup options to config popup width and height
8
+
9
+ ### Patch Changes
10
+
11
+ - 8174cf4c0edf: Fixing MUI / Material UI references
12
+ - Updated dependencies
13
+ - @backstage/core-plugin-api@1.5.3
14
+ - @backstage/config@1.0.8
15
+ - @backstage/types@1.1.0
16
+ - @backstage/version-bridge@1.0.4
17
+
3
18
  ## 1.8.2-next.1
4
19
 
5
20
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -138,12 +138,29 @@ declare class GoogleAuth {
138
138
  static create(options: OAuthApiCreateOptions): typeof googleAuthApiRef.T;
139
139
  }
140
140
 
141
+ /**
142
+ * Options for login popup
143
+ * @public
144
+ */
145
+ type PopupOptions = {
146
+ size?: {
147
+ width: number;
148
+ height: number;
149
+ fullscreen?: never;
150
+ } | {
151
+ width?: never;
152
+ height?: never;
153
+ fullscreen: boolean;
154
+ };
155
+ };
156
+
141
157
  /**
142
158
  * OAuth2 create options.
143
159
  * @public
144
160
  */
145
161
  type OAuth2CreateOptions = OAuthApiCreateOptions & {
146
162
  scopeTransform?: (scopes: string[]) => string[];
163
+ popupOptions?: PopupOptions;
147
164
  };
148
165
  /**
149
166
  * Implements a generic OAuth2 flow for auth.
@@ -1033,4 +1050,4 @@ type FeatureFlaggedProps = {
1033
1050
  */
1034
1051
  declare const FeatureFlagged: (props: FeatureFlaggedProps) => JSX.Element;
1035
1052
 
1036
- export { AlertApiForwarder, ApiFactoryHolder, ApiFactoryRegistry, ApiFactoryScope, ApiProvider, ApiProviderProps, ApiResolver, AppComponents, AppConfigLoader, AppContext, AppIcons, AppOptions, AppRouteBinder, AppRouter, AppRouterProps, AppThemeSelector, AtlassianAuth, AuthApiCreateOptions, BackstageApp, BitbucketAuth, BitbucketServerAuth, BitbucketServerSession, BitbucketSession, BootErrorPageProps, ErrorAlerter, ErrorApiForwarder, ErrorBoundaryFallbackProps, FeatureFlagged, FeatureFlaggedProps, FetchMiddleware, FetchMiddlewares, FlatRoutes, FlatRoutesProps, FrontendHostDiscovery, GithubAuth, GitlabAuth, GoogleAuth, LocalStorageFeatureFlags, MicrosoftAuth, MultipleAnalyticsApi, NoOpAnalyticsApi, OAuth2, OAuth2CreateOptions, OAuth2Session, OAuthApiCreateOptions, OAuthRequestManager, OktaAuth, OneLoginAuth, OneLoginAuthCreateOptions, SamlAuth, SignInPageProps, UnhandledErrorForwarder, UrlPatternDiscovery, WebStorage, createFetchApi, createSpecializedApp, defaultConfigLoader };
1053
+ export { AlertApiForwarder, ApiFactoryHolder, ApiFactoryRegistry, ApiFactoryScope, ApiProvider, ApiProviderProps, ApiResolver, AppComponents, AppConfigLoader, AppContext, AppIcons, AppOptions, AppRouteBinder, AppRouter, AppRouterProps, AppThemeSelector, AtlassianAuth, AuthApiCreateOptions, BackstageApp, BitbucketAuth, BitbucketServerAuth, BitbucketServerSession, BitbucketSession, BootErrorPageProps, ErrorAlerter, ErrorApiForwarder, ErrorBoundaryFallbackProps, FeatureFlagged, FeatureFlaggedProps, FetchMiddleware, FetchMiddlewares, FlatRoutes, FlatRoutesProps, FrontendHostDiscovery, GithubAuth, GitlabAuth, GoogleAuth, LocalStorageFeatureFlags, MicrosoftAuth, MultipleAnalyticsApi, NoOpAnalyticsApi, OAuth2, OAuth2CreateOptions, OAuth2Session, OAuthApiCreateOptions, OAuthRequestManager, OktaAuth, OneLoginAuth, OneLoginAuthCreateOptions, PopupOptions, SamlAuth, SignInPageProps, UnhandledErrorForwarder, UrlPatternDiscovery, WebStorage, createFetchApi, createSpecializedApp, defaultConfigLoader };
package/dist/index.esm.js CHANGED
@@ -253,6 +253,7 @@ class DefaultAuthConnector {
253
253
  __publicField$i(this, "authRequester");
254
254
  __publicField$i(this, "sessionTransform");
255
255
  __publicField$i(this, "enableExperimentalRedirectFlow");
256
+ __publicField$i(this, "popupOptions");
256
257
  var _a;
257
258
  const {
258
259
  configApi,
@@ -261,7 +262,8 @@ class DefaultAuthConnector {
261
262
  provider,
262
263
  joinScopes = defaultJoinScopes,
263
264
  oauthRequestApi,
264
- sessionTransform = (id) => id
265
+ sessionTransform = (id) => id,
266
+ popupOptions
265
267
  } = options;
266
268
  if (!warned$1 && !configApi) {
267
269
  console.warn(
@@ -284,6 +286,7 @@ class DefaultAuthConnector {
284
286
  this.provider = provider;
285
287
  this.joinScopesFunc = joinScopes;
286
288
  this.sessionTransform = sessionTransform;
289
+ this.popupOptions = popupOptions;
287
290
  }
288
291
  async createSession(options) {
289
292
  if (options.instantPopup) {
@@ -343,18 +346,21 @@ class DefaultAuthConnector {
343
346
  }
344
347
  }
345
348
  async showPopup(scopes) {
349
+ var _a, _b, _c, _d, _e, _f, _g, _h;
346
350
  const scope = this.joinScopesFunc(scopes);
347
351
  const popupUrl = await this.buildUrl("/start", {
348
352
  scope,
349
353
  origin: window.location.origin,
350
354
  flow: "popup"
351
355
  });
356
+ const width = ((_b = (_a = this.popupOptions) == null ? void 0 : _a.size) == null ? void 0 : _b.fullscreen) ? window.screen.width : ((_d = (_c = this.popupOptions) == null ? void 0 : _c.size) == null ? void 0 : _d.width) || 450;
357
+ const height = ((_f = (_e = this.popupOptions) == null ? void 0 : _e.size) == null ? void 0 : _f.fullscreen) ? window.screen.height : ((_h = (_g = this.popupOptions) == null ? void 0 : _g.size) == null ? void 0 : _h.height) || 730;
352
358
  const payload = await showLoginPopup({
353
359
  url: popupUrl,
354
360
  name: `${this.provider.title} Login`,
355
361
  origin: new URL(popupUrl).origin,
356
- width: 450,
357
- height: 730
362
+ width,
363
+ height
358
364
  });
359
365
  return await this.sessionTransform(payload);
360
366
  }
@@ -918,7 +924,8 @@ class OAuth2 {
918
924
  provider = DEFAULT_PROVIDER$a,
919
925
  oauthRequestApi,
920
926
  defaultScopes = [],
921
- scopeTransform = (x) => x
927
+ scopeTransform = (x) => x,
928
+ popupOptions
922
929
  } = options;
923
930
  const connector = new DefaultAuthConnector({
924
931
  configApi,
@@ -941,7 +948,8 @@ class OAuth2 {
941
948
  )
942
949
  }
943
950
  };
944
- }
951
+ },
952
+ popupOptions
945
953
  });
946
954
  const sessionManager = new RefreshingAuthSessionManager({
947
955
  connector,