Update packages

This commit is contained in:
Milad Raeisi
2024-11-20 22:24:40 +04:00
parent e6c2507b0c
commit e8b4c989d2
65 changed files with 25285 additions and 21740 deletions

View File

@@ -15,11 +15,12 @@
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist",
"outputPath": {
"base": "dist"
},
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": ["zone.js"],
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
@@ -60,7 +61,8 @@
"src/styles/styles.scss",
"src/styles/tailwind.scss"
],
"scripts": []
"scripts": [],
"browser": "src/main.ts"
},
"configurations": {
"production": {
@@ -77,8 +79,7 @@
}
],
"outputHashing": "all",
"serviceWorker": true,
"ngswConfigPath": "ngsw-config.json"
"serviceWorker": "ngsw-config.json"
},
"development": {
"optimization": false,

46406
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,114 +1,114 @@
{
"name": "angor-hub",
"version": "0.0.11",
"description": "Angor Hub is a Nostr client that is customized around the Angor protocol, a decentralized crowdfunding platform.",
"author": "angor",
"private": true,
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"deploy": "ng deploy",
"version": "node -p \"require('./package.json').version\"",
"changelog": "conventional-changelog -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
"format": "prettier --write \"src/**/*.{ts,html,css,scss,json,js}\""
},
"dependencies": {
"@angular-builders/custom-webpack": "^18.0.0",
"@angular/animations": "18.2.12",
"@angular/cdk": "18.2.13",
"@angular/common": "18.2.12",
"@angular/compiler": "18.2.12",
"@angular/core": "18.2.12",
"@angular/forms": "18.2.12",
"@angular/material": "18.2.13",
"@angular/material-luxon-adapter": "18.2.13",
"@angular/platform-browser": "18.2.12",
"@angular/platform-browser-dynamic": "18.2.12",
"@angular/pwa": "^18.2.12",
"@angular/router": "18.2.12",
"@angular/service-worker": "^18.2.12",
"@blockcore/nostr-login": "^1.0.7",
"@blockcore/nostr-login-components": "^1.0.7",
"@ctrl/ngx-emoji-mart": "^9.2.0",
"@gandlaf21/bolt11-decode": "^3.1.1",
"@getalby/lightning-tools": "^5.1.0",
"@getalby/sdk": "^3.7.1",
"@material/snackbar": "^14.0.0",
"@ngneat/cashew": "^4.1.0",
"@ngneat/transloco": "6.0.4",
"@noble/hashes": "^1.5.0",
"@noble/secp256k1": "2.1.0",
"@types/qrcode": "^1.5.5",
"@webbtc/webln-types": "^3.0.0",
"@zxing/library": "^0.21.3",
"@zxing/ngx-scanner": "^18.0.1",
"angularx-qrcode": "^18.0.2",
"apexcharts": "4.0.0",
"bech32": "^2.0.0",
"blurhash": "^2.0.5",
"buffer": "^6.0.3",
"cropperjs": "^1.6.2",
"crypto-browserify": "^3.12.1",
"crypto-js": "4.2.0",
"dayjs": "^1.11.13",
"dompurify": "^3.2.0",
"highlight.js": "11.10.0",
"install": "^0.13.0",
"jsdom": "^25.0.1",
"light-bolt11-decoder": "^3.2.0",
"lnd-grpc": "^0.5.4",
"localforage": "^1.10.0",
"lodash-es": "4.17.21",
"luxon": "3.5.0",
"moment": "^2.30.1",
"ng-apexcharts": "1.12.0",
"ngx-indexed-db": "^19.1.0",
"ngx-infinite-scroll": "^18.0.0",
"ngx-quill": "26.0.10",
"nostr-tools": "^2.10.3",
"npm": "^10.9.0",
"perfect-scrollbar": "1.5.6",
"process": "^0.11.10",
"qrcode": "^1.5.4",
"quill": "2.0.2",
"rxjs": "~7.8.1",
"sanitize-html": "^2.13.1",
"stream": "^0.0.3",
"stream-browserify": "^3.0.0",
"tslib": "^2.8.1",
"webln": "^0.3.2",
"zone.js": "0.15.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^18.2.12",
"@angular/cli": "18.2.12",
"@angular/compiler-cli": "18.2.12",
"@tailwindcss/typography": "0.5.15",
"@types/chroma-js": "2.4.4",
"@types/crypto-js": "4.2.2",
"@types/highlight.js": "10.1.0",
"@types/jasmine": "5.1.4",
"@types/lodash": "4.17.13",
"@types/lodash-es": "4.17.12",
"@types/luxon": "3.4.2",
"angular-cli-ghpages": "^2.0.3",
"autoprefixer": "10.4.20",
"chroma-js": "3.1.2",
"jasmine-core": "5.4.0",
"karma": "6.4.4",
"karma-chrome-launcher": "3.2.0",
"karma-coverage": "2.2.1",
"karma-jasmine": "5.1.0",
"karma-jasmine-html-reporter": "2.1.0",
"lodash": "4.17.21",
"postcss": "8.4.49",
"prettier": "^3.3.3",
"prettier-plugin-organize-imports": "4.1.0",
"prettier-plugin-tailwindcss": "0.6.8",
"tailwindcss": "3.4.15",
"typescript": "5.5.2"
}
"name": "angor-hub",
"version": "0.0.11",
"description": "Angor Hub is a Nostr client that is customized around the Angor protocol, a decentralized crowdfunding platform.",
"author": "angor",
"private": true,
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"deploy": "ng deploy",
"version": "node -p \"require('./package.json').version\"",
"changelog": "conventional-changelog -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
"format": "prettier --write \"src/**/*.{ts,html,css,scss,json,js}\""
},
"dependencies": {
"@angular-builders/custom-webpack": "^18.0.0",
"@angular/animations": "19.0.0",
"@angular/cdk": "19.0.0",
"@angular/common": "19.0.0",
"@angular/compiler": "19.0.0",
"@angular/core": "19.0.0",
"@angular/forms": "19.0.0",
"@angular/material": "19.0.0",
"@angular/material-luxon-adapter": "19.0.0",
"@angular/platform-browser": "19.0.0",
"@angular/platform-browser-dynamic": "19.0.0",
"@angular/pwa": "^19.0.0",
"@angular/router": "19.0.0",
"@angular/service-worker": "^19.0.0",
"@blockcore/nostr-login": "^1.0.7",
"@blockcore/nostr-login-components": "^1.0.7",
"@ctrl/ngx-emoji-mart": "^9.2.0",
"@gandlaf21/bolt11-decode": "^3.1.1",
"@getalby/lightning-tools": "^5.1.0",
"@getalby/sdk": "^3.7.1",
"@material/snackbar": "^14.0.0",
"@ngneat/cashew": "^4.1.0",
"@ngneat/transloco": "6.0.4",
"@noble/hashes": "^1.5.0",
"@noble/secp256k1": "2.1.0",
"@types/qrcode": "^1.5.5",
"@webbtc/webln-types": "^3.0.0",
"@zxing/library": "^0.21.3",
"@zxing/ngx-scanner": "^18.0.1",
"angularx-qrcode": "^18.0.2",
"apexcharts": "4.0.0",
"bech32": "^2.0.0",
"blurhash": "^2.0.5",
"buffer": "^6.0.3",
"cropperjs": "^1.6.2",
"crypto-browserify": "^3.12.1",
"crypto-js": "4.2.0",
"dayjs": "^1.11.13",
"dompurify": "^3.2.1",
"highlight.js": "11.10.0",
"install": "^0.13.0",
"jsdom": "^25.0.1",
"light-bolt11-decoder": "^3.2.0",
"lnd-grpc": "^0.5.4",
"localforage": "^1.10.0",
"lodash-es": "4.17.21",
"luxon": "3.5.0",
"moment": "^2.30.1",
"ng-apexcharts": "1.13.0",
"ngx-indexed-db": "^19.2.0",
"ngx-infinite-scroll": "^18.0.0",
"ngx-quill": "27.0.0",
"nostr-tools": "^2.10.3",
"npm": "^10.9.0",
"perfect-scrollbar": "1.5.6",
"process": "^0.11.10",
"qrcode": "^1.5.4",
"quill": "2.0.2",
"rxjs": "~7.8.1",
"sanitize-html": "^2.13.1",
"stream": "^0.0.3",
"stream-browserify": "^3.0.0",
"tslib": "^2.8.1",
"webln": "^0.3.2",
"zone.js": "0.15.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^19.0.0",
"@angular/cli": "19.0.0",
"@angular/compiler-cli": "19.0.0",
"@tailwindcss/typography": "0.5.15",
"@types/chroma-js": "2.4.4",
"@types/crypto-js": "4.2.2",
"@types/highlight.js": "10.1.0",
"@types/jasmine": "5.1.4",
"@types/lodash": "4.17.13",
"@types/lodash-es": "4.17.12",
"@types/luxon": "3.4.2",
"angular-cli-ghpages": "^2.0.3",
"autoprefixer": "10.4.20",
"chroma-js": "3.1.2",
"jasmine-core": "5.4.0",
"karma": "6.4.4",
"karma-chrome-launcher": "3.2.0",
"karma-coverage": "2.2.1",
"karma-jasmine": "5.1.0",
"karma-jasmine-html-reporter": "2.1.0",
"lodash": "4.17.21",
"postcss": "8.4.49",
"prettier": "^3.3.3",
"prettier-plugin-organize-imports": "4.1.0",
"prettier-plugin-tailwindcss": "0.6.9",
"tailwindcss": "3.4.15",
"typescript": "5.6.3"
}
}

