@flamingo-stack/openframe-frontend-core 0.0.594 → 0.0.595-snapshot.20260905150417

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.
Files changed (161) hide show
  1. package/dist/{chunk-HQWZ4IXU.cjs → chunk-3CH6VRJX.cjs} +24 -24
  2. package/dist/{chunk-HQWZ4IXU.cjs.map → chunk-3CH6VRJX.cjs.map} +1 -1
  3. package/dist/{chunk-LKN2KKYZ.js → chunk-4K7TCJ35.js} +6 -59
  4. package/dist/{chunk-LKN2KKYZ.js.map → chunk-4K7TCJ35.js.map} +1 -1
  5. package/dist/{chunk-YLVPQNLO.cjs → chunk-5MSHWXJ5.cjs} +170 -223
  6. package/dist/chunk-5MSHWXJ5.cjs.map +1 -0
  7. package/dist/{chunk-CCLPJSY3.cjs → chunk-73BECFSU.cjs} +15 -15
  8. package/dist/{chunk-CCLPJSY3.cjs.map → chunk-73BECFSU.cjs.map} +1 -1
  9. package/dist/{chunk-F5Q3DTP5.js → chunk-7EUE3YTC.js} +8 -8
  10. package/dist/{chunk-GBIC3VNA.js → chunk-7KGN7DV6.js} +6 -6
  11. package/dist/{chunk-YZLUOZKR.js → chunk-7Q66A4CF.js} +2 -2
  12. package/dist/{chunk-DRZ224RU.js → chunk-ANSZVKI2.js} +8 -8
  13. package/dist/{chunk-N3RHX26N.js → chunk-AZZVSEP5.js} +3 -3
  14. package/dist/{chunk-66I2QUFE.cjs → chunk-B26UT36N.cjs} +6 -6
  15. package/dist/{chunk-66I2QUFE.cjs.map → chunk-B26UT36N.cjs.map} +1 -1
  16. package/dist/{chunk-UBRVIVY4.cjs → chunk-B2CSYMKW.cjs} +298 -285
  17. package/dist/chunk-B2CSYMKW.cjs.map +1 -0
  18. package/dist/{chunk-ZK3AZ5YF.cjs → chunk-BTOL222V.cjs} +11 -11
  19. package/dist/{chunk-ZK3AZ5YF.cjs.map → chunk-BTOL222V.cjs.map} +1 -1
  20. package/dist/{chunk-S7VW4HVL.cjs → chunk-DODE3PD4.cjs} +49 -49
  21. package/dist/{chunk-S7VW4HVL.cjs.map → chunk-DODE3PD4.cjs.map} +1 -1
  22. package/dist/{chunk-ZZHHKE2Q.js → chunk-ECXQX4EP.js} +2 -2
  23. package/dist/{chunk-NEFNARFF.cjs → chunk-EEV7SSBJ.cjs} +30 -30
  24. package/dist/{chunk-NEFNARFF.cjs.map → chunk-EEV7SSBJ.cjs.map} +1 -1
  25. package/dist/{chunk-3OQIZPUX.js → chunk-EO3NEGWB.js} +4 -4
  26. package/dist/{chunk-MOHSA65M.js → chunk-EZM5DNII.js} +2 -2
  27. package/dist/{chunk-IKQVXZB5.js → chunk-GSPS6Y5U.js} +6 -6
  28. package/dist/{chunk-CQ35OMPJ.cjs → chunk-I2BNLWC3.cjs} +3 -3
  29. package/dist/{chunk-CQ35OMPJ.cjs.map → chunk-I2BNLWC3.cjs.map} +1 -1
  30. package/dist/{chunk-HOLK4ZMT.js → chunk-II2GBWNW.js} +4 -4
  31. package/dist/{chunk-PETYVGEQ.cjs → chunk-JKGVXLTT.cjs} +5 -5
  32. package/dist/{chunk-PETYVGEQ.cjs.map → chunk-JKGVXLTT.cjs.map} +1 -1
  33. package/dist/{chunk-5EM6NGBK.cjs → chunk-KOQCA5X5.cjs} +17 -27
  34. package/dist/chunk-KOQCA5X5.cjs.map +1 -0
  35. package/dist/{chunk-ACU7J5BL.cjs → chunk-KPE7OQF6.cjs} +84 -84
  36. package/dist/{chunk-ACU7J5BL.cjs.map → chunk-KPE7OQF6.cjs.map} +1 -1
  37. package/dist/{chunk-C4YJC5X7.cjs → chunk-KRKW63LG.cjs} +9 -9
  38. package/dist/{chunk-C4YJC5X7.cjs.map → chunk-KRKW63LG.cjs.map} +1 -1
  39. package/dist/{chunk-ZEG3ZJPY.cjs → chunk-LE5SZPMN.cjs} +33 -33
  40. package/dist/{chunk-ZEG3ZJPY.cjs.map → chunk-LE5SZPMN.cjs.map} +1 -1
  41. package/dist/{chunk-A5AKGC4S.js → chunk-LPMDCQLL.js} +17 -27
  42. package/dist/chunk-LPMDCQLL.js.map +1 -0
  43. package/dist/{chunk-EWOFXJGH.cjs → chunk-M3OQLL7D.cjs} +63 -63
  44. package/dist/{chunk-EWOFXJGH.cjs.map → chunk-M3OQLL7D.cjs.map} +1 -1
  45. package/dist/{chunk-FKXDDJEQ.cjs → chunk-M4YQUHOR.cjs} +5 -5
  46. package/dist/{chunk-FKXDDJEQ.cjs.map → chunk-M4YQUHOR.cjs.map} +1 -1
  47. package/dist/{chunk-5XQMEDGE.cjs → chunk-OHJ4QOWN.cjs} +12 -12
  48. package/dist/{chunk-5XQMEDGE.cjs.map → chunk-OHJ4QOWN.cjs.map} +1 -1
  49. package/dist/{chunk-Y6I2DGKC.cjs → chunk-OMKI5T2G.cjs} +1 -1
  50. package/dist/chunk-OMKI5T2G.cjs.map +1 -0
  51. package/dist/{chunk-M5HGULIY.js → chunk-OQODJ26H.js} +5 -5
  52. package/dist/{chunk-MEWAFY6X.js → chunk-OT5IQMSI.js} +4 -4
  53. package/dist/{chunk-Y22VQDVW.js → chunk-QB244ZDI.js} +4 -4
  54. package/dist/{chunk-3T7ZP3TL.js → chunk-QL6ECU6Y.js} +3 -3
  55. package/dist/{chunk-3XDPXOMS.js → chunk-R2SZYRB2.js} +7 -7
  56. package/dist/{chunk-QAVT6P5F.cjs → chunk-RFA5T5MW.cjs} +28 -28
  57. package/dist/{chunk-QAVT6P5F.cjs.map → chunk-RFA5T5MW.cjs.map} +1 -1
  58. package/dist/{chunk-BTF3CNDP.js → chunk-ROQO355A.js} +1 -1
  59. package/dist/chunk-ROQO355A.js.map +1 -0
  60. package/dist/{chunk-43ADGEWL.cjs → chunk-UJAMXLA3.cjs} +40 -40
  61. package/dist/{chunk-43ADGEWL.cjs.map → chunk-UJAMXLA3.cjs.map} +1 -1
  62. package/dist/{chunk-KVNA3HU2.js → chunk-XANQTIHS.js} +3 -3
  63. package/dist/{chunk-PMN7WDXI.js → chunk-YUHOKPKS.js} +26 -13
  64. package/dist/chunk-YUHOKPKS.js.map +1 -0
  65. package/dist/components/case-studies/index.cjs +16 -16
  66. package/dist/components/case-studies/index.js +6 -6
  67. package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -1
  68. package/dist/components/chat/index.cjs +4 -4
  69. package/dist/components/chat/index.js +3 -3
  70. package/dist/components/contact/index.cjs +7 -7
  71. package/dist/components/contact/index.js +6 -6
  72. package/dist/components/docs/index.cjs +10 -10
  73. package/dist/components/docs/index.js +9 -9
  74. package/dist/components/embeds/index.cjs +7 -7
  75. package/dist/components/embeds/index.js +6 -6
  76. package/dist/components/faq/index.cjs +7 -7
  77. package/dist/components/faq/index.js +6 -6
  78. package/dist/components/features/index.cjs +6 -6
  79. package/dist/components/features/index.js +5 -5
  80. package/dist/components/help-center-pages/index.cjs +26 -26
  81. package/dist/components/help-center-pages/index.js +17 -17
  82. package/dist/components/icons/index.cjs +2 -2
  83. package/dist/components/icons/index.js +1 -1
  84. package/dist/components/icons/mlg-logo.d.ts.map +1 -1
  85. package/dist/components/index.cjs +56 -56
  86. package/dist/components/index.js +17 -17
  87. package/dist/components/meeting-scheduler/booking-form.d.ts +49 -5
  88. package/dist/components/meeting-scheduler/booking-form.d.ts.map +1 -1
  89. package/dist/components/meeting-scheduler/context-panel.d.ts +9 -1
  90. package/dist/components/meeting-scheduler/context-panel.d.ts.map +1 -1
  91. package/dist/components/meeting-scheduler/index.cjs +369 -186
  92. package/dist/components/meeting-scheduler/index.cjs.map +1 -1
  93. package/dist/components/meeting-scheduler/index.d.ts +55 -1
  94. package/dist/components/meeting-scheduler/index.d.ts.map +1 -1
  95. package/dist/components/meeting-scheduler/index.js +344 -161
  96. package/dist/components/meeting-scheduler/index.js.map +1 -1
  97. package/dist/components/meeting-scheduler/slot-picker.d.ts +8 -1
  98. package/dist/components/meeting-scheduler/slot-picker.d.ts.map +1 -1
  99. package/dist/components/navigation/index.cjs +9 -9
  100. package/dist/components/navigation/index.js +8 -8
  101. package/dist/components/onboarding-guides/index.cjs +9 -9
  102. package/dist/components/onboarding-guides/index.js +8 -8
  103. package/dist/components/related-content/index.cjs +3 -3
  104. package/dist/components/related-content/index.js +2 -2
  105. package/dist/components/tickets/index.cjs +10 -10
  106. package/dist/components/tickets/index.js +9 -9
  107. package/dist/components/ui/benefit-card.d.ts.map +1 -1
  108. package/dist/components/ui/index.cjs +6 -6
  109. package/dist/components/ui/index.js +5 -5
  110. package/dist/hooks/index.cjs +3 -3
  111. package/dist/hooks/index.js +2 -2
  112. package/dist/index.cjs +10 -10
  113. package/dist/index.js +9 -9
  114. package/dist/schemas/meeting-booking-schema.cjs +19 -4
  115. package/dist/schemas/meeting-booking-schema.cjs.map +1 -1
  116. package/dist/schemas/meeting-booking-schema.d.ts +41 -16
  117. package/dist/schemas/meeting-booking-schema.d.ts.map +1 -1
  118. package/dist/schemas/meeting-booking-schema.js +19 -5
  119. package/dist/schemas/meeting-booking-schema.js.map +1 -1
  120. package/dist/types/index.cjs.map +1 -1
  121. package/dist/types/index.js.map +1 -1
  122. package/dist/utils/index.cjs +18 -40
  123. package/dist/utils/index.cjs.map +1 -1
  124. package/dist/utils/index.js +18 -40
  125. package/dist/utils/index.js.map +1 -1
  126. package/dist/utils/source-icons.d.ts.map +1 -1
  127. package/package.json +1 -1
  128. package/src/components/chat/entity-cards/dispatch.tsx +0 -57
  129. package/src/components/icons/mlg-logo.tsx +1 -7
  130. package/src/components/meeting-scheduler/booking-form.tsx +371 -152
  131. package/src/components/meeting-scheduler/context-panel.tsx +13 -3
  132. package/src/components/meeting-scheduler/index.tsx +316 -69
  133. package/src/components/meeting-scheduler/slot-picker.tsx +17 -1
  134. package/src/components/ui/benefit-card.tsx +30 -9
  135. package/src/schemas/meeting-booking-schema.ts +58 -4
  136. package/src/types/tmcg.ts +0 -2
  137. package/src/utils/format.ts +1 -1
  138. package/src/utils/source-icons.ts +0 -24
  139. package/dist/chunk-5EM6NGBK.cjs.map +0 -1
  140. package/dist/chunk-A5AKGC4S.js.map +0 -1
  141. package/dist/chunk-BTF3CNDP.js.map +0 -1
  142. package/dist/chunk-PMN7WDXI.js.map +0 -1
  143. package/dist/chunk-UBRVIVY4.cjs.map +0 -1
  144. package/dist/chunk-Y6I2DGKC.cjs.map +0 -1
  145. package/dist/chunk-YLVPQNLO.cjs.map +0 -1
  146. /package/dist/{chunk-F5Q3DTP5.js.map → chunk-7EUE3YTC.js.map} +0 -0
  147. /package/dist/{chunk-GBIC3VNA.js.map → chunk-7KGN7DV6.js.map} +0 -0
  148. /package/dist/{chunk-YZLUOZKR.js.map → chunk-7Q66A4CF.js.map} +0 -0
  149. /package/dist/{chunk-DRZ224RU.js.map → chunk-ANSZVKI2.js.map} +0 -0
  150. /package/dist/{chunk-N3RHX26N.js.map → chunk-AZZVSEP5.js.map} +0 -0
  151. /package/dist/{chunk-ZZHHKE2Q.js.map → chunk-ECXQX4EP.js.map} +0 -0
  152. /package/dist/{chunk-3OQIZPUX.js.map → chunk-EO3NEGWB.js.map} +0 -0
  153. /package/dist/{chunk-MOHSA65M.js.map → chunk-EZM5DNII.js.map} +0 -0
  154. /package/dist/{chunk-IKQVXZB5.js.map → chunk-GSPS6Y5U.js.map} +0 -0
  155. /package/dist/{chunk-HOLK4ZMT.js.map → chunk-II2GBWNW.js.map} +0 -0
  156. /package/dist/{chunk-M5HGULIY.js.map → chunk-OQODJ26H.js.map} +0 -0
  157. /package/dist/{chunk-MEWAFY6X.js.map → chunk-OT5IQMSI.js.map} +0 -0
  158. /package/dist/{chunk-Y22VQDVW.js.map → chunk-QB244ZDI.js.map} +0 -0
  159. /package/dist/{chunk-3T7ZP3TL.js.map → chunk-QL6ECU6Y.js.map} +0 -0
  160. /package/dist/{chunk-3XDPXOMS.js.map → chunk-R2SZYRB2.js.map} +0 -0
  161. /package/dist/{chunk-KVNA3HU2.js.map → chunk-XANQTIHS.js.map} +0 -0
