Update EPUBViewer.tsx
This commit is contained in:
parent
381d5c8048
commit
84c5d3abcf
1 changed files with 20 additions and 2 deletions
|
|
@ -22,6 +22,7 @@ export function EPUBViewer({ className = '' }: EPUBViewerProps) {
|
||||||
const {
|
const {
|
||||||
currDocData,
|
currDocData,
|
||||||
currDocName,
|
currDocName,
|
||||||
|
currDocText, // added for Fork1
|
||||||
locationRef,
|
locationRef,
|
||||||
handleLocationChanged,
|
handleLocationChanged,
|
||||||
bookRef,
|
bookRef,
|
||||||
|
|
@ -59,7 +60,7 @@ export function EPUBViewer({ className = '' }: EPUBViewerProps) {
|
||||||
registerLocationChangeHandler(handleLocationChanged);
|
registerLocationChangeHandler(handleLocationChanged);
|
||||||
}, [registerLocationChangeHandler, handleLocationChanged]);
|
}, [registerLocationChangeHandler, handleLocationChanged]);
|
||||||
|
|
||||||
if (!currDocData) {
|
if (!currDocData) {
|
||||||
return <DocumentSkeleton />;
|
return <DocumentSkeleton />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -82,6 +83,23 @@ export function EPUBViewer({ className = '' }: EPUBViewerProps) {
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Plain-text mirror of the current EPUB page for tools like Migaku */}
|
||||||
|
{currDocText && (
|
||||||
|
<div
|
||||||
|
id="migaku-epub-plain-text"
|
||||||
|
aria-hidden="true"
|
||||||
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
left: '-99999px',
|
||||||
|
top: '0',
|
||||||
|
whiteSpace: 'pre-wrap',
|
||||||
|
pointerEvents: 'none',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{currDocText}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue