@dereekb/dbx-firebase 12.6.15 → 12.6.16

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.
@@ -6,13 +6,13 @@ import { switchMap, of, shareReplay, map, distinctUntilChanged, EMPTY, catchErro
6
6
  import * as i2 from '@dereekb/dbx-core';
7
7
  import { loggedInObsFromIsLoggedIn, loggedOutObsFromIsLoggedIn, authUserIdentifier, DbxInjectionContext, DbxInjectionComponent, AbstractForwardDbxInjectionContextDirective, DbxInjectionContextDirective, DBX_INJECTION_COMPONENT_DATA, DbxAuthService, DbxActionButtonDirective, DbxActionDirective, DbxActionEnforceModifiedDirective, DbxActionHandlerDirective, DbxActionAutoTriggerDirective, provideDbxRouteModelIdDirectiveDelegate, provideDbxRouteModelKeyDirectiveDelegate, AbstractSubscriptionDirective, AbstractIfDirective, LockSetComponentStore, newWithInjector, CutTextPipe, DbxActionContextStoreSourceInstance, DbxActionHandlerInstance, SimpleStorageAccessorFactory, dbxRouteParamReaderInstance, DbxRouteParamDefaultRedirectInstance } from '@dereekb/dbx-core';
8
8
  import { Auth, authState, idToken, GoogleAuthProvider, FacebookAuthProvider, TwitterAuthProvider, GithubAuthProvider, signInWithPopup, createUserWithEmailAndPassword, signInWithEmailAndPassword, signInAnonymously, reauthenticateWithPopup, provideAuth, getAuth, connectAuthEmulator } from '@angular/fire/auth';
9
- import { AUTH_ADMIN_ROLE, cachedGetter, urlWithoutParameters, addToSet, removeFromSet, filterMaybeArrayValues, mapIterable, asArray, excludeValuesFromArray, containsStringAnyCase, addToSetCopy, iterableToArray, runAsyncTasksForValues, pushArrayItemsIntoArray, forEachKeyValue, countAllInNestedArray, invertDecision, separateValues, sortByNumberFunction, readableError, isMaybeSo, firstValue, splitJoinRemainder, MS_IN_HOUR, SECONDS_IN_MINUTE, MS_IN_DAY, unixDateTimeSecondsNumberForNow, MS_IN_MINUTE, addMilliseconds, unixDateTimeSecondsNumberFromDate, dateFromDateOrTimeSecondsNumber, MS_IN_SECOND, isPast } from '@dereekb/util';
9
+ import { AUTH_ADMIN_ROLE, cachedGetter, urlWithoutParameters, addToSet, removeFromSet, filterMaybeArrayValues, mapIterable, asArray, excludeValuesFromArray, containsStringAnyCase, addToSetCopy, iterableToArray, runAsyncTasksForValues, pushArrayItemsIntoArray, forEachKeyValue, countAllInNestedArray, invertDecision, filterUniqueValues, reverseCompareFn, sortByNumberFunction, separateValues, readableError, isMaybeSo, firstValue, splitJoinRemainder, MS_IN_HOUR, SECONDS_IN_MINUTE, MS_IN_DAY, unixDateTimeSecondsNumberForNow, MS_IN_MINUTE, addMilliseconds, unixDateTimeSecondsNumberFromDate, dateFromDateOrTimeSecondsNumber, MS_IN_SECOND, isPast } from '@dereekb/util';
10
10
  import { safeFormatToISO8601DateString, msToSeconds, isSameDate } from '@dereekb/date';
11
11
  import { sendPasswordResetEmail } from 'firebase/auth';
12
12
  import { getToken, initializeAppCheck, ReCaptchaV3Provider } from 'firebase/app-check';
13
13
  import { AppCheck, provideAppCheck } from '@angular/fire/app-check';
14
14
  import * as i1$1 from '@dereekb/dbx-web';
15
- import { DbxLinkComponent, DbxActionModule, DbxButtonModule, DbxErrorComponent, DbxActionErrorDirective, DbxButtonComponent, DbxButtonSpacerDirective, DbxRouterAnchorModule, DbxWidgetService, AbstractDbxSelectionListWrapperDirective, provideDbxListViewWrapper, DbxListWrapperComponentImportsModule, DEFAULT_LIST_WRAPPER_COMPONENT_CONFIGURATION_TEMPLATE, AbstractDbxSelectionListViewDirective, provideDbxListView, DbxSelectionValueListViewComponentImportsModule, DEFAULT_DBX_SELECTION_VALUE_LIST_COMPONENT_CONFIGURATION_TEMPLATE, AbstractDbxValueListViewItemComponent, TwoColumnsContextStore, DbxAnchorComponent, DbxTwoColumnFullLeftDirective, DbxWidgetViewComponent, DbxTwoColumnComponent, DbxTwoBlockComponent, DbxTwoColumnRightComponent, AbstractPopupDirective, DbxPopupService, DbxPopupContentComponent, DbxPopupControlsComponent, DbxModelTypesService, DbxModelTrackerService, allDbxModelViewTrackerEventModelKeys, DbxListItemAnchorModifierDirective, DbxValueListItemModifierDirective, AbstractPopoverDirective, DbxPopoverContentComponent, DbxPopoverHeaderComponent, DbxPopoverScrollContentDirective, DbxListEmptyContentComponent, AbstractPopoverRefDirective, DbxPopoverService, DbxIconButtonComponent, DbxLoadingComponent, DbxDetailBlockComponent, DbxClickToCopyTextComponent, DbxContentPitDirective, DbxModelObjectStateService, DbxListViewWrapper, AbstractDbxWidgetComponent, DbxPopoverInteractionModule, DbxListModifierModule, DbxWebFilePreviewService, DbxActionSnackbarErrorDirective, DbxActionDialogDirective, DbxFileUploadComponent, DbxActionLoadingContextDirective, DbxFileUploadActionSyncDirective } from '@dereekb/dbx-web';
15
+ import { DbxLinkComponent, DbxActionModule, DbxButtonModule, DbxErrorComponent, DbxActionErrorDirective, DbxButtonComponent, DbxButtonSpacerDirective, DbxRouterAnchorModule, DbxWidgetService, AbstractDbxSelectionListWrapperDirective, provideDbxListViewWrapper, DbxListWrapperComponentImportsModule, DEFAULT_LIST_WRAPPER_COMPONENT_CONFIGURATION_TEMPLATE, AbstractDbxSelectionListViewDirective, provideDbxListView, DbxSelectionValueListViewComponentImportsModule, DEFAULT_DBX_SELECTION_VALUE_LIST_COMPONENT_CONFIGURATION_TEMPLATE, AbstractDbxValueListViewItemComponent, TwoColumnsContextStore, DbxAnchorComponent, DbxTwoColumnFullLeftDirective, DbxWidgetViewComponent, DbxTwoColumnComponent, DbxTwoBlockComponent, DbxTwoColumnRightComponent, AbstractPopupDirective, DbxPopupService, DbxPopupContentComponent, DbxPopupControlsComponent, DbxModelTypesService, DbxModelTrackerService, allDbxModelViewTrackerEventModelKeys, DbxListItemAnchorModifierDirective, DbxValueListItemModifierDirective, AbstractPopoverDirective, DbxPopoverContentComponent, DbxPopoverHeaderComponent, DbxPopoverScrollContentDirective, DbxListEmptyContentComponent, AbstractPopoverRefDirective, DbxPopoverService, DbxIconButtonComponent, DbxLoadingComponent, DbxDetailBlockComponent, DbxClickToCopyTextComponent, DbxDownloadTextViewComponent, DbxContentPitDirective, DbxModelObjectStateService, DbxListViewWrapper, AbstractDbxWidgetComponent, DbxPopoverInteractionModule, DbxListModifierModule, DbxWebFilePreviewService, DbxActionSnackbarErrorDirective, DbxActionDialogDirective, DbxFileUploadComponent, DbxActionLoadingContextDirective, DbxFileUploadActionSyncDirective } from '@dereekb/dbx-web';
16
16
  import * as i1 from '@angular/material/icon';
17
17
  import { MatIconModule, MatIcon } from '@angular/material/icon';
18
18
  import * as i1$2 from '@dereekb/dbx-form';
@@ -3506,6 +3506,9 @@ class DbxFirebaseModelEntitiesWidgetService {
3506
3506
  _commonComponentClass;
3507
3507
  _debugComponentClass;
3508
3508
  _entries = new Map();
3509
+ _sortPriorityMap = cachedGetter(() => {
3510
+ return new Map(mapIterable(this._entries.values(), (entry) => [entry.identity, entry.sortPriority ?? -1]));
3511
+ });
3509
3512
  constructor(initialConfig) {
3510
3513
  this._commonComponentClass = initialConfig?.commonComponentClass;
3511
3514
  this._debugComponentClass = initialConfig?.debugComponentClass;
@@ -3540,6 +3543,8 @@ class DbxFirebaseModelEntitiesWidgetService {
3540
3543
  this._entries.set(entry.identity, entry);
3541
3544
  }
3542
3545
  });
3546
+ // Invalidate the cache
3547
+ this._sortPriorityMap.reset();
3543
3548
  }
