@internetarchive/bookreader 5.0.0-11-multiple-files → 5.0.0-110

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 (389) hide show
  1. package/BookReader/474.js +2 -0
  2. package/BookReader/474.js.map +1 -0
  3. package/BookReader/BookReader.css +616 -1467
  4. package/BookReader/BookReader.js +2 -21564
  5. package/BookReader/BookReader.js.LICENSE.txt +20 -20
  6. package/BookReader/BookReader.js.map +1 -1
  7. package/BookReader/bergamot-translator-worker.js +2966 -0
  8. package/BookReader/bergamot-translator-worker.wasm +0 -0
  9. package/BookReader/hypothesis/LICENSE +50 -0
  10. package/BookReader/hypothesis/README.md +55 -0
  11. package/BookReader/hypothesis/build/boot.js +1 -0
  12. package/BookReader/hypothesis/build/manifest.json +20 -0
  13. package/BookReader/hypothesis/build/scripts/annotator.bundle.js +184 -0
  14. package/BookReader/hypothesis/build/scripts/annotator.bundle.js.map +1 -0
  15. package/BookReader/hypothesis/build/scripts/sidebar.bundle.js +798 -0
  16. package/BookReader/hypothesis/build/scripts/sidebar.bundle.js.map +1 -0
  17. package/BookReader/hypothesis/build/scripts/ui-playground.bundle.js +711 -0
  18. package/BookReader/hypothesis/build/scripts/ui-playground.bundle.js.map +1 -0
  19. package/BookReader/hypothesis/build/styles/annotator.css +2235 -0
  20. package/BookReader/hypothesis/build/styles/annotator.css.map +1 -0
  21. package/BookReader/hypothesis/build/styles/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  22. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  23. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  24. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  25. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  26. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Bold.woff2 +0 -0
  27. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  28. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Italic.woff2 +0 -0
  29. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Regular.woff2 +0 -0
  30. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  31. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Math-Italic.woff2 +0 -0
  32. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  33. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  34. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  35. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Script-Regular.woff2 +0 -0
  36. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  37. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  38. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  39. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  40. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  41. package/BookReader/hypothesis/build/styles/highlights.css +2 -0
  42. package/BookReader/hypothesis/build/styles/highlights.css.map +1 -0
  43. package/BookReader/hypothesis/build/styles/katex.min.css +2 -0
  44. package/BookReader/hypothesis/build/styles/katex.min.css.map +1 -0
  45. package/BookReader/hypothesis/build/styles/pdfjs-overrides.css +2 -0
  46. package/BookReader/hypothesis/build/styles/pdfjs-overrides.css.map +1 -0
  47. package/BookReader/hypothesis/build/styles/sidebar.css +2731 -0
  48. package/BookReader/hypothesis/build/styles/sidebar.css.map +1 -0
  49. package/BookReader/hypothesis/build/styles/ui-playground.css +2659 -0
  50. package/BookReader/hypothesis/build/styles/ui-playground.css.map +1 -0
  51. package/BookReader/hypothesis/package.json +126 -0
  52. package/BookReader/ia-bookreader-bundle.js +1907 -0
  53. package/BookReader/ia-bookreader-bundle.js.LICENSE.txt +19 -0
  54. package/BookReader/ia-bookreader-bundle.js.map +1 -0
  55. package/BookReader/icons/1up.svg +1 -12
  56. package/BookReader/icons/2up.svg +1 -15
  57. package/BookReader/icons/advance.svg +3 -26
  58. package/BookReader/icons/chevron-right.svg +1 -1
  59. package/BookReader/icons/close-circle-dark.svg +1 -0
  60. package/BookReader/icons/close-circle.svg +1 -1
  61. package/BookReader/icons/fullscreen.svg +1 -17
  62. package/BookReader/icons/fullscreen_exit.svg +1 -17
  63. package/BookReader/icons/hamburger.svg +1 -15
  64. package/BookReader/icons/left-arrow.svg +1 -12
  65. package/BookReader/icons/magnify-minus.svg +1 -16
  66. package/BookReader/icons/magnify-plus.svg +1 -17
  67. package/BookReader/icons/magnify.svg +1 -15
  68. package/BookReader/icons/pause.svg +1 -23
  69. package/BookReader/icons/play.svg +1 -22
  70. package/BookReader/icons/playback-speed.svg +1 -34
  71. package/BookReader/icons/read-aloud.svg +1 -22
  72. package/BookReader/icons/review.svg +3 -22
  73. package/BookReader/icons/slider-toggle.svg +1 -0
  74. package/BookReader/icons/thumbnails.svg +1 -17
  75. package/BookReader/icons/voice.svg +1 -0
  76. package/BookReader/icons/volume-full.svg +1 -22
  77. package/BookReader/images/BRicons.svg +5 -94
  78. package/BookReader/images/books_graphic.svg +1 -177
  79. package/BookReader/images/hypothesis.ico +0 -0
  80. package/BookReader/images/icon_book.svg +1 -12
  81. package/BookReader/images/icon_bookmark.svg +1 -12
  82. package/BookReader/images/icon_experiment.svg +1 -0
  83. package/BookReader/images/icon_gear.svg +1 -14
  84. package/BookReader/images/icon_hamburger.svg +1 -20
  85. package/BookReader/images/icon_home.svg +1 -21
  86. package/BookReader/images/icon_info.svg +1 -11
  87. package/BookReader/images/icon_one_page.svg +1 -8
  88. package/BookReader/images/icon_pause.svg +1 -1
  89. package/BookReader/images/icon_play.svg +1 -1
  90. package/BookReader/images/icon_playback-rate.svg +1 -15
  91. package/BookReader/images/icon_search_button.svg +1 -8
  92. package/BookReader/images/icon_share.svg +1 -9
  93. package/BookReader/images/icon_skip-ahead.svg +1 -6
  94. package/BookReader/images/icon_skip-back.svg +2 -13
  95. package/BookReader/images/icon_speaker.svg +1 -18
  96. package/BookReader/images/icon_speaker_open.svg +1 -10
  97. package/BookReader/images/icon_thumbnails.svg +1 -12
  98. package/BookReader/images/icon_toc.svg +1 -5
  99. package/BookReader/images/icon_two_pages.svg +1 -9
  100. package/BookReader/images/marker_chap-off.svg +1 -11
  101. package/BookReader/images/marker_chap-on.svg +1 -11
  102. package/BookReader/images/marker_srch-on.svg +1 -11
  103. package/BookReader/images/translate.svg +1 -0
  104. package/BookReader/images/unviewable_page.png +0 -0
  105. package/BookReader/jquery-3.js +2 -0
  106. package/BookReader/jquery-3.js.LICENSE.txt +24 -0
  107. package/BookReader/plugins/plugin.archive_analytics.js +1 -172
  108. package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
  109. package/BookReader/plugins/plugin.autoplay.js +1 -165
  110. package/BookReader/plugins/plugin.autoplay.js.map +1 -1
  111. package/BookReader/plugins/plugin.chapters.js +19 -301
  112. package/BookReader/plugins/plugin.chapters.js.LICENSE.txt +1 -0
  113. package/BookReader/plugins/plugin.chapters.js.map +1 -1
  114. package/BookReader/plugins/plugin.experiments.js +3 -0
  115. package/BookReader/plugins/plugin.experiments.js.LICENSE.txt +1 -0
  116. package/BookReader/plugins/plugin.experiments.js.map +1 -0
  117. package/BookReader/plugins/plugin.iframe.js +1 -74
  118. package/BookReader/plugins/plugin.iframe.js.map +1 -1
  119. package/BookReader/plugins/plugin.iiif.js +2 -0
  120. package/BookReader/plugins/plugin.iiif.js.map +1 -0
  121. package/BookReader/plugins/plugin.resume.js +1 -368
  122. package/BookReader/plugins/plugin.resume.js.map +1 -1
  123. package/BookReader/plugins/plugin.search.js +2 -1420
  124. package/BookReader/plugins/plugin.search.js.LICENSE.txt +1 -0
  125. package/BookReader/plugins/plugin.search.js.map +1 -1
  126. package/BookReader/plugins/plugin.text_selection.js +2 -1080
  127. package/BookReader/plugins/plugin.text_selection.js.LICENSE.txt +1 -0
  128. package/BookReader/plugins/plugin.text_selection.js.map +1 -1
  129. package/BookReader/plugins/plugin.translate.js +137 -0
  130. package/BookReader/plugins/plugin.translate.js.LICENSE.txt +1 -0
  131. package/BookReader/plugins/plugin.translate.js.map +1 -0
  132. package/BookReader/plugins/plugin.tts.js +2 -9193
  133. package/BookReader/plugins/plugin.tts.js.LICENSE.txt +2 -0
  134. package/BookReader/plugins/plugin.tts.js.map +1 -1
  135. package/BookReader/plugins/plugin.url.js +1 -269
  136. package/BookReader/plugins/plugin.url.js.map +1 -1
  137. package/BookReader/plugins/plugin.vendor-fullscreen.js +1 -379
  138. package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
  139. package/BookReader/plugins/translator-worker.js +2 -0
  140. package/BookReader/plugins/translator-worker.js.map +1 -0
  141. package/BookReader/silence.mp3 +0 -0
  142. package/BookReader/translator-worker.js +475 -0
  143. package/BookReader/webcomponents-bundle.js +3 -0
  144. package/BookReader/webcomponents-bundle.js.LICENSE.txt +9 -0
  145. package/BookReader/webcomponents-bundle.js.map +1 -0
  146. package/README.md +14 -3
  147. package/jsconfig.json +19 -0
  148. package/package.json +92 -70
  149. package/src/BookReader/BookModel.js +92 -46
  150. package/src/BookReader/DragScrollable.js +233 -0
  151. package/src/BookReader/ImageCache.js +49 -16
  152. package/src/BookReader/Mode1Up.js +66 -356
  153. package/src/BookReader/Mode1UpLit.js +392 -0
  154. package/src/BookReader/Mode2Up.js +87 -1315
  155. package/src/BookReader/Mode2UpLit.js +788 -0
  156. package/src/BookReader/ModeAbstract.js +43 -0
  157. package/src/BookReader/ModeCoordinateSpace.js +29 -0
  158. package/src/BookReader/ModeSmoothZoom.js +312 -0
  159. package/src/BookReader/ModeThumb.js +30 -16
  160. package/src/BookReader/Navbar/Navbar.js +201 -76
  161. package/src/BookReader/PageContainer.js +120 -23
  162. package/src/BookReader/ReduceSet.js +3 -3
  163. package/src/BookReader/Toolbar/Toolbar.js +19 -41
  164. package/src/BookReader/events.js +3 -3
  165. package/src/BookReader/options.js +94 -17
  166. package/src/BookReader/utils/HTMLDimensionsCacher.js +44 -0
  167. package/src/BookReader/utils/ScrollClassAdder.js +31 -0
  168. package/src/BookReader/utils/SelectionObserver.js +45 -0
  169. package/src/BookReader/utils/classes.js +1 -1
  170. package/src/BookReader/utils.js +141 -13
  171. package/src/BookReader.js +711 -1241
  172. package/src/BookReaderPlugin.js +52 -0
  173. package/src/assets/icons/close-circle-dark.svg +1 -0
  174. package/src/assets/icons/magnify-minus.svg +3 -7
  175. package/src/assets/icons/magnify-plus.svg +3 -7
  176. package/src/assets/icons/slider-toggle.svg +1 -0
  177. package/src/assets/icons/voice.svg +1 -0
  178. package/src/assets/images/hypothesis.ico +0 -0
  179. package/src/assets/images/icon_experiment.svg +1 -0
  180. package/src/assets/images/translate.svg +1 -0
  181. package/src/assets/images/unviewable_page.png +0 -0
  182. package/src/assets/silence.mp3 +0 -0
  183. package/src/css/BookReader.scss +1 -17
  184. package/src/css/_BRBookmarks.scss +1 -1
  185. package/src/css/_BRComponent.scss +1 -1
  186. package/src/css/_BRicon.scss +8 -2
  187. package/src/css/_BRmain.scss +33 -27
  188. package/src/css/_BRnav.scss +74 -70
  189. package/src/css/_BRpages.scss +171 -42
  190. package/src/css/_BRsearch.scss +69 -235
  191. package/src/css/_BRtoolbar.scss +5 -5
  192. package/src/css/_TextSelection.scss +129 -24
  193. package/src/css/_colorbox.scss +2 -2
  194. package/src/css/_controls.scss +24 -7
  195. package/src/css/_icons.scss +14 -1
  196. package/src/{BookNavigator/assets → css}/button-base.js +10 -3
  197. package/src/css/icon_checkmark.js +9 -0
  198. package/src/css/sharedStyles.js +15 -0
  199. package/src/ia-bookreader/downloads/downloads-provider.js +81 -0
  200. package/src/{BookNavigator → ia-bookreader}/downloads/downloads.js +29 -25
  201. package/src/ia-bookreader/ia-bookreader.js +666 -0
  202. package/src/ia-bookreader/sharing.js +27 -0
  203. package/src/ia-bookreader/viewable-files.js +98 -0
  204. package/src/{BookNavigator → ia-bookreader}/visual-adjustments/visual-adjustments-provider.js +17 -17
  205. package/src/{BookNavigator → ia-bookreader}/visual-adjustments/visual-adjustments.js +75 -67
  206. package/src/{BookNavigator → plugins}/bookmarks/bookmark-button.js +4 -3
  207. package/src/{BookNavigator/assets → plugins/bookmarks}/bookmark-colors.js +1 -1
  208. package/src/{BookNavigator → plugins}/bookmarks/bookmark-edit.js +44 -32
  209. package/src/{BookNavigator → plugins}/bookmarks/bookmarks-list.js +48 -49
  210. package/src/{BookNavigator → plugins}/bookmarks/bookmarks-loginCTA.js +5 -10
  211. package/src/plugins/bookmarks/bookmarks-provider.js +63 -0
  212. package/src/{BookNavigator → plugins/bookmarks}/delete-modal-actions.js +1 -1
  213. package/src/{BookNavigator → plugins}/bookmarks/ia-bookmarks.js +117 -68
  214. package/src/plugins/plugin.archive_analytics.js +84 -78
  215. package/src/plugins/plugin.autoplay.js +99 -104
  216. package/src/plugins/plugin.chapters.js +310 -201
  217. package/src/plugins/plugin.experiments.js +321 -0
  218. package/src/plugins/plugin.iframe.js +1 -1
  219. package/src/plugins/plugin.iiif.js +141 -0
  220. package/src/plugins/plugin.resume.js +53 -50
  221. package/src/plugins/plugin.text_selection.js +522 -219
  222. package/src/plugins/plugin.vendor-fullscreen.js +7 -7
  223. package/src/plugins/search/plugin.search.js +380 -360
  224. package/src/{BookNavigator → plugins}/search/search-provider.js +94 -32
  225. package/src/{BookNavigator → plugins}/search/search-results.js +108 -90
  226. package/src/plugins/search/utils.js +50 -0
  227. package/src/plugins/search/view.js +79 -210
  228. package/src/plugins/translate/TranslationManager.js +164 -0
  229. package/src/plugins/translate/plugin.translate.js +512 -0
  230. package/src/plugins/tts/AbstractTTSEngine.js +78 -49
  231. package/src/plugins/tts/FestivalTTSEngine.js +21 -31
  232. package/src/plugins/tts/PageChunk.js +33 -21
  233. package/src/plugins/tts/PageChunkIterator.js +11 -17
  234. package/src/plugins/tts/WebTTSEngine.js +131 -91
  235. package/src/plugins/tts/plugin.tts.js +345 -350
  236. package/src/plugins/tts/utils.js +77 -49
  237. package/src/plugins/url/UrlPlugin.js +191 -0
  238. package/src/plugins/{plugin.url.js → url/plugin.url.js} +47 -18
  239. package/src/util/TextSelectionManager.js +282 -0
  240. package/src/util/browserSniffing.js +33 -1
  241. package/src/util/cache.js +20 -0
  242. package/src/util/docCookies.js +21 -2
  243. package/src/util/lit.js +15 -0
  244. package/src/util/strings.js +1 -0
  245. package/.babelrc +0 -12
  246. package/.dependabot/config.yml +0 -6
  247. package/.eslintrc.js +0 -49
  248. package/.gitattributes +0 -2
  249. package/.github/ISSUE_TEMPLATE/bug.md +0 -32
  250. package/.github/ISSUE_TEMPLATE/feature-request.md +0 -30
  251. package/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +0 -15
  252. package/.github/workflows/node.js.yml +0 -28
  253. package/.github/workflows/npm-publish.yml +0 -47
  254. package/.testcaferc.json +0 -5
  255. package/BookReader/bookreader-component-bundle.js +0 -14330
  256. package/BookReader/bookreader-component-bundle.js.LICENSE.txt +0 -38
  257. package/BookReader/bookreader-component-bundle.js.map +0 -1
  258. package/BookReader/icons/sort-ascending.svg +0 -1
  259. package/BookReader/icons/sort-descending.svg +0 -1
  260. package/BookReader/jquery-1.10.1.js +0 -108
  261. package/BookReader/jquery-1.10.1.js.LICENSE.txt +0 -24
  262. package/BookReader/plugins/plugin.menu_toggle.js +0 -369
  263. package/BookReader/plugins/plugin.menu_toggle.js.map +0 -1
  264. package/BookReader/plugins/plugin.mobile_nav.js +0 -335
  265. package/BookReader/plugins/plugin.mobile_nav.js.map +0 -1
  266. package/BookReaderDemo/BookReaderDemo.css +0 -41
  267. package/BookReaderDemo/BookReaderJSAdvanced.js +0 -115
  268. package/BookReaderDemo/BookReaderJSAutoplay.js +0 -56
  269. package/BookReaderDemo/BookReaderJSSimple.js +0 -55
  270. package/BookReaderDemo/IIIFBookReader.js +0 -207
  271. package/BookReaderDemo/assets/v5/Bookreader-logo-cool-grad.svg +0 -1
  272. package/BookReaderDemo/assets/v5/Bookreader-logo-flat.svg +0 -1
  273. package/BookReaderDemo/assets/v5/Bookreader-logo-hex-cool-grad.png +0 -0
  274. package/BookReaderDemo/assets/v5/Bookreader-logo-hex-flat.png +0 -0
  275. package/BookReaderDemo/assets/v5/Bookreader-logo-lines.png +0 -0
  276. package/BookReaderDemo/assets/v5/Bookreader-logo-lines.svg +0 -1
  277. package/BookReaderDemo/assets/v5/Bookreader-logo-warm.svg +0 -1
  278. package/BookReaderDemo/assets/v5/bookreader-logo-renders@1x.png +0 -0
  279. package/BookReaderDemo/assets/v5/bookreader-logo-renders@2x.png +0 -0
  280. package/BookReaderDemo/assets/v5/bookreader-v5-screenshot.png +0 -0
  281. package/BookReaderDemo/bookreader-template-bundle.js +0 -7178
  282. package/BookReaderDemo/demo-advanced.html +0 -33
  283. package/BookReaderDemo/demo-autoplay.html +0 -38
  284. package/BookReaderDemo/demo-embed-iframe-src.html +0 -84
  285. package/BookReaderDemo/demo-embed.html +0 -26
  286. package/BookReaderDemo/demo-fullscreen-mobile.html +0 -36
  287. package/BookReaderDemo/demo-fullscreen.html +0 -33
  288. package/BookReaderDemo/demo-iiif.html +0 -34
  289. package/BookReaderDemo/demo-iiif.js +0 -26
  290. package/BookReaderDemo/demo-internetarchive.html +0 -74
  291. package/BookReaderDemo/demo-multiple.html +0 -43
  292. package/BookReaderDemo/demo-plugin-menu-toggle.html +0 -34
  293. package/BookReaderDemo/demo-preview-pages.html +0 -1092
  294. package/BookReaderDemo/demo-simple.html +0 -34
  295. package/BookReaderDemo/demo-vendor-fullscreen.html +0 -36
  296. package/BookReaderDemo/immersion-1up.html +0 -64
  297. package/BookReaderDemo/immersion-mode.html +0 -35
  298. package/BookReaderDemo/toggle_controls.html +0 -53
  299. package/BookReaderDemo/view_mode.html +0 -39
  300. package/BookReaderDemo/viewmode-cycle.html +0 -41
  301. package/CHANGELOG.md +0 -476
  302. package/CONTRIBUTING.md +0 -7
  303. package/codecov.yml +0 -17
  304. package/index.html +0 -31
  305. package/karma.conf.js +0 -23
  306. package/screenshot.png +0 -0
  307. package/scripts/postversion.js +0 -10
  308. package/scripts/preversion.js +0 -14
  309. package/scripts/version.js +0 -26
  310. package/src/BookNavigator/BookModel.js +0 -14
  311. package/src/BookNavigator/BookNavigator.js +0 -451
  312. package/src/BookNavigator/assets/book-loader.js +0 -27
  313. package/src/BookNavigator/assets/icon_checkmark.js +0 -6
  314. package/src/BookNavigator/assets/icon_close.js +0 -3
  315. package/src/BookNavigator/assets/icon_sort_ascending.js +0 -5
  316. package/src/BookNavigator/assets/icon_sort_descending.js +0 -5
  317. package/src/BookNavigator/bookmarks/bookmarks-provider.js +0 -53
  318. package/src/BookNavigator/br-fullscreen-mgr.js +0 -83
  319. package/src/BookNavigator/downloads/downloads-provider.js +0 -66
  320. package/src/BookNavigator/search/a-search-result.js +0 -55
  321. package/src/BookNavigator/volumes/volumes-provider.js +0 -75
  322. package/src/BookNavigator/volumes/volumes.js +0 -161
  323. package/src/BookReader/DebugConsole.js +0 -54
  324. package/src/BookReaderComponent/BookReaderComponent.js +0 -112
  325. package/src/ItemNavigator/ItemNavigator.js +0 -372
  326. package/src/ItemNavigator/providers/sharing.js +0 -29
  327. package/src/assets/icons/sort-ascending.svg +0 -1
  328. package/src/assets/icons/sort-descending.svg +0 -1
  329. package/src/css/_MobileNav.scss +0 -194
  330. package/src/dragscrollable-br.js +0 -261
  331. package/src/plugins/menu_toggle/plugin.menu_toggle.js +0 -324
  332. package/src/plugins/plugin.mobile_nav.js +0 -287
  333. package/tests/BookReader/BookModel.test.js +0 -312
  334. package/tests/BookReader/BookReaderPublicFunctions.test.js +0 -171
  335. package/tests/BookReader/DebugConsole.test.js +0 -25
  336. package/tests/BookReader/ImageCache.test.js +0 -150
  337. package/tests/BookReader/Mode1Up.test.js +0 -164
  338. package/tests/BookReader/Mode2Up.test.js +0 -247
  339. package/tests/BookReader/Navbar/Navbar.test.js +0 -169
  340. package/tests/BookReader/PageContainer.test.js +0 -115
  341. package/tests/BookReader/ReduceSet.test.js +0 -38
  342. package/tests/BookReader/Toolbar/Toolbar.test.js +0 -26
  343. package/tests/BookReader/utils/classes.test.js +0 -88
  344. package/tests/BookReader/utils.test.js +0 -109
  345. package/tests/BookReader.options.test.js +0 -39
  346. package/tests/BookReader.test.js +0 -301
  347. package/tests/e2e/README.md +0 -75
  348. package/tests/e2e/autoplay.test.js +0 -13
  349. package/tests/e2e/base.test.js +0 -35
  350. package/tests/e2e/helpers/base.js +0 -258
  351. package/tests/e2e/helpers/debug.js +0 -13
  352. package/tests/e2e/helpers/desktopSearch.js +0 -72
  353. package/tests/e2e/helpers/mobileSearch.js +0 -85
  354. package/tests/e2e/helpers/mockSearch.js +0 -93
  355. package/tests/e2e/helpers/rightToLeft.js +0 -29
  356. package/tests/e2e/ia-production/ia-prod-base.js +0 -17
  357. package/tests/e2e/models/BookReader.js +0 -11
  358. package/tests/e2e/models/Navigation.js +0 -56
  359. package/tests/e2e/rightToLeft.test.js +0 -20
  360. package/tests/e2e/viewmode.test.js +0 -37
  361. package/tests/karma/BookNavigator/book-navigator.test.js +0 -132
  362. package/tests/karma/BookNavigator/bookmarks/bookmark-edit.test.js +0 -133
  363. package/tests/karma/BookNavigator/bookmarks/bookmarks-list.test.js +0 -222
  364. package/tests/karma/BookNavigator/search-results.test.js +0 -240
  365. package/tests/karma/BookNavigator/visual-adjustments.test.js +0 -201
  366. package/tests/karma/BookNavigator/volumes.test.js +0 -133
  367. package/tests/plugins/menu_toggle/plugin.menu_toggle.test.js +0 -68
  368. package/tests/plugins/plugin.archive_analytics.test.js +0 -23
  369. package/tests/plugins/plugin.autoplay.test.js +0 -52
  370. package/tests/plugins/plugin.chapters.test.js +0 -130
  371. package/tests/plugins/plugin.iframe.test.js +0 -42
  372. package/tests/plugins/plugin.mobile_nav.test.js +0 -66
  373. package/tests/plugins/plugin.resume.test.js +0 -98
  374. package/tests/plugins/plugin.text_selection.test.js +0 -203
  375. package/tests/plugins/plugin.url.test.js +0 -129
  376. package/tests/plugins/plugin.vendor-fullscreen.test.js +0 -65
  377. package/tests/plugins/search/plugin.search.test.js +0 -166
  378. package/tests/plugins/search/plugin.search.view.test.js +0 -106
  379. package/tests/plugins/tts/AbstractTTSEngine.test.js +0 -153
  380. package/tests/plugins/tts/FestivalTTSEngine.test.js +0 -59
  381. package/tests/plugins/tts/PageChunk.test.js +0 -57
  382. package/tests/plugins/tts/PageChunkIterator.test.js +0 -179
  383. package/tests/plugins/tts/WebTTSEngine.test.js +0 -126
  384. package/tests/plugins/tts/utils.test.js +0 -133
  385. package/tests/util/browserSniffing.test.js +0 -56
  386. package/tests/util/docCookies.test.js +0 -15
  387. package/tests/util/strings.test.js +0 -63
  388. package/tests/utils.js +0 -42
  389. package/webpack.config.js +0 -86
