@asksable/site-connector 0.6.1 → 0.6.3

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 CHANGED
@@ -94,6 +94,8 @@ sends `intakeResponses` with the final booking.
94
94
  initialSelection={{
95
95
  serviceSlug: 'interior-detailing',
96
96
  customerNotes: 'Estimate shown: $199',
97
+ quotedTotalCents: 19900,
98
+ quotedTotalLabel: '$199',
97
99
  intakeResponses: {
98
100
  vehicle_size: 'large',
99
101
  pet_hair: 'minimal',
@@ -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
@@ -43,6 +44,14 @@ export type BookingInitialSelection = {
43
44
  * page before the customer lands in the booking widget.
44
45
  */
45
46
  intakeResponses?: Record<string, unknown>;
47
+ /**
48
+ * Optional cents total calculated by the host before the customer enters the
49
+ * widget. If omitted, the widget falls back to
50
+ * `intakeResponses.estimate_cents` for backwards compatibility.
51
+ */
52
+ quotedTotalCents?: number;
53
+ /** Optional display label for the host estimate, e.g. "from $229". */
54
+ quotedTotalLabel?: string;
46
55
  };
47
56
  type BookingWidgetProps = {
48
57
  title?: string;
@@ -75,6 +84,17 @@ type BookingWidgetProps = {
75
84
  * service and configuration, e.g. an estimator's "Book this detail" CTA.
76
85
  */
77
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;
78
98
  /**
79
99
  * Destination for the success-state CTA after a new booking is submitted.
80
100
  * Defaults to the host site's home page so embedded sites don't trap the
@@ -99,6 +119,6 @@ type BookingWidgetProps = {
99
119
  __devForceState?: 'success' | 'cancelled' | 'payment-full' | 'payment-deposit';
100
120
  __devForceSuccess?: boolean;
101
121
  };
102
- 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;
103
123
  export {};
104
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;AAuDd;;;;;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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