@internetarchive/bookreader 5.0.0-8-multiple-files → 5.0.0-80

Sign up to get free protection for your applications and to get access to all the features.
Files changed (321) hide show
  1. package/.eslintrc.js +17 -15
  2. package/.github/workflows/node.js.yml +78 -6
  3. package/.github/workflows/npm-publish.yml +6 -20
  4. package/.testcaferc.js +10 -0
  5. package/BookReader/BookReader.css +442 -1393
  6. package/BookReader/BookReader.js +2 -21564
  7. package/BookReader/BookReader.js.LICENSE.txt +20 -20
  8. package/BookReader/BookReader.js.map +1 -1
  9. package/BookReader/ia-bookreader-bundle.js +1782 -0
  10. package/BookReader/ia-bookreader-bundle.js.LICENSE.txt +7 -0
  11. package/BookReader/ia-bookreader-bundle.js.map +1 -0
  12. package/BookReader/icons/1up.svg +1 -12
  13. package/BookReader/icons/2up.svg +1 -15
  14. package/BookReader/icons/advance.svg +3 -26
  15. package/BookReader/icons/chevron-right.svg +1 -1
  16. package/BookReader/icons/close-circle-dark.svg +1 -0
  17. package/BookReader/icons/close-circle.svg +1 -1
  18. package/BookReader/icons/fullscreen.svg +1 -17
  19. package/BookReader/icons/fullscreen_exit.svg +1 -17
  20. package/BookReader/icons/hamburger.svg +1 -15
  21. package/BookReader/icons/left-arrow.svg +1 -12
  22. package/BookReader/icons/magnify-minus.svg +1 -16
  23. package/BookReader/icons/magnify-plus.svg +1 -17
  24. package/BookReader/icons/magnify.svg +1 -15
  25. package/BookReader/icons/pause.svg +1 -23
  26. package/BookReader/icons/play.svg +1 -22
  27. package/BookReader/icons/playback-speed.svg +1 -34
  28. package/BookReader/icons/read-aloud.svg +1 -22
  29. package/BookReader/icons/review.svg +3 -22
  30. package/BookReader/icons/thumbnails.svg +1 -17
  31. package/BookReader/icons/voice.svg +1 -0
  32. package/BookReader/icons/volume-full.svg +1 -22
  33. package/BookReader/images/BRicons.svg +5 -94
  34. package/BookReader/images/books_graphic.svg +1 -177
  35. package/BookReader/images/icon_book.svg +1 -12
  36. package/BookReader/images/icon_bookmark.svg +1 -12
  37. package/BookReader/images/icon_gear.svg +1 -14
  38. package/BookReader/images/icon_hamburger.svg +1 -20
  39. package/BookReader/images/icon_home.svg +1 -21
  40. package/BookReader/images/icon_info.svg +1 -11
  41. package/BookReader/images/icon_one_page.svg +1 -8
  42. package/BookReader/images/icon_pause.svg +1 -1
  43. package/BookReader/images/icon_play.svg +1 -1
  44. package/BookReader/images/icon_playback-rate.svg +1 -15
  45. package/BookReader/images/icon_search_button.svg +1 -8
  46. package/BookReader/images/icon_share.svg +1 -9
  47. package/BookReader/images/icon_skip-ahead.svg +1 -6
  48. package/BookReader/images/icon_skip-back.svg +2 -13
  49. package/BookReader/images/icon_speaker.svg +1 -18
  50. package/BookReader/images/icon_speaker_open.svg +1 -10
  51. package/BookReader/images/icon_thumbnails.svg +1 -12
  52. package/BookReader/images/icon_toc.svg +1 -5
  53. package/BookReader/images/icon_two_pages.svg +1 -9
  54. package/BookReader/images/marker_chap-off.svg +1 -11
  55. package/BookReader/images/marker_chap-on.svg +1 -11
  56. package/BookReader/images/marker_srch-on.svg +1 -11
  57. package/BookReader/jquery-3.js +2 -0
  58. package/BookReader/jquery-3.js.LICENSE.txt +24 -0
  59. package/BookReader/plugins/plugin.archive_analytics.js +1 -172
  60. package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
  61. package/BookReader/plugins/plugin.autoplay.js +1 -165
  62. package/BookReader/plugins/plugin.autoplay.js.map +1 -1
  63. package/BookReader/plugins/plugin.chapters.js +22 -301
  64. package/BookReader/plugins/plugin.chapters.js.LICENSE.txt +1 -0
  65. package/BookReader/plugins/plugin.chapters.js.map +1 -1
  66. package/BookReader/plugins/plugin.iframe.js +1 -74
  67. package/BookReader/plugins/plugin.iframe.js.map +1 -1
  68. package/BookReader/plugins/plugin.iiif.js +2 -0
  69. package/BookReader/plugins/plugin.iiif.js.map +1 -0
  70. package/BookReader/plugins/plugin.resume.js +1 -368
  71. package/BookReader/plugins/plugin.resume.js.map +1 -1
  72. package/BookReader/plugins/plugin.search.js +2 -1420
  73. package/BookReader/plugins/plugin.search.js.LICENSE.txt +1 -0
  74. package/BookReader/plugins/plugin.search.js.map +1 -1
  75. package/BookReader/plugins/plugin.text_selection.js +2 -1080
  76. package/BookReader/plugins/plugin.text_selection.js.LICENSE.txt +1 -0
  77. package/BookReader/plugins/plugin.text_selection.js.map +1 -1
  78. package/BookReader/plugins/plugin.tts.js +2 -9193
  79. package/BookReader/plugins/plugin.tts.js.LICENSE.txt +2 -0
  80. package/BookReader/plugins/plugin.tts.js.map +1 -1
  81. package/BookReader/plugins/plugin.url.js +1 -269
  82. package/BookReader/plugins/plugin.url.js.map +1 -1
  83. package/BookReader/plugins/plugin.vendor-fullscreen.js +1 -379
  84. package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
  85. package/BookReader/webcomponents-bundle.js +3 -0
  86. package/BookReader/webcomponents-bundle.js.LICENSE.txt +9 -0
  87. package/BookReader/webcomponents-bundle.js.map +1 -0
  88. package/BookReaderDemo/BookReaderDemo.css +18 -19
  89. package/BookReaderDemo/BookReaderJSAdvanced.js +0 -3
  90. package/BookReaderDemo/BookReaderJSAutoplay.js +4 -1
  91. package/BookReaderDemo/BookReaderJSSimple.js +1 -0
  92. package/BookReaderDemo/IADemoBr.js +147 -0
  93. package/BookReaderDemo/demo-advanced.html +2 -2
  94. package/BookReaderDemo/demo-autoplay.html +2 -3
  95. package/BookReaderDemo/demo-embed-iframe-src.html +2 -1
  96. package/BookReaderDemo/demo-fullscreen-mobile.html +3 -5
  97. package/BookReaderDemo/demo-fullscreen.html +2 -4
  98. package/BookReaderDemo/demo-iiif.html +99 -12
  99. package/BookReaderDemo/demo-internetarchive.html +214 -18
  100. package/BookReaderDemo/demo-multiple.html +2 -1
  101. package/BookReaderDemo/demo-preview-pages.html +2 -1
  102. package/BookReaderDemo/demo-simple.html +2 -1
  103. package/BookReaderDemo/demo-vendor-fullscreen.html +2 -4
  104. package/BookReaderDemo/ia-multiple-volumes-manifest.js +170 -0
  105. package/BookReaderDemo/immersion-1up.html +2 -2
  106. package/BookReaderDemo/immersion-mode.html +2 -4
  107. package/BookReaderDemo/toggle_controls.html +3 -2
  108. package/BookReaderDemo/view_mode.html +2 -1
  109. package/BookReaderDemo/viewmode-cycle.html +2 -3
  110. package/CHANGELOG.md +545 -33
  111. package/README.md +14 -1
  112. package/babel.config.js +20 -0
  113. package/codecov.yml +6 -0
  114. package/index.html +4 -1
  115. package/jsconfig.json +19 -0
  116. package/netlify.toml +9 -0
  117. package/package.json +70 -60
  118. package/renovate.json +52 -0
  119. package/scripts/preversion.js +0 -1
  120. package/src/BookNavigator/assets/bookmark-colors.js +1 -1
  121. package/src/BookNavigator/assets/button-base.js +9 -2
  122. package/src/BookNavigator/assets/ia-logo.js +17 -0
  123. package/src/BookNavigator/assets/icon_checkmark.js +1 -1
  124. package/src/BookNavigator/assets/icon_close.js +1 -1
  125. package/src/BookNavigator/book-navigator.js +590 -0
  126. package/src/BookNavigator/bookmarks/bookmark-button.js +3 -2
  127. package/src/BookNavigator/bookmarks/bookmark-edit.js +3 -4
  128. package/src/BookNavigator/bookmarks/bookmarks-list.js +2 -3
  129. package/src/BookNavigator/bookmarks/bookmarks-loginCTA.js +3 -8
  130. package/src/BookNavigator/bookmarks/bookmarks-provider.js +27 -17
  131. package/src/BookNavigator/bookmarks/ia-bookmarks.js +116 -67
  132. package/src/BookNavigator/delete-modal-actions.js +1 -1
  133. package/src/BookNavigator/downloads/downloads-provider.js +36 -21
  134. package/src/BookNavigator/downloads/downloads.js +41 -25
  135. package/src/BookNavigator/search/search-provider.js +80 -28
  136. package/src/BookNavigator/search/search-results.js +28 -25
  137. package/src/BookNavigator/sharing.js +27 -0
  138. package/src/BookNavigator/viewable-files.js +95 -0
  139. package/src/BookNavigator/visual-adjustments/visual-adjustments-provider.js +11 -10
  140. package/src/BookNavigator/visual-adjustments/visual-adjustments.js +3 -3
  141. package/src/BookReader/BookModel.js +64 -34
  142. package/src/BookReader/DragScrollable.js +233 -0
  143. package/src/BookReader/Mode1Up.js +56 -351
  144. package/src/BookReader/Mode1UpLit.js +388 -0
  145. package/src/BookReader/Mode2Up.js +73 -1318
  146. package/src/BookReader/Mode2UpLit.js +776 -0
  147. package/src/BookReader/ModeCoordinateSpace.js +29 -0
  148. package/src/BookReader/ModeSmoothZoom.js +312 -0
  149. package/src/BookReader/ModeThumb.js +18 -12
  150. package/src/BookReader/Navbar/Navbar.js +14 -40
  151. package/src/BookReader/PageContainer.js +81 -6
  152. package/src/BookReader/ReduceSet.js +1 -1
  153. package/src/BookReader/Toolbar/Toolbar.js +10 -37
  154. package/src/BookReader/events.js +2 -3
  155. package/src/BookReader/options.js +27 -2
  156. package/src/BookReader/utils/HTMLDimensionsCacher.js +44 -0
  157. package/src/BookReader/utils/ScrollClassAdder.js +31 -0
  158. package/src/BookReader/utils/SelectionObserver.js +45 -0
  159. package/src/BookReader/utils.js +118 -13
  160. package/src/BookReader.js +446 -1062
  161. package/src/assets/icons/close-circle-dark.svg +1 -0
  162. package/src/assets/icons/magnify-minus.svg +3 -7
  163. package/src/assets/icons/magnify-plus.svg +3 -7
  164. package/src/assets/icons/voice.svg +1 -0
  165. package/src/css/BookReader.scss +1 -17
  166. package/src/css/_BRBookmarks.scss +1 -1
  167. package/src/css/_BRComponent.scss +1 -1
  168. package/src/css/_BRmain.scss +33 -27
  169. package/src/css/_BRnav.scss +12 -39
  170. package/src/css/_BRpages.scss +149 -40
  171. package/src/css/_BRsearch.scss +68 -230
  172. package/src/css/_BRtoolbar.scss +5 -5
  173. package/src/css/_TextSelection.scss +87 -27
  174. package/src/css/_colorbox.scss +2 -2
  175. package/src/css/_controls.scss +20 -7
  176. package/src/css/_icons.scss +7 -1
  177. package/src/ia-bookreader/ia-bookreader.js +224 -0
  178. package/src/plugins/plugin.archive_analytics.js +3 -3
  179. package/src/plugins/plugin.autoplay.js +5 -11
  180. package/src/plugins/plugin.chapters.js +237 -191
  181. package/src/plugins/plugin.iiif.js +151 -0
  182. package/src/plugins/plugin.resume.js +3 -3
  183. package/src/plugins/plugin.text_selection.js +464 -134
  184. package/src/plugins/plugin.vendor-fullscreen.js +4 -4
  185. package/src/plugins/search/plugin.search.js +175 -120
  186. package/src/plugins/search/utils.js +43 -0
  187. package/src/plugins/search/view.js +64 -202
  188. package/src/plugins/tts/AbstractTTSEngine.js +71 -40
  189. package/src/plugins/tts/FestivalTTSEngine.js +13 -14
  190. package/src/plugins/tts/PageChunk.js +15 -21
  191. package/src/plugins/tts/PageChunkIterator.js +8 -12
  192. package/src/plugins/tts/WebTTSEngine.js +87 -71
  193. package/src/plugins/tts/plugin.tts.js +96 -127
  194. package/src/plugins/tts/utils.js +15 -25
  195. package/src/plugins/url/UrlPlugin.js +191 -0
  196. package/src/plugins/{plugin.url.js → url/plugin.url.js} +45 -16
  197. package/src/util/browserSniffing.js +22 -0
  198. package/src/util/docCookies.js +21 -2
  199. package/tests/e2e/README.md +37 -0
  200. package/tests/e2e/autoplay.test.js +2 -2
  201. package/tests/e2e/base.test.js +8 -16
  202. package/tests/e2e/helpers/base.js +53 -48
  203. package/tests/e2e/helpers/debug.js +1 -1
  204. package/tests/e2e/helpers/params.js +17 -0
  205. package/tests/e2e/helpers/rightToLeft.js +8 -14
  206. package/tests/e2e/helpers/search.js +73 -0
  207. package/tests/e2e/models/Navigation.js +20 -37
  208. package/tests/e2e/rightToLeft.test.js +4 -5
  209. package/tests/e2e/viewmode.test.js +40 -33
  210. package/tests/jest/BookNavigator/book-navigator.test.js +661 -0
  211. package/tests/jest/BookNavigator/bookmarks/bookmark-button.test.js +43 -0
  212. package/tests/{karma → jest}/BookNavigator/bookmarks/bookmark-edit.test.js +25 -26
  213. package/tests/{karma → jest}/BookNavigator/bookmarks/bookmarks-list.test.js +41 -42
  214. package/tests/jest/BookNavigator/bookmarks/ia-bookmarks.test.js +45 -0
  215. package/tests/jest/BookNavigator/downloads/downloads-provider.test.js +67 -0
  216. package/tests/jest/BookNavigator/downloads/downloads.test.js +53 -0
  217. package/tests/jest/BookNavigator/search/search-provider.test.js +167 -0
  218. package/tests/{karma/BookNavigator → jest/BookNavigator/search}/search-results.test.js +109 -60
  219. package/tests/jest/BookNavigator/sharing/sharing-provider.test.js +49 -0
  220. package/tests/jest/BookNavigator/viewable-files/viewable-files-provider.test.js +80 -0
  221. package/tests/jest/BookNavigator/visual-adjustments.test.js +200 -0
  222. package/tests/{BookReader → jest/BookReader}/BookModel.test.js +74 -14
  223. package/tests/jest/BookReader/BookReaderPublicFunctions.test.js +193 -0
  224. package/tests/{BookReader → jest/BookReader}/ImageCache.test.js +4 -4
  225. package/tests/jest/BookReader/Mode1UpLit.test.js +73 -0
  226. package/tests/jest/BookReader/Mode2Up.test.js +98 -0
  227. package/tests/jest/BookReader/Mode2UpLit.test.js +190 -0
  228. package/tests/jest/BookReader/ModeCoordinateSpace.test.js +16 -0
  229. package/tests/jest/BookReader/ModeSmoothZoom.test.js +218 -0
  230. package/tests/jest/BookReader/ModeThumb.test.js +71 -0
  231. package/tests/{BookReader → jest/BookReader}/Navbar/Navbar.test.js +10 -10
  232. package/tests/{BookReader → jest/BookReader}/PageContainer.test.js +88 -6
  233. package/tests/{BookReader → jest/BookReader}/ReduceSet.test.js +1 -1
  234. package/tests/{BookReader → jest/BookReader}/Toolbar/Toolbar.test.js +2 -2
  235. package/tests/jest/BookReader/utils/HTMLDimensionsCacher.test.js +59 -0
  236. package/tests/jest/BookReader/utils/ScrollClassAdder.test.js +49 -0
  237. package/tests/jest/BookReader/utils/SelectionObserver.test.js +57 -0
  238. package/tests/{BookReader → jest/BookReader}/utils/classes.test.js +1 -1
  239. package/tests/jest/BookReader/utils.test.js +229 -0
  240. package/tests/jest/BookReader.keyboard.test.js +190 -0
  241. package/tests/{BookReader.options.test.js → jest/BookReader.options.test.js} +9 -1
  242. package/tests/{BookReader.test.js → jest/BookReader.test.js} +26 -37
  243. package/tests/{plugins → jest/plugins}/plugin.archive_analytics.test.js +2 -2
  244. package/tests/{plugins → jest/plugins}/plugin.autoplay.test.js +4 -4
  245. package/tests/jest/plugins/plugin.chapters.test.js +195 -0
  246. package/tests/{plugins → jest/plugins}/plugin.iframe.test.js +2 -2
  247. package/tests/{plugins → jest/plugins}/plugin.resume.test.js +3 -3
  248. package/tests/jest/plugins/plugin.text_selection.test.js +317 -0
  249. package/tests/{plugins → jest/plugins}/plugin.vendor-fullscreen.test.js +2 -2
  250. package/tests/{plugins → jest/plugins}/search/plugin.search.test.js +26 -47
  251. package/tests/{plugins → jest/plugins}/search/plugin.search.view.test.js +39 -6
  252. package/tests/jest/plugins/search/utils.js +25 -0
  253. package/tests/jest/plugins/search/utils.test.js +29 -0
  254. package/tests/{plugins → jest/plugins}/tts/AbstractTTSEngine.test.js +29 -9
  255. package/tests/{plugins → jest/plugins}/tts/FestivalTTSEngine.test.js +4 -4
  256. package/tests/{plugins → jest/plugins}/tts/PageChunk.test.js +1 -1
  257. package/tests/{plugins → jest/plugins}/tts/PageChunkIterator.test.js +3 -3
  258. package/tests/{plugins → jest/plugins}/tts/WebTTSEngine.test.js +47 -1
  259. package/tests/{plugins → jest/plugins}/tts/utils.test.js +1 -60
  260. package/tests/jest/plugins/url/UrlPlugin.test.js +198 -0
  261. package/tests/{plugins → jest/plugins/url}/plugin.url.test.js +53 -14
  262. package/tests/jest/setup.js +3 -0
  263. package/tests/{util → jest/util}/browserSniffing.test.js +1 -1
  264. package/tests/jest/util/docCookies.test.js +24 -0
  265. package/tests/{util → jest/util}/strings.test.js +1 -1
  266. package/tests/{utils.js → jest/utils.js} +38 -0
  267. package/webpack.config.js +12 -6
  268. package/.babelrc +0 -12
  269. package/.dependabot/config.yml +0 -6
  270. package/.testcaferc.json +0 -5
  271. package/BookReader/bookreader-component-bundle.js +0 -14312
  272. package/BookReader/bookreader-component-bundle.js.LICENSE.txt +0 -38
  273. package/BookReader/bookreader-component-bundle.js.map +0 -1
  274. package/BookReader/icons/sort-ascending.svg +0 -1
  275. package/BookReader/icons/sort-descending.svg +0 -1
  276. package/BookReader/jquery-1.10.1.js +0 -108
  277. package/BookReader/jquery-1.10.1.js.LICENSE.txt +0 -24
  278. package/BookReader/plugins/plugin.menu_toggle.js +0 -369
  279. package/BookReader/plugins/plugin.menu_toggle.js.map +0 -1
  280. package/BookReader/plugins/plugin.mobile_nav.js +0 -335
  281. package/BookReader/plugins/plugin.mobile_nav.js.map +0 -1
  282. package/BookReaderDemo/IIIFBookReader.js +0 -207
  283. package/BookReaderDemo/bookreader-template-bundle.js +0 -7178
  284. package/BookReaderDemo/demo-iiif.js +0 -26
  285. package/BookReaderDemo/demo-plugin-menu-toggle.html +0 -34
  286. package/karma.conf.js +0 -23
  287. package/src/BookNavigator/BookModel.js +0 -14
  288. package/src/BookNavigator/BookNavigator.js +0 -452
  289. package/src/BookNavigator/assets/book-loader.js +0 -27
  290. package/src/BookNavigator/assets/icon_sort_ascending.js +0 -5
  291. package/src/BookNavigator/assets/icon_sort_descending.js +0 -5
  292. package/src/BookNavigator/br-fullscreen-mgr.js +0 -83
  293. package/src/BookNavigator/search/a-search-result.js +0 -55
  294. package/src/BookNavigator/volumes/volumes-provider.js +0 -76
  295. package/src/BookNavigator/volumes/volumes.js +0 -161
  296. package/src/BookReader/DebugConsole.js +0 -54
  297. package/src/BookReaderComponent/BookReaderComponent.js +0 -112
  298. package/src/ItemNavigator/ItemNavigator.js +0 -372
  299. package/src/ItemNavigator/providers/sharing.js +0 -29
  300. package/src/assets/icons/sort-ascending.svg +0 -1
  301. package/src/assets/icons/sort-descending.svg +0 -1
  302. package/src/css/_MobileNav.scss +0 -194
  303. package/src/dragscrollable-br.js +0 -261
  304. package/src/plugins/menu_toggle/plugin.menu_toggle.js +0 -324
  305. package/src/plugins/plugin.mobile_nav.js +0 -287
  306. package/tests/BookReader/BookReaderPublicFunctions.test.js +0 -171
  307. package/tests/BookReader/DebugConsole.test.js +0 -25
  308. package/tests/BookReader/Mode1Up.test.js +0 -164
  309. package/tests/BookReader/Mode2Up.test.js +0 -247
  310. package/tests/BookReader/utils.test.js +0 -109
  311. package/tests/e2e/helpers/desktopSearch.js +0 -72
  312. package/tests/e2e/helpers/mobileSearch.js +0 -85
  313. package/tests/e2e/ia-production/ia-prod-base.js +0 -17
  314. package/tests/karma/BookNavigator/book-navigator.test.js +0 -132
  315. package/tests/karma/BookNavigator/visual-adjustments.test.js +0 -201
  316. package/tests/karma/BookNavigator/volumes.test.js +0 -101
  317. package/tests/plugins/menu_toggle/plugin.menu_toggle.test.js +0 -68
  318. package/tests/plugins/plugin.chapters.test.js +0 -130
  319. package/tests/plugins/plugin.mobile_nav.test.js +0 -66
  320. package/tests/plugins/plugin.text_selection.test.js +0 -203
  321. package/tests/util/docCookies.test.js +0 -15
