@coras-io/embed 0.5.1 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/README.md +15 -2
- package/dist/components/accordion/accordion-item/accordion-item.component.js +9 -3
- package/dist/components/accordion/accordion-item/accordion-item.styles.js +4 -0
- package/dist/components/accordion/accordion.component.js +8 -0
- package/dist/components/alert/alert.component.d.ts +1 -1
- package/dist/components/alert/alert.component.js +4 -3
- package/dist/components/attraction-card/base/attraction-card.mixin.d.ts +0 -2
- package/dist/components/attraction-card/base/attraction-card.mixin.js +0 -6
- package/dist/components/attraction-card/base/attraction-card.types.d.ts +0 -1
- package/dist/components/basket-mobile/basket-mobile.component.d.ts +14 -3
- package/dist/components/basket-mobile/basket-mobile.component.js +71 -15
- package/dist/components/better-carousel/better-carousel.component.d.ts +3 -5
- package/dist/components/better-carousel/better-carousel.component.js +13 -34
- package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.component.js +5 -12
- package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.styles.js +13 -5
- package/dist/components/breadcrumbs/breadcrumbs.component.d.ts +0 -1
- package/dist/components/breadcrumbs/breadcrumbs.component.js +5 -8
- package/dist/components/breadcrumbs/breadcrumbs.styles.js +8 -2
- package/dist/components/button/button.constants.d.ts +1 -2
- package/dist/components/button/button.constants.js +0 -1
- package/dist/components/calendar/base/calendar.mixin.js +5 -1
- package/dist/components/calendar/multi/multi.component.d.ts +2 -2
- package/dist/components/calendar/multi/multi.component.js +12 -19
- package/dist/components/carousel/carousel.component.js +9 -2
- package/dist/components/categories-tree/categories-tree.component.d.ts +5 -3
- package/dist/components/categories-tree/categories-tree.component.js +22 -21
- package/dist/components/checkbox/checkbox.component.js +5 -1
- package/dist/components/checkbox-group/checkbox-group.component.js +1 -1
- package/dist/components/checkbox-group/checkbox-group.styles.js +1 -1
- package/dist/components/chip/chip.component.js +8 -3
- package/dist/components/crypto-auth-modal/crypto-auth-modal.component.d.ts +6 -0
- package/dist/components/crypto-auth-modal/crypto-auth-modal.component.js +15 -1
- package/dist/components/currencies-list/currencies-list.component.js +0 -1
- package/dist/components/dialog/dialog.component.js +52 -21
- package/dist/components/drawer/drawer.component.d.ts +3 -2
- package/dist/components/drawer/drawer.component.js +13 -18
- package/dist/components/drawer/drawer.styles.js +5 -2
- package/dist/components/dropdown/dropdown.component.js +6 -9
- package/dist/components/expiration-timer/expiration-timer.component.d.ts +2 -3
- package/dist/components/expiration-timer/expiration-timer.component.js +10 -8
- package/dist/components/explore-card/explore-card.component.js +3 -1
- package/dist/components/explore-card/explore-card.styles.js +31 -0
- package/dist/components/filters-drawer/filters-drawer.component.js +1 -1
- package/dist/components/flag-icon/flag-icon.component.d.ts +4 -2
- package/dist/components/flag-icon/flag-icon.component.js +16 -4
- package/dist/components/icon/icon.component.js +15 -2
- package/dist/components/image/image.component.js +4 -3
- package/dist/components/image-viewer/image-viewer.component.js +6 -4
- package/dist/components/input-field/input-field.component.js +10 -6
- package/dist/components/layout/layout.styles.js +1 -1
- package/dist/components/locales-list/locales-list.component.js +0 -1
- package/dist/components/location-image/location-image.component.d.ts +4 -4
- package/dist/components/location-image/location-image.component.js +6 -7
- package/dist/components/locations-results/locations-results.component.d.ts +10 -0
- package/dist/components/locations-results/locations-results.component.js +22 -15
- package/dist/components/locations-results/locations-results.styles.js +4 -1
- package/dist/components/message-card/message-card.component.d.ts +1 -1
- package/dist/components/message-card/message-card.component.js +4 -3
- package/dist/components/mobile-menu-item/mobile-menu-item.component.d.ts +0 -1
- package/dist/components/mobile-menu-item/mobile-menu-item.component.js +14 -16
- package/dist/components/mobile-menu-item/mobile-menu-item.styles.js +9 -5
- package/dist/components/option-group/option-chip/option-chip.component.d.ts +4 -1
- package/dist/components/option-group/option-chip/option-chip.component.js +23 -10
- package/dist/components/option-group/option-group.component.d.ts +3 -1
- package/dist/components/option-group/option-group.component.js +10 -3
- package/dist/components/overlay/overlay.component.d.ts +0 -5
- package/dist/components/overlay/overlay.component.js +3 -15
- package/dist/components/phone-country-code/phone-country-code.component.d.ts +4 -0
- package/dist/components/phone-country-code/phone-country-code.component.js +37 -0
- package/dist/components/phone-country-codes/phone-country-codes.component.js +1 -1
- package/dist/components/phone-field/phone-field.component.js +2 -2
- package/dist/components/search-button/search-button.component.d.ts +1 -1
- package/dist/components/search-button/search-button.component.js +13 -7
- package/dist/components/seated-selector/seated-selector.component.js +3 -3
- package/dist/components/seats-io/seats-io.component.d.ts +3 -2
- package/dist/components/seats-io/seats-io.component.js +31 -13
- package/dist/components/seats-io/seats-io.constants.d.ts +0 -2
- package/dist/components/seats-io/seats-io.constants.js +0 -3
- package/dist/components/seats-io/seats-io.transform.d.ts +1 -6
- package/dist/components/seats-io/seats-io.transform.js +1 -20
- package/dist/components/select-list/select-list.component.js +7 -2
- package/dist/components/select-list/select-option/select-option.component.d.ts +3 -1
- package/dist/components/select-list/select-option/select-option.component.js +10 -3
- package/dist/components/tabs/tabs.component.d.ts +2 -0
- package/dist/components/tabs/tabs.component.js +59 -5
- package/dist/components/time-tag/time-tag.component.js +1 -1
- package/dist/containers/basket/basket.component.d.ts +1 -1
- package/dist/containers/basket/basket.component.js +21 -20
- package/dist/containers/navbar/navbar.component.d.ts +12 -8
- package/dist/containers/navbar/navbar.component.js +108 -62
- package/dist/containers/navbar/navbar.styles.js +23 -5
- package/dist/containers/navbar/navbar.utils.js +4 -4
- package/dist/contexts/basket/basket.provider.d.ts +3 -4
- package/dist/contexts/basket/basket.provider.js +46 -61
- package/dist/contexts/basket/basket.types.d.ts +0 -2
- package/dist/controllers/time-expiration.d.ts +15 -2
- package/dist/controllers/time-expiration.js +47 -17
- package/dist/core/api/client.d.ts +9 -0
- package/dist/core/api/client.js +26 -0
- package/dist/core/api/middlewares/booking-session/booking-session.constants.d.ts +0 -2
- package/dist/core/api/middlewares/booking-session/booking-session.constants.js +0 -2
- package/dist/core/api/middlewares/booking-session/booking-session.js +3 -12
- package/dist/core/api/middlewares/booking-session/booking-session.utils.d.ts +0 -1
- package/dist/core/api/middlewares/booking-session/booking-session.utils.js +6 -28
- package/dist/core/api/middlewares/error-handler/error-handler.js +5 -1
- package/dist/core/api/middlewares/retry/retry.constants.d.ts +3 -0
- package/dist/core/api/middlewares/retry/retry.constants.js +7 -0
- package/dist/core/api/middlewares/retry/retry.d.ts +2 -0
- package/dist/core/api/middlewares/retry/retry.js +48 -0
- package/dist/core/api/queries.d.ts +13 -38
- package/dist/core/api/queries.js +16 -99
- package/dist/core/events.d.ts +2 -4
- package/dist/core/i18n/date.d.ts +14 -5
- package/dist/core/i18n/date.js +47 -20
- package/dist/core/i18n/localization.js +10 -3
- package/dist/core/images/helpers.js +6 -5
- package/dist/core/images/srcset.js +2 -2
- package/dist/core/logger.d.ts +17 -0
- package/dist/core/logger.js +13 -0
- package/dist/core/types/api-schema.d.ts +7872 -0
- package/dist/core/types/seats-config.d.ts +5 -4
- package/dist/core/types/seats-config.js +10 -3
- package/dist/core/utils/crypto-address.d.ts +12 -0
- package/dist/core/utils/crypto-address.js +17 -0
- package/dist/core/utils/datetime.d.ts +13 -11
- package/dist/core/utils/datetime.js +41 -51
- package/dist/core/utils/loyalty.d.ts +8 -0
- package/dist/core/utils/loyalty.js +10 -0
- package/dist/core/utils/redaction.d.ts +9 -0
- package/dist/core/utils/redaction.js +58 -0
- package/dist/core/utils/time.js +2 -3
- package/dist/helpers/helpers.d.ts +6 -0
- package/dist/helpers/helpers.js +33 -16
- package/dist/locales/ar-SA.d.ts +38 -21
- package/dist/locales/ar-SA.js +38 -21
- package/dist/locales/da-DK.d.ts +38 -21
- package/dist/locales/da-DK.js +38 -21
- package/dist/locales/de-DE.d.ts +38 -21
- package/dist/locales/de-DE.js +38 -21
- package/dist/locales/en-IE.d.ts +38 -21
- package/dist/locales/en-IE.js +38 -21
- package/dist/locales/en-US.d.ts +38 -21
- package/dist/locales/en-US.js +38 -21
- package/dist/locales/es-ES.d.ts +38 -21
- package/dist/locales/es-ES.js +38 -21
- package/dist/locales/fr-FR.d.ts +38 -21
- package/dist/locales/fr-FR.js +38 -21
- package/dist/locales/fr-MA.d.ts +38 -21
- package/dist/locales/fr-MA.js +38 -21
- package/dist/locales/is-IS.d.ts +38 -21
- package/dist/locales/is-IS.js +38 -21
- package/dist/locales/it-IT.d.ts +38 -21
- package/dist/locales/it-IT.js +38 -21
- package/dist/locales/ms-MY.d.ts +38 -21
- package/dist/locales/ms-MY.js +38 -21
- package/dist/locales/nb-NO.d.ts +38 -21
- package/dist/locales/nb-NO.js +38 -21
- package/dist/locales/pl-PL.d.ts +38 -21
- package/dist/locales/pl-PL.js +38 -21
- package/dist/locales/pt-PT.d.ts +38 -21
- package/dist/locales/pt-PT.js +38 -21
- package/dist/locales/sv-SE.d.ts +38 -21
- package/dist/locales/sv-SE.js +38 -21
- package/dist/locales/th-TH.d.ts +38 -21
- package/dist/locales/th-TH.js +38 -21
- package/dist/locales/tr-TR.d.ts +38 -21
- package/dist/locales/tr-TR.js +38 -21
- package/dist/locales/zh-CN.d.ts +38 -21
- package/dist/locales/zh-CN.js +38 -21
- package/dist/locales/zh-HK.d.ts +38 -21
- package/dist/locales/zh-HK.js +38 -21
- package/dist/mixins/base.mixin.d.ts +3 -1
- package/dist/mixins/base.mixin.js +10 -7
- package/dist/mixins/coinbase.mixin.d.ts +13 -17
- package/dist/mixins/coinbase.mixin.js +251 -288
- package/dist/mixins/error-modal.mixin.js +8 -4
- package/dist/mixins/location-search/location-search.d.ts +13 -1
- package/dist/mixins/location-search/location-search.js +35 -27
- package/dist/mixins/overlay/overlay-mixin.js +39 -3
- package/dist/mixins/overlay/types.d.ts +1 -0
- package/dist/mixins/search-mixin/search-mixin.js +8 -5
- package/dist/sdk/diagnostics.js +2 -0
- package/dist/sdk/mount.d.ts +10 -0
- package/dist/sdk/mount.js +20 -1
- package/dist/sdk/page-registry.js +5 -0
- package/dist/sdk/params.d.ts +53 -0
- package/dist/sdk/params.js +180 -0
- package/dist/sdk/redaction.d.ts +1 -4
- package/dist/sdk/redaction.js +2 -41
- package/dist/sdk/types.d.ts +21 -7
- package/dist/sdk/url.d.ts +1 -1
- package/dist/sdk/url.js +12 -5
- package/dist/sdk/validation.d.ts +1 -26
- package/dist/sdk/validation.js +8 -145
- package/dist/styles/tokens.d.ts +1 -1
- package/dist/styles/tokens.generated.d.ts +1 -1
- package/dist/styles/tokens.generated.js +1 -1
- package/dist/views/chrome-only-page/chrome-only-page.component.d.ts +30 -0
- package/dist/views/chrome-only-page/chrome-only-page.component.js +24 -0
- package/dist/views/chrome-only-page/chrome-only-page.d.ts +8 -0
- package/dist/views/chrome-only-page/chrome-only-page.js +6 -0
- package/dist/views/chrome-only-page/chrome-only-page.styles.js +13 -0
- package/dist/views/details-page/details-page.component.d.ts +11 -4
- package/dist/views/details-page/details-page.component.js +263 -237
- package/dist/views/details-page/details-page.utilts.d.ts +63 -3
- package/dist/views/details-page/details-page.utilts.js +53 -5
- package/dist/views/details-page/partials/location-categories/location-categories.component.d.ts +29 -0
- package/dist/views/details-page/partials/location-categories/location-categories.component.js +149 -0
- package/dist/views/details-page/partials/location-categories/location-categories.d.ts +8 -0
- package/dist/views/details-page/partials/location-categories/location-categories.js +6 -0
- package/dist/views/details-page/partials/location-categories/location-categories.styles.js +35 -0
- package/dist/views/details-page/partials/location-highlights/location-highlights.component.d.ts +26 -0
- package/dist/views/details-page/partials/location-highlights/location-highlights.component.js +158 -0
- package/dist/views/details-page/partials/location-highlights/location-highlights.d.ts +8 -0
- package/dist/views/details-page/partials/location-highlights/location-highlights.js +6 -0
- package/dist/views/details-page/partials/location-highlights/location-highlights.styles.js +42 -0
- package/dist/views/details-page/partials/tour-description/tour-description.component.js +1 -4
- package/dist/views/help-page/help-page.component.d.ts +2 -0
- package/dist/views/help-page/help-page.component.js +37 -18
- package/dist/views/help-page/help-page.utils.js +6 -5
- package/dist/views/landing-page/landing-page.component.d.ts +5 -8
- package/dist/views/landing-page/landing-page.component.js +82 -97
- package/dist/views/payment-page/controllers/crypto-auth.controller.d.ts +10 -4
- package/dist/views/payment-page/controllers/crypto-auth.controller.js +53 -31
- package/dist/views/payment-page/controllers/crypto-transfer.controller.d.ts +9 -5
- package/dist/views/payment-page/controllers/crypto-transfer.controller.js +26 -39
- package/dist/views/payment-page/controllers/payment-flow.controller.d.ts +6 -1
- package/dist/views/payment-page/controllers/payment-flow.controller.js +1 -0
- package/dist/views/payment-page/controllers/stripe-payment.controller.d.ts +20 -2
- package/dist/views/payment-page/controllers/stripe-payment.controller.js +42 -19
- package/dist/views/payment-page/partials/activity-details/activity-details.component.d.ts +2 -0
- package/dist/views/payment-page/partials/activity-details/activity-details.component.js +6 -3
- package/dist/views/payment-page/partials/billing-address/billing-address.component.d.ts +2 -0
- package/dist/views/payment-page/partials/billing-address/billing-address.component.js +5 -1
- package/dist/views/payment-page/partials/confirmation/confirmation.component.js +2 -3
- package/dist/views/payment-page/partials/country-field/country-field.component.js +1 -1
- package/dist/views/payment-page/partials/payment-type-selector/payment-type-selector.component.js +3 -3
- package/dist/views/payment-page/partials/stripe/stripe.component.d.ts +2 -0
- package/dist/views/payment-page/partials/stripe/stripe.component.js +36 -7
- package/dist/views/payment-page/partials/stripe/stripe.utils.js +0 -3
- package/dist/views/payment-page/payment-page.component.d.ts +39 -6
- package/dist/views/payment-page/payment-page.component.js +302 -178
- package/dist/views/payment-page/payment-page.constants.d.ts +1 -27
- package/dist/views/payment-page/payment-page.constants.js +3 -30
- package/dist/views/payment-page/payment-page.types.d.ts +1 -19
- package/dist/views/payment-page/payment-page.utils.d.ts +22 -13
- package/dist/views/payment-page/payment-page.utils.js +57 -75
- package/dist/views/payment-page/services/payment-api.service.d.ts +16 -34
- package/dist/views/payment-page/services/payment-api.service.js +19 -27
- package/dist/views/search-page/search-page.component.d.ts +2 -0
- package/dist/views/search-page/search-page.component.js +39 -20
- package/dist/views/suggestion-widget/suggestion-widget.component.d.ts +1 -0
- package/dist/views/suggestion-widget/suggestion-widget.component.js +6 -5
- package/package.json +24 -20
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.component.d.ts +0 -10
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.component.js +0 -43
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.d.ts +0 -8
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.js +0 -6
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.styles.js +0 -23
- package/dist/components/attraction-discovery/attraction-discovery.component.d.ts +0 -10
- package/dist/components/attraction-discovery/attraction-discovery.component.js +0 -52
- package/dist/components/attraction-discovery/attraction-discovery.constants.d.ts +0 -4
- package/dist/components/attraction-discovery/attraction-discovery.constants.js +0 -5
- package/dist/components/attraction-discovery/attraction-discovery.d.ts +0 -8
- package/dist/components/attraction-discovery/attraction-discovery.js +0 -6
- package/dist/components/attraction-discovery/attraction-discovery.styles.js +0 -193
- package/dist/components/basket-rewards/basket-rewards.component.d.ts +0 -10
- package/dist/components/basket-rewards/basket-rewards.component.js +0 -52
- package/dist/components/basket-rewards/basket-rewards.d.ts +0 -8
- package/dist/components/basket-rewards/basket-rewards.js +0 -6
- package/dist/components/basket-rewards/basket-rewards.styles.js +0 -18
- package/dist/components/filter-chip/filter-chip.component.d.ts +0 -12
- package/dist/components/filter-chip/filter-chip.component.js +0 -68
- package/dist/components/filter-chip/filter-chip.constants.d.ts +0 -2
- package/dist/components/filter-chip/filter-chip.constants.js +0 -2
- package/dist/components/filter-chip/filter-chip.d.ts +0 -8
- package/dist/components/filter-chip/filter-chip.js +0 -6
- package/dist/components/filter-chip/filter-chip.styles.d.ts +0 -2
- package/dist/components/filter-chip/filter-chip.styles.js +0 -162
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.component.d.ts +0 -10
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.component.js +0 -43
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.d.ts +0 -8
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.js +0 -6
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.styles.d.ts +0 -2
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.styles.js +0 -28
- package/dist/components/image-carousel/image-carousel.component.d.ts +0 -8
- package/dist/components/image-carousel/image-carousel.component.js +0 -36
- package/dist/components/image-carousel/image-carousel.d.ts +0 -8
- package/dist/components/image-carousel/image-carousel.js +0 -6
- package/dist/components/image-carousel/image-carousel.styles.d.ts +0 -2
- package/dist/components/image-carousel/image-carousel.styles.js +0 -72
- package/dist/components/itinerary/itinerary-item/itinerary-item.component.d.ts +0 -9
- package/dist/components/itinerary/itinerary-item/itinerary-item.component.js +0 -45
- package/dist/components/itinerary/itinerary-item/itinerary-item.d.ts +0 -8
- package/dist/components/itinerary/itinerary-item/itinerary-item.js +0 -6
- package/dist/components/itinerary/itinerary-item/itinerary-item.styles.d.ts +0 -2
- package/dist/components/itinerary/itinerary-item/itinerary-item.styles.js +0 -70
- package/dist/components/itinerary/itinerary.component.d.ts +0 -7
- package/dist/components/itinerary/itinerary.component.js +0 -23
- package/dist/components/itinerary/itinerary.d.ts +0 -8
- package/dist/components/itinerary/itinerary.js +0 -6
- package/dist/components/itinerary/itinerary.styles.d.ts +0 -2
- package/dist/components/itinerary/itinerary.styles.js +0 -15
- package/dist/components/marketing-tag/marketing-tag.component.d.ts +0 -5
- package/dist/components/marketing-tag/marketing-tag.component.js +0 -8
- package/dist/components/marketing-tag/marketing-tag.d.ts +0 -8
- package/dist/components/marketing-tag/marketing-tag.js +0 -6
- package/dist/components/marketing-tag/marketing-tag.styles.d.ts +0 -2
- package/dist/components/marketing-tag/marketing-tag.styles.js +0 -36
- package/dist/components/price/price.component.d.ts +0 -12
- package/dist/components/price/price.component.js +0 -38
- package/dist/components/price/price.d.ts +0 -8
- package/dist/components/price/price.js +0 -6
- package/dist/components/reviews/review/review.component.d.ts +0 -9
- package/dist/components/reviews/review/review.component.js +0 -41
- package/dist/components/reviews/review/review.d.ts +0 -8
- package/dist/components/reviews/review/review.js +0 -6
- package/dist/components/reviews/review/review.styles.d.ts +0 -2
- package/dist/components/reviews/review/review.styles.js +0 -45
- package/dist/components/reviews/reviews.component.d.ts +0 -9
- package/dist/components/reviews/reviews.component.js +0 -56
- package/dist/components/reviews/reviews.d.ts +0 -8
- package/dist/components/reviews/reviews.js +0 -6
- package/dist/components/reviews/reviews.styles.d.ts +0 -2
- package/dist/components/reviews/reviews.styles.js +0 -73
- package/dist/components/selected-tickets-preview/selected-tickets-preview.component.d.ts +0 -10
- package/dist/components/selected-tickets-preview/selected-tickets-preview.component.js +0 -51
- package/dist/components/selected-tickets-preview/selected-tickets-preview.d.ts +0 -8
- package/dist/components/selected-tickets-preview/selected-tickets-preview.js +0 -6
- package/dist/components/selected-tickets-preview/selected-tickets-preview.styles.d.ts +0 -2
- package/dist/components/selected-tickets-preview/selected-tickets-preview.styles.js +0 -89
- package/dist/components/tag/tag.component.d.ts +0 -8
- package/dist/components/tag/tag.component.js +0 -33
- package/dist/components/tag/tag.constants.d.ts +0 -1
- package/dist/components/tag/tag.constants.js +0 -1
- package/dist/components/tag/tag.d.ts +0 -8
- package/dist/components/tag/tag.js +0 -6
- package/dist/components/tag/tag.styles.d.ts +0 -2
- package/dist/components/tag/tag.styles.js +0 -56
- package/dist/components/tooltip/tooltip.component.d.ts +0 -19
- package/dist/components/tooltip/tooltip.component.js +0 -124
- package/dist/components/tooltip/tooltip.d.ts +0 -8
- package/dist/components/tooltip/tooltip.js +0 -6
- package/dist/components/tooltip/tooltip.styles.d.ts +0 -2
- package/dist/components/tooltip/tooltip.styles.js +0 -79
- package/dist/core/signals.d.ts +0 -2
- package/dist/core/signals.js +0 -3
- package/dist/core/storybook/argTypes.d.ts +0 -1
- package/dist/core/storybook/argTypes.js +0 -46
- package/dist/core/storybook/cssprops.d.ts +0 -30
- package/dist/core/storybook/cssprops.js +0 -46
- package/dist/core/storybook/demo.d.ts +0 -4
- package/dist/core/storybook/demo.js +0 -17
- package/dist/core/types/api-errors.d.ts +0 -8
- package/dist/core/types/api-errors.js +0 -1
- package/dist/styles/contrast-fixtures.d.ts +0 -5
- package/dist/styles/contrast-fixtures.js +0 -131
- package/dist/views/payment-page/domain/payment-mappers.d.ts +0 -7
- package/dist/views/payment-page/domain/payment-mappers.js +0 -7
- package/dist/views/payment-page/domain/payment-validators.d.ts +0 -6
- package/dist/views/payment-page/domain/payment-validators.js +0 -6
- package/dist/views/payment-page/domain/recovery-payload.d.ts +0 -8
- package/dist/views/payment-page/domain/recovery-payload.js +0 -7
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.component.d.ts +0 -22
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.component.js +0 -65
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.d.ts +0 -8
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.js +0 -6
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.styles.d.ts +0 -2
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.styles.js +0 -12
- package/dist/views/payment-page/payment-page.validation-schema.d.ts +0 -28
- package/dist/views/payment-page/payment-page.validation-schema.js +0 -42
- /package/dist/{components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.styles.d.ts → views/chrome-only-page/chrome-only-page.styles.d.ts} +0 -0
- /package/dist/{components/attraction-discovery/attraction-discovery.styles.d.ts → views/details-page/partials/location-categories/location-categories.styles.d.ts} +0 -0
- /package/dist/{components/basket-rewards/basket-rewards.styles.d.ts → views/details-page/partials/location-highlights/location-highlights.styles.d.ts} +0 -0
|
@@ -9,7 +9,7 @@ import { property, state } from "lit/decorators.js";
|
|
|
9
9
|
import { classMap } from "lit/directives/class-map.js";
|
|
10
10
|
import { memo } from "../../../core/utils/function.js";
|
|
11
11
|
import { title } from "../../../core/utils/text.js";
|
|
12
|
-
import { addDays, addMonths, differenceInCalendarMonths, differenceInDays, endOfMonth, endOfWeek, format, formatISO, isBefore, isSameMonth, isWithinInterval, parse, parseISO, startOfMonth, startOfWeek, } from "date-fns";
|
|
12
|
+
import { addDays, addMonths, differenceInCalendarMonths, differenceInDays, endOfMonth, endOfWeek, format, formatISO, isBefore, isSameMonth, isWithinInterval, parse, parseISO, startOfMonth, startOfToday, startOfWeek, } from "date-fns";
|
|
13
13
|
import { getCalendarLocale, weekdayNames } from "../../../core/i18n/date.js";
|
|
14
14
|
import { fireInternalEvent } from "../../../core/events.js";
|
|
15
15
|
import styles from "./calendar.styles.js";
|
|
@@ -47,6 +47,10 @@ export const BaseCalendarMixin = (superClass) => {
|
|
|
47
47
|
if (!this.range) {
|
|
48
48
|
return false;
|
|
49
49
|
}
|
|
50
|
+
// A range picks travel dates, and a past day can never be booked.
|
|
51
|
+
if (isBefore(day, startOfToday())) {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
50
54
|
if (this.selectedDates.length === 1 &&
|
|
51
55
|
this.selectedDates[0] !== undefined) {
|
|
52
56
|
return isBefore(day, parseISO(this.selectedDates[0]));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type CSSResultGroup, LitElement } from "lit";
|
|
1
|
+
import { type CSSResultGroup, LitElement, type PropertyValues } from "lit";
|
|
2
2
|
declare const BaseCalendarLitElement: import("../base/calendar.types.js").Constructor<import("../base/calendar.types.js").BaseCalendarMixinInterface> & typeof LitElement;
|
|
3
3
|
export declare class CorasMultiMonthCalendar extends BaseCalendarLitElement {
|
|
4
4
|
static styles: CSSResultGroup;
|
|
5
5
|
private visibleMonthsDays;
|
|
6
|
-
|
|
6
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
7
7
|
render(): import("lit").TemplateResult<1>;
|
|
8
8
|
}
|
|
9
9
|
export {};
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
1
|
import { eachMonthOfInterval, format, parse } from "date-fns";
|
|
8
|
-
import { LitElement, html } from "lit";
|
|
9
|
-
import { state } from "lit/decorators.js";
|
|
2
|
+
import { LitElement, html, } from "lit";
|
|
10
3
|
import { title } from "../../../core/utils/text.js";
|
|
11
4
|
import { map } from "lit/directives/map.js";
|
|
12
5
|
import styles from "./multi.styles.js";
|
|
@@ -16,24 +9,27 @@ const BaseCalendarLitElement = BaseCalendarMixin(LitElement);
|
|
|
16
9
|
export class CorasMultiMonthCalendar extends BaseCalendarLitElement {
|
|
17
10
|
constructor() {
|
|
18
11
|
super(...arguments);
|
|
12
|
+
// Derived from minDate and maxDate in willUpdate, so the months follow
|
|
13
|
+
// the bounds instead of being fixed at connection time.
|
|
19
14
|
this.visibleMonthsDays = {};
|
|
20
15
|
}
|
|
21
16
|
static { this.styles = [
|
|
22
17
|
super.styles,
|
|
23
18
|
styles,
|
|
24
19
|
]; }
|
|
25
|
-
|
|
26
|
-
super.
|
|
20
|
+
willUpdate(changed) {
|
|
21
|
+
super.willUpdate(changed);
|
|
22
|
+
if (!changed.has("minDate") && !changed.has("maxDate")) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
27
25
|
const eachMonth = eachMonthOfInterval({
|
|
28
26
|
start: parse(this.minDate, "yyyy-MM", new Date()),
|
|
29
27
|
end: parse(this.maxDate, "yyyy-MM", new Date()),
|
|
30
28
|
});
|
|
31
|
-
this.visibleMonthsDays = eachMonth.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return acc;
|
|
36
|
-
}, {});
|
|
29
|
+
this.visibleMonthsDays = Object.fromEntries(eachMonth.map((month) => [
|
|
30
|
+
format(month, "yyyy-MM"),
|
|
31
|
+
this.generateMonthDays(month),
|
|
32
|
+
]));
|
|
37
33
|
}
|
|
38
34
|
render() {
|
|
39
35
|
return html `
|
|
@@ -54,6 +50,3 @@ export class CorasMultiMonthCalendar extends BaseCalendarLitElement {
|
|
|
54
50
|
`;
|
|
55
51
|
}
|
|
56
52
|
}
|
|
57
|
-
__decorate([
|
|
58
|
-
state()
|
|
59
|
-
], CorasMultiMonthCalendar.prototype, "visibleMonthsDays", void 0);
|
|
@@ -4,6 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
import { localized, msg } from "@lit/localize";
|
|
7
8
|
import { LitElement, html } from "lit";
|
|
8
9
|
import { property, query, queryAssignedElements, state, } from "lit/decorators.js";
|
|
9
10
|
import { classMap } from "lit/directives/class-map.js";
|
|
@@ -11,7 +12,7 @@ import "../button/button.js";
|
|
|
11
12
|
import "../icon/icon.js";
|
|
12
13
|
import styles from "./carousel.styles.js";
|
|
13
14
|
const OFFSET = 1;
|
|
14
|
-
|
|
15
|
+
let CorasCarousel = class CorasCarousel extends LitElement {
|
|
15
16
|
constructor() {
|
|
16
17
|
super(...arguments);
|
|
17
18
|
this.assetsURL = "";
|
|
@@ -85,6 +86,7 @@ export class CorasCarousel extends LitElement {
|
|
|
85
86
|
><coras-icon
|
|
86
87
|
assets-url="${this.assetsURL}"
|
|
87
88
|
icon="chevron-left"
|
|
89
|
+
label=${msg("Previous")}
|
|
88
90
|
></coras-icon
|
|
89
91
|
></coras-button>
|
|
90
92
|
<coras-button
|
|
@@ -97,12 +99,13 @@ export class CorasCarousel extends LitElement {
|
|
|
97
99
|
><coras-icon
|
|
98
100
|
assets-url="${this.assetsURL}"
|
|
99
101
|
icon="chevron-right"
|
|
102
|
+
label=${msg("Next")}
|
|
100
103
|
></coras-icon
|
|
101
104
|
></coras-button>
|
|
102
105
|
</div>
|
|
103
106
|
${this.renderFooter()}`;
|
|
104
107
|
}
|
|
105
|
-
}
|
|
108
|
+
};
|
|
106
109
|
__decorate([
|
|
107
110
|
property({ type: String, attribute: "assets-url" })
|
|
108
111
|
], CorasCarousel.prototype, "assetsURL", void 0);
|
|
@@ -130,3 +133,7 @@ __decorate([
|
|
|
130
133
|
__decorate([
|
|
131
134
|
state()
|
|
132
135
|
], CorasCarousel.prototype, "currentScrollPosition", void 0);
|
|
136
|
+
CorasCarousel = __decorate([
|
|
137
|
+
localized()
|
|
138
|
+
], CorasCarousel);
|
|
139
|
+
export { CorasCarousel };
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { LitElement, type CSSResultGroup } from "lit";
|
|
1
|
+
import { LitElement, type CSSResultGroup, type PropertyValues } from "lit";
|
|
2
2
|
import type { components } from "../../core/types/api-schema.js";
|
|
3
3
|
import "../checkbox/checkbox.js";
|
|
4
4
|
import "../checkbox-group/checkbox-group.js";
|
|
5
5
|
export declare class CorasCategoriesTree extends LitElement {
|
|
6
6
|
static styles: CSSResultGroup;
|
|
7
7
|
categories: components["schemas"]["Category"][];
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/** Comma-separated slugs; a parent slug stands for all of its subcategories */
|
|
9
|
+
selectedCategories: string;
|
|
10
10
|
private _selectedSlugs;
|
|
11
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
12
|
+
private expandSelection;
|
|
11
13
|
private getEventDetail;
|
|
12
14
|
private handleCheckboxChange;
|
|
13
15
|
private getParentCategoryStatus;
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { LitElement, html } from "lit";
|
|
7
|
+
import { LitElement, html, } from "lit";
|
|
8
8
|
import { fireInternalEvent } from "../../core/events.js";
|
|
9
9
|
import { property, state } from "lit/decorators.js";
|
|
10
10
|
import { CheckboxVariants } from "../checkbox/checkbox.constants.js";
|
|
@@ -15,38 +15,36 @@ export class CorasCategoriesTree extends LitElement {
|
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments);
|
|
17
17
|
this.categories = [];
|
|
18
|
+
/** Comma-separated slugs; a parent slug stands for all of its subcategories */
|
|
19
|
+
this.selectedCategories = "";
|
|
18
20
|
this._selectedSlugs = new Set();
|
|
19
21
|
}
|
|
20
22
|
static { this.styles = styles; }
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
willUpdate(changed) {
|
|
24
|
+
// Expansion needs both inputs, and they may arrive in either order.
|
|
25
|
+
if (changed.has("categories") || changed.has("selectedCategories")) {
|
|
26
|
+
this._selectedSlugs = this.expandSelection(this.selectedCategories);
|
|
27
|
+
}
|
|
23
28
|
}
|
|
24
|
-
|
|
25
|
-
const oldSlugs = new Set(this._selectedSlugs);
|
|
29
|
+
expandSelection(value) {
|
|
26
30
|
const inputSlugs = new Set(value
|
|
27
|
-
|
|
28
|
-
.
|
|
29
|
-
.
|
|
30
|
-
const
|
|
31
|
+
.split(",")
|
|
32
|
+
.map((slug) => slug.trim())
|
|
33
|
+
.filter(Boolean));
|
|
34
|
+
const slugs = new Set(inputSlugs);
|
|
31
35
|
for (const category of this.categories) {
|
|
32
36
|
if (!category.subcategories || category.subcategories.length === 0) {
|
|
33
37
|
continue;
|
|
34
38
|
}
|
|
35
39
|
const subcategorySlugs = category.subcategories.map((sub) => sub.slug);
|
|
36
40
|
if (inputSlugs.has(category.slug)) {
|
|
37
|
-
subcategorySlugs.forEach((slug) =>
|
|
41
|
+
subcategorySlugs.forEach((slug) => slugs.add(slug));
|
|
38
42
|
}
|
|
39
|
-
else if (subcategorySlugs.
|
|
40
|
-
|
|
41
|
-
newSlugs.add(category.slug);
|
|
43
|
+
else if (subcategorySlugs.every((slug) => inputSlugs.has(slug))) {
|
|
44
|
+
slugs.add(category.slug);
|
|
42
45
|
}
|
|
43
46
|
}
|
|
44
|
-
|
|
45
|
-
![...oldSlugs].every((slug) => newSlugs.has(slug)) ||
|
|
46
|
-
![...newSlugs].every((slug) => oldSlugs.has(slug))) {
|
|
47
|
-
this._selectedSlugs = newSlugs;
|
|
48
|
-
this.requestUpdate("selectedCategories", oldSlugs);
|
|
49
|
-
}
|
|
47
|
+
return slugs;
|
|
50
48
|
}
|
|
51
49
|
getEventDetail() {
|
|
52
50
|
const result = new Set();
|
|
@@ -137,7 +135,10 @@ export class CorasCategoriesTree extends LitElement {
|
|
|
137
135
|
}
|
|
138
136
|
if (changed) {
|
|
139
137
|
this._selectedSlugs = workingSelectedSlugs;
|
|
140
|
-
|
|
138
|
+
// Keep the public property in step so a later `categories` change
|
|
139
|
+
// re-expands the user's current selection, not a stale one.
|
|
140
|
+
this.selectedCategories = this.getEventDetail();
|
|
141
|
+
fireInternalEvent(this, "selection-changed", this.selectedCategories);
|
|
141
142
|
}
|
|
142
143
|
}
|
|
143
144
|
getParentCategoryStatus(category) {
|
|
@@ -196,7 +197,7 @@ __decorate([
|
|
|
196
197
|
], CorasCategoriesTree.prototype, "categories", void 0);
|
|
197
198
|
__decorate([
|
|
198
199
|
property({ type: String })
|
|
199
|
-
], CorasCategoriesTree.prototype, "selectedCategories",
|
|
200
|
+
], CorasCategoriesTree.prototype, "selectedCategories", void 0);
|
|
200
201
|
__decorate([
|
|
201
202
|
state()
|
|
202
203
|
], CorasCategoriesTree.prototype, "_selectedSlugs", void 0);
|
|
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { LitElement, html } from "lit";
|
|
8
8
|
import { property } from "lit/decorators.js";
|
|
9
9
|
import { classMap } from "lit/directives/class-map.js";
|
|
10
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
10
11
|
import { fireInternalEvent } from "../../core/events.js";
|
|
11
12
|
import { CheckboxVariants } from "./checkbox.constants.js";
|
|
12
13
|
import styles from "./checkbox.styles.js";
|
|
@@ -26,8 +27,9 @@ export class CorasCheckbox extends LitElement {
|
|
|
26
27
|
}
|
|
27
28
|
static { this.styles = styles; }
|
|
28
29
|
render() {
|
|
30
|
+
const indeterminate = this.variant === CheckboxVariants.INDETERMINATE;
|
|
29
31
|
const inputClasses = {
|
|
30
|
-
indeterminate
|
|
32
|
+
indeterminate,
|
|
31
33
|
main: this.variant === CheckboxVariants.MAIN && this.checked,
|
|
32
34
|
};
|
|
33
35
|
return html `
|
|
@@ -36,6 +38,8 @@ export class CorasCheckbox extends LitElement {
|
|
|
36
38
|
class=${classMap(inputClasses)}
|
|
37
39
|
part="input"
|
|
38
40
|
.checked=${this.checked}
|
|
41
|
+
.indeterminate=${indeterminate}
|
|
42
|
+
aria-checked=${ifDefined(indeterminate ? "mixed" : undefined)}
|
|
39
43
|
value=${this.value}
|
|
40
44
|
type="checkbox"
|
|
41
45
|
name="checkbox"
|
|
@@ -5,7 +5,7 @@ export class CorasCheckboxGroup extends LitElement {
|
|
|
5
5
|
static { this.styles = styles; }
|
|
6
6
|
render() {
|
|
7
7
|
return html `<div class="checkbox-group">
|
|
8
|
-
<slot name="primary"
|
|
8
|
+
<slot name="primary"></slot>
|
|
9
9
|
<div class="options">
|
|
10
10
|
<slot></slot>
|
|
11
11
|
</div>
|
|
@@ -13,7 +13,7 @@ export default css `
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.checkbox-group {
|
|
16
|
-
|
|
16
|
+
slot[name="primary"] {
|
|
17
17
|
font-size: var(--checkbox-group-category-option-font-size);
|
|
18
18
|
font-weight: var(--checkbox-group-category-option-font-weight);
|
|
19
19
|
color: var(--checkbox-group-category-option-color);
|
|
@@ -4,6 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
import { localized, msg } from "@lit/localize";
|
|
7
8
|
import { html, LitElement } from "lit";
|
|
8
9
|
import { property } from "lit/decorators.js";
|
|
9
10
|
import { classMap } from "lit/directives/class-map.js";
|
|
@@ -11,7 +12,7 @@ import { fireInternalEvent } from "../../core/events.js";
|
|
|
11
12
|
import "../button/button.js";
|
|
12
13
|
import "../icon/icon.js";
|
|
13
14
|
import styles from "./chip.styles.js";
|
|
14
|
-
|
|
15
|
+
let CorasChip = class CorasChip extends LitElement {
|
|
15
16
|
constructor() {
|
|
16
17
|
super(...arguments);
|
|
17
18
|
this.assetsURL = "";
|
|
@@ -38,16 +39,20 @@ export class CorasChip extends LitElement {
|
|
|
38
39
|
<coras-icon
|
|
39
40
|
assets-url="${this.assetsURL}"
|
|
40
41
|
icon="close"
|
|
41
|
-
label
|
|
42
|
+
label=${msg("Remove")}
|
|
42
43
|
></coras-icon>
|
|
43
44
|
</button>
|
|
44
45
|
</span>
|
|
45
46
|
`;
|
|
46
47
|
}
|
|
47
|
-
}
|
|
48
|
+
};
|
|
48
49
|
__decorate([
|
|
49
50
|
property({ type: String, attribute: "assets-url" })
|
|
50
51
|
], CorasChip.prototype, "assetsURL", void 0);
|
|
51
52
|
__decorate([
|
|
52
53
|
property()
|
|
53
54
|
], CorasChip.prototype, "variant", void 0);
|
|
55
|
+
CorasChip = __decorate([
|
|
56
|
+
localized()
|
|
57
|
+
], CorasChip);
|
|
58
|
+
export { CorasChip };
|
|
@@ -87,6 +87,12 @@ export declare class CorasCryptoAuthModal extends LitElement {
|
|
|
87
87
|
mfaEnrollmentError: string;
|
|
88
88
|
/** Whether to show resend button for email OTP */
|
|
89
89
|
showResend: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Number of email codes sent so far. Each increment confirms a resend
|
|
92
|
+
* succeeded and restarts the resend cooldown; a failed resend leaves the
|
|
93
|
+
* count alone so the button stays available.
|
|
94
|
+
*/
|
|
95
|
+
emailCodeSendCount: number;
|
|
90
96
|
/** Rate limit error message */
|
|
91
97
|
rateLimitError: string;
|
|
92
98
|
/** SMS rate limit error message */
|
|
@@ -62,6 +62,12 @@ let CorasCryptoAuthModal = class CorasCryptoAuthModal extends LitElement {
|
|
|
62
62
|
this.mfaEnrollmentError = "";
|
|
63
63
|
/** Whether to show resend button for email OTP */
|
|
64
64
|
this.showResend = false;
|
|
65
|
+
/**
|
|
66
|
+
* Number of email codes sent so far. Each increment confirms a resend
|
|
67
|
+
* succeeded and restarts the resend cooldown; a failed resend leaves the
|
|
68
|
+
* count alone so the button stays available.
|
|
69
|
+
*/
|
|
70
|
+
this.emailCodeSendCount = 0;
|
|
65
71
|
/** Rate limit error message */
|
|
66
72
|
this.rateLimitError = "";
|
|
67
73
|
/** SMS rate limit error message */
|
|
@@ -119,6 +125,11 @@ let CorasCryptoAuthModal = class CorasCryptoAuthModal extends LitElement {
|
|
|
119
125
|
// Deferred: Lit prohibits synchronous re-entrant property updates inside updated()
|
|
120
126
|
setTimeout(() => this._startEmailResendTimer(), 0);
|
|
121
127
|
}
|
|
128
|
+
else if (changedProperties.has("emailCodeSendCount") &&
|
|
129
|
+
changedProperties.get("emailCodeSendCount") !== undefined &&
|
|
130
|
+
this.codeSent) {
|
|
131
|
+
setTimeout(() => this._startEmailResendTimer(), 0);
|
|
132
|
+
}
|
|
122
133
|
if (changedProperties.has("mfaEnrollmentCodeSent") &&
|
|
123
134
|
this.mfaEnrollmentCodeSent) {
|
|
124
135
|
this._mfaOtpCode = "";
|
|
@@ -207,7 +218,7 @@ let CorasCryptoAuthModal = class CorasCryptoAuthModal extends LitElement {
|
|
|
207
218
|
const otpElement = this.renderRoot.querySelector("#email-otp");
|
|
208
219
|
if (otpElement)
|
|
209
220
|
otpElement.value = "";
|
|
210
|
-
|
|
221
|
+
// The cooldown starts when the parent confirms the send (emailCodeSendCount).
|
|
211
222
|
fireInternalEvent(this, "resend-email-code", {});
|
|
212
223
|
}
|
|
213
224
|
handleInitiateMfaEnrollment() {
|
|
@@ -521,6 +532,9 @@ __decorate([
|
|
|
521
532
|
__decorate([
|
|
522
533
|
property({ type: Boolean, attribute: "show-resend" })
|
|
523
534
|
], CorasCryptoAuthModal.prototype, "showResend", void 0);
|
|
535
|
+
__decorate([
|
|
536
|
+
property({ type: Number, attribute: "email-code-send-count" })
|
|
537
|
+
], CorasCryptoAuthModal.prototype, "emailCodeSendCount", void 0);
|
|
524
538
|
__decorate([
|
|
525
539
|
property({ type: String, attribute: "rate-limit-error" })
|
|
526
540
|
], CorasCryptoAuthModal.prototype, "rateLimitError", void 0);
|
|
@@ -12,7 +12,7 @@ import { msg, localized } from "@lit/localize";
|
|
|
12
12
|
import { fireInternalEvent } from "../../core/events.js";
|
|
13
13
|
import { scrollLock } from "../../core/utils/scroll-lock.js";
|
|
14
14
|
import styles from "./dialog.styles.js";
|
|
15
|
-
const
|
|
15
|
+
const NATIVE_FOCUSABLE_SELECTOR = [
|
|
16
16
|
'a[href]:not([tabindex="-1"])',
|
|
17
17
|
'button:not([disabled]):not([tabindex="-1"])',
|
|
18
18
|
'input:not([disabled]):not([tabindex="-1"])',
|
|
@@ -20,6 +20,40 @@ const FOCUSABLE_SELECTOR = [
|
|
|
20
20
|
'textarea:not([disabled]):not([tabindex="-1"])',
|
|
21
21
|
'[tabindex]:not([tabindex="-1"])',
|
|
22
22
|
].join(",");
|
|
23
|
+
// Custom elements whose host is not focusable but whose shadow root holds the
|
|
24
|
+
// real control. They are invisible to the native selector, so the trap has to
|
|
25
|
+
// look inside them.
|
|
26
|
+
const FOCUSABLE_CUSTOM_ELEMENTS = [
|
|
27
|
+
"coras-button",
|
|
28
|
+
"coras-checkbox",
|
|
29
|
+
"coras-field",
|
|
30
|
+
"coras-otp",
|
|
31
|
+
"coras-select-list",
|
|
32
|
+
];
|
|
33
|
+
const FOCUSABLE_CANDIDATE_SELECTOR = [
|
|
34
|
+
NATIVE_FOCUSABLE_SELECTOR,
|
|
35
|
+
...FOCUSABLE_CUSTOM_ELEMENTS,
|
|
36
|
+
].join(",");
|
|
37
|
+
function resolveFocusTarget(candidate) {
|
|
38
|
+
if (candidate.matches(NATIVE_FOCUSABLE_SELECTOR)) {
|
|
39
|
+
return candidate;
|
|
40
|
+
}
|
|
41
|
+
const focusesThroughShadowRoot = candidate.shadowRoot?.delegatesFocus ||
|
|
42
|
+
FOCUSABLE_CUSTOM_ELEMENTS.includes(candidate.localName);
|
|
43
|
+
if (!focusesThroughShadowRoot) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
return (candidate.shadowRoot?.querySelector(NATIVE_FOCUSABLE_SELECTOR) ?? null);
|
|
47
|
+
}
|
|
48
|
+
// `document.activeElement` stops at the first shadow host, so walk down to the
|
|
49
|
+
// element that really holds focus.
|
|
50
|
+
function deepActiveElement() {
|
|
51
|
+
let active = document.activeElement;
|
|
52
|
+
while (active?.shadowRoot?.activeElement) {
|
|
53
|
+
active = active.shadowRoot.activeElement;
|
|
54
|
+
}
|
|
55
|
+
return active;
|
|
56
|
+
}
|
|
23
57
|
/**
|
|
24
58
|
* A unified dialog component that displays content in a modal overlay.
|
|
25
59
|
*
|
|
@@ -45,7 +79,7 @@ let CorasDialog = class CorasDialog extends LitElement {
|
|
|
45
79
|
/** Whether the dialog is open */
|
|
46
80
|
this.open = false;
|
|
47
81
|
/** Accessible label for the dialog */
|
|
48
|
-
this.label = "Dialog";
|
|
82
|
+
this.label = msg("Dialog");
|
|
49
83
|
/** Whether to show the built-in close button */
|
|
50
84
|
this.showCloseButton = true;
|
|
51
85
|
/** Whether to show the back button */
|
|
@@ -166,39 +200,36 @@ let CorasDialog = class CorasDialog extends LitElement {
|
|
|
166
200
|
const dialog = this.shadowRoot?.querySelector(".dialog");
|
|
167
201
|
if (!dialog)
|
|
168
202
|
return;
|
|
169
|
-
//
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
assigned.forEach((el) => {
|
|
176
|
-
if (el.matches?.(FOCUSABLE_SELECTOR)) {
|
|
177
|
-
slottedFocusable.push(el);
|
|
178
|
-
}
|
|
179
|
-
const nested = el.querySelectorAll?.(FOCUSABLE_SELECTOR);
|
|
180
|
-
if (nested) {
|
|
181
|
-
slottedFocusable.push(...Array.from(nested));
|
|
203
|
+
// Collect candidates from both shadow DOM and slotted light DOM
|
|
204
|
+
const candidates = Array.from(dialog.querySelectorAll(FOCUSABLE_CANDIDATE_SELECTOR));
|
|
205
|
+
dialog.querySelectorAll("slot").forEach((slot) => {
|
|
206
|
+
slot.assignedElements({ flatten: true }).forEach((el) => {
|
|
207
|
+
if (el.matches(FOCUSABLE_CANDIDATE_SELECTOR)) {
|
|
208
|
+
candidates.push(el);
|
|
182
209
|
}
|
|
210
|
+
candidates.push(...el.querySelectorAll(FOCUSABLE_CANDIDATE_SELECTOR));
|
|
183
211
|
});
|
|
184
212
|
});
|
|
185
|
-
const focusable =
|
|
213
|
+
const focusable = candidates
|
|
214
|
+
.map(resolveFocusTarget)
|
|
215
|
+
.filter((el) => el !== null && el.offsetParent !== null);
|
|
186
216
|
if (focusable.length === 0) {
|
|
187
|
-
event.preventDefault();
|
|
188
217
|
return;
|
|
189
218
|
}
|
|
190
219
|
const first = focusable[0];
|
|
191
220
|
const last = focusable[focusable.length - 1];
|
|
221
|
+
const active = deepActiveElement();
|
|
222
|
+
// Focus outside the list (the panel itself, or the body) is treated as a
|
|
223
|
+
// boundary so Tab cannot leave the dialog from there either.
|
|
224
|
+
const atBoundary = active === null || !focusable.includes(active);
|
|
192
225
|
if (event.shiftKey) {
|
|
193
|
-
if (
|
|
194
|
-
this.shadowRoot?.activeElement === first) {
|
|
226
|
+
if (active === first || atBoundary) {
|
|
195
227
|
event.preventDefault();
|
|
196
228
|
last.focus();
|
|
197
229
|
}
|
|
198
230
|
}
|
|
199
231
|
else {
|
|
200
|
-
if (
|
|
201
|
-
this.shadowRoot?.activeElement === last) {
|
|
232
|
+
if (active === last || atBoundary) {
|
|
202
233
|
event.preventDefault();
|
|
203
234
|
first.focus();
|
|
204
235
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { type CSSResultGroup, LitElement
|
|
1
|
+
import { type CSSResultGroup, LitElement } from "lit";
|
|
2
2
|
import "../icon/icon.js";
|
|
3
3
|
declare const CorasDrawer_base: import("../../mixins/overlay/types.js").Constructor<import("../../mixins/overlay/types.js").OverlayMixinInterface> & typeof LitElement;
|
|
4
4
|
export declare class CorasDrawer extends CorasDrawer_base {
|
|
5
5
|
static styles: CSSResultGroup;
|
|
6
6
|
assetsURL: string;
|
|
7
7
|
label: string;
|
|
8
|
-
|
|
8
|
+
private panel;
|
|
9
|
+
focusPanel(): void;
|
|
9
10
|
private renderHeader;
|
|
10
11
|
render(): import("lit").TemplateResult<1>;
|
|
11
12
|
}
|
|
@@ -5,8 +5,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { localized, msg } from "@lit/localize";
|
|
8
|
-
import { LitElement, html
|
|
9
|
-
import { property } from "lit/decorators.js";
|
|
8
|
+
import { LitElement, html } from "lit";
|
|
9
|
+
import { property, query } from "lit/decorators.js";
|
|
10
10
|
import { classMap } from "lit/directives/class-map.js";
|
|
11
11
|
import "../icon/icon.js";
|
|
12
12
|
import { OverlayMixin } from "../../mixins/overlay/overlay-mixin.js";
|
|
@@ -15,13 +15,15 @@ let CorasDrawer = class CorasDrawer extends OverlayMixin(LitElement) {
|
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments);
|
|
17
17
|
this.assetsURL = "";
|
|
18
|
-
this.label = "Drawer";
|
|
18
|
+
this.label = msg("Drawer");
|
|
19
19
|
this.renderHeader = () => {
|
|
20
20
|
return html `
|
|
21
21
|
<div class="header">
|
|
22
22
|
<slot name="header" data-testid="drawer-header-slot"></slot>
|
|
23
|
-
<
|
|
23
|
+
<button
|
|
24
24
|
class="close"
|
|
25
|
+
type="button"
|
|
26
|
+
aria-label=${msg("Close")}
|
|
25
27
|
@click="${this.handleModalClosed}"
|
|
26
28
|
data-testid="drawer-close"
|
|
27
29
|
>
|
|
@@ -29,27 +31,17 @@ let CorasDrawer = class CorasDrawer extends OverlayMixin(LitElement) {
|
|
|
29
31
|
assets-url="${this.assetsURL}"
|
|
30
32
|
part="header-icon"
|
|
31
33
|
icon="close"
|
|
32
|
-
|
|
34
|
+
aria-hidden="true"
|
|
33
35
|
close-icon-style
|
|
34
36
|
></coras-icon>
|
|
35
|
-
</
|
|
37
|
+
</button>
|
|
36
38
|
</div>
|
|
37
39
|
`;
|
|
38
40
|
};
|
|
39
41
|
}
|
|
40
42
|
static { this.styles = styles; }
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (changed.has("open")) {
|
|
44
|
-
// to prevent scrolling when the drawer is open we hide the scrollbar,
|
|
45
|
-
// but we need to add scrollbar width margin to the body to prevent the
|
|
46
|
-
// content from jumping
|
|
47
|
-
const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
|
|
48
|
-
window.document.body.style.marginInlineEnd = this.open
|
|
49
|
-
? `${scrollbarWidth}px`
|
|
50
|
-
: "";
|
|
51
|
-
window.document.body.style.overflow = this.open ? "hidden" : "";
|
|
52
|
-
}
|
|
43
|
+
focusPanel() {
|
|
44
|
+
this.panel.focus();
|
|
53
45
|
}
|
|
54
46
|
render() {
|
|
55
47
|
const classes = {
|
|
@@ -89,6 +81,9 @@ __decorate([
|
|
|
89
81
|
__decorate([
|
|
90
82
|
property({ type: String })
|
|
91
83
|
], CorasDrawer.prototype, "label", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
query(".panel")
|
|
86
|
+
], CorasDrawer.prototype, "panel", void 0);
|
|
92
87
|
CorasDrawer = __decorate([
|
|
93
88
|
localized()
|
|
94
89
|
], CorasDrawer);
|