@coras-io/embed 0.5.0 → 0.6.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/CHANGELOG.md +36 -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.js +0 -1
- 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/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 +14 -152
- 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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @coras-io/embed
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 01b86c3: Retry GET requests up to twice after a network failure, timeout, or 502/503/504, and never replay POST, PUT, PATCH, or DELETE
|
|
8
|
+
- 01b86c3: Abort any API request after 60 seconds so a dead connection no longer leaves a page loading forever
|
|
9
|
+
- d2fdf08: Add the `chrome-only` page, which renders the managed navbar, footer and basket around markup the host owns, so a host that routes some of its own pages can put them in the same chrome as the embedded ones. The host's markup is passed as the new `content` mount option
|
|
10
|
+
- 8a9bd37: Show related attractions and the categories available in a location at the bottom of the details page
|
|
11
|
+
- dac49dc: Lay the mount out as a flex column, so a managed footer sits at the bottom of a short page without host CSS naming Coras elements
|
|
12
|
+
- 53b34a3: Emit `coras:payment-status` with `status: "pending"` when a charge succeeded but the API had not confirmed the transaction within the polling budget, instead of reporting a false failure and offering a retry that re-used the consumed payment
|
|
13
|
+
- 01b86c3: Redact emails, tokens, and card-like numbers from APIError response bodies before they reach callers and error reporters
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 53b34a3: Fix basket countdowns and expiry after a removal, resync the basket after a delete, stop the details page reserving a stale date selection, keep landing filter chips in sync with the applied params, show contact-form failures, and sort performance times correctly in every locale
|
|
18
|
+
- 53b34a3: Fix checkout error handling: reservation validation errors reach their form fields, unstructured failures show a card error, a failed pickup-point save blocks the order, the Apple Pay and Google Pay sheet closes when a reservation fails, phone numbers are sent in E.164, and client-side validation no longer emits a failed payment status
|
|
19
|
+
- 53b34a3: Harden crypto payments: cancelling the MFA prompt cancels the pending user operation, transfer amounts are exact decimals, the RPC chain is verified at initialisation, receipt polling stops when the page goes away, crash recovery after an on-chain transfer works, and the login email is no longer stored in localStorage
|
|
20
|
+
- 01b86c3: Clear a booking session the API rejects with 401 and repeat the GET without it; the middleware order previously prevented this
|
|
21
|
+
- 01b86c3: Show the error modal, alert, or empty state when an API request fails instead of rendering a page as if it returned nothing
|
|
22
|
+
- 56510ee: Expire a stored booking session whose saved expiry is missing or unreadable instead of trusting it forever, keep a tab marked active when the tab group already names it, and bind the textarea value the way Lit supports
|
|
23
|
+
- 53b34a3: Make dialogs, drawers, menus, tabs, accordions, chips and breadcrumbs keyboard operable with correct ARIA, and stop closed dropdowns from observing scroll and resize for the life of the page
|
|
24
|
+
- 01b86c3: Show an error on the help contact form when sending fails instead of the success dialog
|
|
25
|
+
- 872832a: Keep a navbar control slotted into `nav`, `actions-start`, or `actions-end` at its own width, so a tight bar no longer wraps its label inside its own box; the `search` slot gives up the width instead
|
|
26
|
+
- 53b34a3: Ship the API schema declarations, add a `default` export condition, keep Storybook config out of the package, load date-fns locale packs lazily, format custom date patterns in the visitor's locale, drop URL query values `mount()` would reject in `parseCorasUrl`, and reject `ready` with an `unmounted` error on early unmount
|
|
27
|
+
- 01b86c3: Map API validation errors to payment form fields again; the wrapped error body was not being read
|
|
28
|
+
- Updated dependencies [dac49dc]
|
|
29
|
+
- @coras-io/brand-tokens@0.6.0
|
|
30
|
+
|
|
31
|
+
## 0.5.1
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- 8a51a71: Accept a brand's `colorScheme` in `config.theme` under `strict: true`, so a `brand.json` exported from Coras Studio mounts as shipped.
|
|
36
|
+
- Updated dependencies [8a51a71]
|
|
37
|
+
- @coras-io/brand-tokens@0.5.0
|
|
38
|
+
|
|
3
39
|
## 0.5.0
|
|
4
40
|
|
|
5
41
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -8,16 +8,22 @@ Embeddable Coras booking pages, mounted through a single framework-neutral SDK.
|
|
|
8
8
|
pnpm add @coras-io/embed
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
The package is native ESM (no CommonJS build) and targets Node
|
|
11
|
+
The package is native ESM (no CommonJS build) and targets Node 22+ for any
|
|
12
12
|
server-side rendering or build tooling; every modern bundler (Vite, webpack 5,
|
|
13
13
|
Next, Astro) and browser consumes it directly. To load it straight from a
|
|
14
14
|
`<script type="module">` without a bundler or import map, use an ESM CDN that
|
|
15
|
-
resolves bare specifiers, e.g. `https://esm.sh/@coras-io/embed`.
|
|
15
|
+
resolves bare specifiers, e.g. `https://esm.sh/@coras-io/embed`. Every entry
|
|
16
|
+
point also declares a `default` export condition, so `require()` on Node
|
|
17
|
+
22.12+ and Jest in CommonJS mode load the same ESM files instead of failing
|
|
18
|
+
with `ERR_PACKAGE_PATH_NOT_EXPORTED`.
|
|
16
19
|
|
|
17
20
|
If your host application also integrates Coinbase CDP directly, it must resolve
|
|
18
21
|
the **same** `@coinbase/cdp-core` version as this package - two copies desync
|
|
19
22
|
login state until a page refresh. This dependency is deliberately pinned for
|
|
20
23
|
that reason; align your version with the one in this package's `dependencies`.
|
|
24
|
+
Every other runtime dependency uses a caret range, so a host on an adjacent
|
|
25
|
+
patch or minor version of `viem`, `date-fns`, or `dompurify` resolves to one
|
|
26
|
+
copy instead of two; `@coinbase/cdp-core` is the only exact pin.
|
|
21
27
|
|
|
22
28
|
## mount()
|
|
23
29
|
|
|
@@ -39,6 +45,13 @@ const app = mount({
|
|
|
39
45
|
|
|
40
46
|
Page custom elements are internal. You never import them directly.
|
|
41
47
|
|
|
48
|
+
Translations load lazily. `mount()` resolves the message bundle for `locale`
|
|
49
|
+
through a templated dynamic import of `locales/<locale>.js`, which relies on
|
|
50
|
+
the bundler expanding it into one chunk per locale; Vite, Rollup, webpack 5,
|
|
51
|
+
and Parcel do, while esbuild on its own does not and silently serves English. The matching `date-fns` locale pack loads with the
|
|
52
|
+
bundle, and if either chunk fails to load (typically a stale deployment) the
|
|
53
|
+
page quietly falls back to English messages and `en-GB` calendar names.
|
|
54
|
+
|
|
42
55
|
For the full guide and event reference, see the Coras docs at https://docs.coras.io (Getting Started and Reference).
|
|
43
56
|
|
|
44
57
|
## Other entry points
|
|
@@ -18,16 +18,22 @@ export class CorasAccordionItem extends LitElement {
|
|
|
18
18
|
static { this.styles = styles; }
|
|
19
19
|
render() {
|
|
20
20
|
return html `
|
|
21
|
-
<
|
|
21
|
+
<button
|
|
22
|
+
type="button"
|
|
23
|
+
class="heading"
|
|
24
|
+
aria-expanded=${this.open ? "true" : "false"}
|
|
25
|
+
aria-controls="content"
|
|
26
|
+
>
|
|
22
27
|
<span data-testid="label" class="label">${this.label}</span>
|
|
23
28
|
<coras-icon
|
|
24
29
|
assets-url="${this.assetsURL}"
|
|
25
30
|
class="arrow"
|
|
26
31
|
icon="expand-more"
|
|
32
|
+
aria-hidden="true"
|
|
27
33
|
></coras-icon>
|
|
28
|
-
</
|
|
34
|
+
</button>
|
|
29
35
|
|
|
30
|
-
<div data-testid="content" class="content">
|
|
36
|
+
<div data-testid="content" id="content" class="content">
|
|
31
37
|
<slot></slot>
|
|
32
38
|
</div>
|
|
33
39
|
`;
|
|
@@ -25,8 +25,12 @@ export default css `
|
|
|
25
25
|
display: inline-flex;
|
|
26
26
|
justify-content: space-between;
|
|
27
27
|
align-items: center;
|
|
28
|
+
border: 0;
|
|
28
29
|
border-top: 1px solid var(--accordion-divider-color);
|
|
29
30
|
padding: 16px 8px;
|
|
31
|
+
background: none;
|
|
32
|
+
font: inherit;
|
|
33
|
+
text-align: start;
|
|
30
34
|
|
|
31
35
|
.label {
|
|
32
36
|
color: var(--accordion-label-color);
|
|
@@ -16,6 +16,14 @@ export class CorasAccordion extends LitElement {
|
|
|
16
16
|
handleSlotClick(e) {
|
|
17
17
|
const target = e.target;
|
|
18
18
|
const item = target.closest("coras-accordion-item");
|
|
19
|
+
// Only the item's heading button toggles; clicks inside the expanded
|
|
20
|
+
// content must leave the item open.
|
|
21
|
+
const fromHeading = e
|
|
22
|
+
.composedPath()
|
|
23
|
+
.some((node) => node instanceof HTMLButtonElement &&
|
|
24
|
+
node.classList.contains("heading"));
|
|
25
|
+
if (!item || !fromHeading)
|
|
26
|
+
return;
|
|
19
27
|
const newState = this.openedItem !== item;
|
|
20
28
|
this.openedItem = newState ? item : null;
|
|
21
29
|
this.items.forEach((current) => {
|
|
@@ -4,7 +4,7 @@ import type { Variant } from "./alert.types.js";
|
|
|
4
4
|
export declare class CorasAlert extends LitElement {
|
|
5
5
|
static styles: CSSResultGroup;
|
|
6
6
|
assetsURL: string;
|
|
7
|
-
|
|
7
|
+
heading: string;
|
|
8
8
|
variant: Variant;
|
|
9
9
|
shadowless: boolean;
|
|
10
10
|
render(): import("lit").TemplateResult<1>;
|
|
@@ -12,7 +12,8 @@ export class CorasAlert extends LitElement {
|
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments);
|
|
14
14
|
this.assetsURL = "";
|
|
15
|
-
|
|
15
|
+
// Not `title`: that is the native tooltip attribute on every element.
|
|
16
|
+
this.heading = "";
|
|
16
17
|
this.variant = "error";
|
|
17
18
|
this.shadowless = false;
|
|
18
19
|
}
|
|
@@ -30,7 +31,7 @@ export class CorasAlert extends LitElement {
|
|
|
30
31
|
<div class="content">
|
|
31
32
|
<div class="heading">
|
|
32
33
|
<h2 part="title" class="title" data-testid="title">
|
|
33
|
-
${this.
|
|
34
|
+
${this.heading}
|
|
34
35
|
</h2>
|
|
35
36
|
<slot name="action"></slot>
|
|
36
37
|
</div>
|
|
@@ -50,7 +51,7 @@ __decorate([
|
|
|
50
51
|
], CorasAlert.prototype, "assetsURL", void 0);
|
|
51
52
|
__decorate([
|
|
52
53
|
property({ type: String })
|
|
53
|
-
], CorasAlert.prototype, "
|
|
54
|
+
], CorasAlert.prototype, "heading", void 0);
|
|
54
55
|
__decorate([
|
|
55
56
|
property({ type: String })
|
|
56
57
|
], CorasAlert.prototype, "variant", void 0);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { type LitElement } from "lit";
|
|
2
2
|
import type { Constructor } from "../../../contexts/utils.js";
|
|
3
3
|
import "../../category-tag/category-tag.js";
|
|
4
|
-
import "../../marketing-tag/marketing-tag.js";
|
|
5
|
-
import "../../price/price.js";
|
|
6
4
|
import "../../star-rating/star-rating.js";
|
|
7
5
|
import type { AttractionCardMixinType } from "./attraction-card.types.js";
|
|
8
6
|
export declare const AttractionCardMixin: <T extends Constructor<LitElement>>(superClass: T) => Constructor<AttractionCardMixinType> & T;
|
|
@@ -8,8 +8,6 @@ import { html, } from "lit";
|
|
|
8
8
|
import { property } from "lit/decorators.js";
|
|
9
9
|
import { formatDateTimeForDisplay } from "../../../core/utils/datetime.js";
|
|
10
10
|
import "../../category-tag/category-tag.js";
|
|
11
|
-
import "../../marketing-tag/marketing-tag.js";
|
|
12
|
-
import "../../price/price.js";
|
|
13
11
|
import "../../star-rating/star-rating.js";
|
|
14
12
|
import styles from "./attraction-card.styles.js";
|
|
15
13
|
const DATE_DISPLAY_OPTIONS = {
|
|
@@ -27,7 +25,6 @@ export const AttractionCardMixin = (superClass) => {
|
|
|
27
25
|
* candidates via `selectCorasImage` instead of trusting `image`.
|
|
28
26
|
*/
|
|
29
27
|
this.images = [];
|
|
30
|
-
this.label = false;
|
|
31
28
|
this.description = "";
|
|
32
29
|
this.name = "";
|
|
33
30
|
this.rating = 0;
|
|
@@ -78,9 +75,6 @@ export const AttractionCardMixin = (superClass) => {
|
|
|
78
75
|
__decorate([
|
|
79
76
|
property({ type: Array })
|
|
80
77
|
], AttractionCardBase.prototype, "images", void 0);
|
|
81
|
-
__decorate([
|
|
82
|
-
property({ type: Boolean })
|
|
83
|
-
], AttractionCardBase.prototype, "label", void 0);
|
|
84
78
|
__decorate([
|
|
85
79
|
property({ type: String })
|
|
86
80
|
], AttractionCardBase.prototype, "description", void 0);
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import { type CSSResultGroup, LitElement } from "lit";
|
|
1
|
+
import { type CSSResultGroup, LitElement, nothing } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* @fires {CustomEvent} modal-closed - Fired when Escape is pressed while open
|
|
4
|
+
*/
|
|
2
5
|
export declare class CorasBasketMobile extends LitElement {
|
|
3
6
|
static styles: CSSResultGroup;
|
|
4
7
|
open: boolean;
|
|
5
|
-
|
|
8
|
+
/** Accessible name of the dialog */
|
|
9
|
+
label: string;
|
|
10
|
+
private _ownsLock;
|
|
11
|
+
private _previouslyFocused;
|
|
12
|
+
private _handleKeyDown;
|
|
6
13
|
connectedCallback(): void;
|
|
7
14
|
disconnectedCallback(): void;
|
|
15
|
+
protected willUpdate(changedProperties: Map<string, unknown>): void;
|
|
8
16
|
updated(changedProperties: Map<string, unknown>): void;
|
|
9
|
-
|
|
17
|
+
private _lockBodyScroll;
|
|
18
|
+
private _unlockBodyScroll;
|
|
19
|
+
private _restoreFocus;
|
|
20
|
+
render(): typeof nothing | import("lit").TemplateResult<1>;
|
|
10
21
|
}
|
|
@@ -4,44 +4,97 @@ 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 { html, LitElement } from "lit";
|
|
7
|
+
import { html, LitElement, nothing } from "lit";
|
|
8
8
|
import { property } from "lit/decorators.js";
|
|
9
|
-
import { localized } from "@lit/localize";
|
|
9
|
+
import { localized, msg } from "@lit/localize";
|
|
10
|
+
import { fireInternalEvent } from "../../core/events.js";
|
|
11
|
+
import { scrollLock } from "../../core/utils/scroll-lock.js";
|
|
10
12
|
import styles from "./basket-mobile.styles.js";
|
|
13
|
+
/**
|
|
14
|
+
* @fires {CustomEvent} modal-closed - Fired when Escape is pressed while open
|
|
15
|
+
*/
|
|
11
16
|
let CorasBasketMobile = class CorasBasketMobile extends LitElement {
|
|
12
17
|
constructor() {
|
|
13
18
|
super(...arguments);
|
|
14
19
|
this.open = false;
|
|
20
|
+
/** Accessible name of the dialog */
|
|
21
|
+
this.label = msg("Basket");
|
|
22
|
+
this._ownsLock = false;
|
|
23
|
+
this._previouslyFocused = null;
|
|
24
|
+
this._handleKeyDown = (event) => {
|
|
25
|
+
if (event.key === "Escape" && this.open) {
|
|
26
|
+
event.stopPropagation();
|
|
27
|
+
fireInternalEvent(this, "modal-closed", {});
|
|
28
|
+
}
|
|
29
|
+
};
|
|
15
30
|
}
|
|
16
31
|
static { this.styles = styles; }
|
|
17
|
-
_updateBodyScroll() {
|
|
18
|
-
if (this.open) {
|
|
19
|
-
document.body.style.overflow = "hidden";
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
document.body.style.overflow = "";
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
32
|
connectedCallback() {
|
|
26
33
|
super.connectedCallback();
|
|
27
|
-
this.
|
|
34
|
+
this.addEventListener("keydown", this._handleKeyDown);
|
|
35
|
+
if (this.open) {
|
|
36
|
+
this._lockBodyScroll();
|
|
37
|
+
}
|
|
28
38
|
}
|
|
29
39
|
disconnectedCallback() {
|
|
30
|
-
|
|
40
|
+
this.removeEventListener("keydown", this._handleKeyDown);
|
|
41
|
+
this._unlockBodyScroll();
|
|
42
|
+
this._restoreFocus();
|
|
31
43
|
super.disconnectedCallback();
|
|
32
44
|
}
|
|
45
|
+
willUpdate(changedProperties) {
|
|
46
|
+
if (changedProperties.has("open") && this.open) {
|
|
47
|
+
this._previouslyFocused = (this.getRootNode()
|
|
48
|
+
.activeElement ?? document.activeElement);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
33
51
|
updated(changedProperties) {
|
|
34
52
|
if (changedProperties.has("open")) {
|
|
35
|
-
this.
|
|
53
|
+
if (this.open) {
|
|
54
|
+
this._lockBodyScroll();
|
|
55
|
+
this.shadowRoot?.querySelector(".modal-container")?.focus();
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
this._unlockBodyScroll();
|
|
59
|
+
this._restoreFocus();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
_lockBodyScroll() {
|
|
64
|
+
if (!this._ownsLock) {
|
|
65
|
+
scrollLock.lock();
|
|
66
|
+
this._ownsLock = true;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
_unlockBodyScroll() {
|
|
70
|
+
if (this._ownsLock) {
|
|
71
|
+
scrollLock.unlock();
|
|
72
|
+
this._ownsLock = false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
_restoreFocus() {
|
|
76
|
+
const el = this._previouslyFocused;
|
|
77
|
+
this._previouslyFocused = null;
|
|
78
|
+
try {
|
|
79
|
+
el?.focus({ preventScroll: true });
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
// Element may have been removed from the DOM
|
|
36
83
|
}
|
|
37
84
|
}
|
|
38
85
|
render() {
|
|
39
86
|
if (!this.open) {
|
|
40
|
-
return
|
|
87
|
+
return nothing;
|
|
41
88
|
}
|
|
42
89
|
return html `
|
|
43
90
|
<div class="modal-overlay" role="presentation">
|
|
44
|
-
<div
|
|
91
|
+
<div
|
|
92
|
+
class="modal-container"
|
|
93
|
+
role="dialog"
|
|
94
|
+
aria-modal="true"
|
|
95
|
+
aria-label=${this.label}
|
|
96
|
+
tabindex="-1"
|
|
97
|
+
>
|
|
45
98
|
<div class="modal-content" part="content">
|
|
46
99
|
<slot></slot>
|
|
47
100
|
</div>
|
|
@@ -53,6 +106,9 @@ let CorasBasketMobile = class CorasBasketMobile extends LitElement {
|
|
|
53
106
|
__decorate([
|
|
54
107
|
property({ type: Boolean, reflect: true })
|
|
55
108
|
], CorasBasketMobile.prototype, "open", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
property({ type: String })
|
|
111
|
+
], CorasBasketMobile.prototype, "label", void 0);
|
|
56
112
|
CorasBasketMobile = __decorate([
|
|
57
113
|
localized()
|
|
58
114
|
], CorasBasketMobile);
|
|
@@ -53,17 +53,15 @@ export declare class CorasBetterCarousel extends LitElement {
|
|
|
53
53
|
private resizeObserver;
|
|
54
54
|
firstUpdated(): void;
|
|
55
55
|
updated(changedProperties: Map<string, unknown>): void;
|
|
56
|
-
/**
|
|
57
|
-
* Setup scroll listener for carousel
|
|
58
|
-
*/
|
|
59
|
-
private setupScrollListener;
|
|
60
56
|
/**
|
|
61
57
|
* Handle mode change between single-item and multi-item
|
|
62
58
|
*/
|
|
63
59
|
private handleModeChange;
|
|
64
60
|
disconnectedCallback(): void;
|
|
65
61
|
/**
|
|
66
|
-
* Handle scroll events
|
|
62
|
+
* Handle scroll events. Bound to both `scroll` and `scrollend`: `scrollend`
|
|
63
|
+
* settles the state once a smooth scroll finishes, and browsers without it
|
|
64
|
+
* still get the last `scroll` event at the final position.
|
|
67
65
|
*/
|
|
68
66
|
private handleScroll;
|
|
69
67
|
/**
|
|
@@ -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";
|
|
@@ -20,7 +21,7 @@ import styles from "./better-carousel.styles.js";
|
|
|
20
21
|
* @csspart btn-prev - The previous navigation button
|
|
21
22
|
* @csspart btn-next - The next navigation button
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
|
+
let CorasBetterCarousel = class CorasBetterCarousel extends LitElement {
|
|
24
25
|
constructor() {
|
|
25
26
|
super(...arguments);
|
|
26
27
|
this.assetsURL = "";
|
|
@@ -53,7 +54,9 @@ export class CorasBetterCarousel extends LitElement {
|
|
|
53
54
|
*/
|
|
54
55
|
this.currentScrollPosition = 0;
|
|
55
56
|
/**
|
|
56
|
-
* Handle scroll events
|
|
57
|
+
* Handle scroll events. Bound to both `scroll` and `scrollend`: `scrollend`
|
|
58
|
+
* settles the state once a smooth scroll finishes, and browsers without it
|
|
59
|
+
* still get the last `scroll` event at the final position.
|
|
57
60
|
*/
|
|
58
61
|
this.handleScroll = () => {
|
|
59
62
|
this.currentScrollPosition = this.carouselContent.scrollLeft;
|
|
@@ -75,7 +78,6 @@ export class CorasBetterCarousel extends LitElement {
|
|
|
75
78
|
static { this.styles = styles; }
|
|
76
79
|
firstUpdated() {
|
|
77
80
|
this.updateCarouselState();
|
|
78
|
-
this.setupScrollListener();
|
|
79
81
|
this.resizeObserver = new ResizeObserver(() => {
|
|
80
82
|
this.updateCarouselState();
|
|
81
83
|
});
|
|
@@ -87,33 +89,13 @@ export class CorasBetterCarousel extends LitElement {
|
|
|
87
89
|
this.handleModeChange();
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
|
-
/**
|
|
91
|
-
* Setup scroll listener for carousel
|
|
92
|
-
*/
|
|
93
|
-
setupScrollListener() {
|
|
94
|
-
// Add scroll event listener for both modes
|
|
95
|
-
this.carouselContent.addEventListener("scroll", this.handleScroll);
|
|
96
|
-
}
|
|
97
92
|
/**
|
|
98
93
|
* Handle mode change between single-item and multi-item
|
|
99
94
|
*/
|
|
100
95
|
handleModeChange() {
|
|
101
|
-
// Remove existing scroll listener
|
|
102
|
-
if (this.carouselContent) {
|
|
103
|
-
this.carouselContent.removeEventListener("scroll", this.handleScroll);
|
|
104
|
-
}
|
|
105
96
|
// Reset state
|
|
106
97
|
this.currentItemIndex = 0;
|
|
107
98
|
this.currentScrollPosition = 0;
|
|
108
|
-
// Setup for new mode
|
|
109
|
-
if (this.multiItem) {
|
|
110
|
-
// Multi-item mode: setup scroll listener
|
|
111
|
-
this.setupScrollListener();
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
// Single-item mode: also uses scroll but with different behavior
|
|
115
|
-
this.carouselContent.addEventListener("scroll", this.handleScroll);
|
|
116
|
-
}
|
|
117
99
|
// Make all items visible for both modes
|
|
118
100
|
this.items.forEach((item) => {
|
|
119
101
|
item.removeAttribute("hidden");
|
|
@@ -127,10 +109,6 @@ export class CorasBetterCarousel extends LitElement {
|
|
|
127
109
|
disconnectedCallback() {
|
|
128
110
|
super.disconnectedCallback();
|
|
129
111
|
this.resizeObserver?.disconnect();
|
|
130
|
-
// Remove scroll event listener for both modes
|
|
131
|
-
if (this.carouselContent) {
|
|
132
|
-
this.carouselContent.removeEventListener("scroll", this.handleScroll);
|
|
133
|
-
}
|
|
134
112
|
}
|
|
135
113
|
/**
|
|
136
114
|
* Update carousel measurements and state
|
|
@@ -210,8 +188,6 @@ export class CorasBetterCarousel extends LitElement {
|
|
|
210
188
|
left: -scrollAmount,
|
|
211
189
|
behavior: "smooth",
|
|
212
190
|
});
|
|
213
|
-
// Update button visibility after scrolling
|
|
214
|
-
setTimeout(() => this.updateButtonVisibility(), 300);
|
|
215
191
|
}
|
|
216
192
|
/**
|
|
217
193
|
* Scroll to the next set of items in multi-item mode
|
|
@@ -225,8 +201,6 @@ export class CorasBetterCarousel extends LitElement {
|
|
|
225
201
|
left: scrollAmount,
|
|
226
202
|
behavior: "smooth",
|
|
227
203
|
});
|
|
228
|
-
// Update button visibility after scrolling
|
|
229
|
-
setTimeout(() => this.updateButtonVisibility(), 300);
|
|
230
204
|
}
|
|
231
205
|
/**
|
|
232
206
|
* Scroll to a specific item by index
|
|
@@ -243,8 +217,6 @@ export class CorasBetterCarousel extends LitElement {
|
|
|
243
217
|
left: scrollPosition,
|
|
244
218
|
behavior,
|
|
245
219
|
});
|
|
246
|
-
// Update button visibility after scrolling
|
|
247
|
-
setTimeout(() => this.updateButtonVisibility(), 300);
|
|
248
220
|
}
|
|
249
221
|
render() {
|
|
250
222
|
// Classes for the carousel container
|
|
@@ -275,12 +247,14 @@ export class CorasBetterCarousel extends LitElement {
|
|
|
275
247
|
><coras-icon
|
|
276
248
|
assets-url="${this.assetsURL}"
|
|
277
249
|
icon="chevron-left"
|
|
250
|
+
label=${msg("Previous")}
|
|
278
251
|
></coras-icon
|
|
279
252
|
></coras-button>
|
|
280
253
|
<div
|
|
281
254
|
class="carousel-content"
|
|
282
255
|
part="carousel"
|
|
283
256
|
@scroll=${this.handleScroll}
|
|
257
|
+
@scrollend=${this.handleScroll}
|
|
284
258
|
>
|
|
285
259
|
<slot @slotchange=${this.updateCarouselState}></slot>
|
|
286
260
|
</div>
|
|
@@ -297,12 +271,13 @@ export class CorasBetterCarousel extends LitElement {
|
|
|
297
271
|
><coras-icon
|
|
298
272
|
assets-url="${this.assetsURL}"
|
|
299
273
|
icon="chevron-right"
|
|
274
|
+
label=${msg("Next")}
|
|
300
275
|
></coras-icon
|
|
301
276
|
></coras-button>
|
|
302
277
|
</div>
|
|
303
278
|
`;
|
|
304
279
|
}
|
|
305
|
-
}
|
|
280
|
+
};
|
|
306
281
|
__decorate([
|
|
307
282
|
property({ type: String, attribute: "assets-url" })
|
|
308
283
|
], CorasBetterCarousel.prototype, "assetsURL", void 0);
|
|
@@ -333,3 +308,7 @@ __decorate([
|
|
|
333
308
|
__decorate([
|
|
334
309
|
state()
|
|
335
310
|
], CorasBetterCarousel.prototype, "currentScrollPosition", void 0);
|
|
311
|
+
CorasBetterCarousel = __decorate([
|
|
312
|
+
localized()
|
|
313
|
+
], CorasBetterCarousel);
|
|
314
|
+
export { CorasBetterCarousel };
|
|
@@ -6,7 +6,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { html, LitElement } from "lit";
|
|
8
8
|
import { property } from "lit/decorators.js";
|
|
9
|
-
import { classMap } from "lit/directives/class-map.js";
|
|
10
9
|
import styles from "./breadcrumb-item.styles.js";
|
|
11
10
|
export class CorasBreadcrumbItem extends LitElement {
|
|
12
11
|
constructor() {
|
|
@@ -15,18 +14,12 @@ export class CorasBreadcrumbItem extends LitElement {
|
|
|
15
14
|
}
|
|
16
15
|
static { this.styles = styles; }
|
|
17
16
|
render() {
|
|
18
|
-
this.setAttribute("role", "listitem");
|
|
19
17
|
return html `
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
})}
|
|
26
|
-
tabindex="0"
|
|
27
|
-
>
|
|
28
|
-
<slot></slot>
|
|
29
|
-
</span>
|
|
18
|
+
<li part="base" class="breadcrumb-item">
|
|
19
|
+
${this.clickable
|
|
20
|
+
? html `<button type="button" class="link"><slot></slot></button>`
|
|
21
|
+
: html `<span aria-current="page"><slot></slot></span>`}
|
|
22
|
+
</li>
|
|
30
23
|
`;
|
|
31
24
|
}
|
|
32
25
|
}
|
|
@@ -17,13 +17,21 @@ export default css `
|
|
|
17
17
|
.breadcrumb-item {
|
|
18
18
|
display: flex;
|
|
19
19
|
align-items: center;
|
|
20
|
+
list-style: none;
|
|
21
|
+
margin: 0;
|
|
22
|
+
padding: 0;
|
|
23
|
+
}
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
.link {
|
|
26
|
+
padding: 0;
|
|
27
|
+
border: 0;
|
|
28
|
+
background: none;
|
|
29
|
+
font: inherit;
|
|
30
|
+
color: inherit;
|
|
31
|
+
cursor: pointer;
|
|
23
32
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
33
|
+
&:hover {
|
|
34
|
+
text-decoration: underline;
|
|
27
35
|
}
|
|
28
36
|
}
|
|
29
37
|
|
|
@@ -9,16 +9,13 @@ import { html, LitElement } from "lit";
|
|
|
9
9
|
import styles from "./breadcrumbs.styles.js";
|
|
10
10
|
let CorasBreadcrumbs = class CorasBreadcrumbs extends LitElement {
|
|
11
11
|
static { this.styles = styles; }
|
|
12
|
-
connectedCallback() {
|
|
13
|
-
super.connectedCallback();
|
|
14
|
-
this.setAttribute("role", "navigation");
|
|
15
|
-
this.setAttribute("aria-label", msg("Breadcrumbs"));
|
|
16
|
-
}
|
|
17
12
|
render() {
|
|
18
13
|
return html `
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
|
|
14
|
+
<nav part="base" class="breadcrumbs" aria-label=${msg("Breadcrumbs")}>
|
|
15
|
+
<ol>
|
|
16
|
+
<slot></slot>
|
|
17
|
+
</ol>
|
|
18
|
+
</nav>
|
|
22
19
|
`;
|
|
23
20
|
}
|
|
24
21
|
};
|
|
@@ -4,11 +4,17 @@ export default css `
|
|
|
4
4
|
${component}
|
|
5
5
|
|
|
6
6
|
.breadcrumbs {
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
7
|
max-width: 95vw;
|
|
10
8
|
width: 100%;
|
|
11
9
|
overflow: hidden;
|
|
12
10
|
position: relative;
|
|
13
11
|
}
|
|
12
|
+
|
|
13
|
+
ol {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
list-style: none;
|
|
17
|
+
margin: 0;
|
|
18
|
+
padding: 0;
|
|
19
|
+
}
|
|
14
20
|
`;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export declare const variants:
|
|
1
|
+
export declare const variants: readonly ["primary", "secondary", "outlined", "text", "transparent"];
|
|
2
2
|
export declare const radius: readonly ["small", "large", "circle", "field"];
|
|
3
3
|
export declare const height: readonly ["xs", "sm", "md", "lg", "xl"];
|
|
4
4
|
export declare const borderColor: readonly ["none", "light", "medium"];
|
|
5
|
-
export declare const expanded: readonly [true, false];
|