@asksable/site-connector 0.6.2 → 0.6.4
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 +18 -0
- package/dist/booking-widget.d.ts +13 -1
- package/dist/booking-widget.d.ts.map +1 -1
- package/dist/booking-widget.js +335 -54
- package/dist/booking-widget.js.map +1 -1
- package/dist/styles.css +107 -0
- package/dist/translations.d.ts +24 -0
- package/dist/translations.d.ts.map +1 -1
- package/dist/translations.js +24 -0
- package/dist/translations.js.map +1 -1
- package/dist/types.d.ts +14 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,12 +21,17 @@ import { SableSiteProvider } from '@asksable/site-connector'
|
|
|
21
21
|
config={{
|
|
22
22
|
apiUrl: import.meta.env.VITE_SABLE_PUBLIC_API_URL,
|
|
23
23
|
siteSlug: import.meta.env.VITE_SABLE_SITE_SLUG,
|
|
24
|
+
timezone: 'America/Chicago',
|
|
24
25
|
}}
|
|
25
26
|
>
|
|
26
27
|
<App />
|
|
27
28
|
</SableSiteProvider>
|
|
28
29
|
```
|
|
29
30
|
|
|
31
|
+
`timezone` is optional, but recommended for mobile/local-service sites. The
|
|
32
|
+
workspace timezone returned by Sable wins when configured; the host value is the
|
|
33
|
+
fallback before the widget considers browser or staff defaults.
|
|
34
|
+
|
|
30
35
|
## Website analytics
|
|
31
36
|
|
|
32
37
|
`SableSiteProvider` initializes PostHog automatically when the public
|
|
@@ -105,6 +110,19 @@ sends `intakeResponses` with the final booking.
|
|
|
105
110
|
/>
|
|
106
111
|
```
|
|
107
112
|
|
|
113
|
+
### Flexible Arrival Windows
|
|
114
|
+
|
|
115
|
+
For mobile services where the owner optimizes the route after customer intake,
|
|
116
|
+
enable flexible scheduling. Exact slots remain available, but the customer can
|
|
117
|
+
request a date plus an arrival window without taking a hard hold.
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
<BookingWidgetPanel
|
|
121
|
+
allowFlexibleScheduling
|
|
122
|
+
defaultSchedulingPreference="flexible"
|
|
123
|
+
/>
|
|
124
|
+
```
|
|
125
|
+
|
|
108
126
|
## Exports
|
|
109
127
|
|
|
110
128
|
- `createSablePublicClient`
|
package/dist/booking-widget.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './bones/registry.js';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
+
type SchedulingPreference = 'exact' | 'flexible';
|
|
3
4
|
/**
|
|
4
5
|
* Pre-existing context required by reschedule mode. The host (or the
|
|
5
6
|
* customer arriving via magic link) is moving an existing booking, so
|
|
@@ -83,6 +84,17 @@ type BookingWidgetProps = {
|
|
|
83
84
|
* service and configuration, e.g. an estimator's "Book this detail" CTA.
|
|
84
85
|
*/
|
|
85
86
|
initialSelection?: BookingInitialSelection;
|
|
87
|
+
/**
|
|
88
|
+
* Allow scheduled services to be requested as a flexible arrival window
|
|
89
|
+
* instead of forcing an exact slot hold. Existing hosts keep exact-slot
|
|
90
|
+
* booking unless they opt in.
|
|
91
|
+
*/
|
|
92
|
+
allowFlexibleScheduling?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Initial scheduling preference when flexible scheduling is enabled.
|
|
95
|
+
* Defaults to 'exact'.
|
|
96
|
+
*/
|
|
97
|
+
defaultSchedulingPreference?: SchedulingPreference;
|
|
86
98
|
/**
|
|
87
99
|
* Destination for the success-state CTA after a new booking is submitted.
|
|
88
100
|
* Defaults to the host site's home page so embedded sites don't trap the
|
|
@@ -107,6 +119,6 @@ type BookingWidgetProps = {
|
|
|
107
119
|
__devForceState?: 'success' | 'cancelled' | 'payment-full' | 'payment-deposit';
|
|
108
120
|
__devForceSuccess?: boolean;
|
|
109
121
|
};
|
|
110
|
-
export declare function BookingWidgetPanel({ title, description, mobileHeader, mode, rescheduleContext, onRescheduleSubmit, initialSelection, successRedirectHref, __devForceState, __devForceSuccess, }: BookingWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
122
|
+
export declare function BookingWidgetPanel({ title, description, mobileHeader, mode, rescheduleContext, onRescheduleSubmit, initialSelection, allowFlexibleScheduling, defaultSchedulingPreference, successRedirectHref, __devForceState, __devForceSuccess, }: BookingWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
111
123
|
export {};
|
|
112
124
|
//# sourceMappingURL=booking-widget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"booking-widget.d.ts","sourceRoot":"","sources":["../src/booking-widget.tsx"],"names":[],"mappings":"AAaA,OAAO,qBAAqB,CAAA;AAc5B,OAAO,KAAK,EAKV,SAAS,EACV,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"booking-widget.d.ts","sourceRoot":"","sources":["../src/booking-widget.tsx"],"names":[],"mappings":"AAaA,OAAO,qBAAqB,CAAA;AAc5B,OAAO,KAAK,EAKV,SAAS,EACV,MAAM,OAAO,CAAA;AAcd,KAAK,oBAAoB,GAAG,OAAO,GAAG,UAAU,CAAA;AA+EhD;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,EAAE,MAAM,CAAA;IACrB;;qBAEiB;IACjB,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;IACrB;qCACiC;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB;;sBAEkB;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;yCACqC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;oEACgE;IAChE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,0EAA0E;IAC1E,aAAa,CAAC,E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