View File

@@ -34,7 +34,7 @@ import { Subject, filter, takeUntil } from 'rxjs';
animations: angorAnimations,
exportAs: 'angorAlert',
standalone: true,
imports: [MatIconModule, MatButtonModule],
imports: [MatIconModule, MatButtonModule]
})
export class AngorAlertComponent implements OnChanges, OnInit, OnDestroy {
static ngAcceptInputType_dismissible: BooleanInput;

View File

@@ -18,7 +18,6 @@ import {
animations: angorAnimations,
exportAs: 'angorCard',
standalone: true,
imports: [],
})
export class AngorCardComponent implements OnChanges {
static ngAcceptInputType_expanded: BooleanInput;

View File

@@ -23,7 +23,7 @@ import { MatTooltipModule } from '@angular/material/tooltip';
MatTooltipModule,
NgTemplateOutlet,
MatIconModule,
],
]
})
export class AngorFullscreenComponent {
private _document = inject(DOCUMENT);

View File

@@ -20,7 +20,7 @@ import { Subject, takeUntil } from 'rxjs';
encapsulation: ViewEncapsulation.None,
exportAs: 'angorLoadingBar',
standalone: true,
imports: [MatProgressBarModule],
imports: [MatProgressBarModule]
})
export class AngorLoadingBarComponent implements OnChanges, OnInit, OnDestroy {
private _angorLoadingService = inject(AngorLoadingService);

View File

@@ -35,7 +35,7 @@ import { Subject, takeUntil } from 'rxjs';
NgTemplateOutlet,
MatMenuModule,
MatIconModule,
],
]
})
export class AngorHorizontalNavigationBasicItemComponent
implements OnInit, OnDestroy

