@ticketboothapp/booking 0.1.4 → 0.1.8
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/package.json +21 -1
- package/src/components/BookingDetails.tsx +546 -0
- package/src/components/BookingFlow.tsx +2952 -0
- package/src/components/BookingWidget.tsx +7 -5
- package/src/components/Calendar.tsx +906 -0
- package/src/components/CheckoutModal.tsx +294 -0
- package/src/components/CurrencySwitcher.tsx +81 -0
- package/src/components/ErrorBoundary.tsx +63 -0
- package/src/components/ItineraryBuilder.tsx +83 -0
- package/src/components/LanguageSwitcher.tsx +30 -0
- package/src/components/ManageBookingView.tsx +4 -2
- package/src/components/MealDrinkAddOnSelector.tsx +330 -0
- package/src/components/PickupLocationSelector.tsx +1541 -0
- package/src/components/PriceBreakdown.tsx +154 -0
- package/src/components/PriceSummary.tsx +211 -0
- package/src/components/PrivateShuttleBookingFlow.tsx +2290 -0
- package/src/components/ProductList.tsx +78 -0
- package/src/components/TermsAcceptance.tsx +110 -0
- package/src/components/WhatsAppPhoneInput.tsx +224 -0
- package/src/components/index.ts +31 -0
- package/src/contexts/CompanyContext.tsx +8 -20
- package/src/index.ts +5 -0
- package/src/lib/api.ts +801 -0
- package/src/lib/booking-ref.ts +13 -0
- package/src/lib/checkout-breakdown.test.ts +70 -0
- package/src/lib/checkout-breakdown.ts +69 -0
- package/src/lib/constants.ts +17 -0
- package/src/lib/currency.ts +88 -0
- package/src/lib/env.ts +10 -12
- package/src/lib/i18n/config.ts +21 -0
- package/src/lib/i18n/index.tsx +144 -0
- package/src/lib/i18n/messages/en.json +192 -0
- package/src/lib/i18n/messages/fr.json +192 -0
- package/src/lib/itinerary-labels.ts +70 -0
- package/src/lib/location-calculations.ts +43 -0
- package/src/lib/location-utils.ts +139 -0
- package/src/lib/map-utils.ts +153 -0
- package/src/lib/marker-icons.ts +113 -0
- package/src/lib/pickup-location-types.ts +25 -0
- package/src/lib/places-api.ts +154 -0
- package/src/lib/pricing.ts +466 -0
- package/src/lib/theme.ts +83 -0
- package/src/lib/utils.ts +9 -0
- package/src/types/google-maps.d.ts +2 -0
- package/tsconfig.json +8 -2
|
@@ -21,7 +21,8 @@ export interface BookingWidgetProps {
|
|
|
21
21
|
bookingSourceAttribution?: Partial<BookingSourceMetadata>;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
const getBookingHost = (): string =>
|
|
24
|
+
const getBookingHost = (): string =>
|
|
25
|
+
process.env.NEXT_PUBLIC_BOOKING_WIDGET_URL || 'https://viaviamorainelake.com';
|
|
25
26
|
|
|
26
27
|
export function BookingWidget({
|
|
27
28
|
initialProductId,
|
|
@@ -29,23 +30,23 @@ export function BookingWidget({
|
|
|
29
30
|
mode = 'standalone',
|
|
30
31
|
showLanguageSelector = true,
|
|
31
32
|
googleMapsApiKey,
|
|
32
|
-
flowUi,
|
|
33
33
|
bookingSourceAttribution,
|
|
34
34
|
}: BookingWidgetProps) {
|
|
35
35
|
const src = useMemo(() => {
|
|
36
|
-
|
|
36
|
+
// Route directly to customer booking (not partner portal root).
|
|
37
|
+
const url = new URL('/offers', getBookingHost());
|
|
37
38
|
if (initialProductId) url.searchParams.set('productId', initialProductId);
|
|
38
39
|
if (!showLanguageSelector) url.searchParams.set('showLanguageSelector', '0');
|
|
39
40
|
if (googleMapsApiKey) url.searchParams.set('gmapsKey', googleMapsApiKey);
|
|
40
41
|
if (mode) url.searchParams.set('embedMode', mode);
|
|
41
|
-
if (flowUi?.partnerDeferredInvoice) url.searchParams.set('partnerDeferredInvoice', '1');
|
|
42
42
|
if (bookingSourceAttribution?.utmSource) url.searchParams.set('utm_source', bookingSourceAttribution.utmSource);
|
|
43
43
|
if (bookingSourceAttribution?.utmCampaign) url.searchParams.set('utm_campaign', bookingSourceAttribution.utmCampaign);
|
|
44
44
|
if (bookingSourceAttribution?.utmMedium) url.searchParams.set('utm_medium', bookingSourceAttribution.utmMedium);
|
|
45
45
|
if (bookingSourceAttribution?.partnerId) url.searchParams.set('partnerId', bookingSourceAttribution.partnerId);
|
|
46
46
|
if (bookingSourceAttribution?.agentId) url.searchParams.set('agentId', bookingSourceAttribution.agentId);
|
|
47
|
+
if (bookingSourceAttribution?.agentName) url.searchParams.set('agentName', bookingSourceAttribution.agentName);
|
|
47
48
|
return url.toString();
|
|
48
|
-
}, [bookingSourceAttribution,
|
|
49
|
+
}, [bookingSourceAttribution, googleMapsApiKey, initialProductId, mode, showLanguageSelector]);
|
|
49
50
|
|
|
50
51
|
const frameStyle: CSSProperties = {
|
|
51
52
|
width: '100%',
|
|
@@ -61,3 +62,4 @@ export function BookingWidget({
|
|
|
61
62
|
</div>
|
|
62
63
|
);
|
|
63
64
|
}
|
|
65
|
+
|