@dereekb/dbx-firebase 13.32.0 → 13.34.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.
@@ -0,0 +1,19 @@
1
+ @use '../../style/theming';
2
+
3
+ // MARK: Mixin
4
+ @mixin core() {
5
+ .dbx-firebase-external-connection-list {
6
+ // the rows are cards; keep the gap the settings page had before they were a list.
7
+ --dbx-list-card-items-list-gap: var(--dbx-padding-3);
8
+ }
9
+
10
+ .dbx-firebase-external-connection-item {
11
+ // `<dbx-avatar>` owns the logo image and its `contain` fit — only the tile size is set here.
12
+ .dbx-firebase-external-connection-tile {
13
+ --dbx-avatar-size: 40px;
14
+ }
15
+ }
16
+ }
17
+
18
+ @mixin theme($theme-config) {
19
+ }
@@ -1,8 +1,10 @@
1
1
  @use '../auth/login/login';
2
+ @use '../modules/externalconnection/externalconnection';
2
3
  @use '../model/model';
3
4
 
4
5
  // Includes all theming config
5
6
  @mixin all-component-core($theme-config) {
6
7
  @include login.core();
8
+ @include externalconnection.core();
7
9
  @include model.all-model-core($theme-config);
8
10
  }
@@ -1,8 +1,10 @@
1
1
  @use '../auth/login/login';
2
+ @use '../modules/externalconnection/externalconnection';
2
3
  @use '../model/model';
3
4
 
4
5
  // Includes all theming config
5
6
  @mixin all-component-themes($theme-config) {
6
7
  @include login.theme($theme-config);
8
+ @include externalconnection.theme($theme-config);
7
9
  @include model.all-model-theme($theme-config);
8
10
  }
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-firebase",
3
- "version": "13.32.0",
3
+ "version": "13.34.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "21.2.11",
6
6
  "@angular/core": "21.2.11",
7
7
  "@angular/material": "^21.2.9",
8
- "@dereekb/date": "13.32.0",
9
- "@dereekb/dbx-analytics": "13.32.0",
10
- "@dereekb/dbx-core": "13.32.0",
11
- "@dereekb/dbx-form": "13.32.0",
12
- "@dereekb/dbx-web": "13.32.0",
13
- "@dereekb/firebase": "13.32.0",
14
- "@dereekb/model": "13.32.0",
15
- "@dereekb/rxjs": "13.32.0",
16
- "@dereekb/util": "13.32.0",
17
- "@dereekb/vitest": "13.32.0",
8
+ "@dereekb/date": "13.34.0",
9
+ "@dereekb/dbx-analytics": "13.34.0",
10
+ "@dereekb/dbx-core": "13.34.0",
11
+ "@dereekb/dbx-form": "13.34.0",
12
+ "@dereekb/dbx-web": "13.34.0",
13
+ "@dereekb/firebase": "13.34.0",
14
+ "@dereekb/model": "13.34.0",
15
+ "@dereekb/rxjs": "13.34.0",
16
+ "@dereekb/util": "13.34.0",
17
+ "@dereekb/vitest": "13.34.0",
18
18
  "@ng-forge/dynamic-forms": "0.10.0-next.4",
19
19
  "@ngrx/component-store": "^21.1.0",
20
20
  "firebase": "^12.12.1",
@@ -3,12 +3,12 @@ import { Signal, OnDestroy, Type, OnInit, EnvironmentProviders } from '@angular/
3
3
  import * as _dereekb_util from '@dereekb/util';
4
4
  import { Maybe, ErrorInput } from '@dereekb/util';
5
5
  import * as _dereekb_dbx_core from '@dereekb/dbx-core';
6
- import { DbxInjectionComponentConfig, SegueRefOrSegueRefRouterLink } from '@dereekb/dbx-core';
6
+ import { DbxInjectionComponentConfig, ClickableAnchor, SegueRefOrSegueRefRouterLink } from '@dereekb/dbx-core';
7
7
  import { WorkUsingContext } from '@dereekb/rxjs';
8
8
  import * as _dereekb_firebase from '@dereekb/firebase';
9
9
  import { OidcScope, OAuthInteractionLoginDetails, OAuthInteractionConsentResponse, OidcInteractionUid, OidcTokenEndpointAuthMethod, OidcProviderProfileDetails, OidcRedirectUri, OidcScopeDetails, CreateOidcClientParams, UpdateOidcClientFieldParams, OidcEntry, OidcEntryDocument, OidcModelFunctions, CreateOidcClientResult, RotateOidcClientSecretResult, FirestoreQueryConstraint, OidcModelFirestoreCollections, OAuthInteractionLoginResponse, OAuthInteractionConsentRequest } from '@dereekb/firebase';
