@internetarchive/bookreader 5.0.0-18
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 +58 -0
- package/.gitattributes +2 -0
- package/.github/ISSUE_TEMPLATE/bug.md +32 -0
- package/.github/ISSUE_TEMPLATE/feature-request.md +30 -0
- package/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +15 -0
- package/.github/dependabot.yml +8 -0
- package/.github/workflows/node.js.yml +37 -0
- package/.github/workflows/npm-publish.yml +47 -0
- package/.testcaferc.json +5 -0
- package/BookReader/BookReader.css +2983 -0
- package/BookReader/BookReader.js +3 -0
- package/BookReader/BookReader.js.LICENSE.txt +117 -0
- package/BookReader/BookReader.js.map +1 -0
- package/BookReader/bookreader-component-bundle.js +1436 -0
- package/BookReader/bookreader-component-bundle.js.LICENSE.txt +27 -0
- package/BookReader/bookreader-component-bundle.js.map +1 -0
- package/BookReader/icons/1up.svg +1 -0
- package/BookReader/icons/2up.svg +1 -0
- package/BookReader/icons/advance.svg +3 -0
- package/BookReader/icons/chevron-right.svg +1 -0
- package/BookReader/icons/close-circle-dark.svg +1 -0
- package/BookReader/icons/close-circle.svg +1 -0
- package/BookReader/icons/fullscreen.svg +1 -0
- package/BookReader/icons/fullscreen_exit.svg +1 -0
- package/BookReader/icons/hamburger.svg +1 -0
- package/BookReader/icons/left-arrow.svg +1 -0
- package/BookReader/icons/magnify-minus.svg +1 -0
- package/BookReader/icons/magnify-plus.svg +1 -0
- package/BookReader/icons/magnify.svg +1 -0
- package/BookReader/icons/pause.svg +1 -0
- package/BookReader/icons/play.svg +1 -0
- package/BookReader/icons/playback-speed.svg +1 -0
- package/BookReader/icons/read-aloud.svg +1 -0
- package/BookReader/icons/review.svg +3 -0
- package/BookReader/icons/thumbnails.svg +1 -0
- package/BookReader/icons/volume-full.svg +1 -0
- package/BookReader/images/BRicons.png +0 -0
- package/BookReader/images/BRicons.svg +5 -0
- package/BookReader/images/BRicons_ia.png +0 -0
- package/BookReader/images/back_pages.png +0 -0
- package/BookReader/images/book_bottom_icon.png +0 -0
- package/BookReader/images/book_down_icon.png +0 -0
- package/BookReader/images/book_left_icon.png +0 -0
- package/BookReader/images/book_leftmost_icon.png +0 -0
- package/BookReader/images/book_right_icon.png +0 -0
- package/BookReader/images/book_rightmost_icon.png +0 -0
- package/BookReader/images/book_top_icon.png +0 -0
- package/BookReader/images/book_up_icon.png +0 -0
- package/BookReader/images/books_graphic.svg +1 -0
- package/BookReader/images/booksplit.png +0 -0
- package/BookReader/images/control_pause_icon.png +0 -0
- package/BookReader/images/control_play_icon.png +0 -0
- package/BookReader/images/embed_icon.png +0 -0
- package/BookReader/images/icon-home-ia.png +0 -0
- package/BookReader/images/icon_OL-logo-xs.png +0 -0
- package/BookReader/images/icon_alert-xs.png +0 -0
- package/BookReader/images/icon_book.svg +1 -0
- package/BookReader/images/icon_bookmark.svg +1 -0
- package/BookReader/images/icon_close-pop.png +0 -0
- package/BookReader/images/icon_download.png +0 -0
- package/BookReader/images/icon_gear.svg +1 -0
- package/BookReader/images/icon_hamburger.svg +1 -0
- package/BookReader/images/icon_home.png +0 -0
- package/BookReader/images/icon_home.svg +1 -0
- package/BookReader/images/icon_home_ia.png +0 -0
- package/BookReader/images/icon_indicator.png +0 -0
- package/BookReader/images/icon_info.svg +1 -0
- package/BookReader/images/icon_one_page.svg +1 -0
- package/BookReader/images/icon_pause.svg +1 -0
- package/BookReader/images/icon_play.svg +1 -0
- package/BookReader/images/icon_playback-rate.svg +1 -0
- package/BookReader/images/icon_return.png +0 -0
- package/BookReader/images/icon_search_button.svg +1 -0
- package/BookReader/images/icon_share.svg +1 -0
- package/BookReader/images/icon_skip-ahead.svg +1 -0
- package/BookReader/images/icon_skip-back.svg +2 -0
- package/BookReader/images/icon_speaker.svg +1 -0
- package/BookReader/images/icon_speaker_open.svg +1 -0
- package/BookReader/images/icon_thumbnails.svg +1 -0
- package/BookReader/images/icon_toc.svg +1 -0
- package/BookReader/images/icon_two_pages.svg +1 -0
- package/BookReader/images/icon_zoomer.png +0 -0
- package/BookReader/images/loading.gif +0 -0
- package/BookReader/images/logo_icon.png +0 -0
- package/BookReader/images/marker_chap-off.png +0 -0
- package/BookReader/images/marker_chap-off.svg +1 -0
- package/BookReader/images/marker_chap-off_ia.png +0 -0
- package/BookReader/images/marker_chap-on.png +0 -0
- package/BookReader/images/marker_chap-on.svg +1 -0
- package/BookReader/images/marker_srch-on.svg +1 -0
- package/BookReader/images/marker_srchchap-off.png +0 -0
- package/BookReader/images/marker_srchchap-on.png +0 -0
- package/BookReader/images/nav_control-dn.png +0 -0
- package/BookReader/images/nav_control-dn_ia.png +0 -0
- package/BookReader/images/nav_control-up.png +0 -0
- package/BookReader/images/nav_control-up_ia.png +0 -0
- package/BookReader/images/nav_control.png +0 -0
- package/BookReader/images/one_page_mode_icon.png +0 -0
- package/BookReader/images/paper-badge.png +0 -0
- package/BookReader/images/print_icon.png +0 -0
- package/BookReader/images/progressbar.gif +0 -0
- package/BookReader/images/right_edges.png +0 -0
- package/BookReader/images/slider.png +0 -0
- package/BookReader/images/slider_ia.png +0 -0
- package/BookReader/images/thumbnail_mode_icon.png +0 -0
- package/BookReader/images/transparent.png +0 -0
- package/BookReader/images/two_page_mode_icon.png +0 -0
- package/BookReader/images/zoom_in_icon.png +0 -0
- package/BookReader/images/zoom_out_icon.png +0 -0
- package/BookReader/jquery-1.10.1.js +2 -0
- package/BookReader/jquery-1.10.1.js.LICENSE.txt +24 -0
- package/BookReader/plugins/plugin.archive_analytics.js +2 -0
- package/BookReader/plugins/plugin.archive_analytics.js.map +1 -0
- package/BookReader/plugins/plugin.autoplay.js +2 -0
- package/BookReader/plugins/plugin.autoplay.js.map +1 -0
- package/BookReader/plugins/plugin.chapters.js +2 -0
- package/BookReader/plugins/plugin.chapters.js.map +1 -0
- package/BookReader/plugins/plugin.iframe.js +2 -0
- package/BookReader/plugins/plugin.iframe.js.map +1 -0
- package/BookReader/plugins/plugin.mobile_nav.js +2 -0
- package/BookReader/plugins/plugin.mobile_nav.js.map +1 -0
- package/BookReader/plugins/plugin.resume.js +2 -0
- package/BookReader/plugins/plugin.resume.js.map +1 -0
- package/BookReader/plugins/plugin.search.js +2 -0
- package/BookReader/plugins/plugin.search.js.map +1 -0
- package/BookReader/plugins/plugin.text_selection.js +2 -0
- package/BookReader/plugins/plugin.text_selection.js.map +1 -0
- package/BookReader/plugins/plugin.tts.js +3 -0
- package/BookReader/plugins/plugin.tts.js.LICENSE.txt +27 -0
- package/BookReader/plugins/plugin.tts.js.map +1 -0
- package/BookReader/plugins/plugin.url.js +2 -0
- package/BookReader/plugins/plugin.url.js.map +1 -0
- package/BookReader/plugins/plugin.vendor-fullscreen.js +2 -0
- package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -0
- package/BookReaderDemo/BookReaderDemo.css +41 -0
- package/BookReaderDemo/BookReaderJSAdvanced.js +115 -0
- package/BookReaderDemo/BookReaderJSAutoplay.js +56 -0
- package/BookReaderDemo/BookReaderJSSimple.js +55 -0
- package/BookReaderDemo/IIIFBookReader.js +207 -0
- package/BookReaderDemo/assets/v5/Bookreader-logo-cool-grad.svg +1 -0
- package/BookReaderDemo/assets/v5/Bookreader-logo-flat.svg +1 -0
- package/BookReaderDemo/assets/v5/Bookreader-logo-hex-cool-grad.png +0 -0
- package/BookReaderDemo/assets/v5/Bookreader-logo-hex-flat.png +0 -0
- package/BookReaderDemo/assets/v5/Bookreader-logo-lines.png +0 -0
- package/BookReaderDemo/assets/v5/Bookreader-logo-lines.svg +1 -0
- package/BookReaderDemo/assets/v5/Bookreader-logo-warm.svg +1 -0
- package/BookReaderDemo/assets/v5/bookreader-logo-renders@1x.png +0 -0
- package/BookReaderDemo/assets/v5/bookreader-logo-renders@2x.png +0 -0
- package/BookReaderDemo/assets/v5/bookreader-v5-screenshot.png +0 -0
- package/BookReaderDemo/bookreader-template-bundle.js +7178 -0
- package/BookReaderDemo/demo-advanced.html +32 -0
- package/BookReaderDemo/demo-autoplay.html +38 -0
- package/BookReaderDemo/demo-embed-iframe-src.html +84 -0
- package/BookReaderDemo/demo-embed.html +26 -0
- package/BookReaderDemo/demo-fullscreen-mobile.html +36 -0
- package/BookReaderDemo/demo-fullscreen.html +33 -0
- package/BookReaderDemo/demo-iiif.html +34 -0
- package/BookReaderDemo/demo-iiif.js +26 -0
- package/BookReaderDemo/demo-internetarchive.html +74 -0
- package/BookReaderDemo/demo-multiple.html +43 -0
- package/BookReaderDemo/demo-preview-pages.html +1092 -0
- package/BookReaderDemo/demo-simple.html +34 -0
- package/BookReaderDemo/demo-vendor-fullscreen.html +36 -0
- package/BookReaderDemo/immersion-1up.html +64 -0
- package/BookReaderDemo/immersion-mode.html +35 -0
- package/BookReaderDemo/toggle_controls.html +53 -0
- package/BookReaderDemo/view_mode.html +39 -0
- package/BookReaderDemo/viewmode-cycle.html +41 -0
- package/CHANGELOG.md +540 -0
- package/CONTRIBUTING.md +7 -0
- package/LICENSE +661 -0
- package/README.md +205 -0
- package/babel.config.js +18 -0
- package/codecov.yml +17 -0
- package/index.html +31 -0
- package/jsconfig.json +14 -0
- package/karma.conf.js +23 -0
- package/package.json +129 -0
- package/screenshot.png +0 -0
- package/scripts/postversion.js +10 -0
- package/scripts/preversion.js +14 -0
- package/scripts/version.js +26 -0
- package/src/BookNavigator/BookModel.js +14 -0
- package/src/BookNavigator/BookNavigator.js +468 -0
- package/src/BookNavigator/assets/book-loader.js +27 -0
- package/src/BookNavigator/assets/bookmark-colors.js +15 -0
- package/src/BookNavigator/assets/button-base.js +61 -0
- package/src/BookNavigator/assets/icon_checkmark.js +6 -0
- package/src/BookNavigator/assets/icon_close.js +3 -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/bookmarks/bookmark-button.js +64 -0
- package/src/BookNavigator/bookmarks/bookmark-edit.js +215 -0
- package/src/BookNavigator/bookmarks/bookmarks-list.js +285 -0
- package/src/BookNavigator/bookmarks/bookmarks-loginCTA.js +28 -0
- package/src/BookNavigator/bookmarks/bookmarks-provider.js +53 -0
- package/src/BookNavigator/bookmarks/ia-bookmarks.js +500 -0
- package/src/BookNavigator/br-fullscreen-mgr.js +83 -0
- package/src/BookNavigator/delete-modal-actions.js +49 -0
- package/src/BookNavigator/downloads/downloads-provider.js +76 -0
- package/src/BookNavigator/downloads/downloads.js +138 -0
- package/src/BookNavigator/search/a-search-result.js +55 -0
- package/src/BookNavigator/search/search-provider.js +180 -0
- package/src/BookNavigator/search/search-results.js +360 -0
- package/src/BookNavigator/visual-adjustments/visual-adjustments-provider.js +93 -0
- package/src/BookNavigator/visual-adjustments/visual-adjustments.js +280 -0
- package/src/BookNavigator/volumes/volumes-provider.js +83 -0
- package/src/BookNavigator/volumes/volumes.js +178 -0
- package/src/BookReader/BookModel.js +518 -0
- package/src/BookReader/DebugConsole.js +54 -0
- package/src/BookReader/ImageCache.js +116 -0
- package/src/BookReader/Mode1Up.js +90 -0
- package/src/BookReader/Mode1UpLit.js +434 -0
- package/src/BookReader/Mode2Up.js +1372 -0
- package/src/BookReader/ModeSmoothZoom.js +177 -0
- package/src/BookReader/ModeThumb.js +336 -0
- package/src/BookReader/Navbar/Navbar.js +339 -0
- package/src/BookReader/PageContainer.js +120 -0
- package/src/BookReader/ReduceSet.js +26 -0
- package/src/BookReader/Toolbar/Toolbar.js +384 -0
- package/src/BookReader/events.js +20 -0
- package/src/BookReader/options.js +320 -0
- package/src/BookReader/utils/HTMLDimensionsCacher.js +44 -0
- package/src/BookReader/utils/classes.js +36 -0
- package/src/BookReader/utils.js +240 -0
- package/src/BookReader.js +2546 -0
- package/src/BookReaderComponent/BookReaderComponent.js +112 -0
- package/src/ItemNavigator/ItemNavigator.js +376 -0
- package/src/ItemNavigator/providers/sharing.js +33 -0
- package/src/assets/icons/1up.svg +12 -0
- package/src/assets/icons/2up.svg +15 -0
- package/src/assets/icons/advance.svg +26 -0
- package/src/assets/icons/chevron-right.svg +1 -0
- package/src/assets/icons/close-circle-dark.svg +1 -0
- package/src/assets/icons/close-circle.svg +1 -0
- package/src/assets/icons/fullscreen.svg +17 -0
- package/src/assets/icons/fullscreen_exit.svg +17 -0
- package/src/assets/icons/hamburger.svg +15 -0
- package/src/assets/icons/left-arrow.svg +12 -0
- package/src/assets/icons/magnify-minus.svg +16 -0
- package/src/assets/icons/magnify-plus.svg +17 -0
- package/src/assets/icons/magnify.svg +15 -0
- package/src/assets/icons/pause.svg +23 -0
- package/src/assets/icons/play.svg +22 -0
- package/src/assets/icons/playback-speed.svg +34 -0
- package/src/assets/icons/read-aloud.svg +22 -0
- package/src/assets/icons/review.svg +22 -0
- package/src/assets/icons/thumbnails.svg +17 -0
- package/src/assets/icons/volume-full.svg +22 -0
- package/src/assets/images/BRicons.png +0 -0
- package/src/assets/images/BRicons.svg +94 -0
- package/src/assets/images/BRicons_ia.png +0 -0
- package/src/assets/images/back_pages.png +0 -0
- package/src/assets/images/book_bottom_icon.png +0 -0
- package/src/assets/images/book_down_icon.png +0 -0
- package/src/assets/images/book_left_icon.png +0 -0
- package/src/assets/images/book_leftmost_icon.png +0 -0
- package/src/assets/images/book_right_icon.png +0 -0
- package/src/assets/images/book_rightmost_icon.png +0 -0
- package/src/assets/images/book_top_icon.png +0 -0
- package/src/assets/images/book_up_icon.png +0 -0
- package/src/assets/images/books_graphic.svg +177 -0
- package/src/assets/images/booksplit.png +0 -0
- package/src/assets/images/control_pause_icon.png +0 -0
- package/src/assets/images/control_play_icon.png +0 -0
- package/src/assets/images/embed_icon.png +0 -0
- package/src/assets/images/icon-home-ia.png +0 -0
- package/src/assets/images/icon_OL-logo-xs.png +0 -0
- package/src/assets/images/icon_alert-xs.png +0 -0
- package/src/assets/images/icon_book.svg +12 -0
- package/src/assets/images/icon_bookmark.svg +12 -0
- package/src/assets/images/icon_close-pop.png +0 -0
- package/src/assets/images/icon_download.png +0 -0
- package/src/assets/images/icon_gear.svg +14 -0
- package/src/assets/images/icon_hamburger.svg +20 -0
- package/src/assets/images/icon_home.png +0 -0
- package/src/assets/images/icon_home.svg +21 -0
- package/src/assets/images/icon_home_ia.png +0 -0
- package/src/assets/images/icon_indicator.png +0 -0
- package/src/assets/images/icon_info.svg +11 -0
- package/src/assets/images/icon_one_page.svg +8 -0
- package/src/assets/images/icon_pause.svg +1 -0
- package/src/assets/images/icon_play.svg +1 -0
- package/src/assets/images/icon_playback-rate.svg +15 -0
- package/src/assets/images/icon_return.png +0 -0
- package/src/assets/images/icon_search_button.svg +8 -0
- package/src/assets/images/icon_share.svg +9 -0
- package/src/assets/images/icon_skip-ahead.svg +6 -0
- package/src/assets/images/icon_skip-back.svg +13 -0
- package/src/assets/images/icon_speaker.svg +18 -0
- package/src/assets/images/icon_speaker_open.svg +10 -0
- package/src/assets/images/icon_thumbnails.svg +12 -0
- package/src/assets/images/icon_toc.svg +5 -0
- package/src/assets/images/icon_two_pages.svg +9 -0
- package/src/assets/images/icon_zoomer.png +0 -0
- package/src/assets/images/loading.gif +0 -0
- package/src/assets/images/logo_icon.png +0 -0
- package/src/assets/images/marker_chap-off.png +0 -0
- package/src/assets/images/marker_chap-off.svg +11 -0
- package/src/assets/images/marker_chap-off_ia.png +0 -0
- package/src/assets/images/marker_chap-on.png +0 -0
- package/src/assets/images/marker_chap-on.svg +11 -0
- package/src/assets/images/marker_srch-on.svg +11 -0
- package/src/assets/images/marker_srchchap-off.png +0 -0
- package/src/assets/images/marker_srchchap-on.png +0 -0
- package/src/assets/images/nav_control-dn.png +0 -0
- package/src/assets/images/nav_control-dn_ia.png +0 -0
- package/src/assets/images/nav_control-up.png +0 -0
- package/src/assets/images/nav_control-up_ia.png +0 -0
- package/src/assets/images/nav_control.png +0 -0
- package/src/assets/images/one_page_mode_icon.png +0 -0
- package/src/assets/images/paper-badge.png +0 -0
- package/src/assets/images/print_icon.png +0 -0
- package/src/assets/images/progressbar.gif +0 -0
- package/src/assets/images/right_edges.png +0 -0
- package/src/assets/images/slider.png +0 -0
- package/src/assets/images/slider_ia.png +0 -0
- package/src/assets/images/thumbnail_mode_icon.png +0 -0
- package/src/assets/images/transparent.png +0 -0
- package/src/assets/images/two_page_mode_icon.png +0 -0
- package/src/assets/images/zoom_in_icon.png +0 -0
- package/src/assets/images/zoom_out_icon.png +0 -0
- package/src/css/BookReader.scss +89 -0
- package/src/css/_BRBookmarks.scss +29 -0
- package/src/css/_BRComponent.scss +13 -0
- package/src/css/_BRfloat.scss +197 -0
- package/src/css/_BRicon.scss +48 -0
- package/src/css/_BRmain.scss +251 -0
- package/src/css/_BRnav.scss +382 -0
- package/src/css/_BRpages.scss +139 -0
- package/src/css/_BRsearch.scss +226 -0
- package/src/css/_BRtoolbar.scss +84 -0
- package/src/css/_BRvendor.scss +5 -0
- package/src/css/_MobileNav.scss +194 -0
- package/src/css/_TextSelection.scss +32 -0
- package/src/css/_colorbox.scss +52 -0
- package/src/css/_controls.scss +244 -0
- package/src/css/_icons.scss +121 -0
- package/src/dragscrollable-br.js +261 -0
- package/src/jquery-wrapper.js +4 -0
- package/src/plugins/plugin.archive_analytics.js +86 -0
- package/src/plugins/plugin.autoplay.js +129 -0
- package/src/plugins/plugin.chapters.js +251 -0
- package/src/plugins/plugin.iframe.js +48 -0
- package/src/plugins/plugin.mobile_nav.js +287 -0
- package/src/plugins/plugin.resume.js +68 -0
- package/src/plugins/plugin.text_selection.js +291 -0
- package/src/plugins/plugin.url.js +198 -0
- package/src/plugins/plugin.vendor-fullscreen.js +247 -0
- package/src/plugins/search/plugin.search.js +439 -0
- package/src/plugins/search/view.js +440 -0
- package/src/plugins/tts/AbstractTTSEngine.js +242 -0
- package/src/plugins/tts/FestivalTTSEngine.js +169 -0
- package/src/plugins/tts/PageChunk.js +107 -0
- package/src/plugins/tts/PageChunkIterator.js +163 -0
- package/src/plugins/tts/WebTTSEngine.js +352 -0
- package/src/plugins/tts/plugin.tts.js +335 -0
- package/src/plugins/tts/tooltip_dict.js +15 -0
- package/src/plugins/tts/utils.js +91 -0
- package/src/util/browserSniffing.js +30 -0
- package/src/util/debouncer.js +26 -0
- package/src/util/docCookies.js +67 -0
- package/src/util/strings.js +34 -0
- package/tests/BookReader/BookModel.test.js +312 -0
- package/tests/BookReader/BookReaderPublicFunctions.test.js +164 -0
- package/tests/BookReader/DebugConsole.test.js +25 -0
- package/tests/BookReader/ImageCache.test.js +150 -0
- package/tests/BookReader/Mode1UpLit.test.js +87 -0
- package/tests/BookReader/Mode2Up.test.js +245 -0
- package/tests/BookReader/ModeSmoothZoom.test.js +149 -0
- package/tests/BookReader/Navbar/Navbar.test.js +169 -0
- package/tests/BookReader/PageContainer.test.js +187 -0
- package/tests/BookReader/ReduceSet.test.js +38 -0
- package/tests/BookReader/Toolbar/Toolbar.test.js +26 -0
- package/tests/BookReader/utils/HTMLDimensionsCacher.test.js +59 -0
- package/tests/BookReader/utils/classes.test.js +88 -0
- package/tests/BookReader/utils.test.js +136 -0
- package/tests/BookReader.options.test.js +39 -0
- package/tests/BookReader.test.js +301 -0
- package/tests/e2e/README.md +75 -0
- package/tests/e2e/autoplay.test.js +13 -0
- package/tests/e2e/base.test.js +35 -0
- package/tests/e2e/helpers/base.js +263 -0
- package/tests/e2e/helpers/debug.js +13 -0
- package/tests/e2e/helpers/desktopSearch.js +72 -0
- package/tests/e2e/helpers/mobileSearch.js +85 -0
- package/tests/e2e/helpers/mockSearch.js +93 -0
- package/tests/e2e/helpers/rightToLeft.js +29 -0
- package/tests/e2e/ia-production/ia-prod-base.js +17 -0
- package/tests/e2e/models/BookReader.js +11 -0
- package/tests/e2e/models/Navigation.js +56 -0
- package/tests/e2e/rightToLeft.test.js +20 -0
- package/tests/e2e/viewmode.test.js +37 -0
- package/tests/karma/BookNavigator/book-navigator.test.js +180 -0
- package/tests/karma/BookNavigator/bookmarks/bookmark-edit.test.js +133 -0
- package/tests/karma/BookNavigator/bookmarks/bookmarks-list.test.js +222 -0
- package/tests/karma/BookNavigator/downloads/downloads-provider.test.js +64 -0
- package/tests/karma/BookNavigator/downloads/downloads.test.js +54 -0
- package/tests/karma/BookNavigator/search/search-provider.test.js +23 -0
- package/tests/karma/BookNavigator/search/search-results.test.js +240 -0
- package/tests/karma/BookNavigator/sharing/sharing-provider.test.js +40 -0
- package/tests/karma/BookNavigator/visual-adjustments.test.js +201 -0
- package/tests/karma/BookNavigator/volumes/volumes-provider.test.js +160 -0
- package/tests/karma/BookNavigator/volumes/volumes.test.js +98 -0
- package/tests/plugins/plugin.archive_analytics.test.js +23 -0
- package/tests/plugins/plugin.autoplay.test.js +52 -0
- package/tests/plugins/plugin.chapters.test.js +130 -0
- package/tests/plugins/plugin.iframe.test.js +42 -0
- package/tests/plugins/plugin.mobile_nav.test.js +66 -0
- package/tests/plugins/plugin.resume.test.js +98 -0
- package/tests/plugins/plugin.text_selection.test.js +193 -0
- package/tests/plugins/plugin.url.test.js +129 -0
- package/tests/plugins/plugin.vendor-fullscreen.test.js +65 -0
- package/tests/plugins/search/plugin.search.test.js +173 -0
- package/tests/plugins/search/plugin.search.view.test.js +106 -0
- package/tests/plugins/tts/AbstractTTSEngine.test.js +153 -0
- package/tests/plugins/tts/FestivalTTSEngine.test.js +59 -0
- package/tests/plugins/tts/PageChunk.test.js +57 -0
- package/tests/plugins/tts/PageChunkIterator.test.js +179 -0
- package/tests/plugins/tts/WebTTSEngine.test.js +126 -0
- package/tests/plugins/tts/utils.test.js +133 -0
- package/tests/util/browserSniffing.test.js +56 -0
- package/tests/util/docCookies.test.js +15 -0
- package/tests/util/strings.test.js +63 -0
- package/tests/utils.js +80 -0
- package/webpack.config.js +85 -0
@@ -0,0 +1,468 @@
|
|
1
|
+
import { css, html, LitElement } from 'lit-element';
|
2
|
+
import { nothing } from 'lit-html';
|
3
|
+
import SearchProvider from './search/search-provider.js';
|
4
|
+
import DownloadProvider from './downloads/downloads-provider.js';
|
5
|
+
import VisualAdjustmentProvider from './visual-adjustments/visual-adjustments-provider.js';
|
6
|
+
import BookmarksProvider from './bookmarks/bookmarks-provider.js';
|
7
|
+
import SharingProvider from '../ItemNavigator/providers/sharing.js';
|
8
|
+
import VolumesProvider from './volumes/volumes-provider.js';
|
9
|
+
import BRFullscreenMgr from './br-fullscreen-mgr.js';
|
10
|
+
import { Book } from './BookModel.js';
|
11
|
+
import bookLoader from './assets/book-loader.js';
|
12
|
+
|
13
|
+
const events = {
|
14
|
+
menuUpdated: 'menuUpdated',
|
15
|
+
updateSideMenu: 'updateSideMenu',
|
16
|
+
PostInit: 'PostInit',
|
17
|
+
ViewportInFullScreen: 'ViewportInFullScreen',
|
18
|
+
};
|
19
|
+
export class BookNavigator extends LitElement {
|
20
|
+
static get properties() {
|
21
|
+
return {
|
22
|
+
book: { type: Object },
|
23
|
+
pageContainerSelector: { type: String },
|
24
|
+
brWidth: { type: Number },
|
25
|
+
bookReaderLoaded: { type: Boolean },
|
26
|
+
bookreader: { type: Object },
|
27
|
+
downloadableTypes: { type: Array },
|
28
|
+
isAdmin: { type: Boolean },
|
29
|
+
lendingInitialized: { type: Boolean },
|
30
|
+
lendingStatus: { type: Object },
|
31
|
+
menuProviders: { type: Object },
|
32
|
+
menuShortcuts: { type: Array },
|
33
|
+
sideMenuOpen: { type: Boolean },
|
34
|
+
signedIn: { type: Boolean },
|
35
|
+
};
|
36
|
+
}
|
37
|
+
|
38
|
+
constructor() {
|
39
|
+
super();
|
40
|
+
this.book = {};
|
41
|
+
this.pageContainerSelector = '.BRcontainer';
|
42
|
+
this.brWidth = 0;
|
43
|
+
this.bookReaderCannotLoad = false;
|
44
|
+
this.bookReaderLoaded = false;
|
45
|
+
this.bookreader = null;
|
46
|
+
this.downloadableTypes = [];
|
47
|
+
this.isAdmin = false;
|
48
|
+
this.lendingInitialized = false;
|
49
|
+
this.lendingStatus = {};
|
50
|
+
this.menuProviders = {};
|
51
|
+
this.menuShortcuts = [];
|
52
|
+
this.sideMenuOpen = false;
|
53
|
+
this.signedIn = false;
|
54
|
+
|
55
|
+
// Untracked properties
|
56
|
+
this.fullscreenMgr = null;
|
57
|
+
this.brResizeObserver = null;
|
58
|
+
this.model = new Book();
|
59
|
+
this.shortcutOrder = ['volumes', 'search', 'bookmarks'];
|
60
|
+
}
|
61
|
+
|
62
|
+
firstUpdated() {
|
63
|
+
this.model.setMetadata(this.book);
|
64
|
+
this.bindEventListeners();
|
65
|
+
this.emitPostInit();
|
66
|
+
}
|
67
|
+
|
68
|
+
updated(changed) {
|
69
|
+
if (!this.bookreader) {
|
70
|
+
return;
|
71
|
+
}
|
72
|
+
const isFirstSideMenuUpdate = changed.has('sideMenuOpen') && (changed.get('sideMenuOpen') === undefined);
|
73
|
+
if (!isFirstSideMenuUpdate) {
|
74
|
+
// realign image
|
75
|
+
if (this.bookreader.animating) {
|
76
|
+
return;
|
77
|
+
}
|
78
|
+
this.bookreader.resize();
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
/**
|
83
|
+
* Global event emitter for when Book Navigator loads
|
84
|
+
*/
|
85
|
+
emitPostInit() {
|
86
|
+
// emit global event when book nav has loaded with current bookreader selector
|
87
|
+
this.dispatchEvent(new CustomEvent(`BrBookNav:${events.PostInit}`, {
|
88
|
+
detail: { brSelector: this.bookreader?.el },
|
89
|
+
bubbles: true,
|
90
|
+
composed: true,
|
91
|
+
}));
|
92
|
+
}
|
93
|
+
|
94
|
+
/**
|
95
|
+
* Instantiates books submenus & their update callbacks
|
96
|
+
*
|
97
|
+
* NOTE: we are doing our best to scope bookreader's instance.
|
98
|
+
* If your submenu provider uses a bookreader instance to read, manually
|
99
|
+
* manipulate BookReader, please update the navigator's instance of it
|
100
|
+
* to keep it in sync.
|
101
|
+
*/
|
102
|
+
initializeBookSubmenus() {
|
103
|
+
const isBookProtected = this.bookreader.options.protected;
|
104
|
+
this.menuProviders = {
|
105
|
+
search: new SearchProvider(
|
106
|
+
/**
|
107
|
+
* Search specific menu updates
|
108
|
+
* @param {BookReader} brInstance
|
109
|
+
* @param {{ searchCanceled: boolean }} searchUpdates
|
110
|
+
*/
|
111
|
+
(brInstance = null, searchUpdates = {}) => {
|
112
|
+
if (brInstance) {
|
113
|
+
/* refresh br instance reference */
|
114
|
+
this.bookreader = brInstance;
|
115
|
+
}
|
116
|
+
this.updateMenuContents();
|
117
|
+
const wideEnoughToOpenMenu = this.brWidth >= 640;
|
118
|
+
if (wideEnoughToOpenMenu && !searchUpdates?.searchCanceled) {
|
119
|
+
/* open side search menu */
|
120
|
+
this.updateSideMenu('search', 'open');
|
121
|
+
}
|
122
|
+
},
|
123
|
+
this.bookreader,
|
124
|
+
),
|
125
|
+
downloads: new DownloadProvider(isBookProtected),
|
126
|
+
visualAdjustments: new VisualAdjustmentProvider({
|
127
|
+
onOptionChange: (event, brInstance = null) => {
|
128
|
+
if (brInstance) {
|
129
|
+
/* refresh br instance reference */
|
130
|
+
this.bookreader = brInstance;
|
131
|
+
}
|
132
|
+
this.updateMenuContents();
|
133
|
+
},
|
134
|
+
bookContainerSelector: this.pageContainerSelector,
|
135
|
+
bookreader: this.bookreader,
|
136
|
+
}),
|
137
|
+
share: new SharingProvider(this.book.metadata, this.baseHost, this.itemType, this.bookreader.options.subPrefix),
|
138
|
+
bookmarks: new BookmarksProvider(this.bookmarksOptions, this.bookreader),
|
139
|
+
};
|
140
|
+
|
141
|
+
// add shortcut for volumes if multipleBooksList exists
|
142
|
+
if (this.bookreader.options.enableMultipleBooks) {
|
143
|
+
this.menuProviders.volumes = new VolumesProvider(this.baseHost, this.bookreader, (brInstance) => {
|
144
|
+
if (brInstance) {
|
145
|
+
/* refresh br instance reference */
|
146
|
+
this.bookreader = brInstance;
|
147
|
+
}
|
148
|
+
this.updateMenuContents();
|
149
|
+
this.updateSideMenu('volumes', 'open');
|
150
|
+
});
|
151
|
+
this.addMenuShortcut('volumes');
|
152
|
+
}
|
153
|
+
|
154
|
+
this.addMenuShortcut('search'); /* start with search as a shortcut */
|
155
|
+
this.updateMenuContents();
|
156
|
+
}
|
157
|
+
|
158
|
+
/** gets element that houses the bookreader in light dom */
|
159
|
+
get mainBRContainer() {
|
160
|
+
return document.querySelector(this.bookreader.el);
|
161
|
+
}
|
162
|
+
|
163
|
+
get bookmarksOptions() {
|
164
|
+
const referrerStr = `referer=${encodeURIComponent(location.href)}`;
|
165
|
+
return {
|
166
|
+
loginUrl: `https://${this.baseHost}/account/login?${referrerStr}`,
|
167
|
+
displayMode: this.signedIn ? 'bookmarks' : 'login',
|
168
|
+
showItemNavigatorModal: this.showItemNavigatorModal.bind(this),
|
169
|
+
closeItemNavigatorModal: this.closeItemNavigatorModal.bind(this),
|
170
|
+
onBookmarksChanged: (bookmarks) => {
|
171
|
+
const method = Object.keys(bookmarks).length ? 'add' : 'remove';
|
172
|
+
this[`${method}MenuShortcut`]('bookmarks');
|
173
|
+
this.updateMenuContents();
|
174
|
+
},
|
175
|
+
};
|
176
|
+
}
|
177
|
+
|
178
|
+
/**
|
179
|
+
* Open side menu
|
180
|
+
* @param {string} menuId
|
181
|
+
* @param {('open'|'close'|'toggle')} action
|
182
|
+
*/
|
183
|
+
updateSideMenu(menuId = '', action = 'open') {
|
184
|
+
if (!menuId || !action) {
|
185
|
+
return;
|
186
|
+
}
|
187
|
+
const event = new CustomEvent(
|
188
|
+
events.updateSideMenu, {
|
189
|
+
detail: { menuId, action },
|
190
|
+
},
|
191
|
+
);
|
192
|
+
this.dispatchEvent(event);
|
193
|
+
}
|
194
|
+
|
195
|
+
/**
|
196
|
+
* Sets order of menu and emits custom event when done
|
197
|
+
*/
|
198
|
+
updateMenuContents() {
|
199
|
+
const {
|
200
|
+
search, downloads, visualAdjustments, share, bookmarks, volumes
|
201
|
+
} = this.menuProviders;
|
202
|
+
const availableMenus = [volumes, search, bookmarks, visualAdjustments, share].filter((menu) => !!menu);
|
203
|
+
|
204
|
+
if (this.shouldShowDownloadsMenu()) {
|
205
|
+
downloads.update(this.downloadableTypes);
|
206
|
+
availableMenus.splice(1, 0, downloads);
|
207
|
+
}
|
208
|
+
|
209
|
+
const event = new CustomEvent(
|
210
|
+
events.menuUpdated, {
|
211
|
+
detail: availableMenus,
|
212
|
+
},
|
213
|
+
);
|
214
|
+
this.dispatchEvent(event);
|
215
|
+
}
|
216
|
+
|
217
|
+
/**
|
218
|
+
* Confirms if we should show the downloads menu
|
219
|
+
* @returns {bool}
|
220
|
+
*/
|
221
|
+
shouldShowDownloadsMenu() {
|
222
|
+
if (this.model.isRestricted === false) { return true; }
|
223
|
+
if (this.isAdmin) { return true; }
|
224
|
+
const { user_loan_record = {} } = this.lendingStatus;
|
225
|
+
const hasNoLoanRecord = Array.isArray(user_loan_record); /* (bc PHP assoc. arrays) */
|
226
|
+
|
227
|
+
if (hasNoLoanRecord) { return false; }
|
228
|
+
|
229
|
+
const hasValidLoan = user_loan_record.type && (user_loan_record.type !== 'SESSION_LOAN');
|
230
|
+
return hasValidLoan;
|
231
|
+
}
|
232
|
+
|
233
|
+
/**
|
234
|
+
* Adds a provider object to the menuShortcuts array property if it isn't
|
235
|
+
* already added. menuShortcuts are then sorted by shortcutOrder and
|
236
|
+
* a menuShortcutsUpdated event is emitted.
|
237
|
+
*
|
238
|
+
* @param {string} menuId - a string matching the id property of a provider
|
239
|
+
*/
|
240
|
+
addMenuShortcut(menuId) {
|
241
|
+
if (this.menuShortcuts.find((m) => m.id === menuId)) { return; }
|
242
|
+
|
243
|
+
this.menuShortcuts.push(this.menuProviders[menuId]);
|
244
|
+
this.sortMenuShortcuts();
|
245
|
+
this.emitMenuShortcutsUpdated();
|
246
|
+
}
|
247
|
+
|
248
|
+
/**
|
249
|
+
* Removes a provider object from the menuShortcuts array and emits a
|
250
|
+
* menuShortcutsUpdated event.
|
251
|
+
*
|
252
|
+
* @param {string} menuId - a string matching the id property of a provider
|
253
|
+
*/
|
254
|
+
removeMenuShortcut(menuId) {
|
255
|
+
this.menuShortcuts = this.menuShortcuts.filter((m) => m.id !== menuId);
|
256
|
+
this.emitMenuShortcutsUpdated();
|
257
|
+
}
|
258
|
+
|
259
|
+
/**
|
260
|
+
* Sorts the menuShortcuts property by comparing each provider's id to
|
261
|
+
* the id in each iteration over the shortcutOrder array.
|
262
|
+
*/
|
263
|
+
sortMenuShortcuts() {
|
264
|
+
this.menuShortcuts = this.shortcutOrder.reduce((shortcuts, id) => {
|
265
|
+
const menu = this.menuShortcuts.find((m) => m.id === id);
|
266
|
+
if (menu) { shortcuts.push(menu); }
|
267
|
+
return shortcuts;
|
268
|
+
}, []);
|
269
|
+
}
|
270
|
+
|
271
|
+
emitMenuShortcutsUpdated() {
|
272
|
+
const event = new CustomEvent('menuShortcutsUpdated', {
|
273
|
+
detail: this.menuShortcuts,
|
274
|
+
});
|
275
|
+
this.dispatchEvent(event);
|
276
|
+
}
|
277
|
+
|
278
|
+
/**
|
279
|
+
* Core bookreader event handler registry
|
280
|
+
*
|
281
|
+
* NOTE: we are trying to keep bookreader's instance in scope
|
282
|
+
* Please update Book Navigator's instance reference of it to keep it current
|
283
|
+
*/
|
284
|
+
bindEventListeners() {
|
285
|
+
window.addEventListener('BookReader:PostInit', (e) => {
|
286
|
+
this.bookreader = e.detail.props;
|
287
|
+
this.bookReaderLoaded = true;
|
288
|
+
this.bookReaderCannotLoad = false;
|
289
|
+
this.fullscreenMgr = new BRFullscreenMgr(this.bookreader.el);
|
290
|
+
|
291
|
+
this.initializeBookSubmenus();
|
292
|
+
setTimeout(() => this.bookreader.resize(), 0);
|
293
|
+
this.brResizeObserver = new ResizeObserver((elements) => this.reactToBrResize(elements));
|
294
|
+
this.brResizeObserver.observe(this.mainBRContainer);
|
295
|
+
});
|
296
|
+
window.addEventListener('BookReader:fullscreenToggled', (event) => {
|
297
|
+
const { detail: { props: brInstance = null } } = event;
|
298
|
+
if (brInstance) {
|
299
|
+
this.bookreader = brInstance;
|
300
|
+
}
|
301
|
+
this.manageFullScreenBehavior(event);
|
302
|
+
}, { passive: true });
|
303
|
+
window.addEventListener('BookReader:ToggleSearchMenu', (event) => {
|
304
|
+
this.dispatchEvent(new CustomEvent(events.updateSideMenu, {
|
305
|
+
detail: { menuId: 'search', action: 'toggle' },
|
306
|
+
}));
|
307
|
+
});
|
308
|
+
window.addEventListener('LendingFlow:PostInit', ({ detail }) => {
|
309
|
+
const {
|
310
|
+
downloadTypesAvailable, lendingStatus, isAdmin, previewType,
|
311
|
+
} = detail;
|
312
|
+
this.lendingInitialized = true;
|
313
|
+
this.downloadableTypes = downloadTypesAvailable;
|
314
|
+
this.lendingStatus = lendingStatus;
|
315
|
+
this.isAdmin = isAdmin;
|
316
|
+
this.bookReaderCannotLoad = previewType === 'singlePagePreview';
|
317
|
+
});
|
318
|
+
window.addEventListener('BRJSIA:PostInit', ({ detail }) => {
|
319
|
+
const { isRestricted, downloadURLs } = detail;
|
320
|
+
this.bookReaderLoaded = true;
|
321
|
+
this.downloadableTypes = downloadURLs;
|
322
|
+
this.model.setRestriction(isRestricted);
|
323
|
+
});
|
324
|
+
}
|
325
|
+
|
326
|
+
/**
|
327
|
+
* Uses resize observer to fire BookReader's `resize` functionality
|
328
|
+
* We do not want to trigger resize IF:
|
329
|
+
* - book animation is happening
|
330
|
+
* - book is in fullscreen (fullscreen is handled separately)
|
331
|
+
*
|
332
|
+
* @param { Object } entries - resize observer entries
|
333
|
+
*/
|
334
|
+
reactToBrResize(entries = []) {
|
335
|
+
const startBrWidth = this.brWidth;
|
336
|
+
const { animating } = this.bookreader;
|
337
|
+
|
338
|
+
entries.forEach(({ contentRect, target }) => {
|
339
|
+
if (target === this.mainBRContainer) {
|
340
|
+
this.brWidth = contentRect.width;
|
341
|
+
}
|
342
|
+
});
|
343
|
+
setTimeout(() => {
|
344
|
+
if (startBrWidth && !animating) {
|
345
|
+
this.bookreader.resize();
|
346
|
+
}
|
347
|
+
}, 0);
|
348
|
+
}
|
349
|
+
|
350
|
+
/**
|
351
|
+
* Manages Fullscreen behavior
|
352
|
+
* This makes sure that controls are _always_ in view
|
353
|
+
* We need this to accommodate LOAN BAR during fullscreen
|
354
|
+
*/
|
355
|
+
manageFullScreenBehavior() {
|
356
|
+
this.emitFullScreenState();
|
357
|
+
|
358
|
+
if (!this.bookreader.isFullscreen()) {
|
359
|
+
this.fullscreenMgr.teardown();
|
360
|
+
} else {
|
361
|
+
this.fullscreenMgr.setup(this.bookreader);
|
362
|
+
}
|
363
|
+
}
|
364
|
+
|
365
|
+
/**
|
366
|
+
* Intercepts and relays fullscreen toggle events
|
367
|
+
*/
|
368
|
+
emitFullScreenState() {
|
369
|
+
const isFullScreen = this.bookreader.isFullscreen();
|
370
|
+
const event = new CustomEvent('ViewportInFullScreen', {
|
371
|
+
detail: { isFullScreen },
|
372
|
+
});
|
373
|
+
this.dispatchEvent(event);
|
374
|
+
}
|
375
|
+
|
376
|
+
emitShowItemNavigatorModal(e) {
|
377
|
+
this.dispatchEvent(new CustomEvent('showItemNavigatorModal', {
|
378
|
+
detail: e.detail,
|
379
|
+
}));
|
380
|
+
}
|
381
|
+
|
382
|
+
emitCloseItemNavigatorModal() {
|
383
|
+
this.dispatchEvent(new CustomEvent('closeItemNavigatorModal'));
|
384
|
+
}
|
385
|
+
|
386
|
+
showItemNavigatorModal(e) {
|
387
|
+
this.emitShowItemNavigatorModal(e);
|
388
|
+
}
|
389
|
+
|
390
|
+
closeItemNavigatorModal() {
|
391
|
+
this.emitCloseItemNavigatorModal();
|
392
|
+
}
|
393
|
+
|
394
|
+
get loader() {
|
395
|
+
const loader = html`
|
396
|
+
<div class="book-loader">${bookLoader}<div>
|
397
|
+
<h3>Loading viewer</h3>
|
398
|
+
`;
|
399
|
+
return !this.bookReaderLoaded ? loader : nothing;
|
400
|
+
}
|
401
|
+
|
402
|
+
get loadingClass() {
|
403
|
+
return !this.bookReaderLoaded ? 'loading' : '';
|
404
|
+
}
|
405
|
+
|
406
|
+
get itemImage() {
|
407
|
+
const url = `https://${this.baseHost}/services/img/${this.book.metadata.identifier}`;
|
408
|
+
return html`<img src="${url}" alt="cover image for ${this.book.metadata.identifier}">`;
|
409
|
+
}
|
410
|
+
|
411
|
+
render() {
|
412
|
+
const placeholder = this.bookReaderCannotLoad ? this.itemImage : this.loader;
|
413
|
+
return html`<div id="book-navigator" class="${this.loadingClass}">
|
414
|
+
${placeholder}
|
415
|
+
<slot name="bookreader"></slot>
|
416
|
+
</div>
|
417
|
+
`;
|
418
|
+
}
|
419
|
+
|
420
|
+
static get styles() {
|
421
|
+
return css`
|
422
|
+
#book-navigator.loading {
|
423
|
+
display: flex;
|
424
|
+
align-items: center;
|
425
|
+
justify-content: center;
|
426
|
+
min-height: 30vh;
|
427
|
+
}
|
428
|
+
|
429
|
+
#book-navigator .book-loader {
|
430
|
+
width: 30%;
|
431
|
+
margin: auto;
|
432
|
+
text-align: center;
|
433
|
+
color: var(--primaryTextColor);
|
434
|
+
}
|
435
|
+
|
436
|
+
.book-loader {
|
437
|
+
position: relative;
|
438
|
+
}
|
439
|
+
|
440
|
+
.book-loader svg {
|
441
|
+
display: block;
|
442
|
+
width: 60%;
|
443
|
+
max-width: 100px;
|
444
|
+
height: auto;
|
445
|
+
margin: auto;
|
446
|
+
}
|
447
|
+
|
448
|
+
svg * {
|
449
|
+
fill: var(--primaryTextColor);
|
450
|
+
}
|
451
|
+
|
452
|
+
svg .ring {
|
453
|
+
animation: rotate 1.3s infinite linear;
|
454
|
+
transform-origin: 50px 50px;
|
455
|
+
transform-box: fill-box;
|
456
|
+
display: block; // transform won't work on inline style
|
457
|
+
}
|
458
|
+
|
459
|
+
@keyframes rotate {
|
460
|
+
0% {
|
461
|
+
transform: rotate(-360deg);
|
462
|
+
}
|
463
|
+
}
|
464
|
+
`;
|
465
|
+
}
|
466
|
+
}
|
467
|
+
|
468
|
+
customElements.define('book-navigator', BookNavigator);
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { html } from 'lit-element';
|
2
|
+
|
3
|
+
export default html`
|
4
|
+
<svg
|
5
|
+
height="100"
|
6
|
+
viewBox="0 0 100 100"
|
7
|
+
width="100"
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
9
|
+
aria-labelledby="bookreader-loading"
|
10
|
+
>
|
11
|
+
<title id="bookreader-loading">Currently loading viewer.</title>
|
12
|
+
<desc>Please wait while we load book reader.</desc>
|
13
|
+
<g fill="#333" fill-rule="evenodd" class="book-icon">
|
14
|
+
<g transform="matrix(1 0 0 -1 28 67.362264)">
|
15
|
+
<path d="m44.71698 31.6981124v-29.99320678s-18.0956599.30735848-18.6322637-.7171698c-.0633962-.12226414-1.890566-.59207545-2.9745282-.59207545-1.3228302 0-3.5122641 0-4.1286791.74547168-.9707547 1.17452827-18.82811278.71660375-18.82811278.71660375v30.040754l1.83849052.7867924.29094339-28.48188608s15.94981097.15339622 17.09094297-1.10716978c.8145283-.90056602 4.997547-.91641507 5.3450942-.3526415.9611321 1.55716977 14.7101883 1.31716978 17.6077354 1.45981128l.3266038 28.22830118z"/>
|
16
|
+
<path d="m40.1129424 33.5957539h-12.8337733c-1.8690565 0-3.1098112-.7545283-3.9299999-1.6279245v-26.70452764l1.2362264-.00792453c.4584906.72962262 3.0922641 1.39415091 3.0922641 1.39415091h10.1298111s1.0381131.01754717 1.5141509.47377357c.5643396.54056602.7913207 1.36981129.7913207 1.36981129z"/>
|
17
|
+
<path d="m17.3354713 33.5957539h-12.8337733v-25.37660316s0-.75283017.49358489-1.14113205c.52867924-.41433961 1.3415094-.42849055 1.3415094-.42849055h10.59905631s2.2075471-.52698112 3.0928301-1.39415091l1.2.00792453v26.74245214c-.8201886.8581132-2.0530188 1.59-3.8932074 1.59"/>
|
18
|
+
</g>
|
19
|
+
<path
|
20
|
+
class="ring"
|
21
|
+
d="m17.8618849 11.6970233c18.5864635-15.59603144 45.6875867-15.59603102 64.2740497.000001 1.9271446 1.6170806 2.1785128 4.4902567.5614466 6.4174186-1.6170661 1.9271618-4.4902166 2.1785323-6.4173612.5614517-15.1996922-12.75416882-37.3625282-12.75416916-52.5622206-.000001-15.19969387 12.7541707-19.04823077 34.5805019-9.1273354 51.7641499 9.9208955 17.183646 30.7471499 24.7638499 49.3923323 17.9774983 18.6451823-6.7863521 29.7266014-25.9801026 26.2811129-45.5206248-.436848-2.4775114 1.2174186-4.8400696 3.6949079-5.2769215 2.4774893-.4368518 4.8400264 1.2174296 5.2768744 3.694941 4.2132065 23.8945096-9.3373563 47.3649806-32.137028 55.6634567-22.799672 8.2984758-48.2663986-.9707372-60.39785211-21.9832155-12.1314534-21.012481-7.42539173-47.7021198 11.16107351-63.2981544z"
|
22
|
+
fill-rule="nonzero"
|
23
|
+
/>
|
24
|
+
</g>
|
25
|
+
</svg>
|
26
|
+
`;
|
27
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { css } from 'lit-element';
|
2
|
+
|
3
|
+
export default css`
|
4
|
+
.blue {
|
5
|
+
--iconFillColor: var(--blueBookmarkColor, #0023f5);
|
6
|
+
}
|
7
|
+
|
8
|
+
.red {
|
9
|
+
--iconFillColor: var(--redBookmarkColor, #eb3223);
|
10
|
+
}
|
11
|
+
|
12
|
+
.green {
|
13
|
+
--iconFillColor: var(--greenBookmarkColor, #75ef4c);
|
14
|
+
}
|
15
|
+
`;
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import { css } from 'lit-element';
|
2
|
+
|
3
|
+
export default css`
|
4
|
+
.ia-button {
|
5
|
+
min-height: 3rem;
|
6
|
+
border: none;
|
7
|
+
outline: none;
|
8
|
+
cursor: pointer;
|
9
|
+
color: var(--primaryTextColor);
|
10
|
+
line-height: normal;
|
11
|
+
border-radius: .4rem;
|
12
|
+
text-align: center;
|
13
|
+
vertical-align: middle;
|
14
|
+
font-size: 1.4rem;
|
15
|
+
display: inline-block;
|
16
|
+
padding: .6rem 1.2rem;
|
17
|
+
border: 1px solid transparent;
|
18
|
+
|
19
|
+
white-space: nowrap;
|
20
|
+
-webkit-user-select: none;
|
21
|
+
-moz-user-select: none;
|
22
|
+
-ms-user-select: none;
|
23
|
+
-o-user-select: none;
|
24
|
+
user-select: none;
|
25
|
+
}
|
26
|
+
|
27
|
+
.ia-button.link,
|
28
|
+
.ia-button.external {
|
29
|
+
min-height: unset;
|
30
|
+
text-decoration: none;
|
31
|
+
}
|
32
|
+
|
33
|
+
.ia-button:disabled,
|
34
|
+
.ia-button.disabled {
|
35
|
+
cursor: not-allowed;
|
36
|
+
opacity: 0.5;
|
37
|
+
}
|
38
|
+
|
39
|
+
.ia-button.transparent {
|
40
|
+
background-color: transparent;
|
41
|
+
}
|
42
|
+
|
43
|
+
.ia-button.slim {
|
44
|
+
padding: 0;
|
45
|
+
}
|
46
|
+
|
47
|
+
.ia-button.primary {
|
48
|
+
background-color: var(--primaryCTAFill);
|
49
|
+
border-color: var(--primaryCTABorder);
|
50
|
+
}
|
51
|
+
|
52
|
+
.ia-button.cancel {
|
53
|
+
background-color: var(--primaryErrorCTAFill);
|
54
|
+
border-color: var(--primaryErrorCTABorder);
|
55
|
+
}
|
56
|
+
|
57
|
+
.ia-button.external {
|
58
|
+
background: var(--secondaryCTAFill);
|
59
|
+
border-color: var(--secondaryCTABorder);
|
60
|
+
}
|
61
|
+
`;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { css } from 'lit-element';
|
2
|
+
|
3
|
+
// Original SVG object for reference
|
4
|
+
// <svg height="10" viewBox="0 0 13 10" width="13" xmlns="http://www.w3.org/2000/svg"><path d="m4.33333333 10-4.33333333-4.16666667 1.73333333-1.66666666 2.6 2.5 6.93333337-6.66666667 1.7333333 1.66666667z" fill="#fff" fill-rule="evenodd"/></svg>
|
5
|
+
|
6
|
+
export default css`data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjEwIiB2aWV3Qm94PSIwIDAgMTMgMTAiIHdpZHRoPSIxMyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNC4zMzMzMzMzMyAxMC00LjMzMzMzMzMzLTQuMTY2NjY2NjcgMS43MzMzMzMzMy0xLjY2NjY2NjY2IDIuNiAyLjUgNi45MzMzMzMzNy02LjY2NjY2NjY3IDEuNzMzMzMzMyAxLjY2NjY2NjY3eiIgZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+`;
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import { css } from 'lit-element';
|
2
|
+
|
3
|
+
export default css`data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNDAgNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgYXJpYS1sYWJlbGxlZGJ5PSJjbG9zZVRpdGxlSUQgY2xvc2VEZXNjSUQiPjxwYXRoIGQ9Ik0yOS4xOTIgMTAuODA4YTEuNSAxLjUgMCAwMTAgMi4xMkwyMi4xMjIgMjBsNy4wNyA3LjA3MmExLjUgMS41IDAgMDEtMi4xMiAyLjEyMWwtNy4wNzMtNy4wNy03LjA3IDcuMDdhMS41IDEuNSAwIDAxLTIuMTIxLTIuMTJsNy4wNy03LjA3My03LjA3LTcuMDdhMS41IDEuNSAwIDAxMi4xMi0yLjEyMUwyMCAxNy44NzhsNy4wNzItNy4wN2ExLjUgMS41IDAgMDEyLjEyMSAweiIgY2xhc3M9ImZpbGwtY29sb3IiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==`;
|
@@ -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
|
+
`;
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import { LitElement, html, css } from 'lit-element';
|
2
|
+
|
3
|
+
export default class BookmarkButton extends LitElement {
|
4
|
+
static get styles() {
|
5
|
+
return css`
|
6
|
+
button {
|
7
|
+
-webkit-appearance: none;
|
8
|
+
appearance: none;
|
9
|
+
outline: 0;
|
10
|
+
border: none;
|
11
|
+
padding: 0;
|
12
|
+
height: 4rem;
|
13
|
+
width: 4rem;
|
14
|
+
background: transparent;
|
15
|
+
cursor: url('/images/bookreader/bookmark-add.png'), pointer;
|
16
|
+
position: relative;
|
17
|
+
}
|
18
|
+
button > * {
|
19
|
+
display: block;
|
20
|
+
position: absolute;
|
21
|
+
top: 0.2rem;
|
22
|
+
}
|
23
|
+
button.left > * {
|
24
|
+
left: 0.2rem;
|
25
|
+
}
|
26
|
+
|
27
|
+
button.right > * {
|
28
|
+
right: 0.2rem;
|
29
|
+
}
|
30
|
+
`;
|
31
|
+
}
|
32
|
+
|
33
|
+
static get properties() {
|
34
|
+
return {
|
35
|
+
side: { type: String },
|
36
|
+
state: { type: String },
|
37
|
+
};
|
38
|
+
}
|
39
|
+
|
40
|
+
constructor() {
|
41
|
+
super();
|
42
|
+
this.state = 'hollow';
|
43
|
+
}
|
44
|
+
|
45
|
+
handleClick(e) {
|
46
|
+
e.preventDefault();
|
47
|
+
this.dispatchEvent(new CustomEvent('bookmarkButtonClicked'));
|
48
|
+
}
|
49
|
+
|
50
|
+
get title() {
|
51
|
+
return `${this.state === 'hollow' ? 'Add' : 'Remove'} bookmark`;
|
52
|
+
}
|
53
|
+
|
54
|
+
render() {
|
55
|
+
const position = this.side || 'right';
|
56
|
+
return html`
|
57
|
+
<button title=${this.title} @click=${this.handleClick} class=${position}>
|
58
|
+
<icon-bookmark state=${this.state}></icon-bookmark>
|
59
|
+
</button>
|
60
|
+
`;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
customElements.define('bookmark-button', BookmarkButton);
|