@dereekb/dbx-firebase 9.20.19 → 9.21.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.
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, Optional, InjectionToken, Inject, Component, Input, Directive, EventEmitter, Output, NgModule, Injector, ViewChild, HostListener, forwardRef, Host } from '@angular/core';
3
3
  import * as i3 from '@dereekb/dbx-analytics';
4
- import { asObservable, timeoutStartWith, filterMaybe, isNot, SubscriptionObject, lazyFrom, switchMapWhileTrue, loadingStateFromObs, cleanupDestroyable, accumulatorFlattenPageListLoadingState, useFirst, pageLoadingStateFromObs, useAsObservable, distinctUntilModelKeyChange, successResult, beginLoading, errorResult, cleanup, mapLoadingState } from '@dereekb/rxjs';
4
+ import { asObservable, timeoutStartWith, filterMaybe, isNot, SubscriptionObject, lazyFrom, switchMapWhileTrue, loadingStateFromObs, cleanupDestroyable, accumulatorFlattenPageListLoadingState, useFirst, pageLoadingStateFromObs, useAsObservable, distinctUntilModelKeyChange, tapLog, successResult, beginLoading, errorResult, cleanup, mapLoadingState } from '@dereekb/rxjs';
5
5
  import { switchMap, of, shareReplay, map, distinctUntilChanged, catchError, firstValueFrom, BehaviorSubject, combineLatest, first, from, tap, interval, exhaustMap, filter, take, startWith, EMPTY, Subject, throttleTime, NEVER, combineLatestWith } from 'rxjs';
6
6
  import * as i2$2 from '@dereekb/dbx-core';
7
7
  import { loggedInObsFromIsLoggedIn, loggedOutObsFromIsLoggedIn, authUserIdentifier, DbxInjectionContext, AbstractForwardDbxInjectionContextDirective, DBX_INJECTION_COMPONENT_DATA, DbxInjectionComponentModule, DbxAuthService, AbstractSubscriptionDirective, AbstractIfDirective, DbxRouteParamReaderInstance, DbxRouteParamDefaultRedirectInstance, LockSetComponentStore } from '@dereekb/dbx-core';
@@ -33,7 +33,7 @@ import { provideStorage, getStorage, connectStorageEmulator, Storage } from '@an
33
33
  import * as i5 from '@angular/fire/functions';
34
34
  import { provideFunctions, getFunctions, connectFunctionsEmulator, Functions } from '@angular/fire/functions';
35
35
  import * as i1$5 from '@angular/fire/firestore';
36
- import { provideFirestore, getFirestore, connectFirestoreEmulator, enableIndexedDbPersistence, Firestore } from '@angular/fire/firestore';
36
+ import { provideFirestore, getFirestore, connectFirestoreEmulator, enableMultiTabIndexedDbPersistence, enableIndexedDbPersistence, Firestore } from '@angular/fire/firestore';
37
37
  import { HTTP_INTERCEPTORS } from '@angular/common/http';
38
38
  import * as i2$3 from '@angular/material/snack-bar';
39
39
  import { __decorate, __param, __metadata } from 'tslib';
@@ -1808,12 +1808,18 @@ DbxFirebaseDefaultFirestoreProviderModule.ɵfac = i0.ɵɵngDeclareFactory({ minV
1808
1808
  DbxFirebaseDefaultFirestoreProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, imports: [i1$5.FirestoreModule] });