@@ -1,40 +1,71 @@
1
+ @mixin ellipsis-lines($lines: 4) {
2
+ display: -webkit-box;
3
+ -webkit-line-clamp: $lines;
4
+ -webkit-box-orient: vertical;
5
+ overflow: hidden;
6
+ }
7
+
1
8
  %timeline-tooltip {
2
9
  display: none;
3
10
  position: absolute;
4
11
  bottom: calc(100% + 5px);
5
- left: 50%;
6
- transform: translateX(-50%);
7
- width: 230px;
12
+ left: -14px;
13
+ width: 350px;
14
+ max-width: 100vw;
8
15
  padding: 12px 14px;
16
+ padding-bottom: 10px;
9
17
  color: $tooltipText;
10
- font-weight: bold;
11
18
  background: $tooltipBG;
12
19
  box-shadow: 0 2px 4px rgba(0, 0, 0, .5);
20
+ border-radius: 4px;
21
+ animation: fadeUp 0.2s;
22
+
23
+ // Disable text selection
24
+ -webkit-user-select: none;
25
+ -moz-user-select: none;
26
+ -ms-user-select: none;
27
+ -o-user-select: none;
28
+ user-select: none;
29
+
30
+ // Create a triangle under the tooltip using clip-path
31
+ // This makes it possible to move the mouse onto the tooltip
13
32
  &:after {
14
- display: none;
15
33
  position: absolute;
16
- top: 100%;
17
- left: 50%;
18
- transform: translateX(-50%);
19
34
  content: "";
20
- border: 7px solid transparent;
21
- border-width: 7px 4px;
22
- border-bottom: none;
23
- border-top-color: $tooltipBG;
35
+ bottom: -9px;
36
+ left: 0;
37
+ width: 30px;
38
+ height: 10px;
39
+ clip-path: polygon(0 0, 100% 0, 50% 100%);
24
40
  }
25
41
  }
