@factorialco/f0-react 6.65.0 → 6.66.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.
@@ -6236,8 +6236,17 @@ export declare interface F0CarouselDialogProps extends Pick<F0DialogInternalProp
6236
6236
  */
6237
6237
  export declare const F0Chat: (props: F0ChatProps) => ReactNode;
6238
6238
 
6239
+ /** Attachment family, as the transcript classifies it (see
6240
+ * `utils/attachments.ts`). Note `video` is not an {@link F0ChatAttachment}
6241
+ * `kind` — videos are files with a video MIME type. */
6242
+ export declare type F0ChatAttachedKind = "image" | "video" | "document" | "file";
6243
+
6239
6244
  export declare type F0ChatAttachment = F0ChatImageAttachment | F0ChatFileAttachment | F0ChatLocationAttachment | F0ChatVoiceAttachment;
6240
6245
 
6246
+ /** How files reached the composer. Same story as {@link F0ChatReactionSource}:
6247
+ * {@link F0ChatRuntime.uploadFiles} cannot tell these apart. */
6248
+ export declare type F0ChatAttachSource = "button" | "drop" | "paste";
6249
+
6241
6250
  /**
6242
6251
  * Per-channel permissions. Everything is optional and defaults to today's
6243
6252
  * behavior, so hosts only express what their transport restricts (frozen /
@@ -6316,6 +6325,106 @@ export declare type F0ChatEditInput = {
6316
6325
  mentionedEveryone?: boolean;
6317
6326
  };
6318
6327
 
6328
+ export declare type F0ChatEmojiSource = "picker" | "autocomplete";
6329
+
6330
+ /**
6331
+ * Interactions F0Chat resolves internally, reported so the host can observe
6332
+ * them. Everything here is either invisible to {@link F0ChatRuntime} (it calls
6333
+ * no runtime method) or carries provenance a runtime call cannot express.
6334
+ *
6335
+ * F0 has no opinion on what these are for — it reports what the user did, not
6336
+ * what it means. Anything whose truth depends on the server (a send that may
6337
+ * still fail, a delete that may be rejected) is deliberately absent: the host
6338
+ * already sees those through the runtime, and only there does it learn the
6339
+ * outcome.
6340
+ *
6341
+ * Every handler is optional and independent — wire only the ones you need. No
6342
+ * payload carries message content, a URL, coordinates or a user id.
6343
+ *
6344
+ * Passed to `F0ChatProvider`; the provider keeps the object behind a ref, so it
6345
+ * may be rebuilt on every render without re-rendering the transcript.
6346
+ */
6347
+ export declare type F0ChatEvents = {
6348
+ onMessageCopied?: (p: {
6349
+ messageId: string;
6350
+ }) => void;
6351
+ onMessageInfoViewed?: (p: {
6352
+ messageId: string;
6353
+ }) => void;
6354
+ /** Pressing "Reply". Pair with `onReplyCancelled` to measure abandonment —
6355
+ * the host only sees replies that were actually sent. */
6356
+ onReplyStarted?: (p: {
6357
+ messageId: string;
6358
+ }) => void;
6359
+ /** Dismissing the reply chip. NOT fired when the reply is sent, nor when
6360
+ * switching to editing — only an explicit give-up counts. */
6361
+ onReplyCancelled?: (p: {
6362
+ messageId: string;
6363
+ }) => void;
6364
+ onEditStarted?: (p: {
6365
+ messageId: string;
6366
+ }) => void;
6367
+ /** Dismissing the edit chip. Same rule as {@link F0ChatEvents.onReplyCancelled}. */
6368
+ onEditCancelled?: (p: {
6369
+ messageId: string;
6370
+ }) => void;
6371
+ onReactionAdded?: (p: {
6372
+ messageId: string;
6373
+ emoji: string;
6374
+ source: F0ChatReactionSource;
6375
+ }) => void;
6376
+ onReactionRemoved?: (p: {
6377
+ messageId: string;
6378
+ emoji: string;
6379
+ source: F0ChatReactionSource;
6380
+ }) => void;
6381
+ /** Once per file, when the selection passes validation — before the upload
6382
+ * resolves, so it measures the affordance even when the upload then fails. */
6383
+ onFileAttached?: (p: {
6384
+ kind: F0ChatAttachedKind;
6385
+ source: F0ChatAttachSource;
6386
+ }) => void;
6387
+ onAttachmentRemoved?: (p: {
6388
+ kind: F0ChatAttachedKind;
6389
+ }) => void;
6390
+ onEmojiInserted?: (p: {
6391
+ emoji: string;
6392
+ source: F0ChatEmojiSource;
6393
+ }) => void;
6394
+ /** `isEveryone` distinguishes `@here` from a person. Who was mentioned is
6395
+ * deliberately not reported. */
6396
+ onMentionInserted?: (p: {
6397
+ isEveryone: boolean;
6398
+ }) => void;
6399
+ onVoiceRecordingStarted?: () => void;
6400
+ onVoiceRecordingCancelled?: () => void;
6401
+ /** First play of a voice note only — resuming after a pause does not re-fire. */
6402
+ onVoiceNotePlayed?: (p: {
6403
+ durationSeconds?: number;
6404
+ }) => void;
6405
+ onVoicePlaybackRateChanged?: (p: {
6406
+ rate: number;
6407
+ }) => void;
6408
+ /** Opening the image lightbox; `count` is how many images the group holds. */
6409
+ onImageOpened?: (p: {
6410
+ count: number;
6411
+ }) => void;
6412
+ onDocumentOpened?: (p: {
6413
+ kind: F0DocumentKind;
6414
+ }) => void;
6415
+ onAttachmentDownloaded?: (p: {
6416
+ kind: F0ChatAttachedKind;
6417
+ }) => void;
6418
+ onLocationOpened?: () => void;
6419
+ onLinkPreviewClicked?: () => void;
6420
+ onSearchOpened?: () => void;
6421
+ onSearchResultNavigated?: (p: {
6422
+ direction: "next" | "prev";
6423
+ }) => void;
6424
+ onJumpedToQuotedMessage?: () => void;
6425
+ onJumpedToBottom?: () => void;
6426
+ };
6427
+
6319
6428
  export declare type F0ChatFileAttachment = {
6320
6429
  kind: "file";
6321
6430
  url: string;
@@ -6533,8 +6642,11 @@ export declare type F0ChatProps = {
6533
6642
  * Makes a chat {@link F0ChatRuntime} available to the F0Chat UI. The host owns
6534
6643
  * the runtime (mock in stories, GetStream adapter in factorial); F0 only reads it.
6535
6644
  */
6536
- export declare const F0ChatProvider: ({ runtime, children, }: {
6645
+ export declare const F0ChatProvider: ({ runtime, events, children, }: {
6537
6646
  runtime: F0ChatRuntime;
6647
+ /** Observe interactions F0Chat resolves internally — see {@link F0ChatEvents}.
6648
+ * Rebuild it freely: it is read through a ref, never as a context value. */
6649
+ events?: F0ChatEvents;
6538
6650
  children: ReactNode;
6539
6651
  }) => ReactNode;
6540
6652
 
@@ -6549,6 +6661,11 @@ export declare type F0ChatReaction = {
6549
6661
  users?: F0ChatUser[];
6550
6662
  };
6551
6663
 
6664
+ /** Which affordance produced a reaction — the four are indistinguishable from
6665
+ * {@link F0ChatRuntime.toggleReaction}, which receives identical arguments from
6666
+ * all of them. */
6667
+ export declare type F0ChatReactionSource = "quickRow" | "menuPicker" | "existingPill" | "inlinePicker";
6668
+
6552
6669
  /**
6553
6670
  * The data + actions a host provides to drive the chat UI. F0 is headless: it
6554
6671
  * never touches the transport (GetStream, websockets, …). A mock runtime powers
@@ -7001,6 +7118,15 @@ declare type F0DialogSideControls = {
7001
7118
  next?: ReactNode;
7002
7119
  };
7003
7120
 
7121
+ /**
7122
+ * Document families the viewer can render. "pdf" is the default and keeps the
7123
+ * full toolbar (paging, zoom, print, download); the other kinds render a
7124
+ * lazy-loaded, read-only preview: "sheet" (xlsx/xls/csv) as an Excel-style
7125
+ * grid with one tab per sheet, "docx" through docx-preview with page layout,
7126
+ * and "text" as a rendered markdown document (`.md`) or monospaced source.
7127
+ */
7128
+ declare type F0DocumentKind = "pdf" | "sheet" | "docx" | "text";
7129
+
7004
7130
  /**
7005
7131
  * @experimental This is an experimental component, use it at your own risk.
7006
7132
  */
@@ -1,4 +1,4 @@
1
- import { v as s, t, A as i, a as o, J as r, ar as n, aq as l, as as d, B as S, w as C, y as g, L as m, ay as u, az as c, aI as b, x as h, C as P, ax as T, aJ as p, D as F, z as I, a3 as E, b1 as A, b8 as B, K as y, b0 as D, E as L, b as W, i as v, ag as k, ah as O, G as _, an as f, F as x, j as R, n as H, o as M, k as N, c as V, q as w, r as G, H as z, aM as U, aN as j, aB as q, am as Y, aR as K, at as X, a6 as $, aL as J, U as Q, ac as Z, O as aa, bc as ea, V as sa, P as ta, M as ia, N as oa, au as ra, R as na, a_ as la, b2 as da, S as Sa, a7 as Ca, a8 as ga, _ as ma, $ as ua, a0 as ca, Z as ba, a1 as ha, W as Pa, a2 as Ta, a4 as pa, a5 as Fa, a9 as Ia, aa as Ea, b6 as Aa, b5 as Ba, ap as ya, ao as Da, aw as La, aK as Wa, aH as va, av as ka, ab as Oa, aC as _a, b7 as fa, ba as xa, aA as Ra, aF as Ha, aD as Ma, bb as Na, aG as Va, aE as wa, b9 as Ga, d as za, af as Ua, b4 as ja, b3 as qa, aj as Ya, f as Ka, l as Xa, p as $a, g as Ja, h as Qa, aU as Za, aS as ae, ak as ee, al as se, aQ as te, aT as ie, e as oe, s as re, aY as ne, aP as le, aV as de, ad as Se, a$ as Ce, u as ge, ae as me, ai as ue, aO as ce, T as be, Q as he, I as Pe, Y as Te, X as pe, aZ as Fe, aX as Ie, aW as Ee } from "./experimental-DH8mvyWK.js";
1
+ import { v as s, t, A as i, a as o, J as r, ar as n, aq as l, as as d, B as S, w as C, y as g, L as m, ay as u, az as c, aI as b, x as h, C as P, ax as T, aJ as p, D as F, z as I, a3 as E, b1 as A, b8 as B, K as y, b0 as D, E as L, b as W, i as v, ag as k, ah as O, G as _, an as f, F as x, j as R, n as H, o as M, k as N, c as V, q as w, r as G, H as z, aM as U, aN as j, aB as q, am as Y, aR as K, at as X, a6 as $, aL as J, U as Q, ac as Z, O as aa, bc as ea, V as sa, P as ta, M as ia, N as oa, au as ra, R as na, a_ as la, b2 as da, S as Sa, a7 as Ca, a8 as ga, _ as ma, $ as ua, a0 as ca, Z as ba, a1 as ha, W as Pa, a2 as Ta, a4 as pa, a5 as Fa, a9 as Ia, aa as Ea, b6 as Aa, b5 as Ba, ap as ya, ao as Da, aw as La, aK as Wa, aH as va, av as ka, ab as Oa, aC as _a, b7 as fa, ba as xa, aA as Ra, aF as Ha, aD as Ma, bb as Na, aG as Va, aE as wa, b9 as Ga, d as za, af as Ua, b4 as ja, b3 as qa, aj as Ya, f as Ka, l as Xa, p as $a, g as Ja, h as Qa, aU as Za, aS as ae, ak as ee, al as se, aQ as te, aT as ie, e as oe, s as re, aY as ne, aP as le, aV as de, ad as Se, a$ as Ce, u as ge, ae as me, ai as ue, aO as ce, T as be, Q as he, I as Pe, Y as Te, X as pe, aZ as Fe, aX as Ie, aW as Ee } from "./experimental-DAwwevsK.js";
2
2
  import { dO as Be, ep as ye, eo as De, eC as Le, dl as We, em as ve, cd as ke, c3 as Oe, ca as _e, eh as fe, bY as xe, bY as Re, bR as He, ei as Me, cg as Ne, d$ as Ve, ci as we, eF as Ge, en as ze, ey as Ue, ez as je, d5 as qe, eD as Ye, k as Ke, dP as Xe, cM as $e, el as Je, er as Qe, eq as Ze, T as as, h as es, bS as ss, eA as ts, eG as is, eB as os, eE as rs, ex as ns, eu as ls, ew as ds, es as Ss, ej as Cs, ek as gs, ed as ms, ev as us, et as cs } from "./F0CanvasPanel-Db99rzA7.js";
3
3
  import { ax as hs, ay as Ps, a5 as Ts, a6 as ps, a3 as Fs, ag as Is, C as Es, a7 as As, aJ as Bs, ac as ys, aI as Ds, af as Ls, a4 as Ws, av as vs, aL as ks, aK as Os, an as _s, ah as fs, aq as xs, aO as Rs, a2 as Hs, as as Ms, ap as Ns, ak as Vs, aQ as ws, al as Gs, at as zs, au as Us, a8 as js, aM as qs, aN as Ys, am as Ks, aw as Xs, aF as $s, O as Js, aH as Qs, a9 as Zs, aS as at, ab as et, ad as st, aq as tt, aP as it, ar as ot, ao as rt, aR as nt, aa as lt, W as dt, ae as St, a1 as Ct, $ as gt, a0 as mt, aB as ut, aC as ct, az as bt, aG as ht, aj as Pt, ai as Tt, aD as pt, l as Ft, aA as It, aE as Et, y as At } from "./CoachmarkProvider-MMyod2tH.js";
4
4
  export {
package/dist/f0.js CHANGED
@@ -11,8 +11,8 @@ import { l as Ky, c as JN, d as Pd, r as Qy } from "./F0VideoPlayer-CLedAOOb.js"
11
11
  import { F as Ipe } from "./F0VideoPlayer-CLedAOOb.js";
12
12
  import { F as Ppe, p as Rpe } from "./index-Y07o6sHw.js";
13
13
  import { c as Bpe } from "./pdfWorker-BHf5i1AB.js";
14
- import { D as J5, E as Rd, G as H_, H as eI, I as tI, J as eG, K as tG, L as rG, M as nG, N as iG, F as aG } from "./F0AiProcessingOverlay-DwP54pFR.js";
15
- import { A as Vpe, C as Fpe, t as Gpe, s as Hpe, v as Wpe, y as $pe, l as Upe, i as Ype, q as Xpe, z as qpe, B as Zpe, p as jpe, r as Kpe, j as Qpe, e as Jpe, g as ege, k as tge, T as rge, w as nge, h as ige, a as age, n as oge, m as sge, o as lge, b as uge, f as cge, x as fge, c as hge, d as dge, u as vge } from "./F0AiProcessingOverlay-DwP54pFR.js";
14
+ import { D as J5, E as Rd, G as H_, H as eI, I as tI, J as eG, K as tG, L as rG, M as nG, N as iG, F as aG } from "./F0AiProcessingOverlay-Bdv0vSFe.js";
15
+ import { A as Vpe, C as Fpe, t as Gpe, s as Hpe, v as Wpe, y as $pe, l as Upe, i as Ype, q as Xpe, z as qpe, B as Zpe, p as jpe, r as Kpe, j as Qpe, e as Jpe, g as ege, k as tge, T as rge, w as nge, h as ige, a as age, n as oge, m as sge, o as lge, b as uge, f as cge, x as fge, c as hge, d as dge, u as vge } from "./F0AiProcessingOverlay-Bdv0vSFe.js";
16
16
  import { g as oG } from "./_commonjsHelpers-ByX85dGu.js";
17
17
  import { utils as wl, write as rI } from "./xlsx-CzlURDDb.js";
18
18
  import { defaultTranslations as gge } from "./i18n-provider-defaults.js";