@internetarchive/elements 1.1.7-webdev-9054.1 → 1.1.7-webdev-9540.1
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/README.md +19 -0
- package/dist/src/elements/ia-combo-box/ia-combo-box.d.ts.map +1 -1
- package/dist/src/elements/ia-combo-box/ia-combo-box.js +24 -21
- package/dist/src/elements/ia-combo-box/ia-combo-box.js.map +1 -1
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/paypal/paypal.d.ts.map +1 -1
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/paypal/paypal.js +3 -4
- package/dist/src/elements/ia-donation-form/braintree/payment-providers/paypal/paypal.js.map +1 -1
- package/dist/src/elements/ia-dropdown-search-bar/ia-dropdown-search-bar.d.ts.map +1 -1
- package/dist/src/elements/ia-dropdown-search-bar/ia-dropdown-search-bar.js +4 -3
- package/dist/src/elements/ia-dropdown-search-bar/ia-dropdown-search-bar.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-item-navigator.d.ts.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-item-navigator.js +25 -7
- package/dist/src/elements/ia-item-navigator/ia-item-navigator.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-itemnav-menu-button.d.ts.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-itemnav-menu-button.js +7 -6
- package/dist/src/elements/ia-item-navigator/ia-itemnav-menu-button.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-itemnav-menu-slider.d.ts.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-itemnav-menu-slider.js +8 -7
- package/dist/src/elements/ia-item-navigator/ia-itemnav-menu-slider.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-share-panel.d.ts +2 -2
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-share-panel.d.ts.map +1 -1
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-share-panel.js +32 -13
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-share-panel.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-sort-files-button.js +10 -10
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-sort-files-button.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-viewable-files-panel.d.ts.map +1 -1
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-viewable-files-panel.js +3 -3
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-viewable-files-panel.js.map +1 -1
- package/dist/src/elements/ia-scrubber-bar/ia-section-marker.d.ts.map +1 -1
- package/dist/src/elements/ia-scrubber-bar/ia-section-marker.js +7 -2
- package/dist/src/elements/ia-scrubber-bar/ia-section-marker.js.map +1 -1
- package/dist/src/elements/ia-status-indicator/ia-status-indicator.d.ts +5 -5
- package/dist/src/elements/ia-status-indicator/ia-status-indicator.d.ts.map +1 -1
- package/dist/src/elements/ia-status-indicator/ia-status-indicator.js +25 -25
- package/dist/src/elements/ia-status-indicator/ia-status-indicator.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-primary-nav.d.ts +3 -0
- package/dist/src/elements/ia-topnav/ia-topnav-primary-nav.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-primary-nav.js +35 -5
- package/dist/src/elements/ia-topnav/ia-topnav-primary-nav.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav.d.ts +1 -0
- package/dist/src/elements/ia-topnav/ia-topnav.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav.js +6 -2
- package/dist/src/elements/ia-topnav/ia-topnav.js.map +1 -1
- package/dist/src/{elements/ia-scrubber-bar/assets/next-section-marker.d.ts → icons/caret-closed.d.ts} +1 -1
- package/dist/src/icons/caret-closed.d.ts.map +1 -0
- package/dist/src/icons/caret-closed.js +6 -0
- package/dist/src/icons/caret-closed.js.map +1 -0
- package/dist/src/{elements/ia-scrubber-bar/assets/previous-section-marker.d.ts → icons/caret-open.d.ts} +1 -1
- package/dist/src/icons/caret-open.d.ts.map +1 -0
- package/dist/src/icons/caret-open.js +6 -0
- package/dist/src/icons/caret-open.js.map +1 -0
- package/dist/src/icons/clear.d.ts +3 -0
- package/dist/src/icons/clear.d.ts.map +1 -0
- package/dist/src/icons/clear.js +7 -0
- package/dist/src/icons/clear.js.map +1 -0
- package/dist/src/icons/collapse-sidebar.d.ts +3 -0
- package/dist/src/icons/collapse-sidebar.d.ts.map +1 -0
- package/dist/src/icons/collapse-sidebar.js +8 -0
- package/dist/src/icons/collapse-sidebar.js.map +1 -0
- package/dist/src/{elements/ia-item-navigator/icons → icons}/collapse-sidebar.svg +1 -1
- package/dist/src/icons/ellipses.d.ts +3 -0
- package/dist/src/icons/ellipses.d.ts.map +1 -0
- package/dist/src/icons/ellipses.js +8 -0
- package/dist/src/icons/ellipses.js.map +1 -0
- package/dist/src/{elements/ia-item-navigator/icons → icons}/ellipses.svg +1 -1
- package/dist/src/icons/email.d.ts +3 -0
- package/dist/src/icons/email.d.ts.map +1 -0
- package/dist/src/icons/email.js +7 -0
- package/dist/src/icons/email.js.map +1 -0
- package/dist/src/{elements/ia-item-navigator/menus/icons → icons}/email.svg +1 -1
- package/dist/src/icons/facebook.d.ts +3 -0
- package/dist/src/icons/facebook.d.ts.map +1 -0
- package/dist/src/icons/facebook.js +7 -0
- package/dist/src/icons/facebook.js.map +1 -0
- package/dist/src/{elements/ia-item-navigator/menus/icons → icons}/facebook.svg +1 -1
- package/dist/src/icons/link.d.ts +3 -0
- package/dist/src/icons/link.d.ts.map +1 -0
- package/dist/src/icons/link.js +7 -0
- package/dist/src/icons/link.js.map +1 -0
- package/dist/src/{elements/ia-item-navigator/menus/icons → icons}/link.svg +1 -1
- package/dist/src/icons/list.d.ts +3 -0
- package/dist/src/icons/list.d.ts.map +1 -0
- package/dist/src/icons/list.js +4 -0
- package/dist/src/icons/list.js.map +1 -0
- package/dist/src/icons/list.svg +3 -0
- package/dist/src/icons/mediatype-audio.d.ts +3 -0
- package/dist/src/icons/mediatype-audio.d.ts.map +1 -0
- package/dist/src/icons/mediatype-audio.js +4 -0
- package/dist/src/icons/mediatype-audio.js.map +1 -0
- package/dist/src/{elements/ia-status-indicator/icons/audio.svg → icons/mediatype-audio.svg} +1 -1
- package/dist/src/icons/mediatype-collection.d.ts +3 -0
- package/dist/src/icons/mediatype-collection.d.ts.map +1 -0
- package/dist/src/icons/mediatype-collection.js +4 -0
- package/dist/src/icons/mediatype-collection.js.map +1 -0
- package/dist/src/{elements/ia-status-indicator/icons/collection.svg → icons/mediatype-collection.svg} +1 -1
- package/dist/src/icons/mediatype-etree.d.ts +3 -0
- package/dist/src/icons/mediatype-etree.d.ts.map +1 -0
- package/dist/src/icons/mediatype-etree.js +4 -0
- package/dist/src/icons/mediatype-etree.js.map +1 -0
- package/dist/src/{elements/ia-status-indicator/icons/etree.svg → icons/mediatype-etree.svg} +1 -1
- package/dist/src/icons/mediatype-images.d.ts +3 -0
- package/dist/src/icons/mediatype-images.d.ts.map +1 -0
- package/dist/src/icons/mediatype-images.js +4 -0
- package/dist/src/icons/mediatype-images.js.map +1 -0
- package/dist/src/{elements/ia-status-indicator/icons/images.svg → icons/mediatype-images.svg} +1 -1
- package/dist/src/icons/mediatype-software.d.ts +3 -0
- package/dist/src/icons/mediatype-software.d.ts.map +1 -0
- package/dist/src/icons/mediatype-software.js +4 -0
- package/dist/src/icons/mediatype-software.js.map +1 -0
- package/dist/src/{elements/ia-status-indicator/icons/software.svg → icons/mediatype-software.svg} +1 -1
- package/dist/src/icons/mediatype-texts.d.ts +3 -0
- package/dist/src/icons/mediatype-texts.d.ts.map +1 -0
- package/dist/src/icons/mediatype-texts.js +4 -0
- package/dist/src/icons/mediatype-texts.js.map +1 -0
- package/dist/src/{elements/ia-status-indicator/icons/texts.svg → icons/mediatype-texts.svg} +1 -1
- package/dist/src/icons/mediatype-tv.d.ts +3 -0
- package/dist/src/icons/mediatype-tv.d.ts.map +1 -0
- package/dist/src/icons/mediatype-tv.js +4 -0
- package/dist/src/icons/mediatype-tv.js.map +1 -0
- package/dist/src/{elements/ia-status-indicator/icons/tv.svg → icons/mediatype-tv.svg} +1 -1
- package/dist/src/icons/mediatype-video.d.ts +3 -0
- package/dist/src/icons/mediatype-video.d.ts.map +1 -0
- package/dist/src/icons/mediatype-video.js +4 -0
- package/dist/src/icons/mediatype-video.js.map +1 -0
- package/dist/src/{elements/ia-status-indicator/icons/video.svg → icons/mediatype-video.svg} +1 -1
- package/dist/src/icons/mediatype-web.d.ts +3 -0
- package/dist/src/icons/mediatype-web.d.ts.map +1 -0
- package/dist/src/icons/mediatype-web.js +4 -0
- package/dist/src/icons/mediatype-web.js.map +1 -0
- package/dist/src/{elements/ia-status-indicator/icons/web.svg → icons/mediatype-web.svg} +1 -1
- package/dist/src/icons/pinterest.d.ts +3 -0
- package/dist/src/icons/pinterest.d.ts.map +1 -0
- package/dist/src/icons/pinterest.js +7 -0
- package/dist/src/icons/pinterest.js.map +1 -0
- package/dist/src/{elements/ia-item-navigator/menus/icons → icons}/pinterest.svg +1 -1
- package/dist/src/icons/scrubber-next-section.d.ts +3 -0
- package/dist/src/icons/scrubber-next-section.d.ts.map +1 -0
- package/dist/src/icons/scrubber-next-section.js +8 -0
- package/dist/src/icons/scrubber-next-section.js.map +1 -0
- package/dist/src/icons/scrubber-next-section.svg +7 -0
- package/dist/src/icons/scrubber-previous-section.d.ts +3 -0
- package/dist/src/icons/scrubber-previous-section.d.ts.map +1 -0
- package/dist/src/icons/scrubber-previous-section.js +8 -0
- package/dist/src/icons/scrubber-previous-section.js.map +1 -0
- package/dist/src/icons/scrubber-previous-section.svg +7 -0
- package/dist/src/icons/search.d.ts +3 -0
- package/dist/src/icons/search.d.ts.map +1 -0
- package/dist/src/{elements/ia-status-indicator/icons/search.svg → icons/search.js} +6 -7
- package/dist/src/icons/search.js.map +1 -0
- package/dist/src/{elements/ia-dropdown-search-bar → icons}/search.svg +1 -1
- package/dist/src/icons/share.d.ts +3 -0
- package/dist/src/icons/share.d.ts.map +1 -0
- package/dist/src/icons/share.js +7 -0
- package/dist/src/icons/share.js.map +1 -0
- package/dist/src/{elements/ia-item-navigator/menus/icons → icons}/share.svg +1 -1
- package/dist/src/icons/sort-asc.d.ts +3 -0
- package/dist/src/icons/sort-asc.d.ts.map +1 -0
- package/dist/src/icons/sort-asc.js +23 -0
- package/dist/src/icons/sort-asc.js.map +1 -0
- package/dist/src/{elements/ia-item-navigator/menus/icons → icons}/sort-asc.svg +3 -3
- package/dist/src/icons/sort-desc.d.ts +3 -0
- package/dist/src/icons/sort-desc.d.ts.map +1 -0
- package/dist/src/icons/sort-desc.js +22 -0
- package/dist/src/icons/sort-desc.js.map +1 -0
- package/dist/src/{elements/ia-item-navigator/menus/icons → icons}/sort-desc.svg +3 -3
- package/dist/src/icons/sort-neutral.d.ts +3 -0
- package/dist/src/icons/sort-neutral.d.ts.map +1 -0
- package/dist/src/icons/sort-neutral.js +14 -0
- package/dist/src/icons/sort-neutral.js.map +1 -0
- package/dist/src/{elements/ia-item-navigator/menus/icons → icons}/sort-neutral.svg +1 -1
- package/dist/src/icons/tumblr.d.ts +3 -0
- package/dist/src/icons/tumblr.d.ts.map +1 -0
- package/dist/src/icons/tumblr.js +7 -0
- package/dist/src/icons/tumblr.js.map +1 -0
- package/dist/src/{elements/ia-item-navigator/menus/icons → icons}/tumblr.svg +1 -1
- package/dist/src/icons/twitter.d.ts +3 -0
- package/dist/src/icons/twitter.d.ts.map +1 -0
- package/dist/src/icons/twitter.js +7 -0
- package/dist/src/icons/twitter.js.map +1 -0
- package/dist/src/{elements/ia-item-navigator/menus/icons → icons}/twitter.svg +1 -1
- package/dist/src/icons/viewable-files.d.ts +3 -0
- package/dist/src/icons/viewable-files.d.ts.map +1 -0
- package/dist/src/icons/viewable-files.js +7 -0
- package/dist/src/icons/viewable-files.js.map +1 -0
- package/dist/src/{elements/ia-item-navigator/menus/icons → icons}/viewable-files.svg +1 -1
- package/dist/src/util/icon-box.d.ts +17 -0
- package/dist/src/util/icon-box.d.ts.map +1 -0
- package/dist/src/util/icon-box.js +27 -0
- package/dist/src/util/icon-box.js.map +1 -0
- package/package.json +39 -8
- package/dist/src/elements/ia-donation-form/analytics.d.ts +0 -12
- package/dist/src/elements/ia-donation-form/analytics.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/analytics.js +0 -2
- package/dist/src/elements/ia-donation-form/analytics.js.map +0 -1
- package/dist/src/elements/ia-donation-form/flow-handlers/donation-flow-modal-manager.d.ts +0 -118
- package/dist/src/elements/ia-donation-form/flow-handlers/donation-flow-modal-manager.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/flow-handlers/donation-flow-modal-manager.js +0 -194
- package/dist/src/elements/ia-donation-form/flow-handlers/donation-flow-modal-manager.js.map +0 -1
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/apple-pay-flow-handler.d.ts +0 -24
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/apple-pay-flow-handler.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/apple-pay-flow-handler.js +0 -70
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/apple-pay-flow-handler.js.map +0 -1
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/credit-card-flow-handler.d.ts +0 -44
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/credit-card-flow-handler.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/credit-card-flow-handler.js +0 -116
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/credit-card-flow-handler.js.map +0 -1
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/google-pay-flow-handler.d.ts +0 -24
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/google-pay-flow-handler.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/google-pay-flow-handler.js +0 -74
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/google-pay-flow-handler.js.map +0 -1
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/paypal-flow-handler.d.ts +0 -47
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/paypal-flow-handler.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/paypal-flow-handler.js +0 -204
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/paypal-flow-handler.js.map +0 -1
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/venmo-flow-handler.d.ts +0 -30
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/venmo-flow-handler.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/venmo-flow-handler.js +0 -77
- package/dist/src/elements/ia-donation-form/flow-handlers/handlers/venmo-flow-handler.js.map +0 -1
- package/dist/src/elements/ia-donation-form/flow-handlers/payment-flow-handlers.d.ts +0 -80
- package/dist/src/elements/ia-donation-form/flow-handlers/payment-flow-handlers.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/flow-handlers/payment-flow-handlers.js +0 -72
- package/dist/src/elements/ia-donation-form/flow-handlers/payment-flow-handlers.js.map +0 -1
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/autocomplete-field-options.d.ts +0 -2
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/autocomplete-field-options.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/autocomplete-field-options.js +0 -2
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/autocomplete-field-options.js.map +0 -1
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/countries.d.ts +0 -3
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/countries.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/countries.js +0 -254
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/countries.js.map +0 -1
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.d.ts +0 -68
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.js +0 -483
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.js.map +0 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-badged-input.d.ts +0 -26
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-badged-input.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-badged-input.js +0 -163
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-badged-input.js.map +0 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.d.ts +0 -39
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.js +0 -212
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.js.map +0 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-header.d.ts +0 -31
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-header.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-header.js +0 -93
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-header.js.map +0 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.d.ts +0 -33
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.js +0 -380
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.js.map +0 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-summary.d.ts +0 -11
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-summary.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-summary.js +0 -59
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-summary.js.map +0 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-total-amount.d.ts +0 -10
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-total-amount.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-total-amount.js +0 -75
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-total-amount.js.map +0 -1
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.d.ts +0 -111
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.js +0 -522
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.js.map +0 -1
- package/dist/src/elements/ia-donation-form/ia-donation-form.d.ts +0 -95
- package/dist/src/elements/ia-donation-form/ia-donation-form.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/ia-donation-form.js +0 -522
- package/dist/src/elements/ia-donation-form/ia-donation-form.js.map +0 -1
- package/dist/src/elements/ia-donation-form/icons/apple-pay.svg +0 -22
- package/dist/src/elements/ia-donation-form/icons/calendar.svg +0 -12
- package/dist/src/elements/ia-donation-form/icons/credit-card.svg +0 -7
- package/dist/src/elements/ia-donation-form/icons/google-pay.svg +0 -38
- package/dist/src/elements/ia-donation-form/icons/lock.svg +0 -6
- package/dist/src/elements/ia-donation-form/icons/paypal.svg +0 -39
- package/dist/src/elements/ia-donation-form/icons/venmo.svg +0 -9
- package/dist/src/elements/ia-donation-form/icons.d.ts +0 -9
- package/dist/src/elements/ia-donation-form/icons.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/icons.js +0 -27
- package/dist/src/elements/ia-donation-form/icons.js.map +0 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-confirm-modal.d.ts +0 -27
- package/dist/src/elements/ia-donation-form/modals/ia-donation-confirm-modal.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-confirm-modal.js +0 -195
- package/dist/src/elements/ia-donation-form/modals/ia-donation-confirm-modal.js.map +0 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-error-modal-content.d.ts +0 -7
- package/dist/src/elements/ia-donation-form/modals/ia-donation-error-modal-content.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-error-modal-content.js +0 -63
- package/dist/src/elements/ia-donation-form/modals/ia-donation-error-modal-content.js.map +0 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-upsell-modal-content.d.ts +0 -28
- package/dist/src/elements/ia-donation-form/modals/ia-donation-upsell-modal-content.d.ts.map +0 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-upsell-modal-content.js +0 -313
- package/dist/src/elements/ia-donation-form/modals/ia-donation-upsell-modal-content.js.map +0 -1
- package/dist/src/elements/ia-item-navigator/icons.d.ts +0 -13
- package/dist/src/elements/ia-item-navigator/icons.d.ts.map +0 -1
- package/dist/src/elements/ia-item-navigator/icons.js +0 -16
- package/dist/src/elements/ia-item-navigator/icons.js.map +0 -1
- package/dist/src/elements/ia-item-navigator/menus/icons/list.svg +0 -3
- package/dist/src/elements/ia-item-navigator/menus/share-icons.d.ts +0 -16
- package/dist/src/elements/ia-item-navigator/menus/share-icons.d.ts.map +0 -1
- package/dist/src/elements/ia-item-navigator/menus/share-icons.js +0 -23
- package/dist/src/elements/ia-item-navigator/menus/share-icons.js.map +0 -1
- package/dist/src/elements/ia-scrubber-bar/assets/next-section-marker.d.ts.map +0 -1
- package/dist/src/elements/ia-scrubber-bar/assets/next-section-marker.js +0 -18
- package/dist/src/elements/ia-scrubber-bar/assets/next-section-marker.js.map +0 -1
- package/dist/src/elements/ia-scrubber-bar/assets/previous-section-marker.d.ts.map +0 -1
- package/dist/src/elements/ia-scrubber-bar/assets/previous-section-marker.js +0 -18
- package/dist/src/elements/ia-scrubber-bar/assets/previous-section-marker.js.map +0 -1
- package/dist/src/util/masked-icon.d.ts +0 -24
- package/dist/src/util/masked-icon.d.ts.map +0 -1
- package/dist/src/util/masked-icon.js +0 -30
- package/dist/src/util/masked-icon.js.map +0 -1
- /package/dist/src/{elements/ia-combo-box → icons}/caret-closed.svg +0 -0
- /package/dist/src/{elements/ia-combo-box → icons}/caret-open.svg +0 -0
- /package/dist/src/{elements/ia-combo-box → icons}/clear.svg +0 -0
|
@@ -3,9 +3,16 @@ import { css, html, LitElement, nothing, } from 'lit';
|
|
|
3
3
|
import { property } from 'lit/decorators.js';
|
|
4
4
|
import { customElement } from '../../../util/custom-element.js';
|
|
5
5
|
import themeStyles from '../../../themes/theme-styles.js';
|
|
6
|
-
import
|
|
6
|
+
import share from '../../../icons/share.js';
|
|
7
|
+
import twitter from '../../../icons/twitter.js';
|
|
8
|
+
import facebook from '../../../icons/facebook.js';
|
|
9
|
+
import tumblr from '../../../icons/tumblr.js';
|
|
10
|
+
import pinterest from '../../../icons/pinterest.js';
|
|
11
|
+
import email from '../../../icons/email.js';
|
|
12
|
+
import link from '../../../icons/link.js';
|
|
13
|
+
import { iconBox, iconBoxStyles } from '../../../util/icon-box.js';
|
|
7
14
|
/** Icon for the share menu shortcut / menu entry. */
|
|
8
|
-
export
|
|
15
|
+
export const shareIcon = iconBox(share);
|
|
9
16
|
/**
|
|
10
17
|
* The "share this item" side panel: social sharing links (Twitter, Facebook,
|
|
11
18
|
* Tumblr, Pinterest, email) plus copyable iframe / bbcode embed snippets.
|
|
@@ -47,7 +54,7 @@ let IAItemNavSharePanel = class IAItemNavSharePanel extends LitElement {
|
|
|
47
54
|
this.sharingOptions = [
|
|
48
55
|
{
|
|
49
56
|
name: 'Twitter',
|
|
50
|
-
icon:
|
|
57
|
+
icon: iconBox(twitter),
|
|
51
58
|
url: `https://twitter.com/intent/tweet?${new URLSearchParams({
|
|
52
59
|
url: shareUrl,
|
|
53
60
|
text: shareBlurb,
|
|
@@ -56,14 +63,14 @@ let IAItemNavSharePanel = class IAItemNavSharePanel extends LitElement {
|
|
|
56
63
|
},
|
|
57
64
|
{
|
|
58
65
|
name: 'Facebook',
|
|
59
|
-
icon:
|
|
66
|
+
icon: iconBox(facebook),
|
|
60
67
|
url: `https://www.facebook.com/sharer/sharer.php?${new URLSearchParams({
|
|
61
68
|
u: shareUrl,
|
|
62
69
|
})}`,
|
|
63
70
|
},
|
|
64
71
|
{
|
|
65
72
|
name: 'Tumblr',
|
|
66
|
-
icon:
|
|
73
|
+
icon: iconBox(tumblr),
|
|
67
74
|
url: `https://www.tumblr.com/widgets/share/tool/preview?${new URLSearchParams({
|
|
68
75
|
posttype: 'link',
|
|
69
76
|
canonicalUrl: shareUrl,
|
|
@@ -72,7 +79,7 @@ let IAItemNavSharePanel = class IAItemNavSharePanel extends LitElement {
|
|
|
72
79
|
},
|
|
73
80
|
{
|
|
74
81
|
name: 'Pinterest',
|
|
75
|
-
icon:
|
|
82
|
+
icon: iconBox(pinterest),
|
|
76
83
|
url: `http://www.pinterest.com/pin/create/button/?${new URLSearchParams({
|
|
77
84
|
url: shareUrl,
|
|
78
85
|
description: shareBlurb,
|
|
@@ -80,7 +87,7 @@ let IAItemNavSharePanel = class IAItemNavSharePanel extends LitElement {
|
|
|
80
87
|
},
|
|
81
88
|
{
|
|
82
89
|
name: 'Email',
|
|
83
|
-
icon:
|
|
90
|
+
icon: iconBox(email),
|
|
84
91
|
url: `mailto:?${new URLSearchParams({
|
|
85
92
|
subject: shareBlurb,
|
|
86
93
|
body: shareUrl,
|
|
@@ -138,7 +145,7 @@ let IAItemNavSharePanel = class IAItemNavSharePanel extends LitElement {
|
|
|
138
145
|
</a>`)}
|
|
139
146
|
<details>
|
|
140
147
|
<summary class="share-option">
|
|
141
|
-
${
|
|
148
|
+
${iconBox(link)} Get an embeddable link
|
|
142
149
|
</summary>
|
|
143
150
|
<div class="embed">
|
|
144
151
|
<h4>Embed</h4>
|
|
@@ -168,6 +175,7 @@ let IAItemNavSharePanel = class IAItemNavSharePanel extends LitElement {
|
|
|
168
175
|
static get styles() {
|
|
169
176
|
return [
|
|
170
177
|
themeStyles,
|
|
178
|
+
iconBoxStyles,
|
|
171
179
|
css `
|
|
172
180
|
:host {
|
|
173
181
|
--item-navigator-text-color--: var(
|
|
@@ -240,7 +248,8 @@ let IAItemNavSharePanel = class IAItemNavSharePanel extends LitElement {
|
|
|
240
248
|
padding: 0.2em;
|
|
241
249
|
margin-right: 1em;
|
|
242
250
|
vertical-align: middle;
|
|
243
|
-
border
|
|
251
|
+
/* The border only reserves geometry. It isn't drawn. */
|
|
252
|
+
border: 1px solid transparent;
|
|
244
253
|
border-radius: 7px;
|
|
245
254
|
}
|
|
246
255
|
|
|
@@ -250,12 +259,22 @@ let IAItemNavSharePanel = class IAItemNavSharePanel extends LitElement {
|
|
|
250
259
|
font-size: var(--item-navigator-base-font-size--);
|
|
251
260
|
width: 2em;
|
|
252
261
|
height: 2em;
|
|
262
|
+
position: relative;
|
|
263
|
+
/* The glyph fills the border box (the padding box plus the 1px
|
|
264
|
+
border) and is clipped to its rounded corners. */
|
|
265
|
+
clip-path: inset(0 round 7px);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.share-option .ia-icon > svg {
|
|
269
|
+
position: absolute;
|
|
270
|
+
inset: -1px;
|
|
271
|
+
width: calc(100% + 2px);
|
|
272
|
+
height: calc(100% + 2px);
|
|
253
273
|
}
|
|
254
274
|
|
|
255
|
-
/* Our glyphs
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
background-color: var(--item-navigator-icon-color--);
|
|
275
|
+
/* Our glyphs paint with currentColor, so this supplies the paint. */
|
|
276
|
+
.ia-icon {
|
|
277
|
+
color: var(--item-navigator-icon-color--);
|
|
259
278
|
}
|
|
260
279
|
|
|
261
280
|
/* Host-supplied icons may still be inline svg, so keep theming those
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ia-itemnav-share-panel.js","sourceRoot":"","sources":["../../../../../src/elements/ia-item-navigator/menus/ia-itemnav-share-panel.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,EACV,OAAO,GAIR,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,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AjBpC,mBAAmB;IAD/B,aAAa,CAAC,wBAAwB,CAAC;GAC3B,mBAAmB,CA+U/B","sourcesContent":["import {\n css,\n html,\n LitElement,\n nothing,\n PropertyValues,\n TemplateResult,\n type CSSResultGroup,\n} from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { customElement } from '@src/util/custom-element';\nimport themeStyles from '@src/themes/theme-styles';\nimport {\n shareIcon,\n twitterIcon,\n facebookIcon,\n tumblrIcon,\n pinterestIcon,\n emailIcon,\n linkIcon,\n} from './share-icons';\n\ntype ShareOption = {\n name: string;\n icon: TemplateResult | string;\n url: string;\n};\n\n/** Icon for the share menu shortcut / menu entry. */\nexport { shareIcon };\n\n/**\n * The \"share this item\" side panel: social sharing links (Twitter, Facebook,\n * Tumblr, Pinterest, email) plus copyable iframe / bbcode embed snippets.\n * Sharing options are derived from the item identifier/metadata and rebuilt\n * whenever `sharingOptions` is reset to empty.\n */\n@customElement('ia-itemnav-share-panel')\nexport class IAItemNavSharePanel extends LitElement {\n @property({ type: String }) baseHost = 'archive.org';\n\n @property({ type: String }) creator = '';\n\n @property({ type: String }) description = '';\n\n @property({ type: Boolean }) embedOptionsVisible = false;\n\n @property({ type: String }) identifier = '';\n\n @property({ type: Array }) sharingOptions: ShareOption[] = [];\n\n @property({ type: String }) type = '';\n\n @property({ type: Boolean }) renderHeader = false;\n\n @property({ type: String }) fileSubPrefix = '';\n\n private copyNoteTimeouts = new WeakMap<\n Element,\n ReturnType<typeof setTimeout>\n >();\n\n updated(changed: PropertyValues): void {\n if (changed.has('sharingOptions') && !this.sharingOptions.length) {\n this.loadProviders();\n }\n }\n\n loadProviders(): void {\n let shareUrl = `https://${this.baseHost}/details/${this.identifier}`;\n if (this.fileSubPrefix) {\n shareUrl += `/${this.fileSubPrefix}`;\n }\n const shareBlurb = [\n this.description,\n this.creator,\n 'Free Download, Borrow, and Streaming',\n 'Internet Archive',\n ]\n .filter(Boolean)\n .join(' : ');\n\n this.sharingOptions = [\n {\n name: 'Twitter',\n icon: twitterIcon,\n url: `https://twitter.com/intent/tweet?${new URLSearchParams({\n url: shareUrl,\n text: shareBlurb,\n via: 'internetarchive',\n })}`,\n },\n {\n name: 'Facebook',\n icon: facebookIcon,\n url: `https://www.facebook.com/sharer/sharer.php?${new URLSearchParams({\n u: shareUrl,\n })}`,\n },\n {\n name: 'Tumblr',\n icon: tumblrIcon,\n url: `https://www.tumblr.com/widgets/share/tool/preview?${new URLSearchParams(\n {\n posttype: 'link',\n canonicalUrl: shareUrl,\n title: shareBlurb,\n },\n )}`,\n },\n {\n name: 'Pinterest',\n icon: pinterestIcon,\n url: `http://www.pinterest.com/pin/create/button/?${new URLSearchParams(\n {\n url: shareUrl,\n description: shareBlurb,\n },\n )}`,\n },\n {\n name: 'Email',\n icon: emailIcon,\n url: `mailto:?${new URLSearchParams({\n subject: shareBlurb,\n body: shareUrl,\n })}`,\n },\n ];\n }\n\n /**\n * Copies the embed snippet in the clicked `.code` block, preferring the async\n * Clipboard API and falling back to the legacy `execCommand` path for\n * browsers that lack it, then briefly flashes the \"Copied\" note.\n */\n private async copyToClipboard(event: MouseEvent): Promise<void> {\n const currentTarget = event.currentTarget as HTMLElement;\n const textarea = currentTarget.querySelector('textarea');\n const note = currentTarget.querySelector('small');\n if (!textarea || !note) return;\n\n try {\n await navigator.clipboard.writeText(textarea.value);\n } catch {\n // Fallback for browsers without the async Clipboard API.\n textarea.select();\n document.execCommand('copy');\n textarea.blur();\n }\n\n note.classList.add('visible');\n clearTimeout(this.copyNoteTimeouts.get(note));\n this.copyNoteTimeouts.set(\n note,\n setTimeout(() => note.classList.remove('visible'), 4000),\n );\n }\n\n get iframeEmbed(): string {\n return `<iframe\n src=\"https://${this.baseHost}/embed/${this.identifier}\"\n width=\"560\" height=\"384\" frameborder=\"0\"\n webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" allowfullscreen\n ></iframe>`;\n }\n\n get bbcodeEmbed(): string {\n return `[archiveorg ${this.identifier} width=560 height=384 frameborder=0 webkitallowfullscreen=true mozallowfullscreen=true]`;\n }\n\n get helpURL(): string {\n return `https://${this.baseHost}/help/audio.php?identifier=${this.identifier}`;\n }\n\n get header(): TemplateResult | typeof nothing {\n const header = html`<header><h3>Share this ${this.type}</h3></header>`;\n return this.renderHeader ? header : nothing;\n }\n\n render(): TemplateResult {\n return html`\n ${this.header}\n <div>\n ${this.sharingOptions.map(\n (option) =>\n html`<a class=\"share-option\" href=${option.url} target=\"_blank\">\n ${option.icon} ${option.name}\n </a>`,\n )}\n <details>\n <summary class=\"share-option\">\n ${linkIcon} Get an embeddable link\n </summary>\n <div class=\"embed\">\n <h4>Embed</h4>\n <div class=\"code\" @click=${this.copyToClipboard}>\n <textarea readonly>${this.iframeEmbed}</textarea>\n <small>Copied to clipboard</small>\n </div>\n <h4>\n Embed for wordpress.com hosted blogs and archive.org item\n <description> tags\n </h4>\n <div class=\"code\" @click=${this.copyToClipboard}>\n <textarea readonly>${this.bbcodeEmbed}</textarea>\n <small>Copied to clipboard</small>\n </div>\n <p>\n Want more?\n <a href=${this.helpURL}\n >Advanced embedding details, examples, and help</a\n >!\n </p>\n </div>\n </details>\n </div>\n `;\n }\n\n static get styles(): CSSResultGroup {\n return [\n themeStyles,\n css`\n :host {\n --item-navigator-text-color--: var(\n --item-navigator-text-color,\n var(--true-white)\n );\n --item-navigator-border-color--: var(\n --item-navigator-border-color,\n #4b4b4b\n );\n /* Icons follow the adjustable text color by default. */\n --item-navigator-icon-color--: var(\n --item-navigator-icon-color,\n var(--item-navigator-text-color--)\n );\n --item-navigator-share-embed-bg--: var(\n --item-navigator-share-embed-bg,\n #151515\n );\n\n display: block;\n height: 100%;\n overflow-y: auto;\n /* 10px base (petabox scale); internal sizing is em against it. */\n --item-navigator-base-font-size--: var(\n --item-navigator-base-font-size,\n 10px\n );\n font-size: var(--item-navigator-base-font-size--);\n color: var(--item-navigator-text-color--);\n box-sizing: border-box;\n }\n\n header {\n display: flex;\n align-items: baseline;\n }\n\n h3 {\n padding: 0;\n margin: 0 1em 0 0;\n font-size: 1.6em;\n }\n\n h4 {\n font-size: 1.4em;\n }\n\n :host > div {\n padding: 1em 0;\n }\n\n .share-option {\n display: block;\n padding: 0.5em 0;\n font-size: 1.6em;\n text-decoration: none;\n color: var(--item-navigator-text-color--);\n cursor: pointer;\n transition: background-color 0.2s;\n border-radius: 6px;\n }\n\n .share-option:hover {\n background-color: rgba(255, 255, 255, 0.05);\n }\n\n .share-option > * {\n display: inline-block;\n padding: 0.2em;\n margin-right: 1em;\n vertical-align: middle;\n border: 1px solid var(--item-navigator-border-color--);\n border-radius: 7px;\n }\n\n .share-option .ia-icon {\n /* Reset to the base so the icon (em) doesn't compound against the\n share-option's enlarged font-size. */\n font-size: var(--item-navigator-base-font-size--);\n width: 2em;\n height: 2em;\n }\n\n /* Our glyphs are masked spans: the mask supplies the shape, this\n supplies the paint. */\n span.ia-icon {\n background-color: var(--item-navigator-icon-color--);\n }\n\n /* Host-supplied icons may still be inline svg, so keep theming those\n the original way. */\n .ia-icon .fill-color {\n fill: var(--item-navigator-icon-color--);\n }\n\n /* Hide the triangle that appears on details tags */\n summary::marker {\n content: '';\n }\n\n summary::-webkit-details-marker {\n display: none;\n }\n\n .embed {\n padding-right: 5px;\n }\n\n .embed a {\n color: var(--item-navigator-text-color--);\n }\n\n .code {\n position: relative;\n }\n\n textarea {\n display: block;\n width: 100%;\n height: 120px;\n padding: 0.8em 1em;\n box-sizing: border-box;\n resize: none;\n cursor: pointer;\n font: normal 1.4em var(--base-font-family);\n color: var(--item-navigator-text-color--);\n background: var(--item-navigator-share-embed-bg--);\n }\n\n small {\n position: absolute;\n bottom: 0;\n left: 0;\n height: 3em;\n padding: 0.5em 1em;\n box-sizing: border-box;\n font: normal 1.2em/2em var(--base-font-family);\n color: var(--item-navigator-share-embed-bg--);\n background: var(--item-navigator-text-color--);\n opacity: 0;\n transition: opacity 300ms linear;\n }\n\n small.visible {\n opacity: 1;\n }\n `,\n ];\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-itemnav-share-panel': IAItemNavSharePanel;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ia-itemnav-share-panel.js","sourceRoot":"","sources":["../../../../../src/elements/ia-item-navigator/menus/ia-itemnav-share-panel.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,EACV,OAAO,GAIR,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,MAAM,kBAAkB,CAAC;AACrC,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAC3C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAC7C,OAAO,KAAK,MAAM,kBAAkB,CAAC;AACrC,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAQ5D,qDAAqD;AACrD,MAAM,CAAC,MAAM,SAAS,GAAmB,OAAO,CAAC,KAAK,CAAC,CAAC;AAExD;;;;;GAKG;AAEI,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,UAAU;IAA5C;;QACuB,aAAQ,GAAG,aAAa,CAAC;QAEzB,YAAO,GAAG,EAAE,CAAC;QAEb,gBAAW,GAAG,EAAE,CAAC;QAEhB,wBAAmB,GAAG,KAAK,CAAC;QAE7B,eAAU,GAAG,EAAE,CAAC;QAEjB,mBAAc,GAAkB,EAAE,CAAC;QAElC,SAAI,GAAG,EAAE,CAAC;QAET,iBAAY,GAAG,KAAK,CAAC;QAEtB,kBAAa,GAAG,EAAE,CAAC;QAEvC,qBAAgB,GAAG,IAAI,OAAO,EAGnC,C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F;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AA1V6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAA0B;AAEzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDAAc;AAEb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAAkB;AAEhB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;gEAA6B;AAE7B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAAiB;AAEjB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;2DAAoC;AAElC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAW;AAET;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yDAAsB;AAEtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0DAAoB;AAjBpC,mBAAmB;IAD/B,aAAa,CAAC,wBAAwB,CAAC;GAC3B,mBAAmB,CA2V/B","sourcesContent":["import {\n css,\n html,\n LitElement,\n nothing,\n PropertyValues,\n TemplateResult,\n type CSSResultGroup,\n} from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { customElement } from '@src/util/custom-element';\nimport themeStyles from '@src/themes/theme-styles';\nimport share from '@src/icons/share';\nimport twitter from '@src/icons/twitter';\nimport facebook from '@src/icons/facebook';\nimport tumblr from '@src/icons/tumblr';\nimport pinterest from '@src/icons/pinterest';\nimport email from '@src/icons/email';\nimport link from '@src/icons/link';\nimport { iconBox, iconBoxStyles } from '@src/util/icon-box';\n\ntype ShareOption = {\n name: string;\n icon: TemplateResult | string;\n url: string;\n};\n\n/** Icon for the share menu shortcut / menu entry. */\nexport const shareIcon: TemplateResult = iconBox(share);\n\n/**\n * The \"share this item\" side panel: social sharing links (Twitter, Facebook,\n * Tumblr, Pinterest, email) plus copyable iframe / bbcode embed snippets.\n * Sharing options are derived from the item identifier/metadata and rebuilt\n * whenever `sharingOptions` is reset to empty.\n */\n@customElement('ia-itemnav-share-panel')\nexport class IAItemNavSharePanel extends LitElement {\n @property({ type: String }) baseHost = 'archive.org';\n\n @property({ type: String }) creator = '';\n\n @property({ type: String }) description = '';\n\n @property({ type: Boolean }) embedOptionsVisible = false;\n\n @property({ type: String }) identifier = '';\n\n @property({ type: Array }) sharingOptions: ShareOption[] = [];\n\n @property({ type: String }) type = '';\n\n @property({ type: Boolean }) renderHeader = false;\n\n @property({ type: String }) fileSubPrefix = '';\n\n private copyNoteTimeouts = new WeakMap<\n Element,\n ReturnType<typeof setTimeout>\n >();\n\n updated(changed: PropertyValues): void {\n if (changed.has('sharingOptions') && !this.sharingOptions.length) {\n this.loadProviders();\n }\n }\n\n loadProviders(): void {\n let shareUrl = `https://${this.baseHost}/details/${this.identifier}`;\n if (this.fileSubPrefix) {\n shareUrl += `/${this.fileSubPrefix}`;\n }\n const shareBlurb = [\n this.description,\n this.creator,\n 'Free Download, Borrow, and Streaming',\n 'Internet Archive',\n ]\n .filter(Boolean)\n .join(' : ');\n\n this.sharingOptions = [\n {\n name: 'Twitter',\n icon: iconBox(twitter),\n url: `https://twitter.com/intent/tweet?${new URLSearchParams({\n url: shareUrl,\n text: shareBlurb,\n via: 'internetarchive',\n })}`,\n },\n {\n name: 'Facebook',\n icon: iconBox(facebook),\n url: `https://www.facebook.com/sharer/sharer.php?${new URLSearchParams({\n u: shareUrl,\n })}`,\n },\n {\n name: 'Tumblr',\n icon: iconBox(tumblr),\n url: `https://www.tumblr.com/widgets/share/tool/preview?${new URLSearchParams(\n {\n posttype: 'link',\n canonicalUrl: shareUrl,\n title: shareBlurb,\n },\n )}`,\n },\n {\n name: 'Pinterest',\n icon: iconBox(pinterest),\n url: `http://www.pinterest.com/pin/create/button/?${new URLSearchParams(\n {\n url: shareUrl,\n description: shareBlurb,\n },\n )}`,\n },\n {\n name: 'Email',\n icon: iconBox(email),\n url: `mailto:?${new URLSearchParams({\n subject: shareBlurb,\n body: shareUrl,\n })}`,\n },\n ];\n }\n\n /**\n * Copies the embed snippet in the clicked `.code` block, preferring the async\n * Clipboard API and falling back to the legacy `execCommand` path for\n * browsers that lack it, then briefly flashes the \"Copied\" note.\n */\n private async copyToClipboard(event: MouseEvent): Promise<void> {\n const currentTarget = event.currentTarget as HTMLElement;\n const textarea = currentTarget.querySelector('textarea');\n const note = currentTarget.querySelector('small');\n if (!textarea || !note) return;\n\n try {\n await navigator.clipboard.writeText(textarea.value);\n } catch {\n // Fallback for browsers without the async Clipboard API.\n textarea.select();\n document.execCommand('copy');\n textarea.blur();\n }\n\n note.classList.add('visible');\n clearTimeout(this.copyNoteTimeouts.get(note));\n this.copyNoteTimeouts.set(\n note,\n setTimeout(() => note.classList.remove('visible'), 4000),\n );\n }\n\n get iframeEmbed(): string {\n return `<iframe\n src=\"https://${this.baseHost}/embed/${this.identifier}\"\n width=\"560\" height=\"384\" frameborder=\"0\"\n webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" allowfullscreen\n ></iframe>`;\n }\n\n get bbcodeEmbed(): string {\n return `[archiveorg ${this.identifier} width=560 height=384 frameborder=0 webkitallowfullscreen=true mozallowfullscreen=true]`;\n }\n\n get helpURL(): string {\n return `https://${this.baseHost}/help/audio.php?identifier=${this.identifier}`;\n }\n\n get header(): TemplateResult | typeof nothing {\n const header = html`<header><h3>Share this ${this.type}</h3></header>`;\n return this.renderHeader ? header : nothing;\n }\n\n render(): TemplateResult {\n return html`\n ${this.header}\n <div>\n ${this.sharingOptions.map(\n (option) =>\n html`<a class=\"share-option\" href=${option.url} target=\"_blank\">\n ${option.icon} ${option.name}\n </a>`,\n )}\n <details>\n <summary class=\"share-option\">\n ${iconBox(link)} Get an embeddable link\n </summary>\n <div class=\"embed\">\n <h4>Embed</h4>\n <div class=\"code\" @click=${this.copyToClipboard}>\n <textarea readonly>${this.iframeEmbed}</textarea>\n <small>Copied to clipboard</small>\n </div>\n <h4>\n Embed for wordpress.com hosted blogs and archive.org item\n <description> tags\n </h4>\n <div class=\"code\" @click=${this.copyToClipboard}>\n <textarea readonly>${this.bbcodeEmbed}</textarea>\n <small>Copied to clipboard</small>\n </div>\n <p>\n Want more?\n <a href=${this.helpURL}\n >Advanced embedding details, examples, and help</a\n >!\n </p>\n </div>\n </details>\n </div>\n `;\n }\n\n static get styles(): CSSResultGroup {\n return [\n themeStyles,\n iconBoxStyles,\n css`\n :host {\n --item-navigator-text-color--: var(\n --item-navigator-text-color,\n var(--true-white)\n );\n --item-navigator-border-color--: var(\n --item-navigator-border-color,\n #4b4b4b\n );\n /* Icons follow the adjustable text color by default. */\n --item-navigator-icon-color--: var(\n --item-navigator-icon-color,\n var(--item-navigator-text-color--)\n );\n --item-navigator-share-embed-bg--: var(\n --item-navigator-share-embed-bg,\n #151515\n );\n\n display: block;\n height: 100%;\n overflow-y: auto;\n /* 10px base (petabox scale); internal sizing is em against it. */\n --item-navigator-base-font-size--: var(\n --item-navigator-base-font-size,\n 10px\n );\n font-size: var(--item-navigator-base-font-size--);\n color: var(--item-navigator-text-color--);\n box-sizing: border-box;\n }\n\n header {\n display: flex;\n align-items: baseline;\n }\n\n h3 {\n padding: 0;\n margin: 0 1em 0 0;\n font-size: 1.6em;\n }\n\n h4 {\n font-size: 1.4em;\n }\n\n :host > div {\n padding: 1em 0;\n }\n\n .share-option {\n display: block;\n padding: 0.5em 0;\n font-size: 1.6em;\n text-decoration: none;\n color: var(--item-navigator-text-color--);\n cursor: pointer;\n transition: background-color 0.2s;\n border-radius: 6px;\n }\n\n .share-option:hover {\n background-color: rgba(255, 255, 255, 0.05);\n }\n\n .share-option > * {\n display: inline-block;\n padding: 0.2em;\n margin-right: 1em;\n vertical-align: middle;\n /* The border only reserves geometry. It isn't drawn. */\n border: 1px solid transparent;\n border-radius: 7px;\n }\n\n .share-option .ia-icon {\n /* Reset to the base so the icon (em) doesn't compound against the\n share-option's enlarged font-size. */\n font-size: var(--item-navigator-base-font-size--);\n width: 2em;\n height: 2em;\n position: relative;\n /* The glyph fills the border box (the padding box plus the 1px\n border) and is clipped to its rounded corners. */\n clip-path: inset(0 round 7px);\n }\n\n .share-option .ia-icon > svg {\n position: absolute;\n inset: -1px;\n width: calc(100% + 2px);\n height: calc(100% + 2px);\n }\n\n /* Our glyphs paint with currentColor, so this supplies the paint. */\n .ia-icon {\n color: var(--item-navigator-icon-color--);\n }\n\n /* Host-supplied icons may still be inline svg, so keep theming those\n the original way. */\n .ia-icon .fill-color {\n fill: var(--item-navigator-icon-color--);\n }\n\n /* Hide the triangle that appears on details tags */\n summary::marker {\n content: '';\n }\n\n summary::-webkit-details-marker {\n display: none;\n }\n\n .embed {\n padding-right: 5px;\n }\n\n .embed a {\n color: var(--item-navigator-text-color--);\n }\n\n .code {\n position: relative;\n }\n\n textarea {\n display: block;\n width: 100%;\n height: 120px;\n padding: 0.8em 1em;\n box-sizing: border-box;\n resize: none;\n cursor: pointer;\n font: normal 1.4em var(--base-font-family);\n color: var(--item-navigator-text-color--);\n background: var(--item-navigator-share-embed-bg--);\n }\n\n small {\n position: absolute;\n bottom: 0;\n left: 0;\n height: 3em;\n padding: 0.5em 1em;\n box-sizing: border-box;\n font: normal 1.2em/2em var(--base-font-family);\n color: var(--item-navigator-share-embed-bg--);\n background: var(--item-navigator-text-color--);\n opacity: 0;\n transition: opacity 300ms linear;\n }\n\n small.visible {\n opacity: 1;\n }\n `,\n ];\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-itemnav-share-panel': IAItemNavSharePanel;\n }\n}\n"]}
|
|
@@ -3,13 +3,13 @@ import { css, html, LitElement, } from 'lit';
|
|
|
3
3
|
import { property } from 'lit/decorators.js';
|
|
4
4
|
import { customElement } from '../../../util/custom-element.js';
|
|
5
5
|
import themeStyles from '../../../themes/theme-styles.js';
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
const sortAscIcon =
|
|
11
|
-
const sortDescIcon =
|
|
12
|
-
const sortNeutralIcon =
|
|
6
|
+
import { iconBox, iconBoxStyles } from '../../../util/icon-box.js';
|
|
7
|
+
import sortAsc from '../../../icons/sort-asc.js';
|
|
8
|
+
import sortDesc from '../../../icons/sort-desc.js';
|
|
9
|
+
import sortNeutral from '../../../icons/sort-neutral.js';
|
|
10
|
+
const sortAscIcon = iconBox(sortAsc);
|
|
11
|
+
const sortDescIcon = iconBox(sortDesc);
|
|
12
|
+
const sortNeutralIcon = iconBox(sortNeutral);
|
|
13
13
|
/**
|
|
14
14
|
* A tri-state sort toggle for the viewable-files panel header. Cycles
|
|
15
15
|
* default → title ascending → title descending → default, sorting the supplied
|
|
@@ -79,6 +79,7 @@ let IAItemNavSortFilesButton = class IAItemNavSortFilesButton extends LitElement
|
|
|
79
79
|
static get styles() {
|
|
80
80
|
return [
|
|
81
81
|
themeStyles,
|
|
82
|
+
iconBoxStyles,
|
|
82
83
|
css `
|
|
83
84
|
:host {
|
|
84
85
|
/* Every glyph is square, so one knob sizes both axes. Matches the
|
|
@@ -111,12 +112,11 @@ let IAItemNavSortFilesButton = class IAItemNavSortFilesButton extends LitElement
|
|
|
111
112
|
font: inherit;
|
|
112
113
|
}
|
|
113
114
|
|
|
114
|
-
/* The glyph
|
|
115
|
-
supplies the paint. */
|
|
115
|
+
/* The glyph paints with currentColor, so this supplies the paint. */
|
|
116
116
|
button.sort-by .ia-icon {
|
|
117
117
|
width: var(--item-navigator-header-icon-size--);
|
|
118
118
|
height: var(--item-navigator-header-icon-size--);
|
|
119
|
-
|
|
119
|
+
color: var(--item-navigator-icon-color--);
|
|
120
120
|
}
|
|
121
121
|
`,
|
|
122
122
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ia-itemnav-sort-files-button.js","sourceRoot":"","sources":["../../../../../src/elements/ia-item-navigator/menus/ia-itemnav-sort-files-button.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,GAGX,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ia-itemnav-sort-files-button.js","sourceRoot":"","sources":["../../../../../src/elements/ia-item-navigator/menus/ia-itemnav-sort-files-button.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,GAGX,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAC1C,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAGlD,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAErC,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEvC,MAAM,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAE7C;;;;GAIG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,UAAU;IAAjD;;QACsB,gBAAW,GAAuB,EAAE,CAAC;QAErC,mBAAc,GAAuB,EAAE,CAAC;QAExB,gBAAW,GACpD,SAAS,CAAC;IA2Gd,CAAC;IAzGC,MAAM;QACJ,OAAO,IAAI,CAAA,qCAAqC,IAAI,CAAC,UAAU,QAAQ,CAAC;IAC1E,CAAC;IAED,IAAI,UAAU;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,KAAK,MAAM;QACf,OAAO;YACL,WAAW;YACX,aAAa;YACb,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCF;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AAhH4B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;6DAAsC;AAErC;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;gEAAyC;AAExB;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6DAC9B;AAND,wBAAwB;IADpC,aAAa,CAAC,8BAA8B,CAAC;GACjC,wBAAwB,CAiHpC","sourcesContent":["import {\n css,\n html,\n LitElement,\n type CSSResultGroup,\n TemplateResult,\n} from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { customElement } from '@src/util/custom-element';\nimport themeStyles from '@src/themes/theme-styles';\nimport { iconBox, iconBoxStyles } from '@src/util/icon-box';\nimport sortAsc from '@src/icons/sort-asc';\nimport sortDesc from '@src/icons/sort-desc';\nimport sortNeutral from '@src/icons/sort-neutral';\nimport type { FileSortOption, ViewableFileInfo } from './models';\n\nconst sortAscIcon = iconBox(sortAsc);\n\nconst sortDescIcon = iconBox(sortDesc);\n\nconst sortNeutralIcon = iconBox(sortNeutral);\n\n/**\n * A tri-state sort toggle for the viewable-files panel header. Cycles\n * default → title ascending → title descending → default, sorting the supplied\n * file list and emitting `fileListSorted` on each change.\n */\n@customElement('ia-itemnav-sort-files-button')\nexport class IAItemNavSortFilesButton extends LitElement {\n @property({ type: Array }) fileListRaw: ViewableFileInfo[] = [];\n\n @property({ type: Array }) fileListSorted: ViewableFileInfo[] = [];\n\n @property({ type: String, reflect: true }) sortOrderBy: FileSortOption =\n 'default';\n\n render(): TemplateResult {\n return html`<div class=\"sort-multi-file-list\">${this.sortButton}</div>`;\n }\n\n get sortButton(): TemplateResult {\n const sortIcons: Record<FileSortOption, TemplateResult> = {\n default: html`\n <button\n class=\"sort-by neutral-icon\"\n aria-label=\"Sort volumes in initial order\"\n @click=${() => this.sortVolumes('title_asc')}\n >\n ${sortNeutralIcon}\n </button>\n `,\n title_asc: html`\n <button\n class=\"sort-by asc-icon\"\n aria-label=\"Sort volumes in ascending order\"\n @click=${() => this.sortVolumes('title_desc')}\n >\n ${sortAscIcon}\n </button>\n `,\n title_desc: html`\n <button\n class=\"sort-by desc-icon\"\n aria-label=\"Sort volumes in descending order\"\n @click=${() => this.sortVolumes('default')}\n >\n ${sortDescIcon}\n </button>\n `,\n };\n\n return sortIcons[this.sortOrderBy];\n }\n\n sortVolumes(sortType: FileSortOption): void {\n this.sortOrderBy = sortType;\n\n const sortedFiles = [...this.fileListRaw].sort((a, b) => {\n if (sortType === 'title_asc') return a.title.localeCompare(b.title);\n if (sortType === 'title_desc') return b.title.localeCompare(a.title);\n return (a.orig_sort ?? 0) - (b.orig_sort ?? 0);\n });\n\n this.dispatchEvent(\n new CustomEvent('fileListSorted', {\n detail: {\n sortType,\n sortedFiles,\n },\n bubbles: true,\n composed: true,\n }),\n );\n this.fileListSorted = sortedFiles;\n }\n\n static get styles(): CSSResultGroup {\n return [\n themeStyles,\n iconBoxStyles,\n css`\n :host {\n /* Every glyph is square, so one knob sizes both axes. Matches the\n panel header's close button, which sits beside this one. */\n --item-navigator-header-icon-size--: var(\n --item-navigator-header-icon-size,\n 2em\n );\n --item-navigator-icon-color--: var(\n --item-navigator-icon-color,\n var(--item-navigator-text-color, var(--true-white))\n );\n\n /* 10px base (petabox scale); internal sizing is em against it. */\n --item-navigator-base-font-size--: var(\n --item-navigator-base-font-size,\n 10px\n );\n font-size: var(--item-navigator-base-font-size--);\n }\n\n button.sort-by {\n padding: 0;\n background-color: transparent;\n border: 0;\n cursor: pointer;\n display: inline-flex;\n /* Buttons don't inherit font-size, and the UA default would make the\n em-sized glyph larger than the close button beside it. */\n font: inherit;\n }\n\n /* The glyph paints with currentColor, so this supplies the paint. */\n button.sort-by .ia-icon {\n width: var(--item-navigator-header-icon-size--);\n height: var(--item-navigator-header-icon-size--);\n color: var(--item-navigator-icon-color--);\n }\n `,\n ];\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-itemnav-sort-files-button': IAItemNavSortFilesButton;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ia-itemnav-viewable-files-panel.d.ts","sourceRoot":"","sources":["../../../../../src/elements/ia-item-navigator/menus/ia-itemnav-viewable-files-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EACV,OAAO,EACP,KAAK,cAAc,EACnB,cAAc,EACd,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAOb,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjE,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ia-itemnav-viewable-files-panel.d.ts","sourceRoot":"","sources":["../../../../../src/elements/ia-item-navigator/menus/ia-itemnav-viewable-files-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EACV,OAAO,EACP,KAAK,cAAc,EACnB,cAAc,EACd,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAOb,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjE,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,gBAAyB,CAAC;AAExD;;;;;GAKG;AACH,qBACa,2BAA4B,SAAQ,UAAU;IAC7B,QAAQ,EAAE,MAAM,CAAiB;IAEjC,WAAW,EAAE,cAAc,CAAa;IAExC,SAAS,EAAE,MAAM,CAAM;IAExB,QAAQ,EAAE,gBAAgB,EAAE,CAAM;IAEjB,YAAY,UAAS;IAEjE;;;;;;;OAOG;IACH,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAMhD,iBAAiB,IAAI,IAAI;YAOX,gBAAgB;IAS9B,OAAO,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM;IAQvC,IAAI,QAAQ,IAAI,cAAc,CAI7B;IAED,MAAM,CAAC,IAAI,EAAE,gBAAgB,GAAG,cAAc;IAmB9C,IAAI,gBAAgB,IAAI,cAAc,CAYrC;IAED,MAAM,IAAI,cAAc,GAAG,OAAO,OAAO;IAIzC,MAAM,KAAK,MAAM,IAAI,cAAc,CAuGlC;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iCAAiC,EAAE,2BAA2B,CAAC;KAChE;CACF"}
|
|
@@ -4,10 +4,10 @@ import { property } from 'lit/decorators.js';
|
|
|
4
4
|
import { customElement } from '../../../util/custom-element.js';
|
|
5
5
|
import { repeat } from 'lit/directives/repeat.js';
|
|
6
6
|
import themeStyles from '../../../themes/theme-styles.js';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import viewableFiles from '../../../icons/viewable-files.js';
|
|
8
|
+
import { iconBox } from '../../../util/icon-box.js';
|
|
9
9
|
/** Icon for the viewable-files menu shortcut / menu entry. */
|
|
10
|
-
export const viewableFilesIcon =
|
|
10
|
+
export const viewableFilesIcon = iconBox(viewableFiles);
|
|
11
11
|
/**
|
|
12
12
|
* The "viewable files" side panel: a scrollable list of the item's viewable
|
|
13
13
|
* files/volumes, linking each to its page on the host and highlighting the one
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ia-itemnav-viewable-files-panel.js","sourceRoot":"","sources":["../../../../../src/elements/ia-item-navigator/menus/ia-itemnav-viewable-files-panel.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,EACV,OAAO,GAIR,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,
|
|
1
|
+
{"version":3,"file":"ia-itemnav-viewable-files-panel.js","sourceRoot":"","sources":["../../../../../src/elements/ia-item-navigator/menus/ia-itemnav-viewable-files-panel.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,EACV,OAAO,GAIR,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,aAAa,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAG7C,8DAA8D;AAC9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAExD;;;;;GAKG;AAEI,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,UAAU;IAApD;;QACuB,aAAQ,GAAW,aAAa,CAAC;QAEjC,gBAAW,GAAmB,SAAS,CAAC;QAExC,cAAS,GAAW,EAAE,CAAC;QAExB,aAAQ,GAAuB,EAAE,CAAC;QAEjB,iBAAY,GAAG,KAAK,CAAC;IA2LnE,CAAC;IAzLC;;;;;;;OAOG;IACO,OAAO,CAAC,OAAuB;QACvC,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YACxD,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,0EAA0E;QAC1E,4CAA4C;QAC5C,IAAI,CAAC,gBAAg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C,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,WAAW,EAC3B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CACvB,CAAC;QACF,OAAO,IAAI,CAAA;;UAEL,YAAY;;;KAGjB,CAAC;IACJ,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC;IAChE,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO;YACL,WAAW;YACX,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkGF;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AAnM6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6DAAkC;AAEjC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gEAAyC;AAExC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8DAAwB;AAExB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;6DAAmC;AAEjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iEAAsB;AATtD,2BAA2B;IADvC,aAAa,CAAC,iCAAiC,CAAC;GACpC,2BAA2B,CAoMvC","sourcesContent":["import {\n css,\n html,\n LitElement,\n nothing,\n type PropertyValues,\n TemplateResult,\n type CSSResultGroup,\n} from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { customElement } from '@src/util/custom-element';\nimport { repeat } from 'lit/directives/repeat.js';\nimport themeStyles from '@src/themes/theme-styles';\nimport viewableFiles from '@src/icons/viewable-files';\nimport { iconBox } from '@src/util/icon-box';\nimport type { FileSortOption, ViewableFileInfo } from './models';\n\n/** Icon for the viewable-files menu shortcut / menu entry. */\nexport const viewableFilesIcon = iconBox(viewableFiles);\n\n/**\n * The \"viewable files\" side panel: a scrollable list of the item's viewable\n * files/volumes, linking each to its page on the host and highlighting the one\n * matching the current `subPrefix`. Populated by the host via `fileList`\n * (typically re-ordered by an `ia-itemnav-sort-files-button`).\n */\n@customElement('ia-itemnav-viewable-files-panel')\nexport class IAItemNavViewableFilesPanel extends LitElement {\n @property({ type: String }) baseHost: string = 'archive.org';\n\n @property({ type: String }) sortOrderBy: FileSortOption = 'default';\n\n @property({ type: String }) subPrefix: string = '';\n\n @property({ type: Array }) fileList: ViewableFileInfo[] = [];\n\n @property({ type: Boolean, reflect: true }) addSortToUrl = false;\n\n /**\n * Keeps the active file in view whenever the list or the selection changes.\n *\n * Both are needed: hosts commonly build this panel once and hand it a\n * `fileList` afterwards, and the selection can move while the panel stays\n * open. Reacting to the change means there is nothing to wait on — the row\n * exists by the time the update completes.\n */\n protected updated(changed: PropertyValues): void {\n if (changed.has('fileList') || changed.has('subPrefix')) {\n this.revealActiveFile();\n }\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n // Hosts reuse this element across opens, and the scroll container it sits\n // in may have been reset while it was away.\n this.revealActiveFile();\n }\n\n private async revealActiveFile(): Promise<void> {\n await this.updateComplete;\n // `nearest` leaves an already-visible row alone, which is what the\n // Chrome-only `scrollIntoViewIfNeeded` used to buy us.\n this.shadowRoot\n ?.querySelector<HTMLElement>('.content.active')\n ?.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }\n\n fileUrl(item: ViewableFileInfo): string {\n const baseUrl = `//${this.baseHost}${item.url_path}`;\n if (this.addSortToUrl && this.sortOrderBy !== 'default') {\n return `${baseUrl}?sort=${this.sortOrderBy}`;\n }\n return baseUrl;\n }\n\n get pdfLabel(): TemplateResult {\n return html`<span class=\"pdf-label\"\n ><span class=\"sr-only\">view this</span> PDF</span\n >`;\n }\n\n fileLi(item: ViewableFileInfo): TemplateResult {\n const activeClass = this.subPrefix === item.file_subprefix ? ' active' : '';\n const hrefUrl = this.fileUrl(item);\n const isPdf = (item.file_source ?? '').match(/^[^+]+\\.pdf$/i);\n\n return html`\n <li>\n <div class=\"separator\"></div>\n <div class=\"content${activeClass}\">\n <a href=${hrefUrl}>\n <p class=\"item-title\">\n ${item.title}${isPdf ? this.pdfLabel : nothing}\n </p>\n </a>\n </div>\n </li>\n `;\n }\n\n get fileListTemplate(): TemplateResult {\n const filesDisplay = repeat(\n this.fileList,\n (file) => file?.file_prefix,\n this.fileLi.bind(this),\n );\n return html`\n <ul>\n ${filesDisplay}\n <div class=\"separator\"></div>\n </ul>\n `;\n }\n\n render(): TemplateResult | typeof nothing {\n return this.fileList.length ? this.fileListTemplate : nothing;\n }\n\n static get styles(): CSSResultGroup {\n return [\n themeStyles,\n css`\n :host {\n --item-navigator-text-color--: var(\n --item-navigator-text-color,\n var(--true-white)\n );\n --item-navigator-border-color--: var(\n --item-navigator-border-color,\n #4b4b4b\n );\n --item-navigator-active-file-border-color--: var(\n --item-navigator-active-file-border-color,\n #538bc5\n );\n\n display: block;\n overflow-y: auto;\n box-sizing: border-box;\n color: var(--item-navigator-text-color--);\n margin-top: 14px;\n margin-bottom: 2em;\n --active-border-width--: 2px;\n /* 10px base (petabox scale); internal sizing is em against it. */\n --item-navigator-base-font-size--: var(\n --item-navigator-base-font-size,\n 10px\n );\n font-size: var(--item-navigator-base-font-size--);\n }\n\n a {\n color: var(--item-navigator-text-color--);\n text-decoration: none;\n }\n\n ul {\n padding: 0;\n list-style: none;\n margin: var(--active-border-width--) 0.5em 1em 0;\n }\n\n ul > li:first-child .separator {\n display: none;\n }\n\n li {\n cursor: pointer;\n position: relative;\n }\n\n li .content {\n border: var(--active-border-width--) solid transparent;\n padding: 0.2em 0 0.4em 0.2em;\n }\n\n li .content.active {\n border: var(--active-border-width--) solid\n var(--item-navigator-active-file-border-color--);\n }\n\n li.content a {\n display: flex;\n }\n\n .item-title {\n margin-block-start: 0em;\n margin-block-end: 0em;\n font-size: 14px;\n font-weight: bold;\n word-wrap: break-word;\n padding-left: 5px;\n }\n\n .separator {\n background-color: var(--item-navigator-border-color--);\n width: 98%;\n margin: 1px auto;\n height: 1px;\n }\n\n .pdf-label {\n border: 1px solid;\n padding: 2px 5px;\n border-radius: 20px;\n display: inline-block;\n margin-left: 5px;\n font-size: 0.9em;\n }\n\n .pdf-label .sr-only {\n position: absolute;\n clip: rect(1px, 1px, 1px, 1px);\n padding: 0;\n border: 0;\n height: 1px;\n width: 1px;\n overflow: hidden;\n }\n `,\n ];\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-itemnav-viewable-files-panel': IAItemNavViewableFilesPanel;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ia-section-marker.d.ts","sourceRoot":"","sources":["../../../../src/elements/ia-scrubber-bar/ia-section-marker.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAIb,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAK7C;;;;;;GAMG;AACH,qBACa,eAAgB,SAAQ,UAAU;IAC7C,6BAA6B;IACD,UAAU,EAAE,iBAAiB,CAC7B;IAE5B,MAAM,IAAI,cAAc;IAUxB,MAAM,KAAK,MAAM,IAAI,cAAc,
|
|
1
|
+
{"version":3,"file":"ia-section-marker.d.ts","sourceRoot":"","sources":["../../../../src/elements/ia-scrubber-bar/ia-section-marker.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAIb,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAK7C;;;;;;GAMG;AACH,qBACa,eAAgB,SAAQ,UAAU;IAC7C,6BAA6B;IACD,UAAU,EAAE,iBAAiB,CAC7B;IAE5B,MAAM,IAAI,cAAc;IAUxB,MAAM,KAAK,MAAM,IAAI,cAAc,CA4ElC;CACF"}
|
|
@@ -3,8 +3,8 @@ import { css, html, LitElement, } from 'lit';
|
|
|
3
3
|
import { property } from 'lit/decorators.js';
|
|
4
4
|
import { customElement } from '../../util/custom-element.js';
|
|
5
5
|
import { SectionMarkerMode } from './models.js';
|
|
6
|
-
import nextSectionIcon from '
|
|
7
|
-
import previousSectionIcon from '
|
|
6
|
+
import nextSectionIcon from '../../icons/scrubber-next-section.js';
|
|
7
|
+
import previousSectionIcon from '../../icons/scrubber-previous-section.js';
|
|
8
8
|
/**
|
|
9
9
|
* A single section boundary drawn on the scrubber bar.
|
|
10
10
|
*
|
|
@@ -56,6 +56,11 @@ let IASectionMarker = class IASectionMarker extends LitElement {
|
|
|
56
56
|
height: 100%;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
.arrow svg {
|
|
60
|
+
width: 8px;
|
|
61
|
+
height: 10px;
|
|
62
|
+
}
|
|
63
|
+
|
|
59
64
|
.arrow {
|
|
60
65
|
padding-top: 10px;
|
|
61
66
|
opacity: 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ia-section-marker.js","sourceRoot":"","sources":["../../../../src/elements/ia-scrubber-bar/ia-section-marker.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,GAGX,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,eAAe,MAAM,
|
|
1
|
+
{"version":3,"file":"ia-section-marker.js","sourceRoot":"","sources":["../../../../src/elements/ia-scrubber-bar/ia-section-marker.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,GAGX,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,eAAe,MAAM,kCAAkC,CAAC;AAC/D,OAAO,mBAAmB,MAAM,sCAAsC,CAAC;AAEvE;;;;;;GAMG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QACL,6BAA6B;QACD,eAAU,GACpC,iBAAiB,CAAC,OAAO,CAAC;IAyF9B,CAAC;IAvFC,MAAM;QACJ,OAAO,IAAI,CAAA;mCACoB,IAAI,CAAC,UAAU;wCACV,eAAe;;yCAEd,mBAAmB;;KAEvD,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0ET,CAAC;IACJ,CAAC;CACF,CAAA;AA1F6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDACC;AAHjB,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CA4F3B","sourcesContent":["import {\n css,\n html,\n LitElement,\n type CSSResultGroup,\n type TemplateResult,\n} from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { customElement } from '@src/util/custom-element';\n\nimport { SectionMarkerMode } from './models';\n\nimport nextSectionIcon from '@src/icons/scrubber-next-section';\nimport previousSectionIcon from '@src/icons/scrubber-previous-section';\n\n/**\n * A single section boundary drawn on the scrubber bar.\n *\n * It's a vertical divider with an arrow either side. `markerMode` decides\n * which arrows show, so the two markers surrounding the playhead can point\n * towards the section the listener would land in.\n */\n@customElement('ia-section-marker')\nexport class IASectionMarker extends LitElement {\n /** Which arrows to reveal */\n @property({ type: String }) markerMode: SectionMarkerMode =\n SectionMarkerMode.neither;\n\n render(): TemplateResult {\n return html`\n <div class=\"container mode-${this.markerMode}\">\n <div class=\"left-arrow arrow\">${nextSectionIcon}</div>\n <div class=\"center-divider\"></div>\n <div class=\"right-arrow arrow\">${previousSectionIcon}</div>\n </div>\n `;\n }\n\n static get styles(): CSSResultGroup {\n return css`\n :host {\n --section-marker-color--: var(--ia-theme-scrubber-marker-color, #fff);\n /*\n Relative to the marker, which the scrubber sizes to the track, so a\n collapsed divider is exactly as tall as the track it sits on and an\n expanded one stands proportionally above it. A fixed pixel height\n here only lines up at one track height.\n */\n --section-marker-height-collapsed--: var(\n --ia-theme-scrubber-marker-height-collapsed,\n 100%\n );\n --section-marker-height-expanded--: var(\n --ia-theme-scrubber-marker-height-expanded,\n 250%\n );\n --section-marker-animation-speed--: 0.1s;\n\n color: var(--section-marker-color--);\n }\n\n .container {\n display: flex;\n justify-content: center;\n height: 100%;\n }\n\n .arrow svg {\n width: 8px;\n height: 10px;\n }\n\n .arrow {\n padding-top: 10px;\n opacity: 1;\n /*\n The arrows are hidden in every mode. The mode rules below vary only\n opacity, which cannot reveal a hidden element, so nothing here brings\n them back. Reveal them by dropping this line, not by touching the\n mode rules.\n */\n visibility: hidden;\n transition:\n opacity var(--section-marker-animation-speed--) ease-out,\n padding-top var(--section-marker-animation-speed--) ease-out;\n }\n\n .container.mode-left .right-arrow {\n opacity: 0;\n }\n\n .container.mode-right .left-arrow {\n opacity: 0;\n }\n\n .container.mode-neither .left-arrow,\n .container.mode-neither .right-arrow {\n opacity: 0;\n padding-top: 75%;\n }\n\n .container.mode-neither .center-divider {\n height: var(--section-marker-height-collapsed--);\n }\n\n .center-divider {\n border-left: 1px solid currentColor;\n width: 1px;\n left: 50%;\n height: var(--section-marker-height-expanded--);\n align-self: flex-end;\n transition: height var(--section-marker-animation-speed--) ease-out;\n }\n `;\n }\n}\n"]}
|
|
@@ -45,12 +45,12 @@ export declare class IAStatusIndicator extends LitElement {
|
|
|
45
45
|
*/
|
|
46
46
|
private get placeholderTemplate();
|
|
47
47
|
/**
|
|
48
|
-
* The
|
|
48
|
+
* The glyph for the current mediatype, if it maps to one we ship.
|
|
49
49
|
*
|
|
50
50
|
* Unmapped values (e.g. archive.org's `account` or `data`) resolve to
|
|
51
|
-
* undefined and degrade to the default dots
|
|
51
|
+
* undefined and degrade to the default dots.
|
|
52
52
|
*/
|
|
53
|
-
private get
|
|
53
|
+
private get mediatypeGlyph();
|
|
54
54
|
/** Whether the middle of the ring is occupied by a glyph rather than dots */
|
|
55
55
|
private get hasCenterIcon();
|
|
56
56
|
/**
|
|
@@ -66,8 +66,8 @@ export declare class IAStatusIndicator extends LitElement {
|
|
|
66
66
|
/** The roomier ring, used when a glyph occupies the middle */
|
|
67
67
|
private get iconRingSvg();
|
|
68
68
|
/**
|
|
69
|
-
* The bundled mediatype glyph.
|
|
70
|
-
*
|
|
69
|
+
* The bundled mediatype glyph. The generated svg is decorative
|
|
70
|
+
* (`aria-hidden`); this component supplies the size and paint.
|
|
71
71
|
*/
|
|
72
72
|
private get mediatypeIconTemplate();
|
|
73
73
|
private handleIconSlotChange;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ia-status-indicator.d.ts","sourceRoot":"","sources":["../../../../src/elements/ia-status-indicator/ia-status-indicator.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EAEd,UAAU,EAEV,cAAc,EAGd,cAAc,EACf,MAAM,KAAK,CAAC;AAyBb,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,aAAa,GACrB,OAAO,GACP,YAAY,GACZ,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,OAAO,GACP,IAAI,GACJ,OAAO,GACP,KAAK,CAAC;AAeV;;;;;;;;GAQG;AACH,qBAEa,iBAAkB,SAAQ,UAAU;IAEnB,YAA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aAAa,CAAa;IAGhC,SAAS,CAAC,EAAE,aAAa,CAAC;IAGzB,QAAQ,UAAS;IAGrC,OAAO,CAAC,cAAc,CAAS;IAG/B,OAAO,CAAC,cAAc,CAAyC;IAG/D,OAAO,CAAC,WAAW,CAAS;IAGrC,OAAO,CAAC,WAAW,CAA2D;IAE9E,MAAM,IAAI,cAAc;IAYxB;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,YAAY;IAapB,UAAU,CAAC,YAAY,EAAE,cAAc,GAAG,IAAI;IAmB9C,OAAO,CAAC,aAAa;IAUrB,YAAY,IAAI,IAAI;IAYpB,oBAAoB,IAAI,IAAI;IAS5B;;;OAGG;IACH,OAAO,KAAK,mBAAmB,GAE9B;IAED;;;;;OAKG;IACH,OAAO,KAAK,cAAc,GAGzB;IAED,6EAA6E;IAC7E,OAAO,KAAK,aAAa,GAExB;IAED;;;;;;OAMG;IACH,OAAO,KAAK,wBAAwB,GAYnC;IAED,oEAAoE;IACpE,OAAO,KAAK,aAAa,GA4BxB;IAED,8DAA8D;IAC9D,OAAO,KAAK,WAAW,GAoBtB;IAED;;;OAGG;IACH,OAAO,KAAK,qBAAqB,GAKhC;IAED,OAAO,CAAC,oBAAoB;IAK5B,wCAAwC;IACxC,OAAO,KAAK,wBAAwB,GAyBnC;IAED,gCAAgC;IAChC,OAAO,KAAK,sBAAsB,GAkBjC;IAED,MAAM,KAAK,MAAM,IAAI,cAAc,CAgKlC;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,iBAAiB,CAAC;KAC1C;CACF"}
|
|
@@ -4,17 +4,17 @@ import { property, state } from 'lit/decorators.js';
|
|
|
4
4
|
import { customElement } from '../../util/custom-element.js';
|
|
5
5
|
import { localized, msg } from '@lit/localize';
|
|
6
6
|
import themeStyles from '../../themes/theme-styles.js';
|
|
7
|
-
import {
|
|
8
|
-
import audioIcon from '
|
|
9
|
-
import collectionIcon from '
|
|
10
|
-
import etreeIcon from '
|
|
11
|
-
import imagesIcon from '
|
|
12
|
-
import searchIcon from '
|
|
13
|
-
import softwareIcon from '
|
|
14
|
-
import textsIcon from '
|
|
15
|
-
import tvIcon from '
|
|
16
|
-
import videoIcon from '
|
|
17
|
-
import webIcon from '
|
|
7
|
+
import { iconBox, iconBoxStyles } from '../../util/icon-box.js';
|
|
8
|
+
import audioIcon from '../../icons/mediatype-audio.js';
|
|
9
|
+
import collectionIcon from '../../icons/mediatype-collection.js';
|
|
10
|
+
import etreeIcon from '../../icons/mediatype-etree.js';
|
|
11
|
+
import imagesIcon from '../../icons/mediatype-images.js';
|
|
12
|
+
import searchIcon from '../../icons/search.js';
|
|
13
|
+
import softwareIcon from '../../icons/mediatype-software.js';
|
|
14
|
+
import textsIcon from '../../icons/mediatype-texts.js';
|
|
15
|
+
import tvIcon from '../../icons/mediatype-tv.js';
|
|
16
|
+
import videoIcon from '../../icons/mediatype-video.js';
|
|
17
|
+
import webIcon from '../../icons/mediatype-web.js';
|
|
18
18
|
/** How long a mode change takes to fade. Drives both the CSS and the timer. */
|
|
19
19
|
const FADE_DURATION_MS = 250;
|
|
20
20
|
/** One layer per mode, always rendered in this order. See render(). */
|
|
@@ -149,19 +149,19 @@ let IAStatusIndicator = class IAStatusIndicator extends LitElement {
|
|
|
149
149
|
return html `<div class="placeholder"></div>`;
|
|
150
150
|
}
|
|
151
151
|
/**
|
|
152
|
-
* The
|
|
152
|
+
* The glyph for the current mediatype, if it maps to one we ship.
|
|
153
153
|
*
|
|
154
154
|
* Unmapped values (e.g. archive.org's `account` or `data`) resolve to
|
|
155
|
-
* undefined and degrade to the default dots
|
|
155
|
+
* undefined and degrade to the default dots.
|
|
156
156
|
*/
|
|
157
|
-
get
|
|
157
|
+
get mediatypeGlyph() {
|
|
158
158
|
if (!this.mediatype)
|
|
159
159
|
return undefined;
|
|
160
160
|
return MEDIATYPE_ICONS[this.mediatype];
|
|
161
161
|
}
|
|
162
162
|
/** Whether the middle of the ring is occupied by a glyph rather than dots */
|
|
163
163
|
get hasCenterIcon() {
|
|
164
|
-
return this.hasSlottedIcon || !!this.
|
|
164
|
+
return this.hasSlottedIcon || !!this.mediatypeGlyph;
|
|
165
165
|
}
|
|
166
166
|
/**
|
|
167
167
|
* A circular loading indicator to render when processing.
|
|
@@ -236,14 +236,14 @@ let IAStatusIndicator = class IAStatusIndicator extends LitElement {
|
|
|
236
236
|
`;
|
|
237
237
|
}
|
|
238
238
|
/**
|
|
239
|
-
* The bundled mediatype glyph.
|
|
240
|
-
*
|
|
239
|
+
* The bundled mediatype glyph. The generated svg is decorative
|
|
240
|
+
* (`aria-hidden`); this component supplies the size and paint.
|
|
241
241
|
*/
|
|
242
242
|
get mediatypeIconTemplate() {
|
|
243
|
-
const
|
|
244
|
-
if (!
|
|
243
|
+
const glyph = this.mediatypeGlyph;
|
|
244
|
+
if (!glyph)
|
|
245
245
|
return nothing;
|
|
246
|
-
return
|
|
246
|
+
return iconBox(glyph);
|
|
247
247
|
}
|
|
248
248
|
handleIconSlotChange(e) {
|
|
249
249
|
const slot = e.target;
|
|
@@ -299,6 +299,7 @@ let IAStatusIndicator = class IAStatusIndicator extends LitElement {
|
|
|
299
299
|
static get styles() {
|
|
300
300
|
return [
|
|
301
301
|
themeStyles,
|
|
302
|
+
iconBoxStyles,
|
|
302
303
|
css `
|
|
303
304
|
:host {
|
|
304
305
|
--indicator-width--: var(--icon-width);
|
|
@@ -358,7 +359,7 @@ let IAStatusIndicator = class IAStatusIndicator extends LitElement {
|
|
|
358
359
|
display: block;
|
|
359
360
|
}
|
|
360
361
|
|
|
361
|
-
.indicator svg {
|
|
362
|
+
.indicator > svg {
|
|
362
363
|
display: block;
|
|
363
364
|
width: 100%;
|
|
364
365
|
height: auto;
|
|
@@ -376,14 +377,13 @@ let IAStatusIndicator = class IAStatusIndicator extends LitElement {
|
|
|
376
377
|
}
|
|
377
378
|
|
|
378
379
|
/*
|
|
379
|
-
* Sized to fit within the icon ring's inner diameter.
|
|
380
|
-
*
|
|
381
|
-
* recolors with the ring.
|
|
380
|
+
* Sized to fit within the icon ring's inner diameter. The glyph paints
|
|
381
|
+
* with currentColor, so it recolors with the ring.
|
|
382
382
|
*/
|
|
383
383
|
.ia-icon {
|
|
384
384
|
width: 50%;
|
|
385
385
|
height: 50%;
|
|
386
|
-
|
|
386
|
+
color: var(--loading-icon-color--);
|
|
387
387
|
}
|
|
388
388
|
|
|
389
389
|
/* Block, so the svg isn't padded out by the line box it would sit in */
|