@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.
- package/dist/component-status.js +1 -1
- package/dist/experimental.d.ts +15 -2
- package/dist/experimental.js +173 -172
- package/package.json +1 -1
package/dist/component-status.js
CHANGED
|
@@ -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-
|
|
7
|
+
generatedAt: "2026-10-31T12:18:02.614Z",
|
|
8
8
|
stats: {
|
|
9
9
|
total: 312,
|
|
10
10
|
byStatus: {
|
package/dist/experimental.d.ts
CHANGED
|
@@ -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
|
|
6677
|
-
*
|
|
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
|
package/dist/experimental.js
CHANGED
|
@@ -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,
|
|
20170
|
-
|
|
20171
|
-
channelId:
|
|
20172
|
-
replyToId:
|
|
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
|
|
20175
|
-
|
|
20176
|
-
let
|
|
20174
|
+
let re = Y(h);
|
|
20175
|
+
re.current = h;
|
|
20176
|
+
let L = K(async (n, r) => {
|
|
20177
20177
|
if (!a) return;
|
|
20178
|
-
|
|
20179
|
-
let { channelId: i, replyToId: o } =
|
|
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 =
|
|
20195
|
-
o && n.kind === "reply" && n.message.id === o &&
|
|
20194
|
+
let n = re.current;
|
|
20195
|
+
o && n.kind === "reply" && n.message.id === o && g();
|
|
20196
20196
|
}
|
|
20197
20197
|
} catch {
|
|
20198
|
-
|
|
20198
|
+
j(e.chat.fileUploadError);
|
|
20199
20199
|
} finally {
|
|
20200
|
-
|
|
20200
|
+
te(!1);
|
|
20201
20201
|
}
|
|
20202
20202
|
}, [
|
|
20203
20203
|
a,
|
|
20204
20204
|
t,
|
|
20205
|
-
|
|
20206
|
-
|
|
20205
|
+
g,
|
|
20206
|
+
j,
|
|
20207
20207
|
e.chat.fileUploadError
|
|
20208
|
-
]),
|
|
20209
|
-
searchMembers:
|
|
20210
|
-
everyoneLabel:
|
|
20211
|
-
}),
|
|
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 &&
|
|
20217
|
+
})), ...n && d.type === "group" ? [xP({
|
|
20218
20218
|
id: _P,
|
|
20219
20219
|
name: e.chat.mentionEveryone
|
|
20220
|
-
})] : []], [
|
|
20221
|
-
getComposer: K(() =>
|
|
20222
|
-
isEditing:
|
|
20223
|
-
toComposerMentions:
|
|
20224
|
-
}),
|
|
20225
|
-
|
|
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
|
-
|
|
20227
|
+
ae,
|
|
20228
20228
|
r,
|
|
20229
20229
|
i
|
|
20230
20230
|
]);
|
|
20231
20231
|
q(() => () => {
|
|
20232
20232
|
i?.();
|
|
20233
20233
|
}, [i]);
|
|
20234
|
-
let
|
|
20235
|
-
|
|
20234
|
+
let se = K((e) => {
|
|
20235
|
+
O.current.delete(e) && URL.revokeObjectURL(e);
|
|
20236
20236
|
}, []);
|
|
20237
20237
|
q(() => () => {
|
|
20238
|
-
for (let e of
|
|
20239
|
-
|
|
20238
|
+
for (let e of O.current) URL.revokeObjectURL(e);
|
|
20239
|
+
O.current.clear();
|
|
20240
20240
|
}, []);
|
|
20241
|
-
let
|
|
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
|
-
|
|
20244
|
-
}, [
|
|
20245
|
-
let
|
|
20246
|
-
if (t.length === 0 || !a || !
|
|
20247
|
-
if (
|
|
20248
|
-
|
|
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
|
-
|
|
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
|
|
20258
|
-
id: `att-${
|
|
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)
|
|
20263
|
+
for (let e of r) b.onFileAttached({
|
|
20264
20264
|
kind: YD(e.attachment),
|
|
20265
20265
|
source: n
|
|
20266
20266
|
});
|
|
20267
|
-
|
|
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-${
|
|
20271
|
+
id: r[t]?.id ?? `att-${k.current++}`,
|
|
20272
20272
|
status: "ready",
|
|
20273
20273
|
attachment: e
|
|
20274
20274
|
}));
|
|
20275
|
-
|
|
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)
|
|
20283
|
+
for (let e of r) se(e.attachment.url);
|
|
20284
20284
|
} catch {
|
|
20285
|
-
|
|
20286
|
-
for (let e of r)
|
|
20287
|
-
|
|
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
|
-
|
|
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
|
-
|
|
20300
|
-
|
|
20301
|
-
]),
|
|
20302
|
-
let t =
|
|
20303
|
-
n && n.kind !== "voice" && n.kind !== "location" &&
|
|
20304
|
-
let r =
|
|
20305
|
-
t?.status === "uploading" &&
|
|
20306
|
-
r ?
|
|
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
|
-
|
|
20310
|
-
|
|
20311
|
-
|
|
20312
|
-
]),
|
|
20313
|
-
for (let t of e) t.status === "uploading" &&
|
|
20314
|
-
}, [
|
|
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
|
-
|
|
20317
|
-
}, [
|
|
20318
|
-
let
|
|
20319
|
-
let e =
|
|
20320
|
-
e?.cancelRecording(), e?.clear(),
|
|
20321
|
-
}, [
|
|
20322
|
-
|
|
20323
|
-
id: `att-${
|
|
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
|
-
})))),
|
|
20327
|
+
})))), C.current?.loadDraft({
|
|
20327
20328
|
value: e.body,
|
|
20328
|
-
mentions:
|
|
20329
|
+
mentions: R(e)
|
|
20329
20330
|
});
|
|
20330
|
-
}, [
|
|
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 && (
|
|
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
|
-
|
|
20337
|
-
|
|
20338
|
-
|
|
20336
|
+
he,
|
|
20337
|
+
ae
|
|
20338
|
+
]), _e = J(() => ({
|
|
20339
|
+
retarget: ge,
|
|
20339
20340
|
abandonDraft: () => {
|
|
20340
|
-
|
|
20341
|
+
z(), ae.restore({ cleared: !0 });
|
|
20341
20342
|
}
|
|
20342
20343
|
}), [
|
|
20343
|
-
|
|
20344
|
-
|
|
20345
|
-
|
|
20344
|
+
ge,
|
|
20345
|
+
z,
|
|
20346
|
+
ae
|
|
20346
20347
|
]);
|
|
20347
20348
|
q(function() {
|
|
20348
|
-
return
|
|
20349
|
-
}, [
|
|
20350
|
-
return
|
|
20351
|
-
}, [
|
|
20352
|
-
let
|
|
20353
|
-
|
|
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
|
-
|
|
20356
|
-
|
|
20357
|
-
|
|
20358
|
-
]),
|
|
20359
|
-
|
|
20356
|
+
g,
|
|
20357
|
+
P,
|
|
20358
|
+
b
|
|
20359
|
+
]), ye = K(() => {
|
|
20360
|
+
F && b.onReplyCancelled({ messageId: F.id }), g();
|
|
20360
20361
|
}, [
|
|
20361
|
-
|
|
20362
|
-
|
|
20363
|
-
|
|
20364
|
-
]),
|
|
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 =
|
|
20368
|
-
|
|
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
|
-
}),
|
|
20374
|
+
}), g()) : (tl(d.id), ae.noteSent(), t({
|
|
20374
20375
|
body: a,
|
|
20375
20376
|
attachments: o.length > 0 ? o : void 0,
|
|
20376
|
-
replyToId:
|
|
20377
|
+
replyToId: F?.id,
|
|
20377
20378
|
mentions: s.length > 0 ? s : void 0,
|
|
20378
20379
|
mentionedEveryone: c || void 0
|
|
20379
|
-
}),
|
|
20380
|
+
}), T([]), g());
|
|
20380
20381
|
}, [
|
|
20381
|
-
|
|
20382
|
-
|
|
20383
|
-
|
|
20382
|
+
w,
|
|
20383
|
+
d.id,
|
|
20384
|
+
F,
|
|
20384
20385
|
t,
|
|
20385
|
-
|
|
20386
|
+
g,
|
|
20386
20387
|
i,
|
|
20387
|
-
|
|
20388
|
+
P,
|
|
20388
20389
|
n,
|
|
20389
|
-
|
|
20390
|
-
]),
|
|
20391
|
-
|
|
20392
|
-
|
|
20393
|
-
|
|
20394
|
-
|
|
20395
|
-
]),
|
|
20396
|
-
|
|
20397
|
-
|
|
20398
|
-
|
|
20399
|
-
]),
|
|
20400
|
-
|
|
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
|
-
}, [
|
|
20405
|
-
duration:
|
|
20405
|
+
}, [b]), we = {
|
|
20406
|
+
duration: S ? 0 : .18,
|
|
20406
20407
|
ease: Ga
|
|
20407
|
-
},
|
|
20408
|
+
}, Te = /* @__PURE__ */ Q(jn, {
|
|
20408
20409
|
initial: !1,
|
|
20409
20410
|
mode: "popLayout",
|
|
20410
|
-
children:
|
|
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:
|
|
20425
|
+
transition: we,
|
|
20425
20426
|
children: /* @__PURE__ */ Q(hP, {
|
|
20426
|
-
message:
|
|
20427
|
-
onRemove:
|
|
20427
|
+
message: P,
|
|
20428
|
+
onRemove: ve
|
|
20428
20429
|
})
|
|
20429
|
-
}, "edit-chip") :
|
|
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:
|
|
20444
|
+
transition: we,
|
|
20444
20445
|
children: /* @__PURE__ */ Q(gP, {
|
|
20445
|
-
message:
|
|
20446
|
-
onRemove:
|
|
20446
|
+
message: F,
|
|
20447
|
+
onRemove: ye
|
|
20447
20448
|
})
|
|
20448
20449
|
}, "reply-chip") : null
|
|
20449
|
-
}),
|
|
20450
|
-
items:
|
|
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: () =>
|
|
20456
|
+
onRemove: () => fe(e.id)
|
|
20456
20457
|
})
|
|
20457
20458
|
})),
|
|
20458
|
-
label: e.t(
|
|
20459
|
-
busy:
|
|
20460
|
-
reducedMotion:
|
|
20461
|
-
stripRef:
|
|
20462
|
-
}),
|
|
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:
|
|
20465
|
+
ref: E,
|
|
20465
20466
|
type: "file",
|
|
20466
20467
|
multiple: !0,
|
|
20467
20468
|
className: "hidden",
|
|
20468
20469
|
onChange: (e) => {
|
|
20469
|
-
|
|
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: () =>
|
|
20480
|
-
disabled: !
|
|
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:
|
|
20487
|
+
onSelect: Ce
|
|
20487
20488
|
})
|
|
20488
|
-
] }),
|
|
20489
|
+
] }), Oe = u === void 0 ? void 0 : e.chat.messageTooLongError.replace("{{maxCharacters}}", u.toLocaleString());
|
|
20489
20490
|
return {
|
|
20490
|
-
handleRef:
|
|
20491
|
+
handleRef: C,
|
|
20491
20492
|
"data-testid": "chat-composer-surface",
|
|
20492
|
-
onSend:
|
|
20493
|
-
sendKind:
|
|
20494
|
-
hasAttachments:
|
|
20495
|
-
sendBlocked:
|
|
20496
|
-
maxLength:
|
|
20497
|
-
maxLengthError:
|
|
20498
|
-
error:
|
|
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
|
-
...
|
|
20502
|
-
scopeKey:
|
|
20502
|
+
...ie,
|
|
20503
|
+
scopeKey: d.id
|
|
20503
20504
|
},
|
|
20504
20505
|
autocomplete: MP,
|
|
20505
20506
|
voice: {
|
|
20506
20507
|
onTranscribe: o,
|
|
20507
|
-
onAudio:
|
|
20508
|
-
disabled: BP(
|
|
20509
|
-
busy:
|
|
20510
|
-
onStarted:
|
|
20511
|
-
onCancelled:
|
|
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:
|
|
20514
|
+
onTextChange: oe,
|
|
20514
20515
|
onCleared: () => {
|
|
20515
|
-
i?.(),
|
|
20516
|
+
i?.(), ae.noteTextChange();
|
|
20516
20517
|
},
|
|
20517
|
-
onEscape:
|
|
20518
|
-
onArrowUpWhenEmpty:
|
|
20519
|
-
onPasteFiles:
|
|
20520
|
-
header:
|
|
20521
|
-
tray:
|
|
20522
|
-
toolbarStart:
|
|
20523
|
-
reducedMotion:
|
|
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, []);
|