@d-i-t-a/reader 2.0.2 → 2.0.3
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/README.md +42 -3
- package/dist/esm/index.js +48 -54
- package/dist/esm/index.js.map +2 -2
- package/dist/reader.js +2 -2
- package/dist/reader.js.map +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,13 +46,44 @@ Here is the original proposal, initiated by Aferdita Muriqi to the
|
|
|
46
46
|
|
|
47
47
|
Subsequent development of R2D2BC has been supported by [DITA](https://github.com/d-i-t-a), [Bokbasen](https://www.bokbasen.no/), and [CAST](http://www.cast.org) - which explains the D2, B, and C in the name.
|
|
48
48
|
|
|
49
|
+
# Features & Functionalities
|
|
50
|
+
- ePub Reflowable + Fixed Layout
|
|
51
|
+
- Reader Settings
|
|
52
|
+
- Configurable Modules with Callbacks
|
|
53
|
+
- Injectable Fonts, CSS, Javascript
|
|
54
|
+
- Text Selection with Injectable Context Menu
|
|
55
|
+
- Bookmarks
|
|
56
|
+
- Highlights
|
|
57
|
+
- Annotations
|
|
58
|
+
- TTS - Text to speech / Read Aloud
|
|
59
|
+
- Media Overlays - Read Along
|
|
60
|
+
- Search
|
|
61
|
+
- Content Protection
|
|
62
|
+
- Definitions
|
|
63
|
+
- Popup Footnotes
|
|
64
|
+
- Page Breaks - Page Numbers in margin
|
|
65
|
+
- Sample Read
|
|
66
|
+
- Timeline
|
|
67
|
+
- Layers
|
|
68
|
+
- Line Focus (Beta Feature)
|
|
69
|
+
- Popups and Popovers
|
|
70
|
+
|
|
49
71
|
# Extensions and Implementations
|
|
50
72
|
|
|
51
73
|
The R2D2BC reader has been used in:
|
|
52
74
|
- The [Clusive](https://github.com/cast-org/clusive) learning environment
|
|
53
|
-
- Bokbasen's [Allbok.no](https://www.allbok.no)
|
|
54
|
-
-
|
|
55
|
-
- The
|
|
75
|
+
- Bokbasen's [Allbok.no](https://www.allbok.no)
|
|
76
|
+
- Allvir's [Allvit.no](https://www.allvit.no) Reading Platform
|
|
77
|
+
- The UNODC [Fieldguides](https://fieldguides.github.io/library)
|
|
78
|
+
- The DITA Gateway [D2G](https://d2g.dita.digital) with several open collections
|
|
79
|
+
- [Ekitabu's](https://d2g.dita.digital) Web Reader Implementations through Dita Gateway
|
|
80
|
+
- [NYPL's](https://www.nypl.org/) Web Reader Implementations
|
|
81
|
+
- Bibliotheca's [CloudLibrary](https://www.yourcloudlibrary.com) as Sample Reader and Full ePub Reader
|
|
82
|
+
- Above the Treeline's [Edeweiss+](https://www.edelweiss.plus)
|
|
83
|
+
- [Bluefire's](https://www.bluefirereader.com) Web Reader Implementations
|
|
84
|
+
- In a Project in the Meta Verse (to be named once public)
|
|
85
|
+
- and a few more... :)
|
|
86
|
+
|
|
56
87
|
|
|
57
88
|
# Contributing
|
|
58
89
|
Contributions are always welcomed! Please see [CONTRIBUTING](CONTRIBUTING.md) for detailed guidelines.
|
|
@@ -70,5 +101,13 @@ npm run build && npm run examples
|
|
|
70
101
|
```
|
|
71
102
|
Then visit `http://localhost:4444/`. Follow the prompts to view example apps.
|
|
72
103
|
|
|
104
|
+
### WIKI
|
|
105
|
+
- [Implementation Guides and Examples](https://github.com/d-i-t-a/R2D2BC/wiki)
|
|
106
|
+
|
|
107
|
+
### Migration Guides
|
|
108
|
+
- [Version 1.x -> 2.x](MIGRATION.md)
|
|
109
|
+
### Change Log
|
|
110
|
+
- [2.0.x](CHANGELOG.md)
|
|
111
|
+
|
|
73
112
|
## Supporters
|
|
74
113
|
[<img src="https://dita.digital/jetbrains.png" width="60">](https://www.jetbrains.com/?from=R2D2BC)
|
package/dist/esm/index.js
CHANGED
|
@@ -52198,37 +52198,34 @@ var SearchModule = class {
|
|
|
52198
52198
|
}
|
|
52199
52199
|
let i = 0;
|
|
52200
52200
|
if (tocItem) {
|
|
52201
|
-
let href = this.publication.getAbsoluteHref(tocItem.Href);
|
|
52202
52201
|
let doc = this.delegate.iframes[0].contentDocument;
|
|
52203
52202
|
if (doc) {
|
|
52204
|
-
|
|
52205
|
-
|
|
52206
|
-
|
|
52207
|
-
|
|
52208
|
-
|
|
52209
|
-
|
|
52210
|
-
};
|
|
52211
|
-
setTimeout(() => {
|
|
52212
|
-
let highlight;
|
|
52213
|
-
if (i === index2) {
|
|
52214
|
-
highlight = this.createSearchHighlight(selectionInfo, this.properties?.current);
|
|
52215
|
-
this.jumpToMark(index2);
|
|
52216
|
-
} else {
|
|
52217
|
-
highlight = this.createSearchHighlight(selectionInfo, this.properties?.color);
|
|
52218
|
-
}
|
|
52219
|
-
searchItem.highlight = highlight;
|
|
52220
|
-
localSearchResultChapter.push(searchItem);
|
|
52221
|
-
this.currentChapterSearchResult.push(searchItem);
|
|
52222
|
-
this.currentSearchHighlights.push(highlight);
|
|
52223
|
-
i++;
|
|
52224
|
-
}, 500);
|
|
52225
|
-
});
|
|
52203
|
+
if (tocItem) {
|
|
52204
|
+
searchDocDomSeek(term, doc, tocItem.Href, tocItem.Title).then((result) => {
|
|
52205
|
+
result.forEach((searchItem) => {
|
|
52206
|
+
let selectionInfo = {
|
|
52207
|
+
rangeInfo: searchItem.rangeInfo
|
|
52208
|
+
};
|
|
52226
52209
|
setTimeout(() => {
|
|
52227
|
-
|
|
52210
|
+
let highlight;
|
|
52211
|
+
if (i === index2) {
|
|
52212
|
+
highlight = this.createSearchHighlight(selectionInfo, this.properties?.current);
|
|
52213
|
+
this.jumpToMark(index2);
|
|
52214
|
+
} else {
|
|
52215
|
+
highlight = this.createSearchHighlight(selectionInfo, this.properties?.color);
|
|
52216
|
+
}
|
|
52217
|
+
searchItem.highlight = highlight;
|
|
52218
|
+
localSearchResultChapter.push(searchItem);
|
|
52219
|
+
this.currentChapterSearchResult.push(searchItem);
|
|
52220
|
+
this.currentSearchHighlights.push(highlight);
|
|
52221
|
+
i++;
|
|
52228
52222
|
}, 500);
|
|
52229
52223
|
});
|
|
52230
|
-
|
|
52231
|
-
|
|
52224
|
+
setTimeout(() => {
|
|
52225
|
+
callback(localSearchResultChapter);
|
|
52226
|
+
}, 500);
|
|
52227
|
+
});
|
|
52228
|
+
}
|
|
52232
52229
|
}
|
|
52233
52230
|
}
|
|
52234
52231
|
}
|
|
@@ -57565,37 +57562,34 @@ var DefinitionsModule = class {
|
|
|
57565
57562
|
}
|
|
57566
57563
|
let localSearchDefinitions = [];
|
|
57567
57564
|
if (tocItem) {
|
|
57568
|
-
const
|
|
57569
|
-
|
|
57570
|
-
|
|
57571
|
-
|
|
57572
|
-
|
|
57573
|
-
|
|
57574
|
-
|
|
57575
|
-
|
|
57576
|
-
|
|
57577
|
-
|
|
57578
|
-
|
|
57579
|
-
|
|
57580
|
-
|
|
57581
|
-
|
|
57582
|
-
|
|
57583
|
-
|
|
57584
|
-
|
|
57585
|
-
|
|
57586
|
-
|
|
57587
|
-
|
|
57588
|
-
this.currentChapterPopupResult.push(searchItem);
|
|
57589
|
-
this.currentPopupHighlights.push(highlight);
|
|
57590
|
-
}
|
|
57591
|
-
});
|
|
57592
|
-
if (tindex === item.terms.length - 1) {
|
|
57593
|
-
callback(localSearchDefinitions);
|
|
57565
|
+
for (const termKey of item.terms) {
|
|
57566
|
+
const tindex = item.terms.indexOf(termKey);
|
|
57567
|
+
if (tocItem) {
|
|
57568
|
+
await searchDocDomSeek(termKey, this.delegate.iframes[0].contentDocument, tocItem.Href, tocItem.Title, this.delegate.definitionsModule?.properties.fullWordSearch).then((result) => {
|
|
57569
|
+
let i = void 0;
|
|
57570
|
+
if (item.result == 1) {
|
|
57571
|
+
i = 0;
|
|
57572
|
+
} else if (item.result == 2) {
|
|
57573
|
+
i = Math.floor(Math.random() * result.length - 1) + 1;
|
|
57574
|
+
}
|
|
57575
|
+
result.forEach((searchItem, index2) => {
|
|
57576
|
+
if (i === void 0 || i === index2) {
|
|
57577
|
+
const selectionInfo = {
|
|
57578
|
+
rangeInfo: searchItem.rangeInfo
|
|
57579
|
+
};
|
|
57580
|
+
const highlight = this.createDefinitionHighlight(selectionInfo, item);
|
|
57581
|
+
searchItem.highlight = highlight;
|
|
57582
|
+
localSearchDefinitions.push(lodash3.omit(highlight, "definition"));
|
|
57583
|
+
this.currentChapterPopupResult.push(searchItem);
|
|
57584
|
+
this.currentPopupHighlights.push(highlight);
|
|
57594
57585
|
}
|
|
57595
57586
|
});
|
|
57596
|
-
|
|
57587
|
+
if (tindex === item.terms.length - 1) {
|
|
57588
|
+
callback(localSearchDefinitions);
|
|
57589
|
+
}
|
|
57590
|
+
});
|
|
57597
57591
|
}
|
|
57598
|
-
}
|
|
57592
|
+
}
|
|
57599
57593
|
}
|
|
57600
57594
|
}
|
|
57601
57595
|
async define(item) {
|