@flamingo-stack/openframe-frontend-core 0.0.671 → 0.0.672-snapshot.20260928034232
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/chat-protocol/card-marker.d.ts +12 -0
- package/dist/chat-protocol/card-marker.d.ts.map +1 -1
- package/dist/chat-protocol/index.cjs +17 -0
- package/dist/chat-protocol/index.cjs.map +1 -1
- package/dist/chat-protocol/index.d.ts +1 -0
- package/dist/chat-protocol/index.d.ts.map +1 -1
- package/dist/chat-protocol/index.js +15 -1
- package/dist/chat-protocol/index.js.map +1 -1
- package/dist/{chunk-DAGKBFZN.cjs → chunk-26NSIJMT.cjs} +33 -33
- package/dist/{chunk-DAGKBFZN.cjs.map → chunk-26NSIJMT.cjs.map} +1 -1
- package/dist/{chunk-FUXUJSPP.cjs → chunk-3UDBK2YG.cjs} +1 -1
- package/dist/chunk-3UDBK2YG.cjs.map +1 -0
- package/dist/{chunk-XGXHHSDU.cjs → chunk-6QUKYN4K.cjs} +22 -22
- package/dist/{chunk-XGXHHSDU.cjs.map → chunk-6QUKYN4K.cjs.map} +1 -1
- package/dist/{chunk-SNNE34OP.js → chunk-BF7GZ6BS.js} +5 -5
- package/dist/{chunk-SJZPKIW6.cjs → chunk-DRURJCEY.cjs} +12 -12
- package/dist/{chunk-SJZPKIW6.cjs.map → chunk-DRURJCEY.cjs.map} +1 -1
- package/dist/{chunk-YIDNSRPL.cjs → chunk-G262S3Q5.cjs} +31 -31
- package/dist/{chunk-YIDNSRPL.cjs.map → chunk-G262S3Q5.cjs.map} +1 -1
- package/dist/{chunk-OG2BNJ2Q.cjs → chunk-HJ532KQR.cjs} +390 -375
- package/dist/chunk-HJ532KQR.cjs.map +1 -0
- package/dist/{chunk-K3O4D7LW.js → chunk-HRM6242Y.js} +4 -4
- package/dist/{chunk-BP542DGQ.cjs → chunk-IFQMIYFO.cjs} +55 -28
- package/dist/chunk-IFQMIYFO.cjs.map +1 -0
- package/dist/{chunk-IJIIL6WU.js → chunk-IG7M3XKX.js} +6 -6
- package/dist/{chunk-PQ7YC5Y6.js → chunk-II6ABVLK.js} +3 -3
- package/dist/{chunk-TLLTL6LB.js → chunk-JD4U7QMG.js} +1 -1
- package/dist/chunk-JD4U7QMG.js.map +1 -0
- package/dist/{chunk-ZRIVCLPR.js → chunk-JD5TKRCU.js} +1 -1
- package/dist/chunk-JD5TKRCU.js.map +1 -0
- package/dist/{chunk-XH4MRTZM.cjs → chunk-K365MY6G.cjs} +5 -5
- package/dist/{chunk-XH4MRTZM.cjs.map → chunk-K365MY6G.cjs.map} +1 -1
- package/dist/{chunk-EIAVE6SE.cjs → chunk-KV7W5T6U.cjs} +10 -10
- package/dist/{chunk-EIAVE6SE.cjs.map → chunk-KV7W5T6U.cjs.map} +1 -1
- package/dist/{chunk-II66XWU5.cjs → chunk-KYF5EONP.cjs} +3 -3
- package/dist/{chunk-II66XWU5.cjs.map → chunk-KYF5EONP.cjs.map} +1 -1
- package/dist/{chunk-D55IENZJ.cjs → chunk-LCMT2GZK.cjs} +1 -1
- package/dist/chunk-LCMT2GZK.cjs.map +1 -0
- package/dist/{chunk-STLBB6PF.js → chunk-LMUZZUYC.js} +35 -8
- package/dist/chunk-LMUZZUYC.js.map +1 -0
- package/dist/{chunk-FAJUQKWQ.cjs → chunk-N6TC6IPV.cjs} +76 -75
- package/dist/chunk-N6TC6IPV.cjs.map +1 -0
- package/dist/{chunk-RKUCK6MN.js → chunk-OGOMAK7B.js} +2 -2
- package/dist/{chunk-G64BNLDO.js → chunk-P4GUIOLP.js} +2 -2
- package/dist/{chunk-DUZEFACP.js → chunk-RRU46J3N.js} +3 -3
- package/dist/{chunk-DAWYS25M.cjs → chunk-THSIFQGS.cjs} +17 -17
- package/dist/{chunk-DAWYS25M.cjs.map → chunk-THSIFQGS.cjs.map} +1 -1
- package/dist/{chunk-6C6UUOH4.js → chunk-TTHBFT7Q.js} +8 -7
- package/dist/{chunk-6C6UUOH4.js.map → chunk-TTHBFT7Q.js.map} +1 -1
- package/dist/{chunk-YNGAJGYB.cjs → chunk-TZP2OXHG.cjs} +346 -6
- package/dist/chunk-TZP2OXHG.cjs.map +1 -0
- package/dist/{chunk-T3ACDOVD.cjs → chunk-U2H3C4NT.cjs} +7 -7
- package/dist/{chunk-T3ACDOVD.cjs.map → chunk-U2H3C4NT.cjs.map} +1 -1
- package/dist/{chunk-OYMOG544.js → chunk-UFMXQKVT.js} +5 -5
- package/dist/{chunk-NIYIK32F.js → chunk-UMTXGEPU.js} +19 -4
- package/dist/{chunk-NIYIK32F.js.map → chunk-UMTXGEPU.js.map} +1 -1
- package/dist/{chunk-3PVOF3IB.js → chunk-UTHZ7DLN.js} +343 -3
- package/dist/{chunk-3PVOF3IB.js.map → chunk-UTHZ7DLN.js.map} +1 -1
- package/dist/{chunk-YJWR7D6O.cjs → chunk-UXT5EK27.cjs} +3 -3
- package/dist/{chunk-YJWR7D6O.cjs.map → chunk-UXT5EK27.cjs.map} +1 -1
- package/dist/{chunk-UH3BL2OT.js → chunk-VK5737GE.js} +2 -2
- package/dist/{chunk-R22IA7MP.js → chunk-VKLM5UKG.js} +4 -4
- package/dist/{chunk-FHTNCWIP.js → chunk-X2DR3XNN.js} +5 -5
- package/dist/{chunk-GF5TSQ6C.cjs → chunk-YCYOZAB5.cjs} +10 -10
- package/dist/{chunk-GF5TSQ6C.cjs.map → chunk-YCYOZAB5.cjs.map} +1 -1
- package/dist/{chunk-4PVY4JJN.js → chunk-YWQVL5VJ.js} +3 -3
- package/dist/{chunk-PLG6LP7E.cjs → chunk-Z5K4IQZU.cjs} +49 -49
- package/dist/{chunk-PLG6LP7E.cjs.map → chunk-Z5K4IQZU.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +18 -17
- package/dist/components/case-studies/index.cjs.map +1 -1
- package/dist/components/case-studies/index.js +7 -6
- package/dist/components/case-studies/index.js.map +1 -1
- package/dist/components/case-studies/share-experience-section.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/contact/contact-form.d.ts +6 -1
- package/dist/components/contact/contact-form.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +6 -6
- package/dist/components/contact/index.js +5 -5
- package/dist/components/docs/index.cjs +9 -9
- package/dist/components/docs/index.js +8 -8
- package/dist/components/embeds/index.cjs +6 -6
- package/dist/components/embeds/index.js +5 -5
- package/dist/components/faq/index.cjs +6 -6
- package/dist/components/faq/index.js +5 -5
- package/dist/components/features/index.cjs +5 -5
- package/dist/components/features/index.js +4 -4
- package/dist/components/features/waitlist-form.d.ts +7 -2
- package/dist/components/features/waitlist-form.d.ts.map +1 -1
- package/dist/components/help-center-pages/index.cjs +77 -76
- package/dist/components/help-center-pages/index.cjs.map +1 -1
- package/dist/components/help-center-pages/index.js +17 -16
- package/dist/components/help-center-pages/index.js.map +1 -1
- package/dist/components/help-center-pages/trust-center-sections.d.ts.map +1 -1
- package/dist/components/index.cjs +43 -43
- package/dist/components/index.js +15 -15
- package/dist/components/meeting-scheduler/booking-form.d.ts +4 -1
- package/dist/components/meeting-scheduler/booking-form.d.ts.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +75 -40
- package/dist/components/meeting-scheduler/index.cjs.map +1 -1
- package/dist/components/meeting-scheduler/index.d.ts +5 -1
- package/dist/components/meeting-scheduler/index.d.ts.map +1 -1
- package/dist/components/meeting-scheduler/index.js +46 -11
- package/dist/components/meeting-scheduler/index.js.map +1 -1
- package/dist/components/navigation/index.cjs +8 -8
- package/dist/components/navigation/index.js +7 -7
- package/dist/components/onboarding-guides/index.cjs +8 -8
- package/dist/components/onboarding-guides/index.js +7 -7
- package/dist/components/tickets/help-center-create-form.d.ts.map +1 -1
- package/dist/components/tickets/index.cjs +9 -9
- package/dist/components/tickets/index.js +8 -8
- package/dist/components/ui/index.cjs +5 -5
- package/dist/components/ui/index.js +4 -4
- package/dist/contexts/endpoints-runtime-context.d.ts +5 -0
- package/dist/contexts/endpoints-runtime-context.d.ts.map +1 -1
- package/dist/contexts/index.cjs +2 -2
- package/dist/contexts/index.js +1 -1
- package/dist/hooks/index.cjs +5 -3
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +4 -2
- package/dist/hooks/use-form-rescue.d.ts +37 -0
- package/dist/hooks/use-form-rescue.d.ts.map +1 -0
- package/dist/index.cjs +53 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +52 -8
- package/dist/index.js.map +1 -1
- package/dist/utils/form-rescue.cjs +123 -0
- package/dist/utils/form-rescue.cjs.map +1 -0
- package/dist/utils/form-rescue.d.ts +105 -0
- package/dist/utils/form-rescue.d.ts.map +1 -0
- package/dist/utils/form-rescue.js +101 -0
- package/dist/utils/form-rescue.js.map +1 -0
- package/dist/utils/index.cjs +119 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +99 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +7 -1
- package/src/chat-protocol/__tests__/card-marker.test.ts +27 -1
- package/src/chat-protocol/card-marker.ts +24 -0
- package/src/chat-protocol/index.ts +3 -0
- package/src/components/case-studies/share-experience-section.tsx +1 -0
- package/src/components/contact/contact-form.tsx +38 -2
- package/src/components/features/waitlist-form.tsx +27 -2
- package/src/components/help-center-pages/trust-center-sections.tsx +1 -0
- package/src/components/meeting-scheduler/booking-form.tsx +14 -0
- package/src/components/meeting-scheduler/index.tsx +38 -3
- package/src/components/tickets/help-center-create-form.tsx +2 -0
- package/src/contexts/endpoints-runtime-context.tsx +5 -0
- package/src/hooks/__tests__/use-form-rescue.test.tsx +189 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/use-form-rescue.ts +315 -0
- package/src/utils/__tests__/form-rescue.test.ts +106 -0
- package/src/utils/form-rescue.ts +198 -0
- package/src/utils/index.ts +5 -0
- package/dist/chunk-BP542DGQ.cjs.map +0 -1
- package/dist/chunk-D55IENZJ.cjs.map +0 -1
- package/dist/chunk-FAJUQKWQ.cjs.map +0 -1
- package/dist/chunk-FUXUJSPP.cjs.map +0 -1
- package/dist/chunk-OG2BNJ2Q.cjs.map +0 -1
- package/dist/chunk-STLBB6PF.js.map +0 -1
- package/dist/chunk-TLLTL6LB.js.map +0 -1
- package/dist/chunk-YNGAJGYB.cjs.map +0 -1
- package/dist/chunk-ZRIVCLPR.js.map +0 -1
- /package/dist/{chunk-SNNE34OP.js.map → chunk-BF7GZ6BS.js.map} +0 -0
- /package/dist/{chunk-K3O4D7LW.js.map → chunk-HRM6242Y.js.map} +0 -0
- /package/dist/{chunk-IJIIL6WU.js.map → chunk-IG7M3XKX.js.map} +0 -0
- /package/dist/{chunk-PQ7YC5Y6.js.map → chunk-II6ABVLK.js.map} +0 -0
- /package/dist/{chunk-RKUCK6MN.js.map → chunk-OGOMAK7B.js.map} +0 -0
- /package/dist/{chunk-G64BNLDO.js.map → chunk-P4GUIOLP.js.map} +0 -0
- /package/dist/{chunk-DUZEFACP.js.map → chunk-RRU46J3N.js.map} +0 -0
- /package/dist/{chunk-OYMOG544.js.map → chunk-UFMXQKVT.js.map} +0 -0
- /package/dist/{chunk-UH3BL2OT.js.map → chunk-VK5737GE.js.map} +0 -0
- /package/dist/{chunk-R22IA7MP.js.map → chunk-VKLM5UKG.js.map} +0 -0
- /package/dist/{chunk-FHTNCWIP.js.map → chunk-X2DR3XNN.js.map} +0 -0
- /package/dist/{chunk-4PVY4JJN.js.map → chunk-YWQVL5VJ.js.map} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from 'react';
|
|
2
2
|
import { type BookingConfirmation, type MeetingAvailability, type MeetingBookingErrorCode, type MeetingHost } from '../../schemas/meeting-booking-schema';
|
|
3
|
+
import type { FormRescueFormId } from '../../utils/form-rescue';
|
|
3
4
|
import { type BookingFormProps } from './booking-form';
|
|
4
5
|
export interface HubSpotMeetingSchedulerProps {
|
|
5
6
|
/** Directory id of the meeting link (from the host's `/api/meetings` payload). */
|
|
@@ -72,6 +73,9 @@ export interface HubSpotMeetingSchedulerProps {
|
|
|
72
73
|
* can pass it across the RSC boundary where a component cannot.
|
|
73
74
|
*/
|
|
74
75
|
detailsFormProps?: Pick<BookingFormProps, 'fieldRows' | 'consent'>;
|
|
76
|
+
/** Form rescue (save the half-filled booking form for follow-up). OPT-IN:
|
|
77
|
+
* omitted or `null` saves nothing. */
|
|
78
|
+
rescueFormId?: FormRescueFormId | null;
|
|
75
79
|
}
|
|
76
80
|
type Step = 'slot' | 'details' | 'confirmed';
|
|
77
81
|
/** `onStageChange`'s value: a step, or the degraded box that replaces the flow. */
|
|
@@ -169,7 +173,7 @@ export declare function SchedulerDegradedCard({ flow, className, message, action
|
|
|
169
173
|
action?: ReactNode;
|
|
170
174
|
children?: ReactNode;
|
|
171
175
|
}): import("react").JSX.Element;
|
|
172
|
-
export declare function HubSpotMeetingScheduler({ meetingId, apiBaseUrl, initialAvailability, title, description, hosts, displayTimezone, fallbackUrl, onBack, onBooked, onStageChange, className, flow, detailsForm: DetailsForm, detailsFormProps, }: HubSpotMeetingSchedulerProps): import("react").JSX.Element;
|
|
176
|
+
export declare function HubSpotMeetingScheduler({ meetingId, apiBaseUrl, initialAvailability, title, description, hosts, displayTimezone, fallbackUrl, onBack, onBooked, onStageChange, className, flow, detailsForm: DetailsForm, detailsFormProps, rescueFormId, }: HubSpotMeetingSchedulerProps): import("react").JSX.Element;
|
|
173
177
|
export { BookingForm, BookingFormSkeleton, type BookingFormProps, type BookingFieldRow, type BookingFieldSlot, type BookingFormConsent, } from './booking-form';
|
|
174
178
|
export { MeetingSchedulerDirectory, MeetingSchedulerDirectoryRowSkeleton, type MeetingSchedulerDirectoryProps, } from './directory';
|
|
175
179
|
export type { MeetingAvailability, BookingConfirmation, MeetingBookingErrorCode, MeetingHost };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/meeting-scheduler/index.tsx"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/meeting-scheduler/index.tsx"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMtD,OAAO,EAIL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,WAAW,EACjB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,OAAO,EAA0D,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAwB/G,MAAM,WAAW,4BAA4B;IAC3C,kFAAkF;IAClF,SAAS,EAAE,MAAM,CAAC;IAClB,2FAA2F;IAC3F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,mEAAmE;IACnE,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;IACtB,sFAAsF;IACtF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yFAAyF;IACzF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC5C;;;;;OAKG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB;;;;;;;;;;;;;;;;;OAiBG;IACH,WAAW,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC9C;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,WAAW,GAAG,SAAS,CAAC,CAAC;IACnE;2CACuC;IACvC,YAAY,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACxC;AAED,KAAK,IAAI,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,CAAC;AAC7C,mFAAmF;AACnF,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,aAAa,CAAC;AA4ClD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,eAAO,MAAM,mBAAmB,qCAAqC,CAAC;AAEtE;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iCAAiC,kCAAkC,CAAC;AAEjF,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,eAAe,CAAC;AAE3D,4EAA4E;AAC5E,eAAO,MAAM,sBAAsB,EAAE,aAA4B,CAAC;AAElE;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CACzC,aAAa,EACb;IAAE,WAAW,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAStG,CAAC;AAqDF;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,IAA6B,EAC7B,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GACT,EAAE;IACD,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gHAAgH;IAChH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,+BAQA;AAqBD,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,EACT,UAAe,EACf,mBAAmB,EACnB,KAAK,EACL,WAAW,EACX,KAAK,EACL,eAAe,EACf,WAAW,EACX,MAAM,EACN,QAAQ,EACR,aAAa,EACb,SAAS,EACT,IAA6B,EAC7B,WAAW,EAAE,WAAyB,EACtC,gBAAgB,EAChB,YAAmB,GACpB,EAAE,4BAA4B,+BA8kB9B;AAKD,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,yBAAyB,EACzB,oCAAoC,EACpC,KAAK,8BAA8B,GACpC,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,WAAW,EAAE,CAAC;AAC/F,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC"}
|
|
@@ -24,14 +24,15 @@ import {
|
|
|
24
24
|
SelectTrigger,
|
|
25
25
|
SelectValue,
|
|
26
26
|
Textarea
|
|
27
|
-
} from "../../chunk-
|
|
27
|
+
} from "../../chunk-UMTXGEPU.js";
|
|
28
28
|
import "../../chunk-L2SLFCXP.js";
|
|
29
29
|
import "../../chunk-BJXDHKUX.js";
|
|
30
30
|
import {
|
|
31
|
+
useFormRescue,
|
|
31
32
|
useHumanitySignals,
|
|
32
33
|
useToast
|
|
33
|
-
} from "../../chunk-
|
|
34
|
-
import "../../chunk-
|
|
34
|
+
} from "../../chunk-UTHZ7DLN.js";
|
|
35
|
+
import "../../chunk-JD5TKRCU.js";
|
|
35
36
|
import "../../chunk-GRBZC5N3.js";
|
|
36
37
|
import {
|
|
37
38
|
contentFetch,
|
|
@@ -44,7 +45,7 @@ import {
|
|
|
44
45
|
} from "../../chunk-BXWXBBAC.js";
|
|
45
46
|
import {
|
|
46
47
|
useIsHydrated
|
|
47
|
-
} from "../../chunk-
|
|
48
|
+
} from "../../chunk-JD4U7QMG.js";
|
|
48
49
|
import "../../chunk-3T4GPKSB.js";
|
|
49
50
|
import "../../chunk-XXMHLZ3Y.js";
|
|
50
51
|
import "../../chunk-VQZXJIPY.js";
|
|
@@ -617,7 +618,8 @@ function BookingForm({
|
|
|
617
618
|
isSubmitting,
|
|
618
619
|
onSubmit,
|
|
619
620
|
honeypotInputProps,
|
|
620
|
-
getSignals
|
|
621
|
+
getSignals,
|
|
622
|
+
onValuesChange
|
|
621
623
|
}) {
|
|
622
624
|
const { formFields, legalConsent } = availability;
|
|
623
625
|
const supportedFields = useMemo(() => normalizeFormFields(formFields), [formFields]);
|
|
@@ -638,6 +640,7 @@ function BookingForm({
|
|
|
638
640
|
handleSubmit,
|
|
639
641
|
setValue,
|
|
640
642
|
getValues,
|
|
643
|
+
watch,
|
|
641
644
|
formState: { errors }
|
|
642
645
|
} = useForm({
|
|
643
646
|
resolver: zodResolver(schema),
|
|
@@ -672,6 +675,14 @@ function BookingForm({
|
|
|
672
675
|
{ shouldDirty: false }
|
|
673
676
|
);
|
|
674
677
|
}, [consentDefaults, priorConsents, getValues, setValue]);
|
|
678
|
+
useEffect(() => {
|
|
679
|
+
if (!onValuesChange) return void 0;
|
|
680
|
+
const subscription = watch((values, { name }) => {
|
|
681
|
+
const answers = values.formFields ?? {};
|
|
682
|
+
onValuesChange({ ...values, ...answers }, name ? name.replace(/^formFields\./, "") : null);
|
|
683
|
+
});
|
|
684
|
+
return () => subscription.unsubscribe();
|
|
685
|
+
}, [watch, onValuesChange]);
|
|
675
686
|
const submitValid = handleSubmit(async (data) => {
|
|
676
687
|
if (consentMissing) return;
|
|
677
688
|
if (deferSlot) {
|
|
@@ -1458,7 +1469,8 @@ function HubSpotMeetingScheduler({
|
|
|
1458
1469
|
className,
|
|
1459
1470
|
flow = DEFAULT_SCHEDULER_FLOW,
|
|
1460
1471
|
detailsForm: DetailsForm = BookingForm,
|
|
1461
|
-
detailsFormProps
|
|
1472
|
+
detailsFormProps,
|
|
1473
|
+
rescueFormId = null
|
|
1462
1474
|
}) {
|
|
1463
1475
|
const {
|
|
1464
1476
|
availability,
|
|
@@ -1507,6 +1519,26 @@ function HubSpotMeetingScheduler({
|
|
|
1507
1519
|
const [bookingError, setBookingError] = useState4(null);
|
|
1508
1520
|
const { honeypotInputProps, getSignals, resetSignals } = useHumanitySignals();
|
|
1509
1521
|
const { toast } = useToast();
|
|
1522
|
+
const rescueFieldNames = useMemo5(
|
|
1523
|
+
() => [
|
|
1524
|
+
...BUILT_IN_BOOKING_FIELDS.map((field) => field.name),
|
|
1525
|
+
...normalizeFormFields(availability?.formFields ?? []).map((field) => field.name)
|
|
1526
|
+
],
|
|
1527
|
+
[availability?.formFields]
|
|
1528
|
+
);
|
|
1529
|
+
const [restored, setRestored] = useState4(null);
|
|
1530
|
+
const rescue = useFormRescue({
|
|
1531
|
+
formId: rescueFormId,
|
|
1532
|
+
fieldNames: rescueFieldNames,
|
|
1533
|
+
getSignals,
|
|
1534
|
+
onRestore: (values) => {
|
|
1535
|
+
const { email, firstName, lastName, ...answers } = values;
|
|
1536
|
+
setRestored((prev) => ({
|
|
1537
|
+
version: (prev?.version ?? 0) + 1,
|
|
1538
|
+
values: { email: email ?? "", firstName: firstName ?? "", lastName: lastName ?? "", formFields: answers }
|
|
1539
|
+
}));
|
|
1540
|
+
}
|
|
1541
|
+
});
|
|
1510
1542
|
const autoAdvanceCount = useRef2(0);
|
|
1511
1543
|
const [machineFor, setMachineFor] = useState4(meetingId);
|
|
1512
1544
|
if (machineFor !== meetingId) {
|
|
@@ -1574,12 +1606,13 @@ function HubSpotMeetingScheduler({
|
|
|
1574
1606
|
async (payload) => {
|
|
1575
1607
|
const priorError = bookingError;
|
|
1576
1608
|
setBookingError(null);
|
|
1577
|
-
const result = await book(payload);
|
|
1609
|
+
const result = await book({ ...payload, ...rescue.submitFields() });
|
|
1578
1610
|
if (!result.ok && result.message === BOOKING_IN_FLIGHT_MESSAGE) {
|
|
1579
1611
|
setBookingError(priorError);
|
|
1580
1612
|
return;
|
|
1581
1613
|
}
|
|
1582
1614
|
if (result.ok && result.confirmation) {
|
|
1615
|
+
rescue.complete();
|
|
1583
1616
|
setConfirmation(result.confirmation);
|
|
1584
1617
|
setStep("confirmed");
|
|
1585
1618
|
onBooked?.(result.confirmation);
|
|
@@ -1604,7 +1637,7 @@ function HubSpotMeetingScheduler({
|
|
|
1604
1637
|
});
|
|
1605
1638
|
}
|
|
1606
1639
|
},
|
|
1607
|
-
[book, bookingError, detailsFirst, onBooked, refetchAvailability, resetSignals, toast]
|
|
1640
|
+
[book, bookingError, detailsFirst, onBooked, refetchAvailability, rescue, resetSignals, toast]
|
|
1608
1641
|
);
|
|
1609
1642
|
const escapeHatch = fallbackUrl ? /* @__PURE__ */ jsx6(Button, { variant: "outline", size: "small-legacy", href: fallbackUrl, openInNewTab: true, children: "Open in HubSpot" }) : null;
|
|
1610
1643
|
const backEdge = detailsFirst ? step === "slot" ? backToDetails : onBack : step === "details" ? backToSlot : onBack;
|
|
@@ -1692,12 +1725,14 @@ function HubSpotMeetingScheduler({
|
|
|
1692
1725
|
deferSlot: detailsFirst,
|
|
1693
1726
|
submitLabel: preset.submitLabel,
|
|
1694
1727
|
footerNote: preset.footerNote,
|
|
1695
|
-
initialValues: detailsFirst ? stash?.payload : void 0,
|
|
1728
|
+
initialValues: (detailsFirst ? stash?.payload : void 0) ?? restored?.values,
|
|
1696
1729
|
isSubmitting,
|
|
1697
1730
|
onSubmit: detailsFirst ? stashDetails : handleSubmit,
|
|
1698
1731
|
honeypotInputProps,
|
|
1699
|
-
getSignals
|
|
1700
|
-
|
|
1732
|
+
getSignals,
|
|
1733
|
+
onValuesChange: rescue.track
|
|
1734
|
+
},
|
|
1735
|
+
restored?.version ?? 0
|
|
1701
1736
|
)
|
|
1702
1737
|
] }) : /* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-[var(--spacing-system-m)] md:min-h-0 md:flex-1", children: [
|
|
1703
1738
|
bookingError === "SLOT_TAKEN" && /* @__PURE__ */ jsx6(
|