vue-book-reader 1.2.2 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-book-reader",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "type": "module",
5
5
  "main": "lib/vue-book-reader.umd.js",
6
6
  "module": "lib/vue-book-reader.es.js",
@@ -9,21 +9,26 @@
9
9
  ],
10
10
  "keywords": [
11
11
  "vue3",
12
+ "ebook",
12
13
  "reader",
14
+ "foliate-js",
13
15
  "ebooks",
14
16
  "epub",
15
17
  "MOBI",
16
18
  "KF8",
17
19
  "AZW3",
18
20
  "FB2",
19
- "CBZ"
21
+ "CBZ",
22
+ "PDF"
20
23
  ],
24
+ "license": "Apache",
21
25
  "homepage": "https://jinhuan138.github.io/vue-book-reader/",
22
26
  "repository": {
23
27
  "type": "git",
24
28
  "url": "git@github.com:jinhuan138/vue-book-reader.git"
25
29
  },
26
30
  "scripts": {
31
+ "preinstall": "npx only-allow pnpm",
27
32
  "dev": "vite",
28
33
  "build": "vue-tsc && vite build",
29
34
  "preview": "vite preview",
@@ -33,24 +38,25 @@
33
38
  "docs:build": "npm -C docs run docs:build",
34
39
  "docs:preview": "npm -C docs run docs:preview"
35
40
  },
36
- "license": "ISC",
37
41
  "devDependencies": {
42
+ "@types/node": "^25.2.0",
38
43
  "@vitejs/plugin-vue": "^5.0.4",
44
+ "only-allow": "^1.2.2",
39
45
  "pdfjs-dist": "^4.7.76",
40
46
  "prettier": "^3.2.5",
47
+ "rollup-plugin-visualizer": "^6.0.5",
41
48
  "typescript": "^5.4.5",
42
- "vite": "^5.4.20",
49
+ "vite": "^7.3.1",
43
50
  "vite-plugin-lib-inject-css": "^2.2.2",
44
- "vue": "^3.4.21",
45
- "vue-book-reader": "^1.1.8",
51
+ "vite-plugin-static-copy": "^3.2.0",
52
+ "vue": "^3.5.27",
46
53
  "vue-tsc": "^2.0.6"
47
54
  },
48
55
  "browser": {
49
56
  "canvas": false
50
57
  },
51
58
  "packageManager": "pnpm@9.6.0",
52
- "preinstall": "npx only-allow pnpm",
53
59
  "dependencies": {
54
60
  "core-js": "^3.47.0"
55
61
  }
56
- }
62
+ }
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const makeComicBook = ({ entries, loadBlob, getSize }, file) => {
4
- const cache = /* @__PURE__ */ new Map();
5
- const urls = /* @__PURE__ */ new Map();
6
- const load = async (name) => {
7
- if (cache.has(name)) return cache.get(name);
8
- const src = URL.createObjectURL(await loadBlob(name));
9
- const page = URL.createObjectURL(
10
- new Blob([`<!DOCTYPE html><html><head><meta charset="utf-8"></head><body style="margin: 0"><img src="${src}"></body></html>`], { type: "text/html" })
11
- );
12
- urls.set(name, [src, page]);
13
- cache.set(name, page);
14
- return page;
15
- };
16
- const unload = (name) => {
17
- var _a, _b;
18
- (_b = (_a = urls.get(name)) == null ? void 0 : _a.forEach) == null ? void 0 : _b.call(_a, (url) => URL.revokeObjectURL(url));
19
- urls.delete(name);
20
- cache.delete(name);
21
- };
22
- const exts = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".svg", ".jxl", ".avif"];
23
- const files = entries.map((entry) => entry.filename).filter((name) => exts.some((ext) => name.endsWith(ext))).sort();
24
- if (!files.length) throw new Error("No supported image files in archive");
25
- const book = {};
26
- book.getCover = () => loadBlob(files[0]);
27
- book.metadata = { title: file.name };
28
- book.sections = files.map((name) => ({
29
- id: name,
30
- load: () => load(name),
31
- unload: () => unload(name),
32
- size: getSize(name)
33
- }));
34
- book.toc = files.map((name) => ({ label: name, href: name }));
35
- book.rendition = { layout: "pre-paginated" };
36
- book.resolveHref = (href) => ({ index: book.sections.findIndex((s) => s.id === href) });
37
- book.splitTOCHref = (href) => [href, null];
38
- book.getTOCFragment = (doc) => doc.documentElement;
39
- book.destroy = () => {
40
- for (const arr of urls.values())
41
- for (const url of arr) URL.revokeObjectURL(url);
42
- };
43
- return book;
44
- };
45
- exports.makeComicBook = makeComicBook;
@@ -1,45 +0,0 @@
1
- const makeComicBook = ({ entries, loadBlob, getSize }, file) => {
2
- const cache = /* @__PURE__ */ new Map();
3
- const urls = /* @__PURE__ */ new Map();
4
- const load = async (name) => {
5
- if (cache.has(name)) return cache.get(name);
6
- const src = URL.createObjectURL(await loadBlob(name));
7
- const page = URL.createObjectURL(
8
- new Blob([`<!DOCTYPE html><html><head><meta charset="utf-8"></head><body style="margin: 0"><img src="${src}"></body></html>`], { type: "text/html" })
9
- );
10
- urls.set(name, [src, page]);
11
- cache.set(name, page);
12
- return page;
13
- };
14
- const unload = (name) => {
15
- var _a, _b;
16
- (_b = (_a = urls.get(name)) == null ? void 0 : _a.forEach) == null ? void 0 : _b.call(_a, (url) => URL.revokeObjectURL(url));
17
- urls.delete(name);
18
- cache.delete(name);
19
- };
20
- const exts = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".svg", ".jxl", ".avif"];
21
- const files = entries.map((entry) => entry.filename).filter((name) => exts.some((ext) => name.endsWith(ext))).sort();
22
- if (!files.length) throw new Error("No supported image files in archive");
23
- const book = {};
24
- book.getCover = () => loadBlob(files[0]);
25
- book.metadata = { title: file.name };
26
- book.sections = files.map((name) => ({
27
- id: name,
28
- load: () => load(name),
29
- unload: () => unload(name),
30
- size: getSize(name)
31
- }));
32
- book.toc = files.map((name) => ({ label: name, href: name }));
33
- book.rendition = { layout: "pre-paginated" };
34
- book.resolveHref = (href) => ({ index: book.sections.findIndex((s) => s.id === href) });
35
- book.splitTOCHref = (href) => [href, null];
36
- book.getTOCFragment = (doc) => doc.documentElement;
37
- book.destroy = () => {
38
- for (const arr of urls.values())
39
- for (const url of arr) URL.revokeObjectURL(url);
40
- };
41
- return book;
42
- };
43
- export {
44
- makeComicBook
45
- };