From 1d6c09e8088c71eccb5a34143720cd52d13e5104 Mon Sep 17 00:00:00 2001 From: Osei Fortune Date: Sun, 23 Apr 2023 09:47:48 -0400 Subject: [PATCH] feat: add ui support --- README.md | 1 + apps/demo-angular/package.json | 3 +- apps/demo-angular/src/app-routing.module.ts | 1 + apps/demo-angular/src/home.component.ts | 3 + .../plugin-demos/firebase-ui.component.html | 8 + .../src/plugin-demos/firebase-ui.component.ts | 17 + .../src/plugin-demos/firebase-ui.module.ts | 10 + .../demo-vue/app/plugin-demos/firebase-ui.vue | 34 + apps/demo-vue/package.json | 3 +- apps/demo/package.json | 3 +- apps/demo/src/app.ts | 1 + apps/demo/src/main-page.xml | 1 + apps/demo/src/main-view-model.ts | 3 + apps/demo/src/plugin-demos/firebase-ui.ts | 39 + apps/demo/src/plugin-demos/firebase-ui.xml | 15 + package.json | 2 +- packages/firebase-admob/package.json | 2 +- packages/firebase-analytics/package.json | 2 +- .../firebase-app-check-debug/package.json | 2 +- packages/firebase-app-check/package.json | 2 +- packages/firebase-auth/package.json | 2 +- packages/firebase-core/package.json | 2 +- packages/firebase-crashlytics/package.json | 2 +- packages/firebase-database/package.json | 2 +- packages/firebase-dynamic-links/package.json | 2 +- packages/firebase-firestore/package.json | 2 +- .../firebase-firestore/platforms/ios/Podfile | 2 +- packages/firebase-functions/package.json | 2 +- .../firebase-in-app-messaging/package.json | 2 +- packages/firebase-installations/package.json | 2 +- packages/firebase-messaging-core/package.json | 2 +- .../ios/src/NSCUIApplicationDelegate.swift | 17 +- packages/firebase-messaging/package.json | 2 +- packages/firebase-performance/package.json | 2 +- packages/firebase-remote-config/package.json | 2 +- packages/firebase-storage/package.json | 2 +- packages/firebase-ui/.eslintrc.json | 18 + packages/firebase-ui/README.md | 13 + packages/firebase-ui/common.ts | 7 + packages/firebase-ui/index.android.ts | 755 + packages/firebase-ui/index.d.ts | 247 + packages/firebase-ui/index.ios.ts | 611 + packages/firebase-ui/package.json | 35 + .../platforms/android/firebase_ui.aar | Bin 0 -> 5168 bytes .../platforms/android/include.gradle | 3 + .../nativescript/firebase/ui/FirebaseUI.kt | 75 + packages/firebase-ui/platforms/ios/Podfile | 1 + packages/firebase-ui/project.json | 66 + packages/firebase-ui/references.d.ts | 2 + packages/firebase-ui/tsconfig.json | 9 + packages/firebase-ui/typings/android.d.ts | 2752 +++ .../firebase-ui/typings/auth-interop.d.ts | 129 + .../firebase-ui/typings/firebase-auth.d.ts | 16076 ++++++++++++++++ packages/firebase-ui/typings/index.d.ts | 14 + .../typings/objc!FirebaseAnonymousAuthUI.d.ts | 81 + .../typings/objc!FirebaseAuth.d.ts | 840 + .../typings/objc!FirebaseAuthUI.d.ts | 532 + .../typings/objc!FirebaseDatabaseUI.d.ts | 590 + .../typings/objc!FirebaseEmailAuthUI.d.ts | 199 + .../typings/objc!FirebaseFacebookAuthUI.d.ts | 91 + .../typings/objc!FirebaseFirestoreUI.d.ts | 304 + .../typings/objc!FirebaseGoogleAuthUI.d.ts | 91 + .../typings/objc!FirebaseOAuthUI.d.ts | 103 + .../typings/objc!FirebasePhoneAuthUI.d.ts | 93 + .../typings/objc!FirebaseStorageUI.d.ts | 63 + tools/demo/firebase-ui/index.ts | 8 + tools/demo/index.ts | 1 + tools/workspace-scripts.js | 11 + tsconfig.base.json | 3 +- 69 files changed, 23995 insertions(+), 27 deletions(-) create mode 100644 apps/demo-angular/src/plugin-demos/firebase-ui.component.html create mode 100644 apps/demo-angular/src/plugin-demos/firebase-ui.component.ts create mode 100644 apps/demo-angular/src/plugin-demos/firebase-ui.module.ts create mode 100644 apps/demo-vue/app/plugin-demos/firebase-ui.vue create mode 100644 apps/demo/src/plugin-demos/firebase-ui.ts create mode 100644 apps/demo/src/plugin-demos/firebase-ui.xml create mode 100644 packages/firebase-ui/.eslintrc.json create mode 100644 packages/firebase-ui/README.md create mode 100644 packages/firebase-ui/common.ts create mode 100644 packages/firebase-ui/index.android.ts create mode 100644 packages/firebase-ui/index.d.ts create mode 100644 packages/firebase-ui/index.ios.ts create mode 100644 packages/firebase-ui/package.json create mode 100644 packages/firebase-ui/platforms/android/firebase_ui.aar create mode 100644 packages/firebase-ui/platforms/android/include.gradle create mode 100644 packages/firebase-ui/platforms/android/java/org/nativescript/firebase/ui/FirebaseUI.kt create mode 100644 packages/firebase-ui/platforms/ios/Podfile create mode 100644 packages/firebase-ui/project.json create mode 100644 packages/firebase-ui/references.d.ts create mode 100644 packages/firebase-ui/tsconfig.json create mode 100644 packages/firebase-ui/typings/android.d.ts create mode 100644 packages/firebase-ui/typings/auth-interop.d.ts create mode 100644 packages/firebase-ui/typings/firebase-auth.d.ts create mode 100644 packages/firebase-ui/typings/index.d.ts create mode 100644 packages/firebase-ui/typings/objc!FirebaseAnonymousAuthUI.d.ts create mode 100644 packages/firebase-ui/typings/objc!FirebaseAuth.d.ts create mode 100644 packages/firebase-ui/typings/objc!FirebaseAuthUI.d.ts create mode 100644 packages/firebase-ui/typings/objc!FirebaseDatabaseUI.d.ts create mode 100644 packages/firebase-ui/typings/objc!FirebaseEmailAuthUI.d.ts create mode 100644 packages/firebase-ui/typings/objc!FirebaseFacebookAuthUI.d.ts create mode 100644 packages/firebase-ui/typings/objc!FirebaseFirestoreUI.d.ts create mode 100644 packages/firebase-ui/typings/objc!FirebaseGoogleAuthUI.d.ts create mode 100644 packages/firebase-ui/typings/objc!FirebaseOAuthUI.d.ts create mode 100644 packages/firebase-ui/typings/objc!FirebasePhoneAuthUI.d.ts create mode 100644 packages/firebase-ui/typings/objc!FirebaseStorageUI.d.ts create mode 100644 tools/demo/firebase-ui/index.ts diff --git a/README.md b/README.md index a2134d98..18198567 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ - [@nativescript/firebase-performance](packages/firebase-performance/README.md) - [@nativescript/firebase-remote-config](packages/firebase-remote-config/README.md) - [@nativescript/firebase-storage](packages/firebase-storage/README.md) +- [@nativescript/firebase-ui](packages/firebase-ui/README.md) # How to use? diff --git a/apps/demo-angular/package.json b/apps/demo-angular/package.json index 4a731382..397556b2 100644 --- a/apps/demo-angular/package.json +++ b/apps/demo-angular/package.json @@ -19,7 +19,8 @@ "@nativescript/firebase-messaging": "file:../../dist/packages/firebase-messaging", "@nativescript/firebase-functions": "file:../../dist/packages/firebase-functions", "@nativescript/firebase-app-check-debug": "file:../../dist/packages/firebase-app-check-debug", - "@nativescript/firebase-messaging-core": "file:../../dist/packages/firebase-messaging-core" + "@nativescript/firebase-messaging-core": "file:../../dist/packages/firebase-messaging-core", + "@nativescript/firebase-ui": "file:../../dist/packages/firebase-ui" }, "devDependencies": { "@nativescript/android": "~8.4.0", diff --git a/apps/demo-angular/src/app-routing.module.ts b/apps/demo-angular/src/app-routing.module.ts index 0bff5c86..c440a096 100644 --- a/apps/demo-angular/src/app-routing.module.ts +++ b/apps/demo-angular/src/app-routing.module.ts @@ -25,6 +25,7 @@ const routes: Routes = [ { path: 'firebase-performance', loadChildren: () => import('./plugin-demos/firebase-performance.module').then((m) => m.FirebasePerformanceModule) }, { path: 'firebase-remote-config', loadChildren: () => import('./plugin-demos/firebase-remote-config.module').then((m) => m.FirebaseRemoteConfigModule) }, { path: 'firebase-storage', loadChildren: () => import('./plugin-demos/firebase-storage.module').then((m) => m.FirebaseStorageModule) }, + { path: 'firebase-ui', loadChildren: () => import('./plugin-demos/firebase-ui.module').then((m) => m.FirebaseUiModule) }, ]; @NgModule({ diff --git a/apps/demo-angular/src/home.component.ts b/apps/demo-angular/src/home.component.ts index 9f2cee23..d862ba7c 100644 --- a/apps/demo-angular/src/home.component.ts +++ b/apps/demo-angular/src/home.component.ts @@ -60,5 +60,8 @@ export class HomeComponent { { name: 'firebase-storage', }, + { + name: 'firebase-ui', + }, ]; } diff --git a/apps/demo-angular/src/plugin-demos/firebase-ui.component.html b/apps/demo-angular/src/plugin-demos/firebase-ui.component.html new file mode 100644 index 00000000..fea92084 --- /dev/null +++ b/apps/demo-angular/src/plugin-demos/firebase-ui.component.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/apps/demo-angular/src/plugin-demos/firebase-ui.component.ts b/apps/demo-angular/src/plugin-demos/firebase-ui.component.ts new file mode 100644 index 00000000..ac4b8d54 --- /dev/null +++ b/apps/demo-angular/src/plugin-demos/firebase-ui.component.ts @@ -0,0 +1,17 @@ +import { Component, NgZone } from '@angular/core'; +import { DemoSharedFirebaseUi } from '@demo/shared'; +import {} from '@nativescript/firebase-ui'; + +@Component({ + selector: 'demo-firebase-ui', + templateUrl: 'firebase-ui.component.html', +}) +export class FirebaseUiComponent { + demoShared: DemoSharedFirebaseUi; + + constructor(private _ngZone: NgZone) {} + + ngOnInit() { + this.demoShared = new DemoSharedFirebaseUi(); + } +} diff --git a/apps/demo-angular/src/plugin-demos/firebase-ui.module.ts b/apps/demo-angular/src/plugin-demos/firebase-ui.module.ts new file mode 100644 index 00000000..e816820d --- /dev/null +++ b/apps/demo-angular/src/plugin-demos/firebase-ui.module.ts @@ -0,0 +1,10 @@ +import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; +import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular'; +import { FirebaseUiComponent } from './firebase-ui.component'; + +@NgModule({ + imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: FirebaseUiComponent }])], + declarations: [FirebaseUiComponent], + schemas: [NO_ERRORS_SCHEMA], +}) +export class FirebaseUiModule {} diff --git a/apps/demo-vue/app/plugin-demos/firebase-ui.vue b/apps/demo-vue/app/plugin-demos/firebase-ui.vue new file mode 100644 index 00000000..f1c4a0b2 --- /dev/null +++ b/apps/demo-vue/app/plugin-demos/firebase-ui.vue @@ -0,0 +1,34 @@ + + + + + diff --git a/apps/demo-vue/package.json b/apps/demo-vue/package.json index 421d1379..ebb00ace 100644 --- a/apps/demo-vue/package.json +++ b/apps/demo-vue/package.json @@ -20,7 +20,8 @@ "@nativescript/firebase-remote-config": "file:../../packages/firebase-remote-config", "@nativescript/firebase-storage": "file:../../packages/firebase-storage", "@nativescript/firebase-app-check-debug": "file:../../packages/firebase-app-check-debug", - "@nativescript/firebase-messaging-core": "file:../../packages/firebase-messaging-core" + "@nativescript/firebase-messaging-core": "file:../../packages/firebase-messaging-core", + "@nativescript/firebase-ui": "file:../../packages/firebase-ui" }, "devDependencies": { "@nativescript/android": "~8.4.0", diff --git a/apps/demo/package.json b/apps/demo/package.json index 2b68899b..6253bce2 100644 --- a/apps/demo/package.json +++ b/apps/demo/package.json @@ -23,7 +23,8 @@ "@nativescript/firebase-storage": "file:../../packages/firebase-storage", "@nativescript/google-signin": "^1.0.0-alpha.9", "@nativescript/firebase-app-check-debug": "file:../../packages/firebase-app-check-debug", - "@nativescript/firebase-messaging-core": "file:../../packages/firebase-messaging-core" + "@nativescript/firebase-messaging-core": "file:../../packages/firebase-messaging-core", + "@nativescript/firebase-ui": "file:../../packages/firebase-ui" }, "devDependencies": { "@nativescript/android": "~8.4.0", diff --git a/apps/demo/src/app.ts b/apps/demo/src/app.ts index a9553f9b..33a336b8 100644 --- a/apps/demo/src/app.ts +++ b/apps/demo/src/app.ts @@ -13,6 +13,7 @@ import '@nativescript/firebase-messaging'; import '@nativescript/firebase-performance'; import '@nativescript/firebase-remote-config'; import '@nativescript/firebase-storage'; +import '@nativescript/firebase-ui'; import { Admob } from '@nativescript/firebase-admob'; diff --git a/apps/demo/src/main-page.xml b/apps/demo/src/main-page.xml index cc39b65b..74cf247c 100644 --- a/apps/demo/src/main-page.xml +++ b/apps/demo/src/main-page.xml @@ -1,6 +1,7 @@