@wix/vibe-bookings-plugin 0.14.0 → 0.16.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/dist/index.cjs +90 -43
- package/dist/index.cjs.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -2976,30 +2976,39 @@ var getRouterFileContent = () => {
|
|
|
2976
2976
|
|
|
2977
2977
|
// Import route components and loaders
|
|
2978
2978
|
import { rootRouteLoader, WixServicesProvider } from '@/wix-verticals/react-pages/react-router/routes/root';
|
|
2979
|
-
import { ServiceListWrapper } from '@/components/bookings/ServiceListPage';
|
|
2980
|
-
import { ServiceDetails } from '@/components/bookings/ServiceDetails';
|
|
2981
|
-
import { TimeSlotListPage } from '@/components/bookings/TimeSlotListPage';
|
|
2982
|
-
import { BookingFormPage } from '@/components/bookings/BookingFormPage';
|
|
2983
|
-
import {
|
|
2984
|
-
import {
|
|
2979
|
+
import { ServiceListWrapper } from '@/components/bookings/pages/ServiceListPage';
|
|
2980
|
+
import { ServiceDetails } from '@/components/bookings/components/service-page/ServiceDetails';
|
|
2981
|
+
import { TimeSlotListPage } from '@/components/bookings/pages/TimeSlotListPage';
|
|
2982
|
+
import { BookingFormPage } from '@/components/bookings/pages/BookingFormPage';
|
|
2983
|
+
import { LocationSelectorPage } from '@/components/bookings/pages/LocationSelectorPage';
|
|
2984
|
+
import { loadServiceListServiceInitialData } from '@wix/bookings/services';
|
|
2985
|
+
import { useLoaderData } from 'react-router-dom';
|
|
2985
2986
|
|
|
2986
2987
|
// Service list route component
|
|
2987
2988
|
function ServiceListRoute() {
|
|
2988
2989
|
const { servicesListConfig } = useLoaderData<typeof serviceListLoader>();
|
|
2989
|
-
return <ServiceListWrapper servicesListConfig={servicesListConfig} servicePageRoute="/
|
|
2990
|
+
return <ServiceListWrapper servicesListConfig={servicesListConfig} servicePageRoute="/book-online/service" />;
|
|
2990
2991
|
}
|
|
2991
2992
|
|
|
2992
2993
|
// Service details route component
|
|
2993
2994
|
function ServiceDetailsRoute() {
|
|
2994
|
-
const {
|
|
2995
|
+
const { service, timeSlotListConfig, bookingFormId } = useLoaderData<typeof serviceDetailsLoader>();
|
|
2996
|
+
return <ServiceDetails
|
|
2997
|
+
service={service}
|
|
2998
|
+
timeSlotListConfig={timeSlotListConfig}
|
|
2999
|
+
bookingFormId={bookingFormId}
|
|
3000
|
+
/>;
|
|
3001
|
+
}
|
|
3002
|
+
|
|
3003
|
+
// Loader for service details route
|
|
3004
|
+
async function serviceDetailsLoader({ params }: { params: { serviceId: string } }) {
|
|
2995
3005
|
// Note: Load service data by serviceId and pass to ServiceDetails
|
|
2996
3006
|
// ServiceDetails requires a service object from @wix/auto_sdk_bookings_services
|
|
2997
3007
|
// Optionally load timeSlotListConfig and bookingFormId if needed
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
/>;
|
|
3008
|
+
const service = {/* load service by serviceId from params.serviceId */};
|
|
3009
|
+
const timeSlotListConfig = {/* optional: load time slot list config */};
|
|
3010
|
+
const bookingFormId = {/* optional: booking form ID */};
|
|
3011
|
+
return { service, timeSlotListConfig, bookingFormId };
|
|
3003
3012
|
}
|
|
3004
3013
|
|
|
3005
3014
|
// Time slot list route component
|
|
@@ -3014,32 +3023,48 @@ var getRouterFileContent = () => {
|
|
|
3014
3023
|
return <BookingFormPage formId={formId} additionalMetadata={additionalMetadata} />;
|
|
3015
3024
|
}
|
|
3016
3025
|
|
|
3026
|
+
// Location selector route component
|
|
3027
|
+
function LocationSelectorRoute() {
|
|
3028
|
+
const { service } = useLoaderData<typeof locationListLoader>();
|
|
3029
|
+
return <LocationSelectorPage service={service} />;
|
|
3030
|
+
}
|
|
3031
|
+
|
|
3017
3032
|
// Loader for service list route
|
|
3018
3033
|
async function serviceListLoader() {
|
|
3019
|
-
const servicesListConfig = await
|
|
3034
|
+
const servicesListConfig = await loadServiceListServiceInitialData({});
|
|
3020
3035
|
return { servicesListConfig };
|
|
3021
3036
|
}
|
|
3022
3037
|
|
|
3023
3038
|
// Loader for time slot list route
|
|
3024
|
-
async function timeSlotListLoader() {
|
|
3039
|
+
async function timeSlotListLoader({ params }: { params: { serviceId: string } }) {
|
|
3025
3040
|
// Note: Load time slot list config based on service or other criteria
|
|
3026
|
-
const timeSlotListConfig = {/* load time slot list config */};
|
|
3041
|
+
const timeSlotListConfig = {/* load time slot list config using params.serviceId */};
|
|
3027
3042
|
return { timeSlotListConfig };
|
|
3028
3043
|
}
|
|
3029
3044
|
|
|
3030
3045
|
// Loader for booking form route
|
|
3031
3046
|
async function bookingFormLoader() {
|
|
3032
|
-
// Note: Get form ID from route params or config
|
|
3033
|
-
|
|
3047
|
+
// Note: Get form ID from route params, context, or config
|
|
3048
|
+
// The booking form route doesn't have serviceId in the path, so load from context or booking service
|
|
3049
|
+
const formId = {/* get form ID from context or booking service */};
|
|
3034
3050
|
const additionalMetadata = {/* optional: additional metadata */};
|
|
3035
3051
|
return { formId, additionalMetadata };
|
|
3036
3052
|
}
|
|
3037
3053
|
|
|
3054
|
+
// Loader for location selector route
|
|
3055
|
+
async function locationListLoader({ params }: { params: { serviceId?: string } }) {
|
|
3056
|
+
// Note: Load service data by serviceId - LocationSelectorPage uses Service.Locations
|
|
3057
|
+
// which gets locations from the service object
|
|
3058
|
+
// If serviceId is not in route, load from context or booking service
|
|
3059
|
+
const service = {/* load service by serviceId from params or context */};
|
|
3060
|
+
return { service };
|
|
3061
|
+
}
|
|
3062
|
+
|
|
3038
3063
|
const router = createBrowserRouter(
|
|
3039
3064
|
[
|
|
3040
3065
|
{
|
|
3041
3066
|
path: '/',
|
|
3042
|
-
element: <Navigate to="/
|
|
3067
|
+
element: <Navigate to="/book-online" />,
|
|
3043
3068
|
},
|
|
3044
3069
|
{
|
|
3045
3070
|
element: (
|
|
@@ -3050,23 +3075,24 @@ var getRouterFileContent = () => {
|
|
|
3050
3075
|
loader: rootRouteLoader,
|
|
3051
3076
|
children: [
|
|
3052
3077
|
{
|
|
3053
|
-
path: '/
|
|
3078
|
+
path: '/book-online',
|
|
3054
3079
|
element: <ServiceListRoute />,
|
|
3055
|
-
loader: serviceListLoader,
|
|
3056
3080
|
},
|
|
3057
3081
|
{
|
|
3058
|
-
path: '/
|
|
3082
|
+
path: '/book-online/locations',
|
|
3083
|
+
element: <LocationSelectorRoute />,
|
|
3084
|
+
},
|
|
3085
|
+
{
|
|
3086
|
+
path: '/book-online/service/:serviceId',
|
|
3059
3087
|
element: <ServiceDetailsRoute />,
|
|
3060
3088
|
},
|
|
3061
3089
|
{
|
|
3062
|
-
path: '/
|
|
3090
|
+
path: '/book-online/time-selection/:serviceId',
|
|
3063
3091
|
element: <TimeSlotListRoute />,
|
|
3064
|
-
loader: timeSlotListLoader,
|
|
3065
3092
|
},
|
|
3066
3093
|
{
|
|
3067
|
-
path: '/
|
|
3094
|
+
path: '/book-online/booking-form',
|
|
3068
3095
|
element: <BookingFormRoute />,
|
|
3069
|
-
loader: bookingFormLoader,
|
|
3070
3096
|
},
|
|
3071
3097
|
],
|
|
3072
3098
|
},
|
|
@@ -3079,7 +3105,6 @@ var getRouterFileContent = () => {
|
|
|
3079
3105
|
export default function ReactRouterApp() {
|
|
3080
3106
|
return <RouterProvider router={router} />;
|
|
3081
3107
|
}
|
|
3082
|
-
|
|
3083
3108
|
`;
|
|
3084
3109
|
};
|
|
3085
3110
|
var getBookingsCodingInstructions = () => dedent_default`
|
|
@@ -3098,10 +3123,11 @@ ${getRouterFileContent()}
|
|
|
3098
3123
|
\`\`\`
|
|
3099
3124
|
|
|
3100
3125
|
it includes the following routes:
|
|
3101
|
-
- /
|
|
3102
|
-
- /
|
|
3103
|
-
- /
|
|
3104
|
-
- /
|
|
3126
|
+
- /book-online - a service list page displaying all available booking services (uses ServiceList component via ServiceListWrapper)
|
|
3127
|
+
- /book-online/service/:serviceId - a service details page for a specific booking service (uses Service, TimeSlotList, and BookingForm components via ServiceDetails)
|
|
3128
|
+
- /book-online/locations - a location selection page (uses Service.Locations and Location components via LocationSelectorPage)
|
|
3129
|
+
- /book-online/time-selection/:serviceId - a dedicated time slot selection page (uses TimeSlotList component via TimeSlotListPage)
|
|
3130
|
+
- /book-online/booking-form - a dedicated booking form page (uses BookingForm component via BookingFormPage)
|
|
3105
3131
|
|
|
3106
3132
|
The routes in the example router file are wrapped with:
|
|
3107
3133
|
|
|
@@ -3130,32 +3156,51 @@ ${getBookingsProviderLayout()}
|
|
|
3130
3156
|
|
|
3131
3157
|
# Available Bookings Components
|
|
3132
3158
|
|
|
3133
|
-
The bookings system provides the following components from \`@wix/
|
|
3159
|
+
The bookings system provides the following components from \`@wix/bookings/components\`:
|
|
3134
3160
|
|
|
3135
3161
|
1. **ServiceList** - Used for displaying a list of booking services
|
|
3136
3162
|
- Import: \`import { ServiceList } from '@wix/bookings/components';\`
|
|
3137
|
-
- Used in: Service list page (\`/
|
|
3163
|
+
- Used in: Service list page (\`/book-online\` route) via \`ServiceListWrapper\`
|
|
3138
3164
|
- Pattern: \`<ServiceList.Root>\` → \`<ServiceList.Services>\` → \`<ServiceList.ServiceRepeater>\`
|
|
3139
3165
|
- Example: \`<ServiceList.Root serviceListConfig={config}>\` with \`<ServiceList.ServiceRepeater>\` containing \`<Service.Name>\`, \`<Service.Description>\`, \`<Service.Price>\`
|
|
3140
3166
|
|
|
3141
3167
|
2. **Service** - Used for displaying individual service details
|
|
3142
|
-
- Import: \`import { Service } from '@wix/
|
|
3143
|
-
- Used in: Service details page (\`/
|
|
3168
|
+
- Import: \`import { Service } from '@wix/bookings/components';\`
|
|
3169
|
+
- Used in: Service details page (\`/book-online/service/:serviceId\` route) via \`ServiceDetails\`
|
|
3144
3170
|
- Pattern: \`<Service.Root service={service}>\` wrapping service components
|
|
3145
|
-
- Example: \`<Service.Name>\`, \`<Service.Description>\`, \`<Service.Price>\`, \`<Service.Raw>\`
|
|
3171
|
+
- Example: \`<Service.Name>\`, \`<Service.Description>\`, \`<Service.Price>\`, \`<Service.Raw>\`, \`<Service.Locations>\`
|
|
3146
3172
|
|
|
3147
3173
|
3. **TimeSlotList** - Used for displaying and selecting available time slots for booking
|
|
3148
|
-
- Import: \`import { TimeSlotList } from '@wix/
|
|
3174
|
+
- Import: \`import { TimeSlotList } from '@wix/bookings/components';\`
|
|
3149
3175
|
- Used in: Service details page for time slot selection
|
|
3150
3176
|
- Pattern: \`<TimeSlotList.Root config={config}>\` → \`<TimeSlotList.TimeSlots>\` → \`<TimeSlotList.TimeSlotRepeater>\`
|
|
3151
3177
|
- Example: \`<TimeSlotList.TimeSlot.StartDate>\`, \`<TimeSlotList.TimeSlot.Actions.Select>\`
|
|
3152
3178
|
|
|
3153
|
-
4. **
|
|
3154
|
-
- Import: \`import {
|
|
3179
|
+
4. **Location** - Used for displaying and selecting booking locations
|
|
3180
|
+
- Import: \`import { Location } from '@wix/bookings/components';\`
|
|
3181
|
+
- Used in: Location selector page (\`/book-online/locations\` route) via \`LocationSelectorPage\`
|
|
3182
|
+
- Pattern: Used within \`<Service.Locations>\` → \`<Service.Locations.List>\` → \`<Service.Locations.LocationRepeater>\`
|
|
3183
|
+
- Example: \`<Location.Name>\`, \`<Location.Address>\`, \`<Location.Phone>\`, \`<Location.Email>\`, \`<Location.Actions.Select>\`
|
|
3184
|
+
- Note: Location components are used within Service.Locations.LocationRepeater, which automatically provides location context
|
|
3185
|
+
|
|
3186
|
+
5. **BookingForm** - Used for the booking form to complete a reservation
|
|
3187
|
+
- Import: \`import { BookingForm } from '@wix/bookings/components';\`
|
|
3155
3188
|
- Used in: Service details page for completing bookings
|
|
3156
3189
|
- Pattern: \`<BookingForm.Root formId={formId}>\` with automatic form rendering
|
|
3157
3190
|
- Example: \`<BookingForm.Root formId="form-id" />\` - renders form fields automatically
|
|
3158
3191
|
|
|
3192
|
+
## The flow
|
|
3193
|
+
|
|
3194
|
+
The flow of the bookings system is as follows:
|
|
3195
|
+
1. The user clicks the book now button
|
|
3196
|
+
2. If the user has multiple locations, the user selects a location
|
|
3197
|
+
3. The user selects a service
|
|
3198
|
+
4. The user selects the staff member
|
|
3199
|
+
5. The user selects a time slot
|
|
3200
|
+
6. The user fills out the booking form
|
|
3201
|
+
7. The user confirms the booking
|
|
3202
|
+
8. The user is redirected to the checkout page
|
|
3203
|
+
|
|
3159
3204
|
<important_component_notes>
|
|
3160
3205
|
<strong>ALL BOOKINGS COMPONENTS ARE ALREADY IMPLEMENTED IN SIMPLIFIED FORM FOLLOWING HEADLESS-COMPONENTS PATTERNS.</strong>
|
|
3161
3206
|
<strong>DO NOT REIMPLEMENT THESE COMPONENTS - USE THE EXISTING BOOKINGS COMPONENTS AS PROVIDED.</strong>
|
|
@@ -3171,9 +3216,10 @@ The bookings system provides the following components from \`@wix/headless-booki
|
|
|
3171
3216
|
IF AND ONLY IF THE USER ASKS FOR A NON ENGLISH LANGUAGE, YOU MUST TRANSLATE THE FOLLOWING COMPONENTS:
|
|
3172
3217
|
|
|
3173
3218
|
\`\`\`bash
|
|
3174
|
-
src/components/bookings/
|
|
3219
|
+
src/components/bookings/pages/
|
|
3175
3220
|
├── ServiceListPage.tsx
|
|
3176
|
-
├──
|
|
3221
|
+
├── ServicePage.tsx
|
|
3222
|
+
├── LocationSelectorPage.tsx
|
|
3177
3223
|
├── TimeSlotListPage.tsx
|
|
3178
3224
|
└── BookingFormPage.tsx
|
|
3179
3225
|
\`\`\`
|
|
@@ -3185,12 +3231,13 @@ IF THE SITE IS IN ENGLISH OR THE LANGUAGE IS NOT SPECIFIED, YOU MUST NOT READ OR
|
|
|
3185
3231
|
# THIRD TASK: CODE THE REST OF THE SITE PAGES
|
|
3186
3232
|
|
|
3187
3233
|
<important_notes>
|
|
3234
|
+
<strong>IT IS OF UTMOST IMPORTANCE THAT THE BOOKINGS PROVIDER IS INTEGRATED INTO THE SITE LAYOUT.</strong>
|
|
3188
3235
|
<strong>ALL BOOKINGS FEATURES ARE ALREADY IMPLEMENTED BY THE BOOKINGS ROUTES, THEY DO NOT INCLUDE HEADER FOOTER OR ANY OTHER LAYOUT COMPONENTS.</strong>
|
|
3189
3236
|
<strong>THE REST OF THE SITE PAGES SHOULD BE IMPLEMENTED AS USUAL ACCORDING TO THE PLAN AND USER REQUESTS, FOLLOWING THE OTHER INSTRUCTIONS IN THE CONTEXT.</strong>
|
|
3190
3237
|
<strong>NEVER IMPLEMENT CMS-BASED PAGES LIKE "GALLERY" OR "GALLERY ITEM" OR ANY OTHER CMS BASED PAGES FOR BOOKINGS FEATURES LIKE SERVICES OR ANY OTHER BOOKING FEATURES - ONLY USE THE BOOKINGS ROUTES AND SERVICES TO IMPLEMENT THE BOOKINGS FEATURES !!!</strong>
|
|
3191
3238
|
<strong>DO NOT IMPLEMENT A "FEATURED SERVICES" OR "FEATURED BOOKINGS" SECTIONS OR PAGES OR TRY TO LINK TO SPECIFIC SERVICES IN ANY PAGE - BECAUSE YOU DO NOT KNOW THE URL FOR THE SERVICES - JUST LINK TO THE BOOKINGS PAGE.</strong>
|
|
3192
3239
|
<strong>DO NOT USE MOCK DATA FOR SERVICES OR ANY OTHER DATA IN THE HOME PAGE OR ANY OTHER PAGE. ALWAYS LINK TO THE BOOKINGS PAGE.</strong>
|
|
3193
|
-
<strong>DO NOT TRY TO GUESS <code>
|
|
3240
|
+
<strong>DO NOT TRY TO GUESS <code>book-online/service/:serviceId</code> OR OTHER BOOKING ROUTES, ONLY INCLUDE A MENU ITEM TO THE BOOKINGS PAGE <code>/book-online</code>.</strong>
|
|
3194
3241
|
<strong>DO NOT IMPLEMENT BOOKINGS SEARCH YOURSELF - NO BOOKINGS SEARCH BAR OR ANY OTHER BOOKINGS SEARCH FEATURES</strong>
|
|
3195
3242
|
<strong>DO NOT EDIT or READ ANY FILE in <code>./src/wix-verticals/</code> USE EVERYTHING AS IS, ONLY INTEGRATE THE ROUTER!! with the exception of non-english sites, in this case, you are allowed to change the static text to match the new language.</strong>
|
|
3196
3243
|
</important_notes>
|
|
@@ -9731,7 +9778,7 @@ var onServiceCreated2 = createEventModule(onServiceCreated);
|
|
|
9731
9778
|
var onServiceDeleted2 = createEventModule(onServiceDeleted);
|
|
9732
9779
|
var onServiceUpdated2 = createEventModule(onServiceUpdated);
|
|
9733
9780
|
|
|
9734
|
-
//
|
|
9781
|
+
// node_modules/@wix/auto_sdk_bookings_staff-members/build/es/index.mjs
|
|
9735
9782
|
var es_exports2 = {};
|
|
9736
9783
|
__export(es_exports2, {
|
|
9737
9784
|
AggregationType: () => AggregationType2,
|