10
10
  import { FormConfig, ContainerField, RegisteredFieldTypes } from '@ng-forge/dynamic-forms';
11
- import { AbstractDbxSelectionListWrapperDirective, AbstractDbxValueListViewItemComponent, AbstractDbxSelectionListViewDirective, DbxSelectionValueListViewConfig, DbxActionConfirmConfig, DbxValueAsListItem } from '@dereekb/dbx-web';
11
+ import { AbstractDbxSelectionListWrapperDirective, AbstractDbxValueListViewItemComponent, AbstractDbxSelectionListViewDirective, DbxSelectionValueListViewConfig, DbxContentPitScrollableInput, DbxActionConfirmConfig, DbxValueAsListItem } from '@dereekb/dbx-web';
12
12
  import * as _dereekb_dbx_form from '@dereekb/dbx-form';
13
13
  import { AbstractConfigAsyncForgeFormDirective } from '@dereekb/dbx-form';
14
14
  import * as rxjs from 'rxjs';
@@ -53,6 +53,12 @@ declare class DbxFirebaseOAuthLoginViewComponent {
53
53
  interface OAuthConsentScope<T extends OidcScope = OidcScope> {
54
54
  readonly name: T;
55
55
  readonly description: string;
56
+ /**
57
+ * Whether the scope is always granted and cannot be deselected. Required scopes still render as
58
+ * rows in the consent list — selected and disabled — so their description stays visible, but the
59
+ * server enforces them regardless of the submitted payload.
60
+ */
61
+ readonly required?: boolean;
56
62
  }
57
63
 
58
64
  /**
@@ -77,17 +83,19 @@ interface OAuthConsentScopesFormValue {
77
83
  /**
78
84
  * Configuration for the consent scopes form.
79
85
  *
80
- * Required scopes are filtered out by the caller before being passed in
81
- * required scopes are surfaced separately as a static "Always granted" line
82
- * because they are not user-selectable.
86
+ * Required scopes are included in the list rather than filtered out they render as
87
+ * selected-and-disabled rows so their description stays visible while remaining
88
+ * non-deselectable. They are always part of the submitted value; the server force-grants them
89
+ * regardless.
83
90
  */
84
91
  interface OAuthConsentScopesFormFieldsConfig {
85
92
  /**
86
- * Optional scopes the user can choose to grant.
93
+ * Scopes to render. Entries flagged `required` are selected and locked on.
87
94
  */
88
- readonly optionalScopes: readonly OAuthConsentScope[];
95
+ readonly scopes: readonly OAuthConsentScope[];
89
96
  /**
90
- * Initial selection set. Defaults to every optional scope being selected.
97
+ * Initial selection set. Defaults to every scope being selected. Required scopes are always
98
+ * selected regardless of what is passed here.
91
99
  */
92
100
  readonly initiallySelected?: readonly OidcScope[];
93
101
  }
@@ -100,6 +108,11 @@ interface OAuthConsentScopesFormFieldsConfig {
100
108
  * The list renders bare (no Material form-field wrapper) and without the
101
109
  * default 300px height cap so it grows to fit the scope list.
102
110
  *
111
+ * Required scopes are seeded into the initial value and rendered as disabled rows, so they cannot
112
+ * be deselected. Because they are always present in the value, the "select at least one" validator
113
+ * compares against the required count rather than zero — and is skipped entirely when every
114
+ * requested scope is required (there would be nothing left to select).
115
+ *
103
116
  * @param config - The consent scopes form fields configuration.
104
117
  * @returns A `FormConfig` whose single field selects an `OidcScope[]` of granted scopes.
105
118
  */
@@ -249,6 +262,10 @@ declare class DbxFirebaseOAuthConsentScopeListComponent extends AbstractDbxSelec
249
262
  * Selection list view that pairs with `DbxFirebaseOAuthConsentScopeListComponent`.
250
263
  * Maps each `OAuthConsentScope` to a `DbxValueListItem` keyed by the scope name
251
264
  * and renders it through `DbxFirebaseOAuthConsentScopeListItemComponent`.
265
+ *
266
+ * Scopes flagged `required` map to disabled rows so they render selected but cannot be toggled
267
+ * off — the surrounding `dbxListItemIsSelectedModifier` owns the `selected` flag (driven by the
268
+ * form value), and only `disabled` is set here.
252
269
  */
253
270
  declare class DbxFirebaseOAuthConsentScopeListViewComponent extends AbstractDbxSelectionListViewDirective<OAuthConsentScope> {
254
271
  readonly config: DbxSelectionValueListViewConfig<OAuthConsentScope>;
@@ -260,10 +277,14 @@ declare class DbxFirebaseOAuthConsentScopeListViewComponent extends AbstractDbxS
260
277
  * row for both selected and unselected scopes — the selection chrome (the
261
278
  * leading checkbox/highlight) is provided by the wrapping
262
279
  * `dbx-selection-list-view`.
280
+ *
281
+ * Required scopes get an extra "Always granted" note so the row explains why its checkbox is
282
+ * locked on.
263
283
  */
264
284
  declare class DbxFirebaseOAuthConsentScopeListItemComponent extends AbstractDbxValueListViewItemComponent<OAuthConsentScope> {
265
285
  get name(): string;
266
286
  get description(): string;
287
+ get required(): boolean;
267
288
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxFirebaseOAuthConsentScopeListItemComponent, never>;
268
289
  static ɵcmp: i0.ɵɵComponentDeclaration<DbxFirebaseOAuthConsentScopeListItemComponent, "ng-component", never, {}, {}, never, never, true, never>;
269
290
  }
@@ -294,9 +315,21 @@ declare class DbxFirebaseOAuthConsentScopeFormComponent extends AbstractConfigAs
294
315
  * form's value participates in the surrounding `dbxAction` (the consent
295
316
  * view's outer Approve action).
296
317
  *
297
- * Required scopes are not user-selectable. They are surfaced as an "Always
298
- * granted" hint above the form because the server enforces them regardless
299
- * of payload including them in the selection list would just add noise.
318
+ * The scopes live inside a `dbx-content-pit` that starts collapsed to a single
319
+ * underlined summary line ("N permissions are being requested. Click here to
320
+ * edit requested permissions."). Clicking it expands the pit to reveal the
321
+ * selection list so the user can customize which scopes they grant. Starting
322
+ * collapsed keeps the consent screen short enough that Approve/Deny are visible
323
+ * without scrolling even when a client requests many scopes, and the expanded
324
+ * pit is height-capped and scrollable for the same reason.
325
+ *
326
+ * The form itself is always mounted (hidden rather than removed while
327
+ * collapsed) so `dbxActionForm` keeps supplying the granted-scope value to the
328
+ * consent action even when the user never expands the pit.
329
+ *
330
+ * Required scopes are listed first and render as selected-and-disabled rows carrying an "Always
331
+ * granted" note, so their description is visible alongside every other scope while staying
332
+ * non-deselectable. The server force-grants them regardless of the submitted payload.
300
333
  *
301
334
  * Apps can override this default via
302
335
  * `DbxFirebaseOidcConfig.consentScopeListViewClass` or
@@ -307,10 +340,25 @@ declare class DbxFirebaseOAuthConsentScopeFormComponent extends AbstractConfigAs
307
340
  declare class DbxFirebaseOAuthConsentScopeDefaultViewComponent {
308
341
  private readonly _oidcConfigService;
309
342
  private readonly _data;
343
+ private readonly _customizing;
344
+ /**
345
+ * Every requested scope paired with its human-readable description, required ones first so the
346
+ * always-granted rows head the list.
347
+ */
310
348
  readonly mappedScopesSignal: i0.Signal<OAuthConsentScope<string>[]>;
311
- readonly optionalScopesSignal: i0.Signal<OAuthConsentScope<string>[]>;
312
- readonly alwaysGrantedLabelSignal: i0.Signal<Maybe<string>>;
313
349
  readonly formFieldsConfigSignal: i0.Signal<OAuthConsentScopesFormFieldsConfig>;
350
+ /**
351
+ * Leading sentence of the collapsed summary — the number of scopes the client is requesting,
352
+ * counting the always-granted ones since the expanded pit accounts for them too.
353
+ */
354
+ readonly requestedScopesSummarySignal: i0.Signal<string>;
355
+ /**
356
+ * True once the user has expanded the pit to review/customize the requested scopes.
357
+ */
358
+ readonly customizingSignal: i0.Signal<boolean>;
359
+ readonly pitScrollableSignal: i0.Signal<Maybe<DbxContentPitScrollableInput>>;
360
+ readonly customizeAnchor: ClickableAnchor;
361
+ showScopeCustomization(): void;
314
362
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxFirebaseOAuthConsentScopeDefaultViewComponent, never>;
315
363
  static ɵcmp: i0.ɵɵComponentDeclaration<DbxFirebaseOAuthConsentScopeDefaultViewComponent, "dbx-firebase-oauth-consent-scope-default-view", never, {}, {}, never, never, true, never>;
316
364
  }