Compare commits
3 Commits
3.0-beta9
...
3.0-beta11
| Author | SHA1 | Date | |
|---|---|---|---|
| aa3e1de412 | |||
| f9518a9164 | |||
| 3ed025ee61 |
@@ -24,6 +24,11 @@
|
|||||||
"glob": "**/*",
|
"glob": "**/*",
|
||||||
"input": "public"
|
"input": "public"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"glob": "**/*",
|
||||||
|
"input": "node_modules/@taiga-ui/icons/src",
|
||||||
|
"output": "assets/taiga-ui/icons"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"glob": "**/*",
|
"glob": "**/*",
|
||||||
"input": "node_modules/@taiga-ui/icons/src",
|
"input": "node_modules/@taiga-ui/icons/src",
|
||||||
|
|||||||
3307
package-lock.json
generated
3307
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@@ -25,15 +25,17 @@
|
|||||||
"@fortawesome/free-solid-svg-icons": "^7.1.0",
|
"@fortawesome/free-solid-svg-icons": "^7.1.0",
|
||||||
"@ngx-translate/core": "^17.0.0",
|
"@ngx-translate/core": "^17.0.0",
|
||||||
"@ngx-translate/http-loader": "^17.0.0",
|
"@ngx-translate/http-loader": "^17.0.0",
|
||||||
"@taiga-ui/addon-charts": "^5.1.0",
|
"@taiga-ui/addon-charts": "^5.25.0",
|
||||||
"@taiga-ui/addon-mobile": "^5.1.0",
|
"@taiga-ui/addon-commerce": "^5.25.0",
|
||||||
"@taiga-ui/addon-table": "^5.1.0",
|
"@taiga-ui/addon-doc": "^5.25.0",
|
||||||
"@taiga-ui/cdk": "^5.1.0",
|
"@taiga-ui/addon-mobile": "^5.25.0",
|
||||||
"@taiga-ui/core": "^5.1.0",
|
"@taiga-ui/addon-table": "^5.25.0",
|
||||||
|
"@taiga-ui/cdk": "^5.25.0",
|
||||||
|
"@taiga-ui/core": "^5.25.0",
|
||||||
"@taiga-ui/i18n": "^5.2.0",
|
"@taiga-ui/i18n": "^5.2.0",
|
||||||
"@taiga-ui/icons": "^5.1.0",
|
"@taiga-ui/icons": "^5.25.0",
|
||||||
"@taiga-ui/kit": "^5.1.0",
|
"@taiga-ui/kit": "^5.25.0",
|
||||||
"@taiga-ui/layout": "^5.1.0",
|
"@taiga-ui/layout": "^5.25.0",
|
||||||
"libphonenumber-js": "^1.12.41",
|
"libphonenumber-js": "^1.12.41",
|
||||||
"ngx-cookie-service": "^21.3.1",
|
"ngx-cookie-service": "^21.3.1",
|
||||||
"rxjs": "~7.8.0",
|
"rxjs": "~7.8.0",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "Chatenium Nexum 3.0 Beta 9 (April 19, 2026)",
|
"version": "Chatenium Nexum 3.0 Beta 11 (October 4, 2026)",
|
||||||
"ok": "Ok",
|
"ok": "Ok",
|
||||||
"back": "Back",
|
"back": "Back",
|
||||||
"aChatProgram": "A messaging platform that you can trust.",
|
"aChatProgram": "A messaging platform that you can trust.",
|
||||||
@@ -218,8 +218,8 @@
|
|||||||
"changeLogDialog": {
|
"changeLogDialog": {
|
||||||
"label": "Chatenium has been updated",
|
"label": "Chatenium has been updated",
|
||||||
"changeLog": {
|
"changeLog": {
|
||||||
"1": "Started implementing user settings, Privacy & Security is now available.",
|
"1": "The network UI have been merged with the left side navigation panel.",
|
||||||
"2": "Enabled Chatenium Pictures on mobile devices."
|
"2": "Categories and channels now have a threaded UI to align with recent changes"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"chatnav": {
|
"chatnav": {
|
||||||
|
|||||||
@@ -1,37 +1,39 @@
|
|||||||
import {provideTaiga} from '@taiga-ui/core';
|
import { provideTaiga } from '@taiga-ui/core';
|
||||||
import {ApplicationConfig, provideBrowserGlobalErrorListeners, isDevMode} from '@angular/core';
|
import { ApplicationConfig, provideBrowserGlobalErrorListeners, isDevMode } from '@angular/core';
|
||||||
import {provideRouter, withRouterConfig} from '@angular/router';
|
import { provideRouter, withRouterConfig } from '@angular/router';
|
||||||
|
|
||||||
import {routes} from './app.routes';
|
import { routes } from './app.routes';
|
||||||
import {provideTranslateService} from '@ngx-translate/core';
|
import { provideTranslateService } from '@ngx-translate/core';
|
||||||
import {provideTranslateHttpLoader} from '@ngx-translate/http-loader';
|
import { provideTranslateHttpLoader } from '@ngx-translate/http-loader';
|
||||||
import {provideServiceWorker} from '@angular/service-worker';
|
import { provideServiceWorker } from '@angular/service-worker';
|
||||||
import {tuiInputPhoneInternationalOptionsProvider} from '@taiga-ui/kit';
|
import { tuiInputPhoneInternationalOptionsProvider } from '@taiga-ui/kit';
|
||||||
import {defer} from 'rxjs';
|
import { defer } from 'rxjs';
|
||||||
|
|
||||||
export const appConfig: ApplicationConfig = {
|
export const appConfig: ApplicationConfig = {
|
||||||
providers: [
|
providers: [
|
||||||
provideBrowserGlobalErrorListeners(),
|
provideBrowserGlobalErrorListeners(),
|
||||||
provideRouter(routes, withRouterConfig({
|
provideRouter(
|
||||||
paramsInheritanceStrategy: "always"
|
routes,
|
||||||
})),
|
withRouterConfig({
|
||||||
|
paramsInheritanceStrategy: 'always',
|
||||||
|
}),
|
||||||
|
),
|
||||||
provideTaiga(),
|
provideTaiga(),
|
||||||
provideTranslateService({
|
provideTranslateService({
|
||||||
fallbackLang: "en",
|
fallbackLang: 'en',
|
||||||
lang: "hu",
|
lang: 'hu',
|
||||||
loader: provideTranslateHttpLoader({
|
loader: provideTranslateHttpLoader({
|
||||||
prefix: "/i18n/",
|
prefix: '/i18n/',
|
||||||
suffix: ".json"
|
suffix: '.json',
|
||||||
})
|
}),
|
||||||
}),
|
}),
|
||||||
provideServiceWorker('ngsw-worker.js', {
|
provideServiceWorker('ngsw-worker.js', {
|
||||||
enabled: !isDevMode(),
|
enabled: !isDevMode(),
|
||||||
registrationStrategy: 'registerWhenStable:30000'
|
registrationStrategy: 'registerWhenStable:30000',
|
||||||
}),
|
}),
|
||||||
tuiInputPhoneInternationalOptionsProvider({
|
tuiInputPhoneInternationalOptionsProvider({
|
||||||
metadata: defer(async () =>
|
metadata: defer(async () => import('libphonenumber-js/max/metadata').then((m) => m.default)),
|
||||||
import('libphonenumber-js/max/metadata').then((m) => m.default),
|
|
||||||
),
|
|
||||||
}),
|
}),
|
||||||
|
provideTaiga(),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,30 +1,29 @@
|
|||||||
import {Routes} from '@angular/router';
|
import { Routes } from '@angular/router';
|
||||||
import {SignIn} from './signin/signin';
|
import { SignIn } from './signin/signin';
|
||||||
import {Chat} from './chat/chat';
|
import { Chat } from './chat/chat';
|
||||||
import {Dm} from './chat/dm/dm';
|
import { Dm } from './chat/dm/dm';
|
||||||
import {noAuthGuard} from './guards/no-auth-guard';
|
import { noAuthGuard } from './guards/no-auth-guard';
|
||||||
import {authNeededGuard} from './guards/auth-needed-guard';
|
import { authNeededGuard } from './guards/auth-needed-guard';
|
||||||
import {Homepage} from './homepage/homepage';
|
import { Homepage } from './homepage/homepage';
|
||||||
import {Privacy} from './privacy/privacy';
|
import { Privacy } from './privacy/privacy';
|
||||||
import {TOS} from './tos/tos';
|
import { TOS } from './tos/tos';
|
||||||
import {Network} from './chat/network/network';
|
import { Network } from './chat/network/network';
|
||||||
import {Text} from './chat/network/channel/text/text';
|
import { Text } from './chat/network/channel/text/text';
|
||||||
import {See} from './chat/picture/see/see';
|
import { See } from './chat/picture/see/see';
|
||||||
|
|
||||||
export const routes: Routes = [
|
export const routes: Routes = [
|
||||||
{path: '', component: Homepage},
|
{ path: '', component: Homepage },
|
||||||
{path: 'privacy', component: Privacy},
|
{ path: 'privacy', component: Privacy },
|
||||||
{path: 'tos', component: TOS},
|
{ path: 'tos', component: TOS },
|
||||||
{path: 'signin', component: SignIn, canActivate: [noAuthGuard]},
|
{ path: 'signin', component: SignIn, canActivate: [noAuthGuard] },
|
||||||
{
|
{
|
||||||
path: 'chat', component: Chat, canActivate: [authNeededGuard], children: [
|
path: 'chat',
|
||||||
{path: 'dm/:chatid', component: Dm},
|
component: Chat,
|
||||||
{path: 'picture/:uploaderId', component: See},
|
canActivate: [authNeededGuard],
|
||||||
{
|
children: [
|
||||||
path: 'network/:networkId', component: Network, children: [
|
{ path: 'dm/:chatid', component: Dm },
|
||||||
{path: ":categoryId/:channelId", component: Text}
|
{ path: 'picture/:uploaderId', component: See },
|
||||||
]
|
{ path: 'network/:networkId/:categoryId/:channelId', component: Text },
|
||||||
},
|
],
|
||||||
]
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
import { TuiRoot } from '@taiga-ui/core';
|
import { TuiRoot } from '@taiga-ui/core';
|
||||||
import {Component, inject, OnInit, signal} from '@angular/core';
|
import { Component, inject, OnInit, signal } from '@angular/core';
|
||||||
import { RouterOutlet } from '@angular/router';
|
import { RouterOutlet } from '@angular/router';
|
||||||
import { environment as env } from '../environments/environment';
|
import { environment as env } from '../environments/environment';
|
||||||
import {environment, SDKConfig} from '@chatenium/chatenium-sdk/core/environment';
|
import { environment, SDKConfig } from '@chatenium/chatenium-sdk/core/environment';
|
||||||
import {IndexedDB} from './storage/indexed-db';
|
import { IndexedDB } from './storage/indexed-db';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
imports: [RouterOutlet, TuiRoot],
|
imports: [RouterOutlet, TuiRoot, TuiRoot],
|
||||||
templateUrl: './app.html',
|
templateUrl: './app.html',
|
||||||
styleUrl: './app.scss',
|
styleUrl: './app.scss',
|
||||||
})
|
})
|
||||||
export class App implements OnInit {
|
export class App implements OnInit {
|
||||||
indexedDb = inject(IndexedDB)
|
indexedDb = inject(IndexedDB);
|
||||||
|
|
||||||
protected readonly title = signal('Chatenium-On-Web');
|
protected readonly title = signal('Chatenium-On-Web');
|
||||||
|
|
||||||
|
|||||||
@@ -11,33 +11,35 @@
|
|||||||
</button>
|
</button>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
<ng-template [(tuiDialog)]="userSettingsOpen" [tuiDialogOptions]="{closable: false, appearance: 'taiga big'}" class="user-settings">
|
<ng-template [(tuiDialog)]="userSettingsOpen" [tuiDialogOptions]="{closable: false, appearance: 'taiga big'}"
|
||||||
<user-settings (close)="userSettingsOpen.set(false)"/>
|
class="user-settings">
|
||||||
|
<user-settings (close)="userSettingsOpen.set(false)" />
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
@if (serviceManager.currentSession() == null) {
|
@if (serviceManager.currentSession() == null) {
|
||||||
<main style="width: 100%; height: 100svh; display: flex; justify-content: center; align-items: center;">
|
<main style="width: 100%; height: 100svh; display: flex; justify-content: center; align-items: center;">
|
||||||
<tui-loader size="xl"/>
|
<tui-loader size="xl" />
|
||||||
</main>
|
</main>
|
||||||
} @else {
|
} @else {
|
||||||
@if (breakpoint() != "mobile") {
|
@if (breakpoint() != "mobile") {
|
||||||
<main id="layout" tuiGroup [collapsed]="true">
|
<main id="layout" tuiGroup [collapsed]="true" [class.expanded]="expandedSidenav()">
|
||||||
<aside id="chatnav">
|
<aside id="chatnav">
|
||||||
<aside>
|
<aside>
|
||||||
<tui-segmented id="mode_switcher" [(activeItemIndex)]="navigationActiveIndex">
|
<tui-segmented id="mode_switcher" [(activeItemIndex)]="navigationActiveIndex">
|
||||||
<button>
|
<button (click)="expandedSidenav.set(false)">
|
||||||
<tui-icon icon="@tui.message-circle"/>
|
<tui-icon icon="@tui.message-circle" />
|
||||||
</button>
|
</button>
|
||||||
<button>
|
<button>
|
||||||
<tui-icon icon="@tui.network"/>
|
<tui-icon icon="@tui.network" />
|
||||||
</button>
|
</button>
|
||||||
<button>
|
<button (click)="expandedSidenav.set(false)">
|
||||||
<tui-icon icon="@tui.image"/>
|
<tui-icon icon="@tui.image" />
|
||||||
</button>
|
</button>
|
||||||
</tui-segmented>
|
</tui-segmented>
|
||||||
|
|
||||||
<button id="bottom_btn" tuiButton [appearance]="userSettingsOpen() ? 'primary' : 'flat'" (click)="userSettingsOpen.set(true)">
|
<button id="bottom_btn" tuiButton [appearance]="userSettingsOpen() ? 'primary' : 'flat'"
|
||||||
<tui-icon icon="@tui.cog"/>
|
(click)="userSettingsOpen.set(true)">
|
||||||
|
<tui-icon icon="@tui.cog" />
|
||||||
</button>
|
</button>
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
@@ -48,12 +50,14 @@
|
|||||||
[userid]="serviceManager.currentSession()!.userData.userid"></app-dm-list>
|
[userid]="serviceManager.currentSession()!.userData.userid"></app-dm-list>
|
||||||
}
|
}
|
||||||
@case (1) {
|
@case (1) {
|
||||||
<network-list [token]="serviceManager.currentSession()!.token"
|
<network-list
|
||||||
[userid]="serviceManager.currentSession()!.userData.userid"></network-list>
|
[(expandedSidenav)]="expandedSidenav"
|
||||||
|
[token]="serviceManager.currentSession()!.token"
|
||||||
|
[userid]="serviceManager.currentSession()!.userData.userid"></network-list>
|
||||||
}
|
}
|
||||||
@case (2) {
|
@case (2) {
|
||||||
<app-picture-list [token]="serviceManager.currentSession()!.token"
|
<app-picture-list [token]="serviceManager.currentSession()!.token"
|
||||||
[userid]="serviceManager.currentSession()!.userData.userid"></app-picture-list>
|
[userid]="serviceManager.currentSession()!.userData.userid"></app-picture-list>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</main>
|
</main>
|
||||||
@@ -64,14 +68,14 @@
|
|||||||
@if (router.url.startsWith("/chat/dm") || router.url.startsWith("/chat/picture")) {
|
@if (router.url.startsWith("/chat/dm") || router.url.startsWith("/chat/picture")) {
|
||||||
<!-- To ensure data is loaded -->
|
<!-- To ensure data is loaded -->
|
||||||
@defer (when serviceManager.chatsStatus() != LoadStatus.loading) {
|
@defer (when serviceManager.chatsStatus() != LoadStatus.loading) {
|
||||||
<router-outlet/>
|
<router-outlet />
|
||||||
}
|
}
|
||||||
} @else if (router.url.startsWith("/chat/network")) {
|
} @else if (router.url.startsWith("/chat/network")) {
|
||||||
@defer (when serviceManager.networksStatus() != LoadStatus.loading) {
|
@defer (when serviceManager.networksStatus() != LoadStatus.loading) {
|
||||||
<router-outlet/>
|
<router-outlet />
|
||||||
}
|
}
|
||||||
} @else {
|
} @else {
|
||||||
<router-outlet/>
|
<router-outlet />
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
@@ -87,15 +91,17 @@
|
|||||||
[userid]="serviceManager.currentSession()!.userData.userid"></app-dm-list>
|
[userid]="serviceManager.currentSession()!.userData.userid"></app-dm-list>
|
||||||
}
|
}
|
||||||
@case (1) {
|
@case (1) {
|
||||||
<network-list [token]="serviceManager.currentSession()!.token"
|
<network-list
|
||||||
[userid]="serviceManager.currentSession()!.userData.userid"></network-list>
|
[(expandedSidenav)]="expandedSidenav"
|
||||||
|
[token]="serviceManager.currentSession()!.token"
|
||||||
|
[userid]="serviceManager.currentSession()!.userData.userid"></network-list>
|
||||||
}
|
}
|
||||||
@case (2) {
|
@case (2) {
|
||||||
<app-picture-list [token]="serviceManager.currentSession()!.token"
|
<app-picture-list [token]="serviceManager.currentSession()!.token"
|
||||||
[userid]="serviceManager.currentSession()!.userData.userid"></app-picture-list>
|
[userid]="serviceManager.currentSession()!.userData.userid"></app-picture-list>
|
||||||
}
|
}
|
||||||
@case (3) {
|
@case (3) {
|
||||||
<user-settings/>
|
<user-settings />
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@@ -120,14 +126,14 @@
|
|||||||
@if (router.url.startsWith("/chat/dm") || router.url.startsWith("/chat/picture")) {
|
@if (router.url.startsWith("/chat/dm") || router.url.startsWith("/chat/picture")) {
|
||||||
<!-- To ensure data is loaded -->
|
<!-- To ensure data is loaded -->
|
||||||
@defer (when serviceManager.chatsStatus() != LoadStatus.loading) {
|
@defer (when serviceManager.chatsStatus() != LoadStatus.loading) {
|
||||||
<router-outlet (activate)="routerOutletActive.set(true)" (deactivate)="routerOutletActive.set(false)"/>
|
<router-outlet (activate)="routerOutletActive.set(true)" (deactivate)="routerOutletActive.set(false)" />
|
||||||
}
|
}
|
||||||
} @else if (router.url.startsWith("/chat/network")) {
|
} @else if (router.url.startsWith("/chat/network")) {
|
||||||
@defer (when serviceManager.networksStatus() != LoadStatus.loading) {
|
@defer (when serviceManager.networksStatus() != LoadStatus.loading) {
|
||||||
<router-outlet (activate)="routerOutletActive.set(true)" (deactivate)="routerOutletActive.set(false)"/>
|
<router-outlet (activate)="routerOutletActive.set(true)" (deactivate)="routerOutletActive.set(false)" />
|
||||||
}
|
}
|
||||||
} @else {
|
} @else {
|
||||||
<router-outlet (activate)="routerOutletActive.set(true)" (deactivate)="routerOutletActive.set(false)"/>
|
<router-outlet (activate)="routerOutletActive.set(true)" (deactivate)="routerOutletActive.set(false)" />
|
||||||
}
|
}
|
||||||
</main>
|
</main>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
#layout {
|
#layout {
|
||||||
|
transition: 0.3s ease;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 350px minmax(0, 1fr);
|
grid-template-columns: 350px minmax(0, 1fr);
|
||||||
height: 100svh;
|
height: 100svh;
|
||||||
overflow: hidden;
|
|
||||||
|
&.expanded {
|
||||||
|
grid-template-columns: 450px minmax(0, 1fr) !important;
|
||||||
|
}
|
||||||
|
|
||||||
#chatnav {
|
#chatnav {
|
||||||
display: grid;
|
display: grid;
|
||||||
@@ -44,11 +48,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
|
overflow-y: scroll;
|
||||||
|
overflow-x: hidden;
|
||||||
background: var(--tui-background-base-alt);
|
background: var(--tui-background-base-alt);
|
||||||
border-radius: 20px 0 0 20px;
|
border-radius: 20px 0 0 20px;
|
||||||
margin: 10px 0 10px 10px;
|
margin: 10px 0 10px 10px;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
overflow-y: scroll;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ export class Chat implements OnInit {
|
|||||||
breakpoint = inject(TUI_BREAKPOINT)
|
breakpoint = inject(TUI_BREAKPOINT)
|
||||||
router = inject(Router)
|
router = inject(Router)
|
||||||
|
|
||||||
|
expandedSidenav = signal(false)
|
||||||
|
|
||||||
routerOutletActive = signal(false)
|
routerOutletActive = signal(false)
|
||||||
userSettingsOpen = signal(false)
|
userSettingsOpen = signal(false)
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ export class Dm implements OnInit {
|
|||||||
|
|
||||||
async sendMessage(message: string, files: FileDataWithPreview[] | null) {
|
async sendMessage(message: string, files: FileDataWithPreview[] | null) {
|
||||||
if (!files && message.trim() == "") return
|
if (!files && message.trim() == "") return
|
||||||
this.scrollToBottom("smooth")
|
|
||||||
|
|
||||||
const session = this.serviceManager.currentSession();
|
const session = this.serviceManager.currentSession();
|
||||||
if (session != null) {
|
if (session != null) {
|
||||||
@@ -102,14 +101,13 @@ export class Dm implements OnInit {
|
|||||||
forwardedFromName: ""
|
forwardedFromName: ""
|
||||||
}])
|
}])
|
||||||
|
|
||||||
this.scrollToBottom("smooth")
|
|
||||||
|
|
||||||
const respMessage = await this.store.service.sendMessage(tempMsgId, message, null, null, files, <FileUploadProgressListener>{
|
const respMessage = await this.store.service.sendMessage(tempMsgId, message, null, null, files, <FileUploadProgressListener>{
|
||||||
fileProgressUpdate: (tempMsgId, fileId, allChunks, chunksDone) => {
|
fileProgressUpdate: (tempMsgId, fileId, allChunks, chunksDone) => {
|
||||||
this.uploadProgressUpdate(tempMsgId, fileId, allChunks, chunksDone)
|
this.uploadProgressUpdate(tempMsgId, fileId, allChunks, chunksDone)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.updateTempMessage(tempMsgId, respMessage)
|
this.updateTempMessage(tempMsgId, respMessage)
|
||||||
|
this.scrollToBottom("smooth")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,13 +124,13 @@ export class Dm implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollToBottom(anim: 'instant' | 'smooth'): void {
|
restoreScrollState(): void {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const scrollContainer = <HTMLDivElement>document.querySelector("#scrollContainer")
|
const scrollContainer = <HTMLDivElement>document.querySelector("#scrollContainer")
|
||||||
scrollContainer.scroll({
|
scrollContainer.scroll({
|
||||||
top: this.store.messagesVm.scrollBarStatus() == -1 ? scrollContainer.scrollHeight : this.store.messagesVm.scrollBarStatus(),
|
top: this.store.messagesVm.scrollBarStatus() == -1 ? scrollContainer.scrollHeight : this.store.messagesVm.scrollBarStatus(),
|
||||||
left: 0,
|
left: 0,
|
||||||
behavior: anim
|
behavior: "instant"
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.store.messagesVm.scrollBarStatus() == -1) {
|
if (this.store.messagesVm.scrollBarStatus() == -1) {
|
||||||
@@ -141,6 +139,17 @@ export class Dm implements OnInit {
|
|||||||
}, 0)
|
}, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scrollToBottom(anim: 'instant' | 'smooth'): void {
|
||||||
|
setTimeout(() => {
|
||||||
|
const scrollContainer = <HTMLDivElement>document.querySelector("#scrollContainer")
|
||||||
|
scrollContainer.scroll({
|
||||||
|
top: scrollContainer.scrollHeight,
|
||||||
|
left: 0,
|
||||||
|
behavior: anim
|
||||||
|
});
|
||||||
|
}, 0)
|
||||||
|
}
|
||||||
|
|
||||||
handleMessagesScroll(e: any) {
|
handleMessagesScroll(e: any) {
|
||||||
this.store.messagesVm.scrollBarStatus.set(e.target.scrollTop)
|
this.store.messagesVm.scrollBarStatus.set(e.target.scrollTop)
|
||||||
}
|
}
|
||||||
@@ -241,18 +250,18 @@ export class Dm implements OnInit {
|
|||||||
const messagesCache = await currentStore.service.getQuick();
|
const messagesCache = await currentStore.service.getQuick();
|
||||||
currentStore.messages.set(messagesCache);
|
currentStore.messages.set(messagesCache);
|
||||||
this.store.messagesStatus.set(LoadStatus.updating)
|
this.store.messagesStatus.set(LoadStatus.updating)
|
||||||
this.scrollToBottom("instant")
|
this.restoreScrollState()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn(`Cache load failed: ${e}. Skipping cache load...`)
|
console.warn(`Cache load failed: ${e}. Skipping cache load...`)
|
||||||
}
|
}
|
||||||
const messages = await currentStore.service.get();
|
const messages = await currentStore.service.get();
|
||||||
currentStore.messages.set(messages);
|
currentStore.messages.set(messages);
|
||||||
this.store.messagesStatus.set(LoadStatus.loaded)
|
this.store.messagesStatus.set(LoadStatus.loaded)
|
||||||
this.scrollToBottom("instant")
|
this.restoreScrollState()
|
||||||
|
|
||||||
await currentStore.service.joinWebSocketRoom();
|
await currentStore.service.joinWebSocketRoom();
|
||||||
} else {
|
} else {
|
||||||
this.scrollToBottom("instant")
|
this.restoreScrollState()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,35 @@
|
|||||||
<button disabled tuiButton appearance="secondary" iconStart="@tui.plus">
|
<div id="holder" [class.networkActive]="selectedNetwork() != null">
|
||||||
{{ "chat.chatnav.networkList.newNetwork"|translate }}
|
<div id="networks">
|
||||||
</button>
|
<button disabled tuiButton appearance="secondary" iconStart="@tui.plus">
|
||||||
@if (serviceManager.networksStatus() == LoadStatus.updating) {
|
{{ "chat.chatnav.networkList.newNetwork"|translate }}
|
||||||
<div id="loader">
|
</button>
|
||||||
<tui-loader />
|
@if (serviceManager.networksStatus() == LoadStatus.updating) {
|
||||||
{{"updating"|translate}}
|
<div id="loader">
|
||||||
|
<tui-loader />
|
||||||
|
{{"updating"|translate}}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
@for (network of serviceManager.networks(); track network.networkId) {
|
||||||
|
<button [class.enlarge]="breakpoint() == 'mobile'" tuiButton
|
||||||
|
appearance="flat"
|
||||||
|
(click)="selectNetwork(network)">
|
||||||
|
<oimg [src]="network.picture" height="35px" width="35px" [radius]="10"></oimg>
|
||||||
|
<div class="info">
|
||||||
|
<span>{{ network.name }}</span>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
}
|
|
||||||
@for (network of serviceManager.networks(); track network.networkId) {
|
<div id="network">
|
||||||
<button [class.enlarge]="breakpoint() == 'mobile'" tuiButton
|
<div style="display: flex; align-items: center; gap: 1rem;">
|
||||||
[appearance]="router.url.startsWith('/chat/network/' + network.networkId) ? 'primary' : 'flat'"
|
<button tuiButton appearance="secondary" iconStart="@tui.arrow-left" (click)="selectNetwork(null)"></button>
|
||||||
[routerLink]="'/chat/network/' + network.networkId">
|
@if (selectedNetwork() != null) {
|
||||||
<oimg [src]="network.picture" height="35px" width="35px" [radius]="10"></oimg>
|
<oimg [src]="selectedNetwork()!.picture" height="35px" width="35px" [radius]="15"></oimg>
|
||||||
<div class="info">
|
<h3>{{ selectedNetwork()!.name }}</h3>
|
||||||
<span>{{ network.name }}</span>
|
}
|
||||||
</div>
|
</div>
|
||||||
</button>
|
<network [network]="selectedNetwork()!"></network>
|
||||||
}
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,28 +1,68 @@
|
|||||||
:host {
|
#holder {
|
||||||
display: flex;
|
position: relative;
|
||||||
flex-direction: column;
|
|
||||||
gap: 5px;
|
|
||||||
|
|
||||||
button {
|
&.networkActive {
|
||||||
width: 100%;
|
#networks {
|
||||||
display: flex;
|
transform: translateX(100px);
|
||||||
justify-content: start;
|
opacity: 0;
|
||||||
font-weight: 600;
|
pointer-events: none;
|
||||||
|
|
||||||
&.enlarge {
|
|
||||||
height: 75px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.info {
|
#network {
|
||||||
display: flex;
|
pointer-events: all;
|
||||||
flex-direction: column;
|
transform: translateX(0);
|
||||||
text-align: start;
|
opacity: 1;
|
||||||
|
|
||||||
.latest_message {
|
network {
|
||||||
margin-top: -5px;
|
display: block;
|
||||||
font-size: 12px;
|
|
||||||
opacity: 50%;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#networks {
|
||||||
|
transition: 0.3s;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 5px;
|
||||||
|
|
||||||
|
button {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: start;
|
||||||
|
font-weight: 600;
|
||||||
|
|
||||||
|
&.enlarge {
|
||||||
|
height: 75px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
text-align: start;
|
||||||
|
|
||||||
|
.latest_message {
|
||||||
|
margin-top: -5px;
|
||||||
|
font-size: 12px;
|
||||||
|
opacity: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#network {
|
||||||
|
pointer-events: none;
|
||||||
|
transform: translateX(-100px);
|
||||||
|
opacity: 0;
|
||||||
|
transition: 0.2s;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {Component, inject, input, OnInit} from '@angular/core';
|
import { Component, inject, input, model, OnInit, signal } from '@angular/core';
|
||||||
import {IndexedDB} from '../../storage/indexed-db';
|
import {IndexedDB} from '../../storage/indexed-db';
|
||||||
import {Router, RouterLink} from '@angular/router';
|
import {Router, RouterLink} from '@angular/router';
|
||||||
import {LoadStatus, ServiceManager} from '../../service-manager';
|
import {LoadStatus, ServiceManager} from '../../service-manager';
|
||||||
@@ -6,43 +6,53 @@ import {TUI_BREAKPOINT, TuiButton, TuiLoader} from '@taiga-ui/core';
|
|||||||
import {NetworkService} from '@chatenium/chatenium-sdk/services/networkService';
|
import {NetworkService} from '@chatenium/chatenium-sdk/services/networkService';
|
||||||
import {Oimg} from '../elements/oimg/oimg';
|
import {Oimg} from '../elements/oimg/oimg';
|
||||||
import {TranslatePipe} from '@ngx-translate/core';
|
import {TranslatePipe} from '@ngx-translate/core';
|
||||||
|
import { Network as NetworkData } from '@chatenium/chatenium-sdk/domain/networkService.schema';
|
||||||
|
import { Network } from '../network/network';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'network-list',
|
selector: 'network-list',
|
||||||
imports: [
|
imports: [Oimg, TranslatePipe, TuiButton, TuiLoader, Network],
|
||||||
Oimg,
|
|
||||||
TranslatePipe,
|
|
||||||
TuiButton,
|
|
||||||
RouterLink,
|
|
||||||
TuiLoader
|
|
||||||
],
|
|
||||||
templateUrl: './network-list.html',
|
templateUrl: './network-list.html',
|
||||||
styleUrl: './network-list.scss',
|
styleUrl: './network-list.scss',
|
||||||
})
|
})
|
||||||
export class NetworkList implements OnInit {
|
export class NetworkList implements OnInit {
|
||||||
userid = input<string>("")
|
userid = input<string>('');
|
||||||
token = input<string>("")
|
token = input<string>('');
|
||||||
|
expandedSidenav = model.required<boolean>();
|
||||||
|
|
||||||
indexedDb = inject(IndexedDB)
|
selectedNetwork = signal<NetworkData | null>(null);
|
||||||
router = inject(Router)
|
|
||||||
serviceManager = inject(ServiceManager)
|
indexedDb = inject(IndexedDB);
|
||||||
breakpoint = inject(TUI_BREAKPOINT)
|
router = inject(Router);
|
||||||
|
serviceManager = inject(ServiceManager);
|
||||||
|
breakpoint = inject(TUI_BREAKPOINT);
|
||||||
|
|
||||||
|
selectNetwork(network: NetworkData | null) {
|
||||||
|
this.selectedNetwork.set(network);
|
||||||
|
this.expandedSidenav.set(network !== null);
|
||||||
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.serviceManager.networkService = new NetworkService(this.userid(), this.token(), "", this.indexedDb.getApi(), () => {})
|
this.serviceManager.networkService = new NetworkService(
|
||||||
|
this.userid(),
|
||||||
|
this.token(),
|
||||||
|
'',
|
||||||
|
this.indexedDb.getApi(),
|
||||||
|
() => {},
|
||||||
|
);
|
||||||
if (this.serviceManager.networksStatus() != LoadStatus.loaded) {
|
if (this.serviceManager.networksStatus() != LoadStatus.loaded) {
|
||||||
try {
|
try {
|
||||||
this.serviceManager.networks.set(await this.serviceManager.networkService.getQuick())
|
this.serviceManager.networks.set(await this.serviceManager.networkService.getQuick());
|
||||||
this.serviceManager.networksStatus.set(LoadStatus.updating)
|
this.serviceManager.networksStatus.set(LoadStatus.updating);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn(`Cache load failed: ${e}. Skipping cache load...`)
|
console.warn(`Cache load failed: ${e}. Skipping cache load...`);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
this.serviceManager.networks.set(await this.serviceManager.networkService.get())
|
this.serviceManager.networks.set(await this.serviceManager.networkService.get());
|
||||||
this.serviceManager.networksStatus.set(LoadStatus.loaded)
|
this.serviceManager.networksStatus.set(LoadStatus.loaded);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e);
|
||||||
this.serviceManager.networksStatus.set(LoadStatus.error)
|
this.serviceManager.networksStatus.set(LoadStatus.error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,14 +116,13 @@ export class Text {
|
|||||||
forwardedFromName: ""
|
forwardedFromName: ""
|
||||||
}])
|
}])
|
||||||
|
|
||||||
this.scrollToBottom("smooth")
|
|
||||||
|
|
||||||
const respMessage = await this.store.service.sendMessage(tempMsgId, message, null, null, files, <FileUploadProgressListener>{
|
const respMessage = await this.store.service.sendMessage(tempMsgId, message, null, null, files, <FileUploadProgressListener>{
|
||||||
fileProgressUpdate: (tempMsgId, fileId, allChunks, chunksDone) => {
|
fileProgressUpdate: (tempMsgId, fileId, allChunks, chunksDone) => {
|
||||||
this.uploadProgressUpdate(tempMsgId, fileId, allChunks, chunksDone)
|
this.uploadProgressUpdate(tempMsgId, fileId, allChunks, chunksDone)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.updateTempMessage(tempMsgId, respMessage)
|
this.updateTempMessage(tempMsgId, respMessage)
|
||||||
|
this.scrollToBottom("smooth")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,7 +140,7 @@ export class Text {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollToBottom(anim: 'instant' | 'smooth'): void {
|
restoreScrollState() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (!this.store) {
|
if (!this.store) {
|
||||||
return
|
return
|
||||||
@@ -150,7 +149,7 @@ export class Text {
|
|||||||
scrollContainer.scroll({
|
scrollContainer.scroll({
|
||||||
top: this.store.messagesVm.scrollBarStatus() == -1 ? scrollContainer.scrollHeight : this.store.messagesVm.scrollBarStatus(),
|
top: this.store.messagesVm.scrollBarStatus() == -1 ? scrollContainer.scrollHeight : this.store.messagesVm.scrollBarStatus(),
|
||||||
left: 0,
|
left: 0,
|
||||||
behavior: anim
|
behavior: "instant"
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.store.messagesVm.scrollBarStatus() == -1) {
|
if (this.store.messagesVm.scrollBarStatus() == -1) {
|
||||||
@@ -159,6 +158,17 @@ export class Text {
|
|||||||
}, 0)
|
}, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scrollToBottom(anim: 'instant' | 'smooth'): void {
|
||||||
|
setTimeout(() => {
|
||||||
|
const scrollContainer = <HTMLDivElement>document.querySelector("#scrollContainer")
|
||||||
|
scrollContainer.scroll({
|
||||||
|
top: scrollContainer.scrollHeight,
|
||||||
|
left: 0,
|
||||||
|
behavior: anim
|
||||||
|
});
|
||||||
|
}, 0)
|
||||||
|
}
|
||||||
|
|
||||||
handleMessagesScroll(e: any) {
|
handleMessagesScroll(e: any) {
|
||||||
if (!this.store) return
|
if (!this.store) return
|
||||||
this.store.messagesVm.scrollBarStatus.set(e.target.scrollTop)
|
this.store.messagesVm.scrollBarStatus.set(e.target.scrollTop)
|
||||||
@@ -282,7 +292,7 @@ export class Text {
|
|||||||
try {
|
try {
|
||||||
const messagesCache = await currentStore.service.getQuick();
|
const messagesCache = await currentStore.service.getQuick();
|
||||||
currentStore.messages.set(messagesCache);
|
currentStore.messages.set(messagesCache);
|
||||||
this.scrollToBottom("instant")
|
this.restoreScrollState()
|
||||||
currentStore.messagesStatus.set(LoadStatus.updating)
|
currentStore.messagesStatus.set(LoadStatus.updating)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn(`Cache load failed: ${e}. Skipping cache load...`)
|
console.warn(`Cache load failed: ${e}. Skipping cache load...`)
|
||||||
@@ -290,11 +300,11 @@ export class Text {
|
|||||||
const messages = await currentStore.service.get();
|
const messages = await currentStore.service.get();
|
||||||
currentStore.messages.set(messages);
|
currentStore.messages.set(messages);
|
||||||
currentStore.messagesStatus.set(LoadStatus.loaded)
|
currentStore.messagesStatus.set(LoadStatus.loaded)
|
||||||
this.scrollToBottom("instant")
|
this.restoreScrollState()
|
||||||
|
|
||||||
await currentStore.service.joinWebSocketRoom();
|
await currentStore.service.joinWebSocketRoom();
|
||||||
} else {
|
} else {
|
||||||
this.scrollToBottom("instant")
|
this.restoreScrollState()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,82 +1,43 @@
|
|||||||
@defer(when store) {
|
@defer (when store) {
|
||||||
<div id="layout" [class.routerOutletActive]="routerOutletActive()" [class.hideNetworkNav]="routerOutletActive() && breakpoint() == 'desktopSmall'">
|
<div id="layout" [class.routerOutletActive]="routerOutletActive()"
|
||||||
<div id="router">
|
[class.hideNetworkNav]="routerOutletActive() && breakpoint() == 'desktopSmall'">
|
||||||
<router-outlet (activate)="routerOutletActive.set(true)" (deactivate)="routerOutletActive.set(false)"></router-outlet>
|
|
||||||
</div>
|
|
||||||
<div id="network-data">
|
<div id="network-data">
|
||||||
<navbar backButtonDest="/chat" dataAlignment="center">
|
<main tuiGroup orientation="vertical" style="width: 100%; height: 80svh">
|
||||||
<div class="data">
|
@for (category of store.networkData().categories; track category) {
|
||||||
<oimg [src]="store.networkData().picture" height="50px" width="50px" [radius]="15"></oimg>
|
<div class="category">
|
||||||
<h2>{{store.networkData().name}}</h2>
|
<h2>{{ category.name }}</h2>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="items-right"></div>
|
<div class="channels">
|
||||||
</navbar>
|
@for (channel of category.channels; track channel) {
|
||||||
|
<div class="channel">
|
||||||
<tui-tabs [(activeItemIndex)]="tabActiveIndex">
|
<button tuiButton
|
||||||
<button
|
[appearance]="router.url.endsWith(channel.channelId) ? 'secondary' : 'flat'"
|
||||||
iconStart="@tui.hash"
|
[disabled]="channel.type != 'message'"
|
||||||
tuiTab
|
[routerLink]="'/chat/network/'+store.networkData().networkId+'/'+category.categoryId+'/'+channel.channelId">
|
||||||
type="button"
|
@switch (channel.type) {
|
||||||
>
|
@case ("message") {
|
||||||
{{"chat.network.tabs.channels"|translate}}
|
<tui-icon icon="@tui.hash"></tui-icon>
|
||||||
</button>
|
|
||||||
|
|
||||||
<button
|
|
||||||
disabled
|
|
||||||
iconStart="@tui.users"
|
|
||||||
tuiTab
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
{{"chat.network.tabs.members"|translate}}
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button
|
|
||||||
iconStart="@tui.cog"
|
|
||||||
tuiTab
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
{{"chat.network.tabs.settings"|translate}}
|
|
||||||
</button>
|
|
||||||
</tui-tabs>
|
|
||||||
|
|
||||||
<br/>
|
|
||||||
|
|
||||||
@switch (tabActiveIndex) {
|
|
||||||
@case (0) {
|
|
||||||
<main tuiGroup orientation="vertical" style="width: 100%">
|
|
||||||
@for (category of store.networkData().categories; track category) {
|
|
||||||
<div class="category">
|
|
||||||
<h2>{{category.name}}</h2>
|
|
||||||
|
|
||||||
<div tuiGroup orientation="vertical" style="width: 100%">
|
|
||||||
@for (channel of category.channels; track channel) {
|
|
||||||
<button tuiButton class="channel" [appearance]="router.url.endsWith(channel.channelId) ? 'primary' : 'secondary'" [disabled]="channel.type != 'message'" [routerLink]="'/chat/network/'+store.networkData().networkId+'/'+category.categoryId+'/'+channel.channelId">
|
|
||||||
@switch (channel.type) {
|
|
||||||
@case ("message") {
|
|
||||||
<tui-icon icon="@tui.hash"></tui-icon>
|
|
||||||
}
|
|
||||||
@case ("broadcast") {
|
|
||||||
<tui-icon icon="@tui.radio"></tui-icon>
|
|
||||||
}
|
|
||||||
@case ("voice") {
|
|
||||||
<tui-icon icon="@tui.audio-lines"></tui-icon>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
<span>{{channel.name}}</span>
|
@case ("broadcast") {
|
||||||
</button>
|
<tui-icon icon="@tui.radio"></tui-icon>
|
||||||
}
|
}
|
||||||
|
@case ("voice") {
|
||||||
|
<tui-icon icon="@tui.audio-lines"></tui-icon>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<span>{{ channel.name }}</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
}
|
</div>
|
||||||
</main>
|
</div>
|
||||||
}
|
}
|
||||||
@case (2) {
|
</main>
|
||||||
<main id="settings">
|
<!-- @case (2) {
|
||||||
<network-settings [networkStore]="this.store"></network-settings>
|
<main id="settings">
|
||||||
</main>
|
<network-settings [networkStore]="this.store"></network-settings>
|
||||||
}
|
</main>
|
||||||
}
|
}-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 0 100%;
|
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
transition: 0.2s;
|
transition: 0.2s;
|
||||||
@@ -13,20 +11,6 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.routerOutletActive {
|
|
||||||
overflow-y: hidden;
|
|
||||||
padding: 0;
|
|
||||||
grid-template-columns: 1fr 300px;
|
|
||||||
|
|
||||||
#router {
|
|
||||||
background: var(--tui-background-neutral-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
main {
|
|
||||||
padding: 15px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.hideNetworkNav {
|
&.hideNetworkNav {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
|
|
||||||
@@ -38,7 +22,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.category {
|
.category {
|
||||||
background: var(--tui-background-base-alt);
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
|
|
||||||
@@ -46,6 +29,31 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: start;
|
justify-content: start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.channels {
|
||||||
|
position: relative;
|
||||||
|
padding-left: 24px; /* Space for the line and spacing */
|
||||||
|
border-left: 2px solid var(--tui-background-neutral-1-hover); /* Main vertical track */
|
||||||
|
margin-left: 8px; /* Shifts child tracks slightly right */
|
||||||
|
|
||||||
|
.channel {
|
||||||
|
height: 50px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.channel::before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
left: -26px; /* Reaches backward to snap to the parent track */
|
||||||
|
top: 10px; /* Aligns horizontally with the center of the user header */
|
||||||
|
width: 22px; /* Defines width of the horizontal curve */
|
||||||
|
height: 14px; /* Defines height of the vertical curve drop */
|
||||||
|
|
||||||
|
border-left: 2px solid var(--tui-background-neutral-1-hover);
|
||||||
|
border-bottom: 2px solid var(--tui-background-neutral-1-hover);
|
||||||
|
border-bottom-left-radius: 8px; /* Creates the smooth curved bend */
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#settings {
|
#settings {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {Component, inject, OnInit, signal} from '@angular/core';
|
import { Component, effect, inject, input, OnInit, signal } from '@angular/core';
|
||||||
import {ActivatedRoute, Router, RouterLink, RouterOutlet} from '@angular/router';
|
import {ActivatedRoute, Router, RouterLink, RouterOutlet} from '@angular/router';
|
||||||
import {Chat} from '@chatenium/chatenium-sdk/domain/chatService.schema';
|
import {Chat} from '@chatenium/chatenium-sdk/domain/chatService.schema';
|
||||||
import {Message} from '@chatenium/chatenium-sdk/domain/dmService.schema';
|
import {Message} from '@chatenium/chatenium-sdk/domain/dmService.schema';
|
||||||
@@ -15,9 +15,10 @@ import {TuiTab, TuiTabsHorizontal, TuiTabsWithMore} from '@taiga-ui/kit';
|
|||||||
import {TuiItem} from '@taiga-ui/cdk';
|
import {TuiItem} from '@taiga-ui/cdk';
|
||||||
import {TranslatePipe} from '@ngx-translate/core';
|
import {TranslatePipe} from '@ngx-translate/core';
|
||||||
import {Settings} from './settings/settings';
|
import {Settings} from './settings/settings';
|
||||||
|
import { toObservable } from '@angular/core/rxjs-interop';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-network',
|
selector: 'network',
|
||||||
imports: [
|
imports: [
|
||||||
RouterOutlet,
|
RouterOutlet,
|
||||||
Navbar,
|
Navbar,
|
||||||
@@ -31,59 +32,61 @@ import {Settings} from './settings/settings';
|
|||||||
TuiTab,
|
TuiTab,
|
||||||
TranslatePipe,
|
TranslatePipe,
|
||||||
TuiTabsHorizontal,
|
TuiTabsHorizontal,
|
||||||
Settings
|
Settings,
|
||||||
],
|
],
|
||||||
templateUrl: './network.html',
|
templateUrl: './network.html',
|
||||||
styleUrl: './network.scss',
|
styleUrl: './network.scss',
|
||||||
})
|
})
|
||||||
export class Network implements OnInit {
|
export class Network {
|
||||||
serviceManager = inject(ServiceManager)
|
serviceManager = inject(ServiceManager);
|
||||||
route = inject(ActivatedRoute)
|
route = inject(ActivatedRoute);
|
||||||
indexedDb = inject(IndexedDB)
|
indexedDb = inject(IndexedDB);
|
||||||
breakpoint = inject(TUI_BREAKPOINT)
|
breakpoint = inject(TUI_BREAKPOINT);
|
||||||
router = inject(Router)
|
router = inject(Router);
|
||||||
|
|
||||||
tabActiveIndex = 2
|
constructor() {
|
||||||
|
effect(() => {
|
||||||
routerOutletActive = signal(false)
|
if (this.network()) {
|
||||||
|
this.setupNetwork();
|
||||||
networkId = ""
|
|
||||||
get store() {
|
|
||||||
return this.serviceManager.networkServices()[this.networkId]
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
this.route.params.subscribe(async params => {
|
|
||||||
console.log("Loading network...")
|
|
||||||
const networkId = params['networkId'];
|
|
||||||
this.networkId = networkId;
|
|
||||||
|
|
||||||
const session = this.serviceManager.currentSession();
|
|
||||||
const networkData = this.serviceManager.networks().find(c => c.networkId === networkId);
|
|
||||||
|
|
||||||
if (!session || !networkData) {
|
|
||||||
console.warn(`Initialization deferred for ${networkId}: Session or NetworkData missing.`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.serviceManager.networkServices()[networkId]) {
|
|
||||||
const newStore = {
|
|
||||||
networkData: signal<NetworkData>(networkData),
|
|
||||||
textChannels: signal({}),
|
|
||||||
wsListener: (action, data) => {
|
|
||||||
},
|
|
||||||
} as NetworkStorage;
|
|
||||||
|
|
||||||
newStore.service = new NetworkService(
|
|
||||||
session.userData.userid,
|
|
||||||
session.token,
|
|
||||||
networkId,
|
|
||||||
this.indexedDb.getApi(),
|
|
||||||
(action, data) => newStore.wsListener(action, data)
|
|
||||||
);
|
|
||||||
|
|
||||||
this.serviceManager.networkServices()[networkId] = newStore;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
network = input.required<NetworkData>();
|
||||||
|
|
||||||
|
routerOutletActive = signal(false);
|
||||||
|
|
||||||
|
get store() {
|
||||||
|
return this.serviceManager.networkServices()[this.network().networkId];
|
||||||
|
}
|
||||||
|
|
||||||
|
setupNetwork() {
|
||||||
|
console.log(`Setting up NetworkView for ${this.network().networkId}`);
|
||||||
|
const session = this.serviceManager.currentSession();
|
||||||
|
|
||||||
|
if (!session) {
|
||||||
|
console.warn(
|
||||||
|
`Initialization deferred for ${this.network().networkId}: Session or NetworkData missing.`,
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.serviceManager.networkServices()[this.network().networkId]) {
|
||||||
|
const newStore = {
|
||||||
|
networkData: signal<NetworkData>(this.network()),
|
||||||
|
textChannels: signal({}),
|
||||||
|
wsListener: (action, data) => {},
|
||||||
|
} as NetworkStorage;
|
||||||
|
|
||||||
|
newStore.service = new NetworkService(
|
||||||
|
session.userData.userid,
|
||||||
|
session.token,
|
||||||
|
this.network().networkId,
|
||||||
|
this.indexedDb.getApi(),
|
||||||
|
(action, data) => newStore.wsListener(action, data),
|
||||||
|
);
|
||||||
|
|
||||||
|
this.serviceManager.networkServices()[this.network().networkId] = newStore;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,7 @@
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
@if (serviceManager.currentSession()!.userData.emailSet) {
|
@if (serviceManager.currentSession()!.userData.emailSet) {
|
||||||
<button tuiButton appearance="outline" tuiAppearanceMode="invalid" iconStart="@tui.x" [disabled]="!serviceManager.currentSession()!.userData.phoneSet && !serviceManager.currentSession()!.userData.phoneSet"
|
<button tuiButton appearance="outline" tuiAppearanceMode="invalid" iconStart="@tui.x" [disabled]="!serviceManager.currentSession()!.userData.phoneSet && !serviceManager.currentSession()!.userData.passwordSet"
|
||||||
(click)="openChangeEmailDialog(true)"
|
(click)="openChangeEmailDialog(true)"
|
||||||
style="color: var(--tui-text-negative)">
|
style="color: var(--tui-text-negative)">
|
||||||
{{ "chat.userSettingsDialog.security.removeMail"|translate }}
|
{{ "chat.userSettingsDialog.security.removeMail"|translate }}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
{{ "chat.userSettingsDialog.security.label"|translate }}
|
{{ "chat.userSettingsDialog.security.label"|translate }}
|
||||||
</p>
|
</p>
|
||||||
<div id="options" tuiGroup orientation="vertical">
|
<div id="options" tuiGroup orientation="vertical">
|
||||||
<user-settings-security-password/>
|
<user-settings-security-password style="overflow: hidden"/>
|
||||||
<user-settings-security-email/>
|
<user-settings-security-email style="overflow: hidden"/>
|
||||||
<user-settings-security-phone/>
|
<user-settings-security-phone style="overflow: hidden"/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
version: "3.0-beta9",
|
version: "3.0-beta11",
|
||||||
api_url: "http://localhost:3000",
|
api_url: "http://localhost:3000",
|
||||||
cdn_url: "http://localhost:4000",
|
cdn_url: "http://localhost:4000",
|
||||||
ws_url: "ws://localhost:3000",
|
ws_url: "ws://localhost:3000",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
version: "3.0-beta9",
|
version: "3.0-beta11",
|
||||||
api_url: "https://api.chatenium.hu",
|
api_url: "https://api.chatenium.hu",
|
||||||
cdn_url: "https://cdn.chatenium.hu",
|
cdn_url: "https://cdn.chatenium.hu",
|
||||||
ws_url: "wss://api.chatenium.hu",
|
ws_url: "wss://api.chatenium.hu",
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
/* You can add global styles to this file, and also import other style files */
|
/* You can add global styles to this file, and also import other style files */
|
||||||
|
|
||||||
.drag-active * {
|
.drag-active * {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user