mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-02 14:49:16 +02:00
Update deps, fix build and toJSON methods
This commit is contained in:
parent
4ae139f40a
commit
6c8f02db9f
11 changed files with 5450 additions and 580 deletions
|
@ -2,7 +2,7 @@
|
||||||
"presets": [
|
"presets": [
|
||||||
["@babel/preset-env", {
|
["@babel/preset-env", {
|
||||||
"targets": "last 2 Chrome versions, last 2 Safari versions, last 2 ChromeAndroid versions, last 2 iOS versions, last 2 Firefox versions, last 2 Edge versions",
|
"targets": "last 2 Chrome versions, last 2 Safari versions, last 2 ChromeAndroid versions, last 2 iOS versions, last 2 Firefox versions, last 2 Edge versions",
|
||||||
"corejs": 3,
|
"corejs": "3.21",
|
||||||
"useBuiltIns": "usage",
|
"useBuiltIns": "usage",
|
||||||
"bugfixes": true,
|
"bugfixes": true,
|
||||||
"modules": "auto"
|
"modules": "auto"
|
||||||
|
|
5950
package-lock.json
generated
5950
package-lock.json
generated
File diff suppressed because it is too large
Load diff
20
package.json
20
package.json
|
@ -3,34 +3,34 @@
|
||||||
"version": "0.5.0",
|
"version": "0.5.0",
|
||||||
"description": "Parse and Render Epubs",
|
"description": "Parse and Render Epubs",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"module": "src/index.js",
|
|
||||||
"browser": "dist/epub.js",
|
"browser": "dist/epub.js",
|
||||||
|
"exports": "./src/index.js",
|
||||||
"types": "types/index.d.ts",
|
"types": "types/index.d.ts",
|
||||||
"repository": "https://github.com/futurepress/epub.js",
|
"repository": "https://github.com/futurepress/epub.js",
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "",
|
"test": "",
|
||||||
"lint": "eslint -c .eslintrc.js src; exit 0",
|
"lint": "eslint -c .eslintrc.js src; exit 0",
|
||||||
"start": "rollup -w -c rollup.server.config.js",
|
"start": "rollup -w -c rollup.server.config.js",
|
||||||
"build": "rollup -c",
|
"build": "rollup -c",
|
||||||
"compile": "babel src/ -d lib/",
|
"watch": "rollup -w -c rollup.config.js",
|
||||||
"watch": "babel --watch --optional runtime -d lib/ src/",
|
"prepare": "npm run build"
|
||||||
"prepare": "npm run compile && npm run build"
|
|
||||||
},
|
},
|
||||||
"author": "fchasen@gmail.com",
|
"author": "fchasen@gmail.com",
|
||||||
"license": "BSD-2-Clause",
|
"license": "BSD-2-Clause",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.16.7",
|
"@babel/core": "^7.17.9",
|
||||||
"@rollup/plugin-babel": "^5.3.0",
|
"@rollup/plugin-babel": "^5.3.1",
|
||||||
"@rollup/plugin-commonjs": "^21.0.1",
|
"@rollup/plugin-commonjs": "^21.0.3",
|
||||||
"@rollup/plugin-node-resolve": "^13.1.3",
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
||||||
"rollup": "^2.63.0",
|
"rollup": "^2.70.1",
|
||||||
"rollup-plugin-license": "^2.6.1",
|
"rollup-plugin-license": "^2.6.1",
|
||||||
"rollup-plugin-serve": "^1.1.0",
|
"rollup-plugin-serve": "^1.1.0",
|
||||||
"serve": "^13.0.2"
|
"serve": "^13.0.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@xmldom/xmldom": "^0.8.0",
|
"@xmldom/xmldom": "^0.8.2",
|
||||||
"jszip": "^3.7.1",
|
"jszip": "^3.9.1",
|
||||||
"lodash": "^4.17.21"
|
"lodash": "^4.17.21"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,7 +203,7 @@ class Epub extends Publication {
|
||||||
}
|
}
|
||||||
|
|
||||||
toJSON() {
|
toJSON() {
|
||||||
|
return super.toJSON();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -269,7 +269,7 @@ class PageList {
|
||||||
* @return {json}
|
* @return {json}
|
||||||
*/
|
*/
|
||||||
toJSON() {
|
toJSON() {
|
||||||
return JSON.stringify(this.locations);
|
return this.locations;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -14,7 +14,7 @@ class Locator {
|
||||||
name: item.name,
|
name: item.name,
|
||||||
parent: undefined,
|
parent: undefined,
|
||||||
children: new ResourceList()
|
children: new ResourceList()
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
get url() {
|
get url() {
|
||||||
|
@ -89,7 +89,7 @@ class Locator {
|
||||||
|
|
||||||
|
|
||||||
toJSON() {
|
toJSON() {
|
||||||
return JSON.stringify(this);
|
return this.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
|
|
|
@ -412,7 +412,7 @@ class Publication {
|
||||||
* Generates a JSON output of the publication structure
|
* Generates a JSON output of the publication structure
|
||||||
*/
|
*/
|
||||||
toJSON() {
|
toJSON() {
|
||||||
return JSON.stringify(this.data);
|
return this.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -124,7 +124,7 @@ class Resource {
|
||||||
|
|
||||||
|
|
||||||
toJSON() {
|
toJSON() {
|
||||||
|
return this.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
|
|
|
@ -188,7 +188,7 @@ class ResourceList extends Map {
|
||||||
}
|
}
|
||||||
|
|
||||||
toJSON() {
|
toJSON() {
|
||||||
return JSON.stringify(this.toArray());
|
return this.toArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
* @param {string} _query The query string to find
|
* @param {string} _query The query string to find
|
||||||
* @return {object[]} A list of matches, with form {cfi, excerpt}
|
* @return {object[]} A list of matches, with form {cfi, excerpt}
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
find(_query) {
|
find(_query) {
|
||||||
var section = this;
|
var section = this;
|
||||||
var matches = [];
|
var matches = [];
|
||||||
|
@ -54,3 +55,4 @@ find(_query){
|
||||||
|
|
||||||
return matches;
|
return matches;
|
||||||
}
|
}
|
||||||
|
*/
|
|
@ -203,10 +203,10 @@ class Sections {
|
||||||
}
|
}
|
||||||
|
|
||||||
toJSON() {
|
toJSON() {
|
||||||
return JSON.stringify({
|
return {
|
||||||
readingOrder: this.toOrderedArray(),
|
readingOrder: this.toOrderedArray(),
|
||||||
unordered: this.toUnorderedArray()
|
unordered: this.toUnorderedArray()
|
||||||
});
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue