feat(memoir): persist chapter reading prefs globally
Share font size, font family, and background across all memoir chapters via MemoirReadingSettingsProvider and SecureStore (same app-settings pattern). Add parse/merge helpers and unit tests. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9,6 +9,10 @@ import React from 'react';
|
||||
import { Platform, StyleSheet, Text, View } from 'react-native';
|
||||
import Markdown from 'react-native-markdown-display';
|
||||
|
||||
import type {
|
||||
MemoirReadingFontFamily,
|
||||
MemoirReadingFontSize,
|
||||
} from '@/core/settings/memoir-reading-settings';
|
||||
import type { ImageAsset } from './types';
|
||||
|
||||
const PLACEHOLDER_RE = /\{\{\{\{IMAGE:(.*?)\}\}\}\}|\{\{IMAGE:(.*?)\}\}/g;
|
||||
@@ -197,8 +201,8 @@ export interface MarkdownRendererProps {
|
||||
markdown: string;
|
||||
renderedAssets: ImageAsset[];
|
||||
coverImageUrl: string | null;
|
||||
fontSize: 'small' | 'default' | 'large';
|
||||
fontFamily: 'serif' | 'sans';
|
||||
fontSize: MemoirReadingFontSize;
|
||||
fontFamily: MemoirReadingFontFamily;
|
||||
backgroundColor: string;
|
||||
contentWidth: number;
|
||||
/** 多故事分段时仅首段下沉首字 */
|
||||
|
||||
Reference in New Issue
Block a user