@internetarchive/elements 1.7.0 → 1.9.0
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 +25 -1
- package/dist/src/elements/ia-audio-element/ia-audio-element.js +1 -1
- package/dist/src/elements/ia-audio-element/ia-audio-element.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-collapsible-action-group.js +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-collapsible-action-group.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-info-icon.js +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-info-icon.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-text-group.js +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-text-group.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-timer-countdown.js +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-timer-countdown.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-title-bar.js +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-title-bar.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions.js +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions.js.map +1 -1
- package/dist/src/elements/ia-button/ia-button.js +1 -1
- package/dist/src/elements/ia-button/ia-button.js.map +1 -1
- package/dist/src/elements/ia-clearable-text-input/ia-clearable-text-input.js +1 -1
- package/dist/src/elements/ia-clearable-text-input/ia-clearable-text-input.js.map +1 -1
- package/dist/src/elements/ia-combo-box/ia-combo-box.js +1 -1
- package/dist/src/elements/ia-combo-box/ia-combo-box.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.js +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-badged-input.js +2 -2
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-badged-input.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.js +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-edit-donation.js +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-edit-donation.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-header.js +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-header.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.js +2 -2
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-section.js +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-section.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-summary.js +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-summary.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-total-amount.js +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-total-amount.js.map +1 -1
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.js +1 -1
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.js.map +1 -1
- package/dist/src/elements/ia-donation-form/ia-donation-form.js +2 -2
- package/dist/src/elements/ia-donation-form/ia-donation-form.js.map +1 -1
- package/dist/src/elements/ia-donation-form/icons.js +1 -1
- package/dist/src/elements/ia-donation-form/icons.js.map +1 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-confirm-modal.js +1 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-confirm-modal.js.map +1 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-error-modal-content.js +1 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-error-modal-content.js.map +1 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-upsell-modal-content.js +1 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-upsell-modal-content.js.map +1 -1
- package/dist/src/elements/ia-donation-thermometer/ia-donation-thermometer.js +1 -1
- package/dist/src/elements/ia-donation-thermometer/ia-donation-thermometer.js.map +1 -1
- package/dist/src/elements/ia-dropdown/ia-dropdown.d.ts +7 -2
- package/dist/src/elements/ia-dropdown/ia-dropdown.d.ts.map +1 -1
- package/dist/src/elements/ia-dropdown/ia-dropdown.js +13 -9
- package/dist/src/elements/ia-dropdown/ia-dropdown.js.map +1 -1
- package/dist/src/elements/ia-dropdown/ia-icon-label.js +1 -1
- package/dist/src/elements/ia-dropdown/ia-icon-label.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 +2 -1
- package/dist/src/elements/ia-dropdown-search-bar/ia-dropdown-search-bar.js.map +1 -1
- package/dist/src/elements/ia-expandable-search-bar/ia-expandable-search-bar.js +1 -1
- package/dist/src/elements/ia-expandable-search-bar/ia-expandable-search-bar.js.map +1 -1
- package/dist/src/elements/ia-expandable-search-bar/ia-quick-search.js +1 -1
- package/dist/src/elements/ia-expandable-search-bar/ia-quick-search.js.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-comment.js +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-comment.js.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-extra.js +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-extra.js.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.js +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.js.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey.js +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey.js.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback.js +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback.js.map +1 -1
- package/dist/src/elements/ia-histogram-date-range/ia-histogram-date-range.js +1 -1
- package/dist/src/elements/ia-histogram-date-range/ia-histogram-date-range.js.map +1 -1
- package/dist/src/elements/ia-icon/ia-icon.js +1 -1
- package/dist/src/elements/ia-icon/ia-icon.js.map +1 -1
- package/dist/src/elements/ia-image-viewer/ia-image-viewer.js +2 -2
- package/dist/src/elements/ia-image-viewer/ia-image-viewer.js.map +1 -1
- package/dist/src/elements/ia-image-viewer/ia-imgview-controls.js +1 -1
- package/dist/src/elements/ia-image-viewer/ia-imgview-controls.js.map +1 -1
- package/dist/src/elements/ia-image-viewer/ia-imgview-slide.js +1 -1
- package/dist/src/elements/ia-image-viewer/ia-imgview-slide.js.map +1 -1
- package/dist/src/elements/ia-image-viewer/image-viewer-gestures.js +1 -1
- package/dist/src/elements/ia-image-viewer/image-viewer-gestures.js.map +1 -1
- package/dist/src/elements/ia-infinite-scroller/ia-infinite-scroller.js +1 -1
- package/dist/src/elements/ia-infinite-scroller/ia-infinite-scroller.js.map +1 -1
- package/dist/src/elements/ia-infinite-scroller/story-support/ia-infinite-scroller-demo-tile.js +1 -1
- package/dist/src/elements/ia-infinite-scroller/story-support/ia-infinite-scroller-demo-tile.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-item-navigator.js +2 -2
- 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.js +2 -2
- 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.js +2 -2
- package/dist/src/elements/ia-item-navigator/ia-itemnav-menu-slider.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-itemnav-no-theater-available.d.ts.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-itemnav-no-theater-available.js +3 -2
- package/dist/src/elements/ia-item-navigator/ia-itemnav-no-theater-available.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-share-panel.js +2 -2
- 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 +2 -2
- 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.js +2 -2
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-viewable-files-panel.js.map +1 -1
- package/dist/src/elements/ia-otp-form/ia-otp-form.js +1 -1
- package/dist/src/elements/ia-otp-form/ia-otp-form.js.map +1 -1
- package/dist/src/elements/ia-otp-input/ia-otp-input.js +1 -1
- package/dist/src/elements/ia-otp-input/ia-otp-input.js.map +1 -1
- package/dist/src/elements/ia-playback-controls/ia-playback-controls.js +1 -1
- package/dist/src/elements/ia-playback-controls/ia-playback-controls.js.map +1 -1
- package/dist/src/elements/ia-radio-player/ia-radio-player.js +1 -1
- package/dist/src/elements/ia-radio-player/ia-radio-player.js.map +1 -1
- package/dist/src/elements/ia-radio-player/ia-search-results-switcher.js +1 -1
- package/dist/src/elements/ia-radio-player/ia-search-results-switcher.js.map +1 -1
- package/dist/src/elements/ia-reviews/ia-review-form.js +1 -1
- package/dist/src/elements/ia-reviews/ia-review-form.js.map +1 -1
- package/dist/src/elements/ia-reviews/ia-review.js +1 -1
- package/dist/src/elements/ia-reviews/ia-review.js.map +1 -1
- package/dist/src/elements/ia-reviews/ia-reviews.js +1 -1
- package/dist/src/elements/ia-reviews/ia-reviews.js.map +1 -1
- package/dist/src/elements/ia-scrubber-bar/ia-scrubber-bar.js +1 -1
- package/dist/src/elements/ia-scrubber-bar/ia-scrubber-bar.js.map +1 -1
- package/dist/src/elements/ia-scrubber-bar/ia-section-marker.js +1 -1
- package/dist/src/elements/ia-scrubber-bar/ia-section-marker.js.map +1 -1
- package/dist/src/elements/ia-sr-only-text/ia-sr-only-text.js +1 -1
- package/dist/src/elements/ia-sr-only-text/ia-sr-only-text.js.map +1 -1
- package/dist/src/elements/ia-status-indicator/ia-status-indicator.js +2 -2
- package/dist/src/elements/ia-status-indicator/ia-status-indicator.js.map +1 -1
- package/dist/src/elements/ia-topnav/data/menus.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/data/menus.js +5 -1
- package/dist/src/elements/ia-topnav/data/menus.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-desktop-subnav.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-desktop-subnav.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-icon-hamburger.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-icon-hamburger.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-login-button.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-login-button.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-button.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-button.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-menu.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-menu.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-slider.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-slider.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-subnav.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-subnav.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-more-slider.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-more-slider.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-primary-nav.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-primary-nav.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-save-page-form.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-save-page-form.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-signed-out-dropdown.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-signed-out-dropdown.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-user-menu.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-user-menu.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-wayback-search.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-wayback-search.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-wayback-slider.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-wayback-slider.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav.js +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav.js.map +1 -1
- package/dist/src/elements/ia-transcript-view/ia-transcript-entry.js +1 -1
- package/dist/src/elements/ia-transcript-view/ia-transcript-entry.js.map +1 -1
- package/dist/src/elements/ia-transcript-view/ia-transcript-view.js +1 -1
- package/dist/src/elements/ia-transcript-view/ia-transcript-view.js.map +1 -1
- package/dist/src/elements/ia-waveform-progress/ia-waveform-progress.js +1 -1
- package/dist/src/elements/ia-waveform-progress/ia-waveform-progress.js.map +1 -1
- package/dist/src/elements/ia-wayback-search-form/ia-wayback-search-form.js +1 -1
- package/dist/src/elements/ia-wayback-search-form/ia-wayback-search-form.js.map +1 -1
- package/dist/src/elements/modal-manager/ia-modal-manager-template.js +1 -1
- package/dist/src/elements/modal-manager/ia-modal-manager-template.js.map +1 -1
- package/dist/src/elements/modal-manager/modal-manager.js +1 -1
- package/dist/src/elements/modal-manager/modal-manager.js.map +1 -1
- package/dist/src/labs/ia-snow/ia-snow.js +2 -2
- package/dist/src/labs/ia-snow/ia-snow.js.map +1 -1
- package/dist/src/locales/es.d.ts +1 -0
- package/dist/src/locales/es.d.ts.map +1 -1
- package/dist/src/locales/es.js +1 -0
- package/dist/src/locales/es.js.map +1 -1
- package/dist/src/locales/fr.d.ts +1 -0
- package/dist/src/locales/fr.d.ts.map +1 -1
- package/dist/src/locales/fr.js +1 -0
- package/dist/src/locales/fr.js.map +1 -1
- package/dist/src/services/analytics-manager/analytics-helpers.d.ts +1 -1
- package/dist/src/services/analytics-manager/analytics-helpers.d.ts.map +1 -1
- package/dist/src/services/analytics-manager/analytics-helpers.js +5 -0
- package/dist/src/services/analytics-manager/analytics-helpers.js.map +1 -1
- package/dist/src/services/analytics-manager/visitor-status.d.ts +12 -0
- package/dist/src/services/analytics-manager/visitor-status.d.ts.map +1 -0
- package/dist/src/services/analytics-manager/visitor-status.js +30 -0
- package/dist/src/services/analytics-manager/visitor-status.js.map +1 -0
- package/dist/src/utils/custom-element.d.ts.map +1 -0
- package/dist/src/utils/custom-element.js.map +1 -0
- package/dist/src/utils/download-url/download-url.d.ts +21 -0
- package/dist/src/utils/download-url/download-url.d.ts.map +1 -0
- package/dist/src/utils/download-url/download-url.js +30 -0
- package/dist/src/utils/download-url/download-url.js.map +1 -0
- package/dist/src/utils/icon-box.d.ts.map +1 -0
- package/dist/src/utils/icon-box.js.map +1 -0
- package/dist/src/utils/lazy-load-template.d.ts.map +1 -0
- package/dist/src/utils/lazy-load-template.js.map +1 -0
- package/dist/src/utils/prefers-reduced-motion.d.ts.map +1 -0
- package/dist/src/utils/prefers-reduced-motion.js.map +1 -0
- package/eslint/index.mjs +20 -0
- package/eslint/no-hand-built-download-url.mjs +33 -0
- package/package.json +5 -1
- package/dist/src/util/custom-element.d.ts.map +0 -1
- package/dist/src/util/custom-element.js.map +0 -1
- package/dist/src/util/icon-box.d.ts.map +0 -1
- package/dist/src/util/icon-box.js.map +0 -1
- package/dist/src/util/lazy-load-template.d.ts.map +0 -1
- package/dist/src/util/lazy-load-template.js.map +0 -1
- package/dist/src/util/prefers-reduced-motion.d.ts.map +0 -1
- package/dist/src/util/prefers-reduced-motion.js.map +0 -1
- /package/dist/src/{util → utils}/custom-element.d.ts +0 -0
- /package/dist/src/{util → utils}/custom-element.js +0 -0
- /package/dist/src/{util → utils}/icon-box.d.ts +0 -0
- /package/dist/src/{util → utils}/icon-box.js +0 -0
- /package/dist/src/{util → utils}/lazy-load-template.d.ts +0 -0
- /package/dist/src/{util → utils}/lazy-load-template.js +0 -0
- /package/dist/src/{util → utils}/prefers-reduced-motion.d.ts +0 -0
- /package/dist/src/{util → utils}/prefers-reduced-motion.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ia-quick-search.js","sourceRoot":"","sources":["../../../../src/elements/ia-expandable-search-bar/ia-quick-search.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,
|
|
1
|
+
{"version":3,"file":"ia-quick-search.js","sourceRoot":"","sources":["../../../../src/elements/ia-expandable-search-bar/ia-quick-search.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,2BAA2B,CAAC;AAI1D;;GAEG;AACH,MAAM,MAAM,GAAG;IACb,kBAAkB,EAAE,oBAAoB;CACzC,CAAC;AAEF;;GAEG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QACL,2BAA2B;QACA,kBAAa,GAAuB,EAAE,CAAC;IAmGpE,CAAC;IAjGC,MAAM;QACJ,OAAO,IAAI,CAAA;;UAEL,IAAI,CAAC,aAAa,CAAC,GAAG,CACtB,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAA;;;;0CAII,KAAK;yBACtB,IAAI,CAAC,iBAAiB;;kBAE7B,WAAW,CAAC,WAAW;;;WAG9B,CACF;;KAEJ,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACK,iBAAiB,CAAC,CAAQ;QAChC,MAAM,EAAE,gBAAgB,EAAE,GAAI,CAAC,CAAC,aAA6B,CAAC,OAAO,CAAC;QACtE,IAAI,gBAAgB,KAAK,SAAS;YAAE,OAAO;QAE3C,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC,CAAC;QACvE,IAAI,CAAC,WAAW;YAAE,OAAO;QAEzB,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CACb,MAAM,CAAC,kBAAkB,EACzB;YACE,MAAM,EAAE,EAAE,WAAW,EAAE;YACvB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CACF,CACF,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiDT,CAAC;IACJ,CAAC;CACF,CAAA;AAnG4B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;oDAAwC;AAFvD,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CAqGzB","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/utils/custom-element';\n\nimport type { QuickSearchEntry } from './models';\n\n/**\n * Event names emitted by this component\n */\nconst Events = {\n SearchTermSelected: 'searchTermSelected',\n};\n\n/**\n * The list of suggested searches that drops out of the search bar.\n */\n@customElement('ia-quick-search')\nexport class IAQuickSearch extends LitElement {\n /** The entries to offer */\n @property({ type: Array }) quickSearches: QuickSearchEntry[] = [];\n\n render(): TemplateResult {\n return html`\n <ul>\n ${this.quickSearches.map(\n (quickSearch, index) => html`\n <li>\n <button\n type=\"button\"\n data-quick-search-index=${index}\n @click=${this.selectQuickSearch}\n >\n ${quickSearch.displayText}\n </button>\n </li>\n `,\n )}\n </ul>\n `;\n }\n\n /**\n * Reads the index off the button and emits the entry that was picked.\n *\n * Uses `currentTarget` rather than `target`, so the lookup still works if the\n * entry's text ever gains markup of its own for the click to land on.\n */\n private selectQuickSearch(e: Event): void {\n const { quickSearchIndex } = (e.currentTarget as HTMLElement).dataset;\n if (quickSearchIndex === undefined) return;\n\n const searchEntry = this.quickSearches[parseInt(quickSearchIndex, 10)];\n if (!searchEntry) return;\n\n this.dispatchEvent(\n new CustomEvent<{ searchEntry: QuickSearchEntry }>(\n Events.SearchTermSelected,\n {\n detail: { searchEntry },\n bubbles: true,\n composed: true,\n },\n ),\n );\n }\n\n static get styles(): CSSResultGroup {\n return css`\n :host {\n --quick-search-list-padding--: var(\n --ia-theme-quick-search-list-padding,\n 0 0 0.5em 0\n );\n --quick-search-list-item-padding--: var(\n --ia-theme-quick-search-list-item-padding,\n 0.5em 0 0 0\n );\n --quick-search-link-color--: var(\n --ia-theme-quick-search-link-color,\n rgb(68, 132, 202)\n );\n --quick-search-link-decoration--: var(\n --ia-theme-quick-search-link-decoration,\n none\n );\n }\n\n ul {\n padding: var(--quick-search-list-padding--);\n margin: 0;\n list-style: none;\n }\n\n ul li {\n padding: var(--quick-search-list-item-padding--);\n margin: 0;\n display: block;\n }\n\n /*\n A button rather than a link, since picking an entry runs a search in\n place rather than navigating. Stripped back so it reads as plain text\n while staying focusable and keyboard-operable.\n */\n ul li button {\n display: block;\n width: 100%;\n padding: 0;\n border: none;\n background: none;\n font: inherit;\n text-align: left;\n color: var(--quick-search-link-color--);\n text-decoration: var(--quick-search-link-decoration--);\n cursor: pointer;\n }\n `;\n }\n}\n"]}
|
|
@@ -2,7 +2,7 @@ var IAFeatureFeedbackSurveyComment_1;
|
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
3
|
import { html, css, nothing, LitElement, } from 'lit';
|
|
4
4
|
import { property, query } from 'lit/decorators.js';
|
|
5
|
-
import { customElement } from '../../
|
|
5
|
+
import { customElement } from '../../utils/custom-element.js';
|
|
6
6
|
import { localized, msg } from '@lit/localize';
|
|
7
7
|
let IAFeatureFeedbackSurveyComment = IAFeatureFeedbackSurveyComment_1 = class IAFeatureFeedbackSurveyComment extends LitElement {
|
|
8
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ia-feature-feedback-survey-comment.js","sourceRoot":"","sources":["../../../../src/elements/ia-feature-feedback/ia-feature-feedback-survey-comment.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,IAAI,EACJ,GAAG,EACH,OAAO,EAGP,UAAU,GAEX,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAKxC,IAAM,8BAA8B,sCAApC,MAAM,8BACX,SAAQ,UAAU;IA0ClB;;OAEG;IACK,MAAM,KAAK,4BAA4B;QAC7C,OAAO,GAAG,CAAC,UAAU,CAAC,CAAC;IACzB,CAAC;IAED;;OAEG;IACK,MAAM,KAAK,4BAA4B;QAC7C,OAAO,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACpC,CAAC;IAgBD,EAAE;IACF,UAAU;IACV,EAAE;IAEF;QACE,KAAK,EAAE,CAAC;QAxEV;;;WAGG;QACyB,WAAM,GAAG,EAAE,CAAC;QAExC;;WAEG;QACyB,UAAK,GAAG,EAAE,CAAC;QAEvC;;;WAGG;QACyC,aAAQ,GAAG,KAAK,CAAC;QAE7D;;WAEG;QACyC,aAAQ,GAAG,KAAK,CAAC;QAE7D;;;;WAIG;QACyC,eAAU,GAAG,KAAK,CAAC;QA0B/D;;WAEG;QACM,YAAO,GAAG,IAAI,CAAC;QAiBtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;IA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AgB,GAAG,GAAG,CAAA,8CAA8C,CAAC;QAC3E,MAAM,cAAc,GAAG,GAAG,CAAA,8CAA8C,CAAC;QAEzE,OAAO,GAAG,CAAA;;kBAEI,cAAc;;;;;;;qBAOX,cAAc;uBACZ,gBAAgB;;;;;kBAKrB,MAAM;;;;;;;;;kBASN,MAAM;;;;;;;;;;KAUnB,CAAC;IACJ,CAAC;;AA3Ke,6CAAc,GAAG,IAAI,AAAP,CAAQ;AAE/B,gDAAiB,GAAG;IACzB,GAAG,UAAU,CAAC,iBAAiB;IAC/B,cAAc,EAAE,IAAI;CACrB,AAHuB,CAGtB;AA7D0B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8DAAa;AAKZ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6DAAY;AAMK;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gEAAkB;AAKjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gEAAkB;AAOjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kEAAoB;AAKnC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mEAAsB;AAKrB;IAA3B,KAAK,CAAC,WAAW,CAAC;kEAA0C;AAzClD,8BAA8B;IAF1C,aAAa,CAAC,oCAAoC,CAAC;IACnD,SAAS,EAAE;GACC,8BAA8B,CA4O1C","sourcesContent":["import {\n html,\n css,\n nothing,\n CSSResultGroup,\n TemplateResult,\n LitElement,\n PropertyValues,\n} from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { customElement } from '@src/util/custom-element';\nimport { localized, msg } from '@lit/localize';\nimport { IASurveyQuestionInterface, IASurveyQuestionResponse } from './models';\n\n@customElement('ia-feature-feedback-survey-comment')\n@localized()\nexport class IAFeatureFeedbackSurveyComment\n extends LitElement\n implements IASurveyQuestionInterface\n{\n /**\n * The prompt text to show for this question.\n * If empty, no prompt text element will be rendered.\n */\n @property({ type: String }) prompt = '';\n\n /**\n * The current comment text for this question.\n */\n @property({ type: String }) value = '';\n\n /**\n * Whether this question must be answered in order to submit its parent survey.\n * Default false.\n */\n @property({ type: Boolean, reflect: true }) required = false;\n\n /**\n * @inheritdoc\n */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /**\n * Whether to omit the question number before this question's prompt text.\n * If true, this question will be skipped entirely in the numbering order.\n * Default false.\n */\n @property({ type: Boolean, reflect: true }) skipNumber = false;\n\n /**\n * Optional placeholder text to use for the comment field.\n */\n @property({ type: String }) placeholder?: string;\n\n /**\n * The textarea holding this question's comment text.\n */\n @query('#comments') private commentBox!: HTMLTextAreaElement;\n\n /**\n * Default placeholder text for required respones.\n */\n private static get DEFAULT_PLACEHOLDER_REQUIRED(): string {\n return msg('Comments');\n }\n\n /**\n * Default placeholder text for optional responses.\n */\n private static get DEFAULT_PLACEHOLDER_OPTIONAL(): string {\n return msg('Comments (optional)');\n }\n\n /**\n * @inheritdoc\n */\n readonly visible = true;\n\n private readonly internals; // ElementInternals\n\n static readonly formAssociated = true;\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n //\n // METHODS\n //\n\n constructor() {\n super();\n this.internals = this.attachInternals();\n }\n\n render() {\n return html`\n <div id=\"container\">\n ${this.promptTextTemplate}${this.commentBoxTemplate}\n </div>\n `;\n }\n\n willUpdate(changed: PropertyValues): void {\n if (changed.has('required')) {\n this.internals.ariaRequired = this.required.toString();\n }\n if (changed.has('disabled')) {\n this.internals.ariaDisabled = this.disabled.toString();\n }\n }\n\n /**\n * @inheritdoc\n */\n validate() {\n const isValid = !this.required || !!this.commentBox.value;\n if (isValid) {\n this.internals.setValidity({});\n } else {\n this.internals.setValidity(\n { valueMissing: true },\n msg('A comment is required.'),\n );\n }\n return this.internals.reportValidity();\n }\n\n /**\n * @inheritdoc\n */\n get numbered(): boolean {\n return !this.skipNumber;\n }\n\n /**\n * @inheritdoc\n */\n get response(): IASurveyQuestionResponse {\n return {\n name: this.prompt,\n comment: this.value,\n };\n }\n\n /**\n * Template for this question's prompt text, if applicable.\n * Will be preceded by the question number, unless the `skipNumber` flag is set.\n */\n private get promptTextTemplate(): TemplateResult | typeof nothing {\n if (!this.prompt) return nothing;\n\n const numberSlot = this.numbered\n ? html`<slot name=\"question-number\"></slot>`\n : nothing;\n\n return html`<div id=\"prompt-text\">${numberSlot}${this.prompt}</div>`;\n }\n\n /**\n * Template for the comment <textarea> for this question.\n */\n private get commentBoxTemplate(): TemplateResult {\n const defaultPlaceholder = this.required\n ? IAFeatureFeedbackSurveyComment.DEFAULT_PLACEHOLDER_REQUIRED\n : IAFeatureFeedbackSurveyComment.DEFAULT_PLACEHOLDER_OPTIONAL;\n\n const placeholder = this.placeholder ?? defaultPlaceholder;\n\n return html`\n <textarea\n id=\"comments\"\n tabindex=\"0\"\n placeholder=${placeholder}\n aria-labelledby=\"prompt-text\"\n aria-required=${this.required}\n .value=${this.value}\n ?disabled=${this.disabled}\n @change=${this.commentChanged}\n ></textarea>\n `;\n }\n\n /**\n * Handler for when the value of the comments textarea changes.\n */\n private commentChanged(): void {\n if (this.disabled) return;\n\n this.value = this.commentBox.value;\n if (this.value) this.internals.setValidity({});\n\n this.emitResponseChangedEvent();\n }\n\n /**\n * Emits a `responseChanged` event to notify parents of a new response value.\n */\n private emitResponseChangedEvent(): void {\n this.dispatchEvent(\n new CustomEvent('responseChanged', {\n detail: this.response,\n }),\n );\n }\n\n static get styles(): CSSResultGroup {\n const height = css`var(--commentHeight, 50px)`;\n const resize = css`var(--commentResize, none)`;\n\n const questionMargin = css`var(--surveyQuestionMargin, 0 0 15px 0)`;\n\n const promptFontWeight = css`var(--featureFeedbackPromptFontWeight, bold)`;\n const promptFontSize = css`var(--featureFeedbackPromptFontSize, 1.4rem)`;\n\n return css`\n #container {\n margin: ${questionMargin};\n }\n\n #prompt-text {\n text-align: left;\n margin-bottom: 5px;\n flex-grow: 1;\n font-size: ${promptFontSize};\n font-weight: ${promptFontWeight};\n }\n\n #comments {\n width: 100%;\n height: ${height};\n background-color: #ffffff;\n border: 1px #2c2c2c solid;\n border-radius: 4px;\n padding: 7px;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n font-family: inherit;\n resize: ${resize};\n }\n\n #comments::placeholder {\n color: #767676;\n }\n\n :host(:invalid) #comments {\n box-shadow: 0 0 4px red;\n }\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-feature-feedback-survey-comment': IAFeatureFeedbackSurveyComment;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ia-feature-feedback-survey-comment.js","sourceRoot":"","sources":["../../../../src/elements/ia-feature-feedback/ia-feature-feedback-survey-comment.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,IAAI,EACJ,GAAG,EACH,OAAO,EAGP,UAAU,GAEX,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAKxC,IAAM,8BAA8B,sCAApC,MAAM,8BACX,SAAQ,UAAU;IA0ClB;;OAEG;IACK,MAAM,KAAK,4BAA4B;QAC7C,OAAO,GAAG,CAAC,UAAU,CAAC,CAAC;IACzB,CAAC;IAED;;OAEG;IACK,MAAM,KAAK,4BAA4B;QAC7C,OAAO,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACpC,CAAC;IAgBD,EAAE;IACF,UAAU;IACV,EAAE;IAEF;QACE,KAAK,EAAE,CAAC;QAxEV;;;WAGG;QACyB,WAAM,GAAG,EAAE,C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AzClD,8BAA8B;IAF1C,aAAa,CAAC,oCAAoC,CAAC;IACnD,SAAS,EAAE;GACC,8BAA8B,CA4O1C","sourcesContent":["import {\n html,\n css,\n nothing,\n CSSResultGroup,\n TemplateResult,\n LitElement,\n PropertyValues,\n} from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { customElement } from '@src/utils/custom-element';\nimport { localized, msg } from '@lit/localize';\nimport { IASurveyQuestionInterface, IASurveyQuestionResponse } from './models';\n\n@customElement('ia-feature-feedback-survey-comment')\n@localized()\nexport class IAFeatureFeedbackSurveyComment\n extends LitElement\n implements IASurveyQuestionInterface\n{\n /**\n * The prompt text to show for this question.\n * If empty, no prompt text element will be rendered.\n */\n @property({ type: String }) prompt = '';\n\n /**\n * The current comment text for this question.\n */\n @property({ type: String }) value = '';\n\n /**\n * Whether this question must be answered in order to submit its parent survey.\n * Default false.\n */\n @property({ type: Boolean, reflect: true }) required = false;\n\n /**\n * @inheritdoc\n */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /**\n * Whether to omit the question number before this question's prompt text.\n * If true, this question will be skipped entirely in the numbering order.\n * Default false.\n */\n @property({ type: Boolean, reflect: true }) skipNumber = false;\n\n /**\n * Optional placeholder text to use for the comment field.\n */\n @property({ type: String }) placeholder?: string;\n\n /**\n * The textarea holding this question's comment text.\n */\n @query('#comments') private commentBox!: HTMLTextAreaElement;\n\n /**\n * Default placeholder text for required respones.\n */\n private static get DEFAULT_PLACEHOLDER_REQUIRED(): string {\n return msg('Comments');\n }\n\n /**\n * Default placeholder text for optional responses.\n */\n private static get DEFAULT_PLACEHOLDER_OPTIONAL(): string {\n return msg('Comments (optional)');\n }\n\n /**\n * @inheritdoc\n */\n readonly visible = true;\n\n private readonly internals; // ElementInternals\n\n static readonly formAssociated = true;\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n //\n // METHODS\n //\n\n constructor() {\n super();\n this.internals = this.attachInternals();\n }\n\n render() {\n return html`\n <div id=\"container\">\n ${this.promptTextTemplate}${this.commentBoxTemplate}\n </div>\n `;\n }\n\n willUpdate(changed: PropertyValues): void {\n if (changed.has('required')) {\n this.internals.ariaRequired = this.required.toString();\n }\n if (changed.has('disabled')) {\n this.internals.ariaDisabled = this.disabled.toString();\n }\n }\n\n /**\n * @inheritdoc\n */\n validate() {\n const isValid = !this.required || !!this.commentBox.value;\n if (isValid) {\n this.internals.setValidity({});\n } else {\n this.internals.setValidity(\n { valueMissing: true },\n msg('A comment is required.'),\n );\n }\n return this.internals.reportValidity();\n }\n\n /**\n * @inheritdoc\n */\n get numbered(): boolean {\n return !this.skipNumber;\n }\n\n /**\n * @inheritdoc\n */\n get response(): IASurveyQuestionResponse {\n return {\n name: this.prompt,\n comment: this.value,\n };\n }\n\n /**\n * Template for this question's prompt text, if applicable.\n * Will be preceded by the question number, unless the `skipNumber` flag is set.\n */\n private get promptTextTemplate(): TemplateResult | typeof nothing {\n if (!this.prompt) return nothing;\n\n const numberSlot = this.numbered\n ? html`<slot name=\"question-number\"></slot>`\n : nothing;\n\n return html`<div id=\"prompt-text\">${numberSlot}${this.prompt}</div>`;\n }\n\n /**\n * Template for the comment <textarea> for this question.\n */\n private get commentBoxTemplate(): TemplateResult {\n const defaultPlaceholder = this.required\n ? IAFeatureFeedbackSurveyComment.DEFAULT_PLACEHOLDER_REQUIRED\n : IAFeatureFeedbackSurveyComment.DEFAULT_PLACEHOLDER_OPTIONAL;\n\n const placeholder = this.placeholder ?? defaultPlaceholder;\n\n return html`\n <textarea\n id=\"comments\"\n tabindex=\"0\"\n placeholder=${placeholder}\n aria-labelledby=\"prompt-text\"\n aria-required=${this.required}\n .value=${this.value}\n ?disabled=${this.disabled}\n @change=${this.commentChanged}\n ></textarea>\n `;\n }\n\n /**\n * Handler for when the value of the comments textarea changes.\n */\n private commentChanged(): void {\n if (this.disabled) return;\n\n this.value = this.commentBox.value;\n if (this.value) this.internals.setValidity({});\n\n this.emitResponseChangedEvent();\n }\n\n /**\n * Emits a `responseChanged` event to notify parents of a new response value.\n */\n private emitResponseChangedEvent(): void {\n this.dispatchEvent(\n new CustomEvent('responseChanged', {\n detail: this.response,\n }),\n );\n }\n\n static get styles(): CSSResultGroup {\n const height = css`var(--commentHeight, 50px)`;\n const resize = css`var(--commentResize, none)`;\n\n const questionMargin = css`var(--surveyQuestionMargin, 0 0 15px 0)`;\n\n const promptFontWeight = css`var(--featureFeedbackPromptFontWeight, bold)`;\n const promptFontSize = css`var(--featureFeedbackPromptFontSize, 1.4rem)`;\n\n return css`\n #container {\n margin: ${questionMargin};\n }\n\n #prompt-text {\n text-align: left;\n margin-bottom: 5px;\n flex-grow: 1;\n font-size: ${promptFontSize};\n font-weight: ${promptFontWeight};\n }\n\n #comments {\n width: 100%;\n height: ${height};\n background-color: #ffffff;\n border: 1px #2c2c2c solid;\n border-radius: 4px;\n padding: 7px;\n -webkit-box-sizing: border-box;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n font-family: inherit;\n resize: ${resize};\n }\n\n #comments::placeholder {\n color: #767676;\n }\n\n :host(:invalid) #comments {\n box-shadow: 0 0 4px red;\n }\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-feature-feedback-survey-comment': IAFeatureFeedbackSurveyComment;\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { LitElement, nothing } from 'lit';
|
|
3
3
|
import { property } from 'lit/decorators.js';
|
|
4
|
-
import { customElement } from '../../
|
|
4
|
+
import { customElement } from '../../utils/custom-element.js';
|
|
5
5
|
let IAFeatureFeedbackSurveyExtra = class IAFeatureFeedbackSurveyExtra extends LitElement {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ia-feature-feedback-survey-extra.js","sourceRoot":"","sources":["../../../../src/elements/ia-feature-feedback/ia-feature-feedback-survey-extra.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ia-feature-feedback-survey-extra.js","sourceRoot":"","sources":["../../../../src/elements/ia-feature-feedback/ia-feature-feedback-survey-extra.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAInD,IAAM,4BAA4B,GAAlC,MAAM,4BACX,SAAQ,UAAU;IADb;;QAIL;;WAEG;QACwC,SAAI,GAAG,EAAE,CAAC;QAOrD;;WAEG;QACM,YAAO,GAAG,KAAK,CAAC;QAEzB;;;WAGG;QACH,aAAQ,GAAG,KAAK,CAAC;IAkCnB,CAAC;IAhCW,gBAAgB;QACxB,iDAAiD;QACjD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM;QACJ,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACH,IAAI,QAAQ;QACV,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACH,IAAI,QAAQ;QACV,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,KAAK;SACpB,CAAC;IACJ,CAAC;CACF,CAAA;AAlD4C;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0DAAW;AAKV;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2DAAgB;AAZ/C,4BAA4B;IADxC,aAAa,CAAC,kCAAkC,CAAC;GACrC,4BAA4B,CAyDxC","sourcesContent":["import { LitElement, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { customElement } from '@src/utils/custom-element';\nimport { IASurveyQuestionInterface, IASurveyQuestionResponse } from './models';\n\n@customElement('ia-feature-feedback-survey-extra')\nexport class IAFeatureFeedbackSurveyExtra\n extends LitElement\n implements IASurveyQuestionInterface\n{\n /**\n * The name associated with this extra info field.\n */\n @property({ type: String, reflect: true }) name = '';\n\n /**\n * The value of this field to be submitted in the survey response.\n */\n @property({ type: String, reflect: true }) value?: string;\n\n /**\n * @inheritdoc\n */\n readonly visible = false;\n\n /**\n * (Unused for extras)\n * @inheritdoc\n */\n disabled = false;\n\n protected createRenderRoot() {\n // We don't need a shadow root for this component\n return this;\n }\n\n render() {\n return nothing;\n }\n\n /**\n * @inheritdoc\n */\n validate(): boolean {\n return true;\n }\n\n /**\n * @inheritdoc\n */\n get numbered(): boolean {\n return false;\n }\n\n /**\n * @inheritdoc\n */\n get response(): IASurveyQuestionResponse {\n return {\n name: this.name,\n comment: this.value,\n };\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-feature-feedback-survey-extra': IAFeatureFeedbackSurveyExtra;\n }\n}\n"]}
|
|
@@ -2,7 +2,7 @@ var IAFeatureFeedbackSurveyVote_1;
|
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
3
|
import { html, css, nothing, LitElement, } from 'lit';
|
|
4
4
|
import { property, query } from 'lit/decorators.js';
|
|
5
|
-
import { customElement } from '../../
|
|
5
|
+
import { customElement } from '../../utils/custom-element.js';
|
|
6
6
|
import { classMap } from 'lit/directives/class-map.js';
|
|
7
7
|
import { localized, msg } from '@lit/localize';
|
|
8
8
|
import { thumbsUp } from './assets/img/thumb-up.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ia-feature-feedback-survey-vote.js","sourceRoot":"","sources":["../../../../src/elements/ia-feature-fe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B,sBAAsB;;;;;;;;;wBAShB,eAAe;;;;;;kBAMrB,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;KA0BrC,CAAC;IACJ,CAAC;;AAjYe,0CAAc,GAAG,IAAI,AAAP,CAAQ;AAE/B,6CAAiB,GAAG;IACzB,GAAG,UAAU,CAAC,iBAAiB;IAC/B,cAAc,EAAE,IAAI;CACrB,AAHuB,CAGtB;AA5E0B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2DAAqB;AAMpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yDAAyB;AAOxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DAAkB;AAKjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uEAA6B;AAMZ;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6DAAkB;AAKjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6DAAkB;AAOjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+DAAoB;AAOnB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iEAAsB;AAKrC;IAA3B,KAAK,CAAC,WAAW,CAAC;+DAAqD;AAxD7D,2BAA2B;IAFvC,aAAa,CAAC,iCAAiC,CAAC;IAChD,SAAS,EAAE;GACC,2BAA2B,CAidvC","sourcesContent":["import {\n html,\n css,\n nothing,\n CSSResultGroup,\n TemplateResult,\n LitElement,\n PropertyValues,\n} from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { customElement } from '@src/util/custom-element';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { localized, msg } from '@lit/localize';\nimport {\n IASurveyQuestionInterface,\n IASurveyQuestionResponse,\n Vote,\n} from './models';\nimport { IAFeatureFeedbackSurveyComment } from './ia-feature-feedback-survey-comment';\n\nimport { thumbsUp } from './assets/img/thumb-up';\nimport { thumbsDown } from './assets/img/thumb-down';\n\nimport './ia-feature-feedback-survey-comment';\n\n@customElement('ia-feature-feedback-survey-vote')\n@localized()\nexport class IAFeatureFeedbackSurveyVote\n extends LitElement\n implements IASurveyQuestionInterface\n{\n /**\n * The prompt text to show for this question.\n * If empty, no prompt text element will be rendered.\n */\n @property({ type: String }) prompt: string = '';\n\n /**\n * The current vote value of this question.\n * May be undefined if no vote has been selected yet.\n */\n @property({ type: String }) vote?: Vote = undefined;\n\n /**\n * The current comment text for this question.\n * May be undefined if no comment has been written or if this question does not\n * support text comments.\n */\n @property({ type: String }) comment?: string;\n\n /**\n * Optional placeholder text to use for this question's comment field, if shown.\n */\n @property({ type: String }) commentPlaceholder?: string;\n\n /**\n * Whether this question must be answered in order to submit its parent survey.\n * Default false.\n */\n @property({ type: Boolean, reflect: true }) required = false;\n\n /**\n * @inheritdoc\n */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /**\n * Whether to omit the question number before this question's prompt text.\n * If true, this question will be skipped entirely in the numbering order.\n * Default false.\n */\n @property({ type: Boolean, reflect: true }) skipNumber = false;\n\n /**\n * Whether to show a comment box as part of this question, allowing the user to\n * enter an optional text comment in addition to their vote.\n * Default false.\n */\n @property({ type: Boolean, reflect: true }) showComments = false;\n\n /**\n * The comment box sub-component for this question, if shown.\n */\n @query('#comments') private commentBox?: IAFeatureFeedbackSurveyComment;\n\n /**\n * Label exposed to screen-readers for the upvote button.\n */\n private static get UPVOTE_SR_LABEL(): string {\n return msg('Vote up');\n }\n\n /**\n * Label exposed to screen-readers for the downvote button.\n */\n private static get DOWNVOTE_SR_LABEL(): string {\n return msg('Vote down');\n }\n\n /**\n * @inheritdoc\n */\n readonly visible = true;\n\n private readonly internals; // ElementInternals\n\n static readonly formAssociated = true;\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n //\n // METHODS\n //\n\n constructor() {\n super();\n this.internals = this.attachInternals();\n }\n\n render() {\n return html`\n <div id=\"container\">\n <div\n id=\"prompt-row\"\n role=\"radiogroup\"\n aria-labelledby=\"prompt-text\"\n aria-required=${this.required}\n aria-disabled=${this.disabled}\n >\n ${this.promptTextTemplate}${this.voteButtonsTemplate}\n </div>\n ${this.commentFieldTemplate}\n </div>\n `;\n }\n\n willUpdate(changed: PropertyValues): void {\n if (changed.has('required')) {\n this.internals.ariaRequired = this.required.toString();\n }\n if (changed.has('disabled')) {\n this.internals.ariaDisabled = this.disabled.toString();\n }\n }\n\n /**\n * @inheritdoc\n */\n validate() {\n const isValid = !this.required || this.vote;\n if (isValid) {\n this.internals.setValidity({});\n } else {\n this.internals.setValidity({ valueMissing: true }, 'A vote is required.');\n }\n return this.internals.checkValidity();\n }\n\n /**\n * @inheritdoc\n */\n get numbered(): boolean {\n return !this.skipNumber;\n }\n\n /**\n * @inheritdoc\n */\n get response(): IASurveyQuestionResponse {\n return {\n ...this.commentBox?.response,\n name: this.prompt,\n rating: this.vote,\n };\n }\n\n /**\n * Template for this question's prompt text, if applicable.\n * Will be preceded by the question number, unless the `skipNumber` flag is set.\n */\n private get promptTextTemplate(): TemplateResult | typeof nothing {\n if (!this.prompt) return nothing;\n\n const numberSlot = this.numbered\n ? html`<slot name=\"question-number\"></slot>`\n : nothing;\n\n return html`<div id=\"prompt-text\">${numberSlot}${this.prompt}</div>`;\n }\n\n /**\n * Template for this question's up/down voting buttons.\n * The button selection is determined by the current vote state.\n */\n private get voteButtonsTemplate(): TemplateResult {\n const upvoteSelected = this.vote === 'up';\n const downvoteSelected = this.vote === 'down';\n const voteNotSelected = this.vote === undefined;\n\n const voteButtonBaseClasses = {\n 'vote-button': true,\n noselection: voteNotSelected,\n };\n\n const upvoteButtonClassMap = classMap({\n ...voteButtonBaseClasses,\n selected: upvoteSelected,\n unselected: downvoteSelected,\n });\n\n const downvoteButtonClassMap = classMap({\n ...voteButtonBaseClasses,\n selected: downvoteSelected,\n unselected: upvoteSelected,\n });\n\n return html`\n <label\n id=\"upvote\"\n class=${upvoteButtonClassMap}\n ?disabled=${this.disabled}\n >\n <input\n type=\"radio\"\n name=\"vote\"\n value=\"up\"\n ?checked=${upvoteSelected}\n ?disabled=${this.disabled}\n @click=${this.upvoteButtonSelected}\n @keydown=${this.upvoteKeyPressed}\n />\n ${thumbsUp}\n <span class=\"sr-only\"\n >${IAFeatureFeedbackSurveyVote.UPVOTE_SR_LABEL}</span\n >\n </label>\n\n <label\n id=\"downvote\"\n class=${downvoteButtonClassMap}\n ?disabled=${this.disabled}\n >\n <input\n type=\"radio\"\n name=\"vote\"\n value=\"down\"\n ?checked=${downvoteSelected}\n ?disabled=${this.disabled}\n @click=${this.downvoteButtonSelected}\n @keydown=${this.downvoteKeyPressed}\n />\n ${thumbsDown}\n <span class=\"sr-only\"\n >${IAFeatureFeedbackSurveyVote.DOWNVOTE_SR_LABEL}</span\n >\n </label>\n `;\n }\n\n /**\n * Template for this question's comment field, which may be `nothing` if comments\n * are not allowed for this question.\n */\n private get commentFieldTemplate(): TemplateResult | typeof nothing {\n if (!this.showComments) return nothing;\n\n return html`\n <ia-feature-feedback-survey-comment\n id=\"comments\"\n skipNumber\n .value=${this.comment ?? ''}\n .placeholder=${this.commentPlaceholder}\n ?disabled=${this.disabled}\n @responseChanged=${this.commentChanged}\n ></ia-feature-feedback-survey-comment>\n `;\n }\n\n /**\n * Handler for keydown events on the upvote button.\n */\n private upvoteKeyPressed(e: KeyboardEvent): void {\n if (e.key === 'Enter' || e.key === ' ') {\n this.upvoteButtonSelected();\n }\n }\n\n /**\n * Handler for keydown events on the downvote button.\n */\n private downvoteKeyPressed(e: KeyboardEvent): void {\n if (e.key === 'Enter' || e.key === ' ') {\n this.downvoteButtonSelected();\n }\n }\n\n /**\n * Handler for click events on the upvote button.\n */\n private upvoteButtonSelected(): void {\n this.handleVoteButtonSelection('up');\n }\n\n /**\n * Handler for click events on the downvote button.\n */\n private downvoteButtonSelected(): void {\n this.handleVoteButtonSelection('down');\n }\n\n /**\n * Handler for when either vote button is pressed, updating the vote state\n * for this question.\n */\n private handleVoteButtonSelection(vote: Vote): void {\n if (this.disabled) return;\n this.vote = vote;\n this.internals.setValidity({});\n this.emitResponseChangedEvent();\n }\n\n /**\n * Handler for when the value of the comment box changes (if applicable), updating\n * the comment state for this question.\n */\n private commentChanged(e: Event): void {\n e.stopPropagation();\n if (this.disabled) return;\n\n this.comment = this.commentBox?.value;\n this.emitResponseChangedEvent();\n }\n\n /**\n * Emits a `responseChanged` event to notify parents of a new response value.\n */\n private emitResponseChangedEvent(): void {\n this.dispatchEvent(\n new CustomEvent('responseChanged', {\n detail: this.response,\n }),\n );\n }\n\n static get styles(): CSSResultGroup {\n const questionMargin = css`var(--surveyQuestionMargin, 0 0 15px 0)`;\n\n const darkGrayColor = css`var(--featureFeedbackDarkGrayColor, #767676)`;\n const darkGrayColorSvgFilter = css`var(--defaultColorSvgFilter, invert(52%) sepia(0%) saturate(1%) hue-rotate(331deg) brightness(87%) contrast(89%))`;\n\n const defaultColor = css`var(--defaultColor, ${darkGrayColor})`;\n const defaultColorSvgFilter = css`var(--defaultColorSvgFilter, ${darkGrayColorSvgFilter})`;\n\n const upvoteColor = css`var(--upvoteColor, #23765D)`;\n const upvoteColorSvgFilter = css`var(--upvoteColorSvgFilter, invert(34%) sepia(72%) saturate(357%) hue-rotate(111deg) brightness(97%) contrast(95%))`;\n\n const downvoteColor = css`var(--downvoteColor, #720D11)`;\n const downvoteColorSvgFilter = css`var(--downvoteColorSvgFilter, invert(5%) sepia(81%) saturate(5874%) hue-rotate(352deg) brightness(105%) contrast(95%))`;\n\n const unselectedColor = css`var(--unselectedColor, #CCCCCC)`;\n const unselectedColorSvgFilter = css`var(--unselectedColorSvgFilter, invert(100%) sepia(0%) saturate(107%) hue-rotate(138deg) brightness(89%) contrast(77%))`;\n\n const promptFontWeight = css`var(--featureFeedbackPromptFontWeight, bold)`;\n const promptFontSize = css`var(--featureFeedbackPromptFontSize, 1.4rem)`;\n\n return css`\n #container {\n margin: ${questionMargin};\n }\n\n #prompt-row {\n display: flex;\n align-items: center;\n margin-bottom: 5px;\n }\n\n #prompt-text {\n text-align: left;\n flex-grow: 1;\n font-size: ${promptFontSize};\n font-weight: ${promptFontWeight};\n }\n\n .vote-button {\n background-color: #ffffff;\n border: 1px solid #767676;\n border-radius: 2px;\n margin-left: 10px;\n padding: 0;\n width: 25px;\n height: 25px;\n box-sizing: border-box;\n display: flex;\n justify-content: center;\n align-items: center;\n flex: none;\n cursor: pointer;\n }\n\n .vote-button:focus-within {\n outline: 2px solid black;\n outline-offset: 1px;\n }\n\n .vote-button svg {\n width: 15px;\n height: 15px;\n }\n\n .vote-button input {\n margin: 0;\n padding: 0;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n }\n\n .vote-button.noselection {\n border-color: ${defaultColor};\n }\n\n .vote-button.noselection svg {\n filter: ${defaultColorSvgFilter};\n }\n\n .vote-button.unselected {\n border-color: ${unselectedColor};\n }\n\n .vote-button.unselected svg {\n filter: ${unselectedColorSvgFilter};\n }\n\n #upvote.selected {\n border-color: ${upvoteColor};\n }\n\n #upvote.selected svg {\n filter: ${upvoteColorSvgFilter};\n }\n\n #downvote.selected {\n border-color: ${downvoteColor};\n }\n\n #downvote.selected svg {\n filter: ${downvoteColorSvgFilter};\n }\n\n .vote-button.error {\n box-shadow: 0 0 4px red;\n }\n\n .vote-button.noselection[disabled],\n .vote-button.unselected[disabled] {\n border-color: ${unselectedColor};\n cursor: not-allowed;\n }\n\n .vote-button.noselection[disabled] svg,\n .vote-button.unselected[disabled] svg {\n filter: ${unselectedColorSvgFilter};\n }\n\n :host(:invalid) #upvote,\n :host(:invalid) #downvote {\n box-shadow: 0 0 4px red;\n }\n\n #comments {\n --surveyQuestionMargin: 0;\n }\n\n .sr-only {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n margin: -1px !important;\n padding: 0 !important;\n border: 0 !important;\n overflow: hidden !important;\n white-space: nowrap !important;\n clip: rect(1px, 1px, 1px, 1px) !important;\n -webkit-clip-path: inset(50%) !important;\n clip-path: inset(50%) !important;\n user-select: none !important;\n }\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-feature-feedback-survey-vote': IAFeatureFeedbackSurveyVote;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ia-feature-feedback-survey-vote.js","sourceRoot":"","sources":["../../../../src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,IAAI,EACJ,GAAG,EACH,OAAO,EAGP,UAAU,GAEX,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAQ/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,sCAAsC,CAAC;AAIvC,IAAM,2BAA2B,mCAAjC,MAAM,2BACX,SAAQ,UAAU;IAyDlB;;OAEG;IACK,MAAM,KAAK,eAAe;QAChC,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC;IACxB,CAAC;IAED;;OAEG;IACK,MAAM,KAAK,iBAAiB;QAClC,OAAO,GAAG,CAAC,WAAW,CAAC,CAAC;IAC1B,CAAC;IAgBD,EAAE;IACF,UAAU;IACV,EAAE;IAEF;QACE,KAAK,EAAE,CAAC;QAvFV;;;WAGG;QACyB,WAAM,GAAW,EAAE,CAAC;QA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AAOnB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iEAAsB;AAKrC;IAA3B,KAAK,CAAC,WAAW,CAAC;+DAAqD;AAxD7D,2BAA2B;IAFvC,aAAa,CAAC,iCAAiC,CAAC;IAChD,SAAS,EAAE;GACC,2BAA2B,CAidvC","sourcesContent":["import {\n html,\n css,\n nothing,\n CSSResultGroup,\n TemplateResult,\n LitElement,\n PropertyValues,\n} from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { customElement } from '@src/utils/custom-element';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { localized, msg } from '@lit/localize';\nimport {\n IASurveyQuestionInterface,\n IASurveyQuestionResponse,\n Vote,\n} from './models';\nimport { IAFeatureFeedbackSurveyComment } from './ia-feature-feedback-survey-comment';\n\nimport { thumbsUp } from './assets/img/thumb-up';\nimport { thumbsDown } from './assets/img/thumb-down';\n\nimport './ia-feature-feedback-survey-comment';\n\n@customElement('ia-feature-feedback-survey-vote')\n@localized()\nexport class IAFeatureFeedbackSurveyVote\n extends LitElement\n implements IASurveyQuestionInterface\n{\n /**\n * The prompt text to show for this question.\n * If empty, no prompt text element will be rendered.\n */\n @property({ type: String }) prompt: string = '';\n\n /**\n * The current vote value of this question.\n * May be undefined if no vote has been selected yet.\n */\n @property({ type: String }) vote?: Vote = undefined;\n\n /**\n * The current comment text for this question.\n * May be undefined if no comment has been written or if this question does not\n * support text comments.\n */\n @property({ type: String }) comment?: string;\n\n /**\n * Optional placeholder text to use for this question's comment field, if shown.\n */\n @property({ type: String }) commentPlaceholder?: string;\n\n /**\n * Whether this question must be answered in order to submit its parent survey.\n * Default false.\n */\n @property({ type: Boolean, reflect: true }) required = false;\n\n /**\n * @inheritdoc\n */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /**\n * Whether to omit the question number before this question's prompt text.\n * If true, this question will be skipped entirely in the numbering order.\n * Default false.\n */\n @property({ type: Boolean, reflect: true }) skipNumber = false;\n\n /**\n * Whether to show a comment box as part of this question, allowing the user to\n * enter an optional text comment in addition to their vote.\n * Default false.\n */\n @property({ type: Boolean, reflect: true }) showComments = false;\n\n /**\n * The comment box sub-component for this question, if shown.\n */\n @query('#comments') private commentBox?: IAFeatureFeedbackSurveyComment;\n\n /**\n * Label exposed to screen-readers for the upvote button.\n */\n private static get UPVOTE_SR_LABEL(): string {\n return msg('Vote up');\n }\n\n /**\n * Label exposed to screen-readers for the downvote button.\n */\n private static get DOWNVOTE_SR_LABEL(): string {\n return msg('Vote down');\n }\n\n /**\n * @inheritdoc\n */\n readonly visible = true;\n\n private readonly internals; // ElementInternals\n\n static readonly formAssociated = true;\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n //\n // METHODS\n //\n\n constructor() {\n super();\n this.internals = this.attachInternals();\n }\n\n render() {\n return html`\n <div id=\"container\">\n <div\n id=\"prompt-row\"\n role=\"radiogroup\"\n aria-labelledby=\"prompt-text\"\n aria-required=${this.required}\n aria-disabled=${this.disabled}\n >\n ${this.promptTextTemplate}${this.voteButtonsTemplate}\n </div>\n ${this.commentFieldTemplate}\n </div>\n `;\n }\n\n willUpdate(changed: PropertyValues): void {\n if (changed.has('required')) {\n this.internals.ariaRequired = this.required.toString();\n }\n if (changed.has('disabled')) {\n this.internals.ariaDisabled = this.disabled.toString();\n }\n }\n\n /**\n * @inheritdoc\n */\n validate() {\n const isValid = !this.required || this.vote;\n if (isValid) {\n this.internals.setValidity({});\n } else {\n this.internals.setValidity({ valueMissing: true }, 'A vote is required.');\n }\n return this.internals.checkValidity();\n }\n\n /**\n * @inheritdoc\n */\n get numbered(): boolean {\n return !this.skipNumber;\n }\n\n /**\n * @inheritdoc\n */\n get response(): IASurveyQuestionResponse {\n return {\n ...this.commentBox?.response,\n name: this.prompt,\n rating: this.vote,\n };\n }\n\n /**\n * Template for this question's prompt text, if applicable.\n * Will be preceded by the question number, unless the `skipNumber` flag is set.\n */\n private get promptTextTemplate(): TemplateResult | typeof nothing {\n if (!this.prompt) return nothing;\n\n const numberSlot = this.numbered\n ? html`<slot name=\"question-number\"></slot>`\n : nothing;\n\n return html`<div id=\"prompt-text\">${numberSlot}${this.prompt}</div>`;\n }\n\n /**\n * Template for this question's up/down voting buttons.\n * The button selection is determined by the current vote state.\n */\n private get voteButtonsTemplate(): TemplateResult {\n const upvoteSelected = this.vote === 'up';\n const downvoteSelected = this.vote === 'down';\n const voteNotSelected = this.vote === undefined;\n\n const voteButtonBaseClasses = {\n 'vote-button': true,\n noselection: voteNotSelected,\n };\n\n const upvoteButtonClassMap = classMap({\n ...voteButtonBaseClasses,\n selected: upvoteSelected,\n unselected: downvoteSelected,\n });\n\n const downvoteButtonClassMap = classMap({\n ...voteButtonBaseClasses,\n selected: downvoteSelected,\n unselected: upvoteSelected,\n });\n\n return html`\n <label\n id=\"upvote\"\n class=${upvoteButtonClassMap}\n ?disabled=${this.disabled}\n >\n <input\n type=\"radio\"\n name=\"vote\"\n value=\"up\"\n ?checked=${upvoteSelected}\n ?disabled=${this.disabled}\n @click=${this.upvoteButtonSelected}\n @keydown=${this.upvoteKeyPressed}\n />\n ${thumbsUp}\n <span class=\"sr-only\"\n >${IAFeatureFeedbackSurveyVote.UPVOTE_SR_LABEL}</span\n >\n </label>\n\n <label\n id=\"downvote\"\n class=${downvoteButtonClassMap}\n ?disabled=${this.disabled}\n >\n <input\n type=\"radio\"\n name=\"vote\"\n value=\"down\"\n ?checked=${downvoteSelected}\n ?disabled=${this.disabled}\n @click=${this.downvoteButtonSelected}\n @keydown=${this.downvoteKeyPressed}\n />\n ${thumbsDown}\n <span class=\"sr-only\"\n >${IAFeatureFeedbackSurveyVote.DOWNVOTE_SR_LABEL}</span\n >\n </label>\n `;\n }\n\n /**\n * Template for this question's comment field, which may be `nothing` if comments\n * are not allowed for this question.\n */\n private get commentFieldTemplate(): TemplateResult | typeof nothing {\n if (!this.showComments) return nothing;\n\n return html`\n <ia-feature-feedback-survey-comment\n id=\"comments\"\n skipNumber\n .value=${this.comment ?? ''}\n .placeholder=${this.commentPlaceholder}\n ?disabled=${this.disabled}\n @responseChanged=${this.commentChanged}\n ></ia-feature-feedback-survey-comment>\n `;\n }\n\n /**\n * Handler for keydown events on the upvote button.\n */\n private upvoteKeyPressed(e: KeyboardEvent): void {\n if (e.key === 'Enter' || e.key === ' ') {\n this.upvoteButtonSelected();\n }\n }\n\n /**\n * Handler for keydown events on the downvote button.\n */\n private downvoteKeyPressed(e: KeyboardEvent): void {\n if (e.key === 'Enter' || e.key === ' ') {\n this.downvoteButtonSelected();\n }\n }\n\n /**\n * Handler for click events on the upvote button.\n */\n private upvoteButtonSelected(): void {\n this.handleVoteButtonSelection('up');\n }\n\n /**\n * Handler for click events on the downvote button.\n */\n private downvoteButtonSelected(): void {\n this.handleVoteButtonSelection('down');\n }\n\n /**\n * Handler for when either vote button is pressed, updating the vote state\n * for this question.\n */\n private handleVoteButtonSelection(vote: Vote): void {\n if (this.disabled) return;\n this.vote = vote;\n this.internals.setValidity({});\n this.emitResponseChangedEvent();\n }\n\n /**\n * Handler for when the value of the comment box changes (if applicable), updating\n * the comment state for this question.\n */\n private commentChanged(e: Event): void {\n e.stopPropagation();\n if (this.disabled) return;\n\n this.comment = this.commentBox?.value;\n this.emitResponseChangedEvent();\n }\n\n /**\n * Emits a `responseChanged` event to notify parents of a new response value.\n */\n private emitResponseChangedEvent(): void {\n this.dispatchEvent(\n new CustomEvent('responseChanged', {\n detail: this.response,\n }),\n );\n }\n\n static get styles(): CSSResultGroup {\n const questionMargin = css`var(--surveyQuestionMargin, 0 0 15px 0)`;\n\n const darkGrayColor = css`var(--featureFeedbackDarkGrayColor, #767676)`;\n const darkGrayColorSvgFilter = css`var(--defaultColorSvgFilter, invert(52%) sepia(0%) saturate(1%) hue-rotate(331deg) brightness(87%) contrast(89%))`;\n\n const defaultColor = css`var(--defaultColor, ${darkGrayColor})`;\n const defaultColorSvgFilter = css`var(--defaultColorSvgFilter, ${darkGrayColorSvgFilter})`;\n\n const upvoteColor = css`var(--upvoteColor, #23765D)`;\n const upvoteColorSvgFilter = css`var(--upvoteColorSvgFilter, invert(34%) sepia(72%) saturate(357%) hue-rotate(111deg) brightness(97%) contrast(95%))`;\n\n const downvoteColor = css`var(--downvoteColor, #720D11)`;\n const downvoteColorSvgFilter = css`var(--downvoteColorSvgFilter, invert(5%) sepia(81%) saturate(5874%) hue-rotate(352deg) brightness(105%) contrast(95%))`;\n\n const unselectedColor = css`var(--unselectedColor, #CCCCCC)`;\n const unselectedColorSvgFilter = css`var(--unselectedColorSvgFilter, invert(100%) sepia(0%) saturate(107%) hue-rotate(138deg) brightness(89%) contrast(77%))`;\n\n const promptFontWeight = css`var(--featureFeedbackPromptFontWeight, bold)`;\n const promptFontSize = css`var(--featureFeedbackPromptFontSize, 1.4rem)`;\n\n return css`\n #container {\n margin: ${questionMargin};\n }\n\n #prompt-row {\n display: flex;\n align-items: center;\n margin-bottom: 5px;\n }\n\n #prompt-text {\n text-align: left;\n flex-grow: 1;\n font-size: ${promptFontSize};\n font-weight: ${promptFontWeight};\n }\n\n .vote-button {\n background-color: #ffffff;\n border: 1px solid #767676;\n border-radius: 2px;\n margin-left: 10px;\n padding: 0;\n width: 25px;\n height: 25px;\n box-sizing: border-box;\n display: flex;\n justify-content: center;\n align-items: center;\n flex: none;\n cursor: pointer;\n }\n\n .vote-button:focus-within {\n outline: 2px solid black;\n outline-offset: 1px;\n }\n\n .vote-button svg {\n width: 15px;\n height: 15px;\n }\n\n .vote-button input {\n margin: 0;\n padding: 0;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n }\n\n .vote-button.noselection {\n border-color: ${defaultColor};\n }\n\n .vote-button.noselection svg {\n filter: ${defaultColorSvgFilter};\n }\n\n .vote-button.unselected {\n border-color: ${unselectedColor};\n }\n\n .vote-button.unselected svg {\n filter: ${unselectedColorSvgFilter};\n }\n\n #upvote.selected {\n border-color: ${upvoteColor};\n }\n\n #upvote.selected svg {\n filter: ${upvoteColorSvgFilter};\n }\n\n #downvote.selected {\n border-color: ${downvoteColor};\n }\n\n #downvote.selected svg {\n filter: ${downvoteColorSvgFilter};\n }\n\n .vote-button.error {\n box-shadow: 0 0 4px red;\n }\n\n .vote-button.noselection[disabled],\n .vote-button.unselected[disabled] {\n border-color: ${unselectedColor};\n cursor: not-allowed;\n }\n\n .vote-button.noselection[disabled] svg,\n .vote-button.unselected[disabled] svg {\n filter: ${unselectedColorSvgFilter};\n }\n\n :host(:invalid) #upvote,\n :host(:invalid) #downvote {\n box-shadow: 0 0 4px red;\n }\n\n #comments {\n --surveyQuestionMargin: 0;\n }\n\n .sr-only {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n margin: -1px !important;\n padding: 0 !important;\n border: 0 !important;\n overflow: hidden !important;\n white-space: nowrap !important;\n clip: rect(1px, 1px, 1px, 1px) !important;\n -webkit-clip-path: inset(50%) !important;\n clip-path: inset(50%) !important;\n user-select: none !important;\n }\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-feature-feedback-survey-vote': IAFeatureFeedbackSurveyVote;\n }\n}\n"]}
|
|
@@ -2,7 +2,7 @@ var IAFeatureFeedbackSurvey_1;
|
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
3
|
import { html, css, LitElement, nothing, } from 'lit';
|
|
4
4
|
import { property, state, query, queryAssignedElements, } from 'lit/decorators.js';
|
|
5
|
-
import { customElement } from '../../
|
|
5
|
+
import { customElement } from '../../utils/custom-element.js';
|
|
6
6
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
7
7
|
import { localized, msg } from '@lit/localize';
|
|
8
8
|
import { canBeDisabled, canBeNumbered, canBeValidated, hasSurveyResponse, } from './models.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ia-feature-feedback-survey.js","sourceRoot":"","sources":["../../../../src/elements/ia-feature-feedback/ia-feature-feedback-survey.ts"],"names":[],"mappings":";;AAAA,OA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;AAKhD;IAAhB,KAAK,EAAE;0DAAuB;AAKd;IAAhB,KAAK,EAAE;0DAAuB;AAKd;IAAhB,KAAK,EAAE;sDAA6B;AAKR;IAA5B,KAAK,CAAC,YAAY,CAAC;0DAAoC;AAK/B;IAAxB,KAAK,CAAC,QAAQ,CAAC;sDAAgC;AAKf;IAAhC,KAAK,CAAC,gBAAgB,CAAC;6DAA0C;AAKjC;IAAhC,KAAK,CAAC,gBAAgB,CAAC;6DAA0C;AAKjC;IAAhC,qBAAqB,EAAE;iEAA0C;AAxGvD,uBAAuB;IAFnC,aAAa,CAAC,4BAA4B,CAAC;IAC3C,SAAS,EAAE;GACC,uBAAuB,CA47BnC","sourcesContent":["import {\n html,\n css,\n LitElement,\n nothing,\n CSSResultGroup,\n PropertyValues,\n TemplateResult,\n} from 'lit';\nimport {\n property,\n state,\n query,\n queryAssignedElements,\n} from 'lit/decorators.js';\nimport { customElement } from '@src/util/custom-element';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { localized, msg } from '@lit/localize';\n\nimport type {\n SharedResizeObserverInterface,\n SharedResizeObserverResizeHandlerInterface,\n} from '@internetarchive/shared-resize-observer';\nimport type { RecaptchaManagerInterface } from '@src/services/recaptcha-manager/recaptcha-manager';\nimport type { RecaptchaWidgetInterface } from '@src/services/recaptcha-manager/recaptcha-widget';\n\nimport type { FeatureFeedbackServiceInterface } from './feature-feedback-service';\nimport {\n canBeDisabled,\n canBeNumbered,\n canBeValidated,\n hasSurveyResponse,\n SurveyError,\n SurveySubmissionState,\n} from './models';\nimport { timedPromise } from './utils/timed-promise';\n\nimport { thumbsUp } from './assets/img/thumb-up';\nimport { thumbsDown } from './assets/img/thumb-down';\n\nimport './ia-feature-feedback-survey-vote';\nimport './ia-feature-feedback-survey-comment';\nimport './ia-feature-feedback-survey-extra';\n\n@customElement('ia-feature-feedback-survey')\n@localized()\nexport class IAFeatureFeedbackSurvey\n extends LitElement\n implements SharedResizeObserverResizeHandlerInterface\n{\n /**\n * Internal identifier of the survey.\n */\n @property({ type: String }) surveyIdentifier?: string;\n\n /**\n * What text to display on the button that opens the survey popup\n * (default 'Feedback', localized).\n */\n @property({ type: String }) buttonText?: string;\n\n /**\n * Whether to show the up/down thumbs beside the feedback button text (default `false`).\n */\n @property({ type: Boolean }) showButtonThumbs = false;\n\n /**\n * Whether to show question numbers beside each survey question (default `false`).\n */\n @property({ type: Boolean }) showQuestionNumbers = false;\n\n /**\n * Whether the widget is disabled, preventing it from opening (default `false`).\n */\n @property({ type: Boolean }) disabled = false;\n\n /**\n * Time-out threshold, in milliseconds for submit operations (default `8000`).\n */\n @property({ type: Number }) submitTimeout = 8000;\n\n /**\n * Feature Feedback Service instance to handle survey submissions.\n */\n @property({ type: Object })\n featureFeedbackService?: FeatureFeedbackServiceInterface;\n\n /**\n * Recaptcha Manager instance for generating the Recaptcha widget and tokens.\n */\n @property({ type: Object }) recaptchaManager?: RecaptchaManagerInterface;\n\n /**\n * Shared Resize Observer instance to reposition the popup when the page is resized.\n */\n @property({ type: Object }) resizeObserver?: SharedResizeObserverInterface;\n\n /**\n * Whether the popup is currently open.\n */\n @state() private isOpen = false;\n\n /**\n * The current state of the widget's survey submission.\n * - `idle`: No submit has succeeded or been attempted since the popup was last toggled.\n * - `processing`: The widget is currently submitting a response.\n * - `submitted`: The widget has successfully submitted a response.\n * - `error`: The widget encountered an error while submitting its last response,\n * and the popup has not yet been closed.\n */\n @state() private submissionState: SurveySubmissionState = 'idle';\n\n /**\n * X-coordinate of the popup's top left corner.\n */\n @state() private popupTopX = 0;\n\n /**\n * Y-coordinate of the popup's top left corner.\n */\n @state() private popupTopY = 0;\n\n /**\n * Error message to display.\n */\n @state() private error?: SurveyError;\n\n /**\n * The feedback button's container element.\n */\n @query('#container') private container!: HTMLDivElement;\n\n /**\n * The outer container element of the popup.\n */\n @query('#popup') private popup!: HTMLDivElement;\n\n /**\n * The popup form's Cancel button\n */\n @query('#cancel-button') private cancelButton!: HTMLButtonElement;\n\n /**\n * The popup form's Submit button\n */\n @query('#submit-button') private submitButton!: HTMLButtonElement;\n\n /**\n * All elements assigned to the default slot\n */\n @queryAssignedElements() private assignedElements!: HTMLElement[];\n\n /**\n * Promise for any currently loading Recaptcha widget, resolving to the widget when\n * it is finished loading.\n */\n private recaptchaWidgetPromise?: Promise<RecaptchaWidgetInterface>;\n\n private resizingElement = document.body;\n\n /**\n * Text to show on the submit button when idle.\n */\n private static get SUBMIT_BUTTON_NORMAL_TEXT(): string {\n return msg('Submit feedback');\n }\n\n /**\n * Text to show on the submit button while submitting a response.\n */\n private static get SUBMIT_BUTTON_PROCESSING_TEXT(): string {\n return msg('Submitting...');\n }\n\n /**\n * Error message to show when some required questions do not have responses.\n */\n private static get ERROR_MESSAGE_MISSING_REQUIRED_INPUT(): string {\n return msg('Please respond to the indicated questions.');\n }\n\n /**\n * Error message to show when the survey submission encounters an error response.\n */\n private static get ERROR_MESSAGE_SUBMIT_REQUEST_FAILED(): string {\n return msg('There was an error submitting your feedback.');\n }\n\n //\n // METHODS\n //\n\n render() {\n return html`<div id=\"container\">${this.feedbackButtonTemplate}</div>`;\n }\n\n willUpdate(changed: PropertyValues): void {\n if (changed.has('submissionState')) {\n if (this.isProcessing || this.isSubmitted) {\n this.disableSlottedChildren();\n } else {\n this.restoreSlottedChildrenDisabledStates();\n }\n }\n\n if (changed.has('resizeObserver')) {\n const oldObserver = changed.get(\n 'resizeObserver',\n ) as SharedResizeObserverInterface;\n this.disconnectResizeObserver(oldObserver);\n }\n }\n\n updated(changed: PropertyValues): void {\n if (changed.has('showQuestionNumbers') || changed.has('assignedElements')) {\n this.applyQuestionNumbers();\n }\n\n const priorSubmissionState = changed.get('submissionState');\n if (priorSubmissionState) {\n if (\n this.submissionState === 'error' ||\n priorSubmissionState === 'error'\n ) {\n // Transitioning to or from the `error` state can change the height of the popup,\n // so we may need to reposition.\n this.positionPopup();\n }\n }\n\n if (changed.has('isOpen') && this.isOpen) {\n this.focusFirstFormElement();\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEscapeListener();\n this.stopScrollObserver();\n this.disconnectResizeObserver(this.resizeObserver);\n }\n\n /**\n * Sets all disableable slotted children to be disabled, and sets their `originallyDisabled`\n * data property to `true` if they were already disabled.\n */\n private disableSlottedChildren(): void {\n this.assignedElements.filter(canBeDisabled).forEach((elmt) => {\n elmt.dataset.originallyDisabled = elmt.disabled ? 'true' : 'false';\n elmt.disabled = true;\n });\n }\n\n /**\n * Sets all disableable slotted children to their original disabled state if possible.\n * Will only mutate any children that have an `originallyDisabled` data property set,\n * and will subsequently remove it from the dataset if found.\n */\n private restoreSlottedChildrenDisabledStates(): void {\n this.assignedElements.filter(canBeDisabled).forEach((elmt) => {\n const { originallyDisabled } = elmt.dataset;\n if (originallyDisabled === undefined) return;\n\n const originalState = originallyDisabled === 'true';\n delete elmt.dataset.originallyDisabled;\n elmt.disabled = originalState;\n });\n }\n\n /**\n * Repositions any open popup when the window resizes.\n */\n handleResize() {\n if (this.isOpen) {\n this.positionPopup();\n }\n }\n\n /**\n * Repositions any open popup to account for the new scroll position.\n *\n * (Uses an arrow function to achieve lexical `this` binding, so that we don't\n * need to manually bind it)\n */\n private handleScroll = () => {\n if (this.isOpen) {\n this.positionPopup();\n }\n };\n\n /**\n * Handles Escape key events by closing the popup as though the Cancel button\n * were clicked.\n *\n * (Uses an arrow function to achieve lexical `this` binding, so that we don't\n * need to manually bind it)\n */\n private handleEscape = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n this.cancel(e);\n }\n };\n\n private setupEscapeListener() {\n document.addEventListener('keyup', this.handleEscape);\n }\n\n private removeEscapeListener() {\n document.removeEventListener('keyup', this.handleEscape);\n }\n\n private setupScrollObserver() {\n document.addEventListener('scroll', this.handleScroll);\n }\n\n private stopScrollObserver() {\n document.removeEventListener('scroll', this.handleScroll);\n }\n\n private setupResizeObserver() {\n if (!this.resizeObserver) return;\n this.resizeObserver.addObserver({\n handler: this,\n target: this.resizingElement,\n });\n }\n\n private disconnectResizeObserver(observer?: SharedResizeObserverInterface) {\n const observerToRemove = observer ?? this.resizeObserver;\n observerToRemove?.removeObserver({\n handler: this,\n target: this.resizingElement,\n });\n }\n\n /**\n * Requests the Recaptcha Manager generate the Recaptcha widget if possible.\n *\n * Returns `undefined` if no Recaptcha Manager is available.\n *\n * If this method has been called already, it will return the Promise generated\n * by the previous call.\n *\n * Otherwise, a new widget is requested, with the resulting Promise returned\n * and saved to `this.recaptchaWidgetPromise` for other consumers to await.\n */\n private getRecaptchaWidget(): Promise<RecaptchaWidgetInterface> | undefined {\n // If we've already started generating a widget, return the previous Promise.\n if (this.recaptchaWidgetPromise) return this.recaptchaWidgetPromise;\n\n if (!this.recaptchaManager) return undefined;\n this.recaptchaWidgetPromise = this.recaptchaManager.getRecaptchaWidget();\n\n return this.recaptchaWidgetPromise;\n }\n\n /**\n * Resets the widget submission/error state back to defaults.\n * Questions and responses are unaffected.\n */\n private resetSubmissionState(): void {\n this.setSubmissionState('idle');\n this.error = undefined;\n }\n\n /**\n * Sets the submission state to the given value, emitting a state change event\n * if it differs from the old state.\n */\n private setSubmissionState(newState: SurveySubmissionState): void {\n if (this.submissionState === newState) return;\n\n this.submissionState = newState;\n this.emitSubmissionStateChanged();\n }\n\n /**\n * Emits a `submissionStateChanged` event with the current submission state.\n */\n private emitSubmissionStateChanged(): void {\n this.dispatchEvent(\n new CustomEvent('submissionStateChanged', {\n detail: this.submissionState,\n }),\n );\n }\n\n /**\n * Whether the survey is currently submitting its responses.\n */\n get isProcessing(): boolean {\n return this.submissionState === 'processing';\n }\n\n /**\n * Whether the survey has been successfully submitted.\n */\n get isSubmitted(): boolean {\n return this.submissionState === 'submitted';\n }\n\n /**\n * Opens the popup pane, provided the survey has not already been submitted.\n *\n * This will also trigger the Recaptcha widget to begin loading, if it has not already.\n */\n showPopup(): void {\n if (this.isSubmitted) return;\n\n this.setupResizeObserver();\n this.setupScrollObserver();\n this.setupEscapeListener();\n this.positionPopup();\n this.isOpen = true;\n this.getRecaptchaWidget();\n }\n\n /**\n * Closes the popup pane and removes any attached listeners.\n */\n closePopup(): void {\n this.disconnectResizeObserver();\n this.stopScrollObserver();\n this.removeEscapeListener();\n this.isOpen = false;\n }\n\n /**\n * Positions the popup pane so that it resides entirely within the viewport, if possible.\n */\n private positionPopup(): void {\n const containerRect = this.container.getBoundingClientRect();\n const popupRect = this.popup.getBoundingClientRect();\n const windowWidth = window.innerWidth;\n const windowHeight = window.innerHeight;\n const windowCenterX = windowWidth / 2;\n const windowCenterY = windowHeight / 2;\n const bufferX = 5;\n const bufferY = 5;\n\n if (containerRect.left < windowCenterX) {\n this.popupTopX = containerRect.right - 20;\n } else {\n this.popupTopX = containerRect.left + 20 - popupRect.width;\n }\n if (this.popupTopX + popupRect.width > windowWidth) {\n this.popupTopX = windowWidth - popupRect.width - bufferX;\n }\n\n if (containerRect.top < windowCenterY) {\n this.popupTopY = containerRect.bottom - 10;\n } else {\n this.popupTopY = containerRect.top + 10 - popupRect.height;\n }\n if (this.popupTopY + popupRect.height > windowHeight) {\n this.popupTopY = windowHeight - popupRect.height - bufferY;\n }\n\n this.popupTopX = Math.max(bufferX, this.popupTopX);\n this.popupTopY = Math.max(bufferY, this.popupTopY);\n }\n\n /**\n * Template for the feedback button's up/down thumb icons, if they are to be shown.\n */\n private get feedbackButtonThumbsTemplate(): TemplateResult | typeof nothing {\n if (!this.showButtonThumbs) return nothing;\n\n return html`\n <span class=\"beta-button-icon\">${thumbsUp}</span>\n <span class=\"beta-button-icon\">${thumbsDown}</span>\n `;\n }\n\n /**\n * Template for the feedback button's success checkmark.\n */\n private get feedbackButtonCheckTemplate(): TemplateResult {\n return html`<span class=\"beta-button-icon success\">✓</span>`;\n }\n\n /**\n * Template for the feedback button that opens the survey when clicked.\n */\n private get feedbackButtonTemplate(): TemplateResult {\n return html`\n <button\n id=\"beta-button\"\n tabindex=\"0\"\n aria-haspopup=\"dialog\"\n ?disabled=${this.disabled}\n @click=${this.showPopup}\n >\n <span id=\"button-text\">${this.buttonText ?? msg('Feedback')}</span>\n ${this.isSubmitted\n ? this.feedbackButtonCheckTemplate\n : this.feedbackButtonThumbsTemplate}\n </button>\n ${this.popupTemplate}\n `;\n }\n\n /**\n * Template for the current error message, if any.\n */\n private get errorTemplate(): TemplateResult | typeof nothing {\n const { error } = this;\n if (!error) return nothing;\n const message =\n error.kind === 'missingInput'\n ? IAFeatureFeedbackSurvey.ERROR_MESSAGE_MISSING_REQUIRED_INPUT\n : IAFeatureFeedbackSurvey.ERROR_MESSAGE_SUBMIT_REQUEST_FAILED;\n const detail =\n error.kind === 'submitFailed' && error.detail !== undefined\n ? html`<br />${msg('Error: ')}${error.detail}`\n : nothing;\n return html`<div id=\"error\">${message}${detail}</div>`;\n }\n\n /**\n * Template for the full popup survey that appears when the feedback\n * button is clicked.\n */\n private get popupTemplate(): TemplateResult {\n const shouldDisableControls = this.isProcessing || this.isSubmitted;\n const submitButtonText = this.isProcessing\n ? IAFeatureFeedbackSurvey.SUBMIT_BUTTON_PROCESSING_TEXT\n : IAFeatureFeedbackSurvey.SUBMIT_BUTTON_NORMAL_TEXT;\n\n const errorMessage = this.errorTemplate;\n\n const popupStyles = styleMap({\n left: `${this.popupTopX}px`,\n top: `${this.popupTopY}px`,\n });\n\n const stopPropagation = (e: Event) => e.stopPropagation();\n\n return html`\n <div\n id=\"popup-background\"\n class=${this.isOpen ? 'open' : 'closed'}\n @click=${this.backgroundClicked}\n @keydown=${this.backgroundClicked}\n >\n <div\n class=\"focus-trap\"\n tabindex=\"0\"\n @focus=${this.focusSubmitButton}\n ></div>\n <div\n id=\"popup\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"survey-heading\"\n style=${popupStyles}\n >\n <h2 id=\"survey-heading\" class=\"sr-only\">${msg('Feedback Survey')}</h2>\n <form\n id=\"form\"\n ?disabled=${shouldDisableControls}\n @click=${stopPropagation}\n @keydown=${stopPropagation}\n @submit=${this.submit}\n >\n <slot id=\"questions-slot\"></slot>\n ${errorMessage}\n <div id=\"actions\">\n <button\n type=\"button\"\n id=\"cancel-button\"\n class=\"cta-button ia-button dark\"\n tabindex=\"0\"\n ?disabled=${shouldDisableControls}\n @click=${this.cancel}\n >\n ${msg('Cancel')}\n </button>\n <button\n type=\"submit\"\n id=\"submit-button\"\n class=\"cta-button ia-button primary\"\n tabindex=\"0\"\n ?disabled=${shouldDisableControls}\n >\n ${submitButtonText}\n </button>\n </div>\n </form>\n </div>\n <div\n class=\"focus-trap\"\n tabindex=\"0\"\n @focus=${this.focusFirstFormElement}\n ></div>\n </div>\n `;\n }\n\n /**\n * Assigns focus to the first focusable slotted element in the form.\n */\n private focusFirstFormElement(): void {\n // Blur any previously-focused element so that the active element is null\n const rootNode = this.getRootNode() as Document | ShadowRoot;\n\n // Iterate through the slotted form elements and try to focus each one until we succeed\n for (const elmt of this.assignedElements) {\n elmt.focus();\n if (rootNode.activeElement === elmt) return; // We found the first focusable element, we're done\n }\n\n // If there were no focusable slotted elements, just focus the Cancel button next in line\n this.focusCancelButton();\n }\n\n /**\n * Assigns focus to the Cancel button at the end of the form.\n */\n private focusCancelButton(): void {\n this.cancelButton.focus();\n }\n\n /**\n * Assigns focus to the Submit button at the end of the form.\n */\n private focusSubmitButton(): void {\n this.submitButton.focus();\n }\n\n /**\n * Assigns slotted question numbers to all slotted questions that have `numbered`\n * set to true (indicating that they intend to participate in question numbering).\n */\n private applyQuestionNumbers(): void {\n if (!this.showQuestionNumbers) {\n // Remove any previously-added question numbers\n this.assignedElements.forEach((elmt) => {\n elmt.querySelector('[slot=question-number]')?.remove();\n });\n return;\n }\n\n let questionNumber = 1;\n this.assignedElements\n .filter((elmt) => canBeNumbered(elmt) && elmt.numbered)\n .forEach((elmt) => {\n let numberingElmt = elmt.querySelector('[slot=question-number]');\n\n if (!numberingElmt) {\n numberingElmt = document.createElement('span');\n numberingElmt.setAttribute('slot', 'question-number');\n }\n\n numberingElmt.textContent = `${questionNumber}. `;\n elmt.append(numberingElmt);\n\n questionNumber += 1;\n });\n }\n\n /**\n * Handler for when the background layer outside the popup is clicked, treated\n * as though the Cancel button were clicked.\n */\n private backgroundClicked(e: MouseEvent) {\n if (!(e.target instanceof Node)) return;\n if (this.popup?.contains(e.target)) return;\n this.cancel(e);\n }\n\n /**\n * Closes the survey popup and resets any submission error state.\n */\n private cancel(e: Event) {\n e.preventDefault();\n this.closePopup();\n if (!this.isSubmitted) this.resetSubmissionState();\n }\n\n /**\n * Returns a boolean indicating whether all required survey questions have received a\n * valid response.\n *\n * Questions intended to participate in constraint validation must expose a `validate()`\n * method that performs whatever checks make sense for that question type. For instance,\n * required vote questions must have an up/down vote entered, while required comment-only\n * questions must have non-empty comment text.\n *\n * Any slotted children that do not have a `validate()` method will be ignored (i.e., they\n * are assumed to be valid).\n */\n private validate(): boolean {\n return this.assignedElements\n .filter(canBeValidated)\n .map((elmt) => elmt.validate())\n .every((v) => v);\n }\n\n /**\n * Handles survey form submit events by attempting to submit the responses\n * to the server, provided all required responses have been entered.\n */\n private async submit(e?: Event) {\n e?.preventDefault();\n\n if (!this.validate()) {\n this.error = { kind: 'missingInput' };\n this.setSubmissionState('error');\n return;\n }\n\n const { surveyIdentifier, submitTimeout, featureFeedbackService } = this;\n this.error = undefined;\n\n if (!surveyIdentifier) {\n throw new Error('surveyIdentifier is required');\n }\n\n if (!featureFeedbackService) {\n throw new Error('featureFeedbackService is required');\n }\n\n const recaptchaWidgetPromise = this.getRecaptchaWidget();\n let recaptchaWidget: RecaptchaWidgetInterface | undefined;\n try {\n recaptchaWidget = await timedPromise(\n recaptchaWidgetPromise,\n submitTimeout,\n );\n } catch (err) {\n throw new Error(`recaptchaWidget load failed: ${err}`);\n }\n\n if (!recaptchaWidget) {\n throw new Error('recaptchaWidget is required');\n }\n\n const popupWasOpen = this.isOpen;\n this.setSubmissionState('processing');\n\n try {\n const token = await timedPromise(\n recaptchaWidget.execute(),\n submitTimeout,\n );\n\n const response = await timedPromise(\n featureFeedbackService.submitSurvey({\n surveyIdentifier,\n responses: this.assignedElements\n .filter(hasSurveyResponse)\n .map((elmt) => elmt.response),\n recaptchaToken: token,\n }),\n submitTimeout,\n );\n\n if (response.success) {\n this.setSubmissionState('submitted');\n if (popupWasOpen) this.closePopup();\n } else {\n this.error = { kind: 'submitFailed' };\n this.setSubmissionState('error');\n }\n } catch (err) {\n this.error = {\n kind: 'submitFailed',\n detail: err instanceof Error ? err.message : String(err),\n };\n this.setSubmissionState('error');\n }\n }\n\n static get styles(): CSSResultGroup {\n const blueColor = css`var(--featureFeedbackBlueColor, #194880)`;\n const darkGrayColorSvgFilter = css`var(--defaultColorSvgFilter, invert(52%) sepia(0%) saturate(1%) hue-rotate(331deg) brightness(87%) contrast(89%))`;\n\n const backdropZindex = css`var(--featureFeedbackBackdropZindex, 5)`;\n const modalZindex = css`var(--featureFeedbackModalZindex, 6)`;\n\n const popupMaxWidth = css`var(--featureFeedbackPopupMaxWidth, 300px)`;\n const popupVerticalPadding = css`var(--featureFeedbackPopupVerticalPadding, 10px)`;\n const popupHorizontalPadding = css`var(--featureFeedbackPopupHorizontalPadding, 10px)`;\n const popupPadding = css`\n ${popupVerticalPadding} ${popupHorizontalPadding}\n `;\n const popupBorderColor = css`var(--featureFeedbackPopupBorderColor, ${blueColor})`;\n const betaButtonBorderColor = css`var(--featureFeedbackBetaButtonBorderColor, ${blueColor})`;\n const betaButtonTextColor = css`var(--featureFeedbackBetaButtonTextColor, ${blueColor})`;\n const betaButtonBackground = css`var(--featureFeedbackBetaButtonBackground, none)`;\n const betaButtonSvgFilter = css`var(--featureFeedbackBetaButtonSvgFilter, ${darkGrayColorSvgFilter})`;\n\n const popupBlockerColor = css`var(--featureFeedbackPopupBlockerColor, rgba(255, 255, 255, 0.3))`;\n const popupBackgroundColor = css`var(--featureFeedbackPopupBackgroundColor, #FBFBFD)`;\n\n const upvoteColorSvgFilter = css`var(--upvoteColorSvgFilter, invert(34%) sepia(72%) saturate(357%) hue-rotate(111deg) brightness(97%) contrast(95%))`;\n\n const whiteColor = css`var(--white, #fff)`;\n\n const disabledButtonFillColor = css`var(--primaryDisableCTAFill, #767676)`;\n const disabledButtonBorderColor = css`var(--secondaryCTABorder, #999)`;\n\n const primaryButtonFillColor = css`var(--primaryCTAFill, #194880)`;\n const primaryButtonFillColorRGB = css`var(--primaryCTAFillRGB, 25, 72, 128)`;\n const primaryButtonBorderColor = css`var(--primaryCTABorder, #c5d1df)`;\n\n const darkButtonFillColor = css`var(--secondaryCTAFill, #333)`;\n const darkButtonFillColorRGB = css`var(--secondaryCTAFillRGB, 51, 51, 51)`;\n const darkButtonBorderColor = css`var(--primaryCTABorder, #979797)`;\n\n const buttonStyles = css`\n .ia-button {\n min-height: 3rem;\n cursor: pointer;\n color: ${whiteColor};\n line-height: normal;\n border-radius: 0.4rem;\n font-size: 1.4rem;\n font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;\n border: 1px solid transparent;\n white-space: nowrap;\n appearance: auto;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n transition: all 0.1s ease 0s;\n vertical-align: middle;\n padding: 0 3rem;\n outline-color: ${whiteColor};\n outline-offset: -4px;\n user-select: none;\n text-decoration: none;\n width: fit-content;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -o-user-select: none;\n }\n .ia-button:focus-visible {\n outline-style: double;\n }\n .ia-button:disabled {\n cursor: not-allowed;\n background-color: ${disabledButtonFillColor};\n border: 1px solid ${disabledButtonBorderColor};\n }\n\n .ia-button.primary:disabled,\n .ia-button.dark:disabled {\n opacity: 0.5;\n }\n\n .ia-button.primary {\n background-color: ${primaryButtonFillColor};\n border-color: ${primaryButtonBorderColor};\n }\n .ia-button.primary:hover {\n background-color: rgba(${primaryButtonFillColorRGB}, 0.9);\n }\n .ia-button.primary:focus-visible {\n background-color: rgba(${primaryButtonFillColorRGB}, 0.8);\n }\n .ia-button.primary:active {\n background-color: rgba(${primaryButtonFillColorRGB}, 0.7);\n }\n\n .ia-button.dark {\n background-color: ${darkButtonFillColor};\n border-color: ${darkButtonBorderColor};\n }\n .ia-button.dark:hover {\n background-color: rgba(${darkButtonFillColorRGB}, 0.9);\n }\n .ia-button.dark:focus-visible {\n background-color: rgba(${darkButtonFillColorRGB}, 0.8);\n }\n .ia-button.dark:active {\n background-color: rgba(${darkButtonFillColorRGB}, 0.7);\n }\n `;\n\n const surveyStyles = css`\n #container {\n display: inline-block;\n }\n\n #beta-button {\n font-size: 12px;\n font-weight: bold;\n font-style: italic;\n color: ${betaButtonTextColor};\n border: 1px solid ${betaButtonBorderColor};\n border-radius: 4px;\n padding: 1px 5px;\n background: ${betaButtonBackground};\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n cursor: pointer;\n }\n\n .beta-button-icon {\n line-height: 100%;\n }\n\n .beta-button-icon svg {\n height: 10px;\n width: 10px;\n filter: ${betaButtonSvgFilter};\n }\n\n .beta-button-icon.success {\n filter: ${upvoteColorSvgFilter};\n }\n\n #error {\n margin-bottom: 10px;\n color: red;\n font-size: 14px;\n text-align: center;\n font-weight: bold;\n }\n\n #popup-background {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ${backdropZindex};\n background-color: ${popupBlockerColor};\n overflow: hidden;\n }\n\n #popup-background.closed {\n visibility: hidden;\n top: -100%;\n left: -100%;\n }\n\n #popup {\n position: absolute;\n max-width: ${popupMaxWidth};\n max-height: calc(100vh - 2 * ${popupVerticalPadding} - 10px);\n padding: ${popupPadding};\n border: 1px ${popupBorderColor} solid;\n border-radius: 5px;\n background-color: ${popupBackgroundColor};\n box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);\n z-index: ${modalZindex};\n margin-left: 10px;\n margin-right: 10px;\n overflow-y: auto;\n scrollbar-width: thin;\n }\n\n button,\n input,\n a,\n textarea {\n font-family: inherit;\n }\n\n #form > div:last-child {\n margin-bottom: 0;\n }\n\n #actions {\n display: flex;\n justify-content: center;\n align-items: center;\n column-gap: 10px;\n }\n\n .cta-button {\n color: white;\n font-size: 14px;\n border-radius: 4px;\n height: 30px;\n margin: 0;\n }\n\n .sr-only,\n .focus-trap {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n margin: -1px !important;\n padding: 0 !important;\n border: 0 !important;\n overflow: hidden !important;\n white-space: nowrap !important;\n clip: rect(1px, 1px, 1px, 1px) !important;\n -webkit-clip-path: inset(50%) !important;\n clip-path: inset(50%) !important;\n user-select: none !important;\n }\n `;\n\n return [buttonStyles, surveyStyles];\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-feature-feedback-survey': IAFeatureFeedbackSurvey;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ia-feature-feedback-survey.js","sourceRoot":"","sources":["../../../../src/elements/ia-feature-feedback/ia-feature-feedback-survey.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,IAAI,EACJ,GAAG,EACH,UAAU,EACV,OAAO,GAIR,MAAM,KAAK,CAAC;AACb,OAAO,EACL,QAAQ,EACR,KAAK,EACL,KAAK,EACL,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAU/C,OAAO,EACL,aAAa,EACb,aAAa,EACb,cAAc,EACd,iBAAiB,GAGlB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,mCAAmC,CAAC;AAC3C,OAAO,sCAAsC,CAAC;AAC9C,OAAO,oCAAoC,CAAC;AAIrC,IAAM,uBAAuB,+BAA7B,MAAM,uBACX,SAAQ,UAAU;IADb;;QAeL;;WAEG;QAC0B,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AAC;iEAA0B;AAKzB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oEAA6B;AAK5B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yDAAkB;AAKlB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8DAAsB;AAMjD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uEAC8B;AAK7B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iEAA8C;AAK7C;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+DAAgD;AAK1D;IAAhB,KAAK,EAAE;uDAAwB;AAUf;IAAhB,KAAK,EAAE;gEAAyD;AAKhD;IAAhB,KAAK,EAAE;0DAAuB;AAKd;IAAhB,KAAK,EAAE;0DAAuB;AAKd;IAAhB,KAAK,EAAE;sDAA6B;AAKR;IAA5B,KAAK,CAAC,YAAY,CAAC;0DAAoC;AAK/B;IAAxB,KAAK,CAAC,QAAQ,CAAC;sDAAgC;AAKf;IAAhC,KAAK,CAAC,gBAAgB,CAAC;6DAA0C;AAKjC;IAAhC,KAAK,CAAC,gBAAgB,CAAC;6DAA0C;AAKjC;IAAhC,qBAAqB,EAAE;iEAA0C;AAxGvD,uBAAuB;IAFnC,aAAa,CAAC,4BAA4B,CAAC;IAC3C,SAAS,EAAE;GACC,uBAAuB,CA47BnC","sourcesContent":["import {\n html,\n css,\n LitElement,\n nothing,\n CSSResultGroup,\n PropertyValues,\n TemplateResult,\n} from 'lit';\nimport {\n property,\n state,\n query,\n queryAssignedElements,\n} from 'lit/decorators.js';\nimport { customElement } from '@src/utils/custom-element';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { localized, msg } from '@lit/localize';\n\nimport type {\n SharedResizeObserverInterface,\n SharedResizeObserverResizeHandlerInterface,\n} from '@internetarchive/shared-resize-observer';\nimport type { RecaptchaManagerInterface } from '@src/services/recaptcha-manager/recaptcha-manager';\nimport type { RecaptchaWidgetInterface } from '@src/services/recaptcha-manager/recaptcha-widget';\n\nimport type { FeatureFeedbackServiceInterface } from './feature-feedback-service';\nimport {\n canBeDisabled,\n canBeNumbered,\n canBeValidated,\n hasSurveyResponse,\n SurveyError,\n SurveySubmissionState,\n} from './models';\nimport { timedPromise } from './utils/timed-promise';\n\nimport { thumbsUp } from './assets/img/thumb-up';\nimport { thumbsDown } from './assets/img/thumb-down';\n\nimport './ia-feature-feedback-survey-vote';\nimport './ia-feature-feedback-survey-comment';\nimport './ia-feature-feedback-survey-extra';\n\n@customElement('ia-feature-feedback-survey')\n@localized()\nexport class IAFeatureFeedbackSurvey\n extends LitElement\n implements SharedResizeObserverResizeHandlerInterface\n{\n /**\n * Internal identifier of the survey.\n */\n @property({ type: String }) surveyIdentifier?: string;\n\n /**\n * What text to display on the button that opens the survey popup\n * (default 'Feedback', localized).\n */\n @property({ type: String }) buttonText?: string;\n\n /**\n * Whether to show the up/down thumbs beside the feedback button text (default `false`).\n */\n @property({ type: Boolean }) showButtonThumbs = false;\n\n /**\n * Whether to show question numbers beside each survey question (default `false`).\n */\n @property({ type: Boolean }) showQuestionNumbers = false;\n\n /**\n * Whether the widget is disabled, preventing it from opening (default `false`).\n */\n @property({ type: Boolean }) disabled = false;\n\n /**\n * Time-out threshold, in milliseconds for submit operations (default `8000`).\n */\n @property({ type: Number }) submitTimeout = 8000;\n\n /**\n * Feature Feedback Service instance to handle survey submissions.\n */\n @property({ type: Object })\n featureFeedbackService?: FeatureFeedbackServiceInterface;\n\n /**\n * Recaptcha Manager instance for generating the Recaptcha widget and tokens.\n */\n @property({ type: Object }) recaptchaManager?: RecaptchaManagerInterface;\n\n /**\n * Shared Resize Observer instance to reposition the popup when the page is resized.\n */\n @property({ type: Object }) resizeObserver?: SharedResizeObserverInterface;\n\n /**\n * Whether the popup is currently open.\n */\n @state() private isOpen = false;\n\n /**\n * The current state of the widget's survey submission.\n * - `idle`: No submit has succeeded or been attempted since the popup was last toggled.\n * - `processing`: The widget is currently submitting a response.\n * - `submitted`: The widget has successfully submitted a response.\n * - `error`: The widget encountered an error while submitting its last response,\n * and the popup has not yet been closed.\n */\n @state() private submissionState: SurveySubmissionState = 'idle';\n\n /**\n * X-coordinate of the popup's top left corner.\n */\n @state() private popupTopX = 0;\n\n /**\n * Y-coordinate of the popup's top left corner.\n */\n @state() private popupTopY = 0;\n\n /**\n * Error message to display.\n */\n @state() private error?: SurveyError;\n\n /**\n * The feedback button's container element.\n */\n @query('#container') private container!: HTMLDivElement;\n\n /**\n * The outer container element of the popup.\n */\n @query('#popup') private popup!: HTMLDivElement;\n\n /**\n * The popup form's Cancel button\n */\n @query('#cancel-button') private cancelButton!: HTMLButtonElement;\n\n /**\n * The popup form's Submit button\n */\n @query('#submit-button') private submitButton!: HTMLButtonElement;\n\n /**\n * All elements assigned to the default slot\n */\n @queryAssignedElements() private assignedElements!: HTMLElement[];\n\n /**\n * Promise for any currently loading Recaptcha widget, resolving to the widget when\n * it is finished loading.\n */\n private recaptchaWidgetPromise?: Promise<RecaptchaWidgetInterface>;\n\n private resizingElement = document.body;\n\n /**\n * Text to show on the submit button when idle.\n */\n private static get SUBMIT_BUTTON_NORMAL_TEXT(): string {\n return msg('Submit feedback');\n }\n\n /**\n * Text to show on the submit button while submitting a response.\n */\n private static get SUBMIT_BUTTON_PROCESSING_TEXT(): string {\n return msg('Submitting...');\n }\n\n /**\n * Error message to show when some required questions do not have responses.\n */\n private static get ERROR_MESSAGE_MISSING_REQUIRED_INPUT(): string {\n return msg('Please respond to the indicated questions.');\n }\n\n /**\n * Error message to show when the survey submission encounters an error response.\n */\n private static get ERROR_MESSAGE_SUBMIT_REQUEST_FAILED(): string {\n return msg('There was an error submitting your feedback.');\n }\n\n //\n // METHODS\n //\n\n render() {\n return html`<div id=\"container\">${this.feedbackButtonTemplate}</div>`;\n }\n\n willUpdate(changed: PropertyValues): void {\n if (changed.has('submissionState')) {\n if (this.isProcessing || this.isSubmitted) {\n this.disableSlottedChildren();\n } else {\n this.restoreSlottedChildrenDisabledStates();\n }\n }\n\n if (changed.has('resizeObserver')) {\n const oldObserver = changed.get(\n 'resizeObserver',\n ) as SharedResizeObserverInterface;\n this.disconnectResizeObserver(oldObserver);\n }\n }\n\n updated(changed: PropertyValues): void {\n if (changed.has('showQuestionNumbers') || changed.has('assignedElements')) {\n this.applyQuestionNumbers();\n }\n\n const priorSubmissionState = changed.get('submissionState');\n if (priorSubmissionState) {\n if (\n this.submissionState === 'error' ||\n priorSubmissionState === 'error'\n ) {\n // Transitioning to or from the `error` state can change the height of the popup,\n // so we may need to reposition.\n this.positionPopup();\n }\n }\n\n if (changed.has('isOpen') && this.isOpen) {\n this.focusFirstFormElement();\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEscapeListener();\n this.stopScrollObserver();\n this.disconnectResizeObserver(this.resizeObserver);\n }\n\n /**\n * Sets all disableable slotted children to be disabled, and sets their `originallyDisabled`\n * data property to `true` if they were already disabled.\n */\n private disableSlottedChildren(): void {\n this.assignedElements.filter(canBeDisabled).forEach((elmt) => {\n elmt.dataset.originallyDisabled = elmt.disabled ? 'true' : 'false';\n elmt.disabled = true;\n });\n }\n\n /**\n * Sets all disableable slotted children to their original disabled state if possible.\n * Will only mutate any children that have an `originallyDisabled` data property set,\n * and will subsequently remove it from the dataset if found.\n */\n private restoreSlottedChildrenDisabledStates(): void {\n this.assignedElements.filter(canBeDisabled).forEach((elmt) => {\n const { originallyDisabled } = elmt.dataset;\n if (originallyDisabled === undefined) return;\n\n const originalState = originallyDisabled === 'true';\n delete elmt.dataset.originallyDisabled;\n elmt.disabled = originalState;\n });\n }\n\n /**\n * Repositions any open popup when the window resizes.\n */\n handleResize() {\n if (this.isOpen) {\n this.positionPopup();\n }\n }\n\n /**\n * Repositions any open popup to account for the new scroll position.\n *\n * (Uses an arrow function to achieve lexical `this` binding, so that we don't\n * need to manually bind it)\n */\n private handleScroll = () => {\n if (this.isOpen) {\n this.positionPopup();\n }\n };\n\n /**\n * Handles Escape key events by closing the popup as though the Cancel button\n * were clicked.\n *\n * (Uses an arrow function to achieve lexical `this` binding, so that we don't\n * need to manually bind it)\n */\n private handleEscape = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n this.cancel(e);\n }\n };\n\n private setupEscapeListener() {\n document.addEventListener('keyup', this.handleEscape);\n }\n\n private removeEscapeListener() {\n document.removeEventListener('keyup', this.handleEscape);\n }\n\n private setupScrollObserver() {\n document.addEventListener('scroll', this.handleScroll);\n }\n\n private stopScrollObserver() {\n document.removeEventListener('scroll', this.handleScroll);\n }\n\n private setupResizeObserver() {\n if (!this.resizeObserver) return;\n this.resizeObserver.addObserver({\n handler: this,\n target: this.resizingElement,\n });\n }\n\n private disconnectResizeObserver(observer?: SharedResizeObserverInterface) {\n const observerToRemove = observer ?? this.resizeObserver;\n observerToRemove?.removeObserver({\n handler: this,\n target: this.resizingElement,\n });\n }\n\n /**\n * Requests the Recaptcha Manager generate the Recaptcha widget if possible.\n *\n * Returns `undefined` if no Recaptcha Manager is available.\n *\n * If this method has been called already, it will return the Promise generated\n * by the previous call.\n *\n * Otherwise, a new widget is requested, with the resulting Promise returned\n * and saved to `this.recaptchaWidgetPromise` for other consumers to await.\n */\n private getRecaptchaWidget(): Promise<RecaptchaWidgetInterface> | undefined {\n // If we've already started generating a widget, return the previous Promise.\n if (this.recaptchaWidgetPromise) return this.recaptchaWidgetPromise;\n\n if (!this.recaptchaManager) return undefined;\n this.recaptchaWidgetPromise = this.recaptchaManager.getRecaptchaWidget();\n\n return this.recaptchaWidgetPromise;\n }\n\n /**\n * Resets the widget submission/error state back to defaults.\n * Questions and responses are unaffected.\n */\n private resetSubmissionState(): void {\n this.setSubmissionState('idle');\n this.error = undefined;\n }\n\n /**\n * Sets the submission state to the given value, emitting a state change event\n * if it differs from the old state.\n */\n private setSubmissionState(newState: SurveySubmissionState): void {\n if (this.submissionState === newState) return;\n\n this.submissionState = newState;\n this.emitSubmissionStateChanged();\n }\n\n /**\n * Emits a `submissionStateChanged` event with the current submission state.\n */\n private emitSubmissionStateChanged(): void {\n this.dispatchEvent(\n new CustomEvent('submissionStateChanged', {\n detail: this.submissionState,\n }),\n );\n }\n\n /**\n * Whether the survey is currently submitting its responses.\n */\n get isProcessing(): boolean {\n return this.submissionState === 'processing';\n }\n\n /**\n * Whether the survey has been successfully submitted.\n */\n get isSubmitted(): boolean {\n return this.submissionState === 'submitted';\n }\n\n /**\n * Opens the popup pane, provided the survey has not already been submitted.\n *\n * This will also trigger the Recaptcha widget to begin loading, if it has not already.\n */\n showPopup(): void {\n if (this.isSubmitted) return;\n\n this.setupResizeObserver();\n this.setupScrollObserver();\n this.setupEscapeListener();\n this.positionPopup();\n this.isOpen = true;\n this.getRecaptchaWidget();\n }\n\n /**\n * Closes the popup pane and removes any attached listeners.\n */\n closePopup(): void {\n this.disconnectResizeObserver();\n this.stopScrollObserver();\n this.removeEscapeListener();\n this.isOpen = false;\n }\n\n /**\n * Positions the popup pane so that it resides entirely within the viewport, if possible.\n */\n private positionPopup(): void {\n const containerRect = this.container.getBoundingClientRect();\n const popupRect = this.popup.getBoundingClientRect();\n const windowWidth = window.innerWidth;\n const windowHeight = window.innerHeight;\n const windowCenterX = windowWidth / 2;\n const windowCenterY = windowHeight / 2;\n const bufferX = 5;\n const bufferY = 5;\n\n if (containerRect.left < windowCenterX) {\n this.popupTopX = containerRect.right - 20;\n } else {\n this.popupTopX = containerRect.left + 20 - popupRect.width;\n }\n if (this.popupTopX + popupRect.width > windowWidth) {\n this.popupTopX = windowWidth - popupRect.width - bufferX;\n }\n\n if (containerRect.top < windowCenterY) {\n this.popupTopY = containerRect.bottom - 10;\n } else {\n this.popupTopY = containerRect.top + 10 - popupRect.height;\n }\n if (this.popupTopY + popupRect.height > windowHeight) {\n this.popupTopY = windowHeight - popupRect.height - bufferY;\n }\n\n this.popupTopX = Math.max(bufferX, this.popupTopX);\n this.popupTopY = Math.max(bufferY, this.popupTopY);\n }\n\n /**\n * Template for the feedback button's up/down thumb icons, if they are to be shown.\n */\n private get feedbackButtonThumbsTemplate(): TemplateResult | typeof nothing {\n if (!this.showButtonThumbs) return nothing;\n\n return html`\n <span class=\"beta-button-icon\">${thumbsUp}</span>\n <span class=\"beta-button-icon\">${thumbsDown}</span>\n `;\n }\n\n /**\n * Template for the feedback button's success checkmark.\n */\n private get feedbackButtonCheckTemplate(): TemplateResult {\n return html`<span class=\"beta-button-icon success\">✓</span>`;\n }\n\n /**\n * Template for the feedback button that opens the survey when clicked.\n */\n private get feedbackButtonTemplate(): TemplateResult {\n return html`\n <button\n id=\"beta-button\"\n tabindex=\"0\"\n aria-haspopup=\"dialog\"\n ?disabled=${this.disabled}\n @click=${this.showPopup}\n >\n <span id=\"button-text\">${this.buttonText ?? msg('Feedback')}</span>\n ${this.isSubmitted\n ? this.feedbackButtonCheckTemplate\n : this.feedbackButtonThumbsTemplate}\n </button>\n ${this.popupTemplate}\n `;\n }\n\n /**\n * Template for the current error message, if any.\n */\n private get errorTemplate(): TemplateResult | typeof nothing {\n const { error } = this;\n if (!error) return nothing;\n const message =\n error.kind === 'missingInput'\n ? IAFeatureFeedbackSurvey.ERROR_MESSAGE_MISSING_REQUIRED_INPUT\n : IAFeatureFeedbackSurvey.ERROR_MESSAGE_SUBMIT_REQUEST_FAILED;\n const detail =\n error.kind === 'submitFailed' && error.detail !== undefined\n ? html`<br />${msg('Error: ')}${error.detail}`\n : nothing;\n return html`<div id=\"error\">${message}${detail}</div>`;\n }\n\n /**\n * Template for the full popup survey that appears when the feedback\n * button is clicked.\n */\n private get popupTemplate(): TemplateResult {\n const shouldDisableControls = this.isProcessing || this.isSubmitted;\n const submitButtonText = this.isProcessing\n ? IAFeatureFeedbackSurvey.SUBMIT_BUTTON_PROCESSING_TEXT\n : IAFeatureFeedbackSurvey.SUBMIT_BUTTON_NORMAL_TEXT;\n\n const errorMessage = this.errorTemplate;\n\n const popupStyles = styleMap({\n left: `${this.popupTopX}px`,\n top: `${this.popupTopY}px`,\n });\n\n const stopPropagation = (e: Event) => e.stopPropagation();\n\n return html`\n <div\n id=\"popup-background\"\n class=${this.isOpen ? 'open' : 'closed'}\n @click=${this.backgroundClicked}\n @keydown=${this.backgroundClicked}\n >\n <div\n class=\"focus-trap\"\n tabindex=\"0\"\n @focus=${this.focusSubmitButton}\n ></div>\n <div\n id=\"popup\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"survey-heading\"\n style=${popupStyles}\n >\n <h2 id=\"survey-heading\" class=\"sr-only\">${msg('Feedback Survey')}</h2>\n <form\n id=\"form\"\n ?disabled=${shouldDisableControls}\n @click=${stopPropagation}\n @keydown=${stopPropagation}\n @submit=${this.submit}\n >\n <slot id=\"questions-slot\"></slot>\n ${errorMessage}\n <div id=\"actions\">\n <button\n type=\"button\"\n id=\"cancel-button\"\n class=\"cta-button ia-button dark\"\n tabindex=\"0\"\n ?disabled=${shouldDisableControls}\n @click=${this.cancel}\n >\n ${msg('Cancel')}\n </button>\n <button\n type=\"submit\"\n id=\"submit-button\"\n class=\"cta-button ia-button primary\"\n tabindex=\"0\"\n ?disabled=${shouldDisableControls}\n >\n ${submitButtonText}\n </button>\n </div>\n </form>\n </div>\n <div\n class=\"focus-trap\"\n tabindex=\"0\"\n @focus=${this.focusFirstFormElement}\n ></div>\n </div>\n `;\n }\n\n /**\n * Assigns focus to the first focusable slotted element in the form.\n */\n private focusFirstFormElement(): void {\n // Blur any previously-focused element so that the active element is null\n const rootNode = this.getRootNode() as Document | ShadowRoot;\n\n // Iterate through the slotted form elements and try to focus each one until we succeed\n for (const elmt of this.assignedElements) {\n elmt.focus();\n if (rootNode.activeElement === elmt) return; // We found the first focusable element, we're done\n }\n\n // If there were no focusable slotted elements, just focus the Cancel button next in line\n this.focusCancelButton();\n }\n\n /**\n * Assigns focus to the Cancel button at the end of the form.\n */\n private focusCancelButton(): void {\n this.cancelButton.focus();\n }\n\n /**\n * Assigns focus to the Submit button at the end of the form.\n */\n private focusSubmitButton(): void {\n this.submitButton.focus();\n }\n\n /**\n * Assigns slotted question numbers to all slotted questions that have `numbered`\n * set to true (indicating that they intend to participate in question numbering).\n */\n private applyQuestionNumbers(): void {\n if (!this.showQuestionNumbers) {\n // Remove any previously-added question numbers\n this.assignedElements.forEach((elmt) => {\n elmt.querySelector('[slot=question-number]')?.remove();\n });\n return;\n }\n\n let questionNumber = 1;\n this.assignedElements\n .filter((elmt) => canBeNumbered(elmt) && elmt.numbered)\n .forEach((elmt) => {\n let numberingElmt = elmt.querySelector('[slot=question-number]');\n\n if (!numberingElmt) {\n numberingElmt = document.createElement('span');\n numberingElmt.setAttribute('slot', 'question-number');\n }\n\n numberingElmt.textContent = `${questionNumber}. `;\n elmt.append(numberingElmt);\n\n questionNumber += 1;\n });\n }\n\n /**\n * Handler for when the background layer outside the popup is clicked, treated\n * as though the Cancel button were clicked.\n */\n private backgroundClicked(e: MouseEvent) {\n if (!(e.target instanceof Node)) return;\n if (this.popup?.contains(e.target)) return;\n this.cancel(e);\n }\n\n /**\n * Closes the survey popup and resets any submission error state.\n */\n private cancel(e: Event) {\n e.preventDefault();\n this.closePopup();\n if (!this.isSubmitted) this.resetSubmissionState();\n }\n\n /**\n * Returns a boolean indicating whether all required survey questions have received a\n * valid response.\n *\n * Questions intended to participate in constraint validation must expose a `validate()`\n * method that performs whatever checks make sense for that question type. For instance,\n * required vote questions must have an up/down vote entered, while required comment-only\n * questions must have non-empty comment text.\n *\n * Any slotted children that do not have a `validate()` method will be ignored (i.e., they\n * are assumed to be valid).\n */\n private validate(): boolean {\n return this.assignedElements\n .filter(canBeValidated)\n .map((elmt) => elmt.validate())\n .every((v) => v);\n }\n\n /**\n * Handles survey form submit events by attempting to submit the responses\n * to the server, provided all required responses have been entered.\n */\n private async submit(e?: Event) {\n e?.preventDefault();\n\n if (!this.validate()) {\n this.error = { kind: 'missingInput' };\n this.setSubmissionState('error');\n return;\n }\n\n const { surveyIdentifier, submitTimeout, featureFeedbackService } = this;\n this.error = undefined;\n\n if (!surveyIdentifier) {\n throw new Error('surveyIdentifier is required');\n }\n\n if (!featureFeedbackService) {\n throw new Error('featureFeedbackService is required');\n }\n\n const recaptchaWidgetPromise = this.getRecaptchaWidget();\n let recaptchaWidget: RecaptchaWidgetInterface | undefined;\n try {\n recaptchaWidget = await timedPromise(\n recaptchaWidgetPromise,\n submitTimeout,\n );\n } catch (err) {\n throw new Error(`recaptchaWidget load failed: ${err}`);\n }\n\n if (!recaptchaWidget) {\n throw new Error('recaptchaWidget is required');\n }\n\n const popupWasOpen = this.isOpen;\n this.setSubmissionState('processing');\n\n try {\n const token = await timedPromise(\n recaptchaWidget.execute(),\n submitTimeout,\n );\n\n const response = await timedPromise(\n featureFeedbackService.submitSurvey({\n surveyIdentifier,\n responses: this.assignedElements\n .filter(hasSurveyResponse)\n .map((elmt) => elmt.response),\n recaptchaToken: token,\n }),\n submitTimeout,\n );\n\n if (response.success) {\n this.setSubmissionState('submitted');\n if (popupWasOpen) this.closePopup();\n } else {\n this.error = { kind: 'submitFailed' };\n this.setSubmissionState('error');\n }\n } catch (err) {\n this.error = {\n kind: 'submitFailed',\n detail: err instanceof Error ? err.message : String(err),\n };\n this.setSubmissionState('error');\n }\n }\n\n static get styles(): CSSResultGroup {\n const blueColor = css`var(--featureFeedbackBlueColor, #194880)`;\n const darkGrayColorSvgFilter = css`var(--defaultColorSvgFilter, invert(52%) sepia(0%) saturate(1%) hue-rotate(331deg) brightness(87%) contrast(89%))`;\n\n const backdropZindex = css`var(--featureFeedbackBackdropZindex, 5)`;\n const modalZindex = css`var(--featureFeedbackModalZindex, 6)`;\n\n const popupMaxWidth = css`var(--featureFeedbackPopupMaxWidth, 300px)`;\n const popupVerticalPadding = css`var(--featureFeedbackPopupVerticalPadding, 10px)`;\n const popupHorizontalPadding = css`var(--featureFeedbackPopupHorizontalPadding, 10px)`;\n const popupPadding = css`\n ${popupVerticalPadding} ${popupHorizontalPadding}\n `;\n const popupBorderColor = css`var(--featureFeedbackPopupBorderColor, ${blueColor})`;\n const betaButtonBorderColor = css`var(--featureFeedbackBetaButtonBorderColor, ${blueColor})`;\n const betaButtonTextColor = css`var(--featureFeedbackBetaButtonTextColor, ${blueColor})`;\n const betaButtonBackground = css`var(--featureFeedbackBetaButtonBackground, none)`;\n const betaButtonSvgFilter = css`var(--featureFeedbackBetaButtonSvgFilter, ${darkGrayColorSvgFilter})`;\n\n const popupBlockerColor = css`var(--featureFeedbackPopupBlockerColor, rgba(255, 255, 255, 0.3))`;\n const popupBackgroundColor = css`var(--featureFeedbackPopupBackgroundColor, #FBFBFD)`;\n\n const upvoteColorSvgFilter = css`var(--upvoteColorSvgFilter, invert(34%) sepia(72%) saturate(357%) hue-rotate(111deg) brightness(97%) contrast(95%))`;\n\n const whiteColor = css`var(--white, #fff)`;\n\n const disabledButtonFillColor = css`var(--primaryDisableCTAFill, #767676)`;\n const disabledButtonBorderColor = css`var(--secondaryCTABorder, #999)`;\n\n const primaryButtonFillColor = css`var(--primaryCTAFill, #194880)`;\n const primaryButtonFillColorRGB = css`var(--primaryCTAFillRGB, 25, 72, 128)`;\n const primaryButtonBorderColor = css`var(--primaryCTABorder, #c5d1df)`;\n\n const darkButtonFillColor = css`var(--secondaryCTAFill, #333)`;\n const darkButtonFillColorRGB = css`var(--secondaryCTAFillRGB, 51, 51, 51)`;\n const darkButtonBorderColor = css`var(--primaryCTABorder, #979797)`;\n\n const buttonStyles = css`\n .ia-button {\n min-height: 3rem;\n cursor: pointer;\n color: ${whiteColor};\n line-height: normal;\n border-radius: 0.4rem;\n font-size: 1.4rem;\n font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;\n border: 1px solid transparent;\n white-space: nowrap;\n appearance: auto;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n transition: all 0.1s ease 0s;\n vertical-align: middle;\n padding: 0 3rem;\n outline-color: ${whiteColor};\n outline-offset: -4px;\n user-select: none;\n text-decoration: none;\n width: fit-content;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -o-user-select: none;\n }\n .ia-button:focus-visible {\n outline-style: double;\n }\n .ia-button:disabled {\n cursor: not-allowed;\n background-color: ${disabledButtonFillColor};\n border: 1px solid ${disabledButtonBorderColor};\n }\n\n .ia-button.primary:disabled,\n .ia-button.dark:disabled {\n opacity: 0.5;\n }\n\n .ia-button.primary {\n background-color: ${primaryButtonFillColor};\n border-color: ${primaryButtonBorderColor};\n }\n .ia-button.primary:hover {\n background-color: rgba(${primaryButtonFillColorRGB}, 0.9);\n }\n .ia-button.primary:focus-visible {\n background-color: rgba(${primaryButtonFillColorRGB}, 0.8);\n }\n .ia-button.primary:active {\n background-color: rgba(${primaryButtonFillColorRGB}, 0.7);\n }\n\n .ia-button.dark {\n background-color: ${darkButtonFillColor};\n border-color: ${darkButtonBorderColor};\n }\n .ia-button.dark:hover {\n background-color: rgba(${darkButtonFillColorRGB}, 0.9);\n }\n .ia-button.dark:focus-visible {\n background-color: rgba(${darkButtonFillColorRGB}, 0.8);\n }\n .ia-button.dark:active {\n background-color: rgba(${darkButtonFillColorRGB}, 0.7);\n }\n `;\n\n const surveyStyles = css`\n #container {\n display: inline-block;\n }\n\n #beta-button {\n font-size: 12px;\n font-weight: bold;\n font-style: italic;\n color: ${betaButtonTextColor};\n border: 1px solid ${betaButtonBorderColor};\n border-radius: 4px;\n padding: 1px 5px;\n background: ${betaButtonBackground};\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n cursor: pointer;\n }\n\n .beta-button-icon {\n line-height: 100%;\n }\n\n .beta-button-icon svg {\n height: 10px;\n width: 10px;\n filter: ${betaButtonSvgFilter};\n }\n\n .beta-button-icon.success {\n filter: ${upvoteColorSvgFilter};\n }\n\n #error {\n margin-bottom: 10px;\n color: red;\n font-size: 14px;\n text-align: center;\n font-weight: bold;\n }\n\n #popup-background {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: ${backdropZindex};\n background-color: ${popupBlockerColor};\n overflow: hidden;\n }\n\n #popup-background.closed {\n visibility: hidden;\n top: -100%;\n left: -100%;\n }\n\n #popup {\n position: absolute;\n max-width: ${popupMaxWidth};\n max-height: calc(100vh - 2 * ${popupVerticalPadding} - 10px);\n padding: ${popupPadding};\n border: 1px ${popupBorderColor} solid;\n border-radius: 5px;\n background-color: ${popupBackgroundColor};\n box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);\n z-index: ${modalZindex};\n margin-left: 10px;\n margin-right: 10px;\n overflow-y: auto;\n scrollbar-width: thin;\n }\n\n button,\n input,\n a,\n textarea {\n font-family: inherit;\n }\n\n #form > div:last-child {\n margin-bottom: 0;\n }\n\n #actions {\n display: flex;\n justify-content: center;\n align-items: center;\n column-gap: 10px;\n }\n\n .cta-button {\n color: white;\n font-size: 14px;\n border-radius: 4px;\n height: 30px;\n margin: 0;\n }\n\n .sr-only,\n .focus-trap {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n margin: -1px !important;\n padding: 0 !important;\n border: 0 !important;\n overflow: hidden !important;\n white-space: nowrap !important;\n clip: rect(1px, 1px, 1px, 1px) !important;\n -webkit-clip-path: inset(50%) !important;\n clip-path: inset(50%) !important;\n user-select: none !important;\n }\n `;\n\n return [buttonStyles, surveyStyles];\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-feature-feedback-survey': IAFeatureFeedbackSurvey;\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { html, css, LitElement, nothing, } from 'lit';
|
|
3
3
|
import { property, query, state } from 'lit/decorators.js';
|
|
4
|
-
import { customElement } from '../../
|
|
4
|
+
import { customElement } from '../../utils/custom-element.js';
|
|
5
5
|
import { localized, msg } from '@lit/localize';
|
|
6
6
|
import { thumbsUp } from './assets/img/thumb-up.js';
|
|
7
7
|
import { thumbsDown } from './assets/img/thumb-down.js';
|