@internetarchive/bookreader 5.0.0-88-alpha.11 → 5.0.0-88

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 (215) hide show
  1. package/BookReader/BookReader.css +3 -3
  2. package/BookReader/BookReader.js +1 -1
  3. package/BookReader/BookReader.js.map +1 -1
  4. package/BookReader/ia-bookreader-bundle.js +87 -108
  5. package/BookReader/ia-bookreader-bundle.js.map +1 -1
  6. package/BookReader/plugins/plugin.archive_analytics.js +1 -1
  7. package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
  8. package/BookReader/plugins/plugin.search.js +1 -1
  9. package/BookReader/plugins/plugin.search.js.map +1 -1
  10. package/BookReader/plugins/plugin.text_selection.js +1 -1
  11. package/BookReader/plugins/plugin.text_selection.js.map +1 -1
  12. package/BookReader/plugins/plugin.tts.js +1 -1
  13. package/BookReader/plugins/plugin.tts.js.map +1 -1
  14. package/BookReader/plugins/plugin.url.js +1 -1
  15. package/BookReader/plugins/plugin.url.js.map +1 -1
  16. package/CHANGELOG.md +4 -0
  17. package/babel.config.js +12 -30
  18. package/jsconfig.json +1 -3
  19. package/package.json +14 -16
  20. package/src/BookNavigator/search/search-results.js +1 -1
  21. package/src/BookReader/Mode1UpLit.js +56 -86
  22. package/src/BookReader/Mode2UpLit.js +2 -3
  23. package/src/BookReader/Navbar/Navbar.js +53 -11
  24. package/src/BookReader/options.js +3 -0
  25. package/src/BookReader.js +51 -3
  26. package/src/BookReaderPlugin.js +28 -0
  27. package/src/css/_BRnav.scss +0 -3
  28. package/src/css/_controls.scss +4 -0
  29. package/src/plugins/plugin.archive_analytics.js +84 -78
  30. package/src/plugins/plugin.chapters.js +17 -22
  31. package/src/plugins/plugin.text_selection.js +1 -1
  32. package/src/plugins/tts/plugin.tts.js +2 -2
  33. package/tests/jest/BookReader/Navbar/Navbar.test.js +16 -3
  34. package/tests/jest/plugins/plugin.archive_analytics.test.js +8 -11
  35. package/dist/esm/BookNavigator/assets/bookmark-colors.js +0 -4
  36. package/dist/esm/BookNavigator/assets/button-base.js +0 -4
  37. package/dist/esm/BookNavigator/assets/ia-logo.js +0 -4
  38. package/dist/esm/BookNavigator/assets/icon_checkmark.js +0 -8
  39. package/dist/esm/BookNavigator/assets/icon_close.js +0 -4
  40. package/dist/esm/BookNavigator/book-navigator.js +0 -612
  41. package/dist/esm/BookNavigator/bookmarks/bookmark-button.js +0 -35
  42. package/dist/esm/BookNavigator/bookmarks/bookmark-edit.js +0 -78
  43. package/dist/esm/BookNavigator/bookmarks/bookmarks-list.js +0 -160
  44. package/dist/esm/BookNavigator/bookmarks/bookmarks-loginCTA.js +0 -24
  45. package/dist/esm/BookNavigator/bookmarks/bookmarks-provider.js +0 -55
  46. package/dist/esm/BookNavigator/bookmarks/ia-bookmarks.js +0 -521
  47. package/dist/esm/BookNavigator/delete-modal-actions.js +0 -29
  48. package/dist/esm/BookNavigator/downloads/downloads-provider.js +0 -84
  49. package/dist/esm/BookNavigator/downloads/downloads.js +0 -69
  50. package/dist/esm/BookNavigator/search/search-provider.js +0 -238
  51. package/dist/esm/BookNavigator/search/search-results.js +0 -161
  52. package/dist/esm/BookNavigator/sharing.js +0 -26
  53. package/dist/esm/BookNavigator/viewable-files.js +0 -94
  54. package/dist/esm/BookNavigator/visual-adjustments/visual-adjustments-provider.js +0 -83
  55. package/dist/esm/BookNavigator/visual-adjustments/visual-adjustments.js +0 -131
  56. package/dist/esm/BookReader/BookModel.js +0 -575
  57. package/dist/esm/BookReader/DragScrollable.js +0 -224
  58. package/dist/esm/BookReader/ImageCache.js +0 -122
  59. package/dist/esm/BookReader/Mode1Up.js +0 -114
  60. package/dist/esm/BookReader/Mode1UpLit.js +0 -579
  61. package/dist/esm/BookReader/Mode2Up.js +0 -106
  62. package/dist/esm/BookReader/Mode2UpLit.js +0 -1020
  63. package/dist/esm/BookReader/ModeCoordinateSpace.js +0 -28
  64. package/dist/esm/BookReader/ModeSmoothZoom.js +0 -318
  65. package/dist/esm/BookReader/ModeThumb.js +0 -366
  66. package/dist/esm/BookReader/Navbar/Navbar.js +0 -253
  67. package/dist/esm/BookReader/PageContainer.js +0 -165
  68. package/dist/esm/BookReader/ReduceSet.js +0 -27
  69. package/dist/esm/BookReader/Toolbar/Toolbar.js +0 -242
  70. package/dist/esm/BookReader/events.js +0 -20
  71. package/dist/esm/BookReader/options.js +0 -331
  72. package/dist/esm/BookReader/utils/HTMLDimensionsCacher.js +0 -48
  73. package/dist/esm/BookReader/utils/ScrollClassAdder.js +0 -31
  74. package/dist/esm/BookReader/utils/SelectionObserver.js +0 -42
  75. package/dist/esm/BookReader/utils/classes.js +0 -37
  76. package/dist/esm/BookReader/utils.js +0 -315
  77. package/dist/esm/BookReader.js +0 -1828
  78. package/dist/esm/assets/icons/1up.svg +0 -12
  79. package/dist/esm/assets/icons/2up.svg +0 -15
  80. package/dist/esm/assets/icons/advance.svg +0 -26
  81. package/dist/esm/assets/icons/chevron-right.svg +0 -1
  82. package/dist/esm/assets/icons/close-circle-dark.svg +0 -1
  83. package/dist/esm/assets/icons/close-circle.svg +0 -1
  84. package/dist/esm/assets/icons/fullscreen.svg +0 -17
  85. package/dist/esm/assets/icons/fullscreen_exit.svg +0 -17
  86. package/dist/esm/assets/icons/hamburger.svg +0 -15
  87. package/dist/esm/assets/icons/left-arrow.svg +0 -12
  88. package/dist/esm/assets/icons/magnify-minus.svg +0 -12
  89. package/dist/esm/assets/icons/magnify-plus.svg +0 -13
  90. package/dist/esm/assets/icons/magnify.svg +0 -15
  91. package/dist/esm/assets/icons/pause.svg +0 -23
  92. package/dist/esm/assets/icons/play.svg +0 -22
  93. package/dist/esm/assets/icons/playback-speed.svg +0 -34
  94. package/dist/esm/assets/icons/read-aloud.svg +0 -22
  95. package/dist/esm/assets/icons/review.svg +0 -22
  96. package/dist/esm/assets/icons/thumbnails.svg +0 -17
  97. package/dist/esm/assets/icons/voice.svg +0 -1
  98. package/dist/esm/assets/icons/volume-full.svg +0 -22
  99. package/dist/esm/assets/images/BRicons.png +0 -0
  100. package/dist/esm/assets/images/BRicons.svg +0 -94
  101. package/dist/esm/assets/images/BRicons_ia.png +0 -0
  102. package/dist/esm/assets/images/back_pages.png +0 -0
  103. package/dist/esm/assets/images/book_bottom_icon.png +0 -0
  104. package/dist/esm/assets/images/book_down_icon.png +0 -0
  105. package/dist/esm/assets/images/book_left_icon.png +0 -0
  106. package/dist/esm/assets/images/book_leftmost_icon.png +0 -0
  107. package/dist/esm/assets/images/book_right_icon.png +0 -0
  108. package/dist/esm/assets/images/book_rightmost_icon.png +0 -0
  109. package/dist/esm/assets/images/book_top_icon.png +0 -0
  110. package/dist/esm/assets/images/book_up_icon.png +0 -0
  111. package/dist/esm/assets/images/books_graphic.svg +0 -177
  112. package/dist/esm/assets/images/booksplit.png +0 -0
  113. package/dist/esm/assets/images/control_pause_icon.png +0 -0
  114. package/dist/esm/assets/images/control_play_icon.png +0 -0
  115. package/dist/esm/assets/images/embed_icon.png +0 -0
  116. package/dist/esm/assets/images/icon-home-ia.png +0 -0
  117. package/dist/esm/assets/images/icon_OL-logo-xs.png +0 -0
  118. package/dist/esm/assets/images/icon_alert-xs.png +0 -0
  119. package/dist/esm/assets/images/icon_book.svg +0 -12
  120. package/dist/esm/assets/images/icon_bookmark.svg +0 -12
  121. package/dist/esm/assets/images/icon_close-pop.png +0 -0
  122. package/dist/esm/assets/images/icon_download.png +0 -0
  123. package/dist/esm/assets/images/icon_gear.svg +0 -14
  124. package/dist/esm/assets/images/icon_hamburger.svg +0 -20
  125. package/dist/esm/assets/images/icon_home.png +0 -0
  126. package/dist/esm/assets/images/icon_home.svg +0 -21
  127. package/dist/esm/assets/images/icon_home_ia.png +0 -0
  128. package/dist/esm/assets/images/icon_indicator.png +0 -0
  129. package/dist/esm/assets/images/icon_info.svg +0 -11
  130. package/dist/esm/assets/images/icon_one_page.svg +0 -8
  131. package/dist/esm/assets/images/icon_pause.svg +0 -1
  132. package/dist/esm/assets/images/icon_play.svg +0 -1
  133. package/dist/esm/assets/images/icon_playback-rate.svg +0 -15
  134. package/dist/esm/assets/images/icon_return.png +0 -0
  135. package/dist/esm/assets/images/icon_search_button.svg +0 -8
  136. package/dist/esm/assets/images/icon_share.svg +0 -9
  137. package/dist/esm/assets/images/icon_skip-ahead.svg +0 -6
  138. package/dist/esm/assets/images/icon_skip-back.svg +0 -13
  139. package/dist/esm/assets/images/icon_speaker.svg +0 -18
  140. package/dist/esm/assets/images/icon_speaker_open.svg +0 -10
  141. package/dist/esm/assets/images/icon_thumbnails.svg +0 -12
  142. package/dist/esm/assets/images/icon_toc.svg +0 -5
  143. package/dist/esm/assets/images/icon_two_pages.svg +0 -9
  144. package/dist/esm/assets/images/icon_zoomer.png +0 -0
  145. package/dist/esm/assets/images/loading.gif +0 -0
  146. package/dist/esm/assets/images/logo_icon.png +0 -0
  147. package/dist/esm/assets/images/marker_chap-off.png +0 -0
  148. package/dist/esm/assets/images/marker_chap-off.svg +0 -11
  149. package/dist/esm/assets/images/marker_chap-off_ia.png +0 -0
  150. package/dist/esm/assets/images/marker_chap-on.png +0 -0
  151. package/dist/esm/assets/images/marker_chap-on.svg +0 -11
  152. package/dist/esm/assets/images/marker_srch-on.svg +0 -11
  153. package/dist/esm/assets/images/marker_srchchap-off.png +0 -0
  154. package/dist/esm/assets/images/marker_srchchap-on.png +0 -0
  155. package/dist/esm/assets/images/nav_control-dn.png +0 -0
  156. package/dist/esm/assets/images/nav_control-dn_ia.png +0 -0
  157. package/dist/esm/assets/images/nav_control-up.png +0 -0
  158. package/dist/esm/assets/images/nav_control-up_ia.png +0 -0
  159. package/dist/esm/assets/images/nav_control.png +0 -0
  160. package/dist/esm/assets/images/one_page_mode_icon.png +0 -0
  161. package/dist/esm/assets/images/paper-badge.png +0 -0
  162. package/dist/esm/assets/images/print_icon.png +0 -0
  163. package/dist/esm/assets/images/progressbar.gif +0 -0
  164. package/dist/esm/assets/images/right_edges.png +0 -0
  165. package/dist/esm/assets/images/slider.png +0 -0
  166. package/dist/esm/assets/images/slider_ia.png +0 -0
  167. package/dist/esm/assets/images/thumbnail_mode_icon.png +0 -0
  168. package/dist/esm/assets/images/transparent.png +0 -0
  169. package/dist/esm/assets/images/two_page_mode_icon.png +0 -0
  170. package/dist/esm/assets/images/unviewable_page.png +0 -0
  171. package/dist/esm/assets/images/zoom_in_icon.png +0 -0
  172. package/dist/esm/assets/images/zoom_out_icon.png +0 -0
  173. package/dist/esm/css/BookReader.scss +0 -85
  174. package/dist/esm/css/_BRBookmarks.scss +0 -29
  175. package/dist/esm/css/_BRComponent.scss +0 -13
  176. package/dist/esm/css/_BRfloat.scss +0 -197
  177. package/dist/esm/css/_BRicon.scss +0 -54
  178. package/dist/esm/css/_BRmain.scss +0 -262
  179. package/dist/esm/css/_BRnav.scss +0 -354
  180. package/dist/esm/css/_BRpages.scss +0 -213
  181. package/dist/esm/css/_BRsearch.scss +0 -268
  182. package/dist/esm/css/_BRtoolbar.scss +0 -84
  183. package/dist/esm/css/_BRvendor.scss +0 -5
  184. package/dist/esm/css/_TextSelection.scss +0 -108
  185. package/dist/esm/css/_colorbox.scss +0 -52
  186. package/dist/esm/css/_controls.scss +0 -257
  187. package/dist/esm/css/_icons.scss +0 -121
  188. package/dist/esm/ia-bookreader/ia-bookreader.js +0 -141
  189. package/dist/esm/jquery-wrapper.js +0 -3
  190. package/dist/esm/plugins/plugin.archive_analytics.js +0 -72
  191. package/dist/esm/plugins/plugin.autoplay.js +0 -119
  192. package/dist/esm/plugins/plugin.chapters.js +0 -288
  193. package/dist/esm/plugins/plugin.iframe.js +0 -44
  194. package/dist/esm/plugins/plugin.iiif.js +0 -146
  195. package/dist/esm/plugins/plugin.resume.js +0 -66
  196. package/dist/esm/plugins/plugin.text_selection.js +0 -621
  197. package/dist/esm/plugins/plugin.vendor-fullscreen.js +0 -227
  198. package/dist/esm/plugins/search/plugin.search.js +0 -499
  199. package/dist/esm/plugins/search/utils.js +0 -42
  200. package/dist/esm/plugins/search/view.js +0 -360
  201. package/dist/esm/plugins/tts/AbstractTTSEngine.js +0 -282
  202. package/dist/esm/plugins/tts/FestivalTTSEngine.js +0 -192
  203. package/dist/esm/plugins/tts/PageChunk.js +0 -105
  204. package/dist/esm/plugins/tts/PageChunkIterator.js +0 -155
  205. package/dist/esm/plugins/tts/WebTTSEngine.js +0 -364
  206. package/dist/esm/plugins/tts/plugin.tts.js +0 -315
  207. package/dist/esm/plugins/tts/tooltip_dict.js +0 -14
  208. package/dist/esm/plugins/tts/utils.js +0 -79
  209. package/dist/esm/plugins/url/UrlPlugin.js +0 -197
  210. package/dist/esm/plugins/url/plugin.url.js +0 -212
  211. package/dist/esm/util/browserSniffing.js +0 -56
  212. package/dist/esm/util/debouncer.js +0 -25
  213. package/dist/esm/util/docCookies.js +0 -75
  214. package/dist/esm/util/strings.js +0 -34
  215. package/index.js +0 -2