View File

@@ -35,7 +35,7 @@ import { Subject, takeUntil } from 'rxjs';
AngorHorizontalNavigationDividerItemComponent,
MatTooltipModule,
MatIconModule,
],
]
})
export class AngorHorizontalNavigationBranchItemComponent
implements OnInit, OnDestroy

View File

@@ -18,7 +18,7 @@ import { Subject, takeUntil } from 'rxjs';
templateUrl: './divider.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [NgClass],
imports: [NgClass]
})
export class AngorHorizontalNavigationDividerItemComponent
implements OnInit, OnDestroy

View File

@@ -18,7 +18,7 @@ import { Subject, takeUntil } from 'rxjs';
templateUrl: './spacer.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [NgClass],
imports: [NgClass]
})
export class AngorHorizontalNavigationSpacerItemComponent
implements OnInit, OnDestroy

View File

@@ -32,7 +32,7 @@ import { AngorHorizontalNavigationSpacerItemComponent } from './components/space
AngorHorizontalNavigationBasicItemComponent,
AngorHorizontalNavigationBranchItemComponent,
AngorHorizontalNavigationSpacerItemComponent,
],
]
})
export class AngorHorizontalNavigationComponent
implements OnChanges, OnInit, OnDestroy

View File

@@ -38,7 +38,7 @@ import { Subject, filter, takeUntil } from 'rxjs';
AngorVerticalNavigationDividerItemComponent,
AngorVerticalNavigationGroupItemComponent,
AngorVerticalNavigationSpacerItemComponent,
],
]
})
export class AngorVerticalNavigationAsideItemComponent
implements OnChanges, OnInit, OnDestroy

View File

@@ -33,7 +33,7 @@ import { Subject, takeUntil } from 'rxjs';
MatTooltipModule,
NgTemplateOutlet,
MatIconModule,
],
]
})
export class AngorVerticalNavigationBasicItemComponent
implements OnInit, OnDestroy

View File

@@ -39,7 +39,7 @@ import { Subject, filter, takeUntil } from 'rxjs';
AngorVerticalNavigationDividerItemComponent,
AngorVerticalNavigationGroupItemComponent,
AngorVerticalNavigationSpacerItemComponent,
],
]
})
export class AngorVerticalNavigationCollapsableItemComponent
implements OnInit, OnDestroy

View File

@@ -18,7 +18,7 @@ import { Subject, takeUntil } from 'rxjs';
templateUrl: './divider.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [NgClass],
imports: [NgClass]
})
export class AngorVerticalNavigationDividerItemComponent
implements OnInit, OnDestroy

View File

@@ -33,7 +33,7 @@ import { Subject, takeUntil } from 'rxjs';
AngorVerticalNavigationDividerItemComponent,
forwardRef(() => AngorVerticalNavigationGroupItemComponent),
AngorVerticalNavigationSpacerItemComponent,
],
]
})
export class AngorVerticalNavigationGroupItemComponent
implements OnInit, OnDestroy