1809
1809
  DbxFirebaseDefaultFirestoreProviderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, imports: [provideFirestore(((injector) => {
1810
1810
  const firebaseApp = injector.get(FirebaseApp);
1811
+ const firebaseOptions = injector.get(DBX_FIREBASE_OPTIONS_TOKEN);
1811
1812
  const firestore = getFirestore(firebaseApp);
1812
1813
  const emulators = injector.get(DbxFirebaseParsedEmulatorsConfig, undefined);
1813
1814
  if (emulators?.useEmulators && emulators?.firestore) {
1814
1815
  connectFirestoreEmulator(firestore, emulators.firestore.host, emulators.firestore.port, {});
1815
1816
  }
1816
- enableIndexedDbPersistence(firestore);
1817
+ if (firebaseOptions.enableMultiTabIndexedDbPersistence !== false) {
1818
+ enableMultiTabIndexedDbPersistence(firestore);
1819
+ }
1820
+ else if (firebaseOptions.enableIndexedDbPersistence !== false) {
1821
+ enableIndexedDbPersistence(firestore);
1822
+ }
1817
1823
  return firestore;
1818
1824
  }))] });
1819
1825
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFirebaseDefaultFirestoreProviderModule, decorators: [{
@@ -1822,12 +1828,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
1822
1828
  imports: [
1823
1829
  provideFirestore(((injector) => {
1824
1830
  const firebaseApp = injector.get(FirebaseApp);
1831
+ const firebaseOptions = injector.get(DBX_FIREBASE_OPTIONS_TOKEN);
1825
1832
  const firestore = getFirestore(firebaseApp);
1826
1833
  const emulators = injector.get(DbxFirebaseParsedEmulatorsConfig, undefined);
1827
1834
  if (emulators?.useEmulators && emulators?.firestore) {
1828
1835
  connectFirestoreEmulator(firestore, emulators.firestore.host, emulators.firestore.port, {});
1829
1836
  }
1830
- enableIndexedDbPersistence(firestore);
1837
+ if (firebaseOptions.enableMultiTabIndexedDbPersistence !== false) {
1838
+ enableMultiTabIndexedDbPersistence(firestore);
1839
+ }
1840
+ else if (firebaseOptions.enableIndexedDbPersistence !== false) {
1841
+ enableIndexedDbPersistence(firestore);
1842
+ }
1831
1843
  return firestore;
1832
1844
  }))
1833
1845
  ]
@@ -3385,15 +3397,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
3385
3397
  /**
3386
3398
  * Directive that connects a host DbxListView to a DbxFirebaseCollectionStoreDirective to pass data for rendering items from a collection and query parameters.
3387
3399
  */
3388
- class DbxFirebaseCollectionListDirective {
3400
+ class DbxFirebaseCollectionListDirective extends AbstractSubscriptionDirective {
3389
3401
  constructor(dbxFirebaseCollectionStoreDirective, dbxListViewWrapper) {
3402
+ super();
3390
3403
  this.dbxFirebaseCollectionStoreDirective = dbxFirebaseCollectionStoreDirective;
3391
3404
  this.dbxListViewWrapper = dbxListViewWrapper;
3392
- this.dbxListViewWrapper.state$ = this.dbxFirebaseCollectionStoreDirective.pageLoadingState$;
3405
+ this.dbxListViewWrapper.state$ = this.dbxFirebaseCollectionStoreDirective.pageLoadingState$.pipe(tapLog('xxx'));
3406
+ }
3407
+ ngOnInit() {
3408
+ this.sub = this.dbxListViewWrapper.loadMore?.subscribe(() => {
3409
+ this.dbxFirebaseCollectionStoreDirective.next();
3410
+ });
3393
3411
  }
3394
3412
  }
3395
3413
  DbxFirebaseCollectionListDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFirebaseCollectionListDirective, deps: [{ token: DbxFirebaseCollectionStoreDirective }, { token: i1$2.DbxListViewWrapper, host: true }], target: i0.ɵɵFactoryTarget.Directive });
3396
- DbxFirebaseCollectionListDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: DbxFirebaseCollectionListDirective, selector: "[dbxFirebaseCollectionList]", ngImport: i0 });
3414
+ DbxFirebaseCollectionListDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: DbxFirebaseCollectionListDirective, selector: "[dbxFirebaseCollectionList]", usesInheritance: true, ngImport: i0 });
3397
3415
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFirebaseCollectionListDirective, decorators: [{
3398
3416
  type: Directive,
3399
3417
  args: [{