1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-02 14:49:16 +02:00

modified: package-lock.json

modified:   package.json
	modified:   src/annotations.js
This commit is contained in:
Victor Soares 2024-03-25 20:05:27 -03:00
parent 73ad6da5a5
commit 7f04a1b4a1
3 changed files with 18 additions and 4 deletions

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "@victorsoares96/epubjs", "name": "@victorsoares96/epubjs",
"version": "0.3.96", "version": "0.3.98",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@victorsoares96/epubjs", "name": "@victorsoares96/epubjs",
"version": "0.3.96", "version": "0.3.98",
"license": "BSD-2-Clause", "license": "BSD-2-Clause",
"dependencies": { "dependencies": {
"@types/localforage": "0.0.34", "@types/localforage": "0.0.34",

View file

@ -1,6 +1,6 @@
{ {
"name": "@victorsoares96/epubjs", "name": "@victorsoares96/epubjs",
"version": "0.3.97", "version": "0.3.98",
"description": "Parse and Render Epubs", "description": "Parse and Render Epubs",
"main": "lib/index.js", "main": "lib/index.js",
"module": "src/index.js", "module": "src/index.js",

View file

@ -47,6 +47,18 @@ class Annotations {
this._annotations[hash] = annotation; this._annotations[hash] = annotation;
if (type === "highlight") {
this.highlights.push(annotation);
}
if (type === "underline") {
this.underlines.push(annotation);
}
if (type === "mark") {
this.marks.push(annotation);
}
if (sectionIndex in this._annotationsBySectionIndex) { if (sectionIndex in this._annotationsBySectionIndex) {
this._annotationsBySectionIndex[sectionIndex].push(hash); this._annotationsBySectionIndex[sectionIndex].push(hash);
} else { } else {
@ -146,7 +158,9 @@ class Annotations {
* iterate over annotations in the store * iterate over annotations in the store
*/ */
each () { each () {
return this._annotations.forEach.apply(this._annotations, arguments); const annotations = [...this.highlights, ...this.underlines, ...this.marks];
return annotations;
} }
/** /**