3544
3549
  // MARK: Get
3545
3550
  getAllRegisteredWidgetIdentities() {
@@ -3562,6 +3567,9 @@ class DbxFirebaseModelEntitiesWidgetService {
3562
3567
  getWidgetEntries(identities) {
3563
3568
  return filterMaybeArrayValues(mapIterable(identities ?? [], (x) => this.getWidgetEntry(x)));
3564
3569
  }
3570
+ getSortPriorityMap() {
3571
+ return this._sortPriorityMap();
3572
+ }
3565
3573
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseModelEntitiesWidgetService, deps: [{ token: DbxFirebaseModelEntitiesWidgetServiceConfig, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
3566
3574
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseModelEntitiesWidgetService });
3567
3575
  }
@@ -3685,24 +3693,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
3685
3693
  }] });
3686
3694
 
3687
3695
  class DbxFirebaseModelEntitiesComponent {
3696
+ entitiesWidgetService = inject(DbxFirebaseModelEntitiesWidgetService);
3688
3697
  /**
3689
3698
  * Whether the accordion should allow multiple expanded panels.
3690
3699
  */
3691
3700
  multi = input(true);
3692
3701
  entities = input();
3693
3702
  entities$ = toObservable(this.entities).pipe(switchMapMaybe(), map((x) => x ?? beginLoading()), shareReplay(1));
3694
- entitiesWithKeysState$ = this.entities$.pipe(mapLoadingStateValueWithOperator(switchMap((entities) => {
3703
+ allEntitiesWithKeysState$ = this.entities$.pipe(mapLoadingStateValueWithOperator(switchMap((entities) => {
3704
+ const sortPriorityMap = this.entitiesWidgetService.getSortPriorityMap();
3695
3705
  const entitiesWithStore = (entities ?? []).filter((x) => Boolean(x.store));
3696
3706
  const entitiesWithKeys = combineLatest(entitiesWithStore.map((x) => {
3697
- const obs = x.store.currentKey$.pipe(map((key) => (key ? { key, ...x } : null)));
3707
+ const sortPriorityMapEntry = sortPriorityMap.get(x.modelIdentity);
3708
+ const isKnownType = sortPriorityMapEntry != null;
3709
+ const sortPriority = sortPriorityMapEntry ?? -2;
3710
+ const obs = x.store.currentKey$.pipe(map((key) => (key ? { key, ...x, sortPriority, isKnownType } : null)));
3698
3711
  return obs;
3699
3712
  }));
3700
- return entitiesWithKeys.pipe(filterMaybeArray(), defaultIfEmpty([]));
3713
+ return entitiesWithKeys.pipe(filterMaybeArray(), map((entities) => {
3714
+ return filterUniqueValues(entities, (x) => x.key).sort(reverseCompareFn(sortByNumberFunction((x) => x.sortPriority)));
3715
+ }), defaultIfEmpty([]));
3701
3716
  })), shareReplay(1));
3702
- entitiesWithKeys$ = this.entitiesWithKeysState$.pipe(valueFromFinishedLoadingState(), shareReplay(1));
3717
+ entitiesWithKeys$ = this.allEntitiesWithKeysState$.pipe(valueFromFinishedLoadingState(), shareReplay(1));
3703
3718
  entitiesWithKeysSignal = toSignal(this.entitiesWithKeys$, { initialValue: [] });
3704
3719
  hasNoEntitiesSignal = computed(() => !this.entitiesWithKeysSignal()?.length);
3705
- context = loadingStateContext({ obs: this.entitiesWithKeysState$ });
3720
+ context = loadingStateContext({ obs: this.allEntitiesWithKeysState$ });
3706
3721
  ngOnDestroy() {
3707
3722
  this.context.destroy();
3708
3723
  }
@@ -3784,6 +3799,11 @@ class DbxFirebaseModelEntitiesPopoverButtonComponent extends AbstractPopoverRefD
3784
3799
  entitiesSource = inject(DbxFirebaseModelEntitiesSource);
3785
3800
  buttonElement = viewChild.required('button', { read: ElementRef });
3786
3801
  config = input();
3802
+ buttonDisplaySignal = computed(() => {
3803
+ const config = this.config();
3804
+ return config?.buttonDisplay ?? { icon: config?.icon ?? 'data_object' };
3805
+ });
3806
+ buttonStyleSignal = computed(() => this.config()?.buttonStyle);
3787
3807
  _makePopoverRef(origin) {
3788
3808
  if (!origin) {
3789
3809
  throw new Error('Missing origin.');
@@ -3802,18 +3822,18 @@ class DbxFirebaseModelEntitiesPopoverButtonComponent extends AbstractPopoverRefD
3802
3822
  }
3803
3823
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseModelEntitiesPopoverButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
3804
3824
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.2.13", type: DbxFirebaseModelEntitiesPopoverButtonComponent, isStandalone: true, selector: "dbx-firebase-model-entities-popover-button", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "buttonElement", first: true, predicate: ["button"], descendants: true, read: ElementRef, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
3805
- <dbx-icon-button #button (buttonClick)="showEntitiesPopover()" icon="data_object"></dbx-icon-button>
3806
- `, isInline: true, dependencies: [{ kind: "component", type: DbxIconButtonComponent, selector: "dbx-icon-button" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3825
+ <dbx-button #button (buttonClick)="showEntitiesPopover()" [buttonStyle]="buttonStyleSignal()" [buttonDisplay]="buttonDisplaySignal()"></dbx-button>
3826
+ `, isInline: true, dependencies: [{ kind: "component", type: DbxButtonComponent, selector: "dbx-button", inputs: ["bar", "type", "buttonStyle", "color", "spinnerColor", "customButtonColor", "customTextColor", "customSpinnerColor", "basic", "raised", "stroked", "flat", "iconOnly", "fab", "mode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3807
3827
  }
3808
3828
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseModelEntitiesPopoverButtonComponent, decorators: [{
3809
3829
  type: Component,
3810
3830
  args: [{
3811
3831
  selector: 'dbx-firebase-model-entities-popover-button',
3812
3832
  template: `
3813
- <dbx-icon-button #button (buttonClick)="showEntitiesPopover()" icon="data_object"></dbx-icon-button>
3833
+ <dbx-button #button (buttonClick)="showEntitiesPopover()" [buttonStyle]="buttonStyleSignal()" [buttonDisplay]="buttonDisplaySignal()"></dbx-button>
3814
3834
  `,
3815
3835
  standalone: true,
3816
- imports: [DbxIconButtonComponent],
3836
+ imports: [DbxButtonComponent],
3817
3837
  changeDetection: ChangeDetectionStrategy.OnPush
3818
3838
  }]
3819
3839
  }] });
@@ -3995,11 +4015,11 @@ class DbxFirebaseModelKeyComponent {
3995
4015
  sref$ = this.modelTypeInstance$.pipe(switchMap((x) => x?.segueRef$ ?? of(undefined)));
3996
4016
  srefSignal = toSignal(this.sref$);
3997
4017
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseModelKeyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3998
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: DbxFirebaseModelKeyComponent, isStandalone: true, selector: "dbx-firebase-model-key", inputs: { modelKey: { classPropertyName: "modelKey", publicName: "modelKey", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"dbx-firebase-model-key\">\n @if (modelKey(); as key) {\n <!-- Key Data -->\n <dbx-detail-block icon=\"key\" header=\"Model Key\">\n <dbx-click-to-copy-text [highlighted]=\"true\" class=\"dbx-block\">{{ key }}</dbx-click-to-copy-text>\n <dbx-click-to-copy-text [highlighted]=\"true\" class=\"dbx-block\" [copyText]=\"oneWayFlatModelKey()\">(Flat) {{ oneWayFlatModelKey() }}</dbx-click-to-copy-text>\n <dbx-click-to-copy-text [highlighted]=\"true\" class=\"dbx-block\" [copyText]=\"twoWayFlatModelKey()\">(Encoded Flat) {{ twoWayFlatModelKey() }}</dbx-click-to-copy-text>\n </dbx-detail-block>\n\n <!-- Type Info -->\n @if (typeInfoSignal(); as typeInfo) {\n <!-- Model Meta Data -->\n <div>\n <dbx-detail-block [icon]=\"typeInfo.icon\" header=\"Model Type\">\n <dbx-click-to-copy-text class=\"dbx-block\">{{ typeInfo.modelType }}</dbx-click-to-copy-text>\n @if (typeInfo.icon) {\n <dbx-click-to-copy-text [copyText]=\"typeInfo.icon\" class=\"dbx-block\">\n Icon:\n <span class=\"dbx-u\">{{ typeInfo.icon }}</span>\n </dbx-click-to-copy-text>\n } @else {\n <span class=\"dbx-notice\">No Icon For Type</span>\n }\n </dbx-detail-block>\n <dbx-detail-block icon=\"dataset\" header=\"Collection Name\">\n <dbx-click-to-copy-text class=\"dbx-block\">{{ typeInfo.identity.collectionName }}</dbx-click-to-copy-text>\n </dbx-detail-block>\n </div>\n\n <!-- Segue Info -->\n @if (typeCanSegueToView()) {\n <dbx-detail-block icon=\"arrow_forward\" header=\"Segue To View\">\n <div class=\"dbx-hint dbx-small\">This model has a unique view within the app.</div>\n <dbx-anchor [anchor]=\"srefSignal()\"><dbx-button>Go To View</dbx-button></dbx-anchor>\n </dbx-detail-block>\n } @else {\n <dbx-detail-block class=\"dbx-warn\" icon=\"warning\" header=\"No Segue View\">\n <span>This type provides no information for segue directly.</span>\n </dbx-detail-block>\n }\n } @else {\n <dbx-detail-block class=\"dbx-warn\" icon=\"warning\" header=\"No Type Info\">\n <span>There is no type info registered for this model type.</span>\n </dbx-detail-block>\n }\n } @else {\n <div class=\"dbx-firebase-model-key-empty\">No model key provided</div>\n }\n</div>\n", dependencies: [{ kind: "component", type: DbxDetailBlockComponent, selector: "dbx-detail-block", inputs: ["icon", "header", "alignHeader", "bigHeader"] }, { kind: "component", type: DbxButtonComponent, selector: "dbx-button", inputs: ["bar", "type", "buttonStyle", "color", "spinnerColor", "customButtonColor", "customTextColor", "customSpinnerColor", "basic", "raised", "stroked", "flat", "iconOnly", "fab", "mode"] }, { kind: "component", type: DbxClickToCopyTextComponent, selector: "dbx-click-to-copy-text", inputs: ["copyText", "highlighted", "clipboardSnackbarMessagesConfig", "clipboardSnackbarMessagesEnabled", "clickToCopyIcon", "clickIconToCopyOnly"] }, { kind: "component", type: DbxAnchorComponent, selector: "dbx-anchor, [dbx-anchor]", inputs: ["block"] }] });
4018
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: DbxFirebaseModelKeyComponent, isStandalone: true, selector: "dbx-firebase-model-key", inputs: { modelKey: { classPropertyName: "modelKey", publicName: "modelKey", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"dbx-firebase-model-key\">\n @if (modelKey(); as key) {\n <!-- Key Data -->\n <dbx-detail-block icon=\"key\" header=\"Model Key\">\n <dbx-click-to-copy-text [highlighted]=\"true\" class=\"dbx-block\">{{ key }}</dbx-click-to-copy-text>\n <dbx-click-to-copy-text [highlighted]=\"true\" class=\"dbx-block\" [copyText]=\"oneWayFlatModelKey()\">(Flat) {{ oneWayFlatModelKey() }}</dbx-click-to-copy-text>\n <dbx-click-to-copy-text [highlighted]=\"true\" class=\"dbx-block\" [copyText]=\"twoWayFlatModelKey()\">(Encoded Flat) {{ twoWayFlatModelKey() }}</dbx-click-to-copy-text>\n </dbx-detail-block>\n\n <!-- Type Info -->\n @if (typeInfoSignal(); as typeInfo) {\n <!-- Model Meta Data -->\n <div>\n <dbx-detail-block [icon]=\"typeInfo.icon\" header=\"Model Type\">\n <dbx-click-to-copy-text class=\"dbx-block\">{{ typeInfo.modelType }}</dbx-click-to-copy-text>\n @if (typeInfo.icon) {\n <dbx-click-to-copy-text [copyText]=\"typeInfo.icon\" class=\"dbx-block\">\n Icon:\n <span class=\"dbx-u\">{{ typeInfo.icon }}</span>\n </dbx-click-to-copy-text>\n } @else {\n <span class=\"dbx-notice\">No Icon For Type</span>\n }\n </dbx-detail-block>\n <dbx-detail-block icon=\"dataset\" header=\"Collection Name\">\n <dbx-click-to-copy-text class=\"dbx-block\">{{ typeInfo.identity.collectionName }}</dbx-click-to-copy-text>\n </dbx-detail-block>\n </div>\n\n <!-- Segue Info -->\n @if (typeCanSegueToView()) {\n <dbx-detail-block icon=\"arrow_forward\" header=\"Segue To View\">\n <div class=\"dbx-hint dbx-small\">This model has a unique view within the app.</div>\n <dbx-anchor [anchor]=\"srefSignal()\"><dbx-button text=\"Go To View\"></dbx-button></dbx-anchor>\n </dbx-detail-block>\n } @else {\n <dbx-detail-block class=\"dbx-warn\" icon=\"warning\" header=\"No Segue View\">\n <span>This type provides no information for segue directly.</span>\n </dbx-detail-block>\n }\n } @else {\n <dbx-detail-block class=\"dbx-warn\" icon=\"warning\" header=\"No Type Info\">\n <span>There is no type info registered for this model type.</span>\n </dbx-detail-block>\n }\n } @else {\n <div class=\"dbx-firebase-model-key-empty\">No model key provided</div>\n }\n</div>\n", dependencies: [{ kind: "component", type: DbxDetailBlockComponent, selector: "dbx-detail-block", inputs: ["icon", "header", "alignHeader", "bigHeader"] }, { kind: "component", type: DbxButtonComponent, selector: "dbx-button", inputs: ["bar", "type", "buttonStyle", "color", "spinnerColor", "customButtonColor", "customTextColor", "customSpinnerColor", "basic", "raised", "stroked", "flat", "iconOnly", "fab", "mode"] }, { kind: "component", type: DbxClickToCopyTextComponent, selector: "dbx-click-to-copy-text", inputs: ["copyText", "highlighted", "clipboardSnackbarMessagesConfig", "clipboardSnackbarMessagesEnabled", "clickToCopyIcon", "clickIconToCopyOnly"] }, { kind: "component", type: DbxAnchorComponent, selector: "dbx-anchor, [dbx-anchor]", inputs: ["block"] }] });
3999
4019
  }
4000
4020
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseModelKeyComponent, decorators: [{
4001
4021
  type: Component,
4002
- args: [{ selector: 'dbx-firebase-model-key', standalone: true, imports: [MatIcon, DbxDetailBlockComponent, DbxButtonComponent, DbxClickToCopyTextComponent, DbxAnchorComponent], template: "<div class=\"dbx-firebase-model-key\">\n @if (modelKey(); as key) {\n <!-- Key Data -->\n <dbx-detail-block icon=\"key\" header=\"Model Key\">\n <dbx-click-to-copy-text [highlighted]=\"true\" class=\"dbx-block\">{{ key }}</dbx-click-to-copy-text>\n <dbx-click-to-copy-text [highlighted]=\"true\" class=\"dbx-block\" [copyText]=\"oneWayFlatModelKey()\">(Flat) {{ oneWayFlatModelKey() }}</dbx-click-to-copy-text>\n <dbx-click-to-copy-text [highlighted]=\"true\" class=\"dbx-block\" [copyText]=\"twoWayFlatModelKey()\">(Encoded Flat) {{ twoWayFlatModelKey() }}</dbx-click-to-copy-text>\n </dbx-detail-block>\n\n <!-- Type Info -->\n @if (typeInfoSignal(); as typeInfo) {\n <!-- Model Meta Data -->\n <div>\n <dbx-detail-block [icon]=\"typeInfo.icon\" header=\"Model Type\">\n <dbx-click-to-copy-text class=\"dbx-block\">{{ typeInfo.modelType }}</dbx-click-to-copy-text>\n @if (typeInfo.icon) {\n <dbx-click-to-copy-text [copyText]=\"typeInfo.icon\" class=\"dbx-block\">\n Icon:\n <span class=\"dbx-u\">{{ typeInfo.icon }}</span>\n </dbx-click-to-copy-text>\n } @else {\n <span class=\"dbx-notice\">No Icon For Type</span>\n }\n </dbx-detail-block>\n <dbx-detail-block icon=\"dataset\" header=\"Collection Name\">\n <dbx-click-to-copy-text class=\"dbx-block\">{{ typeInfo.identity.collectionName }}</dbx-click-to-copy-text>\n </dbx-detail-block>\n </div>\n\n <!-- Segue Info -->\n @if (typeCanSegueToView()) {\n <dbx-detail-block icon=\"arrow_forward\" header=\"Segue To View\">\n <div class=\"dbx-hint dbx-small\">This model has a unique view within the app.</div>\n <dbx-anchor [anchor]=\"srefSignal()\"><dbx-button>Go To View</dbx-button></dbx-anchor>\n </dbx-detail-block>\n } @else {\n <dbx-detail-block class=\"dbx-warn\" icon=\"warning\" header=\"No Segue View\">\n <span>This type provides no information for segue directly.</span>\n </dbx-detail-block>\n }\n } @else {\n <dbx-detail-block class=\"dbx-warn\" icon=\"warning\" header=\"No Type Info\">\n <span>There is no type info registered for this model type.</span>\n </dbx-detail-block>\n }\n } @else {\n <div class=\"dbx-firebase-model-key-empty\">No model key provided</div>\n }\n</div>\n" }]
4022
+ args: [{ selector: 'dbx-firebase-model-key', standalone: true, imports: [MatIcon, DbxDetailBlockComponent, DbxButtonComponent, DbxClickToCopyTextComponent, DbxAnchorComponent], template: "<div class=\"dbx-firebase-model-key\">\n @if (modelKey(); as key) {\n <!-- Key Data -->\n <dbx-detail-block icon=\"key\" header=\"Model Key\">\n <dbx-click-to-copy-text [highlighted]=\"true\" class=\"dbx-block\">{{ key }}</dbx-click-to-copy-text>\n <dbx-click-to-copy-text [highlighted]=\"true\" class=\"dbx-block\" [copyText]=\"oneWayFlatModelKey()\">(Flat) {{ oneWayFlatModelKey() }}</dbx-click-to-copy-text>\n <dbx-click-to-copy-text [highlighted]=\"true\" class=\"dbx-block\" [copyText]=\"twoWayFlatModelKey()\">(Encoded Flat) {{ twoWayFlatModelKey() }}</dbx-click-to-copy-text>\n </dbx-detail-block>\n\n <!-- Type Info -->\n @if (typeInfoSignal(); as typeInfo) {\n <!-- Model Meta Data -->\n <div>\n <dbx-detail-block [icon]=\"typeInfo.icon\" header=\"Model Type\">\n <dbx-click-to-copy-text class=\"dbx-block\">{{ typeInfo.modelType }}</dbx-click-to-copy-text>\n @if (typeInfo.icon) {\n <dbx-click-to-copy-text [copyText]=\"typeInfo.icon\" class=\"dbx-block\">\n Icon:\n <span class=\"dbx-u\">{{ typeInfo.icon }}</span>\n </dbx-click-to-copy-text>\n } @else {\n <span class=\"dbx-notice\">No Icon For Type</span>\n }\n </dbx-detail-block>\n <dbx-detail-block icon=\"dataset\" header=\"Collection Name\">\n <dbx-click-to-copy-text class=\"dbx-block\">{{ typeInfo.identity.collectionName }}</dbx-click-to-copy-text>\n </dbx-detail-block>\n </div>\n\n <!-- Segue Info -->\n @if (typeCanSegueToView()) {\n <dbx-detail-block icon=\"arrow_forward\" header=\"Segue To View\">\n <div class=\"dbx-hint dbx-small\">This model has a unique view within the app.</div>\n <dbx-anchor [anchor]=\"srefSignal()\"><dbx-button text=\"Go To View\"></dbx-button></dbx-anchor>\n </dbx-detail-block>\n } @else {\n <dbx-detail-block class=\"dbx-warn\" icon=\"warning\" header=\"No Segue View\">\n <span>This type provides no information for segue directly.</span>\n </dbx-detail-block>\n }\n } @else {\n <dbx-detail-block class=\"dbx-warn\" icon=\"warning\" header=\"No Type Info\">\n <span>There is no type info registered for this model type.</span>\n </dbx-detail-block>\n }\n } @else {\n <div class=\"dbx-firebase-model-key-empty\">No model key provided</div>\n }\n</div>\n" }]
4003
4023
  }] });
4004
4024
 
4005
4025
  /**
@@ -4009,16 +4029,29 @@ class DbxFirebaseModelEntitiesDebugWidgetComponent extends AbstractDbxFirebaseMo
4009
4029
  // Convert store observables to signals for template usage
4010
4030
  currentKey = toSignal(this.store.currentKey$);
4011
4031
  currentData = toSignal(this.data$);
4032
+ contentSignal = computed(() => {
4033
+ const key = this.currentKey();
4034
+ const data = this.currentData();
4035
+ let content;
4036
+ if (key && data) {
4037
+ const flattenKey = twoWayFlatFirestoreModelKey(key);
4038
+ content = {
4039
+ content: JSON.stringify(data, null, 2),
4040
+ name: `${flattenKey}.json`
4041
+ };
4042
+ }
4043
+ return content;
4044
+ });
4012
4045
  context = loadingStateContext(this.store.dataLoadingState$);
4013
4046
  ngOnDestroy() {
4014
4047
  this.context.destroy();
4015
4048
  }
4016
4049
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseModelEntitiesDebugWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4017
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: DbxFirebaseModelEntitiesDebugWidgetComponent, isStandalone: true, selector: "dbx-firebase-model-entities-debug-widget", usesInheritance: true, ngImport: i0, template: "<div class=\"dbx-firebase-model-entities-debug-widget\">\n <!-- Model Key Section -->\n <div class=\"dbx-debug-section\">\n <h4>Model Key Information</h4>\n @if (currentKey(); as key) {\n <dbx-firebase-model-key [modelKey]=\"key\"></dbx-firebase-model-key>\n }\n </div>\n\n <!-- Document Data Section -->\n <div class=\"dbx-debug-section\">\n <h4>Document Data</h4>\n <dbx-loading [context]=\"context\">\n @if (currentData(); as data) {\n <dbx-content-pit [rounded]=\"true\">\n <div class=\"dbx-json\">\n <dbx-click-to-copy-text>{{ data | json }}</dbx-click-to-copy-text>\n </div>\n </dbx-content-pit>\n } @else {\n <p class=\"dbx-empty\">No data available</p>\n }\n </dbx-loading>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: DbxFirebaseModelKeyComponent, selector: "dbx-firebase-model-key", inputs: ["modelKey"] }, { kind: "component", type: DbxClickToCopyTextComponent, selector: "dbx-click-to-copy-text", inputs: ["copyText", "highlighted", "clipboardSnackbarMessagesConfig", "clipboardSnackbarMessagesEnabled", "clickToCopyIcon", "clickIconToCopyOnly"] }, { kind: "directive", type: DbxContentPitDirective, selector: "dbx-content-pit, [dbxContentPit]", inputs: ["scrollable", "rounded"] }, { kind: "component", type: DbxLoadingComponent, selector: "dbx-loading", inputs: ["padding", "show", "text", "mode", "color", "diameter", "linear", "loading", "error", "context"] }, { kind: "pipe", type: JsonPipe, name: "json" }] });
4050
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: DbxFirebaseModelEntitiesDebugWidgetComponent, isStandalone: true, selector: "dbx-firebase-model-entities-debug-widget", usesInheritance: true, ngImport: i0, template: "<div class=\"dbx-firebase-model-entities-debug-widget\">\n <!-- Model Key Section -->\n <div class=\"dbx-debug-section\">\n <h4>Model Key Information</h4>\n @if (currentKey(); as key) {\n <dbx-firebase-model-key [modelKey]=\"key\"></dbx-firebase-model-key>\n }\n </div>\n\n <!-- Document Data Section -->\n <div class=\"dbx-debug-section\">\n <h4>Document Data</h4>\n <dbx-loading [context]=\"context\">\n @if (currentData(); as data) {\n <dbx-download-text-view [content]=\"contentSignal()\"></dbx-download-text-view>\n } @else {\n <p class=\"dbx-empty\">No data available</p>\n }\n </dbx-loading>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: DbxFirebaseModelKeyComponent, selector: "dbx-firebase-model-key", inputs: ["modelKey"] }, { kind: "component", type: DbxDownloadTextViewComponent, selector: "dbx-download-text-view", inputs: ["showDownloadButton", "loadingText", "linear", "showTitle", "showPreview", "showExpandPreviewButton", "expandPreview", "content", "contentState"], outputs: ["expandPreviewChange"] }, { kind: "component", type: DbxLoadingComponent, selector: "dbx-loading", inputs: ["padding", "show", "text", "mode", "color", "diameter", "linear", "loading", "error", "context"] }] });
4018
4051
  }
4019
4052
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DbxFirebaseModelEntitiesDebugWidgetComponent, decorators: [{
4020
4053
  type: Component,
4021
- args: [{ selector: 'dbx-firebase-model-entities-debug-widget', standalone: true, imports: [DbxFirebaseModelKeyComponent, DbxClickToCopyTextComponent, DbxContentPitDirective, DbxLoadingComponent, JsonPipe], template: "<div class=\"dbx-firebase-model-entities-debug-widget\">\n <!-- Model Key Section -->\n <div class=\"dbx-debug-section\">\n <h4>Model Key Information</h4>\n @if (currentKey(); as key) {\n <dbx-firebase-model-key [modelKey]=\"key\"></dbx-firebase-model-key>\n }\n </div>\n\n <!-- Document Data Section -->\n <div class=\"dbx-debug-section\">\n <h4>Document Data</h4>\n <dbx-loading [context]=\"context\">\n @if (currentData(); as data) {\n <dbx-content-pit [rounded]=\"true\">\n <div class=\"dbx-json\">\n <dbx-click-to-copy-text>{{ data | json }}</dbx-click-to-copy-text>\n </div>\n </dbx-content-pit>\n } @else {\n <p class=\"dbx-empty\">No data available</p>\n }\n </dbx-loading>\n </div>\n</div>\n" }]
4054
+ args: [{ selector: 'dbx-firebase-model-entities-debug-widget', standalone: true, imports: [DbxFirebaseModelKeyComponent, DbxClickToCopyTextComponent, DbxContentPitDirective, DbxDownloadTextViewComponent, DbxLoadingComponent, JsonPipe], template: "<div class=\"dbx-firebase-model-entities-debug-widget\">\n <!-- Model Key Section -->\n <div class=\"dbx-debug-section\">\n <h4>Model Key Information</h4>\n @if (currentKey(); as key) {\n <dbx-firebase-model-key [modelKey]=\"key\"></dbx-firebase-model-key>\n }\n </div>\n\n <!-- Document Data Section -->\n <div class=\"dbx-debug-section\">\n <h4>Document Data</h4>\n <dbx-loading [context]=\"context\">\n @if (currentData(); as data) {\n <dbx-download-text-view [content]=\"contentSignal()\"></dbx-download-text-view>\n } @else {\n <p class=\"dbx-empty\">No data available</p>\n }\n </dbx-loading>\n </div>\n</div>\n" }]
4022
4055
  }] });
4023
4056
 
4024
4057
  /**