@nivaro/react 0.3.17 → 0.3.19

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.
Files changed (27) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +54 -1
  4. package/dist/index.js +243 -240
  5. package/dist/shared/components/CollectionBrowserView.js +439 -438
  6. package/dist/shared/components/ItemEditForm.js +3758 -3708
  7. package/dist/shared/components/ProfileView.js +38 -23
  8. package/dist/shared/components/RecordReadView.js +452 -430
  9. package/dist/shared/components/bulk/BulkActionButtons.js +113 -106
  10. package/dist/shared/components/chat/ChannelArchive.js +16 -17
  11. package/dist/shared/components/chat/ChatPanel.js +992 -930
  12. package/dist/shared/components/chat/Composer.js +307 -303
  13. package/dist/shared/components/chat/chat-core.js +8 -4
  14. package/dist/shared/components/chat/chat-drafts.js +60 -43
  15. package/dist/shared/components/help-videos/api.js +3 -0
  16. package/dist/shared/components/help-videos/library/HelpVideoLibrary.js +225 -177
  17. package/dist/shared/components/item-edit/InlineTableField.js +159 -158
  18. package/dist/shared/components/item-edit/RecordLiveSync.js +169 -155
  19. package/dist/shared/components/item-edit/RelationCombobox.js +274 -247
  20. package/dist/shared/components/item-edit/RowHistorySheet.js +62 -62
  21. package/dist/shared/components/item-edit/picker-search.js +28 -0
  22. package/dist/shared/components/panels/RevisionsPanel.js +268 -260
  23. package/dist/shared/components/profile/BrowserPushCard.js +135 -89
  24. package/dist/shared/components/profile/push-failure.js +76 -0
  25. package/dist/shared/lib/display-prefs.js +90 -0
  26. package/dist/shared/lib/theme-accents.js +21 -16
  27. package/package.json +1 -1
