@internetarchive/bookreader 5.0.0-12-fixsorting-8 → 5.0.0-120

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 (420) hide show
  1. package/BookReader/474.js +2 -0
  2. package/BookReader/474.js.map +1 -0
  3. package/BookReader/BookReader.css +670 -1190
  4. package/BookReader/bergamot-translator-worker.js +2966 -0
  5. package/BookReader/bergamot-translator-worker.wasm +0 -0
  6. package/BookReader/hypothesis/LICENSE +50 -0
  7. package/BookReader/hypothesis/README.md +55 -0
  8. package/BookReader/hypothesis/build/boot-template.js +1 -0
  9. package/BookReader/hypothesis/build/boot.js +1 -0
  10. package/BookReader/hypothesis/build/manifest.json +20 -0
  11. package/BookReader/hypothesis/build/scripts/annotator.bundle.js +199 -0
  12. package/BookReader/hypothesis/build/scripts/annotator.bundle.js.map +1 -0
  13. package/BookReader/hypothesis/build/scripts/sidebar.bundle.js +811 -0
  14. package/BookReader/hypothesis/build/scripts/sidebar.bundle.js.map +1 -0
  15. package/BookReader/hypothesis/build/scripts/ui-playground.bundle.js +437 -0
  16. package/BookReader/hypothesis/build/scripts/ui-playground.bundle.js.map +1 -0
  17. package/BookReader/hypothesis/build/styles/annotator.css +4 -0
  18. package/BookReader/hypothesis/build/styles/annotator.css.map +1 -0
  19. package/BookReader/hypothesis/build/styles/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  20. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  21. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  22. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  23. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  24. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Bold.woff2 +0 -0
  25. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  26. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Italic.woff2 +0 -0
  27. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Regular.woff2 +0 -0
  28. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  29. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Math-Italic.woff2 +0 -0
  30. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  31. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  32. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  33. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Script-Regular.woff2 +0 -0
  34. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  35. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  36. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  37. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  38. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  39. package/BookReader/hypothesis/build/styles/highlights.css +2 -0
  40. package/BookReader/hypothesis/build/styles/highlights.css.map +1 -0
  41. package/BookReader/hypothesis/build/styles/katex.min.css +3 -0
  42. package/BookReader/hypothesis/build/styles/katex.min.css.map +1 -0
  43. package/BookReader/hypothesis/build/styles/pdfjs-overrides.css +14 -0
  44. package/BookReader/hypothesis/build/styles/pdfjs-overrides.css.map +1 -0
  45. package/BookReader/hypothesis/build/styles/sidebar.css +4 -0
  46. package/BookReader/hypothesis/build/styles/sidebar.css.map +1 -0
  47. package/BookReader/hypothesis/build/styles/ui-playground.css +4 -0
  48. package/BookReader/hypothesis/build/styles/ui-playground.css.map +1 -0
  49. package/BookReader/hypothesis/package.json +126 -0
  50. package/BookReader/ia-bookreader.js +1886 -0
  51. package/BookReader/{BookReader.js.LICENSE.txt → ia-bookreader.js.LICENSE.txt} +26 -20
  52. package/BookReader/ia-bookreader.js.map +1 -0
  53. package/BookReader/icons/1up.svg +1 -12
  54. package/BookReader/icons/2up.svg +1 -15
  55. package/BookReader/icons/advance.svg +3 -26
  56. package/BookReader/icons/chevron-right.svg +1 -1
  57. package/BookReader/icons/close-circle-dark.svg +1 -1
  58. package/BookReader/icons/close-circle.svg +1 -1
  59. package/BookReader/icons/fullscreen.svg +1 -17
  60. package/BookReader/icons/fullscreen_exit.svg +1 -17
  61. package/BookReader/icons/hamburger.svg +1 -15
  62. package/BookReader/icons/left-arrow.svg +1 -12
  63. package/BookReader/icons/magnify-minus.svg +1 -16
  64. package/BookReader/icons/magnify-plus.svg +1 -17
  65. package/BookReader/icons/magnify.svg +1 -15
  66. package/BookReader/icons/pause.svg +1 -23
  67. package/BookReader/icons/play.svg +1 -22
  68. package/BookReader/icons/playback-speed.svg +1 -34
  69. package/BookReader/icons/read-aloud.svg +1 -22
  70. package/BookReader/icons/review.svg +3 -22
  71. package/BookReader/icons/slider-toggle.svg +1 -0
  72. package/BookReader/icons/thumbnails.svg +1 -17
  73. package/BookReader/icons/voice.svg +1 -0
  74. package/BookReader/icons/volume-full.svg +1 -22
  75. package/BookReader/images/BRicons.svg +5 -94
  76. package/BookReader/images/books_graphic.svg +1 -177
  77. package/BookReader/images/hypothesis.ico +0 -0
  78. package/BookReader/images/icon_book.svg +1 -12
  79. package/BookReader/images/icon_bookmark.svg +1 -12
  80. package/BookReader/images/icon_experiment.svg +1 -0
  81. package/BookReader/images/icon_gear.svg +1 -14
  82. package/BookReader/images/icon_hamburger.svg +1 -20
  83. package/BookReader/images/icon_home.svg +1 -21
  84. package/BookReader/images/icon_info.svg +1 -11
  85. package/BookReader/images/icon_one_page.svg +1 -8
  86. package/BookReader/images/icon_pause.svg +1 -1
  87. package/BookReader/images/icon_play.svg +1 -1
  88. package/BookReader/images/icon_playback-rate.svg +1 -15
  89. package/BookReader/images/icon_search_button.svg +1 -8
  90. package/BookReader/images/icon_share.svg +1 -9
  91. package/BookReader/images/icon_skip-ahead.svg +1 -6
  92. package/BookReader/images/icon_skip-back.svg +2 -13
  93. package/BookReader/images/icon_speaker.svg +1 -18
  94. package/BookReader/images/icon_speaker_open.svg +1 -10
  95. package/BookReader/images/icon_thumbnails.svg +1 -12
  96. package/BookReader/images/icon_toc.svg +1 -5
  97. package/BookReader/images/icon_two_pages.svg +1 -9
  98. package/BookReader/images/marker_chap-off.svg +1 -11
  99. package/BookReader/images/marker_chap-on.svg +1 -11
  100. package/BookReader/images/marker_srch-on.svg +1 -11
  101. package/BookReader/images/translate.svg +1 -0
  102. package/BookReader/images/unviewable_page.png +0 -0
  103. package/BookReader/jquery-3.js +2 -0
  104. package/BookReader/jquery-3.js.LICENSE.txt +24 -0
  105. package/BookReader/plugins/plugin.archive_analytics.js +1 -172
  106. package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
  107. package/BookReader/plugins/plugin.autoplay.js +1 -165
  108. package/BookReader/plugins/plugin.autoplay.js.map +1 -1
  109. package/BookReader/plugins/plugin.chapters.js +19 -301
  110. package/BookReader/plugins/plugin.chapters.js.LICENSE.txt +1 -0
  111. package/BookReader/plugins/plugin.chapters.js.map +1 -1
  112. package/BookReader/plugins/plugin.experiments.js +3 -0
  113. package/BookReader/plugins/plugin.experiments.js.LICENSE.txt +1 -0
  114. package/BookReader/plugins/plugin.experiments.js.map +1 -0
  115. package/BookReader/plugins/plugin.iframe.js +1 -74
  116. package/BookReader/plugins/plugin.iframe.js.map +1 -1
  117. package/BookReader/plugins/plugin.iiif.js +2 -0
  118. package/BookReader/plugins/plugin.iiif.js.map +1 -0
  119. package/BookReader/plugins/plugin.resume.js +1 -368
  120. package/BookReader/plugins/plugin.resume.js.map +1 -1
  121. package/BookReader/plugins/plugin.search.js +2 -1385
  122. package/BookReader/plugins/plugin.search.js.LICENSE.txt +1 -0
  123. package/BookReader/plugins/plugin.search.js.map +1 -1
  124. package/BookReader/plugins/plugin.text_selection.js +2 -1080
  125. package/BookReader/plugins/plugin.text_selection.js.LICENSE.txt +1 -0
  126. package/BookReader/plugins/plugin.text_selection.js.map +1 -1
  127. package/BookReader/plugins/plugin.translate.js +3 -0
  128. package/BookReader/plugins/plugin.translate.js.LICENSE.txt +1 -0
  129. package/BookReader/plugins/plugin.translate.js.map +1 -0
  130. package/BookReader/plugins/plugin.tts.js +2 -9193
  131. package/BookReader/plugins/plugin.tts.js.LICENSE.txt +2 -0
  132. package/BookReader/plugins/plugin.tts.js.map +1 -1
  133. package/BookReader/plugins/plugin.url.js +1 -269
  134. package/BookReader/plugins/plugin.url.js.map +1 -1
  135. package/BookReader/plugins/plugin.vendor-fullscreen.js +1 -379
  136. package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
  137. package/BookReader/plugins/translator-worker.js +2 -0
  138. package/BookReader/plugins/translator-worker.js.map +1 -0
  139. package/BookReader/silence.mp3 +0 -0
  140. package/BookReader/translator-worker.js +475 -0
  141. package/BookReader/webcomponents-bundle.js +3 -0
  142. package/BookReader/webcomponents-bundle.js.LICENSE.txt +9 -0
  143. package/BookReader/webcomponents-bundle.js.map +1 -0
  144. package/README.md +17 -4
  145. package/dist/esm/ia-bookreader.js +3 -0
  146. package/dist/esm/ia-bookreader.js.LICENSE.txt +17 -0
  147. package/dist/esm/ia-bookreader.js.map +1 -0
  148. package/dist/esm/plugins/plugin.archive_analytics.js +2 -0
  149. package/dist/esm/plugins/plugin.archive_analytics.js.map +1 -0
  150. package/dist/esm/plugins/plugin.autoplay.js +2 -0
  151. package/dist/esm/plugins/plugin.autoplay.js.map +1 -0
  152. package/dist/esm/plugins/plugin.chapters.js +2 -0
  153. package/dist/esm/plugins/plugin.chapters.js.map +1 -0
  154. package/dist/esm/plugins/plugin.experiments.js +2 -0
  155. package/dist/esm/plugins/plugin.experiments.js.map +1 -0
  156. package/dist/esm/plugins/plugin.iframe.js +2 -0
  157. package/dist/esm/plugins/plugin.iframe.js.map +1 -0
  158. package/dist/esm/plugins/plugin.iiif.js +2 -0
  159. package/dist/esm/plugins/plugin.iiif.js.map +1 -0
  160. package/dist/esm/plugins/plugin.resume.js +2 -0
  161. package/dist/esm/plugins/plugin.resume.js.map +1 -0
  162. package/dist/esm/plugins/plugin.search.js +2 -0
  163. package/dist/esm/plugins/plugin.search.js.map +1 -0
  164. package/dist/esm/plugins/plugin.text_selection.js +2 -0
  165. package/dist/esm/plugins/plugin.text_selection.js.map +1 -0
  166. package/dist/esm/plugins/plugin.translate.js +2 -0
  167. package/dist/esm/plugins/plugin.translate.js.map +1 -0
  168. package/dist/esm/plugins/plugin.tts.js +2 -0
  169. package/dist/esm/plugins/plugin.tts.js.map +1 -0
  170. package/dist/esm/plugins/plugin.url.js +2 -0
  171. package/dist/esm/plugins/plugin.url.js.map +1 -0
  172. package/dist/esm/plugins/plugin.vendor-fullscreen.js +2 -0
  173. package/dist/esm/plugins/plugin.vendor-fullscreen.js.map +1 -0
  174. package/jsconfig.json +18 -0
  175. package/package.json +113 -71
  176. package/src/BookReader/BookModel.js +92 -46
  177. package/src/BookReader/DragScrollable.js +233 -0
  178. package/src/BookReader/ImageCache.js +49 -16
  179. package/src/BookReader/Mode1Up.js +66 -365
  180. package/src/BookReader/Mode1UpLit.js +392 -0
  181. package/src/BookReader/Mode2Up.js +87 -1315
  182. package/src/BookReader/Mode2UpLit.js +786 -0
  183. package/src/BookReader/ModeAbstract.js +43 -0
  184. package/src/BookReader/ModeCoordinateSpace.js +29 -0
  185. package/src/BookReader/ModeSmoothZoom.js +312 -0
  186. package/src/BookReader/ModeThumb.js +29 -15
  187. package/src/BookReader/Navbar/Navbar.js +204 -84
  188. package/src/BookReader/PageContainer.js +120 -23
  189. package/src/BookReader/ReduceSet.js +2 -2
  190. package/src/BookReader/Toolbar/Toolbar.js +18 -40
  191. package/src/BookReader/events.js +3 -3
  192. package/src/BookReader/options.js +105 -18
  193. package/src/BookReader/utils/HTMLDimensionsCacher.js +44 -0
  194. package/src/BookReader/utils/ScrollClassAdder.js +31 -0
  195. package/src/BookReader/utils/SelectionObserver.js +72 -0
  196. package/src/BookReader/utils/classes.js +1 -1
  197. package/src/BookReader/utils.js +136 -12
  198. package/src/BookReader.js +732 -1231
  199. package/src/BookReaderPlugin.js +52 -0
  200. package/src/assets/icons/magnify-minus.svg +3 -7
  201. package/src/assets/icons/magnify-plus.svg +3 -7
  202. package/src/assets/icons/slider-toggle.svg +1 -0
  203. package/src/assets/icons/voice.svg +1 -0
  204. package/src/assets/images/hypothesis.ico +0 -0
  205. package/src/assets/images/icon_experiment.svg +1 -0
  206. package/src/assets/images/translate.svg +1 -0
  207. package/src/assets/images/unviewable_page.png +0 -0
  208. package/src/assets/silence.mp3 +0 -0
  209. package/src/css/BookReader.scss +1 -5
  210. package/src/css/_BRBookmarks.scss +1 -1
  211. package/src/css/_BRComponent.scss +1 -1
  212. package/src/css/_BRicon.scss +8 -2
  213. package/src/css/_BRmain.scss +16 -3
  214. package/src/css/_BRnav.scss +74 -70
  215. package/src/css/_BRpages.scss +174 -42
  216. package/src/css/_BRsearch.scss +69 -30
  217. package/src/css/_BRtoolbar.scss +5 -5
  218. package/src/css/_TextSelection.scss +249 -25
  219. package/src/css/_colorbox.scss +2 -2
  220. package/src/css/_controls.scss +24 -7
  221. package/src/css/_icons.scss +8 -1
  222. package/src/{BookNavigator/assets → css}/button-base.js +2 -2
  223. package/src/css/icon_checkmark.js +9 -0
  224. package/src/css/sharedStyles.js +15 -0
  225. package/src/ia-bookreader/downloads/downloads-provider.js +81 -0
  226. package/src/{BookNavigator → ia-bookreader}/downloads/downloads.js +25 -5
  227. package/src/ia-bookreader/ia-bookreader.js +686 -0
  228. package/src/ia-bookreader/sharing.js +27 -0
  229. package/src/ia-bookreader/viewable-files.js +98 -0
  230. package/src/{BookNavigator → ia-bookreader}/visual-adjustments/visual-adjustments-provider.js +17 -17
  231. package/src/{BookNavigator → ia-bookreader}/visual-adjustments/visual-adjustments.js +75 -67
  232. package/src/{BookNavigator → plugins}/bookmarks/bookmark-button.js +4 -3
  233. package/src/{BookNavigator/assets → plugins/bookmarks}/bookmark-colors.js +1 -1
  234. package/src/{BookNavigator → plugins}/bookmarks/bookmark-edit.js +43 -31
  235. package/src/{BookNavigator → plugins}/bookmarks/bookmarks-list.js +48 -49
  236. package/src/{BookNavigator → plugins}/bookmarks/bookmarks-loginCTA.js +3 -3
  237. package/src/plugins/bookmarks/bookmarks-provider.js +63 -0
  238. package/src/{BookNavigator → plugins/bookmarks}/delete-modal-actions.js +1 -1
  239. package/src/{BookNavigator → plugins}/bookmarks/ia-bookmarks.js +117 -68
  240. package/src/plugins/plugin.archive_analytics.js +84 -78
  241. package/src/plugins/plugin.autoplay.js +99 -104
  242. package/src/plugins/plugin.chapters.js +323 -205
  243. package/src/plugins/plugin.experiments.js +375 -0
  244. package/src/plugins/plugin.iframe.js +36 -37
  245. package/src/plugins/plugin.iiif.js +147 -0
  246. package/src/plugins/plugin.resume.js +54 -51
  247. package/src/plugins/plugin.text_selection.js +464 -219
  248. package/src/plugins/plugin.vendor-fullscreen.js +5 -5
  249. package/src/plugins/search/plugin.search.js +347 -397
  250. package/src/{BookNavigator → plugins}/search/search-provider.js +59 -27
  251. package/src/{BookNavigator → plugins}/search/search-results.js +105 -76
  252. package/src/plugins/search/utils.js +50 -0
  253. package/src/plugins/search/view.js +51 -69
  254. package/src/plugins/translate/TranslationManager.js +164 -0
  255. package/src/plugins/translate/plugin.translate.js +559 -0
  256. package/src/plugins/tts/AbstractTTSEngine.js +78 -49
  257. package/src/plugins/tts/FestivalTTSEngine.js +20 -30
  258. package/src/plugins/tts/PageChunk.js +117 -23
  259. package/src/plugins/tts/PageChunkIterator.js +11 -17
  260. package/src/plugins/tts/WebTTSEngine.js +132 -92
  261. package/src/plugins/tts/plugin.tts.js +341 -351
  262. package/src/plugins/tts/utils.js +76 -67
  263. package/src/plugins/url/UrlPlugin.js +213 -0
  264. package/src/plugins/{plugin.url.js → url/plugin.url.js} +54 -18
  265. package/src/util/TextSelectionManager.js +1464 -0
  266. package/src/util/browserSniffing.js +42 -1
  267. package/src/util/cache.js +20 -0
  268. package/src/util/docCookies.js +21 -2
  269. package/src/util/dom.js +88 -0
  270. package/src/util/generators.js +89 -0
  271. package/src/util/lit.js +15 -0
  272. package/src/util/strings.js +11 -0
  273. package/.babelrc +0 -12
  274. package/.dependabot/config.yml +0 -6
  275. package/.eslintrc.js +0 -50
  276. package/.gitattributes +0 -2
  277. package/.github/ISSUE_TEMPLATE/bug.md +0 -32
  278. package/.github/ISSUE_TEMPLATE/feature-request.md +0 -30
  279. package/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +0 -15
  280. package/.github/workflows/node.js.yml +0 -37
  281. package/.github/workflows/npm-publish.yml +0 -47
  282. package/.testcaferc.json +0 -5
  283. package/BookReader/BookReader.js +0 -21613
  284. package/BookReader/BookReader.js.map +0 -1
  285. package/BookReader/bookreader-component-bundle.js +0 -14497
  286. package/BookReader/bookreader-component-bundle.js.LICENSE.txt +0 -38
  287. package/BookReader/bookreader-component-bundle.js.map +0 -1
  288. package/BookReader/jquery-1.10.1.js +0 -108
  289. package/BookReader/jquery-1.10.1.js.LICENSE.txt +0 -24
  290. package/BookReader/plugins/plugin.menu_toggle.js +0 -369
  291. package/BookReader/plugins/plugin.menu_toggle.js.map +0 -1
  292. package/BookReader/plugins/plugin.mobile_nav.js +0 -335
  293. package/BookReader/plugins/plugin.mobile_nav.js.map +0 -1
  294. package/BookReaderDemo/BookReaderDemo.css +0 -41
  295. package/BookReaderDemo/BookReaderJSAdvanced.js +0 -115
  296. package/BookReaderDemo/BookReaderJSAutoplay.js +0 -56
  297. package/BookReaderDemo/BookReaderJSSimple.js +0 -55
  298. package/BookReaderDemo/IIIFBookReader.js +0 -207
  299. package/BookReaderDemo/assets/v5/Bookreader-logo-cool-grad.svg +0 -1
  300. package/BookReaderDemo/assets/v5/Bookreader-logo-flat.svg +0 -1
  301. package/BookReaderDemo/assets/v5/Bookreader-logo-hex-cool-grad.png +0 -0
  302. package/BookReaderDemo/assets/v5/Bookreader-logo-hex-flat.png +0 -0
  303. package/BookReaderDemo/assets/v5/Bookreader-logo-lines.png +0 -0
  304. package/BookReaderDemo/assets/v5/Bookreader-logo-lines.svg +0 -1
  305. package/BookReaderDemo/assets/v5/Bookreader-logo-warm.svg +0 -1
  306. package/BookReaderDemo/assets/v5/bookreader-logo-renders@1x.png +0 -0
  307. package/BookReaderDemo/assets/v5/bookreader-logo-renders@2x.png +0 -0
  308. package/BookReaderDemo/assets/v5/bookreader-v5-screenshot.png +0 -0
  309. package/BookReaderDemo/bookreader-template-bundle.js +0 -7178
  310. package/BookReaderDemo/demo-advanced.html +0 -33
  311. package/BookReaderDemo/demo-autoplay.html +0 -38
  312. package/BookReaderDemo/demo-embed-iframe-src.html +0 -84
  313. package/BookReaderDemo/demo-embed.html +0 -26
  314. package/BookReaderDemo/demo-fullscreen-mobile.html +0 -36
  315. package/BookReaderDemo/demo-fullscreen.html +0 -33
  316. package/BookReaderDemo/demo-iiif.html +0 -34
  317. package/BookReaderDemo/demo-iiif.js +0 -26
  318. package/BookReaderDemo/demo-internetarchive.html +0 -74
  319. package/BookReaderDemo/demo-multiple.html +0 -43
  320. package/BookReaderDemo/demo-plugin-menu-toggle.html +0 -34
  321. package/BookReaderDemo/demo-preview-pages.html +0 -1092
  322. package/BookReaderDemo/demo-simple.html +0 -34
  323. package/BookReaderDemo/demo-vendor-fullscreen.html +0 -36
  324. package/BookReaderDemo/immersion-1up.html +0 -64
  325. package/BookReaderDemo/immersion-mode.html +0 -35
  326. package/BookReaderDemo/toggle_controls.html +0 -53
  327. package/BookReaderDemo/view_mode.html +0 -39
  328. package/BookReaderDemo/viewmode-cycle.html +0 -41
  329. package/CHANGELOG.md +0 -499
  330. package/CONTRIBUTING.md +0 -7
  331. package/codecov.yml +0 -17
  332. package/index.html +0 -31
  333. package/karma.conf.js +0 -23
  334. package/screenshot.png +0 -0
  335. package/scripts/postversion.js +0 -10
  336. package/scripts/preversion.js +0 -14
  337. package/scripts/version.js +0 -26
  338. package/src/BookNavigator/BookModel.js +0 -14
  339. package/src/BookNavigator/BookNavigator.js +0 -459
  340. package/src/BookNavigator/assets/book-loader.js +0 -27
  341. package/src/BookNavigator/assets/icon_checkmark.js +0 -6
  342. package/src/BookNavigator/assets/icon_close.js +0 -3
  343. package/src/BookNavigator/assets/icon_sort_ascending.js +0 -5
  344. package/src/BookNavigator/assets/icon_sort_descending.js +0 -5
  345. package/src/BookNavigator/assets/icon_sort_neutral.js +0 -5
  346. package/src/BookNavigator/assets/icon_volumes.js +0 -11
  347. package/src/BookNavigator/bookmarks/bookmarks-provider.js +0 -53
  348. package/src/BookNavigator/br-fullscreen-mgr.js +0 -83
  349. package/src/BookNavigator/downloads/downloads-provider.js +0 -66
  350. package/src/BookNavigator/search/a-search-result.js +0 -55
  351. package/src/BookNavigator/volumes/volumes-provider.js +0 -83
  352. package/src/BookNavigator/volumes/volumes.js +0 -178
  353. package/src/BookReader/DebugConsole.js +0 -54
  354. package/src/BookReaderComponent/BookReaderComponent.js +0 -112
  355. package/src/ItemNavigator/ItemNavigator.js +0 -376
  356. package/src/ItemNavigator/providers/sharing.js +0 -33
  357. package/src/css/_MobileNav.scss +0 -194
  358. package/src/dragscrollable-br.js +0 -261
  359. package/src/plugins/menu_toggle/plugin.menu_toggle.js +0 -324
  360. package/src/plugins/plugin.mobile_nav.js +0 -287
  361. package/tests/BookReader/BookModel.test.js +0 -312
  362. package/tests/BookReader/BookReaderPublicFunctions.test.js +0 -171
  363. package/tests/BookReader/DebugConsole.test.js +0 -25
  364. package/tests/BookReader/ImageCache.test.js +0 -150
  365. package/tests/BookReader/Mode1Up.test.js +0 -164
  366. package/tests/BookReader/Mode2Up.test.js +0 -247
  367. package/tests/BookReader/Navbar/Navbar.test.js +0 -169
  368. package/tests/BookReader/PageContainer.test.js +0 -115
  369. package/tests/BookReader/ReduceSet.test.js +0 -38
  370. package/tests/BookReader/Toolbar/Toolbar.test.js +0 -26
  371. package/tests/BookReader/utils/classes.test.js +0 -88
  372. package/tests/BookReader/utils.test.js +0 -109
  373. package/tests/BookReader.options.test.js +0 -39
  374. package/tests/BookReader.test.js +0 -301
  375. package/tests/e2e/README.md +0 -75
  376. package/tests/e2e/autoplay.test.js +0 -13
  377. package/tests/e2e/base.test.js +0 -35
  378. package/tests/e2e/helpers/base.js +0 -263
  379. package/tests/e2e/helpers/debug.js +0 -13
  380. package/tests/e2e/helpers/desktopSearch.js +0 -72
  381. package/tests/e2e/helpers/mobileSearch.js +0 -85
  382. package/tests/e2e/helpers/mockSearch.js +0 -93
  383. package/tests/e2e/helpers/rightToLeft.js +0 -29
  384. package/tests/e2e/ia-production/ia-prod-base.js +0 -17
  385. package/tests/e2e/models/BookReader.js +0 -11
  386. package/tests/e2e/models/Navigation.js +0 -56
  387. package/tests/e2e/rightToLeft.test.js +0 -20
  388. package/tests/e2e/viewmode.test.js +0 -37
  389. package/tests/karma/BookNavigator/book-navigator.test.js +0 -139
  390. package/tests/karma/BookNavigator/bookmarks/bookmark-edit.test.js +0 -133
  391. package/tests/karma/BookNavigator/bookmarks/bookmarks-list.test.js +0 -222
  392. package/tests/karma/BookNavigator/search/search-provider.test.js +0 -23
  393. package/tests/karma/BookNavigator/search/search-results.test.js +0 -240
  394. package/tests/karma/BookNavigator/sharing/sharing-provider.test.js +0 -40
  395. package/tests/karma/BookNavigator/visual-adjustments.test.js +0 -201
  396. package/tests/karma/BookNavigator/volumes/volumes-provider.test.js +0 -141
  397. package/tests/karma/BookNavigator/volumes/volumes.test.js +0 -98
  398. package/tests/plugins/menu_toggle/plugin.menu_toggle.test.js +0 -68
  399. package/tests/plugins/plugin.archive_analytics.test.js +0 -23
  400. package/tests/plugins/plugin.autoplay.test.js +0 -52
  401. package/tests/plugins/plugin.chapters.test.js +0 -130
  402. package/tests/plugins/plugin.iframe.test.js +0 -42
  403. package/tests/plugins/plugin.mobile_nav.test.js +0 -66
  404. package/tests/plugins/plugin.resume.test.js +0 -98
  405. package/tests/plugins/plugin.text_selection.test.js +0 -203
  406. package/tests/plugins/plugin.url.test.js +0 -129
  407. package/tests/plugins/plugin.vendor-fullscreen.test.js +0 -65
  408. package/tests/plugins/search/plugin.search.test.js +0 -173
  409. package/tests/plugins/search/plugin.search.view.test.js +0 -106
  410. package/tests/plugins/tts/AbstractTTSEngine.test.js +0 -153
  411. package/tests/plugins/tts/FestivalTTSEngine.test.js +0 -59
  412. package/tests/plugins/tts/PageChunk.test.js +0 -57
  413. package/tests/plugins/tts/PageChunkIterator.test.js +0 -179
  414. package/tests/plugins/tts/WebTTSEngine.test.js +0 -126
  415. package/tests/plugins/tts/utils.test.js +0 -133
  416. package/tests/util/browserSniffing.test.js +0 -56
  417. package/tests/util/docCookies.test.js +0 -15
  418. package/tests/util/strings.test.js +0 -63
  419. package/tests/utils.js +0 -42
  420. package/webpack.config.js +0 -86
