@internetarchive/bookreader 5.0.0-11 → 5.0.0-110
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 +604 -1239
- 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 +1907 -0
- package/BookReader/ia-bookreader-bundle.js.LICENSE.txt +19 -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/slider-toggle.svg +1 -0
- 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 +22 -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 +92 -70
- 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 +66 -365
- package/src/BookReader/Mode1UpLit.js +392 -0
- package/src/BookReader/Mode2Up.js +87 -1315
- package/src/BookReader/Mode2UpLit.js +788 -0
- package/src/BookReader/ModeAbstract.js +43 -0
- package/src/BookReader/ModeCoordinateSpace.js +29 -0
- package/src/BookReader/ModeSmoothZoom.js +312 -0
- package/src/BookReader/ModeThumb.js +29 -15
- package/src/BookReader/Navbar/Navbar.js +201 -76
- 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 +3 -3
- package/src/BookReader/options.js +94 -17
- 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 +678 -1226
- 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/slider-toggle.svg +1 -0
- 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 +74 -70
- package/src/css/_BRpages.scss +171 -42
- 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 +8 -1
- package/src/{BookNavigator/assets → css}/button-base.js +2 -2
- package/src/css/icon_checkmark.js +9 -0
- package/src/css/sharedStyles.js +15 -0
- package/src/ia-bookreader/downloads/downloads-provider.js +81 -0
- package/src/{BookNavigator → ia-bookreader}/downloads/downloads.js +25 -5
- package/src/ia-bookreader/ia-bookreader.js +666 -0
- package/src/ia-bookreader/sharing.js +27 -0
- package/src/ia-bookreader/viewable-files.js +98 -0
- package/src/{BookNavigator → ia-bookreader}/visual-adjustments/visual-adjustments-provider.js +17 -17
- package/src/{BookNavigator → ia-bookreader}/visual-adjustments/visual-adjustments.js +75 -67
- package/src/{BookNavigator → plugins}/bookmarks/bookmark-button.js +4 -3
- package/src/{BookNavigator/assets → plugins/bookmarks}/bookmark-colors.js +1 -1
- package/src/{BookNavigator → plugins}/bookmarks/bookmark-edit.js +43 -31
- package/src/{BookNavigator → plugins}/bookmarks/bookmarks-list.js +48 -49
- package/src/{BookNavigator → plugins}/bookmarks/bookmarks-loginCTA.js +3 -3
- package/src/plugins/bookmarks/bookmarks-provider.js +63 -0
- package/src/{BookNavigator → plugins/bookmarks}/delete-modal-actions.js +1 -1
- package/src/{BookNavigator → plugins}/bookmarks/ia-bookmarks.js +117 -68
- 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 +522 -219
- package/src/plugins/plugin.vendor-fullscreen.js +5 -5
- package/src/plugins/search/plugin.search.js +374 -392
- package/src/{BookNavigator → plugins}/search/search-provider.js +59 -27
- package/src/{BookNavigator → plugins}/search/search-results.js +105 -76
- package/src/plugins/search/utils.js +50 -0
- package/src/plugins/search/view.js +50 -68
- package/src/plugins/translate/TranslationManager.js +164 -0
- package/src/plugins/translate/plugin.translate.js +512 -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 +345 -350
- package/src/plugins/tts/utils.js +77 -49
- 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/lit.js +15 -0
- 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 -495
- 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/assets/icon_checkmark.js +0 -6
- package/src/BookNavigator/assets/icon_close.js +0 -3
- package/src/BookNavigator/bookmarks/bookmarks-provider.js +0 -53
- package/src/BookNavigator/br-fullscreen-mgr.js +0 -83
- package/src/BookNavigator/downloads/downloads-provider.js +0 -66
- 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
|
@@ -0,0 +1,98 @@
|
|
|
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 {object} options
|
|
17
|
+
* @param {import('../BookReader').default} options.bookreader
|
|
18
|
+
* @param {string} options.baseHost
|
|
19
|
+
* @param {function} options.onProviderChange
|
|
20
|
+
*/
|
|
21
|
+
constructor({ baseHost, bookreader, onProviderChange }) {
|
|
22
|
+
/** @type {import('../BookReader').default} */
|
|
23
|
+
this.bookreader = bookreader;
|
|
24
|
+
this.onProviderChange = onProviderChange;
|
|
25
|
+
this.baseHost = baseHost;
|
|
26
|
+
|
|
27
|
+
const files = bookreader.options.multipleBooksList.by_subprefix;
|
|
28
|
+
this.viewableFiles = Object.keys(files).map(item => files[item]);
|
|
29
|
+
this.volumeCount = Object.keys(files).length;
|
|
30
|
+
|
|
31
|
+
this.id = "volumes";
|
|
32
|
+
this.label = `Viewable files (${this.volumeCount})`;
|
|
33
|
+
this.icon = html`${viewableFilesIcon}`;
|
|
34
|
+
this.sortOrderBy = sortTypes.default;
|
|
35
|
+
|
|
36
|
+
this.component = document.createElement("iaux-in-viewable-files-panel");
|
|
37
|
+
this.component.addSortToUrl = true;
|
|
38
|
+
this.component.subPrefix = bookreader.options.subPrefix || "";
|
|
39
|
+
this.component.baseHost = baseHost;
|
|
40
|
+
this.component.fileList = [...this.viewableFiles];
|
|
41
|
+
|
|
42
|
+
this.sortFilesComponent = document.createElement("iaux-in-sort-files-button");
|
|
43
|
+
this.sortFilesComponent.fileListRaw = this.viewableFiles;
|
|
44
|
+
this.sortFilesComponent.addEventListener('fileListSorted', (e) => this.handleFileListSorted(e));
|
|
45
|
+
this.actionButton = this.sortFilesComponent;
|
|
46
|
+
|
|
47
|
+
// get sort state from query param
|
|
48
|
+
if (this.bookreader.urlPlugin) {
|
|
49
|
+
this.bookreader.urlPlugin.pullFromAddressBar();
|
|
50
|
+
|
|
51
|
+
const urlSortValue = this.bookreader.urlPlugin.getUrlParam('sort');
|
|
52
|
+
if (urlSortValue === sortTypes.title_asc || urlSortValue === sortTypes.title_desc) {
|
|
53
|
+
this.sortOrderBy = urlSortValue;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
this.sortFilesComponent.sortVolumes(this.sortOrderBy);
|
|
58
|
+
|
|
59
|
+
this.onProviderChange(this.bookreader);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** @param { SortTypesT } sortType */
|
|
63
|
+
async handleFileListSorted(event) {
|
|
64
|
+
const { sortType, sortedFiles } = event.detail;
|
|
65
|
+
|
|
66
|
+
this.viewableFiles = sortedFiles;
|
|
67
|
+
this.sortOrderBy = sortType;
|
|
68
|
+
|
|
69
|
+
// update the component
|
|
70
|
+
this.component.fileList = [...this.viewableFiles];
|
|
71
|
+
await this.component.updateComplete;
|
|
72
|
+
|
|
73
|
+
if (this.bookreader.urlPlugin) {
|
|
74
|
+
this.bookreader.urlPlugin.pullFromAddressBar();
|
|
75
|
+
if (this.sortOrderBy !== sortTypes.default) {
|
|
76
|
+
this.bookreader.urlPlugin.setUrlParam('sort', this.sortOrderBy);
|
|
77
|
+
} else {
|
|
78
|
+
this.bookreader.urlPlugin.removeUrlParam('sort');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
this.onProviderChange(this.bookreader);
|
|
83
|
+
|
|
84
|
+
this.multipleFilesClicked(this.sortOrderBy);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @param { SortTypesT } orderBy
|
|
89
|
+
*/
|
|
90
|
+
multipleFilesClicked(orderBy) {
|
|
91
|
+
window.archive_analytics?.send_event(
|
|
92
|
+
'BookReader',
|
|
93
|
+
`VolumesSort|${orderBy}`,
|
|
94
|
+
window.location.path,
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
}
|
package/src/{BookNavigator → ia-bookreader}/visual-adjustments/visual-adjustments-provider.js
RENAMED
|
@@ -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 = [{
|
|
@@ -6,32 +7,31 @@ const visualAdjustmentOptions = [{
|
|
|
6
7
|
name: 'Adjust brightness',
|
|
7
8
|
active: false,
|
|
8
9
|
min: 0,
|
|
9
|
-
max:
|
|
10
|
+
max: 200,
|
|
10
11
|
step: 1,
|
|
11
|
-
value:
|
|
12
|
+
value: 120,
|
|
12
13
|
}, {
|
|
13
14
|
id: 'contrast',
|
|
14
15
|
name: 'Adjust contrast',
|
|
15
16
|
active: false,
|
|
16
17
|
min: 0,
|
|
17
|
-
max:
|
|
18
|
+
max: 200,
|
|
18
19
|
step: 1,
|
|
19
|
-
value:
|
|
20
|
+
value: 120,
|
|
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
|
-
constructor(
|
|
32
|
-
|
|
33
|
-
this.
|
|
34
|
-
this.bookContainerSelector = bookContainerSelector;
|
|
31
|
+
export default class VisualAdjustmentsProvider {
|
|
32
|
+
constructor({ onProviderChange, bookreader }) {
|
|
33
|
+
this.onProviderChange = onProviderChange;
|
|
34
|
+
this.bookContainer = bookreader.refs.$brContainer;
|
|
35
35
|
this.bookreader = bookreader;
|
|
36
36
|
|
|
37
37
|
this.onAdjustmentChange = this.onAdjustmentChange.bind(this);
|
|
@@ -41,10 +41,10 @@ export default class {
|
|
|
41
41
|
this.onZoomOut = this.onZoomOut.bind(this);
|
|
42
42
|
|
|
43
43
|
this.activeCount = 0;
|
|
44
|
-
this.icon = html`<ia-icon
|
|
44
|
+
this.icon = html`<ia-icon-visual-adjustment aria-hidden="true" role="presentation" style="width: var(--iconWidth); height: var(--iconHeight);"></ia-icon-visual-adjustment>`;
|
|
45
45
|
this.label = 'Visual Adjustments';
|
|
46
46
|
this.menuDetails = this.updateOptionsCount();
|
|
47
|
-
this.id = '
|
|
47
|
+
this.id = 'visualAdjustments';
|
|
48
48
|
this.component = html`
|
|
49
49
|
<ia-book-visual-adjustments
|
|
50
50
|
.options=${visualAdjustmentOptions}
|
|
@@ -60,7 +60,7 @@ export default class {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
onZoomOut() {
|
|
63
|
-
this.bookreader.zoom();
|
|
63
|
+
this.bookreader.zoom(-1);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
onAdjustmentChange(event) {
|
|
@@ -76,7 +76,7 @@ export default class {
|
|
|
76
76
|
return newValue ? [...values, newValue] : values;
|
|
77
77
|
}, []).join(' ');
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
this.bookContainer.css('filter', filters);
|
|
80
80
|
|
|
81
81
|
this.optionUpdateComplete(event);
|
|
82
82
|
}
|
|
@@ -84,7 +84,7 @@ export default class {
|
|
|
84
84
|
optionUpdateComplete(event) {
|
|
85
85
|
this.activeCount = event.detail.activeCount;
|
|
86
86
|
this.updateOptionsCount(event);
|
|
87
|
-
this.
|
|
87
|
+
this.onProviderChange();
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
updateOptionsCount() {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { css, html, LitElement } from "lit
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import "@internetarchive/icon-magnify-minus/icon-magnify-minus";
|
|
6
|
-
import "@internetarchive/icon-magnify-plus/icon-magnify-plus";
|
|
1
|
+
import { css, html, LitElement, nothing } from "lit";
|
|
2
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
3
|
+
import { repeat } from "lit/directives/repeat.js";
|
|
4
|
+
import { sharedStyles } from '../../css/sharedStyles.js';
|
|
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,12 +93,19 @@ 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;
|
|
100
100
|
this.activeCount = this.activeOptions.length;
|
|
101
101
|
this.emitOptionChangedEvent(checkedOption.id);
|
|
102
|
+
if (checkedOption.active && checkedOption.value !== undefined) {
|
|
103
|
+
// move focus to the range input
|
|
104
|
+
const rangeInput = this.shadowRoot.querySelector(`input[name="${checkedOption.id}_range"]`);
|
|
105
|
+
requestAnimationFrame(() => {
|
|
106
|
+
rangeInput?.focus();
|
|
107
|
+
});
|
|
108
|
+
}
|
|
102
109
|
}
|
|
103
110
|
|
|
104
111
|
setRangeValue(id, value) {
|
|
@@ -110,7 +117,8 @@ export class IABookVisualAdjustments extends LitElement {
|
|
|
110
117
|
/* render */
|
|
111
118
|
rangeSlider(option) {
|
|
112
119
|
return html`
|
|
113
|
-
<
|
|
120
|
+
<label class=${`range${option.active ? " visible" : ""}`}>
|
|
121
|
+
<span class="sr-only">${option.name}</span>
|
|
114
122
|
<input
|
|
115
123
|
type="range"
|
|
116
124
|
name="${option.id}_range"
|
|
@@ -118,30 +126,30 @@ export class IABookVisualAdjustments extends LitElement {
|
|
|
118
126
|
max=${option.max || 100}
|
|
119
127
|
step=${option.step || 1}
|
|
120
128
|
.value=${option.value}
|
|
129
|
+
aria-valuetext=${`${option.value}%`}
|
|
121
130
|
@input=${(e) => this.setRangeValue(option.id, e.target.value)}
|
|
122
131
|
@change=${() => this.emitOptionChangedEvent()}
|
|
123
132
|
/>
|
|
124
|
-
<
|
|
125
|
-
</
|
|
133
|
+
<span aria-hidden="true">${option.value}%</span>
|
|
134
|
+
</label>
|
|
126
135
|
`;
|
|
127
136
|
}
|
|
128
137
|
|
|
129
138
|
adjustmentCheckbox(option) {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
</
|
|
143
|
-
|
|
144
|
-
</li>`;
|
|
139
|
+
return html`
|
|
140
|
+
<div
|
|
141
|
+
class="adjustment-option ${classMap({active: option.active, 'has-range': option.value !== undefined})}">
|
|
142
|
+
<label class="checkbox-label">
|
|
143
|
+
${option.name}
|
|
144
|
+
<input
|
|
145
|
+
type="checkbox"
|
|
146
|
+
@change=${() => this.changeActiveStateFor(option.id)}
|
|
147
|
+
?checked=${option.active}
|
|
148
|
+
/>
|
|
149
|
+
</label>
|
|
150
|
+
${option.value !== undefined ? this.rangeSlider(option) : nothing}
|
|
151
|
+
</div>
|
|
152
|
+
`;
|
|
145
153
|
}
|
|
146
154
|
|
|
147
155
|
get headerSection() {
|
|
@@ -157,12 +165,12 @@ export class IABookVisualAdjustments extends LitElement {
|
|
|
157
165
|
|
|
158
166
|
get zoomControls() {
|
|
159
167
|
return html`
|
|
160
|
-
<h4>
|
|
161
|
-
<button class="zoom_out" @click=${this.emitZoomOut} title="
|
|
162
|
-
<ia-icon-magnify-minus></ia-icon-magnify-minus>
|
|
168
|
+
<h4>Adjust zoom</h4>
|
|
169
|
+
<button class="zoom_out" @click=${this.emitZoomOut} title="Zoom out" aria-label="Zoom out">
|
|
170
|
+
<ia-icon-magnify-minus aria-hidden="true" role="presentation"></ia-icon-magnify-minus>
|
|
163
171
|
</button>
|
|
164
|
-
<button class="zoom_in" @click=${this.emitZoomIn} title="
|
|
165
|
-
<ia-icon-magnify-plus></ia-icon-magnify-plus>
|
|
172
|
+
<button class="zoom_in" @click=${this.emitZoomIn} title="Zoom in" aria-label="Zoom in">
|
|
173
|
+
<ia-icon-magnify-plus aria-hidden="true" role="presentation"></ia-icon-magnify-plus>
|
|
166
174
|
</button>
|
|
167
175
|
`;
|
|
168
176
|
}
|
|
@@ -171,21 +179,20 @@ export class IABookVisualAdjustments extends LitElement {
|
|
|
171
179
|
render() {
|
|
172
180
|
return html`
|
|
173
181
|
${this.headerSection}
|
|
174
|
-
|
|
175
|
-
${repeat(this.options, (option) => option.id, this.adjustmentCheckbox.bind(this))}
|
|
176
|
-
</ul>
|
|
182
|
+
${repeat(this.options, (option) => option.id, this.adjustmentCheckbox.bind(this))}
|
|
177
183
|
${this.showZoomControls ? this.zoomControls : nothing}
|
|
178
184
|
`;
|
|
179
185
|
}
|
|
180
186
|
|
|
181
187
|
static get styles() {
|
|
182
|
-
|
|
188
|
+
const main = css`
|
|
183
189
|
:host {
|
|
184
190
|
display: block;
|
|
185
191
|
height: 100%;
|
|
186
192
|
overflow-y: auto;
|
|
187
193
|
font-size: 1.4rem;
|
|
188
194
|
box-sizing: border-box;
|
|
195
|
+
padding: 10px 10px 0 0;
|
|
189
196
|
}
|
|
190
197
|
|
|
191
198
|
header {
|
|
@@ -207,49 +214,48 @@ export class IABookVisualAdjustments extends LitElement {
|
|
|
207
214
|
font-style: italic;
|
|
208
215
|
}
|
|
209
216
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
margin-
|
|
217
|
+
.adjustment-option {
|
|
218
|
+
border: 2px solid transparent;
|
|
219
|
+
border-radius: 4px;
|
|
220
|
+
margin-bottom: 4px;
|
|
214
221
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
display: none;
|
|
222
|
+
.adjustment-option.has-range.active {
|
|
223
|
+
border: 2px solid rgba(255, 255, 255, 0.2);
|
|
218
224
|
}
|
|
219
225
|
|
|
220
|
-
label {
|
|
226
|
+
.checkbox-label {
|
|
221
227
|
display: flex;
|
|
222
228
|
justify-content: space-between;
|
|
223
|
-
align-items:
|
|
229
|
+
align-items: center;
|
|
224
230
|
font-size: 1.4rem;
|
|
225
231
|
font-weight: bold;
|
|
226
|
-
|
|
227
|
-
|
|
232
|
+
cursor: pointer;
|
|
233
|
+
padding: 6px 8px;
|
|
234
|
+
transition: background-color 0.2s;
|
|
235
|
+
border-radius: inherit;
|
|
228
236
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
margin-left: .7rem;
|
|
235
|
-
border: 1px solid var(--primaryTextColor);
|
|
236
|
-
border-radius: 2px;
|
|
237
|
-
background: var(--activeButtonBg) 50% 50% no-repeat;
|
|
237
|
+
.checkbox-label:hover {
|
|
238
|
+
background-color: rgba(255, 255, 255, 0.1);
|
|
239
|
+
}
|
|
240
|
+
.adjustment-option.has-range.active > .checkbox-label {
|
|
241
|
+
border-radius: 4px 4px 0 0;
|
|
238
242
|
}
|
|
239
|
-
|
|
240
|
-
|
|
243
|
+
|
|
244
|
+
[type="checkbox"] {
|
|
245
|
+
transform: scale(1.5);
|
|
241
246
|
}
|
|
242
247
|
|
|
243
248
|
.range {
|
|
244
249
|
display: none;
|
|
245
|
-
padding
|
|
250
|
+
padding: 10px;
|
|
251
|
+
align-items: center;
|
|
252
|
+
gap: 10px;
|
|
246
253
|
}
|
|
247
254
|
.range.visible {
|
|
248
255
|
display: flex;
|
|
249
256
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
margin-left: 1rem;
|
|
257
|
+
.range input[type="range"] {
|
|
258
|
+
flex: 1;
|
|
253
259
|
}
|
|
254
260
|
|
|
255
261
|
h4 {
|
|
@@ -262,19 +268,21 @@ export class IABookVisualAdjustments extends LitElement {
|
|
|
262
268
|
-webkit-appearance: none;
|
|
263
269
|
appearance: none;
|
|
264
270
|
border: none;
|
|
265
|
-
border-radius: 0;
|
|
266
271
|
background: transparent;
|
|
267
|
-
outline: none;
|
|
268
272
|
cursor: pointer;
|
|
269
273
|
--iconFillColor: var(--primaryTextColor);
|
|
270
274
|
--iconStrokeColor: var(--primaryTextColor);
|
|
271
275
|
height: 4rem;
|
|
272
276
|
width: 4rem;
|
|
277
|
+
transition: background-color 0.2s;
|
|
278
|
+
border-radius: 4px;
|
|
273
279
|
}
|
|
274
280
|
|
|
275
|
-
button
|
|
276
|
-
|
|
277
|
-
}
|
|
281
|
+
button:hover {
|
|
282
|
+
background-color: rgba(255, 255, 255, 0.1);
|
|
283
|
+
}
|
|
284
|
+
`;
|
|
285
|
+
return [sharedStyles, main];
|
|
278
286
|
}
|
|
279
287
|
}
|
|
280
288
|
customElements.define('ia-book-visual-adjustments', IABookVisualAdjustments);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement, html, css } from 'lit
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
2
|
|
|
3
3
|
export default class BookmarkButton extends LitElement {
|
|
4
4
|
static get styles() {
|
|
@@ -12,7 +12,7 @@ export default class BookmarkButton extends LitElement {
|
|
|
12
12
|
height: 4rem;
|
|
13
13
|
width: 4rem;
|
|
14
14
|
background: transparent;
|
|
15
|
-
cursor: url('/
|
|
15
|
+
cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 0 16 24' width='16'%3E%3Cg fill='%23333' fill-rule='evenodd'%3E%3Cpath d='m15 0c.5522847 0 1 .44771525 1 1v23l-8-5.4545455-8 5.4545455v-23c0-.55228475.44771525-1 1-1zm-2 2h-10c-.51283584 0-.93550716.38604019-.99327227.88337887l-.00672773.11662113v18l6-4.3181818 6 4.3181818v-18c0-.51283584-.3860402-.93550716-.8833789-.99327227z'/%3E%3Cpath d='m8.75 6v2.25h2.25v1.5h-2.25v2.25h-1.5v-2.25h-2.25v-1.5h2.25v-2.25z' fill-rule='nonzero'/%3E%3C/g%3E%3C/svg%3E"), pointer;
|
|
16
16
|
position: relative;
|
|
17
17
|
}
|
|
18
18
|
button > * {
|
|
@@ -40,6 +40,7 @@ export default class BookmarkButton extends LitElement {
|
|
|
40
40
|
constructor() {
|
|
41
41
|
super();
|
|
42
42
|
this.state = 'hollow';
|
|
43
|
+
this.side = undefined;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
handleClick(e) {
|
|
@@ -55,7 +56,7 @@ export default class BookmarkButton extends LitElement {
|
|
|
55
56
|
const position = this.side || 'right';
|
|
56
57
|
return html`
|
|
57
58
|
<button title=${this.title} @click=${this.handleClick} class=${position}>
|
|
58
|
-
<icon-bookmark state=${this.state}></icon-bookmark>
|
|
59
|
+
<icon-bookmark state=${this.state} aria-hidden="true"></icon-bookmark>
|
|
59
60
|
</button>
|
|
60
61
|
`;
|
|
61
62
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import buttonCSS from '../assets/button-base.js';
|
|
1
|
+
import { repeat } from 'lit/directives/repeat.js';
|
|
2
|
+
import { css, html, LitElement, nothing } from 'lit';
|
|
3
|
+
import bookmarkColorsCSS from './bookmark-colors.js';
|
|
4
|
+
import buttonCSS from '../../css/button-base.js';
|
|
6
5
|
|
|
7
6
|
export class IABookmarkEdit extends LitElement {
|
|
8
7
|
static get properties() {
|
|
@@ -65,12 +64,12 @@ export class IABookmarkEdit extends LitElement {
|
|
|
65
64
|
|
|
66
65
|
bookmarkColor(color) {
|
|
67
66
|
return html`
|
|
68
|
-
<
|
|
67
|
+
<div class="color-option">
|
|
69
68
|
<input type="radio" name="color" id="color_${color.id}" .value=${color.id} @change=${() => this.changeColorTo(color.id)} ?checked=${this.bookmark.color === color.id}>
|
|
70
|
-
<label for="color_${color.id}">
|
|
71
|
-
<icon-bookmark class=${color.className}></icon-bookmark>
|
|
69
|
+
<label for="color_${color.id}" title=${color.className}>
|
|
70
|
+
<icon-bookmark class=${color.className} aria-hidden="true"></icon-bookmark>
|
|
72
71
|
</label>
|
|
73
|
-
</
|
|
72
|
+
</div>
|
|
74
73
|
`;
|
|
75
74
|
}
|
|
76
75
|
|
|
@@ -88,18 +87,18 @@ export class IABookmarkEdit extends LitElement {
|
|
|
88
87
|
${this.renderHeader ? IABookmarkEdit.headerSection : nothing}
|
|
89
88
|
${this.showBookmark ? this.bookmarkTemplate : nothing}
|
|
90
89
|
<form action="" method="put" @submit=${this.emitSaveEvent}>
|
|
90
|
+
<label for="note">Note <small>(optional)</small></label>
|
|
91
|
+
<textarea rows="4" cols="80" name="note" id="note" @change=${this.updateNote}>${this.bookmark.note}</textarea>
|
|
91
92
|
<fieldset>
|
|
92
|
-
<
|
|
93
|
-
<
|
|
94
|
-
<label for="color">Bookmark color</label>
|
|
95
|
-
<ul>
|
|
93
|
+
<legend>Bookmark color</legend>
|
|
94
|
+
<div class="color-options">
|
|
96
95
|
${repeat(this.bookmarkColors, color => color.id, this.bookmarkColor.bind(this))}
|
|
97
|
-
</ul>
|
|
98
|
-
<div class="actions">
|
|
99
|
-
<button type="button" class="ia-button cancel" @click=${this.emitDeleteEvent}>Delete</button>
|
|
100
|
-
<input class="ia-button" type="submit" value="Save">
|
|
101
96
|
</div>
|
|
102
97
|
</fieldset>
|
|
98
|
+
<div class="actions">
|
|
99
|
+
<button type="button" class="ia-button cancel" @click=${this.emitDeleteEvent}>Delete</button>
|
|
100
|
+
<input class="ia-button" type="submit" value="Save">
|
|
101
|
+
</div>
|
|
103
102
|
</form>
|
|
104
103
|
`;
|
|
105
104
|
}
|
|
@@ -129,11 +128,11 @@ export class IABookmarkEdit extends LitElement {
|
|
|
129
128
|
}
|
|
130
129
|
|
|
131
130
|
fieldset {
|
|
132
|
-
padding:
|
|
131
|
+
padding: 0;
|
|
133
132
|
border: none;
|
|
134
133
|
}
|
|
135
134
|
|
|
136
|
-
label {
|
|
135
|
+
label, legend {
|
|
137
136
|
display: block;
|
|
138
137
|
font-weight: bold;
|
|
139
138
|
}
|
|
@@ -153,21 +152,24 @@ export class IABookmarkEdit extends LitElement {
|
|
|
153
152
|
resize: vertical;
|
|
154
153
|
}
|
|
155
154
|
|
|
156
|
-
|
|
157
|
-
display:
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
list-style: none;
|
|
155
|
+
.color-options {
|
|
156
|
+
display: flex;
|
|
157
|
+
gap: 10px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.color-option {
|
|
161
|
+
position: relative;
|
|
164
162
|
}
|
|
165
163
|
|
|
166
|
-
|
|
167
|
-
|
|
164
|
+
.color-option input {
|
|
165
|
+
position: absolute;
|
|
166
|
+
opacity: 0;
|
|
167
|
+
width: 0;
|
|
168
|
+
height: 0;
|
|
169
|
+
pointer-events: none;
|
|
168
170
|
}
|
|
169
171
|
|
|
170
|
-
|
|
172
|
+
.color-option label {
|
|
171
173
|
display: block;
|
|
172
174
|
min-width: 50px;
|
|
173
175
|
padding-top: .4rem;
|
|
@@ -177,10 +179,19 @@ export class IABookmarkEdit extends LitElement {
|
|
|
177
179
|
cursor: pointer;
|
|
178
180
|
}
|
|
179
181
|
|
|
180
|
-
|
|
182
|
+
.color-option input:checked + label {
|
|
181
183
|
border-color: var(--primaryTextColor);
|
|
182
184
|
}
|
|
183
185
|
|
|
186
|
+
.color-option input:focus + label {
|
|
187
|
+
outline: 2px solid currentColor;
|
|
188
|
+
outline-offset: 2px;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.color-option input:focus:not(:focus-visible) + label {
|
|
192
|
+
outline: none;
|
|
193
|
+
}
|
|
194
|
+
|
|
184
195
|
input[type="submit"] {
|
|
185
196
|
background: var(--primaryCTAFill);
|
|
186
197
|
border-color: var(--primaryCTABorder);
|
|
@@ -203,6 +214,7 @@ export class IABookmarkEdit extends LitElement {
|
|
|
203
214
|
}
|
|
204
215
|
|
|
205
216
|
.actions {
|
|
217
|
+
margin-top: 20px;
|
|
206
218
|
display: grid;
|
|
207
219
|
grid-template-columns: auto auto;
|
|
208
220
|
grid-gap: 0 1rem;
|