Remove unused components and models for improved maintainability

- Deleted redundant components (`AddActionButton`, `AlertBox`, `AlertStack`, `BackButton`, `CancelButton`, and `CollapsableArea`) and related files.
- Removed unused models (`Book`, `BookSerie`, `BookTables`, `Character`, and `Chapter`) to reduce codebase clutter.
- Updated project structure and references to reflect these removals.
This commit is contained in:
natreex
2026-03-22 22:37:31 -04:00
parent e8aaef108b
commit 64ed90d993
229 changed files with 15091 additions and 21289 deletions

27
lib/utils/html.ts Normal file
View File

@@ -0,0 +1,27 @@
export function formatHTMLContent(htmlContent: string): string {
return htmlContent
.replace(/<h1>/g, '<h1 style="color: var(--color-text-primary); text-indent: 5px; font-size: 28px; font-weight: bold; text-align: left; margin-vertical: 10px;">')
.replace(/<p>/g, '<p style="color: var(--color-editor-text); text-indent: 30px; font-size: 16px; line-height: 22px; margin-vertical: 5px;">')
.replace(/<blockquote>/g, '<blockquote style="border-left-width: 4px; border-left-color: var(--color-gray-light); padding-left: 10px; font-style: italic; color: var(--color-text-dimmed);">');
}
export function textContentToHtml(content: string): string {
const paragraphs: string[] = content
.split(/\n+/)
.map((paragraph: string) => paragraph.trim())
.filter((paragraph: string) => paragraph.length > 0);
return paragraphs
.map((paragraph: string) => `<p>${paragraph}</p>`)
.join('');
}
export function htmlToText(html: string): string {
return html
.replace(/<br\s*\/?>/gi, '\n')
.replace(/<\/?(p|h[1-6]|div)(\s+[^>]*)?>/gi, '\n')
.replace(/<\/?[^>]+(>|$)/g, '')
.replace(/(\n\s*){2,}/g, '\n\n')
.replace(/^\s+|\s+$|(?<=\s)\s+/g, '')
.trim();
}