@@ -1,227 +0,0 @@
1
- /* global BookReader */
2
-
3
- /**
4
- * Toggles browser's native fullscreen mode if available device is not mobile
5
- */
6
- if (!isMobile()) {
7
- var EVENT_NAMESPACE = '.bookreader_vendor-fullscreen';
8
- jQuery.extend(BookReader.defaultOptions, {
9
- /** @type {boolean} */
10
- enableVendorFullscreenPlugin: true
11
- });
12
-
13
- /** @override */
14
- BookReader.prototype.setup = function (super_) {
15
- return function (options) {
16
- super_.call(this, options);
17
- this.isVendorFullscreenActive = false;
18
- };
19
- }(BookReader.prototype.setup);
20
-
21
- /** @override */
22
- BookReader.prototype.getInitialMode = function (super_) {
23
- return function (params) {
24
- var nextMode = super_.call(this, params);
25
- if (this.isVendorFullscreenActive) {
26
- nextMode = this.constMode1up;
27
- }
28
- return nextMode;
29
- };
30
- }(BookReader.prototype.getInitialMode);
31
-
32
- /** @override */
33
- BookReader.prototype.init = function (super_) {
34
- return function () {
35
- super_.call(this);
36
- if (!fullscreenAllowed()) {
37
- return;
38
- }
39
- // In fullscreen mode the colorbox and overlay need to be inside the fullscreen element to display properly.
40
- bindFullscreenChangeListener(this, e => {
41
- e.data.resize();
42
- e.data.updateBrClasses();
43
- var cboxOverlay = $('#cboxOverlay');
44
- var cbox = $('#colorbox');
45
- if (isFullscreenActive()) {
46
- // In full screen mode, the colorbox and overlay need
47
- // to be children of the fullscreen element to display properly.
48
- var $fullscreen = $(getFullscreenElement());
49
- $fullscreen.append(cboxOverlay).append(cbox);
50
- } else {
51
- // In non-fullscreen mode, the colorbox and overlay need
52
- // to be children of the main document body.
53
- $(document.body).append(cboxOverlay).append(cbox);
54
- }
55
- });
56
- };
57
- }(BookReader.prototype.init);
58
-
59
- /**
60
- * Start fullscreen mode
61
- */
62
- BookReader.prototype.enterFullWindow = function () {
63
- this.refs.$brContainer.css('opacity', 0);
64
- var windowWidth = $(window).width();
65
- if (windowWidth <= this.onePageMinBreakpoint) {
66
- this.switchMode(this.constMode1up);
67
- }
68
- this.isVendorFullscreenActive = true;
69
- this.updateBrClasses();
70
- this.resize();
71
- this.jumpToIndex(this.currentIndex());
72
- this.refs.$brContainer.animate({
73
- opacity: 1
74
- }, 400, 'linear');
75
- $(document).on("keyup.".concat(EVENT_NAMESPACE), e => {
76
- if (e.keyCode === 27) this.exitFullScreen();
77
- });
78
- };
79
-
80
- /**
81
- * Exit from fullscreen mode
82
- */
83
- BookReader.prototype.exitFullWindow = function () {
84
- this.refs.$brContainer.css('opacity', 0);
85
- $(document).off('keyup' + EVENT_NAMESPACE);
86
- this.isFullscreenActive = false;
87
- this.updateBrClasses();
88
- this.resize();
89
- this.refs.$brContainer.animate({
90
- opacity: 1
91
- }, 400, 'linear');
92
- };
93
-
94
- /**
95
- * Returns true if fullscreen mode is enabled
96
- *
97
- * @returns {boolean}
98
- */
99
- BookReader.prototype.isFullscreen = function () {
100
- return isFullscreenActive() || this.isVendorFullscreenActive;
101
- };
102
-
103
- /**
104
- * Toggle screen
105
- */
106
- BookReader.prototype.toggleFullscreen = function () {
107
- if (this.isFullscreen()) {
108
- if (fullscreenAllowed()) {
109
- exitFullscreen();
110
- } else {
111
- this.exitFullWindow();
112
- }
113
- } else {
114
- if (fullscreenAllowed()) {
115
- requestFullscreen(this.refs.$br[0]);
116
- } else {
117
- this.enterFullWindow();
118
- }
119
- }
120
- };
121
-
122
- /** @deprecated */
123
- BookReader.util.isMobile = isMobile;
124
-
125
- /** @deprecated */
126
- BookReader.util.getFullscreenElement = getFullscreenElement;
127
-
128
- /** @deprecated */
129
- BookReader.util.bindFullscreenChangeListener = bindFullscreenChangeListener;
130
-
131
- /** @deprecated */
132
- BookReader.util.fullscreenAllowed = fullscreenAllowed;
133
-
134
- /** @deprecated */
135
- BookReader.util.requestFullscreen = requestFullscreen;
136
-
137
- /** @deprecated */
138
- BookReader.util.exitFullscreen = exitFullscreen;
139
-
140
- /** @deprecated */
141
- BookReader.util.isFullscreenActive = isFullscreenActive;
142
- }
143
-
144
- /**
145
- * Returns the DOM element being used for fullscreen.
146
- *
147
- * @returns {HTMLElement}
148
- * @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentOrShadowRoot/fullscreenElement
149
- */
150
- export function getFullscreenElement() {
151
- return document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement;
152
- }
153
-
154
- /**
155
- * Returns true if the document is in fullscreen mode.
156
- *
157
- * @returns {boolean}
158
- */
159
- export function isFullscreenActive() {
160
- var fullscreenElement = getFullscreenElement();
161
- return fullscreenElement !== null && fullscreenElement !== undefined;
162
- }
163
-
164
- /**
165
- * Exits fullscreen mode.
166
- *
167
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/exitFullscreen
168
- */
169
- export function exitFullscreen() {
170
- if (document.exitFullscreen) {
171
- document.exitFullscreen();
172
- } else if (document.webkitExitFullscreen) {
173
- document.webkitExitFullscreen();
174
- } else if (document.mozCancelFullScreen) {
175
- document.mozCancelFullScreen();
176
- } else if (document.msExitFullscreen) {
177
- document.msExitFullscreen();
178
- }
179
- }
180
-
181
- /**
182
- * Requests fullscreen mode for the given element
183
- *
184
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullscreen
185
- */
186
- export function requestFullscreen(element) {
187
- if (element.requestFullscreen) {
188
- element.requestFullscreen();
189
- } else if (element.webkitRequestFullscreen) {
190
- element.webkitRequestFullscreen();
191
- } else if (element.mozRequestFullScreen) {
192
- element.mozRequestFullScreen();
193
- } else if (element.msRequestFullscreen) {
194
- element.msRequestFullscreen();
195
- }
196
- }
197
-
198
- /**
199
- * Returns true if fullscreen mode is allowed on this device and document.
200
- *
201
- * @returns {boolean}
202
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenEnabled
203
- */
204
- export function fullscreenAllowed() {
205
- return document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullScreenEnabled;
206
- }
207
-
208
- /**
209
- * jQuery-style binding to a fullscreenchange event.
210
- *
211
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenchange_event
212
- */
213
- export function bindFullscreenChangeListener(data, fullscreenchangeListener) {
214
- var event = 'fullscreenchange ';
215
- var vendor_prefixes = ['webkit', 'moz', 'ms'];
216
- var all_events = (event + vendor_prefixes.join(event) + event).trim();
217
- $(document).on(all_events, data, fullscreenchangeListener);
218
- }
219
-
220
- /**
221
- * Returns true if current device is mobile
222
- *
223
- * @returns {boolean}
224
- */
225
- export function isMobile() {
226
- return typeof window.orientation !== 'undefined' || navigator.userAgent.indexOf('IEMobile') !== -1;
227
- }