@@ -1,35 +1,90 @@
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
+ }
23
56
 
24
- .BRparagElement {
25
- fill: red;
26
- cursor: text;
27
- white-space: pre;
28
- fill-opacity: 0;
29
- font-family: Georgia, serif;
57
+ .BRtranslateLayer ::selection {
58
+ background: hsla(210, 74%, 62%, 0.4);
59
+ }
60
+
61
+ .BRtranslateLayer ::-moz-selection {
62
+ background: hsla(210, 74%, 62%, 0.4);
63
+ }
64
+
65
+ .BRparagraphElement br {
66
+ visibility: hidden;
67
+ }
68
+
69
+ // Use CSS pseudo-elements to render the hyphens. This makes them
70
+ // not selectable, so copy/pasting text doesn't include them.
71
+ .BRwordElement--hyphen::after {
72
+ content: "-";
73
+ }
74
+
75
+ // Hide text layer for performance during zooming & scrolling
76
+ .BRsmooth-zooming, .BRscrolling-active {
77
+ // If the text layer has an annotation, don't hide it
78
+ .BRpagecontainer:not(.BRpagecontainer--hasSelection):not(:has(hypothesis-highlight)):not(:has(.BRhighlight)) .BRtextLayer {
79
+ display: none;
30
80
  }
31
81
  }
32
82
 
83
+ // Hide text selection layers of off-screen pages
84
+ .BRmode1up .BRpagecontainer:not(.BRpage-visible) .BRtextLayer {
85
+ display: none;
86
+ }
87
+
33
88
  // Makes page image unselectable
34
89
  .BRpagecontainer img {
35
90
  -webkit-user-select: none;
@@ -37,12 +92,181 @@
37
92
  user-select: none;
38
93
  }
39
94
 
40
- // Hides svg text layer when page animation is running
41
- .BRpageFlipping .textSelectionSVG {
95
+
96
+ // These are Microsoft Edge specific fixed to make some of the
97
+ // browsers features work well. These are for the in-place
98
+ // translation.
99
+ .BRtextLayer:has([_istranslated="1"], msreadoutspan) {
100
+ mix-blend-mode: normal;
101
+ }
102
+
103
+ .BRwordElement, .BRspace {
104
+ &[_istranslated="1"], &[_msttexthash] {
105
+ color: black;
106
+ letter-spacing: unset !important;
107
+ }
108
+ }
109
+
110
+ .BRlineElement:has([_istranslated="1"], [_msttexthash]) {
111
+ background: rgba(248, 237, 192, 0.8);
112
+ backdrop-filter: blur(8px);
113
+ color: black;
114
+ text-align: justify;
115
+ width: inherit;
116
+ &:not(:nth-last-child(2)) {
117
+ text-align-last: justify;
118
+ }
119
+ }
120
+
121
+ .BRlineElement[_msttexthash] {
122
+ word-spacing: unset !important;
123
+ }
124
+
125
+ .BRtranslateLayer .BRparagraphElement {
126
+ pointer-events: auto;
127
+ overflow-y: auto;
128
+ background: rgba(248, 237, 192, 0.8);
129
+ backdrop-filter: blur(8px);
130
+ color:black;
131
+ line-height: 1em;
132
+ text-align: justify;
133
+ }
134
+
135
+ .BRtranslateLayer .BRparagraphElement .BRlineElement {
136
+ white-space: break-spaces;
137
+ display: inline-block;
138
+ }
139
+
140
+ .BRtextLayer.showingTranslation {
42
141
  display: none;
43
142
  }
44
143
 
45
- // Hide phantom page when last page is selected
46
- .BRpagecontainer.BRemptypage .textSelectionSVG{
144
+ .BRtranslateLayer .BRparagraphElement.BRtranslateHidden {
47
145
  display: none;
48
- }
146
+ }
147
+
148
+
149
+ $select-menu-radius: 25px;
150
+ $select-menu-extended-radius: 10px;
151
+ .br-select-menu__root {
152
+ display: none;
153
+ color: white;
154
+ color-scheme: dark;
155
+ padding: 2px;
156
+ overflow: hidden;
157
+ opacity: 1;
158
+ transition: opacity 0.2s;
159
+ gap: 5px;
160
+
161
+ &[open] {
162
+ display: flex;
163
+ }
164
+
165
+ &[showextended] {
166
+ display: block;
167
+ gap: 0px;
168
+ background-color: #333;
169
+ border-radius: $select-menu-extended-radius;
170
+ }
171
+
172
+ @starting-style {
173
+ opacity: 0;
174
+ }
175
+ }
176
+ .br-select-menu__root--scrolling {
177
+ opacity: 0;
178
+ pointer-events: none;
179
+ }
180
+
181
+ .br-select-menu__option {
182
+ --iconWidth: 15px;
183
+ --iconHeight: 15px;
184
+ --iconFillColor: currentColor;
185
+ background: transparent;
186
+ display: flex;
187
+ align-items: center;
188
+ border-radius: $select-menu-radius;
189
+ font-family: inherit;
190
+ color: inherit;
191
+ border: 0;
192
+ cursor: pointer;
193
+ text-wrap: nowrap;
194
+ background-color: #333;
195
+ position: relative;
196
+
197
+ @media (pointer: coarse) and (hover: none) {
198
+ padding: 4px 8px;
199
+ #br-select-more & {
200
+ padding: 4px;
201
+ }
202
+ }
203
+
204
+ &:hover:after {
205
+ position: absolute;
206
+ left: 2px;
207
+ right: 2px;
208
+ top: 2px;
209
+ bottom: 2px;
210
+ content: "";
211
+ pointer-events: none;
212
+ background-color: rgba(255, 255, 255, 0.1);
213
+ border-radius: calc($select-menu-radius - 2px);
214
+ }
215
+
216
+ .br-select-menu__root[showextended] & {
217
+ width:100%;
218
+ &:hover:after {
219
+ border-radius: calc($select-menu-extended-radius - 2px);
220
+ }
221
+ }
222
+ }
223
+
224
+ .br-select-menu__icon {
225
+ display: block;
226
+ flex-shrink: 0;
227
+ width: 17px;
228
+ height: 17px;
229
+ padding: 2px;
230
+ }
231
+
232
+ .br-select-menu__label {
233
+ margin-left: 4px;
234
+ font-size: 12px;
235
+ margin-right: 4px;
236
+ }
237
+
238
+ @media (hover: hover) {
239
+ .br-select-menu__option {
240
+ padding: 4px;
241
+ }
242
+ .br-select-menu__label {
243
+ width: 0px;
244
+ margin: 0;
245
+ opacity: 0;
246
+ interpolate-size: allow-keywords;
247
+ transition: width 0.2s;
248
+ }
249
+ .br-select-menu__root:hover .br-select-menu__label {
250
+ width: auto;
251
+ margin: 0 4px;
252
+ opacity: 1;
253
+ }
254
+ }
255
+
256
+ .BRtextLayer .BRhighlight {
257
+ background-color: yellow;
258
+ pointer-events: all;
259
+ color: transparent;
260
+ }
261
+
262
+ @keyframes highlightTargetFlash {
263
+ to { background-color: hsla(45, 80%, 66%, 1); }
264
+ }
265
+
266
+ // Style URI TextFragments, eg ?text=example
267
+ .BRtextLayer .BRhighlight--target-text, .BRtextLayer ::target-text {
268
+ // Similar colour to the default one used in Safari, Firefox. Note Chrome uses a purple colour
269
+ background-color: hsla(45, 80%, 66%, 0.6);
270
+ color: transparent;
271
+ animation: highlightTargetFlash 600ms 1 reverse;
272
+ }
@@ -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 {
@@ -119,3 +119,10 @@
119
119
  height: 12px;
120
120
  background-image: url("icons/close-circle-dark.svg");
121
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;
@@ -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,12 +1,12 @@
1
- import { css, html, LitElement } from 'lit-element';
2
- import { nothing } from 'lit-html';
3
- import buttonStyles from '../assets/button-base.js';
1
+ import { css, html, LitElement, nothing } from 'lit';
2
+ import buttonStyles from '../../css/button-base.js';
4
3
  export class IABookDownloads extends LitElement {
5
4
  static get properties() {
6
5
  return {
7
6
  downloads: { type: Array },
8
7
  expiration: { type: Number },
9
8
  renderHeader: { type: Boolean },
9
+ isBookProtected: { type: Boolean },
10
10
  };
11
11
  }
12
12
 
@@ -15,6 +15,7 @@ export class IABookDownloads extends LitElement {
15
15
  this.downloads = [];
16
16
  this.expiration = 0;
17
17
  this.renderHeader = false;
18
+ this.isBookProtected = false;
18
19
  }
19
20
 
20
21
  get formatsCount() {
@@ -39,6 +40,16 @@ export class IABookDownloads extends LitElement {
39
40
  ));
40
41
  }
41
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
+
42
53
  get header() {
43
54
  if (!this.renderHeader) {
44
55
  return nothing;
@@ -51,13 +62,21 @@ export class IABookDownloads extends LitElement {
51
62
  `;
52
63
  }
53
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
+
54
71
  render() {
55
72
  return html`
56
73
  ${this.header}
57
74
  ${this.loanExpiryMessage}
58
75
  <ul>${this.renderDownloadOptions()}</ul>
59
- <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>
60
- <a class="ia-button external primary" 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
+ }
61
80
  `;
62
81
  }
63
82
 
@@ -128,3 +147,4 @@ export class IABookDownloads extends LitElement {
128
147
  return [buttonStyles, mainCss];
129
148
  }
130
149
  }
150
+ customElements.define('ia-book-downloads', IABookDownloads);