@factorialco/f0-react 1.432.0 → 1.434.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
@@ -332,6 +332,16 @@ declare type AiChatDisclaimer = {
332
332
  linkText?: string;
333
333
  };
334
334
 
335
+ export declare type AiChatFileAttachmentConfig = {
336
+ onUploadFiles: (files: File[]) => Promise<UploadedFile[]>;
337
+ allowedMimeTypes?: string | string[];
338
+ /**
339
+ * Maximum number of files that can be attached at once.
340
+ * Omit or pass undefined for no limit.
341
+ */
342
+ maxFiles?: number;
343
+ };
344
+
335
345
  /**
336
346
  * Interaction mode for the AI chat
337
347
  */
@@ -378,12 +388,11 @@ export declare type AiChatProviderProps = {
378
388
  */
379
389
  VoiceMode?: React.ComponentType;
380
390
  /**
381
- * Async resolver functions for entity references in markdown.
382
- * Used to fetch profile data for inline entity mentions (hover cards).
383
- * The consuming app provides these so the chat can resolve entity IDs
384
- * (e.g. employee IDs) into rich profile data without knowing the API.
391
+ * Configuration for entity references in markdown.
392
+ * Groups resolver functions (data fetching for hover cards) and
393
+ * URL builders (navigation links) for each entity type.
385
394
  */
386
- entityResolvers?: EntityResolvers;
395
+ entityRefs?: EntityRefs;
387
396
  /**
388
397
  * Available tool hints that the user can activate to provide intent context
389
398
  * to the AI. Renders a selector button next to the send button.
@@ -395,6 +404,10 @@ export declare type AiChatProviderProps = {
395
404
  * Groups fetchUsage, upgradePlanUrl, and company/plan display info.
396
405
  */
397
406
  credits?: AiChatCredits;
407
+ /**
408
+ * File attachment configuration. When provided, enables file uploads in the chat.
409
+ */
410
+ fileAttachments?: AiChatFileAttachmentConfig;
398
411
  onThumbsUp?: (message: AIMessage, { threadId, feedback }: {
399
412
  threadId: string;
400
413
  feedback: string;
@@ -504,7 +517,7 @@ declare type AiChatProviderReturnValue = {
504
517
  inProgress: boolean;
505
518
  /** Set the in-progress state (synced from CopilotKit's isLoading) */
506
519
  setInProgress: (value: boolean) => void;
507
- } & Pick<AiChatState, "greeting" | "agent" | "disclaimer" | "resizable" | "entityResolvers" | "toolHints" | "credits"> & {
520
+ } & Pick<AiChatState, "greeting" | "agent" | "disclaimer" | "resizable" | "entityRefs" | "toolHints" | "credits" | "fileAttachments"> & {
508
521
  /** The current canvas content, or null when canvas is closed */
509
522
  canvasContent: CanvasContent | null;
510
523
  /** Open the canvas panel with the given content */
@@ -533,9 +546,10 @@ declare interface AiChatState {
533
546
  historyEnabled?: boolean;
534
547
  footer?: React.ReactNode;
535
548
  VoiceMode?: React.ComponentType;
536
- entityResolvers?: EntityResolvers;
549
+ entityRefs?: EntityRefs;
537
550
  toolHints?: AiChatToolHint[];
538
551
  credits?: AiChatCredits;
552
+ fileAttachments?: AiChatFileAttachmentConfig;
539
553
  placeholders?: string[];
540
554
  setPlaceholders?: React.Dispatch<React.SetStateAction<string[]>>;
541
555
  onThumbsUp?: (message: AIMessage, { threadId, feedback }: {
@@ -571,9 +585,6 @@ export declare type AiChatToolHint = {
571
585
  prompt: string;
572
586
  };
573
587
 
574
- /**
575
- * Tracking options for the AI chat
576
- */
577
588
  declare type AiChatTrackingOptions = {
578
589
  onVisibility?: () => void;
579
590
  onClose?: () => void;
@@ -652,7 +663,7 @@ export declare const aiTranslations: {
652
663
  readonly unpinChat: "Unpin chat";
653
664
  readonly deleteChat: "Delete chat";
654
665
  readonly ask: "Ask One";
655
- readonly viewProfile: "View profile";
666
+ readonly view: "View";
656
667
  readonly tools: "Tools";
657
668
  readonly credits: {
658
669
  readonly title: "Credits";
@@ -689,6 +700,8 @@ export declare const aiTranslations: {
689
700
  readonly actionLabel: "Get credits";
690
701
  };
691
702
  };
703
+ readonly attachFile: "Attach file";
704
+ readonly removeFile: "Remove";
692
705
  readonly growth: {
693
706
  readonly demoCard: {
694
707
  readonly title: "See {{moduleName}} in action";
@@ -1419,6 +1432,18 @@ declare type CalendarMode = "single" | "range";
1419
1432
 
1420
1433
  declare type CalendarView = "day" | "month" | "year" | "week" | "quarter" | "halfyear";
1421
1434
 
1435
+ /**
1436
+ * Profile data for a candidate entity (ATS applicant), resolved asynchronously
1437
+ * and displayed in the entity reference hover card.
1438
+ */
1439
+ declare type CandidateProfile = {
1440
+ id: string | number;
1441
+ firstName: string;
1442
+ lastName: string;
1443
+ avatarUrl?: string;
1444
+ source?: string;
1445
+ };
1446
+
1422
1447
  /**
1423
1448
  * Discriminated union for canvas panel content.
1424
1449
  * Add new entity types to this union as they are implemented.
@@ -3217,7 +3242,7 @@ export declare const defaultTranslations: {
3217
3242
  readonly unpinChat: "Unpin chat";
3218
3243
  readonly deleteChat: "Delete chat";
3219
3244
  readonly ask: "Ask One";
3220
- readonly viewProfile: "View profile";
3245
+ readonly view: "View";
3221
3246
  readonly tools: "Tools";
3222
3247
  readonly credits: {
3223
3248
  readonly title: "Credits";
@@ -3254,6 +3279,8 @@ export declare const defaultTranslations: {
3254
3279
  readonly actionLabel: "Get credits";
3255
3280
  };
3256
3281
  };
3282
+ readonly attachFile: "Attach file";
3283
+ readonly removeFile: "Remove";
3257
3284
  readonly growth: {
3258
3285
  readonly demoCard: {
3259
3286
  readonly title: "See {{moduleName}} in action";
@@ -3753,6 +3780,15 @@ declare const emojiVariants: (props?: ({
3753
3780
  className?: ClassValue;
3754
3781
  })) | undefined) => string;
3755
3782
 
3783
+ /**
3784
+ * Grouped configuration for entity references in the AI chat.
3785
+ * Combines resolver functions (data fetching) with URL builders (navigation).
3786
+ */
3787
+ export declare type EntityRefs = {
3788
+ resolvers?: EntityResolvers;
3789
+ urls?: EntityUrlBuilders;
3790
+ };
3791
+
3756
3792
  /**
3757
3793
  * Map of async resolver functions keyed by entity type.
3758
3794
  * Each resolver takes an entity ID and returns the profile data
@@ -3762,6 +3798,8 @@ declare const emojiVariants: (props?: ({
3762
3798
  */
3763
3799
  export declare type EntityResolvers = {
3764
3800
  person?: (id: string) => Promise<PersonProfile>;
3801
+ candidate?: (id: string) => Promise<CandidateProfile>;
3802
+ jobPosting?: (id: string) => Promise<JobPostingProfile>;
3765
3803
  /**
3766
3804
  * Search for persons by name query. Used by the @mention autocomplete
3767
3805
  * in the chat input to let users reference specific employees.
@@ -3769,6 +3807,19 @@ export declare type EntityResolvers = {
3769
3807
  searchPersons?: (query: string) => Promise<PersonProfile[]>;
3770
3808
  };
3771
3809
 
3810
+ /**
3811
+ * Map of URL builder functions keyed by entity type.
3812
+ * Each builder takes an entity ID and returns the URL to navigate to.
3813
+ *
3814
+ * When a URL builder is not provided for an entity type, the hover card
3815
+ * will not show a navigation action.
3816
+ */
3817
+ export declare type EntityUrlBuilders = {
3818
+ person?: (id: string) => string;
3819
+ candidate?: (id: string) => string;
3820
+ jobPosting?: (id: string) => string;
3821
+ };
3822
+
3772
3823
  declare type Enumerate<N extends number, Acc extends number[] = []> = Acc["length"] extends N ? [...Acc, N][number] : Enumerate<N, [...Acc, Acc["length"]]>;
3773
3824
 
3774
3825
  export declare interface ErrorMessageProps {
@@ -3867,7 +3918,7 @@ export declare const F0AiChat: () => JSX_2.Element | null;
3867
3918
  /**
3868
3919
  * @experimental This is an experimental component use it at your own risk
3869
3920
  */
3870
- export declare const F0AiChatProvider: ({ enabled, greeting, initialMessage, welcomeScreenSuggestions, disclaimer, resizable, defaultVisualizationMode, lockVisualizationMode, historyEnabled, footer, VoiceMode, entityResolvers, toolHints, credits, onThumbsUp, onThumbsDown, children, agent, tracking, ...copilotKitProps }: AiChatProviderProps) => JSX_2.Element;
3921
+ export declare const F0AiChatProvider: ({ enabled, greeting, initialMessage, welcomeScreenSuggestions, disclaimer, resizable, defaultVisualizationMode, lockVisualizationMode, historyEnabled, footer, VoiceMode, entityRefs, toolHints, credits, fileAttachments, onThumbsUp, onThumbsDown, children, agent, tracking, ...copilotKitProps }: AiChatProviderProps) => JSX_2.Element;
3871
3922
 
3872
3923
  export declare const F0AiChatTextArea: ({ submitLabel, inProgress, onSend, onStop, creditWarning, onDismissCreditWarning, onGetCredits, }: ChatTextareaProps) => JSX_2.Element;
3873
3924
 
@@ -4181,13 +4232,14 @@ declare type F0AvatarFlagProps = {
4181
4232
  } & Pick<BaseAvatarProps, "aria-label" | "aria-labelledby">;
4182
4233
 
4183
4234
  export declare const F0AvatarIcon: WithDataTestIdReturnType_4< {
4184
- ({ icon, size, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, }: F0AvatarIconProps_2): JSX_2.Element;
4235
+ ({ icon, size, state, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, }: F0AvatarIconProps_2): JSX_2.Element;
4185
4236
  displayName: string;
4186
4237
  }>;
4187
4238
 
4188
4239
  export declare type F0AvatarIconProps = {
4189
4240
  icon: IconType;
4190
4241
  size?: (typeof avatarIconSizes)[number];
4242
+ state?: F0IconProps["state"];
4191
4243
  } & Partial<Pick<BaseAvatarProps, "aria-label" | "aria-labelledby">>;
4192
4244
 
4193
4245
  export declare const F0AvatarList: WithDataTestIdReturnType_4< {
@@ -7664,6 +7716,17 @@ declare type ItemDefinition = {
7664
7716
  avatar?: AvatarVariant;
7665
7717
  };
7666
7718
 
7719
+ /**
7720
+ * Profile data for a job posting entity (ATS opening), resolved asynchronously
7721
+ * and displayed in the entity reference hover card.
7722
+ */
7723
+ declare type JobPostingProfile = {
7724
+ id: string | number;
7725
+ title: string;
7726
+ status?: string;
7727
+ location?: string;
7728
+ };
7729
+
7667
7730
  declare type Join<T extends string[], D extends string> = T extends [] ? never : T extends [infer F] ? F : T extends [infer F, ...infer R] ? F extends string ? `${F}${D}${Join<Extract<R, string[]>, D>}` : never : string;
7668
7731
 
7669
7732
  /** Flex justify content */
@@ -10085,6 +10148,15 @@ export declare interface TwoColumnLayoutProps {
10085
10148
  */
10086
10149
  export declare function unwrapZodSchema(schema: ZodTypeAny): ZodTypeAny;
10087
10150
 
10151
+ /**
10152
+ * Tracking options for the AI chat
10153
+ */
10154
+ export declare type UploadedFile = {
10155
+ url: string;
10156
+ filename: string;
10157
+ mimetype: string;
10158
+ };
10159
+
10088
10160
  declare type UpsellAction = BaseAction & {
10089
10161
  type: "upsell";
10090
10162
  variant: "promote" | "outlinePromote";
@@ -10898,11 +10970,6 @@ declare module "gridstack" {
10898
10970
  }
10899
10971
 
10900
10972
 
10901
- declare namespace Calendar {
10902
- var displayName: string;
10903
- }
10904
-
10905
-
10906
10973
  declare module "@tiptap/core" {
10907
10974
  interface Commands<ReturnType> {
10908
10975
  aiBlock: {
@@ -10950,3 +11017,8 @@ declare module "@tiptap/core" {
10950
11017
  };
10951
11018
  }
10952
11019
  }
11020
+
11021
+
11022
+ declare namespace Calendar {
11023
+ var displayName: string;
11024
+ }
package/dist/f0.js CHANGED
@@ -1,12 +1,12 @@
1
- import { O as jo, P as xe, Q as yt, K as U, L as sn, R as nr, T as Vo, U as wa, W as pi, X as Wu, Y as $o, Z as je, u as De, _ as Le, $ as ur, a0 as Uu, a1 as Ku, a2 as Tr, a3 as ut, a4 as Sa, a5 as Qu, a6 as Hu, a7 as Gu, a8 as qn, a9 as Ns, aa as Xu, ab as Yu, ac as Ju, ad as gi, ae as ed, af as td, ag as zo, ah as nd, ai as _a, aj as ka, ak as rs, al as Ca, am as Zo, an as Or, ao as qo, ap as rd, aq as sd, ar as ad, as as id, at as Na, au as vi, av as od, aw as ld, ax as cd, ay as Wo, az as ud, M as Me, aA as dd, aB as Er, aC as rr, aD as Uo, aE as Da, aF as fd, aG as md, aH as dr, aI as Aa, aJ as Ko, aK as xn, aL as Qo, aM as hd, aN as Fa, aO as pd, aP as Ho, aQ as Go, N as kt, aR as gd, aS as Gs, aT as Xo, aU as vd, aV as Yo, aW as Sn, aX as Jo, aY as bd, aZ as yd, a_ as el, a$ as xd, b0 as wd, b1 as Sd, b2 as ss, b3 as _d, b4 as kd, b5 as Cd, b6 as Nd, j as Dd, b7 as Ad, b8 as tl, b9 as mn, ba as nl, bb as rl, bc as Ir, bd as sl, be as Ta, bf as Oa, bg as Ea, bh as Ia, bi as dt, bj as Ra, bk as _n, bl as Wn, bm as Un, bn as Kn, bo as Qn, bp as Fd, bq as br, br as al, bs as Rr, bt as ot, bu as il, bv as as, bw as ol, bx as Pa, by as La, bz as Td, bA as Od, bB as Ed, bC as Id, bD as Rd, bE as ll, bF as Pd, bG as Ld, bH as Md, bI as Bd, bJ as cl, bK as jd, bL as Vd, bM as $d, bN as ul, bO as zd, bP as Zd, bQ as qd, bR as Wd, I as Ud, bS as Kd, bT as Qd, bU as Hd, bV as Gd, bW as Xd, bX as Yd } from "./F0AiChat-DRUcCTJI.js";
2
- import { cl as r0, i as s0, cx as a0, cF as i0, h as o0, F as l0, a as c0, C as u0, b as d0, bY as f0, bZ as m0, b_ as h0, b$ as p0, c0 as g0, c1 as v0, c3 as b0, c4 as y0, c5 as x0, c6 as w0, ca as S0, cb as _0, cB as k0, k as C0, ce as N0, cf as D0, cg as A0, ch as F0, cj as T0, ck as O0, cm as E0, cd as I0, ci as R0, cC as P0, c7 as L0, c8 as M0, c9 as B0, cw as j0, cr as V0, cu as $0, g as z0, cq as Z0, cG as q0, cp as W0, co as U0, c2 as K0, c as Q0, cn as H0, cs as G0, d as X0, cy as Y0, cz as J0, cA as e1, cH as t1, cc as n1, ct as r1, f as s1, e as a1, cE as i1, cv as o1, cD as l1 } from "./F0AiChat-DRUcCTJI.js";
1
+ import { O as jo, P as xe, Q as yt, K as U, L as sn, R as nr, T as Vo, U as wa, W as pi, X as Wu, Y as $o, Z as je, u as De, _ as Le, $ as ur, a0 as Uu, a1 as Ku, a2 as Tr, a3 as ut, a4 as Sa, a5 as Qu, a6 as Hu, a7 as Gu, a8 as qn, a9 as Ns, aa as Xu, ab as Yu, ac as Ju, ad as gi, ae as ed, af as td, ag as zo, ah as nd, ai as _a, aj as ka, ak as rs, al as Ca, am as Zo, an as Or, ao as qo, ap as rd, aq as sd, ar as ad, as as id, at as Na, au as vi, av as od, aw as ld, ax as cd, ay as Wo, az as ud, M as Me, aA as dd, aB as Er, aC as rr, aD as Uo, aE as Da, aF as fd, aG as md, aH as dr, aI as Aa, aJ as Ko, aK as xn, aL as Qo, aM as hd, aN as Fa, aO as pd, aP as Ho, aQ as Go, N as kt, aR as gd, aS as Gs, aT as Xo, aU as vd, aV as Yo, aW as Sn, aX as Jo, aY as bd, aZ as yd, a_ as el, a$ as xd, b0 as wd, b1 as Sd, b2 as ss, b3 as _d, b4 as kd, b5 as Cd, b6 as Nd, j as Dd, b7 as Ad, b8 as tl, b9 as mn, ba as nl, bb as rl, bc as Ir, bd as sl, be as Ta, bf as Oa, bg as Ea, bh as Ia, bi as dt, bj as Ra, bk as _n, bl as Wn, bm as Un, bn as Kn, bo as Qn, bp as Fd, bq as br, br as al, bs as Rr, bt as ot, bu as il, bv as as, bw as ol, bx as Pa, by as La, bz as Td, bA as Od, bB as Ed, bC as Id, bD as Rd, bE as ll, bF as Pd, bG as Ld, bH as Md, bI as Bd, bJ as cl, bK as jd, bL as Vd, bM as $d, bN as ul, bO as zd, bP as Zd, bQ as qd, bR as Wd, I as Ud, bS as Kd, bT as Qd, bU as Hd, bV as Gd, bW as Xd, bX as Yd } from "./F0AiChat-BCNtjNO0.js";
2
+ import { cl as r0, i as s0, cx as a0, cF as i0, h as o0, F as l0, a as c0, C as u0, b as d0, bY as f0, bZ as m0, b_ as h0, b$ as p0, c0 as g0, c1 as v0, c3 as b0, c4 as y0, c5 as x0, c6 as w0, ca as S0, cb as _0, cB as k0, k as C0, ce as N0, cf as D0, cg as A0, ch as F0, cj as T0, ck as O0, cm as E0, cd as I0, ci as R0, cC as P0, c7 as L0, c8 as M0, c9 as B0, cw as j0, cr as V0, cu as $0, g as z0, cq as Z0, cG as q0, cp as W0, co as U0, c2 as K0, c as Q0, cn as H0, cs as G0, d as X0, cy as Y0, cz as J0, cA as e1, cH as t1, cc as n1, ct as r1, f as s1, e as a1, cE as i1, cv as o1, cD as l1 } from "./F0AiChat-BCNtjNO0.js";
3
3
  import { jsx as c, jsxs as N, Fragment as He } from "react/jsx-runtime";
4
4
  import * as Ct from "react";
5
5
  import Y, { forwardRef as st, useRef as K, useImperativeHandle as Jd, Children as Pr, useCallback as P, useMemo as z, useState as te, useEffect as le, createElement as yr, isValidElement as dl, Fragment as fl, useLayoutEffect as ef, createContext as It, memo as ml, useReducer as tf, useContext as nt, cloneElement as nf, PureComponent as rf, useId as Ma } from "react";
6
6
  import { unstable_batchedUpdates as xr, createPortal as sf, flushSync as af } from "react-dom";
7
- import { C as of, S as bi, a as lf, f as Ds, L as Bn, b as cf, A as uf, i as wr, c as hl, E as df, g as Nr, d as ff, e as mf, h as hf, j as bn, k as pl, u as pf, G as gf, l as vf, m as yi, r as bf, n as yf, o as gl, p as xf, B as vl, X as bl, Y as Xs, q as wf, s as yl, t as Sf, v as _f, w as kf, x as Cf, y as Nf, z as Df, D as Af, F as Ff, H as xi, I as Tf, J as Of, K as Ef, M as If, N as Rf, O as Pf, P as Lf, Q as Mf, V as Bf, R as Ys, T as jf, U as Vf, W as $f, Z as xl, _ as Ba, $ as wl, a0 as zf, a1 as Zf, a2 as qf, a3 as Wf, a4 as Uf, a5 as Kf, a6 as Qf } from "./index-CCcCCEfU.js";
8
- import { a7 as u1, aa as d1, a8 as f1, a9 as m1, ab as h1 } from "./index-CCcCCEfU.js";
9
- import { A as g1, F as v1, c as b1, d as y1, b as x1, a as w1, o as S1, u as _1 } from "./F0HILActionConfirmation-ot92kVFT.js";
7
+ import { C as of, S as bi, a as lf, f as Ds, L as Bn, b as cf, A as uf, i as wr, c as hl, E as df, g as Nr, d as ff, e as mf, h as hf, j as bn, k as pl, u as pf, G as gf, l as vf, m as yi, r as bf, n as yf, o as gl, p as xf, B as vl, X as bl, Y as Xs, q as wf, s as yl, t as Sf, v as _f, w as kf, x as Cf, y as Nf, z as Df, D as Af, F as Ff, H as xi, I as Tf, J as Of, K as Ef, M as If, N as Rf, O as Pf, P as Lf, Q as Mf, V as Bf, R as Ys, T as jf, U as Vf, W as $f, Z as xl, _ as Ba, $ as wl, a0 as zf, a1 as Zf, a2 as qf, a3 as Wf, a4 as Uf, a5 as Kf, a6 as Qf } from "./index-8e9inWY-.js";
8
+ import { a7 as u1, aa as d1, a8 as f1, a9 as m1, ab as h1 } from "./index-8e9inWY-.js";
9
+ import { A as g1, F as v1, c as b1, d as y1, b as x1, a as w1, o as S1, u as _1 } from "./F0HILActionConfirmation-4KT5qQii.js";
10
10
  import { defaultTranslations as C1 } from "./i18n-provider-defaults.js";
11
11
  const Hf = {
12
12
  xs: 1,
@@ -408,7 +408,7 @@ export declare const defaultTranslations: {
408
408
  readonly unpinChat: "Unpin chat";
409
409
  readonly deleteChat: "Delete chat";
410
410
  readonly ask: "Ask One";
411
- readonly viewProfile: "View profile";
411
+ readonly view: "View";
412
412
  readonly tools: "Tools";
413
413
  readonly credits: {
414
414
  readonly title: "Credits";
@@ -445,6 +445,8 @@ export declare const defaultTranslations: {
445
445
  readonly actionLabel: "Get credits";
446
446
  };
447
447
  };
448
+ readonly attachFile: "Attach file";
449
+ readonly removeFile: "Remove";
448
450
  readonly growth: {
449
451
  readonly demoCard: {
450
452
  readonly title: "See {{moduleName}} in action";
@@ -737,11 +739,6 @@ declare module "gridstack" {
737
739
  }
738
740
 
739
741
 
740
- declare namespace Calendar {
741
- var displayName: string;
742
- }
743
-
744
-
745
742
  declare module "@tiptap/core" {
746
743
  interface Commands<ReturnType> {
747
744
  aiBlock: {
@@ -789,3 +786,8 @@ declare module "@tiptap/core" {
789
786
  };
790
787
  }
791
788
  }
789
+
790
+
791
+ declare namespace Calendar {
792
+ var displayName: string;
793
+ }
@@ -408,7 +408,7 @@ const e = {
408
408
  unpinChat: "Unpin chat",
409
409
  deleteChat: "Delete chat",
410
410
  ask: "Ask One",
411
- viewProfile: "View profile",
411
+ view: "View",
412
412
  tools: "Tools",
413
413
  credits: {
414
414
  title: "Credits",
@@ -445,6 +445,8 @@ const e = {
445
445
  actionLabel: "Get credits"
446
446
  }
447
447
  },
448
+ attachFile: "Attach file",
449
+ removeFile: "Remove",
448
450
  growth: {
449
451
  demoCard: {
450
452
  title: "See {{moduleName}} in action",