@internetarchive/bookreader 5.0.0-63 → 5.0.0-65

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 (101) hide show
  1. package/.github/workflows/node.js.yml +1 -0
  2. package/BookReader/BookReader.css +44 -56
  3. package/BookReader/BookReader.js +1 -1
  4. package/BookReader/BookReader.js.LICENSE.txt +2 -0
  5. package/BookReader/BookReader.js.map +1 -1
  6. package/BookReader/ia-bookreader-bundle.js +95 -95
  7. package/BookReader/ia-bookreader-bundle.js.LICENSE.txt +2 -0
  8. package/BookReader/ia-bookreader-bundle.js.map +1 -1
  9. package/BookReader/icons/1up.svg +1 -1
  10. package/BookReader/icons/2up.svg +1 -1
  11. package/BookReader/icons/advance.svg +1 -1
  12. package/BookReader/icons/chevron-right.svg +1 -1
  13. package/BookReader/icons/close-circle-dark.svg +1 -1
  14. package/BookReader/icons/close-circle.svg +1 -1
  15. package/BookReader/icons/fullscreen.svg +1 -1
  16. package/BookReader/icons/fullscreen_exit.svg +1 -1
  17. package/BookReader/icons/hamburger.svg +1 -1
  18. package/BookReader/icons/left-arrow.svg +1 -1
  19. package/BookReader/icons/magnify-minus.svg +1 -1
  20. package/BookReader/icons/magnify-plus.svg +1 -1
  21. package/BookReader/icons/magnify.svg +1 -1
  22. package/BookReader/icons/pause.svg +1 -1
  23. package/BookReader/icons/play.svg +1 -1
  24. package/BookReader/icons/playback-speed.svg +1 -1
  25. package/BookReader/icons/read-aloud.svg +1 -1
  26. package/BookReader/icons/review.svg +1 -1
  27. package/BookReader/icons/thumbnails.svg +1 -1
  28. package/BookReader/icons/voice.svg +1 -1
  29. package/BookReader/icons/volume-full.svg +1 -1
  30. package/BookReader/images/BRicons.svg +3 -3
  31. package/BookReader/images/books_graphic.svg +1 -1
  32. package/BookReader/images/icon_book.svg +1 -1
  33. package/BookReader/images/icon_bookmark.svg +1 -1
  34. package/BookReader/images/icon_gear.svg +1 -1
  35. package/BookReader/images/icon_hamburger.svg +1 -1
  36. package/BookReader/images/icon_home.svg +1 -1
  37. package/BookReader/images/icon_info.svg +1 -1
  38. package/BookReader/images/icon_one_page.svg +1 -1
  39. package/BookReader/images/icon_pause.svg +1 -1
  40. package/BookReader/images/icon_play.svg +1 -1
  41. package/BookReader/images/icon_search_button.svg +1 -1
  42. package/BookReader/images/icon_share.svg +1 -1
  43. package/BookReader/images/icon_skip-ahead.svg +1 -1
  44. package/BookReader/images/icon_skip-back.svg +1 -1
  45. package/BookReader/images/icon_speaker.svg +1 -1
  46. package/BookReader/images/icon_speaker_open.svg +1 -1
  47. package/BookReader/images/icon_thumbnails.svg +1 -1
  48. package/BookReader/images/icon_toc.svg +1 -1
  49. package/BookReader/images/icon_two_pages.svg +1 -1
  50. package/BookReader/images/marker_chap-off.svg +1 -1
  51. package/BookReader/images/marker_chap-on.svg +1 -1
  52. package/BookReader/images/marker_srch-on.svg +1 -1
  53. package/BookReader/jquery-3.js +1 -1
  54. package/BookReader/plugins/plugin.archive_analytics.js +1 -1
  55. package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
  56. package/BookReader/plugins/plugin.autoplay.js +1 -1
  57. package/BookReader/plugins/plugin.autoplay.js.map +1 -1
  58. package/BookReader/plugins/plugin.chapters.js +2 -1
  59. package/BookReader/plugins/plugin.chapters.js.LICENSE.txt +1 -0
  60. package/BookReader/plugins/plugin.chapters.js.map +1 -1
  61. package/BookReader/plugins/plugin.iframe.js.map +1 -1
  62. package/BookReader/plugins/plugin.mobile_nav.js +1 -1
  63. package/BookReader/plugins/plugin.mobile_nav.js.map +1 -1
  64. package/BookReader/plugins/plugin.resume.js +1 -1
  65. package/BookReader/plugins/plugin.resume.js.map +1 -1
  66. package/BookReader/plugins/plugin.search.js +2 -1
  67. package/BookReader/plugins/plugin.search.js.LICENSE.txt +1 -0
  68. package/BookReader/plugins/plugin.search.js.map +1 -1
  69. package/BookReader/plugins/plugin.text_selection.js +2 -1
  70. package/BookReader/plugins/plugin.text_selection.js.LICENSE.txt +1 -0
  71. package/BookReader/plugins/plugin.text_selection.js.map +1 -1
  72. package/BookReader/plugins/plugin.tts.js +1 -1
  73. package/BookReader/plugins/plugin.tts.js.LICENSE.txt +2 -0
  74. package/BookReader/plugins/plugin.tts.js.map +1 -1
  75. package/BookReader/plugins/plugin.url.js +1 -1
  76. package/BookReader/plugins/plugin.url.js.map +1 -1
  77. package/BookReader/plugins/plugin.vendor-fullscreen.js +1 -1
  78. package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
  79. package/BookReader/webcomponents-bundle.js +1 -1
  80. package/BookReader/webcomponents-bundle.js.map +1 -1
  81. package/CHANGELOG.md +10 -0
  82. package/babel.config.js +5 -4
  83. package/netlify.toml +4 -0
  84. package/package.json +19 -19
  85. package/src/BookNavigator/search/search-results.js +1 -7
  86. package/src/BookReader/utils.js +10 -0
  87. package/src/BookReader.js +0 -5
  88. package/src/css/_BRnav.scss +2 -2
  89. package/src/css/_BRsearch.scss +38 -10
  90. package/src/plugins/search/plugin.search.js +14 -21
  91. package/src/plugins/search/utils.js +43 -0
  92. package/src/plugins/search/view.js +11 -24
  93. package/tests/e2e/helpers/desktopSearch.js +3 -3
  94. package/tests/jest/BookNavigator/search/search-results.test.js +6 -1
  95. package/tests/jest/BookReader/utils.test.js +12 -0
  96. package/tests/jest/plugins/search/plugin.search.test.js +2 -39
  97. package/tests/jest/plugins/search/plugin.search.view.test.js +5 -0
  98. package/tests/jest/plugins/search/utils.js +25 -0
  99. package/tests/jest/plugins/search/utils.test.js +29 -0
  100. package/src/BookReader/DebugConsole.js +0 -54
  101. package/tests/jest/BookReader/DebugConsole.test.js +0 -25