26
42
 
27
43
  #{$brScope} {
28
- .BookReaderSearchHilite {
29
- opacity: 0.20;
30
- filter: alpha(opacity = 20);
31
- background-color: #0000ff;
32
- position: absolute;
33
- /* z-index is important */
34
- z-index: $brZindexBase + 3;
44
+ // FIXME: .ttsHiliteLayer should probably not be in this file,
45
+ // but they appear the same in the UI.
46
+ .searchHiliteLayer, .ttsHiliteLayer {
47
+ pointer-events: none;
35
48
 
36
- animation: hiliteFadeIn .2s;
49
+ rect {
50
+ // Note: Can't use fill-opacity ; safari inexplicably applies that to
51
+ // the outline as well
52
+ fill: rgba(0, 0, 255, 0.2);
53
+ }
37
54
  }
55
+
56
+ .searchHiliteLayer rect {
57
+ animation: highlightFocus 600ms 1 reverse;
58
+ stroke: blue;
59
+ stroke-width: 4px;
60
+
61
+ // Sass for loop for nth-child animation delay
62
+ @for $i from 1 through 10 {
63
+ &:nth-child(#{$i}) {
64
+ animation-delay: #{($i - 1) * 50}ms;
65
+ }
66
+ }
67
+ }
68
+
38
69
  .BRchapter, .BRsearch {
39
70
  position: absolute;
40
71
  bottom: 0; /* Relative to nav line */
@@ -64,6 +95,10 @@
64
95
  // background-image: url(images/marker_chap-on.svg);
65
96
  background-color: blue;
66
97
  }
98
+ .BRchapterPage {
99
+ font-size: 0.85em;
100
+ opacity: .8;
101
+ }
67
102
  }
