Skip to content

Commit 5030bf7

Browse files
committed
TEST: Readme, stylesheet update; eBook sidebar fix
1 parent 17b76a2 commit 5030bf7

File tree

11 files changed

+766
-626
lines changed

11 files changed

+766
-626
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"sass-embedded": "^1.77.8",
7070
"tailwindcss": "^3.4.10",
7171
"tailwindcss-animated": "^1.1.2",
72+
"terser": "^5.34.1",
7273
"util": "^0.12.5",
7374
"vite": "^5.4.0",
7475
"vite-plugin-sass-dts": "^1.3.25",

src/ReactDocumentViewer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import _PdfViewer from './plugins/pdf';
44
import _SheetViewer from './plugins/msexcel';
55
import _DocxViewer from './plugins/msdocx';
66
import _ImgViewer from './plugins/img';
7-
import _EbookViewer from './plugins/epub';
7+
import _EbookViewer from './plugins/ebook';
88
import { getfileTypeExtesions, getFileType } from './utils.js';
99
import { useTranslation } from 'react-i18next';
1010
import i18nInit from './locales';

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import "./scss/index.scss";
22
import ReactDocumentViewer from "./ReactDocumentViewer";
33

4+
window.ReactDocumentViewer = ReactDocumentViewer;
5+
46
if (process.env.NODE_ENV !== "production") {
57
window.addEventListener("load", () => {
68
window.ReactDocumentViewer = new ReactDocumentViewer({
79
rootElement: document.getElementById("root"),
810
// files: [],
911
files: [
10-
{ src: "/docs/test.mobi", fileName: "Image #1" },
12+
{ src: "/docs/test.epub", fileName: "Image #1" },
1113
{ src: "/docs/test.webp", fileName: "Image #2" },
1214
],
1315
downloadInNewWindow: false,

src/plugins/epub/index.tsx renamed to src/plugins/ebook/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export default (props: ViewerPluginProps) => {
227227
};
228228

229229
const showSidebar = (show: boolean) => {
230-
const sidebar = document.querySelector('div.sidebar');
230+
const sidebar = document.querySelector('div.doc-viewer .sidebar');
231231
if (show) {
232232
sidebar?.classList.add('visible');
233233
setSidebarShown(true);
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/scss/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ div:not(span):where(.doc-viewer),
903903
}
904904

905905
.sidebar {
906-
@apply w-52 absolute -left-56 top-11 bottom-0 z-20
906+
@apply w-52 h-full absolute -left-56 top-11 bottom-0 z-20
907907
bg-black opacity-90 transition-all duration-300 p-0
908908
flex flex-col items-center text-gray-300
909909
overflow-hidden px-1 shadow-lg;

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
"skipLibCheck": true,
1515
"target": "ES2015",
1616
"types": ["node"],
17-
"allowJs": true,
17+
"allowJs": true
1818
}
1919
}

0 commit comments

Comments
 (0)