@factorialco/f0-react 4.54.0 → 4.56.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/f0.d.ts CHANGED
@@ -1133,6 +1133,13 @@ declare type AlertAction = {
1133
1133
  loadingState: UpsellingButtonProps["loadingState"];
1134
1134
  nextSteps: UpsellingButtonProps["nextSteps"];
1135
1135
  closeLabel: UpsellingButtonProps["closeLabel"];
1136
+ /**
1137
+ * Whether to show the confirmation dialog after the request resolves.
1138
+ * Defaults to `true`. Set to `false` when `onRequest` only opens a modal or
1139
+ * navigates instead of creating an upselling request, so the success dialog
1140
+ * ("request sent") is not shown for an action that sent nothing.
1141
+ */
1142
+ showConfirmation?: UpsellingButtonProps["showConfirmation"];
1136
1143
  };
1137
1144
 
1138
1145
  export declare type AlertAvatarProps = VariantProps<typeof alertAvatarVariants> & {
@@ -5814,8 +5821,14 @@ declare type EditableTableColumnDefinition<R extends RecordType, Sortings extend
5814
5821
  /**
5815
5822
  * Configuration for `"date"` cells. Accepts `minDate` / `maxDate` to
5816
5823
  * restrict the selectable date range in the picker.
5824
+ *
5825
+ * Can be a static object or a function that receives the current row item
5826
+ * to return a per-row range (e.g. bound one date field by another field's
5827
+ * value: `(item) => ({ minDate: parseISO(item.startDate) })`). The picker's
5828
+ * default visible month follows `minDate`, so a per-row `minDate` also
5829
+ * opens the calendar on that date.
5817
5830
  */
5818
- dateConfig?: DateCellConfig;
5831
+ dateConfig?: DateCellConfig | ((item: R) => DateCellConfig);
5819
5832
  /**
5820
5833
  * Called after this cell's value changes. Use to compute derived values
5821
5834
  * and update other cells in the same row.
@@ -6257,10 +6270,20 @@ export declare const F0AiChatCreditsButton: ({ credits, employeeCredits, trigger
6257
6270
  * - with-history: title acts as a thread selector (clickable) — the host
6258
6271
  * wires `onOpenHistory` to mount its own history dialog.
6259
6272
  * - legacy: title is static; a "new chat" button is shown when `hasMessages`.
6273
+ * Hosts can add header actions that F0 renders alongside the built-in controls.
6260
6274
  *
6261
6275
  * Decoupled from CopilotKit and `useAiChat()` — everything via props.
6262
6276
  */
6263
- export declare const F0AiChatHeader: ({ historyEnabled, title, currentThreadTitle, fullscreen, lockVisualizationMode, onToggleVisualizationMode, onClose, onNewChat, onOpenHistory, hasMessages, credits, employeeCredits, compact, }: F0AiChatHeaderProps) => JSX_2.Element;
6277
+ export declare const F0AiChatHeader: ({ historyEnabled, title, currentThreadTitle, fullscreen, lockVisualizationMode, onToggleVisualizationMode, onClose, onNewChat, onOpenHistory, hasMessages, credits, employeeCredits, compact, actions, }: F0AiChatHeaderProps) => JSX_2.Element;
6278
+
6279
+ export declare interface F0AiChatHeaderAction {
6280
+ /** Stable identifier used as the React key. */
6281
+ id: string;
6282
+ /** Already-localized accessible label and tooltip. */
6283
+ label: string;
6284
+ icon: IconType;
6285
+ onClick: () => void;
6286
+ }
6264
6287
 
6265
6288
  export declare type F0AiChatHeaderProps = {
6266
6289
  /**
@@ -6295,9 +6318,9 @@ export declare type F0AiChatHeaderProps = {
6295
6318
  /** Legacy variant gate: only renders the "new chat" button when true. */
6296
6319
  hasMessages?: boolean;
6297
6320
  /**
6298
- * Minimal header: render only the expand + close controls (no title, new
6299
- * chat or credits popover). Use when a sidebar owns the chat navigation and
6300
- * the credits/settings popover (see `F0AiChatCreditsButton`).
6321
+ * Minimal header: render only header actions plus the expand and close controls
6322
+ * (no title, new chat or credits popover). Use when a sidebar owns the chat
6323
+ * navigation and the credits/settings popover (see `F0AiChatCreditsButton`).
6301
6324
  */
6302
6325
  compact?: boolean;
6303
6326
  /** Credits configuration. When present, renders the credits popover button. */
@@ -6308,6 +6331,11 @@ export declare type F0AiChatHeaderProps = {
6308
6331
  * with `credits`). Hosts opt in per-employee.
6309
6332
  */
6310
6333
  employeeCredits?: AiChatEmployeeCredits;
6334
+ /**
6335
+ * Additional actions rendered immediately before the fullscreen and close
6336
+ * controls. F0 owns their presentation so they match the built-in actions.
6337
+ */
6338
+ actions?: F0AiChatHeaderAction[];
6311
6339
  };
6312
6340
 
6313
6341
  /**
@@ -17216,7 +17244,7 @@ declare type UpsellActionDefinitionFn = () => UpsellActionDefinition | undefined
17216
17244
 
17217
17245
  export declare const UpsellingAlert: WithDataTestIdReturnType_4<typeof _UpsellingAlert>;
17218
17246
 
17219
- declare function _UpsellingAlert({ icon, title, description, action, }: UpsellingAlertProps): JSX_2.Element;
17247
+ declare function _UpsellingAlert({ icon, title, description, action, onDismiss, }: UpsellingAlertProps): JSX_2.Element;
17220
17248
 
17221
17249
  export declare interface UpsellingAlertProps {
17222
17250
  /**
@@ -17235,6 +17263,16 @@ export declare interface UpsellingAlertProps {
17235
17263
  * The upselling action button configuration.
17236
17264
  */
17237
17265
  action: AlertAction;
17266
+ /**
17267
+ * Called when the user dismisses the alert. When provided, a close button is
17268
+ * shown just to the right of the upselling action button.
17269
+ *
17270
+ * The consumer is responsible for deciding what happens on dismiss — for
17271
+ * example, hiding the alert for a number of days and showing it again later
17272
+ * by persisting the dismissal (e.g. in a cookie or local storage) and
17273
+ * unmounting the component while it should stay hidden.
17274
+ */
17275
+ onDismiss?: () => void;
17238
17276
  }
17239
17277
 
17240
17278
  export declare const UpsellingBanner: WithDataTestIdReturnType_4<ForwardRefExoticComponent<Omit<BaseBannerProps, "children" | "primaryAction" | "secondaryAction"> & {
@@ -18474,8 +18512,10 @@ declare module "@tiptap/core" {
18474
18512
 
18475
18513
  declare module "@tiptap/core" {
18476
18514
  interface Commands<ReturnType> {
18477
- transcript: {
18478
- insertTranscript: (data: TranscriptData) => ReturnType;
18515
+ videoEmbed: {
18516
+ setVideoEmbed: (options: {
18517
+ src: string;
18518
+ }) => ReturnType;
18479
18519
  };
18480
18520
  }
18481
18521
  }
@@ -18483,10 +18523,8 @@ declare module "@tiptap/core" {
18483
18523
 
18484
18524
  declare module "@tiptap/core" {
18485
18525
  interface Commands<ReturnType> {
18486
- videoEmbed: {
18487
- setVideoEmbed: (options: {
18488
- src: string;
18489
- }) => ReturnType;
18526
+ transcript: {
18527
+ insertTranscript: (data: TranscriptData) => ReturnType;
18490
18528
  };
18491
18529
  }
18492
18530
  }