@@ -17,6 +17,7 @@ jobs:
17
17
  - uses: actions/checkout@v3
18
18
  - uses: actions/setup-node@v3
19
19
  with:
20
+ # Keep in sync with netlify.toml
20
21
  node-version: 16.x
21
22
  - name: Cache node_modules
22
23
  uses: actions/cache@v3
@@ -323,47 +323,38 @@ body.BRfullscreenActive .mm-menu {
323
323
  .BRinfoLeftCol {
324
324
  font-size: 14px;
325
325
  }
326
-
327
326
  .BRimageW {
328
327
  text-align: center;
329
328
  margin-bottom: 10px;
330
329
  }
331
-
332
330
  .BRimageW img {
333
331
  height: 200px;
334
332
  width: auto;
335
333
  }
336
-
337
334
  .BRinfoValue.larger {
338
335
  font-size: 16px;
339
336
  }
340
-
341
337
  .BRinfoMoreInfoWrapper a {
342
338
  font-size: inherit;
343
339
  color: white;
344
340
  text-decoration: none;
345
341
  }
346
-
347
342
  .BRinfoOtherFormatsFormat {
348
343
  margin-bottom: 6px;
349
344
  }
350
-
351
345
  .BRinfoFooter {
352
346
  margin-bottom: 10px;
353
347
  text-align: left;
354
348
  }
355
-
356
349
  .BRinfoFooter a {
357
350
  display: block;
358
351
  }
359
-
360
352
  .BRfloatFoot.BRinfoFooter {
361
353
  margin: initial;
362
354
  padding: initial;
363
355
  border: initial;
364
356
  font-size: inherit;
365
357
  }
366
-
367
358
  .BookReader .fieldset-embed, .BRmobileMenu .fieldset-embed, .BRfloat .fieldset-embed {
368
359
  display: none;
369
360
  }
@@ -380,56 +371,46 @@ body.BRfullscreenActive .mm-menu {
380
371
  position: relative;
381
372
  padding: 15px;
382
373
  }
383
-
384
374
  .BRinfoLeftCol {
385
375
  float: left;
386
376
  width: 40%;
387
377
  min-height: 1px;
388
378
  }
389
-
390
379
  .BRinfoRightCol {
391
380
  float: left;
392
381
  width: 58%;
393
382
  }
394
-
395
383
  .BRimageW {
396
384
  text-align: center;
397
385
  margin-bottom: 10px;
398
386
  margin-right: 26px;
399
387
  }
400
-
401
388
  .BRimageW img {
402
389
  height: auto;
403
390
  width: 100%;
404
391
  }
405
-
406
392
  .BRinfoValue.larger {
407
393
  font-size: 20px;
408
394
  line-height: 1.2;
409
395
  }
410
-
411
396
  .BRinfoMoreInfoWrapper a {
412
397
  font-size: 14px;
413
398
  color: white;
414
399
  text-decoration: none;
415
400
  font-weight: bold;
416
401
  }
417
-
418
402
  .BRinfoOtherFormatsFormat {
419
403
  display: inline;
420
404
  margin-right: 10px;
421
405
  }
422
-
423
406
  .BRinfoFooter {
424
407
  font-size: 1em;
425
408
  clear: both;
426
409
  }
427
-
428
410
  .BRinfoFooter a {
429
411
  display: inline;
430
412
  margin-right: 10px;
431
413
  }
432
-
433
414
  .BookReader .BRaction, .BRmobileMenu .BRaction, .BRfloat .BRaction {
434
415
  padding: 8px 16px;
435
416
  }
@@ -984,14 +965,13 @@ i.BRicon {
984
965
  /* Desktop Only */
985
966
  @media (min-width: 801px) {
986
967
  .BRfloat .message,
987
- .BRfloatBody {
968
+ .BRfloatBody {
988
969
  padding: 10px 15px 10px 15px;
989
970
  font-size: 16px;
990
971
  line-height: normal;
991
972
  margin-top: 0;
992
973
  margin-bottom: 0px;
993
974
  }
994
-
995
975
  .BRfloatHead {
996
976
  box-sizing: border-box;
997
977
  line-height: normal;
@@ -1001,7 +981,6 @@ i.BRicon {
1001
981
  text-align: center;
1002
982
  border-bottom: 1px solid rgb(216, 216, 216);
1003
983
  }
1004
-
1005
984
  .BRfloatFoot {
1006
985
  padding: 10px;
1007
986
  margin-bottom: 10px;
@@ -1012,10 +991,9 @@ i.BRicon {
1012
991
  .BRfloatBody {
1013
992
  padding: 10px 10px;
1014
993
  }
1015
-
1016
994
  .BRfloat .message,
1017
- .BRfloatBody,
1018
- .BRfloatHead {
995
+ .BRfloatBody,
996
+ .BRfloatHead {
1019
997
  box-sizing: border-box;
1020
998
  line-height: normal;
1021
999
  border-bottom: 1px solid rgb(216, 216, 216);
@@ -1025,12 +1003,10 @@ i.BRicon {
1025
1003
  font-weight: 700;
1026
1004
  text-align: center;
1027
1005
  }
1028
-
1029
1006
  .BRfloatFoot {
1030
1007
  padding: 10px 10px 0 10px;
1031
1008
  border-top: 1px solid #ccc;
1032
1009
  }
1033
-
1034
1010
  .BRfloatFoot .BRaction {
1035
1011
  margin-bottom: 10px;
1036
1012
  }
@@ -1040,7 +1016,6 @@ i.BRicon {
1040
1016
  max-width: initial;
1041
1017
  width: 455px;
1042
1018
  }
1043
-
1044
1019
  .BRfloat.wide {
1045
1020
  max-width: initial;
1046
1021
  width: 555px;
@@ -1064,11 +1039,11 @@ i.BRicon {
1064
1039
  @keyframes fadeUp {
1065
1040
  from {
1066
1041
  opacity: 0;
1067
- transform: translateY(10px);
1042
+ translate: 0 10px;
1068
1043
  }
1069
1044
  to {
1070
1045
  opacity: 1;
1071
- transform: translateY(0);
1046
+ translate: 0 0;
1072
1047
  }
1073
1048
  }
1074
1049
  .BRfooter {
@@ -1240,8 +1215,7 @@ i.BRicon {
1240
1215
  appearance: none;
1241
1216
  border: 0;
1242
1217
  text-align: center;
1243
- text-align-last: center;
1244
- /* Chrome */
1218
+ text-align-last: center; /* Chrome */
1245
1219
  padding-top: 60%;
1246
1220
  padding-left: 10%;
1247
1221
  padding-right: 10%;
@@ -1340,8 +1314,7 @@ i.BRicon {
1340
1314
  height: 20px;
1341
1315
  border-radius: 50%;
1342
1316
  top: -5px;
1343
- margin-left: -9px;
1344
- /* Center icon */
1317
+ margin-left: -9px; /* Center icon */
1345
1318
  z-index: 6;
1346
1319
  border: none;
1347
1320
  }
@@ -1425,11 +1398,9 @@ i.BRicon {
1425
1398
  .BRnavline .BRchapter {
1426
1399
  display: none;
1427
1400
  }
1428
-
1429
1401
  .BRnavCntlBtm {
1430
1402
  bottom: 34px;
1431
1403
  }
1432
-
1433
1404
  .BRpager.ui-slider {
1434
1405
  height: 10px;
1435
1406
  top: 12px;
@@ -1543,24 +1514,31 @@ i.BRicon {
1543
1514
  bottom: calc(100% + 5px);
1544
1515
  left: 50%;
1545
1516
  transform: translateX(-50%);
1546
- width: 230px;
1517
+ width: 350px;
1518
+ max-width: 100vw;
1547
1519
  padding: 12px 14px;
1520
+ padding-bottom: 10px;
1548
1521
  color: #fff;
1549
- font-weight: bold;
1550
1522
  background: #333;
1551
1523
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
1524
+ border-radius: 4px;
1525
+ animation: fadeUp 0.2s;
1526
+ -webkit-user-select: none;
1527
+ -moz-user-select: none;
1528
+ -ms-user-select: none;
1529
+ -o-user-select: none;
1530
+ user-select: none;
1552
1531
  }
1553
1532
  .BookReader .BRquery:after, .BRmobileMenu .BRquery:after, .BRfloat .BRquery:after, .BookReader .BRchapter > div:after, .BRmobileMenu .BRchapter > div:after, .BRfloat .BRchapter > div:after {
1554
- display: none;
1555
1533
  position: absolute;
1556
- top: 100%;
1534
+ content: "";
1535
+ bottom: -9px;
1557
1536
  left: 50%;
1537
+ margin-left: -1px;
1558
1538
  transform: translateX(-50%);
1559
- content: "";
1560
- border: 7px solid transparent;
1561
- border-width: 7px 4px;
1562
- border-bottom: none;
1563
- border-top-color: #333;
1539
+ width: 30px;
1540
+ height: 10px;
1541
+ clip-path: polygon(0 0, 100% 0, 50% 100%);
1564
1542
  }
1565
1543
 
1566
1544
  .BookReader .searchHiliteLayer, .BookReader .ttsHiliteLayer, .BRmobileMenu .searchHiliteLayer, .BRmobileMenu .ttsHiliteLayer, .BRfloat .searchHiliteLayer, .BRfloat .ttsHiliteLayer {
@@ -1606,8 +1584,7 @@ i.BRicon {
1606
1584
  }
1607
1585
  .BookReader .BRchapter, .BookReader .BRsearch, .BRmobileMenu .BRchapter, .BRmobileMenu .BRsearch, .BRfloat .BRchapter, .BRfloat .BRsearch {
1608
1586
  position: absolute;
1609
- bottom: 0;
1610
- /* Relative to nav line */
1587
+ bottom: 0; /* Relative to nav line */
1611
1588
  cursor: pointer;
1612
1589
  z-index: 3;
1613
1590
  background-color: transparent;
@@ -1620,8 +1597,7 @@ i.BRicon {
1620
1597
  height: 8px;
1621
1598
  width: 4px;
1622
1599
  bottom: -13px;
1623
- margin-left: -12px;
1624
- /* Center icon */
1600
+ margin-left: -12px; /* Center icon */
1625
1601
  }
1626
1602
  .BookReader .BRchapter:hover > div, .BRmobileMenu .BRchapter:hover > div, .BRfloat .BRchapter:hover > div {
1627
1603
  display: block;
@@ -1650,7 +1626,19 @@ i.BRicon {
1650
1626
  .BookReader .BRsearch .BRquery, .BRmobileMenu .BRsearch .BRquery, .BRfloat .BRsearch .BRquery {
1651
1627
  display: none;
1652
1628
  }
1653
- .BookReader .BRquery b, .BRmobileMenu .BRquery b, .BRfloat .BRquery b {
1629
+ .BookReader .BRquery main, .BRmobileMenu .BRquery main, .BRfloat .BRquery main {
1630
+ display: -webkit-box;
1631
+ -webkit-line-clamp: 4;
1632
+ -webkit-box-orient: vertical;
1633
+ overflow: hidden;
1634
+ margin-bottom: 6px;
1635
+ }
1636
+ .BookReader .BRquery footer, .BRmobileMenu .BRquery footer, .BRfloat .BRquery footer {
1637
+ text-align: center;
1638
+ font-weight: bold;
1639
+ font-size: 0.9em;
1640
+ }
1641
+ .BookReader .BRquery mark, .BRmobileMenu .BRquery mark, .BRfloat .BRquery mark {
1654
1642
  color: #adaedc;
1655
1643
  font-weight: bold;
1656
1644
  background-color: #272958;
@@ -2535,7 +2523,7 @@ html.mm-background .BookReader {
2535
2523
  /* Mobile Only */
2536
2524
  @media (max-width: 800px) {
2537
2525
  .BRbodyMobileNavEnabled .BRtoolbar.responsive,
2538
- .BRbodyMobileNavEnabledFullscreen.BRfullscreenActive .BRtoolbar.responsive {
2526
+ .BRbodyMobileNavEnabledFullscreen.BRfullscreenActive .BRtoolbar.responsive {
2539
2527
  display: block;
2540
2528
  height: 40px;
2541
2529
  box-sizing: border-box;
@@ -2544,15 +2532,15 @@ html.mm-background .BookReader {
2544
2532
  background: #333;
2545
2533
  }
2546
2534
  .BRbodyMobileNavEnabled .BRtoolbar.responsive .BRtoolbarbuttons,
2547
- .BRbodyMobileNavEnabledFullscreen.BRfullscreenActive .BRtoolbar.responsive .BRtoolbarbuttons {
2535
+ .BRbodyMobileNavEnabledFullscreen.BRfullscreenActive .BRtoolbar.responsive .BRtoolbarbuttons {
2548
2536
  display: none;
2549
2537
  }
2550
2538
  .BRbodyMobileNavEnabled .BRtoolbar.responsive .BRmobileHamburgerWrapper,
2551
- .BRbodyMobileNavEnabledFullscreen.BRfullscreenActive .BRtoolbar.responsive .BRmobileHamburgerWrapper {
2539
+ .BRbodyMobileNavEnabledFullscreen.BRfullscreenActive .BRtoolbar.responsive .BRmobileHamburgerWrapper {
2552
2540
  display: block;
2553
2541
  }
2554
2542
  .BRbodyMobileNavEnabled .BRtoolbar.responsive .BRmobileMenu,
2555
- .BRbodyMobileNavEnabledFullscreen.BRfullscreenActive .BRtoolbar.responsive .BRmobileMenu {
2543
+ .BRbodyMobileNavEnabledFullscreen.BRfullscreenActive .BRtoolbar.responsive .BRmobileMenu {
2556
2544
  display: block;
2557
2545
  }
2558
2546
  }
@@ -2996,10 +2984,10 @@ li.BRtable-contents-el .BRTOCElementPage {
2996
2984
  }
2997
2985
 
2998
2986
  .BRwordElement::selection, .BRspace::selection, .BRparagraphElement::selection, .BRparagraphElement br::selection {
2999
- background: hsla(210deg, 74%, 62%, 0.4);
2987
+ background: hsla(210, 74%, 62%, 0.4);
3000
2988
  }
3001
2989
  .BRwordElement::-moz-selection, .BRspace::-moz-selection, .BRparagraphElement::-moz-selection, .BRparagraphElement br::-moz-selection {
3002
- background: hsla(210deg, 74%, 62%, 0.4);
2990
+ background: hsla(210, 74%, 62%, 0.4);
3003
2991
  color: transparent;
3004
2992
  }
3005
2993