bookito-widget 0.43.1 → 1.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +191 -7
- package/dist/bookito-widget.css +3 -0
- package/dist/bookito-widget.iife.js +112 -0
- package/dist/bookito-widget.js +40173 -0
- package/dist/bookito-widget.umd.js +104 -1992
- package/dist/bookito-widget.window.js +104 -1992
- package/dist/src/app/i18n/index.d.ts +868 -0
- package/dist/src/app/i18n/locales/de.d.ts +86 -0
- package/dist/src/app/i18n/locales/en.d.ts +86 -0
- package/dist/src/app/i18n/locales/fr.d.ts +86 -0
- package/dist/src/app/i18n/locales/it.d.ts +86 -0
- package/dist/src/app/i18n/locales/pl.d.ts +86 -0
- package/dist/src/app/providers/BookitoWidgetRoot.vue.d.ts +8 -0
- package/dist/src/app/query/query-client.d.ts +2 -0
- package/dist/src/embed/global-api.d.ts +9 -0
- package/dist/src/embed/mount-registry.d.ts +10 -0
- package/dist/src/embed/mount.d.ts +12 -0
- package/dist/src/embed/open-modal.d.ts +11 -0
- package/dist/src/embed/shadow-dom.d.ts +5 -0
- package/dist/src/embed/vue-plugin.d.ts +14 -0
- package/dist/src/embed.d.ts +1 -0
- package/dist/src/features/booking-flow/api/bookito-booking.client.d.ts +2 -0
- package/dist/src/features/booking-flow/api/bookito-booking.dto.d.ts +25 -0
- package/dist/src/features/booking-flow/api/bookito-booking.mutations.d.ts +2 -0
- package/dist/src/features/booking-flow/components/AnimatedSuccessCheckmark.vue.d.ts +2 -0
- package/dist/src/features/booking-flow/components/BookingCheckbox.vue.d.ts +11 -0
- package/dist/src/features/booking-flow/components/BookingDetailsDateOfBirthInput.vue.d.ts +10 -0
- package/dist/src/features/booking-flow/components/BookingDetailsDialCodePicker.vue.d.ts +11 -0
- package/dist/src/features/booking-flow/components/BookingDetailsDialCodePickerContent.vue.d.ts +9 -0
- package/dist/src/features/booking-flow/components/BookingDetailsField.vue.d.ts +20 -0
- package/dist/src/features/booking-flow/components/BookingDetailsLanguageSelect.vue.d.ts +9 -0
- package/dist/src/features/booking-flow/components/BookingDetailsPhoneInput.vue.d.ts +12 -0
- package/dist/src/features/booking-flow/components/BookingDetailsSection.vue.d.ts +30 -0
- package/dist/src/features/booking-flow/components/BookingDetailsTextInput.vue.d.ts +13 -0
- package/dist/src/features/booking-flow/components/BookingExtras.vue.d.ts +15 -0
- package/dist/src/features/booking-flow/components/BookingFlowNextButton.vue.d.ts +10 -0
- package/dist/src/features/booking-flow/components/BookingFlowPanel.vue.d.ts +7 -0
- package/dist/src/features/booking-flow/components/BookingFlowStepper.vue.d.ts +13 -0
- package/dist/src/features/booking-flow/components/BookingFlowSuccess.vue.d.ts +5 -0
- package/dist/src/features/booking-flow/components/BookingGuestChips.vue.d.ts +11 -0
- package/dist/src/features/booking-flow/components/BookingGuestsStep.vue.d.ts +15 -0
- package/dist/src/features/booking-flow/components/BookingParticipantCounter.vue.d.ts +13 -0
- package/dist/src/features/booking-flow/components/BookingTimeSection.vue.d.ts +24 -0
- package/dist/src/features/booking-flow/components/booking-flow.props.d.ts +31 -0
- package/dist/src/features/booking-flow/composables/create-booking-flow-api.d.ts +70 -0
- package/dist/src/features/booking-flow/composables/useBookingFlow.d.ts +52 -0
- package/dist/src/features/booking-flow/composables/useBookingFlowActions.d.ts +13 -0
- package/dist/src/features/booking-flow/composables/useBookingFlowActions.types.d.ts +31 -0
- package/dist/src/features/booking-flow/composables/useBookingFlowFormSync.d.ts +12 -0
- package/dist/src/features/booking-flow/composables/useBookingFlowWaitlist.d.ts +17 -0
- package/dist/src/features/booking-flow/composables/useBookingGuestsStepLabels.d.ts +26 -0
- package/dist/src/features/booking-flow/composables/useBookingTimeSectionState.d.ts +19 -0
- package/dist/src/features/booking-flow/composables/useBookingTimeSlots.d.ts +18 -0
- package/dist/src/features/booking-flow/lib/booking-calendar-bounds.d.ts +9 -0
- package/dist/src/features/booking-flow/lib/booking-details-flow.helpers.d.ts +11 -0
- package/dist/src/features/booking-flow/lib/booking-details.helpers.d.ts +26 -0
- package/dist/src/features/booking-flow/lib/booking-external-participant.helpers.d.ts +10 -0
- package/dist/src/features/booking-flow/lib/booking-flow-stepper.helpers.d.ts +17 -0
- package/dist/src/features/booking-flow/lib/booking-flow.actions.d.ts +34 -0
- package/dist/src/features/booking-flow/lib/booking-flow.helpers.d.ts +32 -0
- package/dist/src/features/booking-flow/lib/booking-participants.helpers.d.ts +4 -0
- package/dist/src/features/booking-flow/lib/booking-payload-label.helpers.d.ts +14 -0
- package/dist/src/features/booking-flow/lib/booking-payload.helpers.d.ts +11 -0
- package/dist/src/features/booking-flow/lib/booking-step-completion.helpers.d.ts +2 -0
- package/dist/src/features/booking-flow/lib/booking-time-slot-payload.helpers.d.ts +8 -0
- package/dist/src/features/booking-flow/lib/filter-phone-dial-codes.d.ts +2 -0
- package/dist/src/features/booking-flow/lib/format-booking-time-slot-label.d.ts +13 -0
- package/dist/src/features/booking-flow/lib/phone-dial-code-countries.data.d.ts +2 -0
- package/dist/src/features/booking-flow/lib/phone-dial-codes.d.ts +6 -0
- package/dist/src/features/booking-flow/lib/reset-booking-auth.helpers.d.ts +1 -0
- package/dist/src/features/booking-flow/lib/reset-booking-confirm-step.helpers.d.ts +2 -0
- package/dist/src/features/booking-flow/lib/resolve-booking-total-price.d.ts +10 -0
- package/dist/src/features/booking-flow/lib/resolve-booking-waitlist.d.ts +19 -0
- package/dist/src/features/booking-flow/model/booking-display-step.types.d.ts +6 -0
- package/dist/src/features/booking-flow/model/booking-form-date.helpers.d.ts +10 -0
- package/dist/src/features/booking-flow/model/booking-form-navigation.helpers.d.ts +2 -0
- package/dist/src/features/booking-flow/model/booking-form.types.d.ts +27 -0
- package/dist/src/features/bookito-settings/api/bookito-settings.client.d.ts +2 -0
- package/dist/src/features/bookito-settings/api/bookito-settings.keys.d.ts +4 -0
- package/dist/src/features/bookito-settings/api/bookito-settings.queries.d.ts +2 -0
- package/dist/src/features/bookito-settings/model/bookito-settings.types.d.ts +27 -0
- package/dist/src/features/event-feed/api/bookito-event-category.client.d.ts +4 -0
- package/dist/src/features/event-feed/api/bookito-event-category.dto.d.ts +11 -0
- package/dist/src/features/event-feed/api/bookito-event-category.queries.d.ts +9 -0
- package/dist/src/features/event-feed/api/bookito-event-modal-dates.helpers.d.ts +6 -0
- package/dist/src/features/event-feed/api/bookito-event.client.d.ts +5 -0
- package/dist/src/features/event-feed/api/bookito-event.dto.d.ts +102 -0
- package/dist/src/features/event-feed/api/bookito-event.keys.d.ts +7 -0
- package/dist/src/features/event-feed/api/bookito-event.mapper-helpers.d.ts +17 -0
- package/dist/src/features/event-feed/api/bookito-event.mapper-image.helpers.d.ts +2 -0
- package/dist/src/features/event-feed/api/bookito-event.mapper-variant.helpers.d.ts +3 -0
- package/dist/src/features/event-feed/api/bookito-event.mapper.d.ts +6 -0
- package/dist/src/features/event-feed/api/bookito-event.queries.d.ts +24 -0
- package/dist/src/features/event-feed/api/bookito-time-slots.queries.d.ts +9 -0
- package/dist/src/features/event-feed/components/BookitoWidget.vue.d.ts +5 -0
- package/dist/src/features/event-feed/components/EventFeed.vue.d.ts +21 -0
- package/dist/src/features/event-feed/components/EventFeedScrollControls.vue.d.ts +13 -0
- package/dist/src/features/event-feed/components/ExperienceCard.vue.d.ts +13 -0
- package/dist/src/features/event-feed/components/PoweredByCarlito.vue.d.ts +2 -0
- package/dist/src/features/event-feed/composables/useBookitoWidgetTheme.d.ts +2 -0
- package/dist/src/features/event-feed/composables/useEventFeedScroll.d.ts +8 -0
- package/dist/src/features/event-feed/lib/event-feed-date.utils.d.ts +15 -0
- package/dist/src/features/event-feed/lib/event-feed-item.helpers.d.ts +9 -0
- package/dist/src/features/event-feed/lib/event-feed-occurrence.helpers.d.ts +7 -0
- package/dist/src/features/event-feed/lib/event-feed.utils.d.ts +8 -0
- package/dist/src/features/event-feed/lib/resolve-localized-text.d.ts +2 -0
- package/dist/src/features/event-feed/model/widget.types.d.ts +96 -0
- package/dist/src/features/experience-detail/components/BookitoEventModal.vue.d.ts +14 -0
- package/dist/src/features/experience-detail/components/ExperienceDetailPanel.vue.d.ts +9 -0
- package/dist/src/features/experience-detail/components/ExperienceOverlay.vue.d.ts +16 -0
- package/dist/src/features/experience-detail/components/ExperienceOverlayContent.vue.d.ts +29 -0
- package/dist/src/features/experience-detail/components/ExperienceOverlayHeader.vue.d.ts +15 -0
- package/dist/src/features/experience-detail/composables/useExperienceOverlayBooking.d.ts +20 -0
- package/dist/src/features/experience-detail/lib/bookito-event-modal.helpers.d.ts +7 -0
- package/dist/src/features/experience-detail/lib/experience-booking-cancellation.helpers.d.ts +2 -0
- package/dist/src/features/experience-detail/lib/experience-booking-cutoff.helpers.d.ts +3 -0
- package/dist/src/features/experience-detail/lib/experience-booking-date.helpers.d.ts +3 -0
- package/dist/src/features/experience-detail/lib/experience-overlay.helpers.d.ts +3 -0
- package/dist/src/features/experience-detail/lib/resolve-experience-booking-availability.d.ts +39 -0
- package/dist/src/features/guest-auth/api/guest-auth.client.d.ts +2 -0
- package/dist/src/features/guest-auth/api/guest-auth.dto.d.ts +36 -0
- package/dist/src/features/guest-auth/api/guest-auth.mutations.d.ts +2 -0
- package/dist/src/features/guest-auth/lib/map-login-guests.d.ts +2 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/src/shared/api/api-config.d.ts +5 -0
- package/dist/src/shared/api/auth-tokens.d.ts +3 -0
- package/dist/src/shared/api/federation-client.d.ts +14 -0
- package/dist/src/shared/api/federation-errors.d.ts +9 -0
- package/dist/src/shared/api/graphql-client.d.ts +22 -0
- package/dist/src/shared/api/subdomain-parameter.d.ts +8 -0
- package/dist/src/shared/calendar/BookingCalendar.vue.d.ts +15 -0
- package/dist/src/shared/calendar/BookingCalendarGrid.vue.d.ts +8 -0
- package/dist/src/shared/calendar/BookingCalendarNavigation.vue.d.ts +17 -0
- package/dist/src/shared/calendar/calendar-date-key.d.ts +4 -0
- package/dist/src/shared/calendar/calendar-date-value.d.ts +11 -0
- package/dist/src/shared/calendar/calendar-date.types.d.ts +1 -0
- package/dist/src/shared/calendar/hotel-calendar-date.d.ts +10 -0
- package/dist/src/shared/calendar/index.d.ts +1 -0
- package/dist/src/shared/calendar/useBookingCalendarState.d.ts +29 -0
- package/dist/src/shared/config/languages.d.ts +3 -0
- package/dist/src/shared/lib/format-booking-price.d.ts +2 -0
- package/dist/src/shared/lib/is-ios-platform.d.ts +1 -0
- package/dist/src/shared/lib/map-language-to-intl-locale.d.ts +2 -0
- package/dist/src/shared/lib/normalize-widget-background-color.d.ts +1 -0
- package/dist/src/shared/lib/resolve-widget-title.d.ts +2 -0
- package/dist/src/shared/markdown/components/CarlitoMarkdownRenderer.vue.d.ts +8 -0
- package/dist/src/shared/markdown/components/PdfEmbed/PdfEmbed.vue.d.ts +6 -0
- package/dist/src/shared/markdown/components/PdfEmbed/PdfLoading.vue.d.ts +2 -0
- package/dist/src/shared/markdown/components/PdfEmbed/PdfRenderer.vue.d.ts +14 -0
- package/dist/src/shared/markdown/components/PdfEmbed/PdfViewer.vue.d.ts +38 -0
- package/dist/src/shared/markdown/components/PdfEmbed/PdfViewerError.vue.d.ts +5 -0
- package/dist/src/shared/markdown/components/PdfEmbed/composables/usePdfViewerState.d.ts +24 -0
- package/dist/src/shared/markdown/components/PdfEmbed/composables/useRenderPdf.d.ts +17 -0
- package/dist/src/shared/markdown/components/PdfEmbed/lib/pdf-canvas.d.ts +40 -0
- package/dist/src/shared/markdown/components/PdfEmbed/lib/pdf-render-watches.d.ts +15 -0
- package/dist/src/shared/markdown/has-meaningful-markdown-content.d.ts +5 -0
- package/dist/src/shared/markdown/process-markdown.d.ts +1 -0
- package/dist/src/shared/markdown/remark-center.d.ts +3 -0
- package/dist/src/shared/markdown/transform-markdown-url.d.ts +1 -0
- package/dist/src/shared/pdf/create-pdf-panzoom-session.d.ts +18 -0
- package/dist/src/shared/pdf/index.d.ts +5 -0
- package/dist/src/shared/pdf/pdf-panzoom.d.ts +14 -0
- package/dist/src/shared/pdf/pdfjs.d.ts +2 -0
- package/dist/src/shared/pdf/setup-pdf-panzoom-watches.d.ts +14 -0
- package/dist/src/shared/pdf/usePdfPanzoom.d.ts +6 -0
- package/dist/src/shared/pdf/usePdfPanzoom.types.d.ts +11 -0
- package/dist/src/shared/theme/theme-loader.d.ts +19 -0
- package/dist/src/shared/utils/cn.d.ts +2 -0
- package/dist/src/shared/utils/dom-events.d.ts +4 -0
- package/package.json +102 -4
- package/.babelrc +0 -12
- package/.eslintrc.json +0 -18
- package/CHANGELOG.md +0 -1931
- package/dist/1219.js +0 -1
- package/dist/1229.js +0 -2
- package/dist/1229.js.LICENSE.txt +0 -3
- package/dist/135.js +0 -2
- package/dist/135.js.LICENSE.txt +0 -3
- package/dist/1385.js +0 -2
- package/dist/1385.js.LICENSE.txt +0 -3
- package/dist/1421.js +0 -2
- package/dist/1421.js.LICENSE.txt +0 -3
- package/dist/1426.js +0 -2
- package/dist/1426.js.LICENSE.txt +0 -3
- package/dist/1428.js +0 -2
- package/dist/1428.js.LICENSE.txt +0 -3
- package/dist/1677.js +0 -2
- package/dist/1677.js.LICENSE.txt +0 -3
- package/dist/173.js +0 -2
- package/dist/173.js.LICENSE.txt +0 -3
- package/dist/1798.js +0 -2
- package/dist/1798.js.LICENSE.txt +0 -3
- package/dist/1813.js +0 -2
- package/dist/1813.js.LICENSE.txt +0 -3
- package/dist/2411.js +0 -2
- package/dist/2411.js.LICENSE.txt +0 -3
- package/dist/2782.js +0 -2
- package/dist/2782.js.LICENSE.txt +0 -3
- package/dist/2827.js +0 -2
- package/dist/2827.js.LICENSE.txt +0 -3
- package/dist/2939.js +0 -2
- package/dist/2939.js.LICENSE.txt +0 -3
- package/dist/3002.js +0 -2
- package/dist/3002.js.LICENSE.txt +0 -3
- package/dist/3140.js +0 -1
- package/dist/3rdpartylicenses.txt +0 -3609
- package/dist/4189.js +0 -2
- package/dist/4189.js.LICENSE.txt +0 -3
- package/dist/4194.js +0 -2
- package/dist/4194.js.LICENSE.txt +0 -3
- package/dist/4220.js +0 -2
- package/dist/4220.js.LICENSE.txt +0 -3
- package/dist/434.js +0 -2
- package/dist/434.js.LICENSE.txt +0 -3
- package/dist/4606.js +0 -2
- package/dist/4606.js.LICENSE.txt +0 -3
- package/dist/4614.js +0 -2
- package/dist/4614.js.LICENSE.txt +0 -3
- package/dist/5065.js +0 -2
- package/dist/5065.js.LICENSE.txt +0 -3
- package/dist/5090.js +0 -2
- package/dist/5090.js.LICENSE.txt +0 -3
- package/dist/5143.js +0 -2
- package/dist/5143.js.LICENSE.txt +0 -3
- package/dist/5309.js +0 -2
- package/dist/5309.js.LICENSE.txt +0 -3
- package/dist/5397.js +0 -2
- package/dist/5397.js.LICENSE.txt +0 -3
- package/dist/5427.js +0 -2
- package/dist/5427.js.LICENSE.txt +0 -3
- package/dist/5941.js +0 -2
- package/dist/5941.js.LICENSE.txt +0 -3
- package/dist/5956.js +0 -2
- package/dist/5956.js.LICENSE.txt +0 -3
- package/dist/6016.js +0 -2
- package/dist/6016.js.LICENSE.txt +0 -3
- package/dist/6250.js +0 -2
- package/dist/6250.js.LICENSE.txt +0 -3
- package/dist/6290.js +0 -2
- package/dist/6290.js.LICENSE.txt +0 -3
- package/dist/6335.js +0 -2
- package/dist/6335.js.LICENSE.txt +0 -3
- package/dist/6462.js +0 -2
- package/dist/6462.js.LICENSE.txt +0 -3
- package/dist/650.js +0 -2
- package/dist/650.js.LICENSE.txt +0 -3
- package/dist/6531.js +0 -2
- package/dist/6531.js.LICENSE.txt +0 -3
- package/dist/6878.js +0 -2
- package/dist/6878.js.LICENSE.txt +0 -3
- package/dist/6892.js +0 -2
- package/dist/6892.js.LICENSE.txt +0 -3
- package/dist/6979.js +0 -2
- package/dist/6979.js.LICENSE.txt +0 -3
- package/dist/7120.js +0 -2
- package/dist/7120.js.LICENSE.txt +0 -3
- package/dist/7149.js +0 -2
- package/dist/7149.js.LICENSE.txt +0 -3
- package/dist/7202.js +0 -2
- package/dist/7202.js.LICENSE.txt +0 -3
- package/dist/7213.js +0 -2
- package/dist/7213.js.LICENSE.txt +0 -3
- package/dist/7290.js +0 -2
- package/dist/7290.js.LICENSE.txt +0 -3
- package/dist/7373.js +0 -2
- package/dist/7373.js.LICENSE.txt +0 -3
- package/dist/7515.js +0 -2
- package/dist/7515.js.LICENSE.txt +0 -3
- package/dist/7797.js +0 -2
- package/dist/7797.js.LICENSE.txt +0 -3
- package/dist/7804.js +0 -2
- package/dist/7804.js.LICENSE.txt +0 -3
- package/dist/7813.js +0 -2
- package/dist/7813.js.LICENSE.txt +0 -3
- package/dist/7843.js +0 -2
- package/dist/7843.js.LICENSE.txt +0 -3
- package/dist/8199.js +0 -2
- package/dist/8199.js.LICENSE.txt +0 -3
- package/dist/821.js +0 -2
- package/dist/821.js.LICENSE.txt +0 -3
- package/dist/8365.js +0 -2
- package/dist/8365.js.LICENSE.txt +0 -3
- package/dist/8599.js +0 -2
- package/dist/8599.js.LICENSE.txt +0 -3
- package/dist/880.js +0 -2
- package/dist/880.js.LICENSE.txt +0 -3
- package/dist/8831.js +0 -2
- package/dist/8831.js.LICENSE.txt +0 -3
- package/dist/885.js +0 -2
- package/dist/885.js.LICENSE.txt +0 -3
- package/dist/9079.js +0 -2
- package/dist/9079.js.LICENSE.txt +0 -3
- package/dist/9104.js +0 -2
- package/dist/9104.js.LICENSE.txt +0 -3
- package/dist/9236.js +0 -2
- package/dist/9236.js.LICENSE.txt +0 -3
- package/dist/942.js +0 -2
- package/dist/942.js.LICENSE.txt +0 -3
- package/dist/9456.js +0 -2
- package/dist/9456.js.LICENSE.txt +0 -3
- package/dist/951.js +0 -2
- package/dist/951.js.LICENSE.txt +0 -3
- package/dist/9636.js +0 -2
- package/dist/9636.js.LICENSE.txt +0 -3
- package/dist/9742.js +0 -2
- package/dist/9742.js.LICENSE.txt +0 -3
- package/dist/9792.js +0 -2
- package/dist/9792.js.LICENSE.txt +0 -3
- package/dist/9875.js +0 -2
- package/dist/9875.js.LICENSE.txt +0 -3
- package/dist/Carlito.eot +0 -0
- package/dist/Carlito.svg +0 -321
- package/dist/Carlito.ttf +0 -0
- package/dist/Carlito.woff +0 -0
- package/dist/Carlito.woff2 +0 -0
- package/dist/bookito-widget.umd.js.LICENSE.txt +0 -128
- package/dist/bookito-widget.window.js.LICENSE.txt +0 -128
- package/dist/layers-2x.png +0 -0
- package/dist/layers.png +0 -0
- package/dist/marker-icon.png +0 -0
- package/e2e-tests/e2e.html +0 -77
- package/index.html +0 -92
- package/jest.config.ts +0 -9
- package/postcss.config.js +0 -3
- package/project.json +0 -72
- package/src/BookitoEventDetail/index.tsx +0 -101
- package/src/BookitoEventModal/ModalLoader.tsx +0 -43
- package/src/BookitoEventModal/index.tsx +0 -71
- package/src/BookitoForm/EventInfo.tsx +0 -68
- package/src/BookitoForm/FormSubmitButton/AnimatedSuccessCheckmark/index.module.css +0 -45
- package/src/BookitoForm/FormSubmitButton/AnimatedSuccessCheckmark/index.tsx +0 -24
- package/src/BookitoForm/FormSubmitButton/index.tsx +0 -58
- package/src/BookitoForm/NewBookingForm.tsx +0 -199
- package/src/BookitoWidget/index.tsx +0 -299
- package/src/BookitoWidgetProvider/BookitoWidgetProvider.tsx +0 -36
- package/src/Card/EmptyCard.tsx +0 -30
- package/src/Card/index.tsx +0 -103
- package/src/CardHolder/index.tsx +0 -32
- package/src/Modal/index.tsx +0 -34
- package/src/assets/carlito-logo.svg +0 -10
- package/src/calendar-styles.css +0 -22
- package/src/index.module.css +0 -27
- package/src/index.tsx +0 -166
- package/src/types.ts +0 -8
- package/src/utils/index.tsx +0 -7
- package/tailwind.config.js +0 -13
- package/tsconfig.json +0 -26
- package/tsconfig.lib.json +0 -23
- package/tsconfig.spec.json +0 -20
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { useBookitoSettings, useHotelDate } from '@carlito/api';
|
|
2
|
-
import { SupportedLanguages, useListLocalizedEvents } from '@carlito/bookito-client';
|
|
3
|
-
import BookitoEventDetail from '../BookitoEventDetail';
|
|
4
|
-
import Modal from '../Modal';
|
|
5
|
-
import ModalLoader from './ModalLoader';
|
|
6
|
-
|
|
7
|
-
export type BookitoEventModalProps = {
|
|
8
|
-
eventId: string;
|
|
9
|
-
language?: SupportedLanguages;
|
|
10
|
-
authId: string;
|
|
11
|
-
onCloseModal: () => void;
|
|
12
|
-
openModal: boolean;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
function BookitoEventModal(props: BookitoEventModalProps) {
|
|
16
|
-
const bookitoSettings = useBookitoSettings({
|
|
17
|
-
hotelId: props.authId,
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const daysBookableInAdvance = bookitoSettings.bookitoSettings?.daysBookableInAdvance ?? 90;
|
|
21
|
-
const toDate = useHotelDate({ days: daysBookableInAdvance });
|
|
22
|
-
|
|
23
|
-
const { data, isLoading } = useListLocalizedEvents(
|
|
24
|
-
{
|
|
25
|
-
authId: props.authId,
|
|
26
|
-
id: props.eventId,
|
|
27
|
-
toDate: toDate.toISOString(),
|
|
28
|
-
daysBookableInAdvance: daysBookableInAdvance.toString(),
|
|
29
|
-
resolveOccurrences: true,
|
|
30
|
-
},
|
|
31
|
-
props.openModal && Boolean(bookitoSettings.bookitoSettings)
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
const event = data?.events[0];
|
|
35
|
-
|
|
36
|
-
const firstAvailableDate = data?.availableOnDates?.[0]
|
|
37
|
-
? new Date(data?.availableOnDates?.[0])
|
|
38
|
-
: new Date();
|
|
39
|
-
|
|
40
|
-
// First server-resolved occurrence for this event (resolveOccurrences=true), used as the
|
|
41
|
-
// preselected occurrence in the booking form so no client RRULE runs.
|
|
42
|
-
const resolvedOccurrence = (() => {
|
|
43
|
-
if (!data?.dates) return undefined;
|
|
44
|
-
const sortedByDay = Object.entries(data.dates).sort(
|
|
45
|
-
([a], [b]) => new Date(a).getTime() - new Date(b).getTime()
|
|
46
|
-
);
|
|
47
|
-
for (const [, day] of sortedByDay) {
|
|
48
|
-
const occurrence = day.events.find((e) => e.id === props.eventId)?.occurrences?.[0];
|
|
49
|
-
if (occurrence) return occurrence;
|
|
50
|
-
}
|
|
51
|
-
return undefined;
|
|
52
|
-
})();
|
|
53
|
-
|
|
54
|
-
return props.openModal ? (
|
|
55
|
-
<Modal onCloseModal={props.onCloseModal}>
|
|
56
|
-
{isLoading && <ModalLoader />}
|
|
57
|
-
{data && event && (
|
|
58
|
-
<BookitoEventDetail
|
|
59
|
-
event={event}
|
|
60
|
-
date={firstAvailableDate}
|
|
61
|
-
authId={props.authId}
|
|
62
|
-
availableOnDates={data.availableOnDates || []}
|
|
63
|
-
isModalView={true}
|
|
64
|
-
resolvedOccurrence={resolvedOccurrence}
|
|
65
|
-
/>
|
|
66
|
-
)}
|
|
67
|
-
</Modal>
|
|
68
|
-
) : null;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export default BookitoEventModal;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { LocalizedEventData } from '@carlito/bookito-client';
|
|
3
|
-
import humanizeDuration, { SupportedLanguage } from 'humanize-duration';
|
|
4
|
-
import { Trans } from 'react-i18next';
|
|
5
|
-
import { formatPrice, useApp } from '@carlito/api';
|
|
6
|
-
|
|
7
|
-
export type Props = {
|
|
8
|
-
event: LocalizedEventData;
|
|
9
|
-
date: Date;
|
|
10
|
-
activeLanguage: SupportedLanguage;
|
|
11
|
-
isAllDay?: boolean;
|
|
12
|
-
overallDuration?: number | null;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
function EventInfo({ event, date: onDate, overallDuration, activeLanguage, isAllDay }: Props) {
|
|
16
|
-
const { hotelCurrency } = useApp();
|
|
17
|
-
const stringifiedDuration = humanizeDuration(overallDuration ?? 0, {
|
|
18
|
-
language: 'shortDe',
|
|
19
|
-
// fallbacks: ['en'],
|
|
20
|
-
languages: {
|
|
21
|
-
shortDe: {
|
|
22
|
-
y: () => 'y',
|
|
23
|
-
mo: () => 'mo',
|
|
24
|
-
w: () => 'w',
|
|
25
|
-
d: () => 'd',
|
|
26
|
-
h: () => 'h',
|
|
27
|
-
m: () => 'm',
|
|
28
|
-
s: () => 's',
|
|
29
|
-
ms: () => 'ms',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
units: ['h', 'm'],
|
|
33
|
-
maxDecimalPoints: 0,
|
|
34
|
-
delimiter: ' ',
|
|
35
|
-
} as any);
|
|
36
|
-
|
|
37
|
-
const price = event.basePrice?.amount || 0;
|
|
38
|
-
return (
|
|
39
|
-
<div className="flex justify-between items-start gap-2">
|
|
40
|
-
{price && price !== null ? (
|
|
41
|
-
<div>
|
|
42
|
-
<p className="font-bold text-base">
|
|
43
|
-
<Trans i18nKey="price" />
|
|
44
|
-
</p>
|
|
45
|
-
<p className="text-4xl font-bold">{formatPrice(price, activeLanguage, hotelCurrency)}</p>
|
|
46
|
-
</div>
|
|
47
|
-
) : (
|
|
48
|
-
<div />
|
|
49
|
-
)}
|
|
50
|
-
{overallDuration && (
|
|
51
|
-
<div className="text-right bookito-form__duration">
|
|
52
|
-
<p className="font-bold text-base">
|
|
53
|
-
<Trans i18nKey="duration" />
|
|
54
|
-
</p>
|
|
55
|
-
{isAllDay ? (
|
|
56
|
-
<p className="text-4xl font-normal">
|
|
57
|
-
<Trans i18nKey="all-day" />
|
|
58
|
-
</p>
|
|
59
|
-
) : (
|
|
60
|
-
<p className="text-4xl font-normal">{stringifiedDuration}</p>
|
|
61
|
-
)}
|
|
62
|
-
</div>
|
|
63
|
-
)}
|
|
64
|
-
</div>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export default EventInfo;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
.checkmark__circle {
|
|
2
|
-
stroke-dasharray: 166;
|
|
3
|
-
stroke-dashoffset: 166;
|
|
4
|
-
stroke-width: 2;
|
|
5
|
-
stroke-miterlimit: 10;
|
|
6
|
-
stroke: #7ac142;
|
|
7
|
-
fill: none;
|
|
8
|
-
animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
|
|
9
|
-
}
|
|
10
|
-
.checkmark {
|
|
11
|
-
width: 30px;
|
|
12
|
-
height: 30px;
|
|
13
|
-
border-radius: 50%;
|
|
14
|
-
display: block;
|
|
15
|
-
stroke-width: 2;
|
|
16
|
-
stroke: #fff;
|
|
17
|
-
stroke-miterlimit: 10;
|
|
18
|
-
box-shadow: inset 0px 0px 0px #7ac142;
|
|
19
|
-
animation: fill 0.4s ease-in-out 0.4s forwards, scale 0.3s ease-in-out 0.9s both;
|
|
20
|
-
}
|
|
21
|
-
.checkmark__check {
|
|
22
|
-
transform-origin: 50% 50%;
|
|
23
|
-
stroke-dasharray: 48;
|
|
24
|
-
stroke-dashoffset: 48;
|
|
25
|
-
animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
|
|
26
|
-
}
|
|
27
|
-
@keyframes stroke {
|
|
28
|
-
100% {
|
|
29
|
-
stroke-dashoffset: 0;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
@keyframes scale {
|
|
33
|
-
0%,
|
|
34
|
-
100% {
|
|
35
|
-
transform: none;
|
|
36
|
-
}
|
|
37
|
-
50% {
|
|
38
|
-
transform: scale3d(1.1, 1.1, 1);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
@keyframes fill {
|
|
42
|
-
100% {
|
|
43
|
-
box-shadow: inset 0px 0px 0px 30px #7ac142;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { cssModuleClassNames } from '@carlito/css';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import styles from './index.module.css';
|
|
4
|
-
|
|
5
|
-
const { getCssModuleClassName } = cssModuleClassNames(styles);
|
|
6
|
-
|
|
7
|
-
type Props = {
|
|
8
|
-
className?: string;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const AnimatedSuccessCheckmark = ({ className }: Props) => {
|
|
12
|
-
return (
|
|
13
|
-
<svg
|
|
14
|
-
className={classNames(className, getCssModuleClassName('checkmark'))}
|
|
15
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
-
viewBox="0 0 52 52"
|
|
17
|
-
>
|
|
18
|
-
<circle className={styles['checkmark__circle']} cx="26" cy="26" r="25" fill="none" />{' '}
|
|
19
|
-
<path className={styles['checkmark__check']} fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8" />
|
|
20
|
-
</svg>
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default AnimatedSuccessCheckmark;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { LoadingSpinner } from '@carlito/dashboard-ui';
|
|
2
|
-
import classnames from 'classnames';
|
|
3
|
-
import { ComponentProps, useEffect } from 'react';
|
|
4
|
-
import AnimatedSuccessCheckmark from './AnimatedSuccessCheckmark';
|
|
5
|
-
|
|
6
|
-
interface Props extends ComponentProps<'button'> {
|
|
7
|
-
loading?: boolean;
|
|
8
|
-
success?: boolean;
|
|
9
|
-
onSuccessAnimationEnd?: () => void;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const FormSubmitButton = ({
|
|
13
|
-
className,
|
|
14
|
-
success,
|
|
15
|
-
loading,
|
|
16
|
-
disabled,
|
|
17
|
-
children,
|
|
18
|
-
onSuccessAnimationEnd,
|
|
19
|
-
...btnProps
|
|
20
|
-
}: Props) => {
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
if (success) {
|
|
23
|
-
const timeout = setTimeout(() => {
|
|
24
|
-
onSuccessAnimationEnd?.();
|
|
25
|
-
}, 2000);
|
|
26
|
-
return () => clearTimeout(timeout);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return undefined;
|
|
30
|
-
}, [success, onSuccessAnimationEnd]);
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<div className="relative">
|
|
34
|
-
{success && <AnimatedSuccessCheckmark className="absolute left-2 top-2" />}
|
|
35
|
-
<button
|
|
36
|
-
type="submit"
|
|
37
|
-
id="product-tour-save"
|
|
38
|
-
disabled={loading || disabled}
|
|
39
|
-
className={classnames(
|
|
40
|
-
className,
|
|
41
|
-
{ 'bg-gray-300': disabled },
|
|
42
|
-
{
|
|
43
|
-
'bg-primary-default hover:bg-primary-tint focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-default':
|
|
44
|
-
!disabled,
|
|
45
|
-
},
|
|
46
|
-
{ 'cursor-not-allowed': loading },
|
|
47
|
-
'w-full flex justify-center items-center py-2 px-4 border border-transparent rounded-3xl shadow-sm text-lg font-extrabold text-primary-contrast'
|
|
48
|
-
)}
|
|
49
|
-
{...btnProps}
|
|
50
|
-
>
|
|
51
|
-
<div className="w-0">{loading && <LoadingSpinner className="h-5 w-5" />}</div>
|
|
52
|
-
<div className="w-full pl-3">{children}</div>
|
|
53
|
-
</button>
|
|
54
|
-
</div>
|
|
55
|
-
);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export default FormSubmitButton;
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
BookitoBookingFormValues,
|
|
4
|
-
BookitoEventBookingForm,
|
|
5
|
-
FormAlert,
|
|
6
|
-
QuantityPicker,
|
|
7
|
-
useBookingForm,
|
|
8
|
-
} from '@carlito/shared-ui';
|
|
9
|
-
import { analyticsEvent } from '@carlito/app-analytics';
|
|
10
|
-
import { SUPPORTED_LANGUAGE_CODES } from '@carlito/intl';
|
|
11
|
-
import { extractApiErrorCodes, LocalizedEventData } from '@carlito/bookito-client';
|
|
12
|
-
import { useGetHotelConfiguration } from '@carlito/hub-react';
|
|
13
|
-
import { Formik } from 'formik';
|
|
14
|
-
import EventInfo from './EventInfo';
|
|
15
|
-
import FormSubmitButton from './FormSubmitButton';
|
|
16
|
-
import { useTranslation } from 'react-i18next';
|
|
17
|
-
import { ResolvedOccurrence } from '../types';
|
|
18
|
-
|
|
19
|
-
function getUserLanguage() {
|
|
20
|
-
const browserLanguages = [...navigator.languages];
|
|
21
|
-
const selectedLanugage = SUPPORTED_LANGUAGE_CODES.find((availableLanguage) =>
|
|
22
|
-
browserLanguages.find((browserLanguage) => browserLanguage.includes(availableLanguage))
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
if (!selectedLanugage) {
|
|
26
|
-
return 'en';
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return selectedLanugage;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export type BookingFormProps = {
|
|
33
|
-
event: LocalizedEventData;
|
|
34
|
-
date: Date;
|
|
35
|
-
authId: string;
|
|
36
|
-
availableOnDates: string[];
|
|
37
|
-
shouldPreselectDateInCalendar?: boolean;
|
|
38
|
-
/** Server-resolved occurrence for the preselected date (resolveOccurrences=true). */
|
|
39
|
-
resolvedOccurrence?: ResolvedOccurrence;
|
|
40
|
-
timezone?: string;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export function BookingForm({
|
|
44
|
-
event,
|
|
45
|
-
date: onDate,
|
|
46
|
-
authId,
|
|
47
|
-
availableOnDates,
|
|
48
|
-
shouldPreselectDateInCalendar = true,
|
|
49
|
-
resolvedOccurrence,
|
|
50
|
-
timezone,
|
|
51
|
-
}: BookingFormProps) {
|
|
52
|
-
const userLanguage = getUserLanguage();
|
|
53
|
-
|
|
54
|
-
const { t } = useTranslation();
|
|
55
|
-
// Occurrence times come from the server-resolved occurrence (resolveOccurrences=true) —
|
|
56
|
-
// no client RRULE. When absent, the calendar simply isn't preselected.
|
|
57
|
-
const startDateTime = resolvedOccurrence ? new Date(resolvedOccurrence.startDateTime) : undefined;
|
|
58
|
-
const durationMs = resolvedOccurrence?.durationMs;
|
|
59
|
-
const isAllDay = resolvedOccurrence?.isAllDay;
|
|
60
|
-
const overallDuration =
|
|
61
|
-
(event?.timeBookability === 'custom'
|
|
62
|
-
? event?.timeBookabilitySettings?.timeBlockDurationMs
|
|
63
|
-
: durationMs) ?? undefined;
|
|
64
|
-
|
|
65
|
-
const initialValues: Partial<BookitoBookingFormValues> = useMemo(() => {
|
|
66
|
-
return {
|
|
67
|
-
bookedForDate: shouldPreselectDateInCalendar ? startDateTime : undefined,
|
|
68
|
-
participants: [
|
|
69
|
-
{
|
|
70
|
-
name: '',
|
|
71
|
-
email: '',
|
|
72
|
-
roomNr: '',
|
|
73
|
-
phoneNr: '',
|
|
74
|
-
isMainBooker: true,
|
|
75
|
-
isExternal: true,
|
|
76
|
-
communicationLanguage: userLanguage,
|
|
77
|
-
},
|
|
78
|
-
],
|
|
79
|
-
};
|
|
80
|
-
}, [shouldPreselectDateInCalendar, userLanguage]);
|
|
81
|
-
|
|
82
|
-
const form = useBookingForm({
|
|
83
|
-
initialEditData: initialValues,
|
|
84
|
-
eventId: event.id,
|
|
85
|
-
hotelId: authId,
|
|
86
|
-
bookingSource: 'web_widget',
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
const { state, actions } = form;
|
|
90
|
-
|
|
91
|
-
const onSuccessAnimationEnd = () => {
|
|
92
|
-
actions.resetMutation();
|
|
93
|
-
actions.resetCurrentStep();
|
|
94
|
-
actions.resetForm();
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const isTimeSlotEnabled =
|
|
98
|
-
event.timeBookability === 'custom' && !!event.timeBookabilitySettings?.timeBlockDurationMs;
|
|
99
|
-
|
|
100
|
-
return (
|
|
101
|
-
<Formik<BookitoBookingFormValues>
|
|
102
|
-
innerRef={state.formikRef}
|
|
103
|
-
initialValues={state.initialValues}
|
|
104
|
-
onSubmit={(values, formikHelpers) => actions.onSubmitBooking(values, formikHelpers)}
|
|
105
|
-
>
|
|
106
|
-
{(props) => {
|
|
107
|
-
const isDirty = props.dirty;
|
|
108
|
-
|
|
109
|
-
return (
|
|
110
|
-
<form
|
|
111
|
-
className="bookito-form flex mt-10 flex-col min-h-[65vh]"
|
|
112
|
-
onSubmit={props.handleSubmit}
|
|
113
|
-
>
|
|
114
|
-
<EventInfo
|
|
115
|
-
overallDuration={overallDuration}
|
|
116
|
-
isAllDay={isAllDay}
|
|
117
|
-
event={event}
|
|
118
|
-
date={onDate}
|
|
119
|
-
activeLanguage={props.values?.participants?.[0]?.communicationLanguage ?? 'en'}
|
|
120
|
-
/>
|
|
121
|
-
<div className="mt-12 flex flex-col">
|
|
122
|
-
<BookitoEventBookingForm
|
|
123
|
-
formStore={form}
|
|
124
|
-
handleSubmit={props.handleSubmit}
|
|
125
|
-
activeLanguage={userLanguage}
|
|
126
|
-
event={event}
|
|
127
|
-
hotelId={authId}
|
|
128
|
-
timezone={timezone}
|
|
129
|
-
isTimeSlotEnabled={isTimeSlotEnabled}
|
|
130
|
-
availableOnDates={availableOnDates}
|
|
131
|
-
renderQuantityControls={({
|
|
132
|
-
count,
|
|
133
|
-
onCountChange,
|
|
134
|
-
maxNumberOfAdditionalParticipants,
|
|
135
|
-
}) => (
|
|
136
|
-
<QuantityPicker
|
|
137
|
-
maxNumberOfAdditionalParticipants={maxNumberOfAdditionalParticipants}
|
|
138
|
-
count={count}
|
|
139
|
-
onCountChange={onCountChange}
|
|
140
|
-
/>
|
|
141
|
-
)}
|
|
142
|
-
renderError={({ fieldError, reset }) => {
|
|
143
|
-
const error = extractApiErrorCodes(state.error)?.map(t)?.join('\n') || fieldError;
|
|
144
|
-
return error ? (
|
|
145
|
-
<FormAlert
|
|
146
|
-
onClose={() => {
|
|
147
|
-
reset();
|
|
148
|
-
actions.resetMutation();
|
|
149
|
-
}}
|
|
150
|
-
title={t('error-while-booking')}
|
|
151
|
-
errors={[error]}
|
|
152
|
-
/>
|
|
153
|
-
) : (
|
|
154
|
-
''
|
|
155
|
-
);
|
|
156
|
-
}}
|
|
157
|
-
renderActionButton={({
|
|
158
|
-
buttonText,
|
|
159
|
-
dataTestId,
|
|
160
|
-
isLoading,
|
|
161
|
-
isDisabled,
|
|
162
|
-
onClick,
|
|
163
|
-
}) => (
|
|
164
|
-
<FormSubmitButton
|
|
165
|
-
disabled={isDisabled}
|
|
166
|
-
data-testid={dataTestId}
|
|
167
|
-
className={'min-w-[200px]'}
|
|
168
|
-
onClick={(e) => {
|
|
169
|
-
e.preventDefault();
|
|
170
|
-
onClick();
|
|
171
|
-
}}
|
|
172
|
-
loading={isLoading}
|
|
173
|
-
>
|
|
174
|
-
{buttonText}
|
|
175
|
-
</FormSubmitButton>
|
|
176
|
-
)}
|
|
177
|
-
renderSubmitButton={({ bookBtnContent, dataTestId, isDisabled }) => {
|
|
178
|
-
return (
|
|
179
|
-
<FormSubmitButton
|
|
180
|
-
data-testid={dataTestId}
|
|
181
|
-
onSuccessAnimationEnd={onSuccessAnimationEnd}
|
|
182
|
-
success={state.isSuccess}
|
|
183
|
-
loading={state.isLoading}
|
|
184
|
-
disabled={!isDirty || isDisabled || state.isLoading}
|
|
185
|
-
>
|
|
186
|
-
{bookBtnContent}
|
|
187
|
-
</FormSubmitButton>
|
|
188
|
-
);
|
|
189
|
-
}}
|
|
190
|
-
/>
|
|
191
|
-
</div>
|
|
192
|
-
</form>
|
|
193
|
-
);
|
|
194
|
-
}}
|
|
195
|
-
</Formik>
|
|
196
|
-
);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export default BookingForm;
|