@@ -225,7 +225,15 @@ export function isValidBcp47Locale(locale: string): boolean {
225
225
  * in the visitor's local time) — this schema is the ONLY place a
226
226
  * client-supplied zone is accepted; the availability path is UTC-pinned.
227
227
  */
228
- export function makeBookingSchema(formFields: MeetingFormField[], legalConsent: MeetingLegalConsent | null) {
228
+ function buildBookingSchema<TStart extends z.ZodTypeAny, TDuration extends z.ZodTypeAny, TZone extends z.ZodTypeAny>(
229
+ formFields: MeetingFormField[],
230
+ legalConsent: MeetingLegalConsent | null,
231
+ // Passed IN rather than switched on a boolean: a `deferSlot: boolean`
232
+ // parameter cannot be narrowed at type level, so every ternary inside would
233
+ // infer a union and widen `startTimeMs`/`durationMs` to `number | null |
234
+ // undefined` for BOTH schemas — including the server's wire type.
235
+ slot: { startTimeMs: TStart; durationMs: TDuration; timezone: TZone },
236
+ ) {
229
237
  const answers: Record<string, z.ZodTypeAny> = {};
230
238
  for (const field of formFields) {
231
239
  if (!isSupportedFormField(field)) continue; // unsupported types are fail-closed at render time
@@ -276,12 +284,12 @@ export function makeBookingSchema(formFields: MeetingFormField[], legalConsent:
276
284
  z
277
285
  .object({
278
286
  meetingId: z.string().min(1),
279
- startTimeMs: z.number().int().positive(),
280
- durationMs: z.number().int().positive(),
287
+ startTimeMs: slot.startTimeMs,
288
+ durationMs: slot.durationMs,
281
289
  firstName: z.string().min(1, { message: 'First name is required' }).max(255),
282
290
  lastName: z.string().min(1, { message: 'Last name is required' }).max(255),
283
291
  email: z.string().email({ message: 'Please enter a valid email address' }).max(255),
284
- timezone: z.string().refine(isValidIanaTimezone, { message: 'Invalid timezone' }),
292
+ timezone: slot.timezone,
285
293
  locale: z.string().refine(isValidBcp47Locale, { message: 'Invalid locale' }).optional(),
286
294
  // Plain `.optional()` (no `.default()`) so zod's input and output types
287
295
  // match — react-hook-form's zodResolver needs them identical, and the
@@ -311,4 +319,50 @@ export function makeBookingSchema(formFields: MeetingFormField[], legalConsent:
311
319
  );
312
320
  }
313
321
 
322
+ /**
323
+ * The STRICT schema — the wire contract. The server rebuilds it from the link's
324
+ * own fetched metadata and validates every booking against it; a slot and a
325
+ * duration are not optional on anything that reaches HubSpot.
326
+ */
327
+ export function makeBookingSchema(formFields: MeetingFormField[], legalConsent: MeetingLegalConsent | null) {
328
+ return buildBookingSchema(formFields, legalConsent, {
329
+ startTimeMs: z.number().int().positive(),
330
+ durationMs: z.number().int().positive(),
331
+ timezone: z.string().refine(isValidIanaTimezone, { message: 'Invalid timezone' }),
332
+ });
333
+ }
334
+
335
+ /**
336
+ * The DEFERRED schema — same fields, with the slot/duration/timezone triple
337
+ * relaxed. `flow="details-first"` collects answers BEFORE a slot exists, so the
338
+ * form validates against this and the parent re-attaches the authoritative
339
+ * values at POST time.
340
+ *
341
+ * Two named exports over one private builder rather than an overload or an
342
+ * options flag: `MeetingBookingPayload` is `z.infer<ReturnType<...>>`, and
343
+ * either of those alternatives would widen `startTimeMs`/`durationMs` to
344
+ * `number | undefined` for EVERY consumer — including the server's
345
+ * `durationsMs.includes(data.durationMs)`.
346
+ */
347
+ export function makeDeferredBookingSchema(formFields: MeetingFormField[], legalConsent: MeetingLegalConsent | null) {
348
+ // `.nullish()`, not `.optional()`: the widget passes these straight into
349
+ // `defaultValues`, and details-first has `timezone === null` on the server
350
+ // render and the first client render (zone resolution is post-hydration).
351
+ // Accepting only `undefined` would reject a field with no rendered control
352
+ // and no FieldWrapper — the submit button silently dead, type-check clean.
353
+ return buildBookingSchema(formFields, legalConsent, {
354
+ startTimeMs: z.number().int().positive().nullish(),
355
+ durationMs: z.number().int().positive().nullish(),
356
+ timezone: z.string().refine(isValidIanaTimezone, { message: 'Invalid timezone' }).nullish(),
357
+ });
358
+ }
359
+
360
+ /** The wire payload. Pinned to the STRICT builder — see above. */
314
361
  export type MeetingBookingPayload = z.infer<ReturnType<typeof makeBookingSchema>>;
362
+
363
+ /**
364
+ * The form's value type, used as the `useForm` generic in BOTH flows: a relaxed
365
+ * resolver is not assignable to `Resolver<MeetingBookingPayload>`, and mixing
366
+ * the two survives only on TS's bivariant method-parameter check.
367
+ */
368
+ export type BookingFormValues = z.infer<ReturnType<typeof makeDeferredBookingSchema>>;
package/src/types/tmcg.ts CHANGED
@@ -106,5 +106,3 @@ export const TMCG_ROLE_DISPLAY_NAMES: Record<string, string> = {
106
106
  [TMCG_ROLES.SPEAKER]: 'Speaker',
107
107
  [TMCG_ROLES.MENTOR]: 'Mentor',
108
108
  };
109
-
110
-
@@ -184,7 +184,7 @@ export interface NameInitialsOptions {
184
184
  export function nameInitials(
185
185
  name: string | null | undefined,
186
186
  fallback: string = 'E',
187
- options: NameInitialsOptions = {}
187
+ options: NameInitialsOptions = {},
188
188
  ): string {
189
189
  const { maxLetters = 2, pick: mode = 'all' } = options;
190
190
  const source = typeof name === 'string' ? name.trim() : '';
@@ -68,14 +68,6 @@ export const SOURCE_ICON_NAMES: Record<string, string> = {
68
68
 
69
69
  // Communications
70
70
  'slack-messages': 'slack',
71
-
72
- // People-hub employee content
73
- 'what-i-shipped': 'package',
74
- 'how-i-work': 'book-open',
75
-
76
- // Product-hub internal
77
- 'design-docs': 'file-text',
78
- 'openframe-tenants': 'globe',
79
71
  };
80
72
 
81
73
  /** Lookup an icon name by RagTableConfig.id. Returns undefined when
@@ -147,14 +139,6 @@ export const SOURCE_LABELS_BY_TABLE: Record<string, string> = {
147
139
 
148
140
  // Communications
149
141
  'slack-messages': 'OpenMSP Community',
150
-
151
- // People-hub employee content
152
- 'what-i-shipped': 'What I Shipped',
153
- 'how-i-work': 'How I Work',
154
-
155
- // Product-hub internal
156
- 'design-docs': 'Design Docs',
157
- 'openframe-tenants': 'OpenFrame Tenants',
158
142
  };
159
143
 
160
144
  /** Lookup a human-readable label by RagTableConfig.id. Falls back
@@ -228,14 +212,6 @@ export const DEFAULT_DOCUMENT_TYPE_TO_TABLE_ID: Record<string, string> = {
228
212
 
229
213
  // Communications
230
214
  slack_message: 'slack-messages',
231
-
232
- // People-hub employee content
233
- what_i_shipped: 'what-i-shipped',
234
- how_i_work: 'how-i-work',
235
-
236
- // Product-hub internal
237
- design_doc: 'design-docs',
238
- openframe_tenant: 'openframe-tenants',
239
215
  };
240
216
 
241
217
  /**