@d-i-t-a/reader 2.4.9 → 2.5.0
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 +66 -59
- package/dist/esm/index.js +64489 -40503
- package/dist/esm/index.js.map +4 -4
- package/dist/images/altText_add.svg +3 -0
- package/dist/images/altText_disclaimer.svg +3 -0
- package/dist/images/altText_done.svg +3 -0
- package/dist/images/altText_spinner.svg +30 -0
- package/dist/images/altText_warning.svg +3 -0
- package/dist/images/annotation-check.svg +11 -0
- package/dist/images/annotation-comment.svg +16 -0
- package/dist/images/annotation-help.svg +26 -0
- package/dist/images/annotation-insert.svg +10 -0
- package/dist/images/annotation-key.svg +11 -0
- package/dist/images/annotation-newparagraph.svg +11 -0
- package/dist/images/annotation-noicon.svg +7 -0
- package/dist/images/annotation-note.svg +42 -0
- package/dist/images/annotation-paperclip.svg +6 -0
- package/dist/images/annotation-paragraph.svg +16 -0
- package/dist/images/annotation-pushpin.svg +7 -0
- package/dist/images/checkmark.svg +5 -0
- package/dist/images/comment-actionsButton.svg +3 -0
- package/dist/images/comment-closeButton.svg +3 -0
- package/dist/images/comment-editButton.svg +8 -0
- package/dist/images/comment-popup-editButton.svg +5 -0
- package/dist/images/cursor-editorFreeHighlight.svg +6 -0
- package/dist/images/cursor-editorFreeText.svg +3 -0
- package/dist/images/cursor-editorInk.svg +4 -0
- package/dist/images/cursor-editorTextHighlight.svg +8 -0
- package/dist/images/editor-toolbar-delete.svg +5 -0
- package/dist/images/editor-toolbar-edit.svg +3 -0
- package/dist/images/findbarButton-next.svg +3 -0
- package/dist/images/findbarButton-previous.svg +3 -0
- package/dist/images/gv-toolbarButton-download.svg +3 -0
- package/dist/images/loading-icon.gif +0 -0
- package/dist/images/loading.svg +1 -0
- package/dist/images/messageBar_closingButton.svg +3 -0
- package/dist/images/messageBar_info.svg +3 -0
- package/dist/images/messageBar_warning.svg +3 -0
- package/dist/images/pages_closeButton.svg +3 -0
- package/dist/images/pages_selected.svg +7 -0
- package/dist/images/pages_viewArrow.svg +3 -0
- package/dist/images/pages_viewButton.svg +3 -0
- package/dist/images/secondaryToolbarButton-documentProperties.svg +3 -0
- package/dist/images/secondaryToolbarButton-firstPage.svg +3 -0
- package/dist/images/secondaryToolbarButton-handTool.svg +3 -0
- package/dist/images/secondaryToolbarButton-lastPage.svg +3 -0
- package/dist/images/secondaryToolbarButton-rotateCcw.svg +3 -0
- package/dist/images/secondaryToolbarButton-rotateCw.svg +3 -0
- package/dist/images/secondaryToolbarButton-scrollHorizontal.svg +3 -0
- package/dist/images/secondaryToolbarButton-scrollPage.svg +3 -0
- package/dist/images/secondaryToolbarButton-scrollVertical.svg +3 -0
- package/dist/images/secondaryToolbarButton-scrollWrapped.svg +3 -0
- package/dist/images/secondaryToolbarButton-selectTool.svg +3 -0
- package/dist/images/secondaryToolbarButton-spreadEven.svg +3 -0
- package/dist/images/secondaryToolbarButton-spreadNone.svg +3 -0
- package/dist/images/secondaryToolbarButton-spreadOdd.svg +3 -0
- package/dist/images/toolbarButton-bookmark.svg +3 -0
- package/dist/images/toolbarButton-currentOutlineItem.svg +3 -0
- package/dist/images/toolbarButton-download.svg +4 -0
- package/dist/images/toolbarButton-editorFreeText.svg +5 -0
- package/dist/images/toolbarButton-editorHighlight.svg +6 -0
- package/dist/images/toolbarButton-editorInk.svg +4 -0
- package/dist/images/toolbarButton-editorSignature.svg +6 -0
- package/dist/images/toolbarButton-editorStamp.svg +8 -0
- package/dist/images/toolbarButton-menuArrow.svg +3 -0
- package/dist/images/toolbarButton-openFile.svg +3 -0
- package/dist/images/toolbarButton-pageDown.svg +3 -0
- package/dist/images/toolbarButton-pageUp.svg +3 -0
- package/dist/images/toolbarButton-presentationMode.svg +3 -0
- package/dist/images/toolbarButton-print.svg +3 -0
- package/dist/images/toolbarButton-search.svg +3 -0
- package/dist/images/toolbarButton-secondaryToolbarToggle.svg +3 -0
- package/dist/images/toolbarButton-viewAttachments.svg +3 -0
- package/dist/images/toolbarButton-viewLayers.svg +3 -0
- package/dist/images/toolbarButton-viewOutline.svg +3 -0
- package/dist/images/toolbarButton-viewThumbnail.svg +3 -0
- package/dist/images/toolbarButton-viewsManagerToggle.svg +3 -0
- package/dist/images/toolbarButton-zoomIn.svg +3 -0
- package/dist/images/toolbarButton-zoomOut.svg +3 -0
- package/dist/images/treeitem-collapsed.svg +1 -0
- package/dist/images/treeitem-expanded.svg +1 -0
- package/dist/injectables/click/click.js +637 -153
- package/dist/injectables/click/click.js.map +4 -4
- package/dist/pdf.worker.min.mjs +28 -0
- package/dist/pdf_viewer.css +7129 -0
- package/dist/reader.css +1 -1
- package/dist/reader.css.map +1 -1
- package/dist/reader.js +572 -59
- package/dist/reader.js.map +4 -4
- package/dist/types/index.d.ts +5 -1
- package/dist/types/model/user-settings/ReadiumCSS.d.ts +14 -0
- package/dist/types/model/user-settings/UserProperties.d.ts +1 -1
- package/dist/types/model/user-settings/UserSettings.d.ts +26 -2
- package/dist/types/modules/AnnotationModule.d.ts +2 -2
- package/dist/types/modules/BookmarkModule.d.ts +2 -2
- package/dist/types/modules/ReaderModule.d.ts +6 -0
- package/dist/types/modules/citation/CitationModule.d.ts +21 -5
- package/dist/types/modules/highlight/TextHighlighter.d.ts +2 -0
- package/dist/types/modules/mediaoverlays/MediaOverlayModule.d.ts +4 -0
- package/dist/types/modules/protection/ContentProtectionModule.d.ts +1 -2
- package/dist/types/navigator/IFrameNavigator.d.ts +37 -16
- package/dist/types/navigator/Navigator.d.ts +25 -22
- package/dist/types/navigator/PDFNavigator.d.ts +140 -17
- package/dist/types/reader.d.ts +23 -7
- package/dist/types/store/Annotator.d.ts +26 -22
- package/dist/types/store/LocalAnnotator.d.ts +5 -4
- package/dist/types/store/LocalStorageStore.d.ts +4 -4
- package/dist/types/utils/EventHandler.d.ts +1 -3
- package/dist/types/views/BookView.d.ts +1 -0
- package/dist/types/views/ReflowableBookView.d.ts +7 -0
- package/package.json +49 -58
package/README.md
CHANGED
|
@@ -4,27 +4,51 @@
|
|
|
4
4
|
|
|
5
5
|
# R2D2BC
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
**R2D2BC** is an implementation of the [Readium v2](https://github.com/readium/architecture) EPUB reader for the web.
|
|
9
|
-
It is built as a modular toolkit (rather than a full-featured app) so that applications can use it to
|
|
10
|
-
handle
|
|
7
|
+
## Introduction
|
|
8
|
+
**R2D2BC** is an implementation of the [Readium v2](https://github.com/readium/architecture) EPUB and PDF reader for the web.
|
|
9
|
+
It is built as a modular toolkit (rather than a full-featured app) so that applications can use it to
|
|
10
|
+
handle publication-related functions while customizing their own design, user interface, and extensions.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
## Goals
|
|
13
13
|
|
|
14
14
|
- Follow the Readium architecture specification for best interoperability
|
|
15
|
-
- Allow maximum configurability via API methods, callbacks, code and style injection, and clear separation of functions
|
|
16
|
-
- Modularity
|
|
15
|
+
- Allow maximum configurability via API methods, callbacks, code and style injection, and clear separation of functions
|
|
16
|
+
- Modularity
|
|
17
17
|
- Clarity of code and ease of maintenance
|
|
18
18
|
- Speed
|
|
19
19
|
- Accessibility
|
|
20
20
|
- Free and open source
|
|
21
21
|
|
|
22
|
-
The R2D2BC project intentionally includes only a
|
|
22
|
+
The R2D2BC project intentionally includes only a bare-bones demonstration user interface, and no sample content.
|
|
23
23
|
Any implementer can add their own functionality and design without refactoring the whole project.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
## Features
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
- EPUB Reflowable + Fixed Layout
|
|
28
|
+
- PDF (via pdfjs-dist v5)
|
|
29
|
+
- Reader Settings (font, size, spacing, colors, layout, margins)
|
|
30
|
+
- Configurable Modules with Callbacks
|
|
31
|
+
- Injectable Fonts, CSS, JavaScript
|
|
32
|
+
- Text Selection with Injectable Context Menu
|
|
33
|
+
- Bookmarks
|
|
34
|
+
- Highlights (configurable colors)
|
|
35
|
+
- Annotations
|
|
36
|
+
- TTS - Text to Speech / Read Aloud
|
|
37
|
+
- Media Overlays - Read Along (with click-to-advance)
|
|
38
|
+
- Search
|
|
39
|
+
- Content Protection
|
|
40
|
+
- Definitions
|
|
41
|
+
- Popup Footnotes
|
|
42
|
+
- Page Breaks - Page Numbers in margin
|
|
43
|
+
- Sample Read
|
|
44
|
+
- Timeline
|
|
45
|
+
- Consumption Tracking
|
|
46
|
+
- Layers
|
|
47
|
+
- Line Focus
|
|
48
|
+
- History Navigation
|
|
49
|
+
- Citations
|
|
50
|
+
|
|
51
|
+
## Architecture
|
|
28
52
|
|
|
29
53
|
This project implements most components of the [Readium Architecture](https://github.com/readium/architecture):
|
|
30
54
|
|
|
@@ -32,82 +56,65 @@ This project implements most components of the [Readium Architecture](https://gi
|
|
|
32
56
|
- Implements UserSettings
|
|
33
57
|
- Implements Webpub Manifest
|
|
34
58
|
- Implements the Readium shared models
|
|
35
|
-
- Integrates Readium CSS
|
|
36
|
-
-
|
|
59
|
+
- Integrates Readium CSS v1.1.1
|
|
60
|
+
- Implements Navigator for reflowable and fixed-layout publications
|
|
61
|
+
- Implements PDF Navigator (pdfjs-dist v5)
|
|
37
62
|
|
|
38
|
-
|
|
39
|
-
- Provides a decoupled Minimal UI
|
|
40
|
-
- Provides build system optimization (Webpack)
|
|
41
|
-
|
|
42
|
-
# Origins
|
|
63
|
+
## Origins
|
|
43
64
|
|
|
44
65
|
Here is the original proposal, initiated by Aferdita Muriqi to the
|
|
45
66
|
[Readium Weekly Eng Meeting - 05/22/2019](https://docs.google.com/document/d/1krNe8TUtvajpljcSS4nN_2cHfWO4_Hsag5LnJ4hj_CM/edit#)
|
|
46
67
|
|
|
47
68
|
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
69
|
|
|
49
|
-
|
|
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
|
-
|
|
71
|
-
# Extensions and Implementations
|
|
70
|
+
## Extensions and Implementations
|
|
72
71
|
|
|
73
72
|
The R2D2BC reader has been used in:
|
|
74
73
|
- The [Clusive](https://github.com/cast-org/clusive) learning environment
|
|
75
|
-
- Bokbasen's [Allbok.no](https://www.allbok.no)
|
|
74
|
+
- Bokbasen's [Allbok.no](https://www.allbok.no)
|
|
76
75
|
- Allvir's [Allvit.no](https://www.allvit.no) Reading Platform
|
|
77
76
|
- The UNODC [Fieldguides](https://fieldguides.github.io/library)
|
|
78
77
|
- The DITA Gateway [D2G](https://d2g.dita.digital) with several open collections
|
|
79
78
|
- [Ekitabu's](https://d2g.dita.digital) Web Reader Implementations through Dita Gateway
|
|
80
79
|
- [NYPL's](https://www.nypl.org/) Web Reader Implementations
|
|
81
80
|
- Bibliotheca's [CloudLibrary](https://www.yourcloudlibrary.com) as Sample Reader and Full ePub Reader
|
|
82
|
-
- Above the Treeline's [
|
|
81
|
+
- Above the Treeline's [Edelweiss+](https://www.edelweiss.plus)
|
|
83
82
|
- [Bluefire's](https://www.bluefirereader.com) Web Reader Implementations
|
|
84
|
-
-
|
|
85
|
-
- and a few more... :)
|
|
83
|
+
- and more...
|
|
86
84
|
|
|
85
|
+
## Get Started
|
|
87
86
|
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
```bash
|
|
88
|
+
npm install
|
|
89
|
+
npm run build && npm run examples
|
|
90
|
+
```
|
|
90
91
|
|
|
91
|
-
|
|
92
|
+
Then visit `http://localhost:4444/`. The landing page shows available publications and example viewers.
|
|
92
93
|
|
|
93
|
-
|
|
94
|
+
### Framework Examples
|
|
94
95
|
|
|
95
|
-
|
|
96
|
+
Examples are included for React, Vue, Angular, Next.js, Remix, and Vanilla JS:
|
|
96
97
|
|
|
98
|
+
```bash
|
|
99
|
+
npm run example:react
|
|
100
|
+
npm run example:vue
|
|
101
|
+
npm run example:angular
|
|
102
|
+
npm run example:vanilla
|
|
97
103
|
```
|
|
98
|
-
npm install
|
|
99
104
|
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
Then visit `http://localhost:4444/`. Follow the prompts to view example apps.
|
|
105
|
+
See [examples/README.md](examples/README.md) for full details.
|
|
103
106
|
|
|
104
|
-
|
|
105
|
-
- [Implementation Guides and Examples](https://github.com/d-i-t-a/R2D2BC/wiki)
|
|
107
|
+
## Documentation
|
|
106
108
|
|
|
107
|
-
|
|
108
|
-
- [
|
|
109
|
-
|
|
110
|
-
- [
|
|
109
|
+
- [Full Documentation](DOCUMENTATION.md)
|
|
110
|
+
- [Migration Guide: 1.x to 2.x](MIGRATION.md)
|
|
111
|
+
- [Changelog](CHANGELOG.md)
|
|
112
|
+
- [Examples Guide](examples/README.md)
|
|
113
|
+
|
|
114
|
+
## Contributing
|
|
115
|
+
|
|
116
|
+
Contributions are always welcomed! Please see [CONTRIBUTING](CONTRIBUTING.md) for detailed guidelines.
|
|
111
117
|
|
|
112
118
|
## Supporters
|
|
119
|
+
|
|
113
120
|
[<img src="https://dita.digital/jetbrains.png" width="60">](https://www.jetbrains.com/?from=R2D2BC)
|