68
103
  .BRsearch {
69
104
  width: 9px;
@@ -90,7 +125,17 @@
90
125
  }
91
126
  .BRquery {
92
127
  @extend %timeline-tooltip;
93
- b {
128
+ main {
129
+ @include ellipsis-lines(4);
130
+ margin-bottom: 6px;
131
+ &:before { content: "“"; }
132
+ &:after { content: "”"; }
133
+ }
134
+ footer {
135
+ font-size: 0.85em;
136
+ opacity: .8;
137
+ }
138
+ mark {
94
139
  color: $searchResultText;
95
140
  font-weight: bold;
96
141
  background-color: $searchResultBG;
@@ -119,7 +164,6 @@
119
164
  max-width: 160px;
120
165
  height: 100%;
121
166
  color: white;
122
- outline: none;
123
167
  border: none;
124
168
  padding: 3px 0px 3px 10px;
125
169
  margin: 0;
@@ -145,211 +189,6 @@
145
189
  }
146
190
  }
147
191
 
148
- .BRbooksearch.mobile {
149
- position: relative;
150
- top: 0;
151
- display: flex;
152
- flex-direction: row;
153
-
154
- .BRsearchInput {
155
- -webkit-appearance: none;
156
- position: relative;
157
- min-width: 100px;
158
- float: left;
159
- font-size: $brFontSizeBase;
160
- width: 150px;
161
- height: 30px;
162
- border: 1px solid $brColorLightBorder;
163
- flex: 1;
164
- border-radius: 0;
165
- }
166
- .BRsearchSubmit {
167
- width: 30px;
168
- height: 30px;
169
- border: none;
170
- background-color: $brColorThemeblue;
171
- background-image: url("images/icon_search_button.svg");
172
- background-repeat: no-repeat;
173
- background-position: center center;
174
-
175
- text-align: center;
176
- color: white;
177
- overflow: hidden;
178
- box-sizing: border-box;
179
- display: inline-block;
180
- }
181
- }
182
-
183
- #BRsearch_tray {
184
- --menuSliderBg: #151515;
185
- --primaryTextColor: #fff;
186
- --activeButtonBg: #282828;
187
- --searchResultText: #adaedc;
188
- --searchResultBg: #272958;
189
- --searchResultBorder: #fff;
190
- position: absolute;
191
- top: 0;
192
- right: 0;
193
- bottom: 0;
194
- left: 0;
195
- padding: 15px 10px;
196
- overflow-y: auto;
197
- font-size: 14px;
198
- color: var(--primaryTextColor);
199
- background: var(--menuSliderBg);
200
-
201
- header {
202
- display: flex;
203
- justify-content: space-between;
204
- align-items: center;
205
- }
206
-
207
- h3 {
208
- padding: 0;
209
- margin: 0 10px 0 0;
210
- font-size: 20px;
211
- }
212
-
213
- header p {
214
- display: none;
215
- padding: 0;
216
- margin: 0;
217
- font-size: 12px;
218
- font-weight: bold;
219
- font-style: italic;
220
- }
221
- header p.visible {
222
- display: block;
223
- }
224
-
225
- header div {
226
- display: flex;
227
- align-items: baseline;
228
- }
229
-
230
- a.close {
231
- justify-self: end;
232
- }
233
-
234
- fieldset {
235
- padding: 20px 0 10px 0;
236
- border: none;
237
- }
238
-
239
- [type="checkbox"] {
240
- display: none;
241
- }
242
-
243
- #all_files {
244
- display: none;
245
- + label {
246
- display: none;
247
- }
248
- }
249
-
250
- label {
251
- display: block;
252
- text-align: center;
253
- }
254
-
255
- label.checkbox {
256
- padding-bottom: 5px;
257
- font-size: 16px;
258
- line-height: 150%;
259
- vertical-align: middle;
260
- }
261
-
262
- label.checkbox:after {
263
- display: inline-block;
264
- width: 14px;
265
- height: 14px;
266
- margin-left: 7px;
267
- content: "";
268
- color: var(--primaryTextColor);
269
- border: 1px solid var(--primaryTextColor);
270
- border-radius: 2px;
271
- background: var(--activeButtonBg) 50% 50% no-repeat;
272
- }
273
- :checked + label.checkbox:after {
274
- background-image: url('data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjEwIiB2aWV3Qm94PSIwIDAgMTMgMTAiIHdpZHRoPSIxMyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNC4zMzMzMzMzMyAxMC00LjMzMzMzMzMzLTQuMTY2NjY2NjcgMS43MzMzMzMzMy0xLjY2NjY2NjY2IDIuNiAyLjUgNi45MzMzMzMzNy02LjY2NjY2NjY3IDEuNzMzMzMzMyAxLjY2NjY2NjY3eiIgZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+');
275
- }
276
-
277
- [type="search"] {
278
- -webkit-appearance: textfield;
279
- width: 100%;
280
- height: 22px;
281
- padding: 0 15px;
282
- box-sizing: border-box;
283
- font: normal 16px "Helvetica Neue", Helvetica, Arial, sans-serif;
284
- color: var(--primaryTextColor);
285
- border: 1px solid var(--primaryTextColor);
286
- border-radius: 15px;
287
- background: transparent;
288
- }
289
- [type="search"]:focus {
290
- outline: none;
291
- }
292
- [type="search"]::-webkit-search-cancel-button {
293
- width: 18px;
294
- height: 18px;
295
- -webkit-appearance: none;
296
- appearance: none;
297
- /* Uses an X SVG shape as a mask */
298
- -webkit-mask: url('data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNDAgNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgYXJpYS1sYWJlbGxlZGJ5PSJjbG9zZVRpdGxlSUQgY2xvc2VEZXNjSUQiPjxwYXRoIGQ9Ik0yOS4xOTIgMTAuODA4YTEuNSAxLjUgMCAwMTAgMi4xMkwyMi4xMjIgMjBsNy4wNyA3LjA3MmExLjUgMS41IDAgMDEtMi4xMiAyLjEyMWwtNy4wNzMtNy4wNy03LjA3IDcuMDdhMS41IDEuNSAwIDAxLTIuMTIxLTIuMTJsNy4wNy03LjA3My03LjA3LTcuMDdhMS41IDEuNSAwIDAxMi4xMi0yLjEyMUwyMCAxNy44NzhsNy4wNzItNy4wN2ExLjUgMS41IDAgMDEyLjEyMSAweiIgY2xhc3M9ImZpbGwtY29sb3IiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==') 0 0 no-repeat;
299
- mask: url('data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNDAgNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgYXJpYS1sYWJlbGxlZGJ5PSJjbG9zZVRpdGxlSUQgY2xvc2VEZXNjSUQiPjxwYXRoIGQ9Ik0yOS4xOTIgMTAuODA4YTEuNSAxLjUgMCAwMTAgMi4xMkwyMi4xMjIgMjBsNy4wNyA3LjA3MmExLjUgMS41IDAgMDEtMi4xMiAyLjEyMWwtNy4wNzMtNy4wNy03LjA3IDcuMDdhMS41IDEuNSAwIDAxLTIuMTIxLTIuMTJsNy4wNy03LjA3My03LjA3LTcuMDdhMS41IDEuNSAwIDAxMi4xMi0yLjEyMUwyMCAxNy44NzhsNy4wNzItNy4wN2ExLjUgMS41IDAgMDEyLjEyMSAweiIgY2xhc3M9ImZpbGwtY29sb3IiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==') 0 0 no-repeat;
300
- -webkit-mask-size: 100%;
301
- mask-size: 100%;
302
- background: #fff;
303
- }
304
-
305
- ul {
306
- padding: 0;
307
- margin: 0;
308
- list-style: none;
309
- }
310
-
311
- li {
312
- margin-bottom: 20px;
313
- border-bottom: 1px solid $white;
314
- &:after {
315
- display: none;
316
- }
317
- }
318
-
319
- li img {
320
- display: block;
321
- width: 100%;
322
- }
323
-
324
- li h4 {
325
- padding: 0 0 20px 0;
326
- margin: 0;
327
- font-size: 14px;
328
- font-weight: normal;
329
- }
330
-
331
- li p {
332
- padding: 0 0 15px 0;
333
- margin: 0;
334
- font-size: 12px;
335
- }
336
-
337
- mark {
338
- padding: 0 2px;
339
- color: var(--searchResultText);
340
- background: var(--searchResultBg);
341
- border: 1px solid var(--searchResultBorder);
342
- border-radius: 2px;
343
- }
344
-
345
- #search_pending {
346
- display: none;
347
- }
348
- #search_pending.visible {
349
- display: block;
350
- }
351
- }
352
-
353
192
  .BRsearch-navigation {
354
193
  position: relative;
355
194
  z-index: 1;
@@ -410,9 +249,8 @@
410
249
  }
