@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.
Files changed (111) hide show
  1. package/README.md +66 -59
  2. package/dist/esm/index.js +64489 -40503
  3. package/dist/esm/index.js.map +4 -4
  4. package/dist/images/altText_add.svg +3 -0
  5. package/dist/images/altText_disclaimer.svg +3 -0
  6. package/dist/images/altText_done.svg +3 -0
  7. package/dist/images/altText_spinner.svg +30 -0
  8. package/dist/images/altText_warning.svg +3 -0
  9. package/dist/images/annotation-check.svg +11 -0
  10. package/dist/images/annotation-comment.svg +16 -0
  11. package/dist/images/annotation-help.svg +26 -0
  12. package/dist/images/annotation-insert.svg +10 -0
  13. package/dist/images/annotation-key.svg +11 -0
  14. package/dist/images/annotation-newparagraph.svg +11 -0
  15. package/dist/images/annotation-noicon.svg +7 -0
  16. package/dist/images/annotation-note.svg +42 -0
  17. package/dist/images/annotation-paperclip.svg +6 -0
  18. package/dist/images/annotation-paragraph.svg +16 -0
  19. package/dist/images/annotation-pushpin.svg +7 -0
  20. package/dist/images/checkmark.svg +5 -0
  21. package/dist/images/comment-actionsButton.svg +3 -0
  22. package/dist/images/comment-closeButton.svg +3 -0
  23. package/dist/images/comment-editButton.svg +8 -0
  24. package/dist/images/comment-popup-editButton.svg +5 -0
  25. package/dist/images/cursor-editorFreeHighlight.svg +6 -0
  26. package/dist/images/cursor-editorFreeText.svg +3 -0
  27. package/dist/images/cursor-editorInk.svg +4 -0
  28. package/dist/images/cursor-editorTextHighlight.svg +8 -0
  29. package/dist/images/editor-toolbar-delete.svg +5 -0
  30. package/dist/images/editor-toolbar-edit.svg +3 -0
  31. package/dist/images/findbarButton-next.svg +3 -0
  32. package/dist/images/findbarButton-previous.svg +3 -0
  33. package/dist/images/gv-toolbarButton-download.svg +3 -0
  34. package/dist/images/loading-icon.gif +0 -0
  35. package/dist/images/loading.svg +1 -0
  36. package/dist/images/messageBar_closingButton.svg +3 -0
  37. package/dist/images/messageBar_info.svg +3 -0
  38. package/dist/images/messageBar_warning.svg +3 -0
  39. package/dist/images/pages_closeButton.svg +3 -0
  40. package/dist/images/pages_selected.svg +7 -0
  41. package/dist/images/pages_viewArrow.svg +3 -0
  42. package/dist/images/pages_viewButton.svg +3 -0
  43. package/dist/images/secondaryToolbarButton-documentProperties.svg +3 -0
  44. package/dist/images/secondaryToolbarButton-firstPage.svg +3 -0
  45. package/dist/images/secondaryToolbarButton-handTool.svg +3 -0
  46. package/dist/images/secondaryToolbarButton-lastPage.svg +3 -0
  47. package/dist/images/secondaryToolbarButton-rotateCcw.svg +3 -0
  48. package/dist/images/secondaryToolbarButton-rotateCw.svg +3 -0
  49. package/dist/images/secondaryToolbarButton-scrollHorizontal.svg +3 -0
  50. package/dist/images/secondaryToolbarButton-scrollPage.svg +3 -0
  51. package/dist/images/secondaryToolbarButton-scrollVertical.svg +3 -0
  52. package/dist/images/secondaryToolbarButton-scrollWrapped.svg +3 -0
  53. package/dist/images/secondaryToolbarButton-selectTool.svg +3 -0
  54. package/dist/images/secondaryToolbarButton-spreadEven.svg +3 -0
  55. package/dist/images/secondaryToolbarButton-spreadNone.svg +3 -0
  56. package/dist/images/secondaryToolbarButton-spreadOdd.svg +3 -0
  57. package/dist/images/toolbarButton-bookmark.svg +3 -0
  58. package/dist/images/toolbarButton-currentOutlineItem.svg +3 -0
  59. package/dist/images/toolbarButton-download.svg +4 -0
  60. package/dist/images/toolbarButton-editorFreeText.svg +5 -0
  61. package/dist/images/toolbarButton-editorHighlight.svg +6 -0
  62. package/dist/images/toolbarButton-editorInk.svg +4 -0
  63. package/dist/images/toolbarButton-editorSignature.svg +6 -0
  64. package/dist/images/toolbarButton-editorStamp.svg +8 -0
  65. package/dist/images/toolbarButton-menuArrow.svg +3 -0
  66. package/dist/images/toolbarButton-openFile.svg +3 -0
  67. package/dist/images/toolbarButton-pageDown.svg +3 -0
  68. package/dist/images/toolbarButton-pageUp.svg +3 -0
  69. package/dist/images/toolbarButton-presentationMode.svg +3 -0
  70. package/dist/images/toolbarButton-print.svg +3 -0
  71. package/dist/images/toolbarButton-search.svg +3 -0
  72. package/dist/images/toolbarButton-secondaryToolbarToggle.svg +3 -0
  73. package/dist/images/toolbarButton-viewAttachments.svg +3 -0
  74. package/dist/images/toolbarButton-viewLayers.svg +3 -0
  75. package/dist/images/toolbarButton-viewOutline.svg +3 -0
  76. package/dist/images/toolbarButton-viewThumbnail.svg +3 -0
  77. package/dist/images/toolbarButton-viewsManagerToggle.svg +3 -0
  78. package/dist/images/toolbarButton-zoomIn.svg +3 -0
  79. package/dist/images/toolbarButton-zoomOut.svg +3 -0
  80. package/dist/images/treeitem-collapsed.svg +1 -0
  81. package/dist/images/treeitem-expanded.svg +1 -0
  82. package/dist/injectables/click/click.js +637 -153
  83. package/dist/injectables/click/click.js.map +4 -4
  84. package/dist/pdf.worker.min.mjs +28 -0
  85. package/dist/pdf_viewer.css +7129 -0
  86. package/dist/reader.css +1 -1
  87. package/dist/reader.css.map +1 -1
  88. package/dist/reader.js +572 -59
  89. package/dist/reader.js.map +4 -4
  90. package/dist/types/index.d.ts +5 -1
  91. package/dist/types/model/user-settings/ReadiumCSS.d.ts +14 -0
  92. package/dist/types/model/user-settings/UserProperties.d.ts +1 -1
  93. package/dist/types/model/user-settings/UserSettings.d.ts +26 -2
  94. package/dist/types/modules/AnnotationModule.d.ts +2 -2
  95. package/dist/types/modules/BookmarkModule.d.ts +2 -2
  96. package/dist/types/modules/ReaderModule.d.ts +6 -0
  97. package/dist/types/modules/citation/CitationModule.d.ts +21 -5
  98. package/dist/types/modules/highlight/TextHighlighter.d.ts +2 -0
  99. package/dist/types/modules/mediaoverlays/MediaOverlayModule.d.ts +4 -0
  100. package/dist/types/modules/protection/ContentProtectionModule.d.ts +1 -2
  101. package/dist/types/navigator/IFrameNavigator.d.ts +37 -16
  102. package/dist/types/navigator/Navigator.d.ts +25 -22
  103. package/dist/types/navigator/PDFNavigator.d.ts +140 -17
  104. package/dist/types/reader.d.ts +23 -7
  105. package/dist/types/store/Annotator.d.ts +26 -22
  106. package/dist/types/store/LocalAnnotator.d.ts +5 -4
  107. package/dist/types/store/LocalStorageStore.d.ts +4 -4
  108. package/dist/types/utils/EventHandler.d.ts +1 -3
  109. package/dist/types/views/BookView.d.ts +1 -0
  110. package/dist/types/views/ReflowableBookView.d.ts +7 -0
  111. package/package.json +49 -58
