@internetarchive/bookreader 5.0.0-3 → 5.0.0-30-d
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.
- package/.eslintrc.js +17 -5
- package/.github/dependabot.yml +8 -0
- package/.github/workflows/node.js.yml +10 -1
- package/.husky/_/husky.sh +30 -0
- package/.testcaferc.js +10 -0
- package/BookReader/BookReader.css +75 -323
- package/BookReader/BookReader.js +32261 -2
- package/BookReader/BookReader.js.map +1 -1
- package/BookReader/ia-bookreader-bundle.js +15235 -0
- package/BookReader/ia-bookreader-bundle.js.map +1 -0
- package/BookReader/icons/close-circle-dark.svg +1 -0
- package/BookReader/icons/voice.svg +1 -0
- package/BookReader/jquery-1.10.1.js +108 -2
- package/BookReader/plugins/plugin.archive_analytics.js +170 -1
- package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
- package/BookReader/plugins/plugin.autoplay.js +163 -1
- package/BookReader/plugins/plugin.autoplay.js.map +1 -1
- package/BookReader/plugins/plugin.chapters.js +333 -1
- package/BookReader/plugins/plugin.chapters.js.map +1 -1
- package/BookReader/plugins/plugin.iframe.js +72 -1
- package/BookReader/plugins/plugin.iframe.js.map +1 -1
- package/BookReader/plugins/plugin.mobile_nav.js +332 -1
- package/BookReader/plugins/plugin.mobile_nav.js.map +1 -1
- package/BookReader/plugins/plugin.resume.js +241 -1
- package/BookReader/plugins/plugin.resume.js.map +1 -1
- package/BookReader/plugins/plugin.search.js +1261 -1
- package/BookReader/plugins/plugin.search.js.map +1 -1
- package/BookReader/plugins/plugin.text_selection.js +839 -1
- package/BookReader/plugins/plugin.text_selection.js.map +1 -1
- package/BookReader/plugins/plugin.tts.js +9115 -2
- package/BookReader/plugins/plugin.tts.js.map +1 -1
- package/BookReader/plugins/plugin.url.js +811 -1
- package/BookReader/plugins/plugin.url.js.map +1 -1
- package/BookReader/plugins/plugin.vendor-fullscreen.js +326 -1
- package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
- package/BookReader/webcomponents-bundle.js +412 -0
- package/BookReader/webcomponents-bundle.js.map +1 -0
- package/BookReaderDemo/BookReaderDemo.css +14 -1
- package/BookReaderDemo/IADemoBr.js +107 -0
- package/BookReaderDemo/demo-advanced.html +1 -1
- package/BookReaderDemo/demo-autoplay.html +1 -0
- package/BookReaderDemo/demo-embed-iframe-src.html +1 -0
- package/BookReaderDemo/demo-fullscreen-mobile.html +1 -0
- package/BookReaderDemo/demo-fullscreen.html +1 -0
- package/BookReaderDemo/demo-iiif.html +1 -0
- package/BookReaderDemo/demo-internetarchive.html +66 -18
- package/BookReaderDemo/demo-multiple.html +1 -0
- package/BookReaderDemo/demo-preview-pages.html +1 -0
- package/BookReaderDemo/demo-simple.html +1 -0
- package/BookReaderDemo/demo-vendor-fullscreen.html +1 -0
- package/BookReaderDemo/immersion-1up.html +1 -0
- package/BookReaderDemo/immersion-mode.html +1 -0
- package/BookReaderDemo/toggle_controls.html +1 -0
- package/BookReaderDemo/view_mode.html +1 -0
- package/BookReaderDemo/viewmode-cycle.html +1 -2
- package/CHANGELOG.md +114 -0
- package/babel.config.js +18 -0
- package/index.html +3 -0
- package/jsconfig.json +19 -0
- package/package.json +45 -27
- package/src/BookNavigator/assets/button-base.js +8 -1
- package/src/BookNavigator/assets/ia-logo.js +17 -0
- package/src/BookNavigator/assets/icon_sort_asc.js +5 -0
- package/src/BookNavigator/assets/icon_sort_desc.js +5 -0
- package/src/BookNavigator/assets/icon_sort_neutral.js +5 -0
- package/src/BookNavigator/assets/icon_volumes.js +11 -0
- package/src/BookNavigator/book-navigator.js +528 -0
- package/src/BookNavigator/bookmarks/bookmark-button.js +2 -1
- package/src/BookNavigator/bookmarks/bookmark-edit.js +2 -1
- package/src/BookNavigator/bookmarks/bookmarks-list.js +1 -0
- package/src/BookNavigator/bookmarks/bookmarks-loginCTA.js +4 -9
- package/src/BookNavigator/bookmarks/bookmarks-provider.js +32 -11
- package/src/BookNavigator/bookmarks/ia-bookmarks.js +88 -43
- package/src/BookNavigator/downloads/downloads-provider.js +22 -16
- package/src/BookNavigator/downloads/downloads.js +16 -23
- package/src/BookNavigator/search/a-search-result.js +1 -0
- package/src/BookNavigator/search/search-provider.js +54 -20
- package/src/BookNavigator/search/search-results.js +7 -18
- package/src/BookNavigator/sharing.js +27 -0
- package/src/BookNavigator/visual-adjustments/visual-adjustments-provider.js +10 -12
- package/src/BookNavigator/visual-adjustments/visual-adjustments.js +1 -0
- package/src/BookNavigator/volumes/volumes-provider.js +114 -0
- package/src/BookNavigator/volumes/volumes.js +189 -0
- package/src/BookReader/DebugConsole.js +3 -3
- package/src/BookReader/DragScrollable.js +233 -0
- package/src/BookReader/Mode1Up.js +50 -351
- package/src/BookReader/Mode1UpLit.js +434 -0
- package/src/BookReader/Mode2Up.js +94 -72
- package/src/BookReader/ModeSmoothZoom.js +177 -0
- package/src/BookReader/ModeThumb.js +16 -8
- package/src/BookReader/Navbar/Navbar.js +2 -31
- package/src/BookReader/PageContainer.js +47 -2
- package/src/BookReader/ReduceSet.js +1 -1
- package/src/BookReader/Toolbar/Toolbar.js +5 -5
- package/src/BookReader/options.js +10 -0
- package/src/BookReader/utils/HTMLDimensionsCacher.js +44 -0
- package/src/BookReader/utils.js +68 -13
- package/src/BookReader.js +316 -232
- package/src/assets/icons/close-circle-dark.svg +1 -0
- package/src/assets/icons/voice.svg +1 -0
- package/src/css/BookReader.scss +0 -12
- package/src/css/_BRComponent.scss +1 -1
- package/src/css/_BRmain.scss +19 -24
- package/src/css/_BRnav.scss +4 -26
- package/src/css/_BRpages.scss +35 -0
- package/src/css/_BRsearch.scss +11 -215
- package/src/css/_TextSelection.scss +1 -17
- package/src/css/_controls.scss +16 -3
- package/src/css/_icons.scss +6 -0
- package/src/ia-bookreader/ia-bookreader.js +206 -0
- package/src/plugins/plugin.chapters.js +15 -18
- package/src/plugins/plugin.mobile_nav.js +11 -10
- package/src/plugins/plugin.resume.js +3 -3
- package/src/plugins/plugin.text_selection.js +17 -29
- package/src/plugins/plugin.vendor-fullscreen.js +4 -4
- package/src/plugins/search/plugin.search.js +113 -104
- package/src/plugins/search/view.js +48 -163
- package/src/plugins/tts/AbstractTTSEngine.js +7 -0
- package/src/plugins/tts/FestivalTTSEngine.js +2 -2
- package/src/plugins/tts/WebTTSEngine.js +5 -0
- package/src/plugins/tts/plugin.tts.js +67 -102
- package/src/plugins/url/UrlPlugin.js +184 -0
- package/src/plugins/url/plugin.url.js +220 -0
- package/{src → stat}/BookNavigator/BookModel.js +0 -0
- package/{src → stat}/BookNavigator/BookNavigator.js +151 -104
- package/stat/BookNavigator/assets/bookmark-colors.js +15 -0
- package/stat/BookNavigator/assets/button-base.js +61 -0
- package/stat/BookNavigator/assets/ia-logo.js +17 -0
- package/stat/BookNavigator/assets/icon_checkmark.js +6 -0
- package/stat/BookNavigator/assets/icon_close.js +3 -0
- package/stat/BookNavigator/assets/icon_sort_asc.js +5 -0
- package/stat/BookNavigator/assets/icon_sort_desc.js +5 -0
- package/stat/BookNavigator/assets/icon_sort_neutral.js +5 -0
- package/stat/BookNavigator/assets/icon_volumes.js +11 -0
- package/stat/BookNavigator/bookmarks/bookmark-button.js +64 -0
- package/stat/BookNavigator/bookmarks/bookmark-edit.js +215 -0
- package/stat/BookNavigator/bookmarks/bookmarks-list.js +285 -0
- package/stat/BookNavigator/bookmarks/bookmarks-loginCTA.js +28 -0
- package/stat/BookNavigator/bookmarks/bookmarks-provider.js +56 -0
- package/stat/BookNavigator/bookmarks/ia-bookmarks.js +523 -0
- package/{src → stat}/BookNavigator/br-fullscreen-mgr.js +1 -2
- package/stat/BookNavigator/delete-modal-actions.js +49 -0
- package/stat/BookNavigator/downloads/downloads-provider.js +72 -0
- package/stat/BookNavigator/downloads/downloads.js +139 -0
- package/stat/BookNavigator/provider-config.js +0 -0
- package/stat/BookNavigator/search/a-search-result.js +55 -0
- package/stat/BookNavigator/search/search-provider.js +180 -0
- package/stat/BookNavigator/search/search-results.js +360 -0
- package/stat/BookNavigator/sharing.js +31 -0
- package/stat/BookNavigator/visual-adjustments/visual-adjustments-provider.js +94 -0
- package/stat/BookNavigator/visual-adjustments/visual-adjustments.js +280 -0
- package/stat/BookNavigator/volumes/volumes-provider.js +83 -0
- package/stat/BookNavigator/volumes/volumes.js +178 -0
- package/stat/BookReader/BookModel.js +518 -0
- package/stat/BookReader/DebugConsole.js +54 -0
- package/stat/BookReader/DragScrollable.js +233 -0
- package/stat/BookReader/ImageCache.js +116 -0
- package/stat/BookReader/Mode1Up.js +102 -0
- package/stat/BookReader/Mode1UpLit.js +434 -0
- package/stat/BookReader/Mode2Up.js +1372 -0
- package/stat/BookReader/ModeSmoothZoom.js +177 -0
- package/stat/BookReader/ModeThumb.js +344 -0
- package/stat/BookReader/Navbar/Navbar.js +310 -0
- package/stat/BookReader/PageContainer.js +120 -0
- package/stat/BookReader/ReduceSet.js +26 -0
- package/stat/BookReader/Toolbar/Toolbar.js +384 -0
- package/stat/BookReader/events.js +20 -0
- package/stat/BookReader/options.js +324 -0
- package/stat/BookReader/utils/HTMLDimensionsCacher.js +44 -0
- package/stat/BookReader/utils/classes.js +36 -0
- package/stat/BookReader/utils.js +240 -0
- package/stat/BookReader.js +2550 -0
- package/{src → stat}/BookReaderComponent/BookReaderComponent.js +16 -11
- package/stat/assets/icons/1up.svg +12 -0
- package/stat/assets/icons/2up.svg +15 -0
- package/stat/assets/icons/advance.svg +26 -0
- package/stat/assets/icons/chevron-right.svg +1 -0
- package/stat/assets/icons/close-circle-dark.svg +1 -0
- package/stat/assets/icons/close-circle.svg +1 -0
- package/stat/assets/icons/fullscreen.svg +17 -0
- package/stat/assets/icons/fullscreen_exit.svg +17 -0
- package/stat/assets/icons/hamburger.svg +15 -0
- package/stat/assets/icons/left-arrow.svg +12 -0
- package/stat/assets/icons/magnify-minus.svg +16 -0
- package/stat/assets/icons/magnify-plus.svg +17 -0
- package/stat/assets/icons/magnify.svg +15 -0
- package/stat/assets/icons/pause.svg +23 -0
- package/stat/assets/icons/play.svg +22 -0
- package/stat/assets/icons/playback-speed.svg +34 -0
- package/stat/assets/icons/read-aloud.svg +22 -0
- package/stat/assets/icons/review.svg +22 -0
- package/stat/assets/icons/thumbnails.svg +17 -0
- package/stat/assets/icons/voice.svg +1 -0
- package/stat/assets/icons/volume-full.svg +22 -0
- package/stat/assets/images/BRicons.png +0 -0
- package/stat/assets/images/BRicons.svg +94 -0
- package/stat/assets/images/BRicons_ia.png +0 -0
- package/stat/assets/images/back_pages.png +0 -0
- package/stat/assets/images/book_bottom_icon.png +0 -0
- package/stat/assets/images/book_down_icon.png +0 -0
- package/stat/assets/images/book_left_icon.png +0 -0
- package/stat/assets/images/book_leftmost_icon.png +0 -0
- package/stat/assets/images/book_right_icon.png +0 -0
- package/stat/assets/images/book_rightmost_icon.png +0 -0
- package/stat/assets/images/book_top_icon.png +0 -0
- package/stat/assets/images/book_up_icon.png +0 -0
- package/stat/assets/images/books_graphic.svg +177 -0
- package/stat/assets/images/booksplit.png +0 -0
- package/stat/assets/images/control_pause_icon.png +0 -0
- package/stat/assets/images/control_play_icon.png +0 -0
- package/stat/assets/images/embed_icon.png +0 -0
- package/stat/assets/images/icon-home-ia.png +0 -0
- package/stat/assets/images/icon_OL-logo-xs.png +0 -0
- package/stat/assets/images/icon_alert-xs.png +0 -0
- package/stat/assets/images/icon_book.svg +12 -0
- package/stat/assets/images/icon_bookmark.svg +12 -0
- package/stat/assets/images/icon_close-pop.png +0 -0
- package/stat/assets/images/icon_download.png +0 -0
- package/stat/assets/images/icon_gear.svg +14 -0
- package/stat/assets/images/icon_hamburger.svg +20 -0
- package/stat/assets/images/icon_home.png +0 -0
- package/stat/assets/images/icon_home.svg +21 -0
- package/stat/assets/images/icon_home_ia.png +0 -0
- package/stat/assets/images/icon_indicator.png +0 -0
- package/stat/assets/images/icon_info.svg +11 -0
- package/stat/assets/images/icon_one_page.svg +8 -0
- package/stat/assets/images/icon_pause.svg +1 -0
- package/stat/assets/images/icon_play.svg +1 -0
- package/stat/assets/images/icon_playback-rate.svg +15 -0
- package/stat/assets/images/icon_return.png +0 -0
- package/stat/assets/images/icon_search_button.svg +8 -0
- package/stat/assets/images/icon_share.svg +9 -0
- package/stat/assets/images/icon_skip-ahead.svg +6 -0
- package/stat/assets/images/icon_skip-back.svg +13 -0
- package/stat/assets/images/icon_speaker.svg +18 -0
- package/stat/assets/images/icon_speaker_open.svg +10 -0
- package/stat/assets/images/icon_thumbnails.svg +12 -0
- package/stat/assets/images/icon_toc.svg +5 -0
- package/stat/assets/images/icon_two_pages.svg +9 -0
- package/stat/assets/images/icon_zoomer.png +0 -0
- package/stat/assets/images/loading.gif +0 -0
- package/stat/assets/images/logo_icon.png +0 -0
- package/stat/assets/images/marker_chap-off.png +0 -0
- package/stat/assets/images/marker_chap-off.svg +11 -0
- package/stat/assets/images/marker_chap-off_ia.png +0 -0
- package/stat/assets/images/marker_chap-on.png +0 -0
- package/stat/assets/images/marker_chap-on.svg +11 -0
- package/stat/assets/images/marker_srch-on.svg +11 -0
- package/stat/assets/images/marker_srchchap-off.png +0 -0
- package/stat/assets/images/marker_srchchap-on.png +0 -0
- package/stat/assets/images/nav_control-dn.png +0 -0
- package/stat/assets/images/nav_control-dn_ia.png +0 -0
- package/stat/assets/images/nav_control-up.png +0 -0
- package/stat/assets/images/nav_control-up_ia.png +0 -0
- package/stat/assets/images/nav_control.png +0 -0
- package/stat/assets/images/one_page_mode_icon.png +0 -0
- package/stat/assets/images/paper-badge.png +0 -0
- package/stat/assets/images/print_icon.png +0 -0
- package/stat/assets/images/progressbar.gif +0 -0
- package/stat/assets/images/right_edges.png +0 -0
- package/stat/assets/images/slider.png +0 -0
- package/stat/assets/images/slider_ia.png +0 -0
- package/stat/assets/images/thumbnail_mode_icon.png +0 -0
- package/stat/assets/images/transparent.png +0 -0
- package/stat/assets/images/two_page_mode_icon.png +0 -0
- package/stat/assets/images/zoom_in_icon.png +0 -0
- package/stat/assets/images/zoom_out_icon.png +0 -0
- package/stat/css/BookReader.scss +89 -0
- package/stat/css/_BRBookmarks.scss +29 -0
- package/stat/css/_BRComponent.scss +13 -0
- package/stat/css/_BRfloat.scss +197 -0
- package/stat/css/_BRicon.scss +48 -0
- package/stat/css/_BRmain.scss +251 -0
- package/stat/css/_BRnav.scss +359 -0
- package/stat/css/_BRpages.scss +139 -0
- package/stat/css/_BRsearch.scss +226 -0
- package/stat/css/_BRtoolbar.scss +84 -0
- package/stat/css/_BRvendor.scss +5 -0
- package/stat/css/_MobileNav.scss +194 -0
- package/stat/css/_TextSelection.scss +32 -0
- package/stat/css/_colorbox.scss +52 -0
- package/stat/css/_controls.scss +253 -0
- package/stat/css/_icons.scss +121 -0
- package/stat/jquery-wrapper.js +4 -0
- package/stat/plugins/plugin.archive_analytics.js +86 -0
- package/stat/plugins/plugin.autoplay.js +129 -0
- package/stat/plugins/plugin.chapters.js +248 -0
- package/stat/plugins/plugin.iframe.js +48 -0
- package/stat/plugins/plugin.mobile_nav.js +288 -0
- package/stat/plugins/plugin.resume.js +68 -0
- package/stat/plugins/plugin.text_selection.js +291 -0
- package/{src → stat}/plugins/plugin.url.js +4 -4
- package/stat/plugins/plugin.vendor-fullscreen.js +247 -0
- package/stat/plugins/search/plugin.search.js +439 -0
- package/stat/plugins/search/view.js +439 -0
- package/stat/plugins/tts/AbstractTTSEngine.js +249 -0
- package/stat/plugins/tts/FestivalTTSEngine.js +169 -0
- package/stat/plugins/tts/PageChunk.js +107 -0
- package/stat/plugins/tts/PageChunkIterator.js +163 -0
- package/stat/plugins/tts/WebTTSEngine.js +357 -0
- package/stat/plugins/tts/plugin.tts.js +357 -0
- package/stat/plugins/tts/tooltip_dict.js +15 -0
- package/stat/plugins/tts/utils.js +91 -0
- package/stat/util/browserSniffing.js +30 -0
- package/stat/util/debouncer.js +26 -0
- package/stat/util/docCookies.js +67 -0
- package/stat/util/strings.js +34 -0
- package/tests/e2e/README.md +37 -0
- package/tests/e2e/autoplay.test.js +2 -2
- package/tests/e2e/base.test.js +5 -7
- package/tests/e2e/helpers/base.js +8 -3
- package/tests/e2e/helpers/debug.js +1 -1
- package/tests/e2e/helpers/desktopSearch.js +1 -1
- package/tests/e2e/helpers/mobileSearch.js +3 -3
- package/tests/e2e/helpers/params.js +17 -0
- package/tests/e2e/rightToLeft.test.js +4 -5
- package/tests/e2e/viewmode.test.js +30 -31
- package/tests/{BookReader → jest/BookReader}/BookModel.test.js +3 -3
- package/tests/jest/BookReader/BookReaderPublicFunctions.test.js +176 -0
- package/tests/{BookReader → jest/BookReader}/DebugConsole.test.js +1 -1
- package/tests/{BookReader → jest/BookReader}/ImageCache.test.js +4 -4
- package/tests/jest/BookReader/Mode1UpLit.test.js +87 -0
- package/tests/{BookReader → jest/BookReader}/Mode2Up.test.js +5 -7
- package/tests/jest/BookReader/ModeSmoothZoom.test.js +149 -0
- package/tests/jest/BookReader/ModeThumb.test.js +71 -0
- package/tests/{BookReader → jest/BookReader}/Navbar/Navbar.test.js +7 -7
- package/tests/{BookReader → jest/BookReader}/PageContainer.test.js +74 -2
- package/tests/{BookReader → jest/BookReader}/ReduceSet.test.js +1 -1
- package/tests/{BookReader → jest/BookReader}/Toolbar/Toolbar.test.js +2 -2
- package/tests/jest/BookReader/utils/HTMLDimensionsCacher.test.js +59 -0
- package/tests/{BookReader → jest/BookReader}/utils/classes.test.js +1 -1
- package/tests/jest/BookReader/utils.test.js +136 -0
- package/tests/jest/BookReader.keyboard.test.js +190 -0
- package/tests/{BookReader.options.test.js → jest/BookReader.options.test.js} +9 -1
- package/tests/{BookReader.test.js → jest/BookReader.test.js} +20 -4
- package/tests/{plugins → jest/plugins}/plugin.archive_analytics.test.js +2 -2
- package/tests/{plugins → jest/plugins}/plugin.autoplay.test.js +2 -2
- package/tests/{plugins → jest/plugins}/plugin.chapters.test.js +8 -8
- package/tests/{plugins → jest/plugins}/plugin.iframe.test.js +2 -2
- package/tests/{plugins → jest/plugins}/plugin.mobile_nav.test.js +5 -5
- package/tests/{plugins → jest/plugins}/plugin.resume.test.js +3 -3
- package/tests/{plugins → jest/plugins}/plugin.text_selection.test.js +14 -24
- package/tests/{plugins → jest/plugins}/plugin.vendor-fullscreen.test.js +2 -2
- package/tests/{plugins → jest/plugins}/search/plugin.search.test.js +12 -5
- package/tests/{plugins → jest/plugins}/search/plugin.search.view.test.js +6 -6
- package/tests/{plugins → jest/plugins}/tts/AbstractTTSEngine.test.js +3 -3
- package/tests/{plugins → jest/plugins}/tts/FestivalTTSEngine.test.js +4 -4
- package/tests/{plugins → jest/plugins}/tts/PageChunk.test.js +1 -1
- package/tests/{plugins → jest/plugins}/tts/PageChunkIterator.test.js +3 -3
- package/tests/{plugins → jest/plugins}/tts/WebTTSEngine.test.js +1 -1
- package/tests/{plugins → jest/plugins}/tts/utils.test.js +3 -3
- package/tests/jest/plugins/url/UrlPlugin.test.js +175 -0
- package/tests/{plugins → jest/plugins/url}/plugin.url.test.js +33 -14
- package/tests/{util → jest/util}/browserSniffing.test.js +1 -1
- package/tests/{util → jest/util}/docCookies.test.js +1 -1
- package/tests/{util → jest/util}/strings.test.js +1 -1
- package/tests/{utils.js → jest/utils.js} +38 -0
- package/tests/karma/BookNavigator/book-navigator.test.js +485 -0
- package/tests/karma/BookNavigator/bookmarks/bookmark-button.test.js +44 -0
- package/tests/karma/BookNavigator/bookmarks/bookmark-edit.test.js +1 -3
- package/tests/karma/BookNavigator/bookmarks/bookmarks-list.test.js +1 -2
- package/tests/karma/BookNavigator/downloads/downloads-provider.test.js +67 -0
- package/tests/karma/BookNavigator/downloads/downloads.test.js +54 -0
- package/tests/karma/BookNavigator/search/search-provider.test.js +123 -0
- package/tests/karma/BookNavigator/{search-results.test.js → search/search-results.test.js} +1 -4
- package/tests/karma/BookNavigator/sharing/sharing-provider.test.js +49 -0
- package/tests/karma/BookNavigator/visual-adjustments.test.js +0 -2
- package/tests/karma/BookNavigator/volumes/volumes-provider.test.js +184 -0
- package/tests/karma/BookNavigator/volumes/volumes.test.js +98 -0
- package/webpack.config.js +11 -5
- package/.babelrc +0 -12
- package/.dependabot/config.yml +0 -6
- package/.testcaferc.json +0 -5
- package/BookReader/BookReader.js.LICENSE.txt +0 -72
- package/BookReader/bookreader-component-bundle.js +0 -1450
- package/BookReader/bookreader-component-bundle.js.LICENSE.txt +0 -38
- package/BookReader/bookreader-component-bundle.js.map +0 -1
- package/BookReader/jquery-1.10.1.js.LICENSE.txt +0 -24
- package/BookReader/plugins/plugin.menu_toggle.js +0 -2
- package/BookReader/plugins/plugin.menu_toggle.js.map +0 -1
- package/BookReader/plugins/plugin.tts.js.LICENSE.txt +0 -27
- package/BookReaderDemo/demo-plugin-menu-toggle.html +0 -34
- package/src/BookNavigator/assets/book-loader.js +0 -27
- package/src/ItemNavigator/ItemNavigator.js +0 -372
- package/src/ItemNavigator/providers/sharing.js +0 -29
- package/src/dragscrollable-br.js +0 -261
- package/src/plugins/menu_toggle/plugin.menu_toggle.js +0 -324
- package/tests/BookReader/BookReaderPublicFunctions.test.js +0 -171
- package/tests/BookReader/Mode1Up.test.js +0 -164
- package/tests/BookReader/utils.test.js +0 -109
- package/tests/plugins/menu_toggle/plugin.menu_toggle.test.js +0 -68
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
9
9
|
|
|
10
10
|
<!-- JS dependencies -->
|
|
11
|
+
<script src="../BookReader/webcomponents-bundle.js"></script>
|
|
11
12
|
<script src="../BookReader/jquery-1.10.1.js"></script>
|
|
12
13
|
|
|
13
14
|
|
|
@@ -25,17 +26,24 @@
|
|
|
25
26
|
<script src="../BookReader/plugins/plugin.archive_analytics.js"></script>
|
|
26
27
|
<script src="../BookReader/plugins/plugin.text_selection.js"></script>
|
|
27
28
|
|
|
28
|
-
<script type="module" src="../BookReader/bookreader-
|
|
29
|
+
<script type="module" src="../BookReader/ia-bookreader-bundle.js"></script>
|
|
29
30
|
|
|
30
31
|
<link rel="stylesheet" href="BookReaderDemo.css"/>
|
|
31
|
-
|
|
32
|
+
|
|
33
|
+
<!-- IA scripts -->
|
|
34
|
+
<script src="https://archive.org/bookreader/BookReaderJSIA.js"></script>
|
|
35
|
+
|
|
36
|
+
<!-- IA fetch demo -->
|
|
37
|
+
<script type="module" src="IADemoBr.js"></script>
|
|
38
|
+
|
|
39
|
+
</head>
|
|
32
40
|
|
|
33
41
|
<body>
|
|
34
|
-
<section style="width: 100%; overflow: hidden; background-color: black;">
|
|
42
|
+
<section class="theater" style="width: 100%; overflow: hidden; background-color: black;">
|
|
35
43
|
<ia-bookreader
|
|
36
44
|
baseHost="https://archive.org"
|
|
37
45
|
>
|
|
38
|
-
<div id="IABookReaderWrapper"
|
|
46
|
+
<div id="IABookReaderWrapper" slot="theater-main">
|
|
39
47
|
<div id="BookReader" class="BookReader"></div>
|
|
40
48
|
</div>
|
|
41
49
|
<div>
|
|
@@ -50,25 +58,65 @@
|
|
|
50
58
|
</div>
|
|
51
59
|
</ia-bookreader>
|
|
52
60
|
</section>
|
|
53
|
-
<
|
|
54
|
-
|
|
61
|
+
<style>
|
|
62
|
+
.demos {
|
|
63
|
+
height: 800px;
|
|
64
|
+
width: inherit;
|
|
65
|
+
padding: 10px;
|
|
66
|
+
}
|
|
67
|
+
.demo {
|
|
68
|
+
border: 1px solid white;
|
|
69
|
+
padding: 10px;
|
|
70
|
+
}
|
|
71
|
+
</style>
|
|
72
|
+
<section class="demos">
|
|
73
|
+
<div class="demo">
|
|
74
|
+
<button id="toggle-loggedin">Toggle Logged in view</button>
|
|
75
|
+
<p>Features behind signed in gate: Bookmarks</p>
|
|
76
|
+
<p>Logged In Status: <span id="logged-in-status">Logged Out</span></p>
|
|
77
|
+
</div>
|
|
78
|
+
<div class="demo">
|
|
79
|
+
<button id="start-fs">Start at Fullscreen</button>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="demo">
|
|
82
|
+
<h3 id="placeholder">please wait as we are fetching the following: </h3>
|
|
83
|
+
<input type='checkbox' class='group1' name='itemMD' disabled>Item metadata</input><br>
|
|
84
|
+
<input type='checkbox' class='group1' name='bookManifest' disabled> Book manifest</input><br>
|
|
85
|
+
</div>
|
|
55
86
|
</section>
|
|
87
|
+
<div class="demo">
|
|
88
|
+
<h3>Placeholder div to allow scrolling</h3>
|
|
89
|
+
</div>
|
|
56
90
|
|
|
91
|
+
<modal-manager></modal-manager>
|
|
92
|
+
<script >
|
|
93
|
+
// Set up demo things
|
|
94
|
+
const iaBR = document.querySelector('ia-bookreader');
|
|
95
|
+
const toggleLoginBtn = document.querySelector('#toggle-loggedin');
|
|
96
|
+
toggleLoginBtn.addEventListener('click', () => {
|
|
97
|
+
const currLoggedIn = iaBR.signedIn;
|
|
98
|
+
iaBR.signedIn = !currLoggedIn;
|
|
57
99
|
|
|
58
|
-
|
|
100
|
+
document.querySelector('#logged-in-status').innerText = iaBR.signedIn ? 'Logged In' : 'Logged Out';
|
|
101
|
+
console.log("Toggled SignedIn state", iaBR.signedIn, { currLoggedIn })
|
|
102
|
+
});
|
|
59
103
|
|
|
60
|
-
|
|
61
|
-
|
|
104
|
+
const startFSBtn = document.querySelector('#start-fs');
|
|
105
|
+
startFSBtn.addEventListener('click', () => {
|
|
106
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
107
|
+
if (urlParams.has('view')) {
|
|
108
|
+
const url = new URL(window.location);
|
|
109
|
+
url.searchParams.delete('view');
|
|
110
|
+
window.history.pushState({}, '', url);
|
|
111
|
+
}
|
|
112
|
+
urlParams.set('view', 'theater');
|
|
113
|
+
window.location.search = urlParams.toString();
|
|
114
|
+
});
|
|
62
115
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
window.Sentry = null;
|
|
68
|
-
|
|
69
|
-
var script_url = 'https://archive.org/bookreader/BookReaderJSLocate.php?subPrefix=&id=' + ocaid;
|
|
70
|
-
document.getElementById('pageUrl').src = script_url;
|
|
116
|
+
window.addEventListener('BookReader:PostInit', () => {
|
|
117
|
+
const placeholder = document.querySelector('#placeholder');
|
|
118
|
+
placeholder.innerHTML = 'Dependencies are complete, bookreader has loaded';
|
|
119
|
+
});
|
|
71
120
|
</script>
|
|
72
|
-
|
|
73
121
|
</body>
|
|
74
122
|
</html>
|
|
@@ -7,10 +7,9 @@
|
|
|
7
7
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
8
8
|
|
|
9
9
|
<!-- JS dependencies -->
|
|
10
|
+
<script src="../BookReader/webcomponents-bundle.js"></script>
|
|
10
11
|
<script src="../BookReader/jquery-1.10.1.js"></script>
|
|
11
12
|
|
|
12
|
-
<script src="../BookReader/jquery.bt.min.js"></script>
|
|
13
|
-
|
|
14
13
|
<!-- BookReader and plugins -->
|
|
15
14
|
<link rel="stylesheet" href="../BookReader/BookReader.css"/>
|
|
16
15
|
<script src="../BookReader/BookReader.js"></script>
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,117 @@
|
|
|
1
|
+
# 5.0.0-29
|
|
2
|
+
- import ia-item-navigator for menu management @iisa
|
|
3
|
+
- url plugin: suppress default state on load @dualcnhq
|
|
4
|
+
|
|
5
|
+
# 5.0.0-28
|
|
6
|
+
Dev: Refactor URLPlugin + sync volumes sorting state to URL @dualcnhq @cdrini
|
|
7
|
+
|
|
8
|
+
# 5.0.0-27
|
|
9
|
+
Dev: eslint fix for $.browser @homewardgamer
|
|
10
|
+
Fix: cache search inside requests @iisa
|
|
11
|
+
# 5.0.0-26
|
|
12
|
+
Fix: read aloud play/pause button @nsharma123
|
|
13
|
+
Dev: strict keyboard shortcuts @mc2
|
|
14
|
+
Dev: update IA demo page @iisa
|
|
15
|
+
|
|
16
|
+
# 5.0.0-24
|
|
17
|
+
Fix: book-nav side panel zoom out @mc2
|
|
18
|
+
Dev: refactor zoom code @mc2
|
|
19
|
+
|
|
20
|
+
# 5.0.0-23
|
|
21
|
+
Fix: Darken scrollbars in Safari @pezvi
|
|
22
|
+
Fix: Bookmarks service calls when reader is logged in @mc2
|
|
23
|
+
Dev: Move jest tests into separate directory @cdrini
|
|
24
|
+
|
|
25
|
+
# 5.0.0-22
|
|
26
|
+
- Dev: remove deprecated embed nav view, use standard default @iisa
|
|
27
|
+
|
|
28
|
+
# 5.0.0-21
|
|
29
|
+
- Dev: Toggle view=theater in fullscreen @mc2
|
|
30
|
+
|
|
31
|
+
# 5.0.0-20
|
|
32
|
+
- Feature: Add voice selection dropdown to ReadAloud! @mekarpeles
|
|
33
|
+
- Dev: Make jest support root-level imports with "@" @cdrini
|
|
34
|
+
- Dev: Make it easy to run e2e tests on archive.org/browserstack @cdrini
|
|
35
|
+
|
|
36
|
+
# 5.0.0-19
|
|
37
|
+
- Dev: Refactor dragscrollable from a jquery plugin to a JS class @cdrini
|
|
38
|
+
- Dev: Fix jquery eslint errors @cdrini
|
|
39
|
+
- Dev: Replace deprecated babel-eslint with successor @cdrini
|
|
40
|
+
- Fix: BR not working on iOS 9 / iOS 10! @cdrini, @iisa
|
|
41
|
+
- Added webcomponents, ResizeObserver polyfill
|
|
42
|
+
- ES5-ify lit node_modules
|
|
43
|
+
|
|
44
|
+
# 5.0.0-18
|
|
45
|
+
- Dev: Update a number of dependencies @cdrini
|
|
46
|
+
- Dev: Added eslint-plugin-no-jquery @soham4abc
|
|
47
|
+
- Feature: Add continuous pinch zooming for touch screens and trackpads! @cdrini
|
|
48
|
+
- This is a _big_ change to the codebase. It involved rewriting 1 up mode in LitElement. This means that BookReader now need webcomponents to function.
|
|
49
|
+
- Breaking changes (unlikely to be used by anyone):
|
|
50
|
+
- Most Mode1Up Bookreader global functions removed (unlikely to be used): `drawLeafsOnePage`, `onePageGetAutofitWidth`, `onePageGetAutofitHeight`, `onePageGetPageTop`, `onePageCalculateReductionFactors`, `centerX1up`, `centerY1up`
|
|
51
|
+
- Some Mode2Up cleanups: Removed `setClickHandler2UP`, `setMouseHandlers2UP`
|
|
52
|
+
- [Web components](https://caniuse.com/custom-elementsv1) now must be supported
|
|
53
|
+
- Reduction factors options no longer applies to 1up
|
|
54
|
+
|
|
55
|
+
# 5.0.0-17
|
|
56
|
+
- Fix: focus in a textarea disables keyboard shortcuts @cdrini
|
|
57
|
+
|
|
58
|
+
# 5.0.0-16
|
|
59
|
+
- Dev: remove unused menu toggle plugin @iisa
|
|
60
|
+
- Fix: Book nav loader safari update @iisa
|
|
61
|
+
|
|
62
|
+
# 5.0.0-15
|
|
63
|
+
- Fix: Typing -/+ in search box no longer zooms @cdrini
|
|
64
|
+
- Dev: Add script for updating dev deps @cdrini
|
|
65
|
+
- Refactor/Fix: Convert search/TTS highlights to use SVG layer @cdrini
|
|
66
|
+
- Fix TTS highlights not positioned correctly in Mode1Up
|
|
67
|
+
- Breaking changes (unlikely these are used by anyone):
|
|
68
|
+
- Remove public method `BookReader.prototype.keyboardNavigationIsDisabled`
|
|
69
|
+
- Remove public method `BookReader.util.sleep`
|
|
70
|
+
- Remove public method `BookReader.prototype.updateSearchHilites1UP`
|
|
71
|
+
- Remove public method `BookReader.prototype.updateSearchHilites2UP`
|
|
72
|
+
- Remove public attribute `BookReader.prototype.ttsHilites`
|
|
73
|
+
|
|
74
|
+
# 5.0.0-14
|
|
75
|
+
- Fix: Url search param `q=` updates dynamically @nsharma123
|
|
76
|
+
- Fix: Downloads menu text updates @dualcnhq
|
|
77
|
+
- Fix: Volumes updates - icons, labelling, open menu onload @iisa
|
|
78
|
+
|
|
79
|
+
# 5.0.0-13
|
|
80
|
+
- Enhancement: Add neutral state for sorting volumes @dualcnhq
|
|
81
|
+
- Enhancement: Update subfiles/volumes title sorting logic by filename -> title_asc -> title_desc order then back to filename @dualcnhq
|
|
82
|
+
- Fix: Volume item index count display @dualcnhq
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
# 5.0.0-12
|
|
86
|
+
- Fix: new side panel: sortable multiple volumes @dualcnhq @iisa
|
|
87
|
+
- Fix: sharing side panel can share subfile/volume @iisa
|
|
88
|
+
|
|
89
|
+
# 5.0.0-11
|
|
90
|
+
- Fix: standardize button style for download panel @nsharma123
|
|
91
|
+
# 5.0.0-10
|
|
92
|
+
- Fix: Make 1up default to full width (up to real world size) @cdrini
|
|
93
|
+
- Fix: Remove "page" from toolbar @cdrini
|
|
94
|
+
- Dev: Update menu slider @iisa
|
|
95
|
+
- Dev: Add semi-colons eslint rule @iisa
|
|
96
|
+
|
|
97
|
+
# 5.0.0-9
|
|
98
|
+
- Fix: search-inside results check for page's index via `leafNum` @nsharma123
|
|
99
|
+
# 5.0.0-8
|
|
100
|
+
- Fix: cancel search fix naming var @iisa
|
|
101
|
+
|
|
102
|
+
# 5.0.0-7
|
|
103
|
+
- Fix: cancel search @iisa
|
|
104
|
+
- Dev: remove dead css @cdrini
|
|
105
|
+
- Dev: GHA node_modules caching @cdrini
|
|
106
|
+
# 5.0.0-6
|
|
107
|
+
- Fix: Fullscreen toggle sets/unsets animating flag @iisa
|
|
108
|
+
# 5.0.0-5
|
|
109
|
+
- Fix: Book Nav: resize only when bookreader is not animating @iisa
|
|
110
|
+
- Fix: Web components register themselves at EOF @iisa
|
|
111
|
+
- Dev: update dependencies with dependabot @drini
|
|
112
|
+
# 5.0.0-4
|
|
113
|
+
- Dev: update bookmarks login archive_analytics @iisa @dualcnhq
|
|
114
|
+
|
|
1
115
|
# 5.0.0-3
|
|
2
116
|
- Fix: bookmarks panel has login CTA @dualcnhq @iisa
|
|
3
117
|
|
package/babel.config.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
presets: [
|
|
3
|
+
[
|
|
4
|
+
"@babel/preset-env",
|
|
5
|
+
{
|
|
6
|
+
targets: "> 2%, ie 11, edge 14, samsung > 9, OperaMini all, UCAndroid > 12, Safari >= 9",
|
|
7
|
+
useBuiltIns: "usage",
|
|
8
|
+
corejs: 3
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
],
|
|
12
|
+
plugins: [
|
|
13
|
+
["@babel/plugin-proposal-decorators", {decoratorsBeforeExport: true}],
|
|
14
|
+
["@babel/plugin-proposal-class-properties", {loose: true}],
|
|
15
|
+
["@babel/plugin-proposal-private-property-in-object", { loose: true }],
|
|
16
|
+
["@babel/plugin-proposal-private-methods", { loose: true }],
|
|
17
|
+
]
|
|
18
|
+
};
|
package/index.html
CHANGED
|
@@ -18,12 +18,15 @@
|
|
|
18
18
|
<li><a href="BookReaderDemo/demo-preview-pages.html">Preview Pages</a></li>
|
|
19
19
|
<li><a href="BookReaderDemo/demo-embed.html">Embed</a></li>
|
|
20
20
|
<li><a href="BookReaderDemo/demo-multiple.html">Multiple on same page</a></li>
|
|
21
|
+
<!-- plugin.search.js -->
|
|
21
22
|
<li><a href="BookReaderDemo/demo-internetarchive.html?ocaid=theworksofplato01platiala">From Internet Archive</a></li>
|
|
23
|
+
<!-- plugin.search.js -->
|
|
22
24
|
<li><a href="BookReaderDemo/demo-internetarchive.html?ocaid=adventuresofoli00dick">From Internet Archive - a book with CHAPTERS</a></li>
|
|
23
25
|
<li><a href="BookReaderDemo/demo-iiif.html">IIIF</a></li>
|
|
24
26
|
<li><a href="BookReaderDemo/demo-autoplay.html">Autoplay (kiosk mode)</a></li>
|
|
25
27
|
<li><a href="BookReaderDemo/demo-plugin-menu-toggle.html">Plugin: Full screen menu toggle</a></li>
|
|
26
28
|
<li><a href="BookReaderDemo/immersion-mode.html">Start in immersion (fullscreen) mode</a></li>
|
|
29
|
+
<!-- plugin.search.js -->
|
|
27
30
|
<li><a href="BookReaderDemo/immersion-1up.html">Start in immersion mode on 1up default item</a></li>
|
|
28
31
|
<li><a href="BookReaderDemo/viewmode-cycle.html">Replace view mode buttons with view mode cycler</a></li>
|
|
29
32
|
</ul>
|
package/jsconfig.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es6",
|
|
4
|
+
"moduleResolution": "node",
|
|
5
|
+
"experimentalDecorators": true,
|
|
6
|
+
"baseUrl": ".",
|
|
7
|
+
"paths": {
|
|
8
|
+
"@/*": ["./*"]
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"include": [
|
|
12
|
+
"src/**/*.js",
|
|
13
|
+
"tests/**/*.js",
|
|
14
|
+
],
|
|
15
|
+
"exclude": [
|
|
16
|
+
"node_modules",
|
|
17
|
+
"BookReader"
|
|
18
|
+
]
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@internetarchive/bookreader",
|
|
3
|
-
"version": "5.0.0-
|
|
3
|
+
"version": "5.0.0-30-d",
|
|
4
4
|
"description": "The Internet Archive BookReader.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
|
-
"module": "src/
|
|
12
|
+
"module": "src/ia-bookreader/ia-bookreader.js",
|
|
13
13
|
"keywords": [
|
|
14
14
|
"online",
|
|
15
15
|
"bookreader",
|
|
@@ -26,35 +26,45 @@
|
|
|
26
26
|
"private": false,
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@internetarchive/ia-activity-indicator": "^0.0.1",
|
|
29
|
-
"@internetarchive/ia-
|
|
30
|
-
"@internetarchive/ia-menu-slider": "^
|
|
31
|
-
"@internetarchive/ia-sharing-options": "^0.1.
|
|
29
|
+
"@internetarchive/ia-item-navigator": "^0.0.4-4",
|
|
30
|
+
"@internetarchive/ia-menu-slider": "^1.1.1",
|
|
31
|
+
"@internetarchive/ia-sharing-options": "^0.1.4",
|
|
32
32
|
"@internetarchive/icon-bookmark": "^1.1.3",
|
|
33
33
|
"@internetarchive/icon-collapse-sidebar": "^1.1.0",
|
|
34
|
+
"@internetarchive/icon-dl": "^1.1.3",
|
|
34
35
|
"@internetarchive/icon-edit-pencil": "1.1.5",
|
|
35
36
|
"@internetarchive/icon-magnify-minus": "^1.2.3",
|
|
36
37
|
"@internetarchive/icon-magnify-plus": "^1.2.3",
|
|
37
38
|
"@internetarchive/icon-search": "^1.2.3",
|
|
39
|
+
"@internetarchive/icon-share": "^1.1.3",
|
|
40
|
+
"@internetarchive/icon-visual-adjustment": "^1.1.3",
|
|
38
41
|
"@internetarchive/modal-manager": "^0.1.0",
|
|
42
|
+
"@internetarchive/shared-resize-observer": "^0.0.1",
|
|
39
43
|
"lit-element": "^2.4.0",
|
|
40
44
|
"lit-html": "^1.3.0"
|
|
41
45
|
},
|
|
42
46
|
"devDependencies": {
|
|
43
|
-
"@babel/core": "7.
|
|
44
|
-
"@babel/
|
|
47
|
+
"@babel/core": "7.15.0",
|
|
48
|
+
"@babel/eslint-parser": "^7.15.7",
|
|
49
|
+
"@babel/plugin-proposal-class-properties": "^7.14.5",
|
|
50
|
+
"@babel/plugin-proposal-decorators": "^7.14.5",
|
|
51
|
+
"@babel/preset-env": "7.15.0",
|
|
45
52
|
"@open-wc/testing": "^2.5.33",
|
|
46
53
|
"@open-wc/testing-karma": "^4.0.9",
|
|
47
|
-
"@types/jest": "
|
|
54
|
+
"@types/jest": "27.0.1",
|
|
55
|
+
"@webcomponents/webcomponentsjs": "^2.6.0",
|
|
48
56
|
"babel-loader": "8.2.2",
|
|
49
|
-
"codecov": "3.8.
|
|
57
|
+
"codecov": "3.8.3",
|
|
50
58
|
"concurrently": "6.0.2",
|
|
51
|
-
"core-js": "3.
|
|
59
|
+
"core-js": "3.16.2",
|
|
52
60
|
"cpx2": "3.0.0",
|
|
53
|
-
"eslint": "7.
|
|
61
|
+
"eslint": "^7.32.0",
|
|
62
|
+
"eslint-plugin-no-jquery": "^2.6.0",
|
|
54
63
|
"eslint-plugin-testcafe": "0.2.1",
|
|
64
|
+
"hammerjs": "^2.0.8",
|
|
55
65
|
"http-server": "0.12.3",
|
|
56
|
-
"iso-language-codes": "1.0
|
|
57
|
-
"jest": "
|
|
66
|
+
"iso-language-codes": "1.1.0",
|
|
67
|
+
"jest": "27.0.6",
|
|
58
68
|
"jquery": "1.11.3",
|
|
59
69
|
"jquery-colorbox": "1.6.4",
|
|
60
70
|
"jquery-ui": "1.12.1",
|
|
@@ -64,26 +74,30 @@
|
|
|
64
74
|
"karma-coverage": "^2.0.3",
|
|
65
75
|
"live-server": "1.2.1",
|
|
66
76
|
"node-fetch": "2.6.1",
|
|
67
|
-
"regenerator-runtime": "0.13.
|
|
68
|
-
"sass": "1.
|
|
69
|
-
"sinon": "
|
|
77
|
+
"regenerator-runtime": "0.13.9",
|
|
78
|
+
"sass": "1.38.2",
|
|
79
|
+
"sinon": "11.1.2",
|
|
70
80
|
"soundmanager2": "2.97.20170602",
|
|
71
|
-
"svgo": "2.
|
|
72
|
-
"testcafe": "1.
|
|
73
|
-
"
|
|
74
|
-
"webpack
|
|
81
|
+
"svgo": "2.4.0",
|
|
82
|
+
"testcafe": "^1.16.1",
|
|
83
|
+
"testcafe-browser-provider-browserstack": "^1.13.2-alpha.1",
|
|
84
|
+
"webpack": "5.51.1",
|
|
85
|
+
"webpack-cli": "4.8.0"
|
|
75
86
|
},
|
|
76
87
|
"jest": {
|
|
88
|
+
"testEnvironment": "jsdom",
|
|
89
|
+
"transformIgnorePatterns": [
|
|
90
|
+
"node_modules/(?!(lit-html|lit-element|lit)/)"
|
|
91
|
+
],
|
|
92
|
+
"moduleNameMapper": {
|
|
93
|
+
"^@/(.*)$": "<rootDir>/$1"
|
|
94
|
+
},
|
|
77
95
|
"setupFiles": [
|
|
78
96
|
"./src/jquery-wrapper.js"
|
|
79
97
|
],
|
|
80
98
|
"roots": [
|
|
81
99
|
"<rootDir>/src/",
|
|
82
|
-
"<rootDir>/tests/"
|
|
83
|
-
],
|
|
84
|
-
"testPathIgnorePatterns": [
|
|
85
|
-
"<rootDir>/tests/e2e/",
|
|
86
|
-
"<rootDir>/tests/karma/"
|
|
100
|
+
"<rootDir>/tests/jest/"
|
|
87
101
|
],
|
|
88
102
|
"coverageDirectory": "<rootDir>/coverage-jest"
|
|
89
103
|
},
|
|
@@ -105,12 +119,16 @@
|
|
|
105
119
|
"serve-live": "npx live-server . --port 8000 --watch=index.html,BookReader,BookReaderDemo",
|
|
106
120
|
"serve-dev": "npm run build-css && npx concurrently --kill-others npm:serve-live npm:build-*:watch",
|
|
107
121
|
"test": "npm run test-jest && npm run test-karma",
|
|
108
|
-
"test:e2e": "npm run build &&
|
|
109
|
-
"test:e2e:dev": "
|
|
122
|
+
"test:e2e": "npm run build && npx testcafe",
|
|
123
|
+
"test:e2e:dev": "npx testcafe --live --dev",
|
|
110
124
|
"test-jest:watch": "npx jest --watch",
|
|
111
125
|
"test-jest": "npx jest --coverage --colors",
|
|
112
126
|
"test-karma": "npx karma start --coverage",
|
|
113
127
|
"test-karma:watch": "npx karma start --auto-watch=true --single-run=false",
|
|
128
|
+
"DOCS:update:test-deps": "If CI succeeds, these should be good to update",
|
|
129
|
+
"update:test-deps": "npm i @babel/eslint-parser@latest @open-wc/testing@latest @open-wc/testing-karma@latest @types/jest@latest codecov@latest eslint@latest eslint-plugin-testcafe@latest jest@latest karma-coverage@latest sinon@latest testcafe@latest",
|
|
130
|
+
"DOCS:update:build-deps": "These can cause strange changes, so do an npm run build + check file size (git diff --stat), and check the site is as expected",
|
|
131
|
+
"update:build-deps": "npm i @babel/core@latest @babel/preset-env@latest babel-loader@latest core-js@latest regenerator-runtime@latest sass@latest svgo@latest webpack@latest webpack-cli@latest",
|
|
114
132
|
"codecov": "npx codecov"
|
|
115
133
|
}
|
|
116
134
|
}
|
|
@@ -24,8 +24,10 @@ export default css`
|
|
|
24
24
|
user-select: none;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
.ia-button.link
|
|
27
|
+
.ia-button.link,
|
|
28
|
+
.ia-button.external {
|
|
28
29
|
min-height: unset;
|
|
30
|
+
text-decoration: none;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
.ia-button:disabled,
|
|
@@ -51,4 +53,9 @@ export default css`
|
|
|
51
53
|
background-color: var(--primaryErrorCTAFill);
|
|
52
54
|
border-color: var(--primaryErrorCTABorder);
|
|
53
55
|
}
|
|
56
|
+
|
|
57
|
+
.ia-button.external {
|
|
58
|
+
background: var(--secondaryCTAFill);
|
|
59
|
+
border-color: var(--secondaryCTABorder);
|
|
60
|
+
}
|
|
54
61
|
`;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { svg } from 'lit-element';
|
|
2
|
+
|
|
3
|
+
export default svg`
|
|
4
|
+
<svg class="ia-logo" width="27" height="30" viewBox="0 0 27 30" xmlns="http://www.w3.org/2000/svg" aria-labelledby="logoTitleID logoDescID">
|
|
5
|
+
<title id="logoTitleID">Internet Archive logo</title>
|
|
6
|
+
<desc id="logoDescID">A line drawing of the Internet Archive headquarters building façade.</desc>
|
|
7
|
+
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
8
|
+
<mask id="mask-2" fill="white">
|
|
9
|
+
<path d="M26.6666667,28.6046512 L26.6666667,30 L0,30 L0.000283687943,28.6046512 L26.6666667,28.6046512 Z M25.6140351,26.5116279 L25.6140351,28.255814 L1.05263158,28.255814 L1.05263158,26.5116279 L25.6140351,26.5116279 Z M3.62469203,7.6744186 L3.91746909,7.82153285 L4.0639977,10.1739544 L4.21052632,13.9963932 L4.21052632,17.6725617 L4.0639977,22.255044 L4.03962296,25.3421929 L3.62469203,25.4651163 L2.16024641,25.4651163 L1.72094074,25.3421929 L1.55031755,22.255044 L1.40350877,17.6970339 L1.40350877,14.0211467 L1.55031755,10.1739544 L1.68423854,7.80887484 L1.98962322,7.6744186 L3.62469203,7.6744186 Z M24.6774869,7.6744186 L24.9706026,7.82153285 L25.1168803,10.1739544 L25.2631579,13.9963932 L25.2631579,17.6725617 L25.1168803,22.255044 L25.0927809,25.3421929 L24.6774869,25.4651163 L23.2130291,25.4651163 L22.7736357,25.3421929 L22.602418,22.255044 L22.4561404,17.6970339 L22.4561404,14.0211467 L22.602418,10.1739544 L22.7369262,7.80887484 L23.0420916,7.6744186 L24.6774869,7.6744186 Z M9.94042303,7.6744186 L10.2332293,7.82153285 L10.3797725,10.1739544 L10.5263158,13.9963932 L10.5263158,17.6725617 L10.3797725,22.255044 L10.3556756,25.3421929 L9.94042303,25.4651163 L8.47583122,25.4651163 L8.0362015,25.3421929 L7.86556129,22.255044 L7.71929825,17.6970339 L7.71929825,14.0211467 L7.86556129,10.1739544 L8.00005604,7.80887484 L8.30491081,7.6744186 L9.94042303,7.6744186 Z M18.0105985,7.6744186 L18.3034047,7.82153285 L18.449948,10.1739544 L18.5964912,13.9963932 L18.5964912,17.6725617 L18.449948,22.255044 L18.425851,25.3421929 L18.0105985,25.4651163 L16.5460067,25.4651163 L16.1066571,25.3421929 L15.9357367,22.255044 L15.7894737,17.6970339 L15.7894737,14.0211467 L15.9357367,10.1739544 L16.0702315,7.80887484 L16.3753664,7.6744186 L18.0105985,7.6744186 Z M25.6140351,4.53488372 L25.6140351,6.97674419 L1.05263158,6.97674419 L1.05263158,4.53488372 L25.6140351,4.53488372 Z M13.0806755,0 L25.9649123,2.93331338 L25.4484139,3.8372093 L0.771925248,3.8372093 L0,3.1041615 L13.0806755,0 Z" id="path-1"></path>
|
|
10
|
+
</mask>
|
|
11
|
+
<use fill="#FFFFFF" xlink:href="#path-1"></use>
|
|
12
|
+
<g mask="url(#mask-2)" fill="#FFFFFF">
|
|
13
|
+
<path d="M0,0 L26.6666667,0 L26.6666667,30 L0,30 L0,0 Z" id="swatch"></path>
|
|
14
|
+
</g>
|
|
15
|
+
</g>
|
|
16
|
+
</svg>
|
|
17
|
+
`;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
|
|
3
|
+
export default html`
|
|
4
|
+
<svg name="sort-asc" height="18" viewBox="0 0 18 18" width="18" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z" fill="#fff" fill-rule="nonzero"/><path d="m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z" fill="#fff" fill-rule="nonzero"/><path d="m10.3846154 11.0769231 2.7692308 5.5384615 2.7692307-5.5384615m-2.7692307 4.1538461v-13.15384612" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.661538" transform="matrix(1 0 0 -1 0 18.692308)"/></g></svg>
|
|
5
|
+
`;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
|
|
3
|
+
export default html`
|
|
4
|
+
<svg name="sort-desc" height="18" viewBox="0 0 18 18" width="18" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z" fill="#fff" fill-rule="nonzero"/><path d="m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z" fill="#fff" fill-rule="nonzero"/><path d="m10.3846154 11.0769231 2.7692308 5.5384615 2.7692307-5.5384615m-2.7692307 4.1538461v-13.15384612" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.661538"/></g></svg>
|
|
5
|
+
`;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
|
|
3
|
+
export default html`
|
|
4
|
+
<svg name="sort-neutral" height="18" viewBox="0 0 18 18" width="18" xmlns="http://www.w3.org/2000/svg"><g fill="#fff" fill-rule="evenodd"><path d="m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z" fill-rule="nonzero"/><path d="m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z" fill-rule="nonzero"/><circle cx="13" cy="9" r="2"/></g></svg>
|
|
5
|
+
`;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { html } from 'lit-html';
|
|
2
|
+
|
|
3
|
+
export default html`
|
|
4
|
+
<svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" aria-labelledby="volumesTitleID volumesDescID">
|
|
5
|
+
<title id="volumesTitleID">Volumes icon</title>
|
|
6
|
+
<desc id="volumesDescID">Three books stacked on each other</desc>
|
|
7
|
+
<g fill="#ffffff">
|
|
8
|
+
<path fill="#ffffff" d="m9.83536396 0h10.07241114c.1725502.47117517.3378411.76385809.4958725.87804878.1295523.11419069.3199719.1998337.5712586.25692905.2512868.05709534.4704647.08564301.6575337.08564301h.2806036v15.24362526h-4.3355343v3.8106985h-4.44275v3.7250554h-12.01318261c-.27306495 0-.50313194-.085643-.69020098-.256929-.18706903-.1712861-.30936193-.3425721-.36687867-.5138581l-.06449694-.2785477v-14.2159091c0-.32815965.08627512-.5922949.25882537-.79240577.17255024-.20011086.34510049-.32150776.51765073-.36419068l.25882537-.0640244h3.36472977v-2.54767184c0-.31374722.08627513-.57067627.25882537-.77078714.17255025-.20011086.34510049-.32150776.51765074-.36419068l.25882536-.06402439h3.36472978v-2.56929047c0-.32815964.08627512-.5922949.25882537-.79240576.17255024-.20011087.34510049-.31430156.51765073-.34257207zm10.78355264 15.6294346v-13.53076498c-.2730649-.08536585-.4456152-.16380266-.5176507-.23531042-.1725502-.1424612-.2730649-.27078714-.3015441-.38497783v13.36031043h-9.87808272c0 .0144124-.02149898.0144124-.06449694 0-.04299795-.0144124-.08962561.006929-.13988296.0640244-.05025735.0570953-.07538603.1427383-.07538603.256929s.02149898.210643.06449694.289357c.04299795.078714.08599591.1322062.12899387.1604767l.06449693.0216187h10.71905571zm-10.2449613-2.4412417h7.98003v-11.60421286h-7.98003zm1.6827837-9.41990022h4.6153002c.1725502 0 .3199718.05349224.4422647.16047672s.1834393.23891353.1834393.39578714c0 .15687362-.0611464.28519956-.1834393.38497783s-.2697145.1496674-.4422647.1496674h-4.6153002c-.1725503 0-.3199719-.04988913-.4422647-.1496674-.1222929-.09977827-.1834394-.22810421-.1834394-.38497783 0-.15687361.0611465-.28880266.1834394-.39578714.1222928-.10698448.2697144-.16047672.4422647-.16047672zm-6.08197737 13.50997782h7.72120467v-.8131929h-3.79610541c-.27306495 0-.49950224-.085643-.67931188-.256929-.17980964-.1712861-.29847284-.3425721-.35598958-.5138581l-.06449694-.2785477v-10.02023282h-2.82530086zm6.77217827-11.36890243h3.2139578c.1295522 0 .240956.05709534.3342113.17128603.0932554.11419069.139883.24972284.139883.40659645 0 .15687362-.0466276.28880267-.139883.39578714-.0932553.10698448-.2046591.16047672-.3342113.16047672h-3.2139578c-.1295523 0-.2373264-.05349224-.3233223-.16047672-.0859959-.10698447-.1289938-.23891352-.1289938-.39578714 0-.15687361.0429979-.29240576.1289938-.40659645s.19377-.17128603.3233223-.17128603zm-11.15043132 15.11557653h7.69942646v-.7491685h-3.79610539c-.25854616 0-.48135376-.0892462-.66842279-.2677384-.18706904-.1784922-.30936193-.3605876-.36687868-.546286l-.06449694-.2569291v-10.04101994h-2.80352266zm14.62237682-4.5606985h-.8191949v2.1410754h-9.89986085s-.04299796.0285477-.12899387.085643c-.08599592.0570954-.12201369.1427384-.10805331.2569291 0 .1141907.01786928.210643.05360784.289357.03573856.0787139.07538603.125.1189424.138858l.06449694.0432373h10.71905575v-2.9542683zm-4.3991936 3.8106985h-.8191949v2.077051h-9.8563045c0 .0144124-.02149898.0144124-.06449694 0-.04299795-.0144125-.08962561.0105321-.13988296.0748337-.05025735.0643015-.07538603.1607538-.07538603.289357 0 .1141906.02149898.2070399.06449694.2785476.04299795.0715078.08599591.1141907.12899387.1280488l.06449693.0216186h10.69811519v-2.8686252z" />
|
|
9
|
+
</g>
|
|
10
|
+
</svg>
|
|
11
|
+
`;
|