Merge pull request #766 from adityachandelgit/develop

Merge Develop into Master for release
This commit is contained in:
Aditya Chandel
2025-07-21 23:38:16 -06:00
committed by GitHub
21 changed files with 371 additions and 232 deletions
+1 -1
View File
@@ -147,7 +147,7 @@ git checkout -b fix/my-fix
- Follow code conventions, keep PRs focused and scoped - Follow code conventions, keep PRs focused and scoped
- Link the relevant issue in your PR - Link the relevant issue in your PR
- Test your changes - Test your changes
- Target the `master` branch when opening PRs - Target the `develop` branch when opening PRs
--- ---
+18 -38
View File
@@ -11,22 +11,27 @@ BookLore is a self-hosted web app for organizing and managing your personal book
## ✨ Key Features ## ✨ Key Features
- 📚 **Organized Book Management** - Categorize books with **Libraries** and **Shelves** for easy discovery and structured organization. - 📚 **Powerful Book Organization**: Keep your library tidy with **Libraries** and **Shelves**. Whether you're sorting by genre, author, or mood, finding the right book is effortless.
- 🧠 **Smart Metadata Handling** - Automatically fetch book details from **Goodreads**, **Amazon**, and **Google Books**, or edit them manually with fine-grained control. - 🧠 **Intelligent Metadata Management**: Instantly fetch rich metadata from **Goodreads**, **Amazon**, **Google Books**, **Hardcover**, and more, or fine-tune every detail yourself with our advanced editor.
- 👥 **Multi-User Support** - Admins can create accounts, assign libraries, and manage permissions for metadata edits, uploads, and downloads. - 👥 **Multi-User Access with Permissions**: Add users, assign libraries, and control who can edit, upload, or download. Perfect for families, friends, or teams.
- 📖 **Built-in PDF & ePub Reader** - A fast, feature-rich reader for PDFs and ePubs, with customizable reading settings and a clean UI. - 📖 **Built-in PDF, ePub, and CBX Reader**: Enjoy a smooth, distraction-free reading experience directly in your browser. Supports themes and adjustable settings.
- 🌐 **OPDS 1.2 Support** - Browse and download books through the **Open Publication Distribution System** – compatible with many reading apps. - 🌐 **OPDS 1.2 Integration**: Connect BookLore to your favorite reading apps with full **OPDS** support for seamless downloads.
- 🔐 **Optional OIDC Authentication** - Secure access with **OpenID Connect**, supporting both local JWT authentication and external providers like **Authentik**. - 🔐 **Flexible Authentication**: Secure your library with optional **OIDC login** via providers like **Authentik** and **Pocket ID**, or stick with local **JWT**, the choice is yours.
- 📤 **Multi-Book Uploads** - Upload multiple books at once with metadata auto-detection and file organization. - 📤 **Smart Batch Upload with BookDrop Folder**: Drop dozens of books into the **BookDrop Folder**, and BookLore will automatically scan, organize, and fetch metadata for all of them, hands-free and efficient.
- 📧 **Send Books via Email** - Share books directly with others by sending them via email – quick and easy. - 📧 **Send Books by Email**: Seamlessly share books with friends or your own devices by sending them directly via email from within BookLore. Just one click, and it’s delivered.
- 🚀 **Continuous Improvements** - Frequent updates with new features, performance enhancements, and UI improvements. BookLore is perfect for self-hosters who want complete control over their digital library. Stay tuned for updates! - 📱 **Mobile-Optimized UI**: Sleek, responsive design tailored for phones and tablets. Manage your library from anywhere, effortlessly.
## 🎥 Video Guides & Tutorials - 🔄 **Open Source & Self-Hosted**: Take full control of your digital library with BookLore’s open-source, self-hosted design.
- 🚀 **Active Development**: BookLore is under continuous improvement with regular updates to features, UI, and performance.
For a step-by-step walkthrough, check out the official BookLore video guides on YouTube: ## 🚀 Getting Started with BookLore
📺 [BookLore Tutorials – YouTube](https://www.youtube.com/watch?v=UMrn_fIeFRo&list=PLi0fq0zaM7lqY7dX0R66jQtKW64z4_Tdz) Kick off your BookLore journey with our official documentation and helpful video guides.
These videos cover deployment, configuration, and feature highlights to help you get started quickly. 📘 [BookLore Documentation: Getting Started](https://adityachandelgit.github.io/booklore-docs/docs/getting-started)
Our up-to-date docs walk you through installation, setup, configuration, and key features, everything you need to get up and running smoothly.
🎥 [BookLore Tutorials: YouTube](https://www.youtube.com/watch?v=UMrn_fIeFRo&list=PLi0fq0zaM7lqY7dX0R66jQtKW64z4_Tdz)
These older videos provide useful walkthroughs and visual guidance, but note that some content may be outdated compared to the current docs.
## 🐳 Deploy with Docker ## 🐳 Deploy with Docker
@@ -141,31 +146,6 @@ For detailed instructions on setting up OIDC authentication:
- 📺 [YouTube video on configuring Authentik with BookLore](https://www.youtube.com/watch?v=r6Ufh9ldF9M) - 📺 [YouTube video on configuring Authentik with BookLore](https://www.youtube.com/watch?v=r6Ufh9ldF9M)
- 📘 [Step-by-step setup guide for Pocket ID](docs/OIDC-Setup-With-PocketID.md) - 📘 [Step-by-step setup guide for Pocket ID](docs/OIDC-Setup-With-PocketID.md)
## 🔐 Remote Authentication (Trusted Header SSO, Forward Auth)
If you run BookLore behind a reverse proxy with remote authentication (middleware),
you can enable automatic login by setting `REMOTE_AUTH_ENABLED` to `true`.
This allows you to use your existing authentication system (e.g., OAuth, SAML) to log in to BookLore.
The following remote auth environment variables can be configured:
| Variable Name | Description | Default Value |
|------------------------------|-----------------------------------------|---------------------------------------------------------------------|
| REMOTE_AUTH_ENABLED | Enable remote authentication | `false` |
| REMOTE_AUTH_CREATE_NEW_USERS | Auto-create users from remote auth | `true` |
| REMOTE_AUTH_HEADER_NAME | HTTP header containing user's name | `Remote-Name` |
| REMOTE_AUTH_HEADER_USER | HTTP header containing username | `Remote-User` |
| REMOTE_AUTH_HEADER_EMAIL | HTTP header containing user's email | `Remote-Email` |
| REMOTE_AUTH_HEADER_GROUPS | HTTP header containing user's groups | `Remote-Groups` |
| REMOTE_AUTH_ADMIN_GROUP | Group name that grants admin privileges | - |
Example implementations:
- https://www.authelia.com/integration/trusted-header-sso/introduction/
- https://caddyserver.com/docs/caddyfile/directives/forward_auth
- https://doc.traefik.io/traefik/middlewares/http/forwardauth/
- https://github.com/sevensolutions/traefik-oidc-auth (Traefik OIDC Auth)
## 🤝 Community & Support ## 🤝 Community & Support
- 🐞 Found a bug? [Open an issue](https://github.com/adityachandelgit/BookLore/issues) - 🐞 Found a bug? [Open an issue](https://github.com/adityachandelgit/BookLore/issues)
@@ -20,6 +20,7 @@ import com.adityachandel.booklore.util.FileUtils;
import com.adityachandel.booklore.util.PathPatternResolver; import com.adityachandel.booklore.util.PathPatternResolver;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FilenameUtils;
import org.springframework.core.io.PathResource; import org.springframework.core.io.PathResource;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -105,7 +106,7 @@ public class BookDropService {
filePattern += "{currentFilename}"; filePattern += "{currentFilename}";
} }
String relativePath = PathPatternResolver.resolvePattern(metadata, filePattern, bookdropFile.getFilePath()); String relativePath = PathPatternResolver.resolvePattern(metadata, filePattern, FilenameUtils.getName(bookdropFile.getFilePath()));
Path source = Path.of(bookdropFile.getFilePath()); Path source = Path.of(bookdropFile.getFilePath());
Path target = Paths.get(path.getPath(), relativePath); Path target = Paths.get(path.getPath(), relativePath);
File targetFile = target.toFile(); File targetFile = target.toFile();
@@ -190,6 +190,11 @@ public class LibraryService {
return libraryMapper.toLibrary(libraryEntity); return libraryMapper.toLibrary(libraryEntity);
} }
public List<Library> getAllLibraries() {
List<LibraryEntity> libraries = libraryRepository.findAll();
return libraries.stream().map(libraryMapper::toLibrary).toList();
}
public List<Library> getLibraries() { public List<Library> getLibraries() {
BookLoreUser user = authenticationService.getAuthenticatedUser(); BookLoreUser user = authenticationService.getAuthenticatedUser();
BookLoreUserEntity userEntity = userRepository.findById(user.getId()).orElseThrow(() -> new UsernameNotFoundException("User not found")); BookLoreUserEntity userEntity = userRepository.findById(user.getId()).orElseThrow(() -> new UsernameNotFoundException("User not found"));
@@ -17,7 +17,7 @@ public class LibraryRescanScheduler {
@Scheduled(cron = "0 0 0 * * *") // At 00:00 every day @Scheduled(cron = "0 0 0 * * *") // At 00:00 every day
public void rescanLibraries() { public void rescanLibraries() {
log.info("Starting scheduled library rescan at midnight"); log.info("Starting scheduled library rescan at midnight");
for (Library library : libraryService.getLibraries()) { for (Library library : libraryService.getAllLibraries()) {
try { try {
libraryService.rescanLibrary(library.getId()); libraryService.rescanLibrary(library.getId());
log.info("Rescanned library '{}'", library.getName()); log.info("Rescanned library '{}'", library.getName());
@@ -22,14 +22,22 @@ import com.adityachandel.booklore.util.FileUtils;
import com.adityachandel.booklore.util.PathPatternResolver; import com.adityachandel.booklore.util.PathPatternResolver;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.file.FileSystems;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.LinkOption;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.nio.file.attribute.GroupPrincipal;
import java.nio.file.attribute.PosixFileAttributeView;
import java.nio.file.attribute.UserPrincipal;
import java.nio.file.attribute.UserPrincipalLookupService;
import java.util.Objects; import java.util.Objects;
@RequiredArgsConstructor @RequiredArgsConstructor
@@ -47,6 +55,12 @@ public class FileUploadService {
private final EpubMetadataExtractor epubMetadataExtractor; private final EpubMetadataExtractor epubMetadataExtractor;
private final MonitoringService monitoringService; private final MonitoringService monitoringService;
@Value("${PUID:0}")
private String userId;
@Value("${GUID:0}")
private String groupId;
public Book uploadFile(MultipartFile file, long libraryId, long pathId) throws IOException { public Book uploadFile(MultipartFile file, long libraryId, long pathId) throws IOException {
validateFile(file); validateFile(file);
@@ -70,6 +84,8 @@ public class FileUploadService {
try { try {
file.transferTo(tempPath); file.transferTo(tempPath);
setTemporaryFileOwnership(tempPath);
BookFileExtension fileExt = BookFileExtension.fromFileName(file.getOriginalFilename()).orElseThrow(() -> ApiError.INVALID_FILE_FORMAT.createException("Unsupported file extension")); BookFileExtension fileExt = BookFileExtension.fromFileName(file.getOriginalFilename()).orElseThrow(() -> ApiError.INVALID_FILE_FORMAT.createException("Unsupported file extension"));
@@ -138,6 +154,19 @@ public class FileUploadService {
} }
} }
private void setTemporaryFileOwnership(Path tempPath) throws IOException {
UserPrincipalLookupService lookupService = FileSystems.getDefault()
.getUserPrincipalLookupService();
if (!userId.equals("0")) {
UserPrincipal user = lookupService.lookupPrincipalByName(userId);
Files.getFileAttributeView(tempPath, PosixFileAttributeView.class, LinkOption.NOFOLLOW_LINKS).setOwner(user);
}
if (!groupId.equals("0")) {
GroupPrincipal group = lookupService.lookupPrincipalByGroupName(groupId);
Files.getFileAttributeView(tempPath, PosixFileAttributeView.class, LinkOption.NOFOLLOW_LINKS).setGroup(group);
}
}
private Book processFile(String fileName, LibraryEntity libraryEntity, LibraryPathEntity libraryPathEntity, File storageFile, BookFileType fileType) { private Book processFile(String fileName, LibraryEntity libraryEntity, LibraryPathEntity libraryPathEntity, File storageFile, BookFileType fileType) {
String subPath = FileUtils.getRelativeSubPath(libraryPathEntity.getPath(), storageFile.toPath()); String subPath = FileUtils.getRelativeSubPath(libraryPathEntity.getPath(), storageFile.toPath());
@@ -50,6 +50,13 @@
border-width: 1px 1px 0px 1px; border-width: 1px 1px 0px 1px;
} }
@media (max-width: 768px) {
.book-browser-footer {
left: 0%;
right: 0%;
}
}
.topbar-item { .topbar-item {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
@@ -275,7 +275,7 @@ export class BookBrowserComponent implements OnInit, AfterViewInit {
this.entityViewPreferences = user.userSettings?.entityViewPreferences; this.entityViewPreferences = user.userSettings?.entityViewPreferences;
const globalPrefs = this.entityViewPreferences?.global; const globalPrefs = this.entityViewPreferences?.global;
const currentEntityTypeStr = this.entityType ? this.entityType.toString().toUpperCase() : undefined; const currentEntityTypeStr = this.entityType ? this.entityType.toString().toUpperCase() : undefined;
this.coverScalePreferenceService.initScaleValue(user?.userSettings?.entityViewPreferences?.global?.coverSize); this.coverScalePreferenceService.initScaleValue(this.coverScalePreferenceService.scaleFactor);
this.filterSortPreferenceService.initValue(user?.userSettings?.filterSortingMode); this.filterSortPreferenceService.initValue(user?.userSettings?.filterSortingMode);
this.columnPreferenceService.initPreferences(user.userSettings?.tableColumnPreference); this.columnPreferenceService.initPreferences(user.userSettings?.tableColumnPreference);
this.visibleColumns = this.columnPreferenceService.visibleColumns; this.visibleColumns = this.columnPreferenceService.visibleColumns;
@@ -1,8 +1,8 @@
import {Injectable, inject} from '@angular/core'; import {inject, Injectable} from '@angular/core';
import {Subject} from 'rxjs'; import {Subject} from 'rxjs';
import {debounceTime} from 'rxjs/operators'; import {debounceTime} from 'rxjs/operators';
import {MessageService} from 'primeng/api'; import {MessageService} from 'primeng/api';
import {UserService} from '../../../settings/user-management/user.service'; import {LocalStorageService} from '../../../core/service/local-storage-service';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -12,9 +12,10 @@ export class CoverScalePreferenceService {
private readonly BASE_WIDTH = 135; private readonly BASE_WIDTH = 135;
private readonly BASE_HEIGHT = 220; private readonly BASE_HEIGHT = 220;
private readonly DEBOUNCE_MS = 1000; private readonly DEBOUNCE_MS = 1000;
private readonly STORAGE_KEY = 'coverScalePreference';
private readonly messageService = inject(MessageService); private readonly messageService = inject(MessageService);
private readonly userService = inject(UserService); private readonly localStorageService = inject(LocalStorageService);
private readonly scaleChangeSubject = new Subject<number>(); private readonly scaleChangeSubject = new Subject<number>();
readonly scaleChange$ = this.scaleChangeSubject.asObservable(); readonly scaleChange$ = this.scaleChangeSubject.asObservable();
@@ -22,6 +23,8 @@ export class CoverScalePreferenceService {
scaleFactor = 1.0; scaleFactor = 1.0;
constructor() { constructor() {
this.loadScaleFromStorage();
this.scaleChange$ this.scaleChange$
.pipe(debounceTime(this.DEBOUNCE_MS)) .pipe(debounceTime(this.DEBOUNCE_MS))
.subscribe(scale => this.saveScalePreference(scale)); .subscribe(scale => this.saveScalePreference(scale));
@@ -48,19 +51,28 @@ export class CoverScalePreferenceService {
} }
private saveScalePreference(scale: number): void { private saveScalePreference(scale: number): void {
const user = this.userService.getCurrentUser(); try {
const prefs = user?.userSettings?.entityViewPreferences; this.localStorageService.set(this.STORAGE_KEY, scale);
this.messageService.add({
severity: 'success',
summary: 'Cover Size Saved',
detail: `Cover size set to ${scale.toFixed(2)}x.`,
life: 1500
});
} catch (e) {
this.messageService.add({
severity: 'error',
summary: 'Save Failed',
detail: 'Could not save cover size preference locally.',
life: 3000
});
}
}
if (!user || !prefs) return; private loadScaleFromStorage(): void {
const saved = this.localStorageService.get<number>(this.STORAGE_KEY);
prefs.global = {...prefs.global, coverSize: scale}; if (saved !== null && !isNaN(saved)) {
this.userService.updateUserSetting(user.id, 'entityViewPreferences', prefs); this.scaleFactor = saved;
}
this.messageService.add({
severity: 'success',
summary: 'Cover Size Saved',
detail: `Cover size set to ${scale.toFixed(2)}x.`,
life: 1500
});
} }
} }
@@ -0,0 +1,25 @@
import {Injectable} from '@angular/core';
@Injectable({providedIn: 'root'})
export class LocalStorageService {
get<T>(key: string): T | null {
try {
const value = localStorage.getItem(key);
return value ? JSON.parse(value) as T : null;
} catch {
return null;
}
}
set<T>(key: string, value: T): void {
try {
localStorage.setItem(key, JSON.stringify(value));
} catch {
}
}
remove(key: string): void {
localStorage.removeItem(key);
}
}
@@ -1,6 +1,6 @@
import {Component, inject, OnInit} from '@angular/core'; import {Component, inject, OnInit} from '@angular/core';
import {AppMenuitemComponent} from './app.menuitem.component'; import {AppMenuitemComponent} from './app.menuitem.component';
import { AsyncPipe } from '@angular/common'; import {AsyncPipe} from '@angular/common';
import {MenuModule} from 'primeng/menu'; import {MenuModule} from 'primeng/menu';
import {LibraryService} from '../../../book/service/library.service'; import {LibraryService} from '../../../book/service/library.service';
import {Observable, of} from 'rxjs'; import {Observable, of} from 'rxjs';
@@ -141,6 +141,7 @@ export class AppMenuComponent implements OnInit {
} }
openChangelogDialog() { openChangelogDialog() {
const isMobile = window.innerWidth <= 768;
this.dynamicDialogRef = this.dialogService.open(VersionChangelogDialogComponent, { this.dynamicDialogRef = this.dialogService.open(VersionChangelogDialogComponent, {
header: 'What’s New', header: 'What’s New',
modal: true, modal: true,
@@ -149,8 +150,9 @@ export class AppMenuComponent implements OnInit {
position: 'absolute', position: 'absolute',
top: '10%', top: '10%',
bottom: '10%', bottom: '10%',
minWidth: '800px', width: isMobile ? '90vw' : '800px',
maxWidth: '800px', maxWidth: isMobile ? '90vw' : '800px',
minWidth: isMobile ? '90vw' : '800px',
}, },
}); });
} }
@@ -32,8 +32,8 @@
@if (userService.userState$ | async; as userData) { @if (userService.userState$ | async; as userData) {
<li> <li>
@if (userData.permissions.canManipulateLibrary || userData.permissions.admin) { @if (userData.permissions.canManipulateLibrary || userData.permissions.admin) {
<a class="topbar-item" (click)="openLibraryCreatorDialog()" pTooltip="Create New Library" tooltipPosition="top"> <a class="topbar-item" (click)="openLibraryCreatorDialog()" pTooltip="Create New Library" tooltipPosition="bottom">
<i class="pi pi-plus-circle text-surface-700 dark:text-surface-100"></i> <i class="pi pi-plus-circle text-surface-100"></i>
</a> </a>
} }
</li> </li>
@@ -41,50 +41,49 @@
@if (userService.userState$ | async; as userData) { @if (userService.userState$ | async; as userData) {
<li> <li>
@if (userData.permissions.canManipulateLibrary || userData.permissions.admin) { @if (userData.permissions.canManipulateLibrary || userData.permissions.admin) {
<a class="topbar-item" (click)="openFileUploadDialog()" pTooltip="Upload Book" tooltipPosition="top"> <a class="topbar-item" (click)="openFileUploadDialog()" pTooltip="Upload Book" tooltipPosition="bottom">
<i class="pi pi-upload text-surface-700 dark:text-surface-100"></i> <i class="pi pi-upload text-surface-100"></i>
</a> </a>
} }
</li> </li>
} }
<li> <li>
<a class="topbar-item" (click)="navigateToSettings()" pTooltip="Settings" tooltipPosition="top"> <a class="topbar-item" (click)="navigateToSettings()" pTooltip="Settings" tooltipPosition="bottom">
<i class="pi pi-cog text-surface-700 dark:text-surface-100"></i> <i class="pi pi-cog text-surface-100"></i>
</a> </a>
</li> </li>
</div> </div>
<p-divider layout="vertical"/> <p-divider layout="vertical"/>
<li class="relative">
<button
type="button"
class="topbar-item"
(click)="notificationPopover.toggle($event)"
>
<i
class="pi"
[ngClass]="iconClass"
[ngStyle]="{ color: iconColor }"
style="font-size: 1.25rem"
[class.pulsating]="iconPulsating"
aria-label="Unified Notification Icon"
></i>
</button>
@if (shouldShowNotificationBadge) {
<span class="notification-badge">{{ completedTaskCount }}</span>
}
<p-popover #notificationPopover>
<app-unified-notification-popover-component></app-unified-notification-popover-component>
</p-popover>
</li>
<p-divider layout="vertical"/>
<div class="flex gap-6"> <div class="flex gap-6">
<li class="relative group overflow-hidden !border-transparent topbar-item" pTooltip="Love BookLore?" tooltipPosition="top" (click)="openGithubSupportDialog()"> <li class="relative">
<button
type="button"
class="topbar-item"
(click)="notificationPopover.toggle($event)"
>
<i
class="pi"
[ngClass]="iconClass"
[ngStyle]="{ color: iconColor }"
style="font-size: 1.25rem"
[class.pulsating]="iconPulsating"
aria-label="Unified Notification Icon"
></i>
</button>
@if (shouldShowNotificationBadge) {
<span class="notification-badge">{{ completedTaskCount }}</span>
}
<p-popover #notificationPopover>
<app-unified-notification-popover-component></app-unified-notification-popover-component>
</p-popover>
</li>
<li class="relative group overflow-hidden !border-transparent topbar-item" pTooltip="Love BookLore?" tooltipPosition="bottom" (click)="openGithubSupportDialog()">
<span <span
style="animation-duration: 2s; background: conic-gradient(from 90deg, #f97316, #f59e0b, #eab308, #84cc16, #22c55e, #10b981, #14a8a6, #06b6d4, #0ea5e9, #3b82f6, #6366f1, #8b5cf6, #a855f7, #d946ef, #ec4899, #f43f5e)" style="animation-duration: 2s; background: conic-gradient(from 90deg, #f97316, #f59e0b, #eab308, #84cc16, #22c55e, #10b981, #14a8a6, #06b6d4, #0ea5e9, #3b82f6, #6366f1, #8b5cf6, #a855f7, #d946ef, #ec4899, #f43f5e)"
class="absolute -top-5 -left-5 w-20 h-20 animate-spin"> class="absolute -top-5 -left-5 w-20 h-20 animate-spin">
@@ -108,13 +107,23 @@
<p-divider layout="vertical"/> <p-divider layout="vertical"/>
<div class="flex gap-6"> <div class="flex gap-6">
<li> <li>
<button class="topbar-item" (click)="openUserProfileDialog()" pTooltip="Profile" tooltipPosition="top"> <a class="topbar-item"
<i class="pi pi-user text-surface-700 dark:text-surface-100"></i> href="https://adityachandelgit.github.io/booklore-docs/docs/getting-started/"
target="_blank"
rel="noopener noreferrer"
pTooltip="Documentation"
tooltipPosition="bottom">
<i class="pi pi-info-circle text-surface-100"></i>
</a>
</li>
<li>
<button class="topbar-item" (click)="openUserProfileDialog()" pTooltip="Profile" tooltipPosition="bottom">
<i class="pi pi-user text-surface-100"></i>
</button> </button>
</li> </li>
<li> <li>
<button class="topbar-item" (click)="logout()" pTooltip="Logout" tooltipPosition="top"> <button class="topbar-item" (click)="logout()" pTooltip="Logout" tooltipPosition="left">
<i class="pi pi-sign-out text-surface-700 dark:text-surface-100"></i> <i class="pi pi-sign-out text-surface-100"></i>
</button> </button>
</li> </li>
</div> </div>
@@ -135,7 +144,7 @@
class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded" class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded"
(click)="openLibraryCreatorDialog(); mobileMenu.hide()" (click)="openLibraryCreatorDialog(); mobileMenu.hide()"
> >
<i class="pi pi-plus-circle text-surface-700 dark:text-surface-100"></i> <i class="pi pi-plus-circle text-surface-100"></i>
Create Library Create Library
</button> </button>
</li> </li>
@@ -144,7 +153,7 @@
class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded" class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded"
(click)="openFileUploadDialog(); mobileMenu.hide()" (click)="openFileUploadDialog(); mobileMenu.hide()"
> >
<i class="pi pi-upload text-surface-700 dark:text-surface-100"></i> <i class="pi pi-upload text-surface-100"></i>
Upload Book Upload Book
</button> </button>
</li> </li>
@@ -155,16 +164,26 @@
class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded" class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded"
(click)="navigateToSettings(); mobileMenu.hide()" (click)="navigateToSettings(); mobileMenu.hide()"
> >
<i class="pi pi-cog text-surface-700 dark:text-surface-100"></i> <i class="pi pi-cog text-surface-100"></i>
Settings Settings
</button> </button>
</li> </li>
<li>
<a
class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded"
href="https://adityachandelgit.github.io/booklore-docs/docs/getting-started/"
target="_blank"
rel="noopener noreferrer">
<i class="pi pi-info-circle text-surface-100"></i>
Documentation
</a>
</li>
<li> <li>
<button <button
class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded" class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded"
(click)="openGithubSupportDialog(); mobileMenu.hide()" (click)="openGithubSupportDialog(); mobileMenu.hide()"
> >
<i class="pi pi-thumbs-up text-surface-700 dark:text-surface-100"></i> <i class="pi pi-thumbs-up text-surface-100"></i>
Support BookLore Support BookLore
</button> </button>
</li> </li>
@@ -173,7 +192,7 @@
class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded" class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded"
(click)="openUserProfileDialog(); mobileMenu.hide()" (click)="openUserProfileDialog(); mobileMenu.hide()"
> >
<i class="pi pi-user text-surface-700 dark:text-surface-100"></i> <i class="pi pi-user text-surface-100"></i>
Profile Profile
</button> </button>
</li> </li>
@@ -182,7 +201,7 @@
class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded" class="flex items-center gap-2 w-full text-left p-2 hover:bg-surface-200 dark:hover:bg-surface-700 rounded"
(click)="logout(); mobileMenu.hide()" (click)="logout(); mobileMenu.hide()"
> >
<i class="pi pi-sign-out text-surface-700 dark:text-surface-100"></i> <i class="pi pi-sign-out text-surface-100"></i>
Logout Logout
</button> </button>
</li> </li>
@@ -140,11 +140,20 @@ export class AppTopBarComponent implements OnDestroy {
} }
private openDialog(component: any, header: string, top: string) { private openDialog(component: any, header: string, top: string) {
const isMobile = window.innerWidth <= 768;
this.ref = this.dialogService.open(component, { this.ref = this.dialogService.open(component, {
header, header,
modal: true, modal: true,
closable: true, closable: true,
style: { position: 'absolute', top }, style: {
position: 'absolute',
top,
...(isMobile && {
width: '90vw',
maxWidth: '90vw',
minWidth: '90vw',
}),
},
}); });
} }
@@ -1,9 +1,9 @@
.tabpanels-responsive { .tabpanels-responsive {
height: calc(100vh - 9.7rem); height: calc(100dvh - 9.7rem);
} }
@media (max-width: 768px) { @media (max-width: 768px) {
.tabpanels-responsive { .tabpanels-responsive {
height: calc(100vh - 8.5rem); height: calc(100dvh - 8.5rem);
} }
} }
@@ -12,9 +12,8 @@
<img <img
[attr.src]="urlHelper.getCoverUrl(book.id, book.metadata?.coverUpdatedOn)" [attr.src]="urlHelper.getCoverUrl(book.id, book.metadata?.coverUpdatedOn)"
alt="Image" alt="Image"
width="250"
[ngClass]="{ 'brightness-50': isUploading }" [ngClass]="{ 'brightness-50': isUploading }"
class="transition-all duration-300 ease-in-out"/> class="w-[200px] md:w-[250px] transition-all duration-300 ease-in-out"/>
@if (isUploading) { @if (isUploading) {
<p-progressSpinner <p-progressSpinner
class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-10"> class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-10">
@@ -54,7 +53,7 @@
} }
</div> </div>
</div> </div>
<div class="flex flex-col flex-grow pl-2"> <div class="flex flex-col flex-grow md:pl-2">
<div class="flex flex-col md:flex-row w-full gap-4 pb-1"> <div class="flex flex-col md:flex-row w-full gap-4 pb-1">
<div class="flex flex-col gap-1 md:w-2/3"> <div class="flex flex-col gap-1 md:w-2/3">
@@ -426,7 +425,7 @@
</div> </div>
<div class="mt-auto"> <div class="mt-auto">
<p-divider></p-divider> <p-divider></p-divider>
<div class="flex flex-col gap-2 px-2 pt-4 md:pb-4 z-10"> <div class="flex flex-col gap-2 px-0 md:px-2 pt-4 md:pb-4 z-10">
<!-- Desktop Buttons --> <!-- Desktop Buttons -->
<div class="hidden sm:flex justify-between w-full gap-4"> <div class="hidden sm:flex justify-between w-full gap-4">
@@ -473,24 +472,57 @@
</div> </div>
} }
<div class="flex gap-4 items-center flex-wrap ml-auto"> <div class="flex justify-between items-center w-full gap-4">
<p-button <div class="flex gap-4">
icon="pi pi-bolt" <p-button
[outlined]="true" icon="pi pi-bolt"
severity="info" [outlined]="true"
(onClick)="autoFetch(book.id)" severity="info"
[disabled]="isAutoFetching" (onClick)="autoFetch(book.id)"
pTooltip="Auto Fetch" [disabled]="isAutoFetching"
tooltipPosition="top"> pTooltip="Auto Fetch"
</p-button> tooltipPosition="top">
</p-button>
@if (book.bookType === 'PDF' || book.bookType === 'EPUB') { @if (book.bookType === 'PDF' || book.bookType === 'EPUB') {
<p-button icon="pi pi-refresh" [outlined]="true" severity="danger" (onClick)="restoreMetadata()" pTooltip="Restore" tooltipPosition="top"></p-button> <p-button
} icon="pi pi-refresh"
<p-button icon="pi pi-lock-open" [outlined]="true" severity="success" (onClick)="unlockAll()" pTooltip="Unlock All" tooltipPosition="top"></p-button> [outlined]="true"
<p-button icon="pi pi-lock" [outlined]="true" severity="warn" (onClick)="lockAll()" pTooltip="Lock All" tooltipPosition="top"></p-button> severity="danger"
<p-divider layout="vertical" /> (onClick)="restoreMetadata()"
<p-button label="Save" icon="pi pi-check" [loading]="isSaving" [disabled]="isSaving" type="submit"></p-button> pTooltip="Restore"
tooltipPosition="top">
</p-button>
}
<p-button
icon="pi pi-lock-open"
[outlined]="true"
severity="success"
(onClick)="unlockAll()"
pTooltip="Unlock All"
tooltipPosition="top">
</p-button>
<p-button
icon="pi pi-lock"
[outlined]="true"
severity="warn"
(onClick)="lockAll()"
pTooltip="Lock All"
tooltipPosition="top">
</p-button>
</div>
<div>
<p-button
label="Save"
icon="pi pi-check"
[loading]="isSaving"
[disabled]="isSaving"
type="submit">
</p-button>
</div>
</div> </div>
</div> </div>
@@ -9,7 +9,7 @@
} @else { } @else {
<form class="flex flex-col w-full h-full pt-2 min-w-full md:min-w-[60rem] pr-0 md:pr-2 pl-0 md:pl-2" [formGroup]="form" (ngSubmit)="onSubmit()"> <form class="flex flex-col w-full h-full pt-2 min-w-full md:min-w-[60rem] pr-0 md:pr-2 pl-0 md:pl-2" [formGroup]="form" (ngSubmit)="onSubmit()">
<div class="grid grid-cols-1 md:flex md:flex-row w-full gap-4 md:items-end"> <div class="grid grid-cols-1 md:flex md:flex-row w-full gap-2 md:gap-4 md:items-end">
<div class="flex flex-col gap-1 w-full max-w-full md:w-3/12"> <div class="flex flex-col gap-1 w-full max-w-full md:w-3/12">
<label for="provider">Providers</label> <label for="provider">Providers</label>
@@ -50,40 +50,56 @@
</div> </div>
@if (loading) { @if (loading) {
<div class="flex justify-center items-center mt-8"> <div class="flex justify-center items-center flex-col gap-4 h-[40dvh] md:h-[70dvh] text-center">
<p-progress-spinner ariaLabel="loading"/> <p-progress-spinner ariaLabel="Loading metadata..."/>
<p class="text-gray-300">
Fetching metadata from your selected sources.<br/>
This may take a few moments...
</p>
</div> </div>
} }
@if (!loading) { @if (!loading) {
<div class="mt-4 md:mt-8 flex-1 overflow-y-auto"> @if (searchTriggered && allFetchedMetadata.length === 0) {
@for (metadata of allFetchedMetadata; track metadata) { <div class="flex flex-col items-center justify-center h-[50dvh] md:h-[70dvh] text-center">
<div class="book-item flex flex-col w-full"> <p class="text-gray-300">No metadata results found.<br/>Try adjusting your search criteria.</p>
<div class="flex flex-row w-full book-item-content cursor-pointer" (click)="onBookClick(metadata)"> </div>
<img [src]="metadata.thumbnailUrl || 'assets/images/missing-cover.jpg'" alt="Image" class="img-fixed-dimensions pr-0 md:pr-2 md:py-3 self-center md:self-start"/> }
<div class="flex flex-col w-full m-2"> @if (!searchTriggered && allFetchedMetadata.length === 0) {
<div class="flex flex-col md:flex-row gap-2 md:gap-4 justify-between"> <div class="flex flex-col items-center justify-center h-[50dvh] md:h-[70dvh] text-center">
<p class="font-bold">{{ truncateText(metadata['title']!, 90) }}</p> <p class="text-gray-300">Start by searching for metadata using the search bar above.</p>
<div class="flex flex-wrap gap-2 text-sm"> </div>
<p>ISBN: {{ metadata['isbn10'] || metadata['asin'] }}</p> }
<span class="hidden md:inline">|</span> @if (allFetchedMetadata.length > 0) {
<p>Published: {{ metadata['publishedDate'] }}</p> <div class="mt-4 md:mt-8 flex-1 overflow-y-auto">
@for (metadata of allFetchedMetadata; track metadata) {
<div class="book-item flex flex-col w-full">
<div class="flex flex-row w-full book-item-content cursor-pointer" (click)="onBookClick(metadata)">
<img [src]="metadata.thumbnailUrl || 'assets/images/missing-cover.jpg'" alt="Image" class="img-fixed-dimensions pr-0 md:pr-2 md:py-3 self-center md:self-start"/>
<div class="flex flex-col w-full m-2">
<div class="flex flex-col md:flex-row gap-2 md:gap-4 justify-between">
<p class="font-bold">{{ truncateText(metadata['title']!, 90) }}</p>
<div class="flex flex-wrap gap-2 text-sm">
<p>ISBN: {{ metadata['isbn10'] || metadata['asin'] }}</p>
<span class="hidden md:inline">|</span>
<p>Published: {{ metadata['publishedDate'] }}</p>
</div>
</div> </div>
<div class="flex flex-wrap gap-2 text-sm">
<p>by {{ truncateText(metadata['authors']!.join(', '), 70) }}</p>
<span class="hidden md:inline">|</span>
<p>Source: <span [innerHTML]="buildProviderLink(metadata)"></span></p>
</div>
<p class="mt-4 truncate-text p-secondary">
{{ sanitizeHtml(metadata['description']) }}
</p>
</div> </div>
<div class="flex flex-wrap gap-2 text-sm">
<p>by {{ truncateText(metadata['authors']!.join(', '), 70) }}</p>
<span class="hidden md:inline">|</span>
<p>Source: <span [innerHTML]="buildProviderLink(metadata)"></span></p>
</div>
<p class="mt-4 truncate-text p-secondary">
{{ sanitizeHtml(metadata['description']) }}
</p>
</div> </div>
<p-divider></p-divider>
</div> </div>
<p-divider></p-divider> }
</div> </div>
} }
</div>
} }
</form> </form>
} }
@@ -40,6 +40,7 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
allFetchedMetadata: BookMetadata[] = []; allFetchedMetadata: BookMetadata[] = [];
bookId!: number; bookId!: number;
loading: boolean = false; loading: boolean = false;
searchTriggered = false;
@Input() book$!: Observable<Book | null>; @Input() book$!: Observable<Book | null>;
@@ -120,6 +121,7 @@ export class MetadataSearcherComponent implements OnInit, OnDestroy {
} }
onSubmit(): void { onSubmit(): void {
this.searchTriggered = true;
if (this.form.valid) { if (this.form.valid) {
const providerKeys = this.form.get('provider')?.value; const providerKeys = this.form.get('provider')?.value;
if (!providerKeys) return; if (!providerKeys) return;
@@ -187,96 +187,98 @@
</div> </div>
} }
<div class="grid md:grid-cols-3 gap-y-2.5 text-sm pt-2 md:pt-4 text-gray-700 dark:text-gray-300 max-w-6xl"> <div class="px-1 md:px-0">
<p class="whitespace-nowrap max-w-[250px] overflow-hidden text-ellipsis"> <div class="grid md:grid-cols-3 gap-y-2.5 text-sm pt-2 md:pt-4 pb-2 text-gray-300 max-w-6xl">
<span class="font-bold">Publisher: </span> <p class="whitespace-nowrap max-w-[250px] overflow-hidden text-ellipsis">
@if (book?.metadata?.publisher) { <span class="font-bold">Publisher: </span>
<span class="underline hover:opacity-80 cursor-pointer" (click)="goToPublisher(book?.metadata?.publisher!)"> @if (book?.metadata?.publisher) {
<span class="underline hover:opacity-80 cursor-pointer" (click)="goToPublisher(book?.metadata?.publisher!)">
{{ book?.metadata?.publisher }} {{ book?.metadata?.publisher }}
</span> </span>
} @else { } @else {
<span>-</span> <span>-</span>
} }
</p> </p>
<p><strong>Published:</strong> {{ book?.metadata!.publishedDate || '-' }}</p> <p><strong>Published:</strong> {{ book?.metadata!.publishedDate || '-' }}</p>
<p><strong>Language:</strong> {{ book?.metadata!.language || '-' }}</p> <p><strong>Language:</strong> {{ book?.metadata!.language || '-' }}</p>
<p class="whitespace-nowrap flex items-center gap-2"> <p class="whitespace-nowrap flex items-center gap-2">
<span class="font-bold">File Type:</span> <span class="font-bold">File Type:</span>
<span <span
class="inline-block px-2 py-0.5 rounded-lg text-xs font-bold text-gray-200" class="inline-block px-2 py-0.5 rounded-lg text-xs font-bold text-gray-200"
[ngClass]="getFileTypeColorClass(getFileExtension(book?.filePath))"> [ngClass]="getFileTypeColorClass(getFileExtension(book?.filePath))">
{{ getFileExtension(book?.filePath) || '-' }} {{ getFileExtension(book?.filePath) || '-' }}
</span> </span>
</p> </p>
<p><strong>File Size:</strong> {{ getFileSizeInMB(book) }}</p> <p><strong>File Size:</strong> {{ getFileSizeInMB(book) }}</p>
<p> <p>
<strong>ISBN:</strong> <strong>ISBN:</strong>
@if (book?.metadata?.isbn13 || book?.metadata?.isbn10) { @if (book?.metadata?.isbn13 || book?.metadata?.isbn10) {
{{ book.metadata!.isbn13 }} {{ book.metadata!.isbn13 }}
@if (book?.metadata?.isbn13 && book?.metadata?.isbn10) { @if (book?.metadata?.isbn13 && book?.metadata?.isbn10) {
/ /
}
{{ book.metadata!.isbn10 }}
} @else {
<span>-</span>
} }
{{ book.metadata!.isbn10 }} </p>
} @else { <p class="whitespace-nowrap flex items-center gap-2">
<span>-</span> <span class="font-bold">Read Status:</span>
} <span
</p> class="inline-block px-2 py-0.5 rounded-full text-xs font-bold text-white cursor-pointer"
<p class="whitespace-nowrap flex items-center gap-2"> [ngClass]="getStatusSeverityClass(selectedReadStatus)"
<span class="font-bold">Read Status:</span> (click)="menu.toggle($event)">
<span
class="inline-block px-2 py-0.5 rounded-full text-xs font-bold text-white cursor-pointer"
[ngClass]="getStatusSeverityClass(selectedReadStatus)"
(click)="menu.toggle($event)">
{{ getStatusLabel(selectedReadStatus) }} {{ getStatusLabel(selectedReadStatus) }}
</span> </span>
<p-menu #menu [popup]="true" [model]="readStatusMenuItems"></p-menu> <p-menu #menu [popup]="true" [model]="readStatusMenuItems"></p-menu>
</p> </p>
<p class="whitespace-nowrap flex items-center"> <p class="whitespace-nowrap flex items-center">
<span class="font-bold mr-2">Progress:</span> <span class="font-bold mr-2">Progress:</span>
<span class="inline-flex items-center"> <span class="inline-flex items-center">
<span <span
class="inline-block px-2 py-0.5 rounded-full text-xs font-bold text-white" class="inline-block px-2 py-0.5 rounded-full text-xs font-bold text-white"
[ngClass]="getProgressColorClass(getProgressPercent(book))"> [ngClass]="getProgressColorClass(getProgressPercent(book))">
{{ getProgressPercent(book) !== null ? getProgressPercent(book) + '%' : 'N/A' }} {{ getProgressPercent(book) !== null ? getProgressPercent(book) + '%' : 'N/A' }}
</span> </span>
@if (getProgressPercent(book) !== null) { @if (getProgressPercent(book) !== null) {
<p-button <p-button
pTooltip="Reset progress" pTooltip="Reset progress"
tooltipPosition="bottom" tooltipPosition="bottom"
icon="pi pi-refresh" icon="pi pi-refresh"
size="small" size="small"
severity="danger" severity="danger"
text text
class="ml-1 custom-button-padding" class="ml-1 custom-button-padding"
(onClick)="resetProgress(book)"> (onClick)="resetProgress(book)">
</p-button> </p-button>
} }
</span> </span>
</p> </p>
<p class="whitespace-nowrap flex items-center gap-2"> <p class="whitespace-nowrap flex items-center gap-2">
<span class="font-bold">Metadata Match:</span> <span class="font-bold">Metadata Match:</span>
@if (book?.metadataMatchScore != null) { @if (book?.metadataMatchScore != null) {
<span <span
class="inline-block px-2 py-0.5 rounded-lg text-xs font-bold text-gray-200 border" class="inline-block px-2 py-0.5 rounded-lg text-xs font-bold text-gray-200 border"
[ngClass]="getMatchScoreColorClass(book?.metadataMatchScore!)"> [ngClass]="getMatchScoreColorClass(book?.metadataMatchScore!)">
{{ (book?.metadataMatchScore! * 100) | number:'1.0-0' }}% {{ (book?.metadataMatchScore! * 100) | number:'1.0-0' }}%
</span> </span>
} @else { } @else {
<span>-</span> <span>-</span>
} }
</p> </p>
</div> </div>
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<span class="font-semibold text-sm">File Path:</span> <span class="font-semibold text-sm">File Path:</span>
<i <i
class="pi cursor-pointer text-sm" class="pi cursor-pointer text-sm"
[ngClass]="showFilePath ? 'pi-eye-slash' : 'pi-eye'" [ngClass]="showFilePath ? 'pi-eye-slash' : 'pi-eye'"
(click)="showFilePath = !showFilePath" (click)="showFilePath = !showFilePath"
></i> ></i>
@if (showFilePath) { @if (showFilePath) {
<code class="text-xs font-mono truncate text-gray-300">{{ book?.filePath }}</code> <code class="text-xs font-mono truncate text-gray-300">{{ book?.filePath }}</code>
} }
</div>
</div> </div>
</div> </div>
@@ -15,7 +15,6 @@ import {BookService} from '../../book/service/book.service';
import {AppSettingKey, AppSettings} from '../../core/model/app-settings.model'; import {AppSettingKey, AppSettings} from '../../core/model/app-settings.model';
import {filter, take} from 'rxjs/operators'; import {filter, take} from 'rxjs/operators';
import {FileUploadPatternComponent} from './file-upload-pattern/file-upload-pattern.component'; import {FileUploadPatternComponent} from './file-upload-pattern/file-upload-pattern.component';
import {OpdsSettingsComponent} from './opds-settings/opds-settings.component';
import {InputText} from 'primeng/inputtext'; import {InputText} from 'primeng/inputtext';
@Component({ @Component({
@@ -30,7 +29,6 @@ import {InputText} from 'primeng/inputtext';
ToggleSwitch, ToggleSwitch,
FormsModule, FormsModule,
FileUploadPatternComponent, FileUploadPatternComponent,
OpdsSettingsComponent,
InputText InputText
], ],
templateUrl: './global-preferences.component.html', templateUrl: './global-preferences.component.html',
@@ -3,7 +3,7 @@
<div class="min-w-[300px] md:min-w-[500px]"> <div class="min-w-[300px] md:min-w-[500px]">
<section> <section>
<div class="flex flex-col gap-4"> <div class="flex flex-col gap-4 py-4">
<h2 class="text-xl font-semibold">User Profile</h2> <h2 class="text-xl font-semibold">User Profile</h2>
<div class="px-4 py-2"> <div class="px-4 py-2">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6"> <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
@@ -1,4 +1,4 @@
:root[class="p-dark"] { :root[class~="p-dark"] {
--primary-text-color: var(--p-primary-400); --primary-text-color: var(--p-primary-400);
--primary-text-color-dark: var(--p-primary-900); --primary-text-color-dark: var(--p-primary-900);
--primary-color: var(--p-primary-color); --primary-color: var(--p-primary-color);