cleanup
This commit is contained in:
parent
68fa3287d7
commit
5edae0e8ae
7 changed files with 10 additions and 19 deletions
|
|
@ -5,7 +5,7 @@
|
|||
"scripts": {
|
||||
"dev": "next dev --turbopack",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"start": "next start -p 3002",
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import "./globals.css";
|
||||
import { Providers } from "./providers";
|
||||
import TTSPlayer from "@/components/TTSPlayer";
|
||||
import { Metadata } from "next";
|
||||
import Script from "next/script";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "OpenReader WebUI",
|
||||
|
|
@ -17,13 +17,7 @@ export default function RootLayout({
|
|||
<html lang="en" suppressHydrationWarning>
|
||||
<head>
|
||||
<meta name="color-scheme" content="light dark" />
|
||||
<script src="/theme.js" />
|
||||
<style dangerouslySetInnerHTML={{ __html: `
|
||||
:root { color-scheme: light dark; }
|
||||
html.dark { color-scheme: dark; }
|
||||
html.light { color-scheme: light; }
|
||||
html { background: var(--background); }
|
||||
`}} />
|
||||
<Script src="/theme.js" strategy="beforeInteractive" />
|
||||
</head>
|
||||
<body className="antialiased">
|
||||
<Providers>
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ export function DocumentList() {
|
|||
</DialogTitle>
|
||||
<div className="mt-2">
|
||||
<p className="text-sm text-muted">
|
||||
Are you sure you want to delete "{documentToDelete?.name}"? This action cannot be undone.
|
||||
Are you sure you want to delete <span className='font-bold'>{documentToDelete?.name}</span>? This action cannot be undone.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ export function PDFViewer({ pdfData }: PDFViewerProps) {
|
|||
return () => {
|
||||
styleElement.remove();
|
||||
};
|
||||
}, []);
|
||||
}, [styleElement]);
|
||||
|
||||
useEffect(() => {
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
'use client';
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import { useTTS } from '@/contexts/TTSContext';
|
||||
import { Button, Listbox, ListboxButton, ListboxOptions, ListboxOption } from '@headlessui/react';
|
||||
import {
|
||||
|
|
@ -33,7 +32,6 @@ const speedOptions = [
|
|||
];
|
||||
|
||||
export default function TTSPlayer() {
|
||||
const [isVisible, setIsVisible] = useState(true);
|
||||
const {
|
||||
isPlaying,
|
||||
togglePlay,
|
||||
|
|
@ -51,8 +49,7 @@ export default function TTSPlayer() {
|
|||
|
||||
return (
|
||||
<div
|
||||
className={`fixed bottom-4 left-1/2 transform -translate-x-1/2 z-50 ${isVisible ? 'opacity-100' : 'opacity-0'
|
||||
} transition-opacity duration-300`}
|
||||
className={`fixed bottom-4 left-1/2 transform -translate-x-1/2 z-50 transition-opacity duration-300`}
|
||||
>
|
||||
<div className="bg-base dark:bg-base rounded-full shadow-lg px-4 py-1 flex items-center space-x-1 relative">
|
||||
<div className="relative">
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import stringSimilarity from 'string-similarity';
|
|||
import nlp from 'compromise';
|
||||
|
||||
// Add the correct type import
|
||||
import type { TextContent, TextItem } from 'pdfjs-dist/types/src/display/api';
|
||||
import type { TextItem } from 'pdfjs-dist/types/src/display/api';
|
||||
import { useConfig } from '@/contexts/ConfigContext';
|
||||
|
||||
// Set worker from public directory
|
||||
|
|
@ -232,7 +232,7 @@ export function PDFProvider({ children }: { children: ReactNode }) {
|
|||
|
||||
for (let i = 0; i < elements.length; i++) {
|
||||
let combinedText = '';
|
||||
let currentElements = [];
|
||||
const currentElements = [];
|
||||
for (let j = i; j < Math.min(i + 10, elements.length); j++) {
|
||||
const node = elements[j];
|
||||
const newText = combinedText ? `${combinedText} ${node.text}` : node.text;
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ export function TTSProvider({ children }: { children: React.ReactNode }) {
|
|||
const [audioContext, setAudioContext] = useState<AudioContextType>(null);
|
||||
const currentRequestRef = useRef<AbortController | null>(null);
|
||||
const [activeSource, setActiveSource] = useState<AudioBufferSourceNode | null>(null);
|
||||
const [audioQueue, setAudioQueue] = useState<AudioBuffer[]>([]);
|
||||
const [currentAudioIndex, setCurrentAudioIndex] = useState(0);
|
||||
const [audioQueue] = useState<AudioBuffer[]>([]);
|
||||
const [currentAudioIndex] = useState(0);
|
||||
const [isProcessing, setIsProcessing] = useState(false);
|
||||
const skipTriggeredRef = useRef(false);
|
||||
const skipTimeoutRef = useRef<NodeJS.Timeout | null>(null);
|
||||
|
|
|
|||
Loading…
Reference in a new issue