@@ -1,35 +1,97 @@
1
- .textSelectionSVG {
2
- width: 100%;
1
+ .BRtextLayer, .BRtranslateLayer {
2
+ z-index: 2;
3
3
  position: absolute;
4
- height: 100%;
5
4
  top: 0;
6
5
  left: 0;
7
- // Make it so right-clicking on "blank" part of svg sends events to the image (for saving)
6
+ color: transparent;
7
+ transform-origin: 0 0;
8
+ // Make it so right-clicking on "blank" part of text layer sends events to the image (for saving)
8
9
  pointer-events: none;
9
- .BRwordElement { pointer-events: all; }
10
- &.selectingSVG {
11
- pointer-events: auto;
12
- cursor: text;
13
- }
14
-
15
- // Highlight colors for text selection layer ( these 2 properties do not work if joined)
16
- .BRwordElement::selection {
10
+ cursor: text;
11
+ }
12
+
13
+ .BRtextLayer {
14
+ mix-blend-mode: multiply;
15
+ }
16
+
17
+ .BRtranslateLayer {
18
+ hyphens: auto;
19
+ }
20
+
21
+ .BRparagraphElement {
22
+ margin: 0;
23
+ cursor: text;
24
+ font-family: Georgia, serif;
25
+ line-height: 0;
26
+ }
27
+
28
+ .BRlineElement {
29
+ pointer-events: all;
30
+ white-space: nowrap;
31
+ display: inline-block;
32
+
33
+ // We use display: inline-block, otherwise this causes every line
34
+ // to have newlines at the end in safari. BUT, since they're inline,
35
+ // if the OCR has to short line in the same paragraph, they can wrap
36
+ // and one can go onto the other. This adds an arbitrary margin to
37
+ // the right of each line, forcing things to wrap.
38
+ // See eg https://www-drini.archive.org/details/countofmontecris00duma_7/page/261/mode/2up
39
+ // Page 261, second last line on the page.
40
+ .BRtextLayer[dir=ltr] & { margin-right: 100%; }
41
+ .BRtextLayer[dir=rtl] & { margin-left: 100%; }
42
+ }
43
+
44
+ // Highlight colors for text selection layer
45
+ .BRwordElement, .BRspace, .BRparagraphElement, .BRparagraphElement br {
46
+ // these 2 properties do not work if joined
47
+ &::selection {
17
48
  background: hsla(210, 74%, 62%, 0.4);
18
49
  }
19
- .BRwordElement::-moz-selection {
50
+
51
+ &::-moz-selection {
20
52
  background: hsla(210, 74%, 62%, 0.4);
21
- color: transparent;
53
+ color:transparent;
22
54
  }
55
+ }
56
+
57
+ // Style URI TextFragments, eg #:~:text=example
58
+ .BRtextLayer ::target-text {
59
+ // Similar colour to the default one used in Safari, Firefox. Note Chrome uses a purple colour
60
+ background-color: hsla(45, 80%, 66%, 0.6);
61
+ color: transparent;
62
+ }
63
+
64
+ .BRtranslateLayer ::selection {
65
+ background: hsla(210, 74%, 62%, 0.4);
66
+ }
67
+
68
+ .BRtranslateLayer ::-moz-selection {
69
+ background: hsla(210, 74%, 62%, 0.4);
70
+ }
71
+
72
+ .BRparagraphElement br {
73
+ visibility: hidden;
74
+ }
75
+
76
+ // Use CSS pseudo-elements to render the hyphens. This makes them
77
+ // not selectable, so copy/pasting text doesn't include them.
78
+ .BRwordElement--hyphen::after {
79
+ content: "-";
80
+ }
23
81
 
24
- .BRparagElement {
25
- fill: red;
26
- cursor: text;
27
- white-space: pre;
28
- fill-opacity: 0;
29
- font-family: Georgia, serif;
82
+ // Hide text layer for performance during zooming & scrolling
83
+ .BRsmooth-zooming, .BRscrolling-active {
84
+ // If the text layer has an annotation, don't hide it
85
+ .BRpagecontainer:not(.BRpagecontainer--hasSelection):not(:has(hypothesis-highlight)) .BRtextLayer {
86
+ display: none;
30
87
  }
31
88
  }
32
89
 
90
+ // Hide text selection layers of off-screen pages
91
+ .BRmode1up .BRpagecontainer:not(.BRpage-visible) .BRtextLayer {
92
+ display: none;
93
+ }
94
+
33
95
  // Makes page image unselectable
34
96
  .BRpagecontainer img {
35
97
  -webkit-user-select: none;
@@ -37,12 +99,55 @@
37
99
  user-select: none;
38
100
  }
39
101
 
40
- // Hides svg text layer when page animation is running
41
- .BRpageFlipping .textSelectionSVG {
102
+
103
+ // These are Microsoft Edge specific fixed to make some of the
104
+ // browsers features work well. These are for the in-place
105
+ // translation.
106
+ .BRtextLayer:has([_istranslated="1"], msreadoutspan) {
107
+ mix-blend-mode: normal;
108
+ }
109
+
110
+ .BRwordElement, .BRspace {
111
+ &[_istranslated="1"], &[_msttexthash] {
112
+ color: black;
113
+ letter-spacing: unset !important;
114
+ }
115
+ }
116
+
117
+ .BRlineElement:has([_istranslated="1"], [_msttexthash]) {
118
+ background: rgba(248, 237, 192, 0.8);
119
+ backdrop-filter: blur(8px);
120
+ color: black;
121
+ text-align: justify;
122
+ width: inherit;
123
+ &:not(:nth-last-child(2)) {
124
+ text-align-last: justify;
125
+ }
126
+ }
127
+
128
+ .BRlineElement[_msttexthash] {
129
+ word-spacing: unset !important;
130
+ }
131
+
132
+ .BRtranslateLayer .BRparagraphElement {
133
+ pointer-events: auto;
134
+ overflow-y: auto;
135
+ background: rgba(248, 237, 192, 0.8);
136
+ backdrop-filter: blur(8px);
137
+ color:black;
138
+ line-height: 1em;
139
+ text-align: justify;
140
+ }
141
+
142
+ .BRtranslateLayer .BRparagraphElement .BRlineElement {
143
+ white-space: break-spaces;
144
+ display: inline-block;
145
+ }
146
+
147
+ .BRtextLayer.showingTranslation {
42
148
  display: none;
43
149
  }
44
150
 
45
- // Hide phantom page when last page is selected
46
- .BRpagecontainer.BRemptypage .textSelectionSVG{
151
+ .BRtranslateLayer .BRparagraphElement.BRtranslateHidden {
47
152
  display: none;
48
153
  }
@@ -46,7 +46,7 @@
46
46
  }
47
47
  #cboxLoadingOverlay{background:transparent;}
48
48
 
49
- .shift{
49
+ .br-colorbox-shift {
50
50
  position: absolute !important;
51
51
  left: -10000px !important;
52
- }
52
+ }
@@ -1,7 +1,7 @@
1
1
  .BRcontrols {
2
2
  width: 100%;
3
3
 
4
- .tooltip {
4
+ .BRtooltip {
5
5
  display: none;
6
6
  position: absolute;
7
7
  width: auto;
@@ -14,9 +14,10 @@
14
14
  color: $controlsText;
15
15
  border-radius: 3px;
16
16
  background: $tooltipBG;
17
+ pointer-events: none;
17
18
  }
18
19
 
19
- .full .tooltip {
20
+ .full .BRtooltip {
20
21
  left: auto;
21
22
  right: 0;
22
23
  transform: translateX(0);
@@ -28,24 +29,32 @@
28
29
  }
29
30
  }
30
31
 
31
- select.playback-speed {
32
- width: 24px;
32
+ select.playback-speed, select.playback-voices {
33
33
  padding-top: 18px;
34
34
  -moz-appearance: none;
35
35
  -webkit-appearance: none;
36
36
  appearance: none;
37
37
  font-size: 10px;
38
- text-align: center;
39
38
  text-align-last: center;
40
39
  color: $controlsText;
41
40
  border: none;
42
41
  cursor: pointer;
43
- background: transparent url("icons/playback-speed.svg") 50% 0 no-repeat;
44
- option {
42
+ option, optgroup {
45
43
  background: $controlsBG;
46
44
  }
47
45
  }
48
46
 
47
+ select.playback-speed {
48
+ width: 30px;
49
+ background: transparent url("icons/playback-speed.svg") 50% 0 no-repeat;
50
+ }
51
+
52
+ select.playback-voices {
53
+ width: 30px;
54
+ background: transparent url("icons/voice.svg") 50% 0 no-repeat;
55
+ background-size: 18px;
56
+ }
57
+
49
58
  .active {
50
59
  background: $activeButtonBG;
51
60
  }
@@ -72,6 +81,10 @@
72
81
  height: 30px;
73
82
  }
74
83
 
84
+ .controls .hide {
85
+ display: none;
86
+ }
87
+
75
88
  @keyframes slideUp {
76
89
  from {
77
90
  opacity: 0;
@@ -100,6 +113,10 @@
100
113
  &.visible {
101
114
  display: flex;
102
115
  animation: slideUp 0.2s;
116
+ button {
117
+ width: unset;
118
+ height: unset;
119
+ }
103
120
  }
104
121
 
105
122
  li {
@@ -37,7 +37,7 @@
37
37
  }
38
38
 
39
39
  .icon-fullscreen-exit {
40
- background-image: url("icons/fullscreen-exit.svg");
40
+ background-image: url("icons/fullscreen_exit.svg");
41
41
  }
42
42
 
43
43
  .icon-thumb {
@@ -113,3 +113,16 @@
113
113
  height: 12px;
114
114
  background-image: url("icons/close-circle.svg");
115
115
  }
116
+
117
+ .icon-close-dark {
118
+ width: 12px;
119
+ height: 12px;
120
+ background-image: url("icons/close-circle-dark.svg");
121
+ }
122
+
123
+ .icon-toggle-slider {
124
+ background-size: 25px;
125
+ width: 25px;
126
+ height: 25px;
127
+ background-image: url("icons/slider-toggle.svg");
128
+ }
@@ -1,10 +1,9 @@
1
- import { css } from 'lit-element';
1
+ import { css } from 'lit';
2
2
 
3
3
  export default css`
4
4
  .ia-button {
5
5
  min-height: 3rem;
6
6
  border: none;
7
- outline: none;
8
7
  cursor: pointer;
9
8
  color: var(--primaryTextColor);
10
9
  line-height: normal;
@@ -12,6 +11,7 @@ export default css`
12
11
  text-align: center;
13
12
  vertical-align: middle;
14
13
  font-size: 1.4rem;
14
+ font-family: inherit;
15
15
  display: inline-block;
16
16
  padding: .6rem 1.2rem;
17
17
  border: 1px solid transparent;
@@ -24,8 +24,10 @@ export default css`
24
24
  user-select: none;
25
25
  }
26
26
 
27
- .ia-button.link {
27
+ .ia-button.link,
28
+ .ia-button.external {
28
29
  min-height: unset;
30
+ text-decoration: none;
29
31
  }
30
32
 
31
33
  .ia-button:disabled,
@@ -51,4 +53,9 @@ export default css`
51
53
  background-color: var(--primaryErrorCTAFill);
52
54
  border-color: var(--primaryErrorCTABorder);
53
55
  }
56
+
57
+ .ia-button.external {
58
+ background: var(--secondaryCTAFill);
59
+ border-color: var(--secondaryCTABorder);
60
+ }
54
61
  `;
@@ -0,0 +1,9 @@
1
+ import { html } from 'lit';
2
+
3
+ export default html`
4
+ <svg height="10" viewBox="0 0 13 10" width="13" xmlns="http://www.w3.org/2000/svg">
5
+ <path
6
+ d="m4.33333333 10-4.33333333-4.16666667 1.73333333-1.66666666 2.6 2.5 6.93333337-6.66666667 1.7333333 1.66666667z"
7
+ fill="#fff" fill-rule="evenodd" />
8
+ </svg>
9
+ `;
@@ -0,0 +1,15 @@
1
+ import { css } from "lit";
2
+
3
+ export const sharedStyles = css`
4
+ .sr-only {
5
+ position: absolute !important;
6
+ width: 1px !important;
7
+ height: 1px !important;
8
+ padding: 0 !important;
9
+ margin: -1px !important;
10
+ overflow: hidden !important;
11
+ clip: rect(0 0 0 0) !important;
12
+ white-space: nowrap !important;
13
+ border: 0 !important;
14
+ }
15
+ `;
@@ -0,0 +1,81 @@
1
+ import { html } from 'lit';
2
+ import '@internetarchive/icon-dl/icon-dl.js';
3
+ import './downloads.js';
4
+
5
+ const menuBase = {
6
+ pdf: {
7
+ type: 'Encrypted Adobe PDF',
8
+ url: '#',
9
+ note: 'PDF files contain high quality images of pages.',
10
+ },
11
+ lcppdf: {
12
+ type: 'Get LCP PDF',
13
+ url: '#',
14
+ note: 'PDF files contain high quality images of pages.',
15
+ },
16
+ lcpepub: {
17
+ type: 'Get LCP ePub',
18
+ url: '#',
19
+ note: 'ePub files are smaller in size, but may contain errors.',
20
+ },
21
+ epub: {
22
+ type: 'Encrypted Adobe ePub',
23
+ url: '#',
24
+ note: 'ePub files are smaller in size, but may contain errors.',
25
+ },
26
+ };
27
+
28
+ const publicMenuBase = {
29
+ pdf: "PDF",
30
+ epub: "ePub",
31
+ lcppdf: "LCP PDF",
32
+ lcpepub: "LCP ePub",
33
+ };
34
+
35
+ export default class DownloadsProvider {
36
+
37
+ constructor({ bookreader }) {
38
+ this.icon = html`<ia-icon-dl aria-hidden="true" role="presentation" style="width: var(--iconWidth); height: var(--iconHeight);"></ia-icon-dl>`;
39
+ this.label = 'Downloadable files';
40
+ this.menuDetails = '';
41
+ this.downloads = [];
42
+ this.id = 'downloads';
43
+ this.component = '';
44
+ this.isBookProtected = bookreader?.options?.isProtected || false;
45
+ }
46
+
47
+ update(downloadTypes) {
48
+ this.computeAvailableTypes(downloadTypes);
49
+ this.component = this.menu;
50
+ this.component.isBookProtected = this.isBookProtected;
51
+
52
+ const ending = this.downloads.length === 1 ? '' : 's';
53
+ this.menuDetails = `(${this.downloads.length} format${ending})`;
54
+ }
55
+
56
+ /**
57
+ * Generates Download Menu Info for available types
58
+ * sets global `downloads`
59
+ * @param availableTypes
60
+ */
61
+ computeAvailableTypes(availableTypes = []) {
62
+ const menuData = availableTypes.reduce((found, incoming = []) => {
63
+ const [ type = '', link = '' ] = incoming;
64
+ const formattedType = type.toLowerCase();
65
+ const downloadOption = menuBase[formattedType] || null;
66
+
67
+ if (downloadOption) {
68
+ const menuButtonText = this.isBookProtected ? menuBase[formattedType].type : publicMenuBase[formattedType];
69
+ const menuInfo = Object.assign({}, downloadOption, { url: link, type: menuButtonText});
70
+ found.push(menuInfo);
71
+ }
72
+ return found;
73
+ }, []);
74
+
75
+ this.downloads = menuData;
76
+ }
77
+
78
+ get menu () {
79
+ return html`<ia-book-downloads .downloads=${this.downloads}></ia-book-downloads>`;
80
+ }
81
+ }
@@ -1,11 +1,12 @@
1
- import { css, html, LitElement } from 'lit-element';
2
- import { nothing } from 'lit-html';
1
+ import { css, html, LitElement, nothing } from 'lit';
2
+ import buttonStyles from '../../css/button-base.js';
3
3
  export class IABookDownloads extends LitElement {
4
4
  static get properties() {
5
5
  return {
6
6
  downloads: { type: Array },
7
7
  expiration: { type: Number },
8
8
  renderHeader: { type: Boolean },
9
+ isBookProtected: { type: Boolean },
9
10
  };
10
11
  }
11
12
 
@@ -14,6 +15,7 @@ export class IABookDownloads extends LitElement {
14
15
  this.downloads = [];
15
16
  this.expiration = 0;
16
17
  this.renderHeader = false;
18
+ this.isBookProtected = false;
17
19
  }
18
20
 
19
21
  get formatsCount() {
@@ -31,13 +33,23 @@ export class IABookDownloads extends LitElement {
31
33
  return this.downloads.map(option => (
32
34
  html`
33
35
  <li>
34
- <a class="button" href="${option.url}">Get ${option.type}</a>
36
+ <a class="ia-button link primary" href="${option.url}">Get ${option.type}</a>
35
37
  ${option.note ? html`<p>${option.note}</p>` : html``}
36
38
  </li>
37
39
  `
38
40
  ));
39
41
  }
40
42
 
43
+ /**
44
+ * checks if downloads list contains an LCP option
45
+ * @return {boolean}
46
+ */
47
+ get hasLCPOption() {
48
+ const regex = /^(LCP)/g;
49
+ const lcpAvailable = this.downloads.some(option => option.type?.match(regex));
50
+ return lcpAvailable;
51
+ }
52
+
41
53
  get header() {
42
54
  if (!this.renderHeader) {
43
55
  return nothing;
@@ -50,18 +62,26 @@ export class IABookDownloads extends LitElement {
50
62
  `;
51
63
  }
52
64
 
65
+ get installLCPSoftwareMsg() {
66
+ return html`
67
+ <p>For LCP downloads, make sure you have LCP software such as <a href="https://thorium.edrlab.org/" rel="noopener noreferrer nofollow" target="_blank">Thorium (desktop)</a>, <a href="https://apps.apple.com/us/app/cantook-by-aldiko/id1476410111" rel="noopener noreferrer nofollow" target="_blank">Cantook (iOS)</a> or <a href="https://play.google.com/store/apps/details?id=com.aldiko.android" rel="noopener noreferrer nofollow" target="_blank">Cantook (Android)</a> installed on your device.</p>
68
+ `;
69
+ }
70
+
53
71
  render() {
54
72
  return html`
55
73
  ${this.header}
56
74
  ${this.loanExpiryMessage}
57
75
  <ul>${this.renderDownloadOptions()}</ul>
58
- <p>To access downloaded books, you need Adobe-compliant software on your device. The Internet Archive will administer this loan, but Adobe may also collect some information.</p>
59
- <a class="button external" href="https://www.adobe.com/solutions/ebook/digital-editions/download.html" rel="noopener noreferrer" target="_blank">Install Adobe Digital Editions</a>
76
+ ${this.hasLCPOption
77
+ ? this.installLCPSoftwareMsg
78
+ : nothing
79
+ }
60
80
  `;
61
81
  }
62
82
 
63
83
  static get styles() {
64
- return css`
84
+ const mainCss = css`
65
85
  :host {
66
86
  display: block;
67
87
  height: 100%;
@@ -79,24 +99,6 @@ export class IABookDownloads extends LitElement {
79
99
  justify-self: end;
80
100
  }
81
101
 
82
- .button {
83
- color: var(--primaryTextColor);
84
- background: var(--primaryCTAFill);
85
- border: 1px solid var(--primaryCTABorder);
86
- display: inline-block;
87
- padding: .6rem 1rem;
88
- font-size: 1.4rem;
89
- text-decoration: none;
90
- text-shadow: 1px 1px #484848;
91
- border-radius: 4px;
92
- }
93
-
94
- .button.external {
95
- background: var(--secondaryCTAFill, transparent);
96
- border: 1px solid var(--secondaryCTABorder, #999);
97
- text-shadow: none;
98
- }
99
-
100
102
  header {
101
103
  display: flex;
102
104
  align-items: center;
@@ -109,7 +111,6 @@ export class IABookDownloads extends LitElement {
109
111
  font-weight: bold;
110
112
  font-style: italic;
111
113
  }
112
-
113
114
  header div {
114
115
  display: flex;
115
116
  align-items: baseline;
@@ -142,5 +143,8 @@ export class IABookDownloads extends LitElement {
142
143
  line-height: 140%;
143
144
  }
144
145
  `;
146
+
147
+ return [buttonStyles, mainCss];
145
148
  }
146
149
  }
150
+ customElements.define('ia-book-downloads', IABookDownloads);