View File

@@ -18,7 +18,7 @@ import { Subject, takeUntil } from 'rxjs';
templateUrl: './spacer.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [NgClass],
imports: [NgClass]
})
export class AngorVerticalNavigationSpacerItemComponent
implements OnInit, OnDestroy

View File

@@ -73,7 +73,7 @@ import {
AngorVerticalNavigationDividerItemComponent,
AngorVerticalNavigationGroupItemComponent,
AngorVerticalNavigationSpacerItemComponent,
],
]
})
export class AngorVerticalNavigationComponent
implements OnChanges, OnInit, AfterViewInit, OnDestroy

View File

@@ -24,8 +24,7 @@ import { MatIconModule } from '@angular/material/icon';
`,
],
encapsulation: ViewEncapsulation.None,
standalone: true,
imports: [MatButtonModule, MatDialogModule, MatIconModule, NgClass],
imports: [MatButtonModule, MatDialogModule, MatIconModule, NgClass]
})
export class AngorConfirmationDialogComponent {
data: AngorConfirmationConfig = inject(MAT_DIALOG_DATA);

View File

@@ -6,7 +6,7 @@ import { RouterOutlet } from '@angular/router';
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [RouterOutlet],
imports: [RouterOutlet]
})
export class AppComponent {
/**

View File

@@ -37,7 +37,7 @@ import { SignerService } from 'app/services/signer.service';
MatCheckboxModule,
MatProgressSpinnerModule,
CommonModule,
],
]
})
export class RegisterComponent implements OnInit {
@ViewChild('registerNgForm') registerNgForm: NgForm;

View File

@@ -23,7 +23,6 @@ import { Subscription } from 'rxjs';
@Component({
selector: 'auth-sign-in',
templateUrl: './login.component.html',
standalone: true,
imports: [
RouterLink,
AngorAlertComponent,
@@ -36,7 +35,7 @@ import { Subscription } from 'rxjs';
MatCheckboxModule,
MatProgressSpinnerModule,
CommonModule,
],
]
})
export class LoginComponent implements OnInit {
SecretKeyLoginForm: FormGroup;

View File

@@ -8,8 +8,7 @@ import { Subject, finalize, takeUntil, takeWhile, tap, timer } from 'rxjs';
selector: 'auth-logout',
templateUrl: './logout.component.html',
encapsulation: ViewEncapsulation.None,
standalone: true,
imports: [RouterLink, I18nPluralPipe],
imports: [RouterLink, I18nPluralPipe]
})
export class LogoutComponent implements OnInit, OnDestroy {
countdown: number = 5;

View File

@@ -23,10 +23,8 @@ import { Observable, Subject, takeUntil } from 'rxjs';
standalone: true,
imports: [
MatButtonModule,
RouterLink,
MatIconModule,
AngorCardComponent,
CdkScrollable,
MatFormFieldModule,
MatSelectModule,
MatOptionModule,
@@ -35,9 +33,6 @@ import { Observable, Subject, takeUntil } from 'rxjs';
NgClass,
MatTooltipModule,
MatProgressBarModule,
AngorFindByKeyPipe,
PercentPipe,
I18nPluralPipe,
CommonModule,
],
templateUrl: './bookmark.component.html',

View File

@@ -10,8 +10,7 @@ import { RouterOutlet } from '@angular/router';
templateUrl: './chat.component.html',
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [RouterOutlet],
imports: [RouterOutlet]
})
export class ChatComponent {
/**

View File

@@ -28,7 +28,6 @@ import { AngorNavigationService, AngorVerticalNavigationComponent } from '@angor
templateUrl: './chats.component.html',
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
MatSidenavModule,
NewChatComponent,
@@ -44,7 +43,7 @@ import { AngorNavigationService, AngorVerticalNavigationComponent } from '@angor
AgoPipe,
CommonModule,
CheckmessagePipe,
],
]
})
export class ChatsComponent implements OnInit, OnDestroy {

View File

@@ -15,8 +15,7 @@ import { Chat } from '../chat.types';
templateUrl: './contact-info.component.html',
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [MatButtonModule, MatIconModule, RouterModule],
imports: [MatButtonModule, MatIconModule, RouterModule]
})
export class ContactInfoComponent {
@Input() chat: Chat;

View File

@@ -43,7 +43,6 @@ import { ParseContentService } from 'app/services/parse-content.service';
styleUrls: ['./conversation.component.css'],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
MatSidenavModule,
ContactInfoComponent,
@@ -59,7 +58,7 @@ import { ParseContentService } from 'app/services/parse-content.service';
DatePipe,
PickerComponent,
CommonModule,
],
]
})
export class ConversationComponent implements OnInit, OnDestroy {
@ViewChild('messageInput') messageInput: ElementRef;

View File

@@ -10,8 +10,7 @@ import { MatIconModule } from '@angular/material/icon';
templateUrl: './empty-conversation.component.html',
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [MatIconModule],
imports: [MatIconModule]
})
export class EmptyConversationComponent {
/**

View File

@@ -19,8 +19,7 @@ import { Contact } from '../chat.types';
templateUrl: './new-chat.component.html',
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [MatButtonModule, MatIconModule],
imports: [MatButtonModule, MatIconModule]
})
export class NewChatComponent implements OnInit, OnDestroy {
@Input() drawer: MatDrawer;

View File

@@ -21,14 +21,13 @@ import { Profile } from '../chat.types';
templateUrl: './profile.component.html',
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
MatButtonModule,
MatIconModule,
MatFormFieldModule,
MatInputModule,
FormsModule,
],
]
})
export class ProfileComponent implements OnInit, OnDestroy {
@Input() drawer: MatDrawer;

View File

@@ -32,29 +32,23 @@ import { BookmarkService } from 'app/services/bookmark.service';
@Component({
selector: 'explore',
standalone: true,
templateUrl: './explore.component.html',
encapsulation: ViewEncapsulation.None,
standalone: true,
imports: [
MatButtonModule,
RouterLink,
MatIconModule,
AngorCardComponent,
CdkScrollable,
MatFormFieldModule,
MatSelectModule,
MatOptionModule,
MatInputModule,
MatSlideToggleModule,
NgClass,
MatTooltipModule,
MatProgressBarModule,
AngorFindByKeyPipe,
PercentPipe,
I18nPluralPipe,
CommonModule,
],
MatButtonModule,
MatIconModule,
AngorCardComponent,
MatFormFieldModule,
MatSelectModule,
MatOptionModule,
MatInputModule,
MatSlideToggleModule,
NgClass,
MatTooltipModule,
MatProgressBarModule,
CommonModule,
]
})
export class ExploreComponent implements OnInit, OnDestroy {

View File

@@ -40,7 +40,6 @@ import { PostComponent } from 'app/layout/common/post/post.component';
selector: 'help-center',
templateUrl: './home.component.html',
encapsulation: ViewEncapsulation.None,
standalone: true,
imports: [
CommonModule,
FormsModule,
@@ -56,7 +55,7 @@ import { PostComponent } from 'app/layout/common/post/post.component';
QRCodeModule,
InfiniteScrollModule,
PostComponent
],
]
})
export class LandingHomeComponent implements OnInit, OnDestroy {
posts: NostrEvent[] = [];

View File

@@ -10,8 +10,7 @@ import { RouterLink } from '@angular/router';
templateUrl: './error-404.component.html',
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [RouterLink],
imports: [RouterLink]
})
export class Error404Component {
/**

View File

@@ -40,7 +40,6 @@ export interface PostReaction {
@Component({
selector: 'app-post-event',
standalone: true,
imports: [
AngorCardComponent,
MatIconModule,
@@ -63,7 +62,6 @@ export interface PostReaction {
ReplayProfileComponent,
PostComponent,
PickerComponent,
],
templateUrl: './post-event.component.html',
styleUrls: ['./post-event.component.scss']

View File

@@ -6,11 +6,11 @@ import { AgoPipe } from "../../../shared/pipes/ago.pipe";
import { MetadataService } from 'app/services/metadata.service';
@Component({
selector: 'app-post-profile',
standalone: true,
templateUrl: './post-profile.component.html',
styleUrls: ['./post-profile.component.scss'],
imports: [CommonModule, AgoPipe]
selector: 'app-post-profile',
templateUrl: './post-profile.component.html',
styleUrls: ['./post-profile.component.scss'],
standalone: true,
imports: [CommonModule, AgoPipe]
})
export class PostProfileComponent implements OnInit, OnDestroy {
@Input() pubkey!: string;

View File

@@ -6,7 +6,6 @@ import { MetadataService } from 'app/services/metadata.service';
@Component({
selector: 'app-replay-profile',
standalone: true,
templateUrl: './replay-profile.component.html',
styleUrls: ['./replay-profile.component.scss'],
imports: [CommonModule]

View File

@@ -81,9 +81,8 @@ interface Chip {
MatIconModule,
MatExpansionModule,
MatSidenavModule,
AgoPipe,
PostComponent
],
]
})
export class ProfileComponent implements OnInit, OnDestroy {

View File

@@ -46,7 +46,7 @@ import { NostrEvent, UnsignedEvent, finalizeEvent } from 'nostr-tools';
MatOptionModule,
MatButtonModule,
CommonModule,
],
]
})
export class SettingsAdvancedProfileComponent implements OnInit {
profileForm: FormGroup;

View File

@@ -25,18 +25,15 @@ import { IndexerService } from 'app/services/indexer.service';
imports: [
FormsModule,
ReactiveFormsModule,
AngorAlertComponent,
MatRadioModule,
NgClass,
MatIconModule,
MatFormFieldModule,
MatInputModule,
MatSelectModule,
MatOptionModule,
MatButtonModule,
CurrencyPipe,
CommonModule,
],
]
})
export class SettingsIndexerComponent implements OnInit {
mainnetIndexers: Array<{ url: string; primary: boolean }> = [];

View File

@@ -24,7 +24,6 @@ import { IndexerService } from 'app/services/indexer.service';
imports: [
FormsModule,
ReactiveFormsModule,
AngorAlertComponent,
MatRadioModule,
NgClass,
MatIconModule,
@@ -33,9 +32,8 @@ import { IndexerService } from 'app/services/indexer.service';
MatSelectModule,
MatOptionModule,
MatButtonModule,
CurrencyPipe,
CommonModule,
],
]
})
export class SettingsNetworkComponent implements OnInit {
networkForm: FormGroup;

View File

@@ -24,7 +24,7 @@ import { MatSlideToggleModule } from '@angular/material/slide-toggle';
ReactiveFormsModule,
MatSlideToggleModule,
MatButtonModule,
],
]
})
export class SettingsNotificationsComponent implements OnInit {
notificationsForm: UntypedFormGroup;

View File

@@ -46,7 +46,7 @@ import { NostrEvent, UnsignedEvent, finalizeEvent } from 'nostr-tools';
MatOptionModule,
MatButtonModule,
CommonModule,
],
]
})
export class SettingsProfileComponent implements OnInit {
profileForm: FormGroup;

View File

@@ -34,7 +34,7 @@ import { Subscription } from 'rxjs';
TitleCasePipe,
CommonModule,
FormsModule,
],
]
})
export class SettingsRelayComponent implements OnInit {
relays: any[] = [];

View File

@@ -32,7 +32,7 @@ import { SignerService } from 'app/services/signer.service';
MatInputModule,
MatSlideToggleModule,
MatButtonModule,
],
]
})
export class SettingsSecurityComponent implements OnInit {
securityForm: UntypedFormGroup;

View File

@@ -41,7 +41,7 @@ import { SettingsAdvancedProfileComponent } from './advanced-profile/advanced-pr
SettingsNetworkComponent,
SettingsIndexerComponent,
SettingsAdvancedProfileComponent
],
]
})
export class SettingsComponent implements OnInit, OnDestroy {
@ViewChild('drawer') drawer: MatDrawer;

View File

@@ -24,7 +24,6 @@ import { AngorCardComponent } from '../../../@angor/components/card/card.compone
@Component({
selector: 'app-zap',
standalone: true,
templateUrl: './zap.component.html',
styleUrls: ['./zap.component.scss'],
imports: [
@@ -37,7 +36,7 @@ import { AngorCardComponent } from '../../../@angor/components/card/card.compone
TextFieldModule,
ReactiveFormsModule,
AngorCardComponent,
],
]
})
export class ZapComponent implements OnInit {
private readonly formBuilder = inject(FormBuilder);

View File

@@ -38,7 +38,7 @@ import { Subject, takeUntil } from 'rxjs';
NgTemplateOutlet,
RouterLink,
DatePipe,
],
]
})
export class NotificationsComponent implements OnInit, OnDestroy {
@ViewChild('notificationsOrigin') private _notificationsOrigin: MatButton;

View File

@@ -44,7 +44,7 @@ import { Subscription, take, takeUntil } from 'rxjs';
MatButton,
],
templateUrl: './post.component.html',
styleUrls: ['./post.component.scss'],
styleUrls: ['./post.component.scss']
})
export class PostComponent implements OnDestroy {

View File

@@ -41,7 +41,7 @@ import { Subject, takeUntil } from 'rxjs';
MatInputModule,
TextFieldModule,
DatePipe,
],
]
})
export class QuickChatComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild('messageInput') messageInput: ElementRef;

View File

@@ -50,10 +50,8 @@ import { Subject, debounceTime, filter, map, takeUntil } from 'rxjs';
ReactiveFormsModule,
MatOptionModule,
RouterLink,
NgTemplateOutlet,
MatFormFieldModule,
MatInputModule,
NgClass,
CommonModule,
],
providers: [
@@ -64,7 +62,7 @@ import { Subject, debounceTime, filter, map, takeUntil } from 'rxjs';
return () => overlay.scrollStrategies.block();
},
},
],
]
})
export class SearchComponent implements OnChanges, OnInit, OnDestroy {
@Input() appearance: 'basic' | 'bar' = 'basic';

View File

@@ -42,7 +42,7 @@ import { Subject, takeUntil } from 'rxjs';
MatButtonModule,
NgClass,
MatTooltipModule,
],
]
})
export class SettingsComponent implements OnInit, OnDestroy {
config: AngorConfig;

View File

@@ -28,12 +28,8 @@ import { NewVersionCheckerService } from 'app/services/update.service';
MatButtonModule,
MatIconModule,
MatTooltipModule,
NgClass,
NgTemplateOutlet,
RouterLink,
DatePipe,
CommonModule,
],
]
})
export class UpdateComponent {
@Input() tooltip: string;

View File

@@ -38,7 +38,7 @@ import { NostrLoginService } from 'app/services/nostr-login.service';
MatDividerModule,
CommonModule,
RouterModule
],
]
})
export class UserComponent implements OnInit, OnDestroy {

View File

@@ -28,8 +28,7 @@ import { ClassicLayoutComponent } from './layouts/vertical/classic/classic.compo
EmptyLayoutComponent,
ModernLayoutComponent,
ClassicLayoutComponent,
SettingsComponent,
],
]
})
export class LayoutComponent implements OnInit, OnDestroy {
config: AngorConfig;

View File

@@ -8,7 +8,7 @@ import { Subject } from 'rxjs';
templateUrl: './empty.component.html',
encapsulation: ViewEncapsulation.None,
standalone: true,
imports: [AngorLoadingBarComponent, RouterOutlet],
imports: [AngorLoadingBarComponent, RouterOutlet]
})
export class EmptyLayoutComponent implements OnDestroy {
private _unsubscribeAll: Subject<any> = new Subject<any>();

View File

@@ -36,9 +36,8 @@ import { UpdateComponent } from '../../../common/update/update.component';
NotificationsComponent,
UserComponent,
RouterOutlet,
QuickChatComponent,
UpdateComponent,
],
]
})
export class ModernLayoutComponent implements OnInit, OnDestroy {
isScreenSmall: boolean;

View File

@@ -34,9 +34,8 @@ import { UpdateComponent } from '../../../common/update/update.component';
NotificationsComponent,
UserComponent,
RouterOutlet,
QuickChatComponent,
UpdateComponent,
],
]
})
export class ClassicLayoutComponent implements OnInit, OnDestroy {
isScreenSmall: boolean;

View File

@@ -1,153 +0,0 @@
import { Injectable } from '@angular/core';
import { NostrEvent, NostrProfile } from './interfaces';
import * as sanitizeHtml from 'sanitize-html';
@Injectable({
providedIn: 'root',
})
export class DataValidation {
contentLimit = 16384;
tagsLimit = 50;
profileLimit = 16384; // Should we consider 32768 for profiles?
profileTagsLimit = 1000;
contactsContentLimit = 16384;
sanitizeEvent(event: NostrEvent) {
// Allow only a super restricted set of tags and attributes
let clean = sanitizeHtml(event.content, {
allowedTags: ['b', 'i', 'em', 'strong', 'a', 'img'],
allowedAttributes: {
a: ['href'],
img: ['src'], // Only allow src and nothing else on images.
},
allowedIframeHostnames: ['www.youtube.com'],
});
event.content = clean;
return event;
}
validateEvent(event: NostrEvent) {
if (event.pubkey.length < 60 || event.pubkey.length > 70) {
return null;
}
if (!event.sig || !event.id) {
return null;
}
if (event.sig.length < 100 || event.pubkey.length > 150) {
return null;
}
if (event.id.length !== 64) {
return null;
}
if (typeof event.kind !== 'number' || typeof event.created_at !== 'number') {
return null;
}
if (event.kind === 0) {
// Reduce the content length to reduce system resource usage and improve UI experience.
if (event.content.length > this.profileLimit) {
event.content = event.content.substring(0, this.profileLimit);
event.contentCut = true;
}
} else {
// Reduce the content length to reduce system resource usage and improve UI experience.
if (event.content.length > this.contentLimit) {
event.content = event.content.substring(0, this.contentLimit);
event.contentCut = true;
}
}
// TODO: Do we need more validation for tags? Probably limited length?
// Tag content is currently not sanitized, does it need to be? Probably does since hashtags will be linkable?
if (event.tags && event.tags.length > this.tagsLimit) {
event.tags = event.tags.splice(0, this.tagsLimit);
event.tagsCut = true;
}
return event;
}
/** Returns true if valid, false if not valid. Does not throw error for optimization purposes. */
validateContacts(event: NostrEvent) {
if (event.pubkey.length < 60 || event.pubkey.length > 70) {
return null;
}
if (!event.sig || !event.id) {
return null;
}
if (event.sig.length < 100 || event.pubkey.length > 150) {
return null;
}
if (event.id.length !== 64) {
return null;
}
if (typeof event.kind !== 'number' || typeof event.created_at !== 'number') {
return null;
}
if (event.kind !== 3) {
return null;
}
// Reduce the content length to reduce system resource usage and improve UI experience.
if (event.content.length > this.contactsContentLimit) {
event.content = event.content.substring(0, this.contactsContentLimit);
event.contentCut = true;
}
return event;
}
escapeNewLineChars(valueToEscape: string) {
if (valueToEscape != null && valueToEscape != '') {
return valueToEscape.replace(/\n/g, ' ');
} else {
return valueToEscape;
}
}
sanitizeProfile(profile: NostrProfile) {
let clean = sanitizeHtml(profile.about, {
allowedTags: [],
allowedAttributes: {},
});
profile.about = clean;
return profile;
}
/** Returns true if valid, false if not valid. Does not throw error for optimization purposes. */
validateProfile(profile: NostrProfile) {
if (profile.picture.length > 2000) {
return null;
}
if (profile.name.length > 280) {
return null;
}
if (profile.about.length > 280) {
return null;
}
if (profile.nip05.length > 2000) {
return null;
}
return profile;
}
}

View File

@@ -5,7 +5,6 @@ import * as secp from '@noble/secp256k1';
import { bech32 } from '@scure/base';
import { Subscription } from 'rxjs';
import { NostrProfileDocument, NostrProfile, NostrEvent, NostrEventDocument, NostrBadgeDefinition } from './interfaces';
import { DataValidation } from './data-validation';
export function sleep(durationInMillisecond: number): Promise<void> {
return new Promise((resolve) => setTimeout(resolve, durationInMillisecond));
@@ -19,7 +18,7 @@ export function now() {
providedIn: 'root',
})
export class Utilities {
constructor(private snackBar: MatSnackBar, private validator: DataValidation, private sanitizer: DomSanitizer) {}
constructor(private snackBar: MatSnackBar, private sanitizer: DomSanitizer) {}
unsubscribe(subscriptions: Subscription[]) {
if (!subscriptions) {
@@ -92,25 +91,7 @@ export class Utilities {
return Math.floor(millisatoshis / 1000);
}
mapProfileEvent(event: NostrEventDocument): NostrProfileDocument | undefined {
// If a timeout is received, the event content will be: "The query timed out before it could complete: [{"kinds":[0],"authors":["edcd205..."]}]."
if (typeof event === 'string') {
return undefined;
}
try {
const jsonParsed = JSON.parse(event.content) as NostrProfileDocument;
const profile = this.validator.sanitizeProfile(jsonParsed) as NostrProfileDocument;
profile.pubkey = event.pubkey;
profile.created_at = event.created_at;
return profile;
} catch (err) {
console.warn(err);
}
return undefined;
}
getRelayUrls(relays: any) {
let preparedRelays = relays;

View File

@@ -35,15 +35,7 @@ import { GifService } from 'app/services/gif.service';
MatSidenavModule,
MatButtonModule,
MatIconModule,
NgClass,
SettingsProfileComponent,
SettingsSecurityComponent,
SettingsNotificationsComponent,
SettingsRelayComponent,
SettingsNetworkComponent,
SettingsIndexerComponent,
FormsModule,
MatOption,
MatLabel,
MatFormField,
ReactiveFormsModule,
@@ -74,7 +66,7 @@ import { GifService } from 'app/services/gif.service';
transform: scale(1.1);
}
`,
],
]
})
export class GifDialogComponent {
gifSearch: string = '';

View File

@@ -35,13 +35,6 @@ import { SettingsSecurityComponent } from 'app/components/settings/security/secu
MatSidenavModule,
MatButtonModule,
MatIconModule,
NgClass,
SettingsProfileComponent,
SettingsSecurityComponent,
SettingsNotificationsComponent,
SettingsRelayComponent,
SettingsNetworkComponent,
SettingsIndexerComponent,
FormsModule,
MatOption,
MatLabel,
@@ -59,7 +52,7 @@ import { SettingsSecurityComponent } from 'app/components/settings/security/secu
width: 100%;
}
`,
],
]
})
export class PasswordDialogComponent {
passwordForm: FormGroup;

View File

@@ -22,9 +22,9 @@ import { hexToBytes } from '@noble/hashes/utils';
@Component({
selector: 'app-send-dialog',
standalone: true,
templateUrl: './zap-dialog.component.html',
styleUrls: ['./zap-dialog.component.scss'],
standalone: true,
imports: [
MatSidenavModule,
MatButtonModule,
@@ -44,7 +44,7 @@ import { hexToBytes } from '@noble/hashes/utils';
MatDivider,
MatTooltip,
MatDialogClose,
],
]
})
export class ZapDialogComponent implements OnInit {
private readonly formBuilder = inject(FormBuilder);

View File

@@ -1,4 +1,4 @@
@import 'emoji.scss';
@use 'emoji.scss';
body {
overflow-x: hidden;