package/README.md CHANGED
@@ -4,27 +4,51 @@
4
4
 
5
5
  # R2D2BC
6
6
 
7
- # Introduction
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 the EPUB-related functions while customizing the own design, user interface, and extensions.
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
- # Goals
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 base-bones demonstration user interface, and no sample content.
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
- See below for projects that provide the necessary other elements to try it out and see it in action.
25
+ ## Features
26
26
 
27
- # Architecture
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
- - Integrates a simple Navigator for reflowable publications
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
- Additionally, it:
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
- # 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
-
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 [Edeweiss+](https://www.edelweiss.plus)
81
+ - Above the Treeline's [Edelweiss+](https://www.edelweiss.plus)
83
82
  - [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... :)
83
+ - and more...
86
84
 
85
+ ## Get Started
87
86
 
88
- # Contributing
89
- Contributions are always welcomed! Please see [CONTRIBUTING](CONTRIBUTING.md) for detailed guidelines.
87
+ ```bash
88
+ npm install
89
+ npm run build && npm run examples
90
+ ```
90
91
 
91
- [![DepShield Badge](https://depshield.sonatype.org/badges/d-i-t-a/R2D2BC/depshield.svg)](https://depshield.github.io)
92
+ Then visit `http://localhost:4444/`. The landing page shows available publications and example viewers.
92
93
 
93
- # Get Started
94
+ ### Framework Examples
94
95
 
95
- Download ebook examples here: https://standardebooks.org/ebooks and copy them to `./examples/epubs`. Then:
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
- npm run build && npm run examples
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
- ### WIKI
105
- - [Implementation Guides and Examples](https://github.com/d-i-t-a/R2D2BC/wiki)
107
+ ## Documentation
106
108
 
107
- ### Migration Guides
108
- - [Version 1.x -> 2.x](MIGRATION.md)
109
- ### Change Log
110
- - [2.0.x](CHANGELOG.md)
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)