@factorialco/f0-react 12.3.0 → 12.4.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.
@@ -4,7 +4,7 @@ import { useCallback as i, useEffect as a, useRef as o, useState as s } from "re
4
4
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
5
5
  //#region \0virtual:f0-component-status-data
6
6
  var u = {
7
- generatedAt: "2026-10-30T15:59:26.589Z",
7
+ generatedAt: "2026-10-31T12:18:02.614Z",
8
8
  stats: {
9
9
  total: 312,
10
10
  byStatus: {
@@ -6279,6 +6279,12 @@ type F0ChatHeaderAction = {
6279
6279
  * Ignored for `inline` actions — the row of icon buttons has no such state.
6280
6280
  */
6281
6281
  critical?: boolean;
6282
+ /**
6283
+ * `promote` draws an inline action as an upsell (the `promote` button): the
6284
+ * action exists, but the plan leaves it out and pressing it should explain
6285
+ * why. Ignored in the overflow menu and for toggles (`active` set).
6286
+ */
6287
+ variant?: "default" | "promote";
6282
6288
  };
6283
6289
  /** The id of the built-in Messages tab, always first and the default. */
6284
6290
  export declare const F0_CHAT_MESSAGES_TAB_ID = "messages";
@@ -6673,10 +6679,17 @@ type F0ChatRuntime = {
6673
6679
  /**
6674
6680
  * Maximum size in bytes for each file selected, dropped, or pasted into the
6675
6681
  * composer. When any file exceeds the limit, the composer rejects the whole
6676
- * batch before calling `uploadFiles` and keeps the validation error visible
6677
- * until the next attachment attempt. Omit for no size limit.
6682
+ * batch before calling `uploadFiles` and shows the limit as a transient
6683
+ * error, gone after a few seconds like the other composer warnings. Omit for
6684
+ * no size limit.
6678
6685
  */
6679
6686
  maxFileSizeBytes?: number;
6687
+ /**
6688
+ * Called when a batch is rejected for {@link maxFileSizeBytes}, after the
6689
+ * composer shows its error. For hosts whose limit is a plan's, to offer the
6690
+ * upgrade.
6691
+ */
6692
+ onFileTooLarge?: (files: File[], maxFileSizeBytes: number) => void;
6680
6693
  /**
6681
6694
  * Maximum number of characters allowed in a message. The composer keeps an
6682
6695
  * oversized draft in place and shows its existing validation banner instead
@@ -15977,7 +15977,7 @@ var hO = () => mO(aO, "useChatJump"), gO = (e) => {
15977
15977
  className: "flex shrink-0 items-center gap-0.5",
15978
15978
  children: [
15979
15979
  C.map((t) => t.active === void 0 ? /* @__PURE__ */ Q(er, {
15980
- variant: "ghost",
15980
+ variant: t.variant === "promote" ? "promote" : "ghost",
15981
15981
  hideLabel: !0,
15982
15982
  label: t.label,
15983
15983
  icon: t.icon,
@@ -20166,17 +20166,17 @@ var MP = {
20166
20166
  size: e.size,
20167
20167
  mimeType: e.type
20168
20168
  }, BP = (e, t) => e && t, VP = () => {
20169
- let e = W(), { sendMessage: t, editMessage: n, onInputActivity: r, stopTyping: i, uploadFiles: a, transcribe: o, maxFiles: s, maxFileSizeBytes: c, maxMessageCharacters: l, channel: u, searchMembers: d, capabilities: f } = gl(), p = !!a && zk("canUpload", u.type, f), { target: m } = _O(), { clearComposeTarget: h, registerComposerHandle: g } = vO(), _ = LP(), { registerFileDropHandler: v } = yO(), y = il(), { reducedMotion: b } = PO(), x = !!b, S = Y(null), [C, w] = X([]), T = Y(null), E = Y(null), D = Y(/* @__PURE__ */ new Set()), O = Y(0), { error: k, show: A, clear: j } = Rr(), M = m.kind === "edit", N = m.kind === "edit" ? m.message : null, P = m.kind === "reply" ? m.message : null, F = p, [I, ee] = X(!1), te = Y({ channelId: u.id });
20170
- te.current = {
20171
- channelId: u.id,
20172
- replyToId: P?.id
20169
+ let e = W(), { sendMessage: t, editMessage: n, onInputActivity: r, stopTyping: i, uploadFiles: a, transcribe: o, maxFiles: s, maxFileSizeBytes: c, onFileTooLarge: l, maxMessageCharacters: u, channel: d, searchMembers: f, capabilities: p } = gl(), m = !!a && zk("canUpload", d.type, p), { target: h } = _O(), { clearComposeTarget: g, registerComposerHandle: _ } = vO(), v = LP(), { registerFileDropHandler: y } = yO(), b = il(), { reducedMotion: x } = PO(), S = !!x, C = Y(null), [w, T] = X([]), E = Y(null), D = Y(null), O = Y(/* @__PURE__ */ new Set()), k = Y(0), { error: A, show: j, clear: M } = Rr(), N = h.kind === "edit", P = h.kind === "edit" ? h.message : null, F = h.kind === "reply" ? h.message : null, I = m, [ee, te] = X(!1), ne = Y({ channelId: d.id });
20170
+ ne.current = {
20171
+ channelId: d.id,
20172
+ replyToId: F?.id
20173
20173
  };
20174
- let ne = Y(m);
20175
- ne.current = m;
20176
- let re = K(async (n, r) => {
20174
+ let re = Y(h);
20175
+ re.current = h;
20176
+ let L = K(async (n, r) => {
20177
20177
  if (!a) return;
20178
- ee(!0);
20179
- let { channelId: i, replyToId: o } = te.current, s = n.type || "audio/webm", c = s.includes("mp4") ? "m4a" : s.includes("ogg") ? "ogg" : "webm", l = new File([n], `voice-note.${c}`, { type: s });
20178
+ te(!0);
20179
+ let { channelId: i, replyToId: o } = ne.current, s = n.type || "audio/webm", c = s.includes("mp4") ? "m4a" : s.includes("ogg") ? "ogg" : "webm", l = new File([n], `voice-note.${c}`, { type: s });
20180
20180
  try {
20181
20181
  let [e] = await a([l]);
20182
20182
  if (e && "url" in e) {
@@ -20191,88 +20191,88 @@ var MP = {
20191
20191
  name: l.name
20192
20192
  }]
20193
20193
  });
20194
- let n = ne.current;
20195
- o && n.kind === "reply" && n.message.id === o && h();
20194
+ let n = re.current;
20195
+ o && n.kind === "reply" && n.message.id === o && g();
20196
20196
  }
20197
20197
  } catch {
20198
- A(e.chat.fileUploadError);
20198
+ j(e.chat.fileUploadError);
20199
20199
  } finally {
20200
- ee(!1);
20200
+ te(!1);
20201
20201
  }
20202
20202
  }, [
20203
20203
  a,
20204
20204
  t,
20205
- h,
20206
- A,
20205
+ g,
20206
+ j,
20207
20207
  e.chat.fileUploadError
20208
- ]), L = CP({
20209
- searchMembers: d,
20210
- everyoneLabel: u.type === "group" ? e.chat.mentionEveryone : void 0
20211
- }), ie = K(({ mentions: t, mentionedEveryone: n }) => [...(t ?? []).map((e) => xP({
20208
+ ]), ie = CP({
20209
+ searchMembers: f,
20210
+ everyoneLabel: d.type === "group" ? e.chat.mentionEveryone : void 0
20211
+ }), R = K(({ mentions: t, mentionedEveryone: n }) => [...(t ?? []).map((e) => xP({
20212
20212
  id: e.id,
20213
20213
  name: e.name,
20214
20214
  avatar: e.avatar,
20215
20215
  subtitle: e.subtitle,
20216
20216
  profileHref: e.profileHref
20217
- })), ...n && u.type === "group" ? [xP({
20217
+ })), ...n && d.type === "group" ? [xP({
20218
20218
  id: _P,
20219
20219
  name: e.chat.mentionEveryone
20220
- })] : []], [u.type, e.chat.mentionEveryone]), R = PP({
20221
- getComposer: K(() => S.current, []),
20222
- isEditing: M,
20223
- toComposerMentions: ie
20224
- }), ae = K((e) => {
20225
- R.noteTextChange(), r(), e.trim().length === 0 && i?.();
20220
+ })] : []], [d.type, e.chat.mentionEveryone]), ae = PP({
20221
+ getComposer: K(() => C.current, []),
20222
+ isEditing: N,
20223
+ toComposerMentions: R
20224
+ }), oe = K((e) => {
20225
+ ae.noteTextChange(), r(), e.trim().length === 0 && i?.();
20226
20226
  }, [
20227
- R,
20227
+ ae,
20228
20228
  r,
20229
20229
  i
20230
20230
  ]);
20231
20231
  q(() => () => {
20232
20232
  i?.();
20233
20233
  }, [i]);
20234
- let oe = K((e) => {
20235
- D.current.delete(e) && URL.revokeObjectURL(e);
20234
+ let se = K((e) => {
20235
+ O.current.delete(e) && URL.revokeObjectURL(e);
20236
20236
  }, []);
20237
20237
  q(() => () => {
20238
- for (let e of D.current) URL.revokeObjectURL(e);
20239
- D.current.clear();
20238
+ for (let e of O.current) URL.revokeObjectURL(e);
20239
+ O.current.clear();
20240
20240
  }, []);
20241
- let se = C.some((e) => e.status === "uploading"), ce = J(() => [...C.filter(RP), ...C.filter((e) => !RP(e))], [C]), le = Y(0);
20241
+ let ce = w.some((e) => e.status === "uploading"), le = J(() => [...w.filter(RP), ...w.filter((e) => !RP(e))], [w]), ue = Y(0);
20242
20242
  q(() => {
20243
- le.current = C.length;
20244
- }, [C]);
20245
- let ue = K(async (t, n) => {
20246
- if (t.length === 0 || !a || !p) return;
20247
- if (j(), s !== void 0 && le.current + t.length > s) {
20248
- A(e.chat.tooManyFilesError.replace("{{maxFiles}}", String(s)));
20243
+ ue.current = w.length;
20244
+ }, [w]);
20245
+ let de = K(async (t, n) => {
20246
+ if (t.length === 0 || !a || !m) return;
20247
+ if (M(), s !== void 0 && ue.current + t.length > s) {
20248
+ j(e.chat.tooManyFilesError.replace("{{maxFiles}}", String(s)));
20249
20249
  return;
20250
20250
  }
20251
20251
  if (c !== void 0 && t.some((e) => e.size > c)) {
20252
- A(e.chat.fileTooLargeError.replace("{{maxFileSize}}", Oa(c)), { persistent: !0 });
20252
+ j(e.chat.fileTooLargeError.replace("{{maxFileSize}}", Oa(c))), l?.(t, c);
20253
20253
  return;
20254
20254
  }
20255
20255
  let r = t.map((e) => {
20256
20256
  let t = URL.createObjectURL(e);
20257
- return D.current.add(t), {
20258
- id: `att-${O.current++}`,
20257
+ return O.current.add(t), {
20258
+ id: `att-${k.current++}`,
20259
20259
  status: "uploading",
20260
20260
  attachment: zP(e, t)
20261
20261
  };
20262
20262
  });
20263
- for (let e of r) y.onFileAttached({
20263
+ for (let e of r) b.onFileAttached({
20264
20264
  kind: YD(e.attachment),
20265
20265
  source: n
20266
20266
  });
20267
- w((e) => [...e, ...r]);
20267
+ T((e) => [...e, ...r]);
20268
20268
  let i = new Set(r.map((e) => e.id));
20269
20269
  try {
20270
20270
  let e = (await a(t)).map((e, t) => ({
20271
- id: r[t]?.id ?? `att-${O.current++}`,
20271
+ id: r[t]?.id ?? `att-${k.current++}`,
20272
20272
  status: "ready",
20273
20273
  attachment: e
20274
20274
  }));
20275
- w((t) => {
20275
+ T((t) => {
20276
20276
  let n = new Map(e.map((e) => [e.id, e]));
20277
20277
  return t.flatMap((e) => {
20278
20278
  if (!i.has(e.id)) return [e];
@@ -20280,134 +20280,135 @@ var MP = {
20280
20280
  return t ? [t] : [];
20281
20281
  });
20282
20282
  });
20283
- for (let e of r) oe(e.attachment.url);
20283
+ for (let e of r) se(e.attachment.url);
20284
20284
  } catch {
20285
- w((e) => e.filter((e) => !i.has(e.id)));
20286
- for (let e of r) oe(e.attachment.url);
20287
- A(e.chat.fileUploadError);
20285
+ T((e) => e.filter((e) => !i.has(e.id)));
20286
+ for (let e of r) se(e.attachment.url);
20287
+ j(e.chat.fileUploadError);
20288
20288
  }
20289
20289
  }, [
20290
20290
  a,
20291
- p,
20291
+ m,
20292
20292
  s,
20293
20293
  c,
20294
+ l,
20295
+ M,
20294
20296
  j,
20295
- A,
20296
20297
  e.chat.tooManyFilesError,
20297
20298
  e.chat.fileTooLargeError,
20298
20299
  e.chat.fileUploadError,
20299
- oe,
20300
- y
20301
- ]), de = K((e) => {
20302
- let t = C.find((t) => t.id === e), n = t?.attachment;
20303
- n && n.kind !== "voice" && n.kind !== "location" && y.onAttachmentRemoved({ kind: YD(n) });
20304
- let r = C.some((t) => t.id !== e);
20305
- t?.status === "uploading" && oe(t.attachment.url), w((t) => t.filter((t) => t.id !== e)), requestAnimationFrame(() => {
20306
- r ? E.current?.focus() : S.current?.focus();
20300
+ se,
20301
+ b
20302
+ ]), fe = K((e) => {
20303
+ let t = w.find((t) => t.id === e), n = t?.attachment;
20304
+ n && n.kind !== "voice" && n.kind !== "location" && b.onAttachmentRemoved({ kind: YD(n) });
20305
+ let r = w.some((t) => t.id !== e);
20306
+ t?.status === "uploading" && se(t.attachment.url), T((t) => t.filter((t) => t.id !== e)), requestAnimationFrame(() => {
20307
+ r ? D.current?.focus() : C.current?.focus();
20307
20308
  });
20308
20309
  }, [
20309
- C,
20310
- oe,
20311
- y
20312
- ]), fe = K((e) => {
20313
- for (let t of e) t.status === "uploading" && oe(t.attachment.url);
20314
- }, [oe]);
20310
+ w,
20311
+ se,
20312
+ b
20313
+ ]), pe = K((e) => {
20314
+ for (let t of e) t.status === "uploading" && se(t.attachment.url);
20315
+ }, [se]);
20315
20316
  q(() => {
20316
- v((e) => void ue(e, "drop"));
20317
- }, [v, ue]);
20318
- let pe = K((e) => void ue(e, "paste"), [ue]), me = K(() => {
20319
- let e = S.current;
20320
- e?.cancelRecording(), e?.clear(), fe(C), w([]), e?.breakHistory();
20321
- }, [fe, C]), z = K((e) => {
20322
- w((t) => (fe(t), (e.attachments ?? []).filter((e) => e.kind !== "card").map((e) => ({
20323
- id: `att-${O.current++}`,
20317
+ y((e) => void de(e, "drop"));
20318
+ }, [y, de]);
20319
+ let me = K((e) => void de(e, "paste"), [de]), z = K(() => {
20320
+ let e = C.current;
20321
+ e?.cancelRecording(), e?.clear(), pe(w), T([]), e?.breakHistory();
20322
+ }, [pe, w]), he = K((e) => {
20323
+ T((t) => (pe(t), (e.attachments ?? []).filter((e) => e.kind !== "card").map((e) => ({
20324
+ id: `att-${k.current++}`,
20324
20325
  status: "ready",
20325
20326
  attachment: e
20326
- })))), S.current?.loadDraft({
20327
+ })))), C.current?.loadDraft({
20327
20328
  value: e.body,
20328
- mentions: ie(e)
20329
+ mentions: R(e)
20329
20330
  });
20330
- }, [ie, fe]), he = K((e, t) => {
20331
+ }, [R, pe]), ge = K((e, t) => {
20331
20332
  let n = e.kind === "edit" && t.kind !== "edit", r = e.kind === "edit" && t.kind === "edit" && e.message.id === t.message.id;
20332
- n && (me(), R.restore({ cleared: !0 })), t.kind === "edit" && !r && (e.kind !== "edit" && R.flush(), z(t.message)), t.kind !== "none" && S.current?.focus({ preventScroll: !0 });
20333
+ n && (z(), ae.restore({ cleared: !0 })), t.kind === "edit" && !r && (e.kind !== "edit" && ae.flush(), he(t.message)), t.kind !== "none" && C.current?.focus({ preventScroll: !0 });
20333
20334
  }, [
20334
- me,
20335
20335
  z,
20336
- R
20337
- ]), ge = J(() => ({
20338
- retarget: he,
20336
+ he,
20337
+ ae
20338
+ ]), _e = J(() => ({
20339
+ retarget: ge,
20339
20340
  abandonDraft: () => {
20340
- me(), R.restore({ cleared: !0 });
20341
+ z(), ae.restore({ cleared: !0 });
20341
20342
  }
20342
20343
  }), [
20343
- he,
20344
- me,
20345
- R
20344
+ ge,
20345
+ z,
20346
+ ae
20346
20347
  ]);
20347
20348
  q(function() {
20348
- return g(ge), () => g(null);
20349
- }, [g, ge]), q(function() {
20350
- return h;
20351
- }, [h]);
20352
- let _e = K(() => {
20353
- N && y.onEditCancelled({ messageId: N.id }), h();
20349
+ return _(_e), () => _(null);
20350
+ }, [_, _e]), q(function() {
20351
+ return g;
20352
+ }, [g]);
20353
+ let ve = K(() => {
20354
+ P && b.onEditCancelled({ messageId: P.id }), g();
20354
20355
  }, [
20355
- h,
20356
- N,
20357
- y
20358
- ]), ve = K(() => {
20359
- P && y.onReplyCancelled({ messageId: P.id }), h();
20356
+ g,
20357
+ P,
20358
+ b
20359
+ ]), ye = K(() => {
20360
+ F && b.onReplyCancelled({ messageId: F.id }), g();
20360
20361
  }, [
20361
- h,
20362
- y,
20363
- P
20364
- ]), ye = K(({ text: e, mentions: r }) => {
20362
+ g,
20363
+ b,
20364
+ F
20365
+ ]), be = K(({ text: e, mentions: r }) => {
20365
20366
  let a = e.trim();
20366
20367
  i?.();
20367
- let o = C.flatMap((e) => e.status === "ready" ? [e.attachment] : []), { mentions: s, mentionedEveryone: c } = wP(r);
20368
- N && n ? (n(N.id, {
20368
+ let o = w.flatMap((e) => e.status === "ready" ? [e.attachment] : []), { mentions: s, mentionedEveryone: c } = wP(r);
20369
+ P && n ? (n(P.id, {
20369
20370
  body: a,
20370
20371
  attachments: o.length > 0 ? o : void 0,
20371
20372
  mentions: s.length > 0 ? s : void 0,
20372
20373
  mentionedEveryone: c || void 0
20373
- }), h()) : (tl(u.id), R.noteSent(), t({
20374
+ }), g()) : (tl(d.id), ae.noteSent(), t({
20374
20375
  body: a,
20375
20376
  attachments: o.length > 0 ? o : void 0,
20376
- replyToId: P?.id,
20377
+ replyToId: F?.id,
20377
20378
  mentions: s.length > 0 ? s : void 0,
20378
20379
  mentionedEveryone: c || void 0
20379
- }), w([]), h());
20380
+ }), T([]), g());
20380
20381
  }, [
20381
- C,
20382
- u.id,
20383
- P,
20382
+ w,
20383
+ d.id,
20384
+ F,
20384
20385
  t,
20385
- h,
20386
+ g,
20386
20387
  i,
20387
- N,
20388
+ P,
20388
20389
  n,
20389
- R
20390
- ]), be = K((e) => m.kind !== "none" && (e.preventDefault(), M ? _e() : ve(), !0), [
20391
- m.kind,
20392
- M,
20393
- _e,
20394
- ve
20395
- ]), xe = K(() => C.length === 0 && m.kind === "none" && _(), [
20396
- C.length,
20397
- m.kind,
20398
- _
20399
- ]), Se = K((e) => {
20400
- S.current?.insertText(e), y.onEmojiInserted({
20390
+ ae
20391
+ ]), xe = K((e) => h.kind !== "none" && (e.preventDefault(), N ? ve() : ye(), !0), [
20392
+ h.kind,
20393
+ N,
20394
+ ve,
20395
+ ye
20396
+ ]), Se = K(() => w.length === 0 && h.kind === "none" && v(), [
20397
+ w.length,
20398
+ h.kind,
20399
+ v
20400
+ ]), Ce = K((e) => {
20401
+ C.current?.insertText(e), b.onEmojiInserted({
20401
20402
  emoji: e,
20402
20403
  source: "picker"
20403
20404
  });
20404
- }, [y]), Ce = {
20405
- duration: x ? 0 : .18,
20405
+ }, [b]), we = {
20406
+ duration: S ? 0 : .18,
20406
20407
  ease: Ga
20407
- }, we = /* @__PURE__ */ Q(jn, {
20408
+ }, Te = /* @__PURE__ */ Q(jn, {
20408
20409
  initial: !1,
20409
20410
  mode: "popLayout",
20410
- children: M && N ? /* @__PURE__ */ Q(V.div, {
20411
+ children: N && P ? /* @__PURE__ */ Q(V.div, {
20411
20412
  className: "overflow-hidden",
20412
20413
  initial: {
20413
20414
  height: 0,
@@ -20421,12 +20422,12 @@ var MP = {
20421
20422
  height: 0,
20422
20423
  opacity: 0
20423
20424
  },
20424
- transition: Ce,
20425
+ transition: we,
20425
20426
  children: /* @__PURE__ */ Q(hP, {
20426
- message: N,
20427
- onRemove: _e
20427
+ message: P,
20428
+ onRemove: ve
20428
20429
  })
20429
- }, "edit-chip") : P ? /* @__PURE__ */ Q(V.div, {
20430
+ }, "edit-chip") : F ? /* @__PURE__ */ Q(V.div, {
20430
20431
  className: "overflow-hidden",
20431
20432
  initial: {
20432
20433
  height: 0,
@@ -20440,33 +20441,33 @@ var MP = {
20440
20441
  height: 0,
20441
20442
  opacity: 0
20442
20443
  },
20443
- transition: Ce,
20444
+ transition: we,
20444
20445
  children: /* @__PURE__ */ Q(gP, {
20445
- message: P,
20446
- onRemove: ve
20446
+ message: F,
20447
+ onRemove: ye
20447
20448
  })
20448
20449
  }, "reply-chip") : null
20449
- }), Te = /* @__PURE__ */ Q(ui, {
20450
- items: ce.map((e) => ({
20450
+ }), Ee = /* @__PURE__ */ Q(ui, {
20451
+ items: le.map((e) => ({
20451
20452
  id: e.id,
20452
20453
  content: /* @__PURE__ */ Q(mP, {
20453
20454
  attachment: e.attachment,
20454
20455
  uploading: e.status === "uploading",
20455
- onRemove: () => de(e.id)
20456
+ onRemove: () => fe(e.id)
20456
20457
  })
20457
20458
  })),
20458
- label: e.t(C.length === 1 ? "chat.attachmentCount.one" : "chat.attachmentCount.other", { count: C.length }),
20459
- busy: se,
20460
- reducedMotion: x,
20461
- stripRef: E
20462
- }), Ee = (t) => /* @__PURE__ */ $(Z, { children: [
20459
+ label: e.t(w.length === 1 ? "chat.attachmentCount.one" : "chat.attachmentCount.other", { count: w.length }),
20460
+ busy: ce,
20461
+ reducedMotion: S,
20462
+ stripRef: D
20463
+ }), De = (t) => /* @__PURE__ */ $(Z, { children: [
20463
20464
  /* @__PURE__ */ Q("input", {
20464
- ref: T,
20465
+ ref: E,
20465
20466
  type: "file",
20466
20467
  multiple: !0,
20467
20468
  className: "hidden",
20468
20469
  onChange: (e) => {
20469
- ue(Array.from(e.target.files ?? []), "button"), e.target.value = "";
20470
+ de(Array.from(e.target.files ?? []), "button"), e.target.value = "";
20470
20471
  }
20471
20472
  }),
20472
20473
  /* @__PURE__ */ Q(er, {
@@ -20476,51 +20477,51 @@ var MP = {
20476
20477
  hideLabel: !0,
20477
20478
  label: e.chat.attachFile,
20478
20479
  icon: _r,
20479
- onClick: () => T.current?.click(),
20480
- disabled: !p || t === "transcribing"
20480
+ onClick: () => E.current?.click(),
20481
+ disabled: !m || t === "transcribing"
20481
20482
  }),
20482
20483
  /* @__PURE__ */ Q(Hv, {
20483
20484
  variant: "outline",
20484
20485
  size: "md",
20485
20486
  label: e.chat.addEmoji,
20486
- onSelect: Se
20487
+ onSelect: Ce
20487
20488
  })
20488
- ] }), De = l === void 0 ? void 0 : e.chat.messageTooLongError.replace("{{maxCharacters}}", l.toLocaleString());
20489
+ ] }), Oe = u === void 0 ? void 0 : e.chat.messageTooLongError.replace("{{maxCharacters}}", u.toLocaleString());
20489
20490
  return {
20490
- handleRef: S,
20491
+ handleRef: C,
20491
20492
  "data-testid": "chat-composer-surface",
20492
- onSend: ye,
20493
- sendKind: M ? "save" : "send",
20494
- hasAttachments: C.length > 0,
20495
- sendBlocked: se || I,
20496
- maxLength: l,
20497
- maxLengthError: De,
20498
- error: k,
20493
+ onSend: be,
20494
+ sendKind: N ? "save" : "send",
20495
+ hasAttachments: w.length > 0,
20496
+ sendBlocked: ce || ee,
20497
+ maxLength: u,
20498
+ maxLengthError: Oe,
20499
+ error: A,
20499
20500
  labels: { mentionPinnedDescription: e.chat.mentionEveryoneDescription },
20500
20501
  mentions: {
20501
- ...L,
20502
- scopeKey: u.id
20502
+ ...ie,
20503
+ scopeKey: d.id
20503
20504
  },
20504
20505
  autocomplete: MP,
20505
20506
  voice: {
20506
20507
  onTranscribe: o,
20507
- onAudio: F ? (e, t) => void re(e, t) : void 0,
20508
- disabled: BP(M, F),
20509
- busy: I,
20510
- onStarted: y.onVoiceRecordingStarted,
20511
- onCancelled: y.onVoiceRecordingCancelled
20508
+ onAudio: I ? (e, t) => void L(e, t) : void 0,
20509
+ disabled: BP(N, I),
20510
+ busy: ee,
20511
+ onStarted: b.onVoiceRecordingStarted,
20512
+ onCancelled: b.onVoiceRecordingCancelled
20512
20513
  },
20513
- onTextChange: ae,
20514
+ onTextChange: oe,
20514
20515
  onCleared: () => {
20515
- i?.(), R.noteTextChange();
20516
+ i?.(), ae.noteTextChange();
20516
20517
  },
20517
- onEscape: be,
20518
- onArrowUpWhenEmpty: xe,
20519
- onPasteFiles: p ? pe : void 0,
20520
- header: we,
20521
- tray: Te,
20522
- toolbarStart: Ee,
20523
- reducedMotion: x
20518
+ onEscape: xe,
20519
+ onArrowUpWhenEmpty: Se,
20520
+ onPasteFiles: m ? me : void 0,
20521
+ header: Te,
20522
+ tray: Ee,
20523
+ toolbarStart: De,
20524
+ reducedMotion: S
20524
20525
  };
20525
20526
  }, HP = (e) => e.dataTransfer?.types?.includes("Files"), UP = () => {
20526
20527
  let { dropFiles: e } = yO(), t = Y(0), [n, r] = X(!1), i = K((e) => HP(e) ? (e.preventDefault(), e.stopPropagation(), !0) : !1, []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@factorialco/f0-react",
3
- "version": "12.3.0",
3
+ "version": "12.4.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/factorialco/f0.git",