411
250
  }
412
251
 
413
- @keyframes hiliteFadeIn {
414
- from { opacity: 0; }
415
- to { opacity: 0.2; }
252
+ @keyframes highlightFocus {
253
+ to { stroke-width: 20px; }
416
254
  }
417
255
 
418
256
  /* Mid size breakpoint */
@@ -34,8 +34,6 @@
34
34
  }
35
35
  .BRtoolbarbuttons {
36
36
  white-space: nowrap;
37
- text-align: right;
38
- border-spacing: 0;
39
37
  box-sizing: border-box;
40
38
  display: flex;
41
39
  flex-direction: row;
@@ -65,13 +63,11 @@
65
63
  display: none;
66
64
  }
67
65
  .BRtoolbarLeft {
68
- text-align: left;
69
66
  flex: 1 auto;
70
67
  overflow-y: hidden;
71
68
  }
72
69
  // .BRtoolbarSectionTitle {}
73
70
  .BRtoolbarRight {
74
- text-align: right;
75
71
  flex: none;
76
72
  }
77
73
 
@@ -81,4 +77,8 @@
81
77
  padding: 0;
82
78
  box-shadow: 0px 1px 3px 0px rgba(#666, .25);
83
79
  }
84
- }
80
+ }
81
+
82
+ ia-bookreader .BRtoolbar {
83
+ padding-left: 50px;
84
+ }
@@ -1,35 +1,73 @@
1
- .textSelectionSVG {
2
- width: 100%;
1
+ .BRtextLayer {
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
+ .BRparagraphElement {
14
+ margin: 0;
15
+ cursor: text;
16
+ font-family: Georgia, serif;
17
+ line-height: 0;
18
+ }
19
+
20
+ .BRlineElement {
21
+ pointer-events: all;
22
+ white-space: nowrap;
23
+ display: inline-block;
24
+
25
+ // We use display: inline-block, otherwise this causes every line
26
+ // to have newlines at the end in safari. BUT, since they're inline,
27
+ // if the OCR has to short line in the same paragraph, they can wrap
28
+ // and one can go onto the other. This adds an arbitrary margin to
29
+ // the right of each line, forcing things to wrap.
30
+ // See eg https://www-drini.archive.org/details/countofmontecris00duma_7/page/261/mode/2up
31
+ // Page 261, second last line on the page.
32
+ .BRtextLayer[dir=ltr] & { margin-right: 100%; }
33
+ .BRtextLayer[dir=rtl] & { margin-left: 100%; }
34
+ }
35
+
36
+ // Highlight colors for text selection layer
37
+ .BRwordElement, .BRspace, .BRparagraphElement, .BRparagraphElement br {
38
+ // these 2 properties do not work if joined
39
+ &::selection {
17
40
  background: hsla(210, 74%, 62%, 0.4);
18
41
  }
19
- .BRwordElement::-moz-selection {
42
+
43
+ &::-moz-selection {
20
44
  background: hsla(210, 74%, 62%, 0.4);
21
- color: transparent;
45
+ color:transparent;
22
46
  }
47
+ }
48
+
49
+ .BRparagraphElement br {
50
+ visibility: hidden;
51
+ }
52
+
53
+ // Use CSS pseudo-elements to render the hyphens. This makes them
54
+ // not selectable, so copy/pasting text doesn't include them.
55
+ .BRwordElement--hyphen::after {
56
+ content: "-";
57
+ }
23
58
 
24
- .BRparagElement {
25
- fill: red;
26
- cursor: text;
27
- white-space: pre;
28
- fill-opacity: 0;
29
- font-family: Georgia, serif;
59
+ // Hide text layer for performance during zooming & scrolling
60
+ .BRsmooth-zooming, .BRscrolling-active {
61
+ .BRpagecontainer:not(.BRpagecontainer--hasSelection) .BRtextLayer {
62
+ display: none;
30
63
  }
31
64
  }
32
65
 
66
+ // Hide text selection layers of off-screen pages
67
+ .BRmode1up .BRpagecontainer:not(.BRpage-visible) .BRtextLayer {
68
+ display: none;
69
+ }
70
+
33
71
  // Makes page image unselectable
34
72
  .BRpagecontainer img {
35
73
  -webkit-user-select: none;
@@ -37,12 +75,34 @@
37
75
  user-select: none;
38
76
  }
39
77
 
40
- // Hides svg text layer when page animation is running
41
- .BRpageFlipping .textSelectionSVG {
42
- display: none;
78
+
79
+ // These are Microsoft Edge specific fixed to make some of the
80
+ // browsers features work well. These are for the in-place
81
+ // translation.
82
+ .BRwordElement, .BRspace {
83
+ &[_istranslated="1"], &[_msttexthash] {
84
+ background-color: #e4dccd;
85
+ color: black;
86
+ letter-spacing: unset !important;
87
+ background: #ccbfa7;
88
+ }
43
89
  }
44
90
 
45
- // Hide phantom page when last page is selected
46
- .BRpagecontainer.BRemptypage .textSelectionSVG{
47
- display: none;
48
- }
91
+ .BRlineElement font[_mstmutation="1"] {
92
+ background: #ccbfa7;
93
+ }
94
+
95
+ .BRlineElement:has([_istranslated="1"], [_msttexthash]) {
96
+ background-color: #e4dccd;
97
+ color: black;
98
+ text-align: justify;
99
+ width: inherit;
100
+ &:not(:nth-last-child(2)) {
101
+ text-align-last: justify;
102
+ }
103
+ }
104
+
105
+ .BRlineElement[_msttexthash] {
106
+ background: #ccbfa7;
107
+ word-spacing: unset !important;
108
+ }
@@ -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
  }
@@ -100,6 +109,10 @@
100
109
  &.visible {
101
110
  display: flex;
102
111
  animation: slideUp 0.2s;
112
+ button {
113
+ width: unset;
114
+ height: unset;
115
+ }
103
116
  }
104
117
 
105
118
  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,9 @@
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
+ }