@coras-io/embed 0.5.1 → 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 +28 -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 +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
|
@@ -2,73 +2,48 @@ import type { Client } from "openapi-fetch";
|
|
|
2
2
|
import type { PathsWithMethod, RequestBodyJSON, ResponseObjectMap, SuccessResponse } from "openapi-typescript-helpers";
|
|
3
3
|
import type { paths } from "../types/api-schema.js";
|
|
4
4
|
import type { SupportedLocales } from "../types/index.js";
|
|
5
|
-
|
|
5
|
+
type RequestConfig = {
|
|
6
6
|
client: Client<paths>;
|
|
7
7
|
distributorID: string;
|
|
8
8
|
locale: SupportedLocales;
|
|
9
|
+
bookingSession?: string | null;
|
|
10
|
+
path?: Record<string, string>;
|
|
11
|
+
query?: Record<string, unknown>;
|
|
12
|
+
headers?: Record<string, string>;
|
|
13
|
+
body?: unknown;
|
|
14
|
+
};
|
|
15
|
+
export declare const apiGet: <TPath extends PathsWithMethod<paths, "get">>({ endpoint, ...config }: RequestConfig & {
|
|
9
16
|
endpoint: TPath;
|
|
10
17
|
query?: paths[TPath]["get"]["parameters"]["query"];
|
|
11
|
-
path?: Record<string, string>;
|
|
12
|
-
bookingSession?: string | null;
|
|
13
18
|
}) => Promise<{
|
|
14
19
|
data: SuccessResponse<ResponseObjectMap<paths[TPath]["get"]>>;
|
|
15
20
|
response: Response;
|
|
16
21
|
}>;
|
|
17
|
-
export declare const apiPost: <TPath extends PathsWithMethod<paths, "post">>({
|
|
18
|
-
client: Client<paths>;
|
|
19
|
-
distributorID: string;
|
|
20
|
-
locale: SupportedLocales;
|
|
22
|
+
export declare const apiPost: <TPath extends PathsWithMethod<paths, "post">>({ endpoint, ...config }: RequestConfig & {
|
|
21
23
|
endpoint: TPath;
|
|
22
24
|
body: RequestBodyJSON<paths[TPath]["post"]>;
|
|
23
|
-
path?: Record<string, string>;
|
|
24
|
-
bookingSession?: string | null;
|
|
25
|
-
headers?: Record<string, string>;
|
|
26
25
|
}) => Promise<{
|
|
27
26
|
data: SuccessResponse<ResponseObjectMap<paths[TPath]["post"]>>;
|
|
28
27
|
response: Response;
|
|
29
28
|
}>;
|
|
30
|
-
export declare const apiPut: <TPath extends PathsWithMethod<paths, "put">>({
|
|
31
|
-
client: Client<paths>;
|
|
32
|
-
distributorID: string;
|
|
33
|
-
locale: SupportedLocales;
|
|
29
|
+
export declare const apiPut: <TPath extends PathsWithMethod<paths, "put">>({ endpoint, ...config }: RequestConfig & {
|
|
34
30
|
endpoint: TPath;
|
|
35
31
|
body: RequestBodyJSON<paths[TPath]["put"]>;
|
|
36
|
-
path?: Record<string, string>;
|
|
37
|
-
bookingSession?: string | null;
|
|
38
|
-
headers?: Record<string, string>;
|
|
39
32
|
}) => Promise<{
|
|
40
33
|
data: SuccessResponse<ResponseObjectMap<paths[TPath]["put"]>>;
|
|
41
34
|
response: Response;
|
|
42
35
|
}>;
|
|
43
|
-
export declare const apiPatch: <TPath extends PathsWithMethod<paths, "patch">>({
|
|
44
|
-
client: Client<paths>;
|
|
45
|
-
distributorID: string;
|
|
46
|
-
locale: SupportedLocales;
|
|
36
|
+
export declare const apiPatch: <TPath extends PathsWithMethod<paths, "patch">>({ endpoint, ...config }: RequestConfig & {
|
|
47
37
|
endpoint: TPath;
|
|
48
|
-
path?: Record<string, string>;
|
|
49
|
-
query?: Record<string, string | null | undefined>;
|
|
50
38
|
body?: RequestBodyJSON<paths[TPath]["patch"]>;
|
|
51
|
-
bookingSession?: string | null;
|
|
52
39
|
}) => Promise<{
|
|
53
40
|
data: SuccessResponse<ResponseObjectMap<paths[TPath]["patch"]>>;
|
|
54
41
|
response: Response;
|
|
55
42
|
}>;
|
|
56
|
-
export declare const apiDelete: <TPath extends PathsWithMethod<paths, "delete">>({
|
|
57
|
-
client: Client<paths>;
|
|
58
|
-
distributorID: string;
|
|
59
|
-
locale: SupportedLocales;
|
|
43
|
+
export declare const apiDelete: <TPath extends PathsWithMethod<paths, "delete">>({ endpoint, ...config }: RequestConfig & {
|
|
60
44
|
endpoint: TPath;
|
|
61
|
-
path?: Record<string, string>;
|
|
62
|
-
bookingSession?: string | null;
|
|
63
45
|
}) => Promise<{
|
|
64
46
|
data: SuccessResponse<ResponseObjectMap<paths[TPath]["delete"]>>;
|
|
65
47
|
response: Response;
|
|
66
48
|
}>;
|
|
67
|
-
export
|
|
68
|
-
data: T;
|
|
69
|
-
response: Response;
|
|
70
|
-
}>): Promise<{
|
|
71
|
-
data: T | undefined;
|
|
72
|
-
response: Response | undefined;
|
|
73
|
-
error: unknown;
|
|
74
|
-
}>;
|
|
49
|
+
export {};
|
package/dist/core/api/queries.js
CHANGED
|
@@ -14,108 +14,25 @@ const createBaseRequestConfig = (distributorID, locale, customBookingSession) =>
|
|
|
14
14
|
const language_code = getApiLanguageCode(locale);
|
|
15
15
|
return { headers, path, language_code };
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
// The wrappers below carry the schema-derived types; this builder only merges
|
|
18
|
+
// the shared headers, API version, and language code into the openapi-fetch
|
|
19
|
+
// init. Its argument shape is assembled from loosely typed records, so it
|
|
20
|
+
// cannot satisfy the per-endpoint init type and is cast once here. The result
|
|
21
|
+
// is cast too: the error middleware throws on every non-ok response, so the
|
|
22
|
+
// success branch is the only one a caller can observe.
|
|
23
|
+
const request = (method, endpoint, { client, distributorID, locale, bookingSession, path: customPath, query: customQuery, headers: customHeaders, body, }) => {
|
|
18
24
|
const { headers, path, language_code } = createBaseRequestConfig(distributorID, locale, bookingSession);
|
|
19
|
-
|
|
25
|
+
return client.request(method, endpoint, {
|
|
20
26
|
params: {
|
|
21
|
-
header: headers,
|
|
22
|
-
path: {
|
|
23
|
-
|
|
24
|
-
...(customPath || {}),
|
|
25
|
-
},
|
|
26
|
-
query: {
|
|
27
|
-
...(query || {}),
|
|
28
|
-
language_code,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
32
|
-
});
|
|
33
|
-
return { data, response };
|
|
34
|
-
};
|
|
35
|
-
export const apiPost = async ({ client, distributorID, locale, endpoint, body, path: customPath, bookingSession, headers: customHeaders, }) => {
|
|
36
|
-
const { headers, path, language_code } = createBaseRequestConfig(distributorID, locale, bookingSession);
|
|
37
|
-
const { data, response } = await client.POST(endpoint, {
|
|
38
|
-
params: {
|
|
39
|
-
header: {
|
|
40
|
-
...headers,
|
|
41
|
-
...(customHeaders || {}),
|
|
42
|
-
},
|
|
43
|
-
path: {
|
|
44
|
-
...path,
|
|
45
|
-
...(customPath || {}),
|
|
46
|
-
},
|
|
47
|
-
query: {
|
|
48
|
-
language_code,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
body,
|
|
52
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
-
});
|
|
54
|
-
return { data, response };
|
|
55
|
-
};
|
|
56
|
-
export const apiPut = async ({ client, distributorID, locale, endpoint, body, path: customPath, bookingSession, headers: customHeaders, }) => {
|
|
57
|
-
const { headers, path, language_code } = createBaseRequestConfig(distributorID, locale, bookingSession);
|
|
58
|
-
const { data, response } = await client.PUT(endpoint, {
|
|
59
|
-
params: {
|
|
60
|
-
header: {
|
|
61
|
-
...headers,
|
|
62
|
-
...(customHeaders || {}),
|
|
63
|
-
},
|
|
64
|
-
path: {
|
|
65
|
-
...path,
|
|
66
|
-
...(customPath || {}),
|
|
67
|
-
},
|
|
68
|
-
query: {
|
|
69
|
-
language_code,
|
|
70
|
-
},
|
|
27
|
+
header: { ...headers, ...customHeaders },
|
|
28
|
+
path: { ...path, ...customPath },
|
|
29
|
+
query: { ...customQuery, language_code },
|
|
71
30
|
},
|
|
72
31
|
body,
|
|
73
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
74
|
-
});
|
|
75
|
-
return { data, response };
|
|
76
|
-
};
|
|
77
|
-
export const apiPatch = async ({ client, distributorID, locale, endpoint, path: customPath, query: customQuery, body, bookingSession, }) => {
|
|
78
|
-
const { headers, path, language_code } = createBaseRequestConfig(distributorID, locale, bookingSession);
|
|
79
|
-
const { data, response } = await client.PATCH(endpoint, {
|
|
80
|
-
params: {
|
|
81
|
-
header: headers,
|
|
82
|
-
path: {
|
|
83
|
-
...path,
|
|
84
|
-
...(customPath || {}),
|
|
85
|
-
},
|
|
86
|
-
query: {
|
|
87
|
-
language_code,
|
|
88
|
-
...(customQuery || {}),
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
body,
|
|
92
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
93
|
-
});
|
|
94
|
-
return { data, response };
|
|
95
|
-
};
|
|
96
|
-
export const apiDelete = async ({ client, distributorID, locale, endpoint, path: customPath, bookingSession, }) => {
|
|
97
|
-
const { headers, path, language_code } = createBaseRequestConfig(distributorID, locale, bookingSession);
|
|
98
|
-
const { data, response } = await client.DELETE(endpoint, {
|
|
99
|
-
params: {
|
|
100
|
-
header: headers,
|
|
101
|
-
path: {
|
|
102
|
-
...path,
|
|
103
|
-
...(customPath || {}),
|
|
104
|
-
},
|
|
105
|
-
query: {
|
|
106
|
-
language_code,
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
110
32
|
});
|
|
111
|
-
return { data, response };
|
|
112
33
|
};
|
|
113
|
-
export
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
catch (error) {
|
|
119
|
-
return { data: undefined, response: undefined, error };
|
|
120
|
-
}
|
|
121
|
-
}
|
|
34
|
+
export const apiGet = ({ endpoint, ...config }) => request("get", endpoint, config);
|
|
35
|
+
export const apiPost = ({ endpoint, ...config }) => request("post", endpoint, config);
|
|
36
|
+
export const apiPut = ({ endpoint, ...config }) => request("put", endpoint, config);
|
|
37
|
+
export const apiPatch = ({ endpoint, ...config }) => request("patch", endpoint, config);
|
|
38
|
+
export const apiDelete = ({ endpoint, ...config }) => request("delete", endpoint, config);
|
package/dist/core/events.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { components } from "./types/api-schema.js";
|
|
|
4
4
|
import type { CorasHostEventMap, CorasHostEventName } from "../sdk/types.js";
|
|
5
5
|
import type { PaymentFiatMethodType } from "../components/payment-fiat-method/payment-fiat-method.types.js";
|
|
6
6
|
import type { PhoneCodeSelection } from "../components/phone-field/phone-field.types.js";
|
|
7
|
+
import type { GeolocationFailedEventDetail } from "../components/locations-results/locations-results.component.js";
|
|
7
8
|
export interface ValueChangedEventDetail {
|
|
8
9
|
value: unknown;
|
|
9
10
|
fieldName?: string;
|
|
@@ -42,9 +43,6 @@ export interface MarketingChangedEventDetail {
|
|
|
42
43
|
export interface EmailChangedEventDetail {
|
|
43
44
|
value: string;
|
|
44
45
|
}
|
|
45
|
-
export interface TermsChangedEventDetail {
|
|
46
|
-
value: boolean;
|
|
47
|
-
}
|
|
48
46
|
export interface StripeInitializedEventDetail {
|
|
49
47
|
stripe: Stripe;
|
|
50
48
|
}
|
|
@@ -82,7 +80,6 @@ export interface InternalEventMap {
|
|
|
82
80
|
"selection-changed": SelectionChangeEventDetail;
|
|
83
81
|
"code-selected": PhoneCodeSelection;
|
|
84
82
|
"phone-code-selected": PhoneCodeSelection;
|
|
85
|
-
"terms-changed": TermsChangedEventDetail;
|
|
86
83
|
"email-changed": EmailChangedEventDetail;
|
|
87
84
|
"marketing-changed": MarketingChangedEventDetail;
|
|
88
85
|
"date-selected": DateSelectedEventDetail;
|
|
@@ -121,6 +118,7 @@ export interface InternalEventMap {
|
|
|
121
118
|
"seats-unavailable": Record<string, never>;
|
|
122
119
|
"seats-confirmed": SeatsConfirmedEventDetail;
|
|
123
120
|
"geolocation-selected": GeolocationSelectedEventDetail;
|
|
121
|
+
"geolocation-failed": GeolocationFailedEventDetail;
|
|
124
122
|
"tab-changed": TabChangeEventDetail;
|
|
125
123
|
"chip-removed": Record<string, never>;
|
|
126
124
|
"coras-image-load": Record<string, never>;
|
package/dist/core/i18n/date.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { type Locale } from "date-fns";
|
|
2
2
|
import type { allLocales } from "./locale-codes.js";
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
type SupportedLocale = (typeof allLocales)[number];
|
|
4
|
+
export declare const localeMapping: Partial<Record<SupportedLocale, Locale>>;
|
|
5
|
+
/**
|
|
6
|
+
* Loads the date-fns pack for `locale` into `localeMapping`. A pack that fails
|
|
7
|
+
* to load (typically a stale chunk after a deployment) is left unset, so the
|
|
8
|
+
* calendar quietly renders with the en-GB fallback instead of failing the
|
|
9
|
+
* locale switch; there is no per-mount logger below the SDK to report it to.
|
|
10
|
+
*/
|
|
11
|
+
export declare const loadCalendarLocale: (locale: SupportedLocale) => Promise<void>;
|
|
12
|
+
export declare const getCalendarLocale: (locale: SupportedLocale) => Locale;
|
|
13
|
+
export declare const weekdayNames: (locale: SupportedLocale) => (string | undefined)[];
|
|
14
|
+
export declare const formatDate: (date: Date | string, locale: SupportedLocale, showYear?: boolean) => string;
|
|
15
|
+
export declare const getDateRangeLabel: (startDate: string, endDate: string, locale: SupportedLocale) => string | undefined;
|
|
16
|
+
export {};
|
package/dist/core/i18n/date.js
CHANGED
|
@@ -1,26 +1,53 @@
|
|
|
1
1
|
import { addDays, format, parseISO, startOfWeek } from "date-fns";
|
|
2
|
-
import {
|
|
2
|
+
import { enGB } from "date-fns/locale/en-GB";
|
|
3
|
+
// One chunk per pack, so a visitor downloads the pack for their locale rather
|
|
4
|
+
// than all nineteen. The specifiers are written out because bundlers only
|
|
5
|
+
// expand a dynamic import over relative paths, never over a bare package
|
|
6
|
+
// subpath.
|
|
7
|
+
const calendarLocaleLoaders = {
|
|
8
|
+
"ar-SA": () => import("date-fns/locale/ar-SA").then((m) => m.arSA),
|
|
9
|
+
"da-DK": () => import("date-fns/locale/da").then((m) => m.da),
|
|
10
|
+
"de-DE": () => import("date-fns/locale/de").then((m) => m.de),
|
|
11
|
+
"en-GB": () => Promise.resolve(enGB),
|
|
12
|
+
"en-IE": () => import("date-fns/locale/en-IE").then((m) => m.enIE),
|
|
13
|
+
"en-US": () => import("date-fns/locale/en-US").then((m) => m.enUS),
|
|
14
|
+
"es-ES": () => import("date-fns/locale/es").then((m) => m.es),
|
|
15
|
+
"fr-FR": () => import("date-fns/locale/fr").then((m) => m.fr),
|
|
16
|
+
"fr-MA": () => import("date-fns/locale/fr").then((m) => m.fr),
|
|
17
|
+
"is-IS": () => import("date-fns/locale/is").then((m) => m.is),
|
|
18
|
+
"it-IT": () => import("date-fns/locale/it").then((m) => m.it),
|
|
19
|
+
"ms-MY": () => import("date-fns/locale/ms").then((m) => m.ms),
|
|
20
|
+
"nb-NO": () => import("date-fns/locale/nb").then((m) => m.nb),
|
|
21
|
+
"pl-PL": () => import("date-fns/locale/pl").then((m) => m.pl),
|
|
22
|
+
"pt-PT": () => import("date-fns/locale/pt").then((m) => m.pt),
|
|
23
|
+
"sv-SE": () => import("date-fns/locale/sv").then((m) => m.sv),
|
|
24
|
+
"th-TH": () => import("date-fns/locale/th").then((m) => m.th),
|
|
25
|
+
"tr-TR": () => import("date-fns/locale/tr").then((m) => m.tr),
|
|
26
|
+
"zh-CN": () => import("date-fns/locale/zh-CN").then((m) => m.zhCN),
|
|
27
|
+
"zh-HK": () => import("date-fns/locale/zh-HK").then((m) => m.zhHK),
|
|
28
|
+
};
|
|
29
|
+
// The packs loaded so far. `loadLocale` in localization.ts fills it alongside
|
|
30
|
+
// the lit message bundle, so every synchronous render path that calls
|
|
31
|
+
// `getCalendarLocale` finds the pack of the active locale. The source locale
|
|
32
|
+
// is seeded because lit-localize never calls `loadLocale` for it.
|
|
3
33
|
export const localeMapping = {
|
|
4
|
-
"ar-SA": arSA,
|
|
5
|
-
"da-DK": da,
|
|
6
|
-
"de-DE": de,
|
|
7
34
|
"en-GB": enGB,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Loads the date-fns pack for `locale` into `localeMapping`. A pack that fails
|
|
38
|
+
* to load (typically a stale chunk after a deployment) is left unset, so the
|
|
39
|
+
* calendar quietly renders with the en-GB fallback instead of failing the
|
|
40
|
+
* locale switch; there is no per-mount logger below the SDK to report it to.
|
|
41
|
+
*/
|
|
42
|
+
export const loadCalendarLocale = async (locale) => {
|
|
43
|
+
if (localeMapping[locale])
|
|
44
|
+
return;
|
|
45
|
+
try {
|
|
46
|
+
localeMapping[locale] = await calendarLocaleLoaders[locale]();
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
// Fallback documented above.
|
|
50
|
+
}
|
|
24
51
|
};
|
|
25
52
|
export const getCalendarLocale = (locale) => localeMapping[locale] || enGB;
|
|
26
53
|
export const weekdayNames = (locale) => {
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
/// <reference types="vite/client" />
|
|
2
2
|
import { configureLocalization } from "@lit/localize";
|
|
3
|
+
import { loadCalendarLocale } from "./date.js";
|
|
3
4
|
import { sourceLocale, targetLocales } from "./locale-codes.js";
|
|
4
5
|
export const { getLocale, setLocale } = configureLocalization({
|
|
5
6
|
sourceLocale,
|
|
6
7
|
targetLocales,
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
|
|
8
|
+
// The date-fns pack loads with the message bundle so both are in place when
|
|
9
|
+
// `setLocale` resolves and the components re-render. Stale chunks vanish
|
|
10
|
+
// after deployment - each import falls back on its own (source-locale
|
|
11
|
+
// messages, en-GB calendar names) rather than producing unhandled rejections.
|
|
12
|
+
loadLocale: (locale) => Promise.all([
|
|
13
|
+
import(`../../locales/${locale}.js`).catch(() => ({ templates: {} })),
|
|
14
|
+
// lit-localize only calls this with an entry of `targetLocales`.
|
|
15
|
+
loadCalendarLocale(locale),
|
|
16
|
+
]).then(([messages]) => messages),
|
|
10
17
|
});
|
|
11
18
|
// Prevent full page reload on HMR - accept the module update
|
|
12
19
|
// This is stripped from production builds
|
|
@@ -9,12 +9,13 @@ import { DEFAULT_LOCATION_IMAGE } from "./constants.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export function getLocationImageURL({ baseURL, country = "", city = "", imageExtension, params, }) {
|
|
11
11
|
const query = params ? `?${new URLSearchParams(params).toString()}` : "";
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
// Country and city come from API data and can hold spaces, accents or a
|
|
13
|
+
// slash, so each is encoded as a single path segment.
|
|
14
|
+
if (country !== "" && city !== "") {
|
|
15
|
+
return `${baseURL}/${encodeURIComponent(country)}/${encodeURIComponent(city)}.${imageExtension}${query}`;
|
|
15
16
|
}
|
|
16
|
-
else if (country !== ""
|
|
17
|
-
return `${baseURL}/${country}.${imageExtension}${query}`;
|
|
17
|
+
else if (country !== "") {
|
|
18
|
+
return `${baseURL}/${encodeURIComponent(country)}.${imageExtension}${query}`;
|
|
18
19
|
}
|
|
19
20
|
else {
|
|
20
21
|
return `${baseURL}/${DEFAULT_LOCATION_IMAGE}${query}`;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structurally identical to the SDK's `CorasLogger`, with both methods
|
|
3
|
+
* required so callers never optional-chain. Core must not import from the SDK.
|
|
4
|
+
*/
|
|
5
|
+
export type Logger = {
|
|
6
|
+
warn(message: string, data?: unknown): void;
|
|
7
|
+
error(error: unknown, data?: unknown): void;
|
|
8
|
+
};
|
|
9
|
+
export declare const NOOP_LOGGER: Logger;
|
|
10
|
+
/** Wraps a host logger whose methods are optional into a `Logger`. */
|
|
11
|
+
export declare function toLogger(input?: {
|
|
12
|
+
warn?: Logger["warn"];
|
|
13
|
+
error?: Logger["error"];
|
|
14
|
+
}): Logger;
|
|
15
|
+
export declare const loggerContext: {
|
|
16
|
+
__context__: Logger;
|
|
17
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createContext } from "@lit/context";
|
|
2
|
+
export const NOOP_LOGGER = {
|
|
3
|
+
warn() { },
|
|
4
|
+
error() { },
|
|
5
|
+
};
|
|
6
|
+
/** Wraps a host logger whose methods are optional into a `Logger`. */
|
|
7
|
+
export function toLogger(input) {
|
|
8
|
+
return {
|
|
9
|
+
warn: (message, data) => input?.warn?.(message, data),
|
|
10
|
+
error: (error, data) => input?.error?.(error, data),
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export const loggerContext = createContext(Symbol("logger-context"));
|