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
package/src/index.tsx
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { SupportedLanguages } from '@carlito/bookito-client';
|
|
2
|
-
import { setupShadowDomStyle } from '@carlito/css';
|
|
3
|
-
import '@carlito/react-intl';
|
|
4
|
-
import { createRoot } from 'react-dom/client';
|
|
5
|
-
import BookitoEventModal, { BookitoEventModalProps } from './BookitoEventModal';
|
|
6
|
-
import BookitoWidget, { BookitoWidgetProps } from './BookitoWidget';
|
|
7
|
-
import { BookitoWidgetViewMode } from './types';
|
|
8
|
-
/**
|
|
9
|
-
Ensure that all CSS modules are imported here and included in the "additionalStyles" .This serves as a temporary solution to loading styles in the shadow root.
|
|
10
|
-
The alternative approach involves registering the style to global variable, but this method is currently not functioning as expected and requires further investigation.
|
|
11
|
-
* */
|
|
12
|
-
import AnimatedSuccessCheckmarkStyles from './BookitoForm/FormSubmitButton/AnimatedSuccessCheckmark/index.module.css';
|
|
13
|
-
import BookitoWidgetProvider from './BookitoWidgetProvider/BookitoWidgetProvider';
|
|
14
|
-
import reactCalendarStyles from './calendar-styles.css';
|
|
15
|
-
import styles from './index.module.css';
|
|
16
|
-
|
|
17
|
-
// Updated npm token configuration with granular access token (90 days)
|
|
18
|
-
console.log('🚀 Bookito Widget initialized! Visit https://carlito-app.com for more details!');
|
|
19
|
-
|
|
20
|
-
type InitializeBookitoWidget = {
|
|
21
|
-
container: HTMLElement | string;
|
|
22
|
-
customCss?: string;
|
|
23
|
-
} & BookitoWidgetProps;
|
|
24
|
-
|
|
25
|
-
type OpenBookitoEventModalArg = {
|
|
26
|
-
container?: HTMLElement | string;
|
|
27
|
-
onCloseModal?: () => void;
|
|
28
|
-
} & Omit<BookitoEventModalProps, 'openModal'>;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* This function is used to extract all styles from the shadow doms and insert them into the
|
|
32
|
-
* shadow dom of the widget. This is needed because the style-loader does not allow
|
|
33
|
-
* to mount styles more than once, which is super annoying and weird.
|
|
34
|
-
*/
|
|
35
|
-
function getStyleLoaderStyles() {
|
|
36
|
-
// Get all shadow roots
|
|
37
|
-
const shadowRoots = Array.from(document.querySelectorAll('*'))
|
|
38
|
-
.map((el) => el.shadowRoot)
|
|
39
|
-
.filter((root) => root != null) as ShadowRoot[];
|
|
40
|
-
|
|
41
|
-
// Search shadows and extract styles
|
|
42
|
-
const allStyles = shadowRoots
|
|
43
|
-
.map((root) => Array.from(root.querySelectorAll('style[data-style-loader]')))
|
|
44
|
-
.reduce((acc, tags) => {
|
|
45
|
-
return [...acc, ...tags.map((tag) => tag.innerHTML)];
|
|
46
|
-
}, [] as string[]);
|
|
47
|
-
|
|
48
|
-
if (allStyles.length === 0) {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const styleTag = document.createElement('style');
|
|
53
|
-
styleTag.setAttribute('data-style-loader', '');
|
|
54
|
-
styleTag.innerHTML = allStyles.join('');
|
|
55
|
-
|
|
56
|
-
return styleTag;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (typeof window !== 'undefined') {
|
|
60
|
-
const createRootElement = ({ container, ...props }: InitializeBookitoWidget): HTMLDivElement => {
|
|
61
|
-
const elem = typeof container === 'string' ? document.querySelector(container) : container;
|
|
62
|
-
if (!elem) {
|
|
63
|
-
throw new Error('No container defined!' + container);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (!props.authId) {
|
|
67
|
-
throw new Error('No auth id param defined!');
|
|
68
|
-
}
|
|
69
|
-
const shadowRoot = elem.shadowRoot ?? elem.attachShadow({ mode: 'open' });
|
|
70
|
-
const div = document.createElement('div');
|
|
71
|
-
div.style.fontFamily = 'var(--theme-font-family-sans)';
|
|
72
|
-
shadowRoot.append(div);
|
|
73
|
-
|
|
74
|
-
const stylesToInsert = getStyleLoaderStyles();
|
|
75
|
-
if (props.customCss) {
|
|
76
|
-
const styleElement = document.createElement('style');
|
|
77
|
-
styleElement.innerHTML = props.customCss;
|
|
78
|
-
shadowRoot.append(styleElement);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (stylesToInsert) {
|
|
82
|
-
// copy styles from style-loader
|
|
83
|
-
shadowRoot.append(stylesToInsert);
|
|
84
|
-
setupShadowDomStyle({
|
|
85
|
-
shadowRoot,
|
|
86
|
-
hotelId: props.authId,
|
|
87
|
-
additonalStyles: [reactCalendarStyles, AnimatedSuccessCheckmarkStyles],
|
|
88
|
-
}); //Todo: added this line as a temp fix to be able to load theme variables ,
|
|
89
|
-
} else {
|
|
90
|
-
setupShadowDomStyle({
|
|
91
|
-
shadowRoot,
|
|
92
|
-
hotelId: props.authId,
|
|
93
|
-
additonalStyles: [reactCalendarStyles, AnimatedSuccessCheckmarkStyles],
|
|
94
|
-
});
|
|
95
|
-
(styles as any).use({ target: shadowRoot });
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return div;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
const bookitoWidget = {
|
|
102
|
-
initialize({ ...props }: InitializeBookitoWidget) {
|
|
103
|
-
const rootElement = createRootElement(props);
|
|
104
|
-
createRoot(rootElement).render(
|
|
105
|
-
<BookitoWidgetProvider hotelId={props.authId} language={props?.language}>
|
|
106
|
-
<BookitoWidget {...props} />
|
|
107
|
-
</BookitoWidgetProvider>
|
|
108
|
-
);
|
|
109
|
-
},
|
|
110
|
-
openBookitoModal(props: OpenBookitoEventModalArg) {
|
|
111
|
-
const rootElement = createRootElement({
|
|
112
|
-
container: props.container ?? window.document.body,
|
|
113
|
-
...props,
|
|
114
|
-
});
|
|
115
|
-
const root = createRoot(rootElement);
|
|
116
|
-
root.render(
|
|
117
|
-
<BookitoWidgetProvider hotelId={props.authId} language={props?.language}>
|
|
118
|
-
<BookitoEventModal
|
|
119
|
-
openModal={true}
|
|
120
|
-
{...props}
|
|
121
|
-
onCloseModal={() => {
|
|
122
|
-
root.unmount();
|
|
123
|
-
rootElement.parentNode?.removeChild(rootElement);
|
|
124
|
-
props.onCloseModal && props.onCloseModal();
|
|
125
|
-
}}
|
|
126
|
-
/>
|
|
127
|
-
</BookitoWidgetProvider>
|
|
128
|
-
);
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
(window as any).bookitoWidget = bookitoWidget;
|
|
133
|
-
|
|
134
|
-
if (!customElements.get('bookito-widget')) {
|
|
135
|
-
class BookitoWidgetWebComponent extends HTMLElement {
|
|
136
|
-
private _container;
|
|
137
|
-
constructor() {
|
|
138
|
-
super();
|
|
139
|
-
|
|
140
|
-
this._container = this;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
connectedCallback() {
|
|
144
|
-
bookitoWidget.initialize({
|
|
145
|
-
container: this._container,
|
|
146
|
-
authId: this.getAttribute('auth-id') || '',
|
|
147
|
-
categoryId: this.getAttribute('category-id') || '',
|
|
148
|
-
title: this.getAttribute('title') || '',
|
|
149
|
-
language: this.getAttribute('language') as SupportedLanguages,
|
|
150
|
-
viewMode:
|
|
151
|
-
(this.getAttribute('viewMode') as BookitoWidgetViewMode) ||
|
|
152
|
-
(this.getAttribute('view-mode') as BookitoWidgetViewMode) ||
|
|
153
|
-
'Date',
|
|
154
|
-
customCss: this.getAttribute('custom-css') || this.getAttribute('customCss') || '',
|
|
155
|
-
excludeNonBookable: this.getAttribute('exclude-non-bookable') === 'true' || false,
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
customElements.define('bookito-widget', BookitoWidgetWebComponent);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export { BookitoEventModal, BookitoWidgetProvider };
|
|
165
|
-
export type { BookitoWidgetViewMode };
|
|
166
|
-
export default BookitoWidget;
|
package/src/types.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ConditionallyLocalizedListEventsResponse } from '@carlito/bookito-client';
|
|
2
|
-
|
|
3
|
-
export type BookitoWidgetViewMode = 'List' | 'Date';
|
|
4
|
-
|
|
5
|
-
/** Server-resolved occurrence (resolveOccurrences=true): `dates[].events[].occurrences[]`. */
|
|
6
|
-
export type ResolvedOccurrence = NonNullable<
|
|
7
|
-
ConditionallyLocalizedListEventsResponse<true>['dates'][string]['events'][number]['occurrences']
|
|
8
|
-
>[number];
|
package/src/utils/index.tsx
DELETED
package/tailwind.config.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const { createGlobPatternsForDependencies } = require('@nx/react/tailwind');
|
|
2
|
-
const { join } = require('path');
|
|
3
|
-
|
|
4
|
-
const taildwindBaseConfig = require('../../../tailwind.config');
|
|
5
|
-
|
|
6
|
-
/** @type {import('tailwindcss').Config} */
|
|
7
|
-
module.exports = {
|
|
8
|
-
...taildwindBaseConfig,
|
|
9
|
-
content: [
|
|
10
|
-
join(__dirname, '{src,pages,components}/**/*!(*.stories|*.spec).{ts,tsx,html}'),
|
|
11
|
-
...createGlobPatternsForDependencies(__dirname),
|
|
12
|
-
],
|
|
13
|
-
};
|
package/tsconfig.json
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"jsx": "react-jsx",
|
|
5
|
-
"allowJs": true,
|
|
6
|
-
"esModuleInterop": true,
|
|
7
|
-
"allowSyntheticDefaultImports": true,
|
|
8
|
-
"forceConsistentCasingInFileNames": true,
|
|
9
|
-
"strict": true,
|
|
10
|
-
"noImplicitOverride": true,
|
|
11
|
-
"noPropertyAccessFromIndexSignature": false,
|
|
12
|
-
"noImplicitReturns": true,
|
|
13
|
-
"noFallthroughCasesInSwitch": true,
|
|
14
|
-
"resolveJsonModule": true
|
|
15
|
-
},
|
|
16
|
-
"files": [],
|
|
17
|
-
"include": [],
|
|
18
|
-
"references": [
|
|
19
|
-
{
|
|
20
|
-
"path": "./tsconfig.lib.json"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"path": "./tsconfig.spec.json"
|
|
24
|
-
}
|
|
25
|
-
]
|
|
26
|
-
}
|
package/tsconfig.lib.json
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "../../../dist/out-tsc",
|
|
5
|
-
"types": ["node"]
|
|
6
|
-
},
|
|
7
|
-
"files": [
|
|
8
|
-
"../../../node_modules/@nx/react/typings/cssmodule.d.ts",
|
|
9
|
-
"../../../node_modules/@nx/react/typings/image.d.ts"
|
|
10
|
-
],
|
|
11
|
-
"exclude": [
|
|
12
|
-
"jest.config.ts",
|
|
13
|
-
"**/*.spec.ts",
|
|
14
|
-
"**/*.test.ts",
|
|
15
|
-
"**/*.spec.tsx",
|
|
16
|
-
"**/*.test.tsx",
|
|
17
|
-
"**/*.spec.js",
|
|
18
|
-
"**/*.test.js",
|
|
19
|
-
"**/*.spec.jsx",
|
|
20
|
-
"**/*.test.jsx"
|
|
21
|
-
],
|
|
22
|
-
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "../../../global.d.ts"]
|
|
23
|
-
}
|
package/tsconfig.spec.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "../../../dist/out-tsc",
|
|
5
|
-
"module": "commonjs",
|
|
6
|
-
"types": ["jest", "node"]
|
|
7
|
-
},
|
|
8
|
-
"include": [
|
|
9
|
-
"jest.config.ts",
|
|
10
|
-
"**/*.test.ts",
|
|
11
|
-
"**/*.spec.ts",
|
|
12
|
-
"**/*.test.tsx",
|
|
13
|
-
"**/*.spec.tsx",
|
|
14
|
-
"**/*.test.js",
|
|
15
|
-
"**/*.spec.js",
|
|
16
|
-
"**/*.test.jsx",
|
|
17
|
-
"**/*.spec.jsx",
|
|
18
|
-
"**/*.d.ts"
|
|
19
|
-
]
|
|
20
|
-
}
|