@internetarchive/bookreader 5.0.0-112 → 5.0.0-114

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 (36) hide show
  1. package/BookReader/BookReader.css +20 -7
  2. package/BookReader/BookReader.js +43 -1
  3. package/BookReader/BookReader.js.map +1 -1
  4. package/BookReader/ia-bookreader-bundle.js +3 -45
  5. package/BookReader/ia-bookreader-bundle.js.map +1 -1
  6. package/BookReader/plugins/plugin.chapters.js +2 -2
  7. package/BookReader/plugins/plugin.chapters.js.map +1 -1
  8. package/BookReader/plugins/plugin.experiments.js +1 -1
  9. package/BookReader/plugins/plugin.experiments.js.map +1 -1
  10. package/BookReader/plugins/plugin.search.js +1 -1
  11. package/BookReader/plugins/plugin.search.js.map +1 -1
  12. package/BookReader/plugins/plugin.text_selection.js +1 -23
  13. package/BookReader/plugins/plugin.text_selection.js.map +1 -1
  14. package/BookReader/plugins/plugin.translate.js +3 -25
  15. package/BookReader/plugins/plugin.translate.js.map +1 -1
  16. package/BookReader/plugins/plugin.tts.js +1 -1
  17. package/BookReader/plugins/plugin.tts.js.map +1 -1
  18. package/BookReader/plugins/plugin.url.js +1 -2
  19. package/BookReader/plugins/plugin.url.js.map +1 -1
  20. package/BookReader/plugins/plugin.vendor-fullscreen.js +1 -1
  21. package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
  22. package/package.json +1 -1
  23. package/src/BookReader/utils/SelectionObserver.js +2 -2
  24. package/src/BookReader.js +5 -4
  25. package/src/css/_BRpages.scss +5 -2
  26. package/src/css/_TextSelection.scss +21 -9
  27. package/src/ia-bookreader/ia-bookreader.js +13 -2
  28. package/src/plugins/plugin.experiments.js +44 -8
  29. package/src/plugins/plugin.text_selection.js +26 -56
  30. package/src/plugins/tts/plugin.tts.js +3 -3
  31. package/src/plugins/tts/utils.js +0 -10
  32. package/src/plugins/url/UrlPlugin.js +2 -15
  33. package/src/plugins/url/plugin.url.js +7 -59
  34. package/src/util/TextSelectionManager.js +950 -138
  35. package/src/util/strings.js +10 -0
  36. package/BookReader/plugins/plugin.url.js.LICENSE.txt +0 -1
@@ -533,7 +533,7 @@ svg.BRPageLayer {
533
533
  bottom: 0;
534
534
  }
535
535
 
536
- .BRpageFlipping .BRtextLayer {
536
+ .BRpageFlipping .BRpagecontainer:not(:has(hypothesis-highlight)):not(:has(.BRhighlight)) .BRtextLayer {
537
537
  display: none;
538
538
  }
539
539
 
@@ -2205,11 +2205,6 @@ ia-bookreader .BRtoolbar {
2205
2205
  color: transparent;
2206
2206
  }
2207
2207
 
2208
- .BRtextLayer ::target-text {
2209
- background-color: hsla(45, 80%, 66%, 0.6);
2210
- color: transparent;
2211
- }
2212
-
2213
2208
  .BRtranslateLayer ::selection {
2214
2209
  background: hsla(210, 74%, 62%, 0.4);
2215
2210
  }
@@ -2226,7 +2221,7 @@ ia-bookreader .BRtoolbar {
2226
2221
  content: "-";
2227
2222
  }
2228
2223
 
2229
- .BRsmooth-zooming .BRpagecontainer:not(.BRpagecontainer--hasSelection):not(:has(hypothesis-highlight)) .BRtextLayer, .BRscrolling-active .BRpagecontainer:not(.BRpagecontainer--hasSelection):not(:has(hypothesis-highlight)) .BRtextLayer {
2224
+ .BRsmooth-zooming .BRpagecontainer:not(.BRpagecontainer--hasSelection):not(:has(hypothesis-highlight)):not(:has(.BRhighlight)) .BRtextLayer, .BRscrolling-active .BRpagecontainer:not(.BRpagecontainer--hasSelection):not(:has(hypothesis-highlight)):not(:has(.BRhighlight)) .BRtextLayer {
2230
2225
  display: none;
2231
2226
  }
2232
2227
 
@@ -2291,6 +2286,7 @@ ia-bookreader .BRtoolbar {
2291
2286
  display: none;
2292
2287
  border-radius: 20px;
2293
2288
  background-color: #333;
2289
+ color: white;
2294
2290
  color-scheme: dark;
2295
2291
  padding: 2px;
2296
2292
  overflow: hidden;
@@ -2346,6 +2342,23 @@ ia-bookreader .BRtoolbar {
2346
2342
  opacity: 1;
2347
2343
  }
2348
2344
 
2345
+ .BRtextLayer .BRhighlight {
2346
+ background-color: yellow;
2347
+ pointer-events: all;
2348
+ color: transparent;
2349
+ }
2350
+
2351
+ @keyframes highlightTargetFlash {
2352
+ to {
2353
+ background-color: hsl(45, 80%, 66%);
2354
+ }
2355
+ }
2356
+ .BRtextLayer .BRhighlight--target-text, .BRtextLayer ::target-text {
2357
+ background-color: hsla(45, 80%, 66%, 0.6);
2358
+ color: transparent;
2359
+ animation: highlightTargetFlash 600ms 1 reverse;
2360
+ }
2361
+
2349
2362
  /**
2350
2363
  * Hide modal-manager that loads item-navigator-modal
2351
2364
  * loading bookmarks related alert messages