@@ -326,334 +326,338 @@ const es = lt(function({
326
326
  "data-chat-composer-closed": !0,
327
327
  children: P
328
328
  }
329
- ) : /* @__PURE__ */ c("div", { className: m("shrink-0 border-t", x.divider), "data-chat-composer-wrap": !0, children: [
330
- de && i.trim() && /* @__PURE__ */ r(
331
- "p",
332
- {
333
- className: "px-3 pt-1.5 text-[11px] text-slate-500 dark:text-slate-400",
334
- "data-chat-off-hours-note": !0,
335
- children: de
336
- }
337
- ),
338
- ee && /* @__PURE__ */ r(
339
- Ft,
340
- {
341
- kind: ee.kind,
342
- room: d,
343
- initialText: ee.text,
344
- parentId: f,
345
- onClose: () => te(null),
346
- th: x
347
- }
348
- ),
349
- k && /* @__PURE__ */ c("div", { className: "flex items-start gap-2 px-3 pt-2", "data-chat-quote-draft": !0, children: [
350
- /* @__PURE__ */ r(et, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-slate-400" }),
351
- /* @__PURE__ */ c("div", { className: "min-w-0 flex-1 text-[11.5px]", children: [
352
- /* @__PURE__ */ c("span", { className: "font-semibold text-slate-600 dark:text-slate-300", children: [
353
- "Quoting ",
354
- k.sender_name ?? "a message"
329
+ ) : (
330
+ // `relative`: the slash-command form (absolute, bottom-full) sits just above the composer.
331
+ // Unpositioned, it anchored to the room view and opened above the whole panel, off screen.
332
+ /* @__PURE__ */ c("div", { className: m("relative shrink-0 border-t", x.divider), "data-chat-composer-wrap": !0, children: [
333
+ de && i.trim() && /* @__PURE__ */ r(
334
+ "p",
335
+ {
336
+ className: "px-3 pt-1.5 text-[11px] text-slate-500 dark:text-slate-400",
337
+ "data-chat-off-hours-note": !0,
338
+ children: de
339
+ }
340
+ ),
341
+ ee && /* @__PURE__ */ r(
342
+ Ft,
343
+ {
344
+ kind: ee.kind,
345
+ room: d,
346
+ initialText: ee.text,
347
+ parentId: f,
348
+ onClose: () => te(null),
349
+ th: x
350
+ }
351
+ ),
352
+ k && /* @__PURE__ */ c("div", { className: "flex items-start gap-2 px-3 pt-2", "data-chat-quote-draft": !0, children: [
353
+ /* @__PURE__ */ r(et, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-slate-400" }),
354
+ /* @__PURE__ */ c("div", { className: "min-w-0 flex-1 text-[11.5px]", children: [
355
+ /* @__PURE__ */ c("span", { className: "font-semibold text-slate-600 dark:text-slate-300", children: [
356
+ "Quoting ",
357
+ k.sender_name ?? "a message"
358
+ ] }),
359
+ /* @__PURE__ */ r("p", { className: "truncate text-slate-500 dark:text-slate-400", children: k.deleted_at ? "Message removed" : k.message || "Attachment" })
355
360
  ] }),
356
- /* @__PURE__ */ r("p", { className: "truncate text-slate-500 dark:text-slate-400", children: k.deleted_at ? "Message removed" : k.message || "Attachment" })
361
+ /* @__PURE__ */ r(
362
+ "button",
363
+ {
364
+ type: "button",
365
+ onClick: v,
366
+ className: "rounded p-0.5 text-slate-400 hover:text-slate-700 dark:hover:text-slate-100",
367
+ "aria-label": "Stop quoting",
368
+ children: /* @__PURE__ */ r(Ae, { className: "h-3.5 w-3.5" })
369
+ }
370
+ )
357
371
  ] }),
358
- /* @__PURE__ */ r(
359
- "button",
372
+ F.length > 0 && /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-1.5 px-3 pt-2", children: F.map((e) => /* @__PURE__ */ c(
373
+ "span",
360
374
  {
361
- type: "button",
362
- onClick: v,
363
- className: "rounded p-0.5 text-slate-400 hover:text-slate-700 dark:hover:text-slate-100",
364
- "aria-label": "Stop quoting",
365
- children: /* @__PURE__ */ r(Ae, { className: "h-3.5 w-3.5" })
366
- }
367
- )
368
- ] }),
369
- F.length > 0 && /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-1.5 px-3 pt-2", children: F.map((e) => /* @__PURE__ */ c(
370
- "span",
371
- {
372
- className: m(
373
- "relative inline-flex max-w-[200px] items-center gap-1 overflow-hidden rounded-full border px-2 py-0.5 text-[11px]",
374
- e.error ? "border-red-300 text-red-700 dark:border-red-500/50 dark:text-red-300" : "border-slate-200 bg-slate-50 text-slate-600 dark:border-border dark:bg-muted dark:text-slate-300"
375
- ),
376
- title: e.error ?? e.name,
377
- "data-chat-upload": e.id ? "done" : e.error ? "failed" : "uploading",
378
- children: [
379
- !e.id && !e.error && /* @__PURE__ */ r(
380
- "span",
381
- {
382
- className: "absolute inset-y-0 left-0 bg-nvr-cyan/15 transition-[width]",
383
- style: { width: `${Math.round(e.progress * 100)}%` },
384
- "aria-hidden": !0
385
- }
375
+ className: m(
376
+ "relative inline-flex max-w-[200px] items-center gap-1 overflow-hidden rounded-full border px-2 py-0.5 text-[11px]",
377
+ e.error ? "border-red-300 text-red-700 dark:border-red-500/50 dark:text-red-300" : "border-slate-200 bg-slate-50 text-slate-600 dark:border-border dark:bg-muted dark:text-slate-300"
386
378
  ),
387
- /* @__PURE__ */ r(Fe, { className: "relative h-3 w-3 shrink-0 opacity-60" }),
388
- /* @__PURE__ */ r("span", { className: "relative truncate", children: e.error ? `${e.name} — ${e.error}` : e.name }),
389
- !e.id && !e.error && /* @__PURE__ */ c("span", { className: "relative tabular-nums text-slate-500", children: [
390
- Math.round(e.progress * 100),
391
- "%"
392
- ] }),
393
- /* @__PURE__ */ r(
394
- "button",
395
- {
396
- type: "button",
397
- onClick: () => Je(e.key),
398
- className: "relative text-slate-400 hover:text-red-500",
399
- "aria-label": e.id || e.error ? `Remove ${e.name}` : `Cancel ${e.name}`,
400
- title: e.id || e.error ? "Remove" : "Cancel upload",
401
- children: /* @__PURE__ */ r(Ae, { className: "h-3 w-3" })
402
- }
403
- )
404
- ]
405
- },
406
- e.key
407
- )) }),
408
- q && /* @__PURE__ */ c(
409
- "p",
410
- {
411
- className: "px-3 pt-1.5 text-[11px] text-slate-500 dark:text-slate-400",
412
- "data-chat-pasted-table": !0,
413
- children: [
414
- "Pasted as a table.",
415
- " ",
416
- /* @__PURE__ */ r(
417
- "button",
418
- {
419
- type: "button",
420
- onClick: Ve,
421
- className: "font-medium underline underline-offset-2",
422
- children: "Paste as plain text instead"
423
- }
424
- )
425
- ]
426
- }
427
- ),
428
- /* @__PURE__ */ c(
429
- "form",
430
- {
431
- className: m("relative", je ? "p-2" : "p-2.5"),
432
- onSubmit: (e) => {
433
- e.preventDefault(), $e();
379
+ title: e.error ?? e.name,
380
+ "data-chat-upload": e.id ? "done" : e.error ? "failed" : "uploading",
381
+ children: [
382
+ !e.id && !e.error && /* @__PURE__ */ r(
383
+ "span",
384
+ {
385
+ className: "absolute inset-y-0 left-0 bg-nvr-cyan/15 transition-[width]",
386
+ style: { width: `${Math.round(e.progress * 100)}%` },
387
+ "aria-hidden": !0
388
+ }
389
+ ),
390
+ /* @__PURE__ */ r(Fe, { className: "relative h-3 w-3 shrink-0 opacity-60" }),
391
+ /* @__PURE__ */ r("span", { className: "relative truncate", children: e.error ? `${e.name} — ${e.error}` : e.name }),
392
+ !e.id && !e.error && /* @__PURE__ */ c("span", { className: "relative tabular-nums text-slate-500", children: [
393
+ Math.round(e.progress * 100),
394
+ "%"
395
+ ] }),
396
+ /* @__PURE__ */ r(
397
+ "button",
398
+ {
399
+ type: "button",
400
+ onClick: () => Je(e.key),
401
+ className: "relative text-slate-400 hover:text-red-500",
402
+ "aria-label": e.id || e.error ? `Remove ${e.name}` : `Cancel ${e.name}`,
403
+ title: e.id || e.error ? "Remove" : "Cancel upload",
404
+ children: /* @__PURE__ */ r(Ae, { className: "h-3 w-3" })
405
+ }
406
+ )
407
+ ]
434
408
  },
435
- "data-chat-composer": !0,
436
- children: [
437
- we && /* @__PURE__ */ r(
438
- "div",
439
- {
440
- className: m(
441
- "absolute bottom-full left-2.5 z-20 mb-1 w-[300px] overflow-hidden rounded-xl border shadow-lg",
442
- x.surface,
443
- "border-slate-200 dark:border-border"
444
- ),
445
- "data-chat-picker": E ? "slash" : h !== null ? "mention" : "record",
446
- children: E ? /* @__PURE__ */ r(
447
- Et,
448
- {
449
- entries: L,
450
- index: C,
451
- onPick: Ce,
452
- accentSoft: x.accentSoft
453
- }
454
- ) : h !== null ? K.map((e, t) => /* @__PURE__ */ c(
455
- "button",
456
- {
457
- type: "button",
458
- onMouseDown: (s) => {
459
- s.preventDefault(), ve(e);
460
- },
461
- className: m(
462
- "flex w-full items-center gap-2 px-3 py-1.5 text-left text-[12.5px]",
463
- t === C ? x.accentSoft : "text-slate-700 dark:text-slate-200"
464
- ),
465
- children: [
466
- e.kind === "person" || e.kind === "bot" ? He(e.user_id, e.display_name) : /* @__PURE__ */ r("span", { className: "flex h-[22px] w-[22px] items-center justify-center rounded-full bg-slate-200 text-[11px] font-bold text-slate-600 dark:bg-muted dark:text-slate-300", children: "@" }),
467
- /* @__PURE__ */ c("span", { className: "min-w-0 flex-1 truncate", children: [
468
- e.kind === "here" || e.kind === "channel" ? `@${e.display_name}` : e.display_name,
469
- e.sub && /* @__PURE__ */ r("span", { className: "ml-1.5 text-[11px] text-slate-500 dark:text-slate-400", children: e.sub })
470
- ] })
471
- ]
472
- },
473
- e.user_id
474
- )) : J.map((e, t) => /* @__PURE__ */ c(
475
- "button",
476
- {
477
- type: "button",
478
- onMouseDown: (s) => {
479
- s.preventDefault(), Ne(e);
480
- },
481
- className: m(
482
- "flex w-full items-center gap-2 px-3 py-1.5 text-left text-[12.5px]",
483
- t === C ? x.accentSoft : "text-slate-700 dark:text-slate-200"
484
- ),
485
- children: [
486
- /* @__PURE__ */ r(tt, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
487
- /* @__PURE__ */ r("span", { className: "min-w-0 flex-1 truncate font-medium", children: e.label }),
488
- /* @__PURE__ */ r("span", { className: "shrink-0 text-[10.5px] capitalize text-slate-500 dark:text-slate-400", children: e.type })
489
- ]
490
- },
491
- `${e.type}:${e.token}`
492
- ))
493
- }
494
- ),
495
- /* @__PURE__ */ c(
496
- "div",
497
- {
498
- className: m(
499
- "rounded-lg border transition-colors focus-within:border-nvr-cyan",
500
- x.input,
501
- w && "border-red-400 focus-within:border-red-500 dark:border-red-500"
502
- ),
503
- "data-chat-composer-box": !0,
504
- children: [
505
- /* @__PURE__ */ r(
506
- "textarea",
409
+ e.key
410
+ )) }),
411
+ q && /* @__PURE__ */ c(
412
+ "p",
413
+ {
414
+ className: "px-3 pt-1.5 text-[11px] text-slate-500 dark:text-slate-400",
415
+ "data-chat-pasted-table": !0,
416
+ children: [
417
+ "Pasted as a table.",
418
+ " ",
419
+ /* @__PURE__ */ r(
420
+ "button",
421
+ {
422
+ type: "button",
423
+ onClick: Ve,
424
+ className: "font-medium underline underline-offset-2",
425
+ children: "Paste as plain text instead"
426
+ }
427
+ )
428
+ ]
429
+ }
430
+ ),
431
+ /* @__PURE__ */ c(
432
+ "form",
433
+ {
434
+ className: m("relative", je ? "p-2" : "p-2.5"),
435
+ onSubmit: (e) => {
436
+ e.preventDefault(), $e();
437
+ },
438
+ "data-chat-composer": !0,
439
+ children: [
440
+ we && /* @__PURE__ */ r(
441
+ "div",
442
+ {
443
+ className: m(
444
+ "absolute bottom-full left-2.5 z-20 mb-1 w-[300px] overflow-hidden rounded-xl border shadow-lg",
445
+ x.surface,
446
+ "border-slate-200 dark:border-border"
447
+ ),
448
+ "data-chat-picker": E ? "slash" : h !== null ? "mention" : "record",
449
+ children: E ? /* @__PURE__ */ r(
450
+ Et,
507
451
  {
508
- ref: N,
509
- rows: 1,
510
- value: i,
511
- onChange: (e) => Ye(e.target.value, e.target.selectionStart ?? e.target.value.length),
512
- onKeyDown: Ze,
513
- onPaste: Ge,
514
- placeholder: f ? "Reply in thread…" : `Message ${_}…`,
515
- className: "block min-h-9 w-full resize-none bg-transparent px-3 pb-1 pt-2 text-[12.5px] leading-[19px] outline-none placeholder:text-slate-500 dark:placeholder:text-slate-400",
516
- "aria-label": f ? "Reply in thread" : `Message ${_}`,
517
- "data-chat-input": !0
452
+ entries: L,
453
+ index: C,
454
+ onPick: Ce,
455
+ accentSoft: x.accentSoft
518
456
  }
457
+ ) : h !== null ? K.map((e, t) => /* @__PURE__ */ c(
458
+ "button",
459
+ {
460
+ type: "button",
461
+ onMouseDown: (s) => {
462
+ s.preventDefault(), ve(e);
463
+ },
464
+ className: m(
465
+ "flex w-full items-center gap-2 px-3 py-1.5 text-left text-[12.5px]",
466
+ t === C ? x.accentSoft : "text-slate-700 dark:text-slate-200"
467
+ ),
468
+ children: [
469
+ e.kind === "person" || e.kind === "bot" ? He(e.user_id, e.display_name) : /* @__PURE__ */ r("span", { className: "flex h-[22px] w-[22px] items-center justify-center rounded-full bg-slate-200 text-[11px] font-bold text-slate-600 dark:bg-muted dark:text-slate-300", children: "@" }),
470
+ /* @__PURE__ */ c("span", { className: "min-w-0 flex-1 truncate", children: [
471
+ e.kind === "here" || e.kind === "channel" ? `@${e.display_name}` : e.display_name,
472
+ e.sub && /* @__PURE__ */ r("span", { className: "ml-1.5 text-[11px] text-slate-500 dark:text-slate-400", children: e.sub })
473
+ ] })
474
+ ]
475
+ },
476
+ e.user_id
477
+ )) : J.map((e, t) => /* @__PURE__ */ c(
478
+ "button",
479
+ {
480
+ type: "button",
481
+ onMouseDown: (s) => {
482
+ s.preventDefault(), Ne(e);
483
+ },
484
+ className: m(
485
+ "flex w-full items-center gap-2 px-3 py-1.5 text-left text-[12.5px]",
486
+ t === C ? x.accentSoft : "text-slate-700 dark:text-slate-200"
487
+ ),
488
+ children: [
489
+ /* @__PURE__ */ r(tt, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
490
+ /* @__PURE__ */ r("span", { className: "min-w-0 flex-1 truncate font-medium", children: e.label }),
491
+ /* @__PURE__ */ r("span", { className: "shrink-0 text-[10.5px] capitalize text-slate-500 dark:text-slate-400", children: e.type })
492
+ ]
493
+ },
494
+ `${e.type}:${e.token}`
495
+ ))
496
+ }
497
+ ),
498
+ /* @__PURE__ */ c(
499
+ "div",
500
+ {
501
+ className: m(
502
+ "rounded-lg border transition-colors focus-within:border-nvr-cyan",
503
+ x.input,
504
+ w && "border-red-400 focus-within:border-red-500 dark:border-red-500"
519
505
  ),
520
- /* @__PURE__ */ c("div", { className: "flex items-center gap-0.5 px-1 pb-1", "data-chat-composer-tools": !0, children: [
506
+ "data-chat-composer-box": !0,
507
+ children: [
521
508
  /* @__PURE__ */ r(
522
- "input",
509
+ "textarea",
523
510
  {
524
- ref: fe,
525
- type: "file",
526
- multiple: !0,
527
- className: "hidden",
528
- onChange: (e) => {
529
- Q([...e.target.files ?? []]), e.target.value = "";
530
- }
511
+ ref: N,
512
+ rows: 1,
513
+ value: i,
514
+ onChange: (e) => Ye(e.target.value, e.target.selectionStart ?? e.target.value.length),
515
+ onKeyDown: Ze,
516
+ onPaste: Ge,
517
+ placeholder: f ? "Reply in thread…" : `Message ${_}…`,
518
+ className: "block min-h-9 w-full resize-none bg-transparent px-3 pb-1 pt-2 text-[12.5px] leading-[19px] outline-none placeholder:text-slate-500 dark:placeholder:text-slate-400",
519
+ "aria-label": f ? "Reply in thread" : `Message ${_}`,
520
+ "data-chat-input": !0
531
521
  }
532
522
  ),
533
- /* @__PURE__ */ r(Wt, { botName: T }),
534
- /* @__PURE__ */ r(
535
- Nt,
536
- {
537
- label: "Emoji",
538
- className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md p-0 text-slate-500 hover:bg-slate-200/70 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100 [&>svg]:h-4 [&>svg]:w-4",
539
- onPick: (e) => {
540
- const t = N.current, s = (t == null ? void 0 : t.selectionStart) ?? i.length, n = (t == null ? void 0 : t.selectionEnd) ?? i.length, a = e.startsWith(":") && s > 0 && !/\s$/.test(i.slice(0, s)) ? " " : "";
541
- p(i.slice(0, s) + a + e + i.slice(n)), requestAnimationFrame(() => {
542
- t == null || t.focus();
543
- const u = s + a.length + e.length;
544
- t == null || t.setSelectionRange(u, u);
545
- });
523
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-0.5 px-1 pb-1", "data-chat-composer-tools": !0, children: [
524
+ /* @__PURE__ */ r(
525
+ "input",
526
+ {
527
+ ref: fe,
528
+ type: "file",
529
+ multiple: !0,
530
+ className: "hidden",
531
+ onChange: (e) => {
532
+ Q([...e.target.files ?? []]), e.target.value = "";
533
+ }
546
534
  }
547
- }
548
- ),
549
- /* @__PURE__ */ r(
550
- "button",
551
- {
552
- type: "button",
553
- onClick: () => {
554
- var e;
555
- return (e = fe.current) == null ? void 0 : e.click();
556
- },
557
- className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-slate-500 transition-colors hover:bg-slate-200/70 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
558
- "aria-label": "Attach a file",
559
- title: "Attach a file (or paste / drop one)",
560
- children: /* @__PURE__ */ r(Fe, { className: "h-4 w-4", strokeWidth: 2 })
561
- }
562
- ),
563
- /* @__PURE__ */ r($t, { onClip: (e) => void ze(e), disabled: !!P }),
564
- /* @__PURE__ */ r(
565
- "button",
566
- {
567
- type: "button",
568
- onClick: () => pe((e) => !e),
569
- className: m(
570
- "flex h-7 w-7 shrink-0 items-center justify-center rounded-md transition-colors",
571
- w ? "bg-red-50 text-red-600 dark:bg-red-500/15 dark:text-red-300" : "text-slate-500 hover:bg-slate-200/70 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100"
572
- ),
573
- "aria-pressed": w,
574
- "aria-label": "Mark urgent",
575
- title: w ? "Urgent: reaches people even when they muted the room (5 per hour)" : "Mark urgent — breaks through mute for the people it is addressed to",
576
- "data-chat-urgent-toggle": w ? "on" : "off",
577
- children: /* @__PURE__ */ r(st, { className: "h-4 w-4", strokeWidth: 2 })
578
- }
579
- ),
580
- /* @__PURE__ */ c(Pe, { open: he, onOpenChange: me, children: [
581
- /* @__PURE__ */ r(We, { asChild: !0, children: /* @__PURE__ */ r(
535
+ ),
536
+ /* @__PURE__ */ r(Wt, { botName: T }),
537
+ /* @__PURE__ */ r(
538
+ Nt,
539
+ {
540
+ label: "Emoji",
541
+ className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md p-0 text-slate-500 hover:bg-slate-200/70 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100 [&>svg]:h-4 [&>svg]:w-4",
542
+ onPick: (e) => {
543
+ const t = N.current, s = (t == null ? void 0 : t.selectionStart) ?? i.length, n = (t == null ? void 0 : t.selectionEnd) ?? i.length, a = e.startsWith(":") && s > 0 && !/\s$/.test(i.slice(0, s)) ? " " : "";
544
+ p(i.slice(0, s) + a + e + i.slice(n)), requestAnimationFrame(() => {
545
+ t == null || t.focus();
546
+ const u = s + a.length + e.length;
547
+ t == null || t.setSelectionRange(u, u);
548
+ });
549
+ }
550
+ }
551
+ ),
552
+ /* @__PURE__ */ r(
582
553
  "button",
583
554
  {
584
555
  type: "button",
556
+ onClick: () => {
557
+ var e;
558
+ return (e = fe.current) == null ? void 0 : e.click();
559
+ },
585
560
  className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-slate-500 transition-colors hover:bg-slate-200/70 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
586
- "aria-label": "Send later",
587
- title: "Send later",
588
- "data-chat-schedule": !0,
589
- children: /* @__PURE__ */ r(nt, { className: "h-4 w-4", strokeWidth: 2 })
561
+ "aria-label": "Attach a file",
562
+ title: "Attach a file (or paste / drop one)",
563
+ children: /* @__PURE__ */ r(Fe, { className: "h-4 w-4", strokeWidth: 2 })
590
564
  }
591
- ) }),
592
- /* @__PURE__ */ c(Oe, { align: "end", side: "top", className: "w-[240px] p-2", children: [
593
- /* @__PURE__ */ r("p", { className: "px-1 pb-1.5 text-[12px] font-semibold text-slate-800 dark:text-slate-100", children: "Send this later" }),
594
- Xe.map((e) => /* @__PURE__ */ r(
565
+ ),
566
+ /* @__PURE__ */ r($t, { onClip: (e) => void ze(e), disabled: !!P }),
567
+ /* @__PURE__ */ r(
568
+ "button",
569
+ {
570
+ type: "button",
571
+ onClick: () => pe((e) => !e),
572
+ className: m(
573
+ "flex h-7 w-7 shrink-0 items-center justify-center rounded-md transition-colors",
574
+ w ? "bg-red-50 text-red-600 dark:bg-red-500/15 dark:text-red-300" : "text-slate-500 hover:bg-slate-200/70 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100"
575
+ ),
576
+ "aria-pressed": w,
577
+ "aria-label": "Mark urgent",
578
+ title: w ? "Urgent: reaches people even when they muted the room (5 per hour)" : "Mark urgent — breaks through mute for the people it is addressed to",
579
+ "data-chat-urgent-toggle": w ? "on" : "off",
580
+ children: /* @__PURE__ */ r(st, { className: "h-4 w-4", strokeWidth: 2 })
581
+ }
582
+ ),
583
+ /* @__PURE__ */ c(Pe, { open: he, onOpenChange: me, children: [
584
+ /* @__PURE__ */ r(We, { asChild: !0, children: /* @__PURE__ */ r(
595
585
  "button",
596
586
  {
597
587
  type: "button",
598
- onClick: () => De(e.at),
599
- className: "flex w-full items-center rounded-md px-2 py-1.5 text-left text-[12px] text-slate-700 hover:bg-muted dark:text-slate-200",
600
- children: e.label
601
- },
602
- e.label
603
- )),
604
- /* @__PURE__ */ c("div", { className: "mt-1.5 flex items-center gap-1 border-t border-slate-100 pt-2 dark:border-border", children: [
605
- /* @__PURE__ */ r(
606
- "input",
607
- {
608
- type: "datetime-local",
609
- value: re,
610
- onChange: (e) => qe(e.target.value),
611
- className: m(
612
- "h-8 min-w-0 flex-1 rounded-md border px-1.5 text-[11.5px] outline-none",
613
- x.input
614
- ),
615
- "aria-label": "Send at"
616
- }
617
- ),
618
- /* @__PURE__ */ r(
588
+ className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-slate-500 transition-colors hover:bg-slate-200/70 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
589
+ "aria-label": "Send later",
590
+ title: "Send later",
591
+ "data-chat-schedule": !0,
592
+ children: /* @__PURE__ */ r(nt, { className: "h-4 w-4", strokeWidth: 2 })
593
+ }
594
+ ) }),
595
+ /* @__PURE__ */ c(Oe, { align: "end", side: "top", className: "w-[240px] p-2", children: [
596
+ /* @__PURE__ */ r("p", { className: "px-1 pb-1.5 text-[12px] font-semibold text-slate-800 dark:text-slate-100", children: "Send this later" }),
597
+ Xe.map((e) => /* @__PURE__ */ r(
619
598
  "button",
620
599
  {
621
600
  type: "button",
622
- disabled: !re,
623
- onClick: () => De(new Date(re)),
624
- className: m(
625
- "h-8 rounded-md px-2 text-[11.5px] font-medium disabled:opacity-40",
626
- x.action
627
- ),
628
- children: "Set"
629
- }
630
- )
601
+ onClick: () => De(e.at),
602
+ className: "flex w-full items-center rounded-md px-2 py-1.5 text-left text-[12px] text-slate-700 hover:bg-muted dark:text-slate-200",
603
+ children: e.label
604
+ },
605
+ e.label
606
+ )),
607
+ /* @__PURE__ */ c("div", { className: "mt-1.5 flex items-center gap-1 border-t border-slate-100 pt-2 dark:border-border", children: [
608
+ /* @__PURE__ */ r(
609
+ "input",
610
+ {
611
+ type: "datetime-local",
612
+ value: re,
613
+ onChange: (e) => qe(e.target.value),
614
+ className: m(
615
+ "h-8 min-w-0 flex-1 rounded-md border px-1.5 text-[11.5px] outline-none",
616
+ x.input
617
+ ),
618
+ "aria-label": "Send at"
619
+ }
620
+ ),
621
+ /* @__PURE__ */ r(
622
+ "button",
623
+ {
624
+ type: "button",
625
+ disabled: !re,
626
+ onClick: () => De(new Date(re)),
627
+ className: m(
628
+ "h-8 rounded-md px-2 text-[11.5px] font-medium disabled:opacity-40",
629
+ x.action
630
+ ),
631
+ children: "Set"
632
+ }
633
+ )
634
+ ] })
631
635
  ] })
632
- ] })
633
- ] }),
634
- /* @__PURE__ */ r(
635
- "button",
636
- {
637
- type: "submit",
638
- disabled: !i.trim() && !F.some((e) => e.id) || oe,
639
- className: m(
640
- "ml-auto flex h-8 w-8 shrink-0 items-center justify-center rounded-md transition-[filter] hover:brightness-110 disabled:opacity-40",
641
- w ? "bg-red-600 text-white" : x.action
642
- ),
643
- "aria-label": w ? "Send urgent" : "Send",
644
- title: oe ? "Waiting for the upload to finish" : void 0,
645
- "data-chat-send": !0,
646
- children: /* @__PURE__ */ r(rt, { className: "h-4 w-4", strokeWidth: 2 })
647
- }
648
- )
649
- ] })
650
- ]
651
- }
652
- )
653
- ]
654
- }
655
- )
656
- ] });
636
+ ] }),
637
+ /* @__PURE__ */ r(
638
+ "button",
639
+ {
640
+ type: "submit",
641
+ disabled: !i.trim() && !F.some((e) => e.id) || oe,
642
+ className: m(
643
+ "ml-auto flex h-8 w-8 shrink-0 items-center justify-center rounded-md transition-[filter] hover:brightness-110 disabled:opacity-40",
644
+ w ? "bg-red-600 text-white" : x.action
645
+ ),
646
+ "aria-label": w ? "Send urgent" : "Send",
647
+ title: oe ? "Waiting for the upload to finish" : void 0,
648
+ "data-chat-send": !0,
649
+ children: /* @__PURE__ */ r(rt, { className: "h-4 w-4", strokeWidth: 2 })
650
+ }
651
+ )
652
+ ] })
653
+ ]
654
+ }
655
+ )
656
+ ]
657
+ }
658
+ )
659
+ ] })
660
+ );
657
661
  });
658
662
  function Wt({ botName: D }) {
659
663
  const d = [