@internetarchive/bookreader 5.0.0-10-alpha-3 → 5.0.0-100
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/BookReader/474.js +2 -0
- package/BookReader/474.js.map +1 -0
- package/BookReader/BookReader.css +428 -1139
- package/BookReader/BookReader.js +1 -1
- package/BookReader/BookReader.js.LICENSE.txt +20 -20
- package/BookReader/BookReader.js.map +1 -1
- package/BookReader/bergamot-translator-worker.js +2966 -0
- package/BookReader/bergamot-translator-worker.wasm +0 -0
- package/BookReader/hypothesis/LICENSE +50 -0
- package/BookReader/hypothesis/README.md +55 -0
- package/BookReader/hypothesis/build/boot.js +1 -0
- package/BookReader/hypothesis/build/manifest.json +20 -0
- package/BookReader/hypothesis/build/scripts/annotator.bundle.js +184 -0
- package/BookReader/hypothesis/build/scripts/annotator.bundle.js.map +1 -0
- package/BookReader/hypothesis/build/scripts/sidebar.bundle.js +798 -0
- package/BookReader/hypothesis/build/scripts/sidebar.bundle.js.map +1 -0
- package/BookReader/hypothesis/build/scripts/ui-playground.bundle.js +711 -0
- package/BookReader/hypothesis/build/scripts/ui-playground.bundle.js.map +1 -0
- package/BookReader/hypothesis/build/styles/annotator.css +2235 -0
- package/BookReader/hypothesis/build/styles/annotator.css.map +1 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/highlights.css +2 -0
- package/BookReader/hypothesis/build/styles/highlights.css.map +1 -0
- package/BookReader/hypothesis/build/styles/katex.min.css +2 -0
- package/BookReader/hypothesis/build/styles/katex.min.css.map +1 -0
- package/BookReader/hypothesis/build/styles/pdfjs-overrides.css +2 -0
- package/BookReader/hypothesis/build/styles/pdfjs-overrides.css.map +1 -0
- package/BookReader/hypothesis/build/styles/sidebar.css +2731 -0
- package/BookReader/hypothesis/build/styles/sidebar.css.map +1 -0
- package/BookReader/hypothesis/build/styles/ui-playground.css +2659 -0
- package/BookReader/hypothesis/build/styles/ui-playground.css.map +1 -0
- package/BookReader/hypothesis/package.json +126 -0
- package/BookReader/ia-bookreader-bundle.js +1782 -0
- package/BookReader/ia-bookreader-bundle.js.LICENSE.txt +7 -0
- package/BookReader/ia-bookreader-bundle.js.map +1 -0
- package/BookReader/icons/1up.svg +1 -1
- package/BookReader/icons/2up.svg +1 -1
- package/BookReader/icons/advance.svg +1 -1
- package/BookReader/icons/chevron-right.svg +1 -1
- package/BookReader/icons/close-circle-dark.svg +1 -1
- package/BookReader/icons/close-circle.svg +1 -1
- package/BookReader/icons/fullscreen.svg +1 -1
- package/BookReader/icons/fullscreen_exit.svg +1 -1
- package/BookReader/icons/hamburger.svg +1 -1
- package/BookReader/icons/left-arrow.svg +1 -1
- package/BookReader/icons/magnify-minus.svg +1 -1
- package/BookReader/icons/magnify-plus.svg +1 -1
- package/BookReader/icons/magnify.svg +1 -1
- package/BookReader/icons/pause.svg +1 -1
- package/BookReader/icons/play.svg +1 -1
- package/BookReader/icons/playback-speed.svg +1 -1
- package/BookReader/icons/read-aloud.svg +1 -1
- package/BookReader/icons/review.svg +1 -1
- package/BookReader/icons/thumbnails.svg +1 -1
- package/BookReader/icons/voice.svg +1 -0
- package/BookReader/icons/volume-full.svg +1 -1
- package/BookReader/images/BRicons.svg +3 -3
- package/BookReader/images/books_graphic.svg +1 -1
- package/BookReader/images/hypothesis.ico +0 -0
- package/BookReader/images/icon_book.svg +1 -1
- package/BookReader/images/icon_bookmark.svg +1 -1
- package/BookReader/images/icon_experiment.svg +1 -0
- package/BookReader/images/icon_gear.svg +1 -1
- package/BookReader/images/icon_hamburger.svg +1 -1
- package/BookReader/images/icon_home.svg +1 -1
- package/BookReader/images/icon_info.svg +1 -1
- package/BookReader/images/icon_one_page.svg +1 -1
- package/BookReader/images/icon_pause.svg +1 -1
- package/BookReader/images/icon_play.svg +1 -1
- package/BookReader/images/icon_playback-rate.svg +1 -1
- package/BookReader/images/icon_search_button.svg +1 -1
- package/BookReader/images/icon_share.svg +1 -1
- package/BookReader/images/icon_skip-ahead.svg +1 -1
- package/BookReader/images/icon_skip-back.svg +1 -1
- package/BookReader/images/icon_speaker.svg +1 -1
- package/BookReader/images/icon_speaker_open.svg +1 -1
- package/BookReader/images/icon_thumbnails.svg +1 -1
- package/BookReader/images/icon_toc.svg +1 -1
- package/BookReader/images/icon_two_pages.svg +1 -1
- package/BookReader/images/marker_chap-off.svg +1 -1
- package/BookReader/images/marker_chap-on.svg +1 -1
- package/BookReader/images/marker_srch-on.svg +1 -1
- package/BookReader/images/translate.svg +1 -0
- package/BookReader/images/unviewable_page.png +0 -0
- package/BookReader/jquery-3.js +2 -0
- package/BookReader/jquery-3.js.LICENSE.txt +24 -0
- package/BookReader/plugins/plugin.archive_analytics.js +1 -1
- package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
- package/BookReader/plugins/plugin.autoplay.js +1 -1
- package/BookReader/plugins/plugin.autoplay.js.map +1 -1
- package/BookReader/plugins/plugin.chapters.js +25 -1
- package/BookReader/plugins/plugin.chapters.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.chapters.js.map +1 -1
- package/BookReader/plugins/plugin.experiments.js +3 -0
- package/BookReader/plugins/plugin.experiments.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.experiments.js.map +1 -0
- package/BookReader/plugins/plugin.iframe.js +1 -1
- package/BookReader/plugins/plugin.iframe.js.map +1 -1
- package/BookReader/plugins/plugin.iiif.js +2 -0
- package/BookReader/plugins/plugin.iiif.js.map +1 -0
- package/BookReader/plugins/plugin.resume.js +1 -1
- package/BookReader/plugins/plugin.resume.js.map +1 -1
- package/BookReader/plugins/plugin.search.js +2 -1
- package/BookReader/plugins/plugin.search.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.search.js.map +1 -1
- package/BookReader/plugins/plugin.text_selection.js +2 -1
- package/BookReader/plugins/plugin.text_selection.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.text_selection.js.map +1 -1
- package/BookReader/plugins/plugin.translate.js +137 -0
- package/BookReader/plugins/plugin.translate.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.translate.js.map +1 -0
- package/BookReader/plugins/plugin.tts.js +1 -1
- package/BookReader/plugins/plugin.tts.js.LICENSE.txt +2 -0
- package/BookReader/plugins/plugin.tts.js.map +1 -1
- package/BookReader/plugins/plugin.url.js +1 -1
- package/BookReader/plugins/plugin.url.js.map +1 -1
- package/BookReader/plugins/plugin.vendor-fullscreen.js +1 -1
- package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
- package/BookReader/plugins/translator-worker.js +2 -0
- package/BookReader/plugins/translator-worker.js.map +1 -0
- package/BookReader/silence.mp3 +0 -0
- package/BookReader/translator-worker.js +475 -0
- package/BookReader/webcomponents-bundle.js +3 -0
- package/BookReader/webcomponents-bundle.js.LICENSE.txt +9 -0
- package/BookReader/webcomponents-bundle.js.map +1 -0
- package/README.md +14 -3
- package/jsconfig.json +19 -0
- package/package.json +84 -64
- package/src/BookNavigator/assets/bookmark-colors.js +1 -1
- package/src/BookNavigator/assets/button-base.js +2 -1
- package/src/BookNavigator/assets/ia-logo.js +17 -0
- package/src/BookNavigator/assets/icon_checkmark.js +1 -1
- package/src/BookNavigator/assets/icon_close.js +1 -1
- package/src/BookNavigator/book-navigator.js +620 -0
- package/src/BookNavigator/bookmarks/bookmark-button.js +3 -2
- package/src/BookNavigator/bookmarks/bookmark-edit.js +2 -3
- package/src/BookNavigator/bookmarks/bookmarks-list.js +2 -3
- package/src/BookNavigator/bookmarks/bookmarks-loginCTA.js +2 -2
- package/src/BookNavigator/bookmarks/bookmarks-provider.js +27 -17
- package/src/BookNavigator/bookmarks/ia-bookmarks.js +116 -67
- package/src/BookNavigator/delete-modal-actions.js +1 -1
- package/src/BookNavigator/downloads/downloads-provider.js +36 -21
- package/src/BookNavigator/downloads/downloads.js +24 -4
- package/src/BookNavigator/search/search-provider.js +55 -27
- package/src/BookNavigator/search/search-results.js +25 -11
- package/src/BookNavigator/sharing.js +27 -0
- package/src/BookNavigator/viewable-files.js +95 -0
- package/src/BookNavigator/visual-adjustments/visual-adjustments-provider.js +13 -12
- package/src/BookNavigator/visual-adjustments/visual-adjustments.js +9 -9
- package/src/BookReader/BookModel.js +92 -46
- package/src/BookReader/DragScrollable.js +233 -0
- package/src/BookReader/ImageCache.js +49 -16
- package/src/BookReader/Mode1Up.js +58 -360
- package/src/BookReader/Mode1UpLit.js +393 -0
- package/src/BookReader/Mode2Up.js +75 -1318
- package/src/BookReader/Mode2UpLit.js +787 -0
- package/src/BookReader/ModeCoordinateSpace.js +29 -0
- package/src/BookReader/ModeSmoothZoom.js +312 -0
- package/src/BookReader/ModeThumb.js +20 -12
- package/src/BookReader/Navbar/Navbar.js +130 -53
- package/src/BookReader/PageContainer.js +120 -23
- package/src/BookReader/ReduceSet.js +2 -2
- package/src/BookReader/Toolbar/Toolbar.js +18 -40
- package/src/BookReader/events.js +2 -3
- package/src/BookReader/options.js +87 -16
- package/src/BookReader/utils/HTMLDimensionsCacher.js +44 -0
- package/src/BookReader/utils/ScrollClassAdder.js +31 -0
- package/src/BookReader/utils/SelectionObserver.js +45 -0
- package/src/BookReader/utils/classes.js +1 -1
- package/src/BookReader/utils.js +136 -12
- package/src/BookReader.js +641 -1192
- package/src/BookReaderPlugin.js +52 -0
- package/src/assets/icons/magnify-minus.svg +3 -7
- package/src/assets/icons/magnify-plus.svg +3 -7
- package/src/assets/icons/voice.svg +1 -0
- package/src/assets/images/hypothesis.ico +0 -0
- package/src/assets/images/icon_experiment.svg +1 -0
- package/src/assets/images/translate.svg +1 -0
- package/src/assets/images/unviewable_page.png +0 -0
- package/src/assets/silence.mp3 +0 -0
- package/src/css/BookReader.scss +1 -5
- package/src/css/_BRBookmarks.scss +1 -1
- package/src/css/_BRComponent.scss +1 -1
- package/src/css/_BRicon.scss +8 -2
- package/src/css/_BRmain.scss +16 -3
- package/src/css/_BRnav.scss +12 -66
- package/src/css/_BRpages.scss +163 -43
- package/src/css/_BRsearch.scss +69 -30
- package/src/css/_BRtoolbar.scss +5 -5
- package/src/css/_TextSelection.scss +129 -24
- package/src/css/_colorbox.scss +2 -2
- package/src/css/_controls.scss +24 -7
- package/src/css/_icons.scss +1 -1
- package/src/ia-bookreader/ia-bookreader.js +224 -0
- package/src/plugins/plugin.archive_analytics.js +84 -78
- package/src/plugins/plugin.autoplay.js +99 -104
- package/src/plugins/plugin.chapters.js +314 -205
- package/src/plugins/plugin.experiments.js +321 -0
- package/src/plugins/plugin.iframe.js +1 -1
- package/src/plugins/plugin.iiif.js +141 -0
- package/src/plugins/plugin.resume.js +54 -51
- package/src/plugins/plugin.text_selection.js +510 -219
- package/src/plugins/plugin.vendor-fullscreen.js +5 -5
- package/src/plugins/search/plugin.search.js +370 -392
- package/src/plugins/search/utils.js +43 -0
- package/src/plugins/search/view.js +49 -67
- package/src/plugins/translate/TranslationManager.js +162 -0
- package/src/plugins/translate/plugin.translate.js +523 -0
- package/src/plugins/tts/AbstractTTSEngine.js +78 -49
- package/src/plugins/tts/FestivalTTSEngine.js +20 -30
- package/src/plugins/tts/PageChunk.js +33 -21
- package/src/plugins/tts/PageChunkIterator.js +11 -17
- package/src/plugins/tts/WebTTSEngine.js +131 -91
- package/src/plugins/tts/plugin.tts.js +344 -350
- package/src/plugins/tts/utils.js +49 -47
- package/src/plugins/url/UrlPlugin.js +191 -0
- package/src/plugins/{plugin.url.js → url/plugin.url.js} +44 -15
- package/src/util/TextSelectionManager.js +282 -0
- package/src/util/browserSniffing.js +33 -1
- package/src/util/cache.js +20 -0
- package/src/util/docCookies.js +21 -2
- package/src/util/strings.js +1 -0
- package/.babelrc +0 -12
- package/.dependabot/config.yml +0 -6
- package/.eslintrc.js +0 -50
- package/.gitattributes +0 -2
- package/.github/ISSUE_TEMPLATE/bug.md +0 -32
- package/.github/ISSUE_TEMPLATE/feature-request.md +0 -30
- package/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +0 -15
- package/.github/workflows/node.js.yml +0 -37
- package/.github/workflows/npm-publish.yml +0 -47
- package/.testcaferc.json +0 -5
- 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 +0 -2
- 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.mobile_nav.js +0 -2
- package/BookReader/plugins/plugin.mobile_nav.js.map +0 -1
- package/BookReaderDemo/BookReaderDemo.css +0 -41
- package/BookReaderDemo/BookReaderJSAdvanced.js +0 -115
- package/BookReaderDemo/BookReaderJSAutoplay.js +0 -56
- package/BookReaderDemo/BookReaderJSSimple.js +0 -55
- package/BookReaderDemo/IIIFBookReader.js +0 -207
- package/BookReaderDemo/assets/v5/Bookreader-logo-cool-grad.svg +0 -1
- package/BookReaderDemo/assets/v5/Bookreader-logo-flat.svg +0 -1
- 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 +0 -1
- package/BookReaderDemo/assets/v5/Bookreader-logo-warm.svg +0 -1
- 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 +0 -7178
- package/BookReaderDemo/demo-advanced.html +0 -33
- package/BookReaderDemo/demo-autoplay.html +0 -38
- package/BookReaderDemo/demo-embed-iframe-src.html +0 -84
- package/BookReaderDemo/demo-embed.html +0 -26
- package/BookReaderDemo/demo-fullscreen-mobile.html +0 -36
- package/BookReaderDemo/demo-fullscreen.html +0 -33
- package/BookReaderDemo/demo-iiif.html +0 -34
- package/BookReaderDemo/demo-iiif.js +0 -26
- package/BookReaderDemo/demo-internetarchive.html +0 -74
- package/BookReaderDemo/demo-multiple.html +0 -43
- package/BookReaderDemo/demo-plugin-menu-toggle.html +0 -34
- package/BookReaderDemo/demo-preview-pages.html +0 -1092
- package/BookReaderDemo/demo-simple.html +0 -34
- package/BookReaderDemo/demo-vendor-fullscreen.html +0 -36
- package/BookReaderDemo/immersion-1up.html +0 -64
- package/BookReaderDemo/immersion-mode.html +0 -35
- package/BookReaderDemo/toggle_controls.html +0 -53
- package/BookReaderDemo/view_mode.html +0 -39
- package/BookReaderDemo/viewmode-cycle.html +0 -41
- package/CHANGELOG.md +0 -493
- package/CONTRIBUTING.md +0 -7
- package/codecov.yml +0 -17
- package/index.html +0 -31
- package/karma.conf.js +0 -23
- package/screenshot.png +0 -0
- package/scripts/postversion.js +0 -10
- package/scripts/preversion.js +0 -14
- package/scripts/version.js +0 -26
- package/src/BookNavigator/BookModel.js +0 -14
- package/src/BookNavigator/BookNavigator.js +0 -446
- package/src/BookNavigator/assets/book-loader.js +0 -27
- package/src/BookNavigator/br-fullscreen-mgr.js +0 -83
- package/src/BookNavigator/search/a-search-result.js +0 -55
- package/src/BookReader/DebugConsole.js +0 -54
- package/src/BookReaderComponent/BookReaderComponent.js +0 -112
- package/src/ItemNavigator/ItemNavigator.js +0 -376
- package/src/ItemNavigator/providers/sharing.js +0 -29
- package/src/css/_MobileNav.scss +0 -194
- package/src/dragscrollable-br.js +0 -261
- package/src/plugins/menu_toggle/plugin.menu_toggle.js +0 -324
- package/src/plugins/plugin.mobile_nav.js +0 -287
- package/tests/BookReader/BookModel.test.js +0 -312
- package/tests/BookReader/BookReaderPublicFunctions.test.js +0 -171
- package/tests/BookReader/DebugConsole.test.js +0 -25
- package/tests/BookReader/ImageCache.test.js +0 -150
- package/tests/BookReader/Mode1Up.test.js +0 -164
- package/tests/BookReader/Mode2Up.test.js +0 -247
- package/tests/BookReader/Navbar/Navbar.test.js +0 -169
- package/tests/BookReader/PageContainer.test.js +0 -115
- package/tests/BookReader/ReduceSet.test.js +0 -38
- package/tests/BookReader/Toolbar/Toolbar.test.js +0 -26
- package/tests/BookReader/utils/classes.test.js +0 -88
- package/tests/BookReader/utils.test.js +0 -109
- package/tests/BookReader.options.test.js +0 -39
- package/tests/BookReader.test.js +0 -301
- package/tests/e2e/README.md +0 -75
- package/tests/e2e/autoplay.test.js +0 -13
- package/tests/e2e/base.test.js +0 -35
- package/tests/e2e/helpers/base.js +0 -263
- package/tests/e2e/helpers/debug.js +0 -13
- package/tests/e2e/helpers/desktopSearch.js +0 -72
- package/tests/e2e/helpers/mobileSearch.js +0 -85
- package/tests/e2e/helpers/mockSearch.js +0 -93
- package/tests/e2e/helpers/rightToLeft.js +0 -29
- package/tests/e2e/ia-production/ia-prod-base.js +0 -17
- package/tests/e2e/models/BookReader.js +0 -11
- package/tests/e2e/models/Navigation.js +0 -56
- package/tests/e2e/rightToLeft.test.js +0 -20
- package/tests/e2e/viewmode.test.js +0 -37
- package/tests/karma/BookNavigator/book-navigator.test.js +0 -132
- package/tests/karma/BookNavigator/bookmarks/bookmark-edit.test.js +0 -133
- package/tests/karma/BookNavigator/bookmarks/bookmarks-list.test.js +0 -222
- package/tests/karma/BookNavigator/search/search-provider.test.js +0 -23
- package/tests/karma/BookNavigator/search/search-results.test.js +0 -240
- package/tests/karma/BookNavigator/visual-adjustments.test.js +0 -201
- package/tests/plugins/menu_toggle/plugin.menu_toggle.test.js +0 -68
- package/tests/plugins/plugin.archive_analytics.test.js +0 -23
- package/tests/plugins/plugin.autoplay.test.js +0 -52
- package/tests/plugins/plugin.chapters.test.js +0 -130
- package/tests/plugins/plugin.iframe.test.js +0 -42
- package/tests/plugins/plugin.mobile_nav.test.js +0 -66
- package/tests/plugins/plugin.resume.test.js +0 -98
- package/tests/plugins/plugin.text_selection.test.js +0 -203
- package/tests/plugins/plugin.url.test.js +0 -129
- package/tests/plugins/plugin.vendor-fullscreen.test.js +0 -65
- package/tests/plugins/search/plugin.search.test.js +0 -173
- package/tests/plugins/search/plugin.search.view.test.js +0 -106
- package/tests/plugins/tts/AbstractTTSEngine.test.js +0 -153
- package/tests/plugins/tts/FestivalTTSEngine.test.js +0 -59
- package/tests/plugins/tts/PageChunk.test.js +0 -57
- package/tests/plugins/tts/PageChunkIterator.test.js +0 -179
- package/tests/plugins/tts/WebTTSEngine.test.js +0 -126
- package/tests/plugins/tts/utils.test.js +0 -133
- package/tests/util/browserSniffing.test.js +0 -56
- package/tests/util/docCookies.test.js +0 -15
- package/tests/util/strings.test.js +0 -63
- package/tests/utils.js +0 -42
- package/webpack.config.js +0 -86
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import { nothing } from 'lit
|
|
3
|
-
|
|
4
|
-
import './search-results';
|
|
1
|
+
// @ts-check
|
|
2
|
+
import { html, nothing } from 'lit';
|
|
3
|
+
import '@internetarchive/icon-search/icon-search.js';
|
|
4
|
+
import './search-results.js';
|
|
5
|
+
/** @typedef {import('@/src/plugins/search/plugin.search.js').SearchInsideMatch} SearchInsideMatch */
|
|
6
|
+
/** @typedef {import('@/src/plugins/search/plugin.search.js').SearchInsideResults} SearchInsideResults */
|
|
7
|
+
/** @typedef {import('@/src/BookReader.js').default} BookReader */
|
|
5
8
|
|
|
6
9
|
let searchState = {
|
|
7
10
|
query: '',
|
|
@@ -10,8 +13,11 @@ let searchState = {
|
|
|
10
13
|
queryInProgress: false,
|
|
11
14
|
errorMessage: '',
|
|
12
15
|
};
|
|
13
|
-
export default class {
|
|
14
|
-
constructor(
|
|
16
|
+
export default class SearchProvider {
|
|
17
|
+
constructor({
|
|
18
|
+
onProviderChange,
|
|
19
|
+
bookreader,
|
|
20
|
+
}) {
|
|
15
21
|
/* search menu events */
|
|
16
22
|
this.onBookSearchInitiated = this.onBookSearchInitiated.bind(this);
|
|
17
23
|
/* bookreader search events */
|
|
@@ -26,12 +32,12 @@ export default class {
|
|
|
26
32
|
this.bindEventListeners = this.bindEventListeners.bind(this);
|
|
27
33
|
this.getMenuDetails = this.getMenuDetails.bind(this);
|
|
28
34
|
this.getComponent = this.getComponent.bind(this);
|
|
29
|
-
this.advanceToPage = this.advanceToPage.bind(this);
|
|
30
35
|
this.updateMenu = this.updateMenu.bind(this);
|
|
31
36
|
|
|
32
|
-
this.
|
|
33
|
-
|
|
34
|
-
this.
|
|
37
|
+
this.onProviderChange = onProviderChange;
|
|
38
|
+
/** @type {import('@/src/BookReader.js').default} */
|
|
39
|
+
this.bookreader = bookreader;
|
|
40
|
+
this.icon = html`<ia-icon-search style="width: var(--iconWidth); height: var(--iconHeight);"></ia-icon-search>`;
|
|
35
41
|
this.label = 'Search inside';
|
|
36
42
|
this.menuDetails = this.getMenuDetails();
|
|
37
43
|
this.id = 'search';
|
|
@@ -69,13 +75,20 @@ export default class {
|
|
|
69
75
|
errorMessage: '',
|
|
70
76
|
};
|
|
71
77
|
const updateMenuFor = {
|
|
72
|
-
searchCanceled: true
|
|
78
|
+
searchCanceled: true,
|
|
73
79
|
};
|
|
74
80
|
this.updateMenu(updateMenuFor);
|
|
81
|
+
|
|
82
|
+
if (this.bookreader.urlPlugin) {
|
|
83
|
+
this.updateSearchInUrl();
|
|
84
|
+
}
|
|
75
85
|
}
|
|
76
86
|
|
|
77
87
|
onSearchStarted(e) {
|
|
78
|
-
const { term = '' } = e.detail.props;
|
|
88
|
+
const { term = '', instance } = e.detail.props;
|
|
89
|
+
if (instance) {
|
|
90
|
+
this.bookreader = instance;
|
|
91
|
+
}
|
|
79
92
|
searchState.query = term;
|
|
80
93
|
searchState.results = [];
|
|
81
94
|
searchState.resultsCount = 0;
|
|
@@ -89,11 +102,14 @@ export default class {
|
|
|
89
102
|
this.bookreader.search(searchState.query);
|
|
90
103
|
}
|
|
91
104
|
|
|
105
|
+
/**
|
|
106
|
+
* @param {CustomEvent<{props: {instance: BookReader, results: SearchInsideResults}}>} event
|
|
107
|
+
*/
|
|
92
108
|
onSearchRequestError(event, errorType = 'default') {
|
|
93
|
-
const { detail: { props
|
|
94
|
-
const { instance
|
|
109
|
+
const { detail: { props } } = event;
|
|
110
|
+
const { instance, results } = props;
|
|
95
111
|
if (instance) {
|
|
96
|
-
|
|
112
|
+
/** @type {BookReader} keep bookreader instance reference up-to-date */
|
|
97
113
|
this.bookreader = instance;
|
|
98
114
|
}
|
|
99
115
|
const errorMessages = {
|
|
@@ -104,6 +120,7 @@ export default class {
|
|
|
104
120
|
};
|
|
105
121
|
|
|
106
122
|
const messageToShow = errorMessages[errorType] ?? errorMessages.default;
|
|
123
|
+
searchState.query = results?.q || '';
|
|
107
124
|
searchState.results = [];
|
|
108
125
|
searchState.resultsCount = 0;
|
|
109
126
|
searchState.queryInProgress = false;
|
|
@@ -126,7 +143,7 @@ export default class {
|
|
|
126
143
|
}
|
|
127
144
|
|
|
128
145
|
searchCanceledInMenu() {
|
|
129
|
-
this.bookreader
|
|
146
|
+
this.bookreader.plugins.search.cancelSearchRequest();
|
|
130
147
|
}
|
|
131
148
|
|
|
132
149
|
onSearchResultsCleared() {
|
|
@@ -137,8 +154,23 @@ export default class {
|
|
|
137
154
|
queryInProgress: false,
|
|
138
155
|
errorMessage: '',
|
|
139
156
|
};
|
|
140
|
-
this.updateMenu();
|
|
141
|
-
this.bookreader
|
|
157
|
+
this.updateMenu({ openMenu: false });
|
|
158
|
+
this.bookreader.plugins.search.searchView.clearSearchFieldAndResults(false);
|
|
159
|
+
if (this.bookreader.urlPlugin) {
|
|
160
|
+
this.updateSearchInUrl();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** update URL `q=<term>` query param in URL */
|
|
165
|
+
updateSearchInUrl() {
|
|
166
|
+
if (this.bookreader.urlPlugin) {
|
|
167
|
+
this.bookreader.urlPlugin.pullFromAddressBar();
|
|
168
|
+
if (searchState.query) {
|
|
169
|
+
this.bookreader.urlPlugin.setUrlParam('q', searchState.query);
|
|
170
|
+
} else {
|
|
171
|
+
this.bookreader.urlPlugin.removeUrlParam('q');
|
|
172
|
+
}
|
|
173
|
+
}
|
|
142
174
|
}
|
|
143
175
|
|
|
144
176
|
/**
|
|
@@ -148,7 +180,7 @@ export default class {
|
|
|
148
180
|
updateMenu(searchUpdates = {}) {
|
|
149
181
|
this.menuDetails = this.getMenuDetails();
|
|
150
182
|
this.component = this.getComponent();
|
|
151
|
-
this.
|
|
183
|
+
this.onProviderChange(this.bookreader, searchUpdates);
|
|
152
184
|
}
|
|
153
185
|
|
|
154
186
|
getComponent() {
|
|
@@ -168,14 +200,10 @@ export default class {
|
|
|
168
200
|
`;
|
|
169
201
|
}
|
|
170
202
|
|
|
203
|
+
/**
|
|
204
|
+
* @param {{ detail: {match: SearchInsideMatch} }} param0
|
|
205
|
+
*/
|
|
171
206
|
onSearchResultsClicked({ detail }) {
|
|
172
|
-
|
|
173
|
-
this.advanceToPage(page);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
advanceToPage(leaf) {
|
|
177
|
-
const page = this.bookreader.leafNumToIndex(leaf);
|
|
178
|
-
this.bookreader._searchPluginGoToResult(page);
|
|
179
|
-
this.bookreader.updateSearchHilites();
|
|
207
|
+
this.bookreader.plugins.search.jumpToMatch(detail.match.matchIndex);
|
|
180
208
|
}
|
|
181
209
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/* eslint-disable class-methods-use-this */
|
|
2
|
-
import {
|
|
3
|
-
import { css, html, LitElement } from 'lit
|
|
4
|
-
import '@internetarchive/ia-activity-indicator/ia-activity-indicator';
|
|
5
|
-
import './a-search-result.js';
|
|
2
|
+
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
|
3
|
+
import { css, html, LitElement, nothing } from 'lit';
|
|
4
|
+
import '@internetarchive/ia-activity-indicator/ia-activity-indicator.js';
|
|
6
5
|
import checkmarkIcon from '../assets/icon_checkmark.js';
|
|
7
6
|
import closeIcon from '../assets/icon_close.js';
|
|
8
7
|
import buttonCSS from '../assets/button-base.js';
|
|
9
|
-
|
|
8
|
+
/** @typedef {import('@/src/plugins/search/plugin.search.js').SearchInsideMatch} SearchInsideMatch */
|
|
10
9
|
|
|
11
10
|
export class IABookSearchResults extends LitElement {
|
|
12
11
|
static get properties() {
|
|
@@ -24,11 +23,12 @@ export class IABookSearchResults extends LitElement {
|
|
|
24
23
|
constructor() {
|
|
25
24
|
super();
|
|
26
25
|
|
|
26
|
+
/** @type {SearchInsideMatch[]} */
|
|
27
27
|
this.results = [];
|
|
28
28
|
this.query = '';
|
|
29
29
|
this.queryInProgress = false;
|
|
30
30
|
this.renderHeader = false;
|
|
31
|
-
this.
|
|
31
|
+
this.renderSearchAllFiles = false;
|
|
32
32
|
this.displayResultImages = false;
|
|
33
33
|
this.errorMessage = '';
|
|
34
34
|
|
|
@@ -61,6 +61,9 @@ export class IABookSearchResults extends LitElement {
|
|
|
61
61
|
|
|
62
62
|
setQuery(e) {
|
|
63
63
|
this.query = e.currentTarget.value;
|
|
64
|
+
if (!this.query) {
|
|
65
|
+
this.cancelSearch();
|
|
66
|
+
}
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
performSearch(e) {
|
|
@@ -78,7 +81,15 @@ export class IABookSearchResults extends LitElement {
|
|
|
78
81
|
}));
|
|
79
82
|
}
|
|
80
83
|
|
|
81
|
-
|
|
84
|
+
/**
|
|
85
|
+
* @param {SearchInsideMatch} match
|
|
86
|
+
*/
|
|
87
|
+
selectResult(match) {
|
|
88
|
+
this.dispatchEvent(new CustomEvent('resultSelected', {
|
|
89
|
+
bubbles: true,
|
|
90
|
+
composed: true,
|
|
91
|
+
detail: { match },
|
|
92
|
+
}));
|
|
82
93
|
this.dispatchEvent(new CustomEvent('closeMenu', {
|
|
83
94
|
bubbles: true,
|
|
84
95
|
composed: true,
|
|
@@ -130,10 +141,12 @@ export class IABookSearchResults extends LitElement {
|
|
|
130
141
|
return html`
|
|
131
142
|
<ul class="results ${resultsClass}">
|
|
132
143
|
${this.results.map(match => html`
|
|
133
|
-
<
|
|
134
|
-
.
|
|
135
|
-
|
|
136
|
-
|
|
144
|
+
<li @click=${this.selectResult.bind(this, match)}>
|
|
145
|
+
${match.cover ? html`<img src="${match.cover}" />` : nothing}
|
|
146
|
+
<h4>${match.title || nothing}</h4>
|
|
147
|
+
<p class="page-num">Page ${match.displayPageNumber}</p>
|
|
148
|
+
<p>${unsafeHTML(match.html)}</p>
|
|
149
|
+
</li>
|
|
137
150
|
`)}
|
|
138
151
|
</ul>
|
|
139
152
|
`;
|
|
@@ -149,6 +162,7 @@ export class IABookSearchResults extends LitElement {
|
|
|
149
162
|
name="query"
|
|
150
163
|
alt="Search inside this book."
|
|
151
164
|
@keyup=${this.setQuery}
|
|
165
|
+
@search=${this.setQuery}
|
|
152
166
|
.value=${this.query}
|
|
153
167
|
/>
|
|
154
168
|
</fieldset>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { iauxShareIcon } from '@internetarchive/ia-item-navigator/dist/src/menus/share-panel.js';
|
|
3
|
+
import '@internetarchive/ia-item-navigator/dist/src/menus/share-panel.js';
|
|
4
|
+
|
|
5
|
+
export default class SharingProvider {
|
|
6
|
+
constructor({
|
|
7
|
+
item,
|
|
8
|
+
baseHost,
|
|
9
|
+
bookreader,
|
|
10
|
+
}) {
|
|
11
|
+
const { identifier, creator, title } = item?.metadata;
|
|
12
|
+
const creatorToUse = Array.isArray(creator) ? creator[0] : creator;
|
|
13
|
+
const subPrefix = bookreader.subPrefix || '';
|
|
14
|
+
const label = `Share this book`;
|
|
15
|
+
this.icon = html`${iauxShareIcon}`;
|
|
16
|
+
this.label = label;
|
|
17
|
+
this.id = 'share';
|
|
18
|
+
this.component = html`<iaux-in-share-panel
|
|
19
|
+
.identifier=${identifier}
|
|
20
|
+
.type=${`book`}
|
|
21
|
+
.creator=${creatorToUse}
|
|
22
|
+
.description=${title}
|
|
23
|
+
.baseHost=${baseHost}
|
|
24
|
+
.fileSubPrefix=${subPrefix}
|
|
25
|
+
></iaux-in-share-panel>`;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
|
|
3
|
+
import { viewableFilesIcon } from '@internetarchive/ia-item-navigator/dist/src/menus/viewable-files.js';
|
|
4
|
+
import '@internetarchive/ia-item-navigator/dist/src/menus/viewable-files.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* * @typedef { 'title_asc' | 'title_desc' | 'default'} SortTypesT
|
|
8
|
+
*/
|
|
9
|
+
const sortTypes = {
|
|
10
|
+
title_asc: 'title_asc',
|
|
11
|
+
title_desc: 'title_desc',
|
|
12
|
+
default: 'default',
|
|
13
|
+
};
|
|
14
|
+
export default class ViewableFilesProvider {
|
|
15
|
+
/**
|
|
16
|
+
* @param {import('../BookReader').default} bookreader
|
|
17
|
+
*/
|
|
18
|
+
constructor({ baseHost, bookreader, onProviderChange }) {
|
|
19
|
+
/** @type {import('../BookReader').default} */
|
|
20
|
+
this.bookreader = bookreader;
|
|
21
|
+
this.onProviderChange = onProviderChange;
|
|
22
|
+
this.baseHost = baseHost;
|
|
23
|
+
|
|
24
|
+
const files = bookreader.options.multipleBooksList.by_subprefix;
|
|
25
|
+
this.viewableFiles = Object.keys(files).map(item => files[item]);
|
|
26
|
+
this.volumeCount = Object.keys(files).length;
|
|
27
|
+
|
|
28
|
+
this.id = "volumes";
|
|
29
|
+
this.label = `Viewable files (${this.volumeCount})`;
|
|
30
|
+
this.icon = html`${viewableFilesIcon}`;
|
|
31
|
+
this.sortOrderBy = sortTypes.default;
|
|
32
|
+
|
|
33
|
+
this.component = document.createElement("iaux-in-viewable-files-panel");
|
|
34
|
+
this.component.addSortToUrl = true;
|
|
35
|
+
this.component.subPrefix = bookreader.options.subPrefix || "";
|
|
36
|
+
this.component.baseHost = baseHost;
|
|
37
|
+
this.component.fileList = [...this.viewableFiles];
|
|
38
|
+
|
|
39
|
+
this.sortFilesComponent = document.createElement("iaux-in-sort-files-button");
|
|
40
|
+
this.sortFilesComponent.fileListRaw = this.viewableFiles;
|
|
41
|
+
this.sortFilesComponent.addEventListener('fileListSorted', (e) => this.handleFileListSorted(e));
|
|
42
|
+
this.actionButton = this.sortFilesComponent;
|
|
43
|
+
|
|
44
|
+
// get sort state from query param
|
|
45
|
+
if (this.bookreader.urlPlugin) {
|
|
46
|
+
this.bookreader.urlPlugin.pullFromAddressBar();
|
|
47
|
+
|
|
48
|
+
const urlSortValue = this.bookreader.urlPlugin.getUrlParam('sort');
|
|
49
|
+
if (urlSortValue === sortTypes.title_asc || urlSortValue === sortTypes.title_desc) {
|
|
50
|
+
this.sortOrderBy = urlSortValue;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
this.sortFilesComponent.sortVolumes(this.sortOrderBy);
|
|
55
|
+
|
|
56
|
+
this.onProviderChange(this.bookreader);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** @param { SortTypesT } sortType */
|
|
60
|
+
async handleFileListSorted(event) {
|
|
61
|
+
const { sortType, sortedFiles } = event.detail;
|
|
62
|
+
|
|
63
|
+
this.viewableFiles = sortedFiles;
|
|
64
|
+
this.sortOrderBy = sortType;
|
|
65
|
+
|
|
66
|
+
// update the component
|
|
67
|
+
this.component.fileList = [...this.viewableFiles];
|
|
68
|
+
await this.component.updateComplete;
|
|
69
|
+
|
|
70
|
+
if (this.bookreader.urlPlugin) {
|
|
71
|
+
this.bookreader.urlPlugin.pullFromAddressBar();
|
|
72
|
+
if (this.sortOrderBy !== sortTypes.default) {
|
|
73
|
+
this.bookreader.urlPlugin.setUrlParam('sort', this.sortOrderBy);
|
|
74
|
+
} else {
|
|
75
|
+
this.bookreader.urlPlugin.removeUrlParam('sort');
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
this.onProviderChange(this.bookreader);
|
|
80
|
+
|
|
81
|
+
this.multipleFilesClicked(this.sortOrderBy);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* @param { SortTypesT } orderBy
|
|
86
|
+
*/
|
|
87
|
+
multipleFilesClicked(orderBy) {
|
|
88
|
+
window.archive_analytics?.send_event(
|
|
89
|
+
'BookReader',
|
|
90
|
+
`VolumesSort|${orderBy}`,
|
|
91
|
+
window.location.path,
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { html } from 'lit
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import '@internetarchive/icon-visual-adjustment/icon-visual-adjustment.js';
|
|
2
3
|
import './visual-adjustments.js';
|
|
3
4
|
|
|
4
5
|
const visualAdjustmentOptions = [{
|
|
@@ -19,19 +20,19 @@ const visualAdjustmentOptions = [{
|
|
|
19
20
|
value: 100,
|
|
20
21
|
}, {
|
|
21
22
|
id: 'invert',
|
|
22
|
-
name: '
|
|
23
|
+
name: 'Invert colors (dark mode)',
|
|
23
24
|
active: false,
|
|
24
25
|
}, {
|
|
25
26
|
id: 'grayscale',
|
|
26
|
-
name: '
|
|
27
|
+
name: 'Convert to grayscale',
|
|
27
28
|
active: false,
|
|
28
29
|
}];
|
|
29
30
|
|
|
30
|
-
export default class {
|
|
31
|
+
export default class VisualAdjustmentsProvider {
|
|
31
32
|
constructor(options) {
|
|
32
|
-
const {
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
33
|
+
const { onProviderChange, bookreader } = options;
|
|
34
|
+
this.onProviderChange = onProviderChange;
|
|
35
|
+
this.bookContainer = bookreader.refs.$brContainer;
|
|
35
36
|
this.bookreader = bookreader;
|
|
36
37
|
|
|
37
38
|
this.onAdjustmentChange = this.onAdjustmentChange.bind(this);
|
|
@@ -41,10 +42,10 @@ export default class {
|
|
|
41
42
|
this.onZoomOut = this.onZoomOut.bind(this);
|
|
42
43
|
|
|
43
44
|
this.activeCount = 0;
|
|
44
|
-
this.icon = html`<ia-icon
|
|
45
|
+
this.icon = html`<ia-icon-visual-adjustment style="width: var(--iconWidth); height: var(--iconHeight);"></ia-icon-visual-adjustment>`;
|
|
45
46
|
this.label = 'Visual Adjustments';
|
|
46
47
|
this.menuDetails = this.updateOptionsCount();
|
|
47
|
-
this.id = '
|
|
48
|
+
this.id = 'visualAdjustments';
|
|
48
49
|
this.component = html`
|
|
49
50
|
<ia-book-visual-adjustments
|
|
50
51
|
.options=${visualAdjustmentOptions}
|
|
@@ -60,7 +61,7 @@ export default class {
|
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
onZoomOut() {
|
|
63
|
-
this.bookreader.zoom();
|
|
64
|
+
this.bookreader.zoom(-1);
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
onAdjustmentChange(event) {
|
|
@@ -76,7 +77,7 @@ export default class {
|
|
|
76
77
|
return newValue ? [...values, newValue] : values;
|
|
77
78
|
}, []).join(' ');
|
|
78
79
|
|
|
79
|
-
|
|
80
|
+
this.bookContainer.css('filter', filters);
|
|
80
81
|
|
|
81
82
|
this.optionUpdateComplete(event);
|
|
82
83
|
}
|
|
@@ -84,7 +85,7 @@ export default class {
|
|
|
84
85
|
optionUpdateComplete(event) {
|
|
85
86
|
this.activeCount = event.detail.activeCount;
|
|
86
87
|
this.updateOptionsCount(event);
|
|
87
|
-
this.
|
|
88
|
+
this.onProviderChange();
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
updateOptionsCount() {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { css, html, LitElement } from "lit
|
|
2
|
-
import { repeat } from "lit
|
|
3
|
-
import { nothing } from "lit
|
|
1
|
+
import { css, html, LitElement } from "lit";
|
|
2
|
+
import { repeat } from "lit/directives/repeat.js";
|
|
3
|
+
import { nothing } from "lit";
|
|
4
4
|
import checkmarkIcon from '../assets/icon_checkmark.js';
|
|
5
|
-
import "@internetarchive/icon-magnify-minus/icon-magnify-minus";
|
|
6
|
-
import "@internetarchive/icon-magnify-plus/icon-magnify-plus";
|
|
5
|
+
import "@internetarchive/icon-magnify-minus/icon-magnify-minus.js";
|
|
6
|
+
import "@internetarchive/icon-magnify-plus/icon-magnify-plus.js";
|
|
7
7
|
|
|
8
8
|
const namespacedEvent = (eventName) => `visualAdjustment${eventName}`;
|
|
9
9
|
|
|
@@ -43,7 +43,7 @@ export class IABookVisualAdjustments extends LitElement {
|
|
|
43
43
|
get activeOptions() {
|
|
44
44
|
return this.options.reduce(
|
|
45
45
|
(results, option) => (option.active ? [...results, option.id] : results),
|
|
46
|
-
[]
|
|
46
|
+
[],
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -71,7 +71,7 @@ export class IABookVisualAdjustments extends LitElement {
|
|
|
71
71
|
bubbles: true,
|
|
72
72
|
composed: true,
|
|
73
73
|
detail,
|
|
74
|
-
})
|
|
74
|
+
}),
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -93,7 +93,7 @@ export class IABookVisualAdjustments extends LitElement {
|
|
|
93
93
|
changeActiveStateFor(optionName) {
|
|
94
94
|
const updatedOptions = [...this.options];
|
|
95
95
|
const checkedOption = updatedOptions.find(
|
|
96
|
-
(option) => option.id === optionName
|
|
96
|
+
(option) => option.id === optionName,
|
|
97
97
|
);
|
|
98
98
|
checkedOption.active = !checkedOption.active;
|
|
99
99
|
this.options = updatedOptions;
|
|
@@ -157,7 +157,7 @@ export class IABookVisualAdjustments extends LitElement {
|
|
|
157
157
|
|
|
158
158
|
get zoomControls() {
|
|
159
159
|
return html`
|
|
160
|
-
<h4>
|
|
160
|
+
<h4>Adjust zoom</h4>
|
|
161
161
|
<button class="zoom_out" @click=${this.emitZoomOut} title="zoom out">
|
|
162
162
|
<ia-icon-magnify-minus></ia-icon-magnify-minus>
|
|
163
163
|
</button>
|