feat(reader): add document mode to the PDF viewer, overhaul PDF viewer, add different modes to CBX viewer (#306)
* feat(reader): add document mode to the PDF viewer, overhaul PDF viewer, add different modes to CBX viewer * feat(reader): improve reader settings with brightness, emulate book mode, and click-to-paginate options * feat(reader): add long strip scroll mode and update related settings
This commit is contained in:
+7
-10
@@ -73,6 +73,13 @@ export class BookFilterComponent implements OnInit, OnDestroy {
|
||||
|
||||
readonly filterLabelKeys = FILTER_LABEL_KEYS;
|
||||
|
||||
private readonly userSettingsEffect = effect(() => {
|
||||
const user = this.userService.currentUser();
|
||||
if (!user) return;
|
||||
this._visibleFilters = user.userSettings.visibleFilters ?? [...DEFAULT_VISIBLE_FILTERS];
|
||||
this.updateVisibleFilterTypes();
|
||||
});
|
||||
|
||||
getFilterLabel(type: FilterType): string {
|
||||
const key = this.filterLabelKeys[type];
|
||||
return key ? this.t.translate(key) : type;
|
||||
@@ -99,7 +106,6 @@ export class BookFilterComponent implements OnInit, OnDestroy {
|
||||
ngOnInit(): void {
|
||||
this.updateVisibleFilterTypes();
|
||||
this.updateExpandedPanels();
|
||||
this.subscribeToUserSettings();
|
||||
this.subscribeToReset();
|
||||
}
|
||||
|
||||
@@ -164,15 +170,6 @@ export class BookFilterComponent implements OnInit, OnDestroy {
|
||||
return String(value ?? '');
|
||||
}
|
||||
|
||||
private subscribeToUserSettings(): void {
|
||||
effect(() => {
|
||||
const user = this.userService.currentUser();
|
||||
if (!user) return;
|
||||
this._visibleFilters = user.userSettings.visibleFilters ?? [...DEFAULT_VISIBLE_FILTERS];
|
||||
this.updateVisibleFilterTypes();
|
||||
});
|
||||
}
|
||||
|
||||
private updateVisibleFilterTypes(): void {
|
||||
this.visibleFilterTypes = this._visibleFilters.filter(
|
||||
vf => this.filterTypes.includes(vf as FilterType)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {Shelf} from './shelf.model';
|
||||
import {CbxBackgroundColor, CbxFitMode, CbxPageSpread, CbxPageViewMode, CbxScrollMode, NewPdfReaderSetting} from '../../settings/user-management/user.service';
|
||||
import {CbxBackgroundColor, CbxFitMode, CbxPageSpread, CbxPageSplitOption, CbxPageViewMode, CbxScrollMode, NewPdfReaderSetting} from '../../settings/user-management/user.service';
|
||||
import {BookReview} from '../components/book-reviews/book-review-service';
|
||||
import {ZoomType} from 'ngx-extended-pdf-viewer';
|
||||
|
||||
@@ -305,6 +305,7 @@ export interface MetadataUpdateWrapper {
|
||||
export interface PdfViewerSetting {
|
||||
zoom: ZoomType;
|
||||
spread: 'off' | 'even' | 'odd';
|
||||
isDarkTheme?: boolean;
|
||||
}
|
||||
|
||||
export interface EpubViewerSetting {
|
||||
@@ -339,6 +340,11 @@ export interface CbxViewerSetting {
|
||||
fitMode: CbxFitMode;
|
||||
scrollMode?: CbxScrollMode;
|
||||
backgroundColor?: CbxBackgroundColor;
|
||||
pageSplitOption?: CbxPageSplitOption;
|
||||
brightness?: number;
|
||||
emulateBook?: boolean;
|
||||
clickToPaginate?: boolean;
|
||||
autoCloseMenu?: boolean;
|
||||
}
|
||||
|
||||
export interface BookSetting {
|
||||
|
||||
Reference in New Issue
Block a user