@estiva-app/ui 0.97.0 → 0.98.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/index.js CHANGED
@@ -4518,7 +4518,7 @@ function ownerOf(object, options, onAct) {
4518
4518
  value: action.current || void 0,
4519
4519
  options: [
4520
4520
  { value: "", label: "Unassigned" },
4521
- ...Object.entries(known).map(([pubkey, profile]) => ({ value: pubkey, label: profile.displayName ?? "\u2014", picture: profile.picture })).sort((a, b) => a.label.localeCompare(b.label))
4521
+ ...Object.entries(known).map(([pubkey, profile]) => ({ value: pubkey, label: profile.displayName ?? "\u2014", picture: profile.picture, ...profile.bot ? { bot: true } : {} })).sort((a, b) => a.label.localeCompare(b.label))
4522
4522
  ],
4523
4523
  ...onAct ? { onChange: (value) => onAct(action.id, value) } : {}
4524
4524
  },
@@ -4539,7 +4539,7 @@ function authorOf(object, directory) {
4539
4539
  if (!pubkey || !/^[0-9a-f]{64}$/.test(pubkey)) return void 0;
4540
4540
  const profile = object.people?.[pubkey] ?? directory?.[pubkey];
4541
4541
  if (!profile?.displayName) return void 0;
4542
- return { name: profile.displayName, ...profile.picture ? { picture: profile.picture } : {} };
4542
+ return { name: profile.displayName, ...profile.picture ? { picture: profile.picture } : {}, ...profile.bot ? { bot: true } : {} };
4543
4543
  }
4544
4544
  function linkedFrom(object, options) {
4545
4545
  const { slots, people } = object;
@@ -5208,9 +5208,17 @@ import { IconArrowNarrowRight, IconCircleCheck as IconCircleCheck4, IconDotsVert
5208
5208
 
5209
5209
  // src/ConversationMenu.tsx
5210
5210
  import { IconCircleCheck as IconCircleCheck3, IconCircleDashed as IconCircleDashed4, IconDotsVertical as IconDotsVertical3 } from "@tabler/icons-react";
5211
- import { jsx as jsx73, jsxs as jsxs51 } from "react/jsx-runtime";
5212
- function ConversationMenu({ resolved = false, onResolve, onReopen, children, onEdit, onDelete, open, onOpenChange, trigger }) {
5211
+ import { Fragment as Fragment18, jsx as jsx73, jsxs as jsxs51 } from "react/jsx-runtime";
5212
+ function ConversationMenu({ resolved = false, onResolve, onReopen, resolveHint, children, label, onEdit, editLabel = "Edit", after, onDelete, open, onOpenChange, trigger }) {
5213
5213
  const resolves = resolved ? onReopen : onResolve;
5214
+ const first = (resolves || children) && /* @__PURE__ */ jsxs51(Fragment18, { children: [
5215
+ resolves && (resolved ? /* @__PURE__ */ jsx73(MenuItem, { leading: /* @__PURE__ */ jsx73(IconCircleDashed4, { size: 16, stroke: 1.5, className: "text-text-secondary" }), label: "Reopen", onClick: onReopen }) : /* @__PURE__ */ jsx73(MenuItem, { leading: /* @__PURE__ */ jsx73(IconCircleCheck3, { size: 16, stroke: 1.5, className: "text-text-secondary" }), label: "Resolve", shortcut: resolveHint, onClick: onResolve })),
5216
+ children
5217
+ ] });
5218
+ const middle = (onEdit || after) && /* @__PURE__ */ jsxs51(Fragment18, { children: [
5219
+ onEdit && /* @__PURE__ */ jsx73(MenuItem, { label: editLabel, onClick: onEdit }),
5220
+ after
5221
+ ] });
5214
5222
  return /* @__PURE__ */ jsxs51(
5215
5223
  Menu,
5216
5224
  {
@@ -5220,10 +5228,10 @@ function ConversationMenu({ resolved = false, onResolve, onReopen, children, onE
5220
5228
  onOpenChange,
5221
5229
  className: "w-[244px]",
5222
5230
  children: [
5223
- resolves && (resolved ? /* @__PURE__ */ jsx73(MenuItem, { leading: /* @__PURE__ */ jsx73(IconCircleDashed4, { size: 16, stroke: 1.5, className: "text-text-secondary" }), label: "Reopen", onClick: onReopen }) : /* @__PURE__ */ jsx73(MenuItem, { leading: /* @__PURE__ */ jsx73(IconCircleCheck3, { size: 16, stroke: 1.5, className: "text-text-secondary" }), label: "Resolve", onClick: onResolve })),
5224
- children,
5225
- (resolves || children) && (onEdit || onDelete) && /* @__PURE__ */ jsx73(MenuSeparator, {}),
5226
- onEdit && /* @__PURE__ */ jsx73(MenuItem, { label: "Edit", onClick: onEdit }),
5231
+ first && (label ? /* @__PURE__ */ jsx73(MenuSection, { label, children: first }) : first),
5232
+ first && middle && /* @__PURE__ */ jsx73(MenuSeparator, {}),
5233
+ middle,
5234
+ onDelete && (first || middle) && /* @__PURE__ */ jsx73(MenuSeparator, {}),
5227
5235
  onDelete && /* @__PURE__ */ jsx73(MenuItem, { label: "Delete", destructive: true, onClick: onDelete })
5228
5236
  ]
5229
5237
  }
@@ -5323,14 +5331,14 @@ function ReactionRow({ reactions, options, nameOf, viewer, onToggle, className }
5323
5331
 
5324
5332
  // src/RepliesRow.tsx
5325
5333
  import { IconChevronRight as IconChevronRight4, IconMessage2 as IconMessage24 } from "@tabler/icons-react";
5326
- import { Fragment as Fragment18, jsx as jsx77, jsxs as jsxs53 } from "react/jsx-runtime";
5334
+ import { Fragment as Fragment19, jsx as jsx77, jsxs as jsxs53 } from "react/jsx-runtime";
5327
5335
  var ROW_CLASSES3 = "flex w-full items-center gap-2 pb-1.5 pl-8 pr-2";
5328
5336
  var OPEN_CLASSES = "border-accent-outline bg-accent-wash";
5329
5337
  var BOX_CLASSES = "group/replies flex shrink-0 items-center gap-2 rounded-lg border border-transparent px-2 py-1.5 transition-colors hover:border-accent-outline hover:bg-accent-wash";
5330
5338
  function RepliesRow({ count, faces, last, isNew = false, urgent = false, onOpen, open = false }) {
5331
5339
  const withFaces = !!faces && faces.length > 0;
5332
5340
  const label = `${count} ${count === 1 ? "reply" : "replies"}`;
5333
- const inner = /* @__PURE__ */ jsxs53(Fragment18, { children: [
5341
+ const inner = /* @__PURE__ */ jsxs53(Fragment19, { children: [
5334
5342
  withFaces && /* @__PURE__ */ jsx77("span", { className: "flex shrink-0 items-center", children: /* @__PURE__ */ jsx77(AvatarGroup, { size: 18, members: faces.map((f) => ({ name: f.name, picture: f.picture, bot: f.bot })) }) }),
5335
5343
  /* @__PURE__ */ jsx77(
5336
5344
  IconMessage24,
@@ -5354,7 +5362,7 @@ function RepliesRow({ count, faces, last, isNew = false, urgent = false, onOpen,
5354
5362
  }
5355
5363
  )
5356
5364
  ] });
5357
- const chip = isNew && /* @__PURE__ */ jsxs53(Fragment18, { children: [
5365
+ const chip = isNew && /* @__PURE__ */ jsxs53(Fragment19, { children: [
5358
5366
  /* @__PURE__ */ jsx77("span", { className: "h-0.5 w-0.5 shrink-0 rounded-full bg-text-muted" }),
5359
5367
  /* @__PURE__ */ jsx77(Chip, { type: urgent ? "warning" : "brand", label: "1 new" })
5360
5368
  ] });
@@ -5375,7 +5383,7 @@ function RepliesRow({ count, faces, last, isNew = false, urgent = false, onOpen,
5375
5383
 
5376
5384
  // src/ResolveDialog.tsx
5377
5385
  import { useId as useId5, useState as useState17 } from "react";
5378
- import { Fragment as Fragment19, jsx as jsx78, jsxs as jsxs54 } from "react/jsx-runtime";
5386
+ import { Fragment as Fragment20, jsx as jsx78, jsxs as jsxs54 } from "react/jsx-runtime";
5379
5387
  function ResolveDialog({ onResolve, onCancel, refused }) {
5380
5388
  const [note, setNote] = useState17("");
5381
5389
  const [busy, setBusy] = useState17(false);
@@ -5385,7 +5393,7 @@ function ResolveDialog({ onResolve, onCancel, refused }) {
5385
5393
  {
5386
5394
  title: "Resolve",
5387
5395
  onClose: onCancel,
5388
- footer: /* @__PURE__ */ jsxs54(Fragment19, { children: [
5396
+ footer: /* @__PURE__ */ jsxs54(Fragment20, { children: [
5389
5397
  /* @__PURE__ */ jsx78(Button, { variant: "muted", onClick: onCancel, children: "Cancel" }),
5390
5398
  /* @__PURE__ */ jsx78(Button, { variant: "resolve", type: "submit", form: formId, disabled: busy, children: "Resolve" })
5391
5399
  ] }),
@@ -5449,13 +5457,13 @@ function useFaceLine(root, active, toDot = false) {
5449
5457
  }
5450
5458
 
5451
5459
  // src/ConversationCard.tsx
5452
- import { Fragment as Fragment20, jsx as jsx79, jsxs as jsxs55 } from "react/jsx-runtime";
5453
- function Head({ author, time, timeHref, edited, isNew, urgent, meta }) {
5460
+ import { Fragment as Fragment21, jsx as jsx79, jsxs as jsxs55 } from "react/jsx-runtime";
5461
+ function Head({ author, time, timeHref, timeLabel = "Link to this", edited, isNew, urgent, meta }) {
5454
5462
  return /* @__PURE__ */ jsxs55("div", { className: "flex w-full items-center gap-2", children: [
5455
5463
  /* @__PURE__ */ jsxs55("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
5456
5464
  /* @__PURE__ */ jsx79("span", { "data-face": true, className: "relative flex shrink-0", children: /* @__PURE__ */ jsx79(Avatar, { size: 24, src: author.picture, alt: author.name, bot: author.bot }) }),
5457
5465
  /* @__PURE__ */ jsx79("span", { className: "min-w-0 truncate text-body-2-strong text-text-primary", children: author.name }),
5458
- timeHref ? /* @__PURE__ */ jsx79(WithTooltip, { label: "Link to this", wrapperClassName: "shrink-0", children: /* @__PURE__ */ jsx79(MetaText, { className: "contents", children: /* @__PURE__ */ jsx79(Link, { href: timeHref, variant: "quiet", "data-interactive": true, children: time }) }) }) : /* @__PURE__ */ jsx79(MetaText, { className: "shrink-0", children: time }),
5466
+ timeHref ? /* @__PURE__ */ jsx79(WithTooltip, { label: timeLabel, wrapperClassName: "shrink-0", children: /* @__PURE__ */ jsx79(MetaText, { className: "contents", children: /* @__PURE__ */ jsx79(Link, { href: timeHref, variant: "quiet", "data-interactive": true, children: time }) }) }) : /* @__PURE__ */ jsx79(MetaText, { className: "shrink-0", children: time }),
5459
5467
  /* @__PURE__ */ jsx79(EditedMarker, { edited }),
5460
5468
  meta
5461
5469
  ] }),
@@ -5487,9 +5495,8 @@ function ResolvedCheck({ by, note, at }) {
5487
5495
  "Resolved"
5488
5496
  ] }) });
5489
5497
  }
5490
- var FOLDED_WORDS_CLASSES = "[&>div]:line-clamp-1 [&>div]:max-h-[1lh] [&>div>*:not(p):not(ul):not(ol):not(blockquote):not(pre):not(div:only-child)]:hidden [&>div>div:only-child>*:not(p):not(ul):not(ol):not(blockquote):not(pre)]:hidden";
5491
- function Words({ children, oneLine = false }) {
5492
- return /* @__PURE__ */ jsx79("div", { className: cn("relative w-full break-words pb-2 pl-8 pr-2 pt-1", oneLine && FOLDED_WORDS_CLASSES), children: /* @__PURE__ */ jsx79("div", { className: "flex flex-col gap-2 text-body-2 text-text-secondary", children }) });
5498
+ function Words({ children }) {
5499
+ return /* @__PURE__ */ jsx79("div", { className: "relative w-full break-words pb-2 pl-8 pr-2 pt-1", children: /* @__PURE__ */ jsx79("div", { className: "flex flex-col gap-2 text-body-2 text-text-secondary", children }) });
5493
5500
  }
5494
5501
  function Reactions({ reactions, refused, readOnly }) {
5495
5502
  if ((!reactions || reactions.reactions.length === 0) && !refused) return null;
@@ -5535,7 +5542,7 @@ function useEditing(editing, onEditingChange) {
5535
5542
  return [now, set];
5536
5543
  }
5537
5544
  function ConversationCard(props) {
5538
- const { author, about, files, reactions, reactionRefused, isNew = false, urgent = false, own = false, editor, deleted = false, replies, onReply, resolved, onResolve, resolveRefused, onReopen, selected, onClick, onDelete, deleteNote, menu, className, children } = props;
5545
+ const { author, about, files, reactions, reactionRefused, isNew = false, urgent = false, own = false, editor, deleted = false, replies, onReply, resolved, noun = "comment", onResolve, resolveHint, resolveRefused, onReopen, selected, onClick, onDelete, deleteNote, menu, menuAfter, menuLabel, editLabel, className, children } = props;
5539
5546
  const readOnly = (props.readOnly ?? false) || deleted;
5540
5547
  const inThreadCard = useContext12(InThreadCard);
5541
5548
  const item = useContext12(InConversationItem);
@@ -5553,18 +5560,16 @@ function ConversationCard(props) {
5553
5560
  const root = useRef15(null);
5554
5561
  const dotLine = useFaceLine(root, toDot, true);
5555
5562
  const settle = () => requestAnimationFrame(() => setHovered(stillHere(root.current)));
5556
- const offersMenu = !!resolves || !!menu || own && (!!editor || !!onDelete);
5563
+ const offersMenu = !!resolves || !!menu || !!menuAfter || own && (!!editor || !!onDelete);
5557
5564
  const showStrip = hovered && !isEditing && !readOnly;
5558
5565
  const react = reactions?.onToggle;
5559
5566
  const press = onClick ?? (readOnly && !replies?.count ? void 0 : item?.toggle);
5560
5567
  const reply = onReply ?? item?.show;
5561
5568
  const marked = selected ?? (item && !item.under ? item.open : void 0);
5562
5569
  const under = !!item?.under;
5563
- const closed = !inThreadCard && !marked;
5564
- const folded = !!resolved && closed;
5565
5570
  const repliesRow = replies && replies.count > 0 && /* @__PURE__ */ jsx79(RepliesRow, { ...replies, onOpen: replies.onOpen ?? (under ? item?.toggle : void 0), open: replies.open ?? (under && !!item?.open), urgent });
5566
5571
  const aboutShown = !!about && !deleted;
5567
- return /* @__PURE__ */ jsxs55(Fragment20, { children: [
5572
+ return /* @__PURE__ */ jsxs55(Fragment21, { children: [
5568
5573
  /* @__PURE__ */ jsxs55(
5569
5574
  Card,
5570
5575
  {
@@ -5590,13 +5595,14 @@ function ConversationCard(props) {
5590
5595
  },
5591
5596
  children: [
5592
5597
  isEditing ? /* @__PURE__ */ jsx79(Editing, { author, children: editor(() => setEditing(false)) }) : /* @__PURE__ */ jsxs55("div", { "data-comment-body": true, className: "flex flex-col items-start px-2 pt-2", children: [
5593
- deleted ? /* @__PURE__ */ jsx79("p", { className: "w-full pb-2 pl-8 pr-2 text-caption italic text-text-muted", children: "This comment was deleted." }) : /* @__PURE__ */ jsxs55(Fragment20, { children: [
5598
+ deleted ? /* @__PURE__ */ jsx79("p", { className: "w-full pb-2 pl-8 pr-2 text-caption italic text-text-muted", children: "This comment was deleted." }) : /* @__PURE__ */ jsxs55(Fragment21, { children: [
5594
5599
  /* @__PURE__ */ jsx79(
5595
5600
  Head,
5596
5601
  {
5597
5602
  author,
5598
5603
  time: props.time,
5599
5604
  timeHref: props.timeHref,
5605
+ timeLabel: props.timeLabel,
5600
5606
  edited: props.edited,
5601
5607
  isNew,
5602
5608
  urgent,
@@ -5605,10 +5611,10 @@ function ConversationCard(props) {
5605
5611
  ),
5606
5612
  aboutShown && // Under the name, above the words (Katerina, 1 November).
5607
5613
  /* @__PURE__ */ jsx79("div", { className: "relative w-full pl-8 pr-2 pt-0.5", children: about }),
5608
- /* @__PURE__ */ jsx79(Words, { oneLine: folded, children })
5614
+ /* @__PURE__ */ jsx79(Words, { children })
5609
5615
  ] }),
5610
- !deleted && files && !folded && /* @__PURE__ */ jsx79("div", { className: "relative flex w-full flex-wrap items-start gap-2 pb-2 pl-8 pr-2", children: files }),
5611
- !folded && /* @__PURE__ */ jsx79(Reactions, { reactions, refused: reactionRefused, readOnly }),
5616
+ !deleted && files && /* @__PURE__ */ jsx79("div", { className: "relative flex w-full flex-wrap items-start gap-2 pb-2 pl-8 pr-2", children: files }),
5617
+ /* @__PURE__ */ jsx79(Reactions, { reactions, refused: reactionRefused, readOnly }),
5612
5618
  resolved?.note && // Who resolved it and the note, above the way into the replies; the check by the time says "Resolved" (Katerina, 1 November).
5613
5619
  /* @__PURE__ */ jsx79("div", { className: "relative w-full pb-1", children: /* @__PURE__ */ jsx79("div", { className: "-ml-2 w-[calc(100%+8px)]", children: /* @__PURE__ */ jsx79(EndedLine, { by: resolved.by, note: resolved.note, at: resolved.at }) }) }),
5614
5620
  repliesRow && /* @__PURE__ */ jsx79("div", { className: "relative w-full", children: repliesRow })
@@ -5641,7 +5647,11 @@ function ConversationCard(props) {
5641
5647
  resolved: !!resolved,
5642
5648
  onResolve: onResolve && (() => setResolving(true)),
5643
5649
  onReopen,
5650
+ resolveHint,
5651
+ label: menuLabel,
5644
5652
  onEdit: own && editor ? () => setEditing(true) : void 0,
5653
+ editLabel,
5654
+ after: menuAfter,
5645
5655
  onDelete: own && onDelete ? () => setDeleting(true) : void 0,
5646
5656
  children: menu
5647
5657
  }
@@ -5651,14 +5661,14 @@ function ConversationCard(props) {
5651
5661
  ]
5652
5662
  }
5653
5663
  ),
5654
- deleting && onDelete && /* @__PURE__ */ jsxs55(ConfirmDialog, { title: "Delete this comment?", confirmLabel: "Delete comment", destructive: true, onConfirm: onDelete, onClose: () => setDeleting(false), children: [
5655
- /* @__PURE__ */ jsx79("p", { children: deleteNote ?? "It is deleted for everyone." }),
5664
+ deleting && onDelete && /* @__PURE__ */ jsx79(ConfirmDialog, { title: `Delete this ${noun}?`, confirmLabel: `Delete ${noun}`, destructive: true, onConfirm: onDelete, onClose: () => setDeleting(false), children: deleteNote !== void 0 ? typeof deleteNote === "string" ? /* @__PURE__ */ jsx79("p", { children: deleteNote }) : deleteNote : /* @__PURE__ */ jsxs55(Fragment21, { children: [
5665
+ /* @__PURE__ */ jsx79("p", { children: "It is deleted for everyone." }),
5656
5666
  replies && replies.count > 0 && /* @__PURE__ */ jsxs55("p", { children: [
5657
5667
  "Its ",
5658
5668
  replies.count === 1 ? "reply stays" : `${replies.count} replies stay`,
5659
5669
  "."
5660
5670
  ] })
5661
- ] }),
5671
+ ] }) }),
5662
5672
  resolving && onResolve && /* @__PURE__ */ jsx79(
5663
5673
  ResolveDialog,
5664
5674
  {
@@ -5674,7 +5684,7 @@ function ConversationCard(props) {
5674
5684
  ] });
5675
5685
  }
5676
5686
  function ReplyCard(props) {
5677
- const { author, about, files, reactions, reactionRefused, isNew = false, urgent = false, own = false, editor, onDelete, deleteNote, menu, className, children } = props;
5687
+ const { author, about, files, reactions, reactionRefused, isNew = false, urgent = false, own = false, editor, onDelete, deleteNote, menu, menuAfter, menuLabel, editLabel, className, children } = props;
5678
5688
  const readOnly = props.readOnly ?? false;
5679
5689
  const [hovered, setHovered] = useState19(false);
5680
5690
  const [menuOpen, setMenuOpen] = useState19(false);
@@ -5682,11 +5692,11 @@ function ReplyCard(props) {
5682
5692
  const [deleting, setDeleting] = useState19(false);
5683
5693
  const [editing, setEditing] = useEditing(props.editing, props.onEditingChange);
5684
5694
  const isEditing = editing && !readOnly && !!editor;
5685
- const offersMenu = !!menu || own && (!!editor || !!onDelete);
5695
+ const offersMenu = !!menu || !!menuAfter || own && (!!editor || !!onDelete);
5686
5696
  const showStrip = hovered && !isEditing && !readOnly && (offersMenu || !!reactions?.onToggle);
5687
5697
  const root = useRef15(null);
5688
5698
  const settle = () => requestAnimationFrame(() => setHovered(stillHere(root.current)));
5689
- return /* @__PURE__ */ jsxs55(Fragment20, { children: [
5699
+ return /* @__PURE__ */ jsxs55(Fragment21, { children: [
5690
5700
  /* @__PURE__ */ jsxs55(
5691
5701
  Card,
5692
5702
  {
@@ -5710,7 +5720,7 @@ function ReplyCard(props) {
5710
5720
  },
5711
5721
  children: [
5712
5722
  isEditing ? /* @__PURE__ */ jsx79(Editing, { author, children: editor(() => setEditing(false)) }) : /* @__PURE__ */ jsxs55("div", { className: "flex flex-col items-start px-2 pt-2", children: [
5713
- /* @__PURE__ */ jsx79(Head, { author, time: props.time, timeHref: props.timeHref, edited: props.edited, isNew, urgent }),
5723
+ /* @__PURE__ */ jsx79(Head, { author, time: props.time, timeHref: props.timeHref, timeLabel: props.timeLabel, edited: props.edited, isNew, urgent }),
5714
5724
  about && /* @__PURE__ */ jsx79("div", { className: "w-full pl-8 pr-2 pt-0.5", children: about }),
5715
5725
  /* @__PURE__ */ jsx79(Words, { children }),
5716
5726
  files && /* @__PURE__ */ jsx79("div", { className: "flex w-full flex-wrap items-start gap-2 pb-2 pl-8 pr-2", children: files }),
@@ -5735,7 +5745,10 @@ function ReplyCard(props) {
5735
5745
  setMenuOpen(next);
5736
5746
  if (!next) settle();
5737
5747
  },
5748
+ label: menuLabel,
5738
5749
  onEdit: own && editor ? () => setEditing(true) : void 0,
5750
+ editLabel,
5751
+ after: menuAfter,
5739
5752
  onDelete: own && onDelete ? () => setDeleting(true) : void 0,
5740
5753
  children: menu
5741
5754
  }
@@ -5745,12 +5758,12 @@ function ReplyCard(props) {
5745
5758
  ]
5746
5759
  }
5747
5760
  ),
5748
- deleting && onDelete && /* @__PURE__ */ jsx79(ConfirmDialog, { title: "Delete this reply?", confirmLabel: "Delete reply", destructive: true, onConfirm: onDelete, onClose: () => setDeleting(false), children: /* @__PURE__ */ jsx79("p", { children: deleteNote ?? "It is deleted for everyone." }) })
5761
+ deleting && onDelete && /* @__PURE__ */ jsx79(ConfirmDialog, { title: "Delete this reply?", confirmLabel: "Delete reply", destructive: true, onConfirm: onDelete, onClose: () => setDeleting(false), children: deleteNote === void 0 ? /* @__PURE__ */ jsx79("p", { children: "It is deleted for everyone." }) : typeof deleteNote === "string" ? /* @__PURE__ */ jsx79("p", { children: deleteNote }) : deleteNote })
5749
5762
  ] });
5750
5763
  }
5751
5764
 
5752
5765
  // src/ConversationLayout.tsx
5753
- import { useEffect as useEffect10, useLayoutEffect as useLayoutEffect7, useRef as useRef16, useState as useState20 } from "react";
5766
+ import { Fragment as Fragment22, useEffect as useEffect10, useLayoutEffect as useLayoutEffect7, useRef as useRef16, useState as useState20 } from "react";
5754
5767
 
5755
5768
  // src/Panel.tsx
5756
5769
  import { jsx as jsx80, jsxs as jsxs56 } from "react/jsx-runtime";
@@ -5779,10 +5792,10 @@ function Panel(props) {
5779
5792
  }
5780
5793
 
5781
5794
  // src/ConversationLayout.tsx
5782
- import { Fragment as Fragment21, jsx as jsx81, jsxs as jsxs57 } from "react/jsx-runtime";
5795
+ import { Fragment as Fragment23, jsx as jsx81, jsxs as jsxs57 } from "react/jsx-runtime";
5783
5796
  function List({ items, open, under, above, loading, empty, change, caret }) {
5784
5797
  if (loading) return /* @__PURE__ */ jsx81(SkeletonConversation, {});
5785
- if (items.length === 0) return /* @__PURE__ */ jsx81(EmptyState, { scope: "section", message: empty });
5798
+ if (items.length === 0) return typeof empty === "string" ? /* @__PURE__ */ jsx81(EmptyState, { scope: "section", message: empty }) : /* @__PURE__ */ jsx81(Fragment23, { children: empty });
5786
5799
  const stateOf = (item) => change && item.thread ? {
5787
5800
  under,
5788
5801
  open: open === item.id,
@@ -5791,14 +5804,35 @@ function List({ items, open, under, above, loading, empty, change, caret }) {
5791
5804
  } : null;
5792
5805
  const draw2 = (item) => {
5793
5806
  if (!under) {
5794
- return /* @__PURE__ */ jsx81("div", { "data-conversation-item": item.id, className: "flex flex-col", children: /* @__PURE__ */ jsx81(InConversationItem.Provider, { value: stateOf(item), children: item.card }) }, item.id);
5807
+ return /* @__PURE__ */ jsxs57(Fragment22, { children: [
5808
+ item.before,
5809
+ /* @__PURE__ */ jsx81("div", { "data-conversation-item": item.id, className: "flex flex-col", children: /* @__PURE__ */ jsx81(InConversationItem.Provider, { value: stateOf(item), children: item.card }) })
5810
+ ] }, item.id);
5795
5811
  }
5796
5812
  return /* @__PURE__ */ jsx81(UnderItem, { item, isOpen: open === item.id && !!item.thread, state: stateOf(item), caret }, item.id);
5797
5813
  };
5798
5814
  if (!under) {
5799
- return /* @__PURE__ */ jsxs57(Fragment21, { children: [
5815
+ const stretches = [];
5816
+ const seen = /* @__PURE__ */ new Map();
5817
+ for (const item of items) {
5818
+ const last = stretches[stretches.length - 1];
5819
+ if (last && last.day === item.day) {
5820
+ last.items.push(item);
5821
+ continue;
5822
+ }
5823
+ const name = item.day ?? "";
5824
+ const count = (seen.get(name) ?? 0) + 1;
5825
+ seen.set(name, count);
5826
+ stretches.push({ key: `${item.day === void 0 ? "no-day" : `day:${name}`}#${count}`, day: item.day, items: [item] });
5827
+ }
5828
+ return /* @__PURE__ */ jsxs57(Fragment23, { children: [
5800
5829
  above,
5801
- items.map(draw2)
5830
+ stretches.map(
5831
+ (stretch) => stretch.day === void 0 ? /* @__PURE__ */ jsx81(Fragment22, { children: stretch.items.map(draw2) }, stretch.key) : /* @__PURE__ */ jsxs57("div", { className: "flex flex-col gap-2", children: [
5832
+ /* @__PURE__ */ jsx81(Divider, { look: "section", label: stretch.day, sticky: true }),
5833
+ stretch.items.map(draw2)
5834
+ ] }, stretch.key)
5835
+ )
5802
5836
  ] });
5803
5837
  }
5804
5838
  const resolved = items.filter((item) => item.resolved);
@@ -5815,7 +5849,7 @@ function List({ items, open, under, above, loading, empty, change, caret }) {
5815
5849
  children: list.map(draw2)
5816
5850
  }
5817
5851
  );
5818
- return /* @__PURE__ */ jsxs57(Fragment21, { children: [
5852
+ return /* @__PURE__ */ jsxs57(Fragment23, { children: [
5819
5853
  above,
5820
5854
  items.filter((item) => !item.resolved && !item.gone).map(draw2),
5821
5855
  group("On deleted blocks", gone),
@@ -5848,7 +5882,24 @@ function UnderItem({ item, isOpen, state, caret }) {
5848
5882
  }
5849
5883
  );
5850
5884
  }
5851
- function ConversationLayout({ threads, items, open, onOpenChange, box, above, loading = false, empty = "No comments yet.", header, title = "Comments", actions, className }) {
5885
+ function ConversationLayout({
5886
+ threads,
5887
+ items,
5888
+ open,
5889
+ onOpenChange,
5890
+ box,
5891
+ above,
5892
+ below,
5893
+ top,
5894
+ loading = false,
5895
+ empty = "No comments yet.",
5896
+ header,
5897
+ title = "Comments",
5898
+ actions,
5899
+ bodyRef,
5900
+ onBodyScroll,
5901
+ className
5902
+ }) {
5852
5903
  const body = useRef16(null);
5853
5904
  const pressed2 = useRef16(null);
5854
5905
  const itemAt = (id) => body.current?.querySelector(`[data-conversation-item="${CSS.escape(id)}"]`) ?? null;
@@ -5880,11 +5931,28 @@ function ConversationLayout({ threads, items, open, onOpenChange, box, above, lo
5880
5931
  }
5881
5932
  const opened = items.find((item) => item.id === open)?.thread;
5882
5933
  return /* @__PURE__ */ jsxs57("div", { className: cn("flex min-h-0 min-w-0 flex-1", className), children: [
5883
- /* @__PURE__ */ jsxs57("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
5884
- header,
5885
- /* @__PURE__ */ jsx81(ScrollArea, { className: "min-h-0 flex-1", contentClassName: "flex flex-col gap-2 p-4", children: /* @__PURE__ */ jsx81(List, { items, open, under: false, above, loading, empty, change, caret }) }),
5886
- box && /* @__PURE__ */ jsx81("div", { className: "shrink-0 p-3", children: box })
5887
- ] }),
5934
+ /* @__PURE__ */ jsx81(
5935
+ ErrorBoundary,
5936
+ {
5937
+ label: "conversation",
5938
+ frame: (message) => /* @__PURE__ */ jsxs57("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
5939
+ /* @__PURE__ */ jsx81(ContainerHeader, { title }),
5940
+ /* @__PURE__ */ jsx81("div", { className: "flex min-h-0 flex-1 flex-col px-4", children: message })
5941
+ ] }),
5942
+ children: /* @__PURE__ */ jsxs57("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
5943
+ header,
5944
+ /* @__PURE__ */ jsxs57(ScrollArea, { className: "min-h-0 flex-1", viewportRef: bodyRef, onScroll: onBodyScroll, contentClassName: "flex min-h-full flex-col", children: [
5945
+ top != null && top !== false && top !== "" && /* @__PURE__ */ jsx81("div", { className: "shrink-0 px-4 pt-4", children: top }),
5946
+ /* @__PURE__ */ jsx81("div", { className: "min-h-0 flex-1" }),
5947
+ /* @__PURE__ */ jsxs57("div", { className: "flex shrink-0 flex-col gap-2 p-4", children: [
5948
+ /* @__PURE__ */ jsx81(List, { items, open, under: false, above, loading, empty, change, caret }),
5949
+ !loading && below
5950
+ ] })
5951
+ ] }),
5952
+ box && /* @__PURE__ */ jsx81("div", { className: "shrink-0 p-3", children: box })
5953
+ ] })
5954
+ }
5955
+ ),
5888
5956
  opened && /* @__PURE__ */ jsx81("div", { className: "flex w-[384px] shrink-0 flex-col border-l border-border-subtle", children: /* @__PURE__ */ jsx81(caretOnOpen.Provider, { value: caret, children: opened }) })
5889
5957
  ] });
5890
5958
  }
@@ -5901,11 +5969,11 @@ function QuotedLine({ words, state = "here", label }) {
5901
5969
  }
5902
5970
 
5903
5971
  // src/ReactionHorizon.tsx
5904
- import { Fragment as Fragment22, jsxs as jsxs59 } from "react/jsx-runtime";
5972
+ import { Fragment as Fragment24, jsxs as jsxs59 } from "react/jsx-runtime";
5905
5973
  function ReactionHorizon({ limit, omitted, cut = false }) {
5906
5974
  if (omitted <= 0 && !cut) return null;
5907
5975
  return /* @__PURE__ */ jsxs59("p", { className: "text-caption text-text-muted", children: [
5908
- omitted > 0 && /* @__PURE__ */ jsxs59(Fragment22, { children: [
5976
+ omitted > 0 && /* @__PURE__ */ jsxs59(Fragment24, { children: [
5909
5977
  "Reactions are shown for the latest ",
5910
5978
  limit,
5911
5979
  " comments and replies here. ",
@@ -5968,14 +6036,29 @@ function ArchivedNotice({ by, when, resolution, withWhat, withTitle, onUnarchive
5968
6036
  import { Children } from "react";
5969
6037
  import { IconX as IconX6 } from "@tabler/icons-react";
5970
6038
  import { useContext as useContext13 } from "react";
5971
- import { Fragment as Fragment23, jsx as jsx85, jsxs as jsxs62 } from "react/jsx-runtime";
6039
+ import { Fragment as Fragment25, jsx as jsx85, jsxs as jsxs62 } from "react/jsx-runtime";
5972
6040
  var anyIn = (children) => Children.toArray(children).length > 0;
5973
- function Replies({ children, loading }) {
6041
+ function Replies({ children, loading, empty }) {
5974
6042
  if (loading) return /* @__PURE__ */ jsx85(SkeletonConversation, {});
5975
- if (!anyIn(children)) return /* @__PURE__ */ jsx85(EmptyState, { scope: "section", message: "No replies yet." });
5976
- return /* @__PURE__ */ jsx85(Fragment23, { children });
6043
+ if (!anyIn(children)) return typeof empty === "string" ? /* @__PURE__ */ jsx85(EmptyState, { scope: "section", message: empty }) : /* @__PURE__ */ jsx85(Fragment25, { children: empty });
6044
+ return /* @__PURE__ */ jsx85(Fragment25, { children });
5977
6045
  }
5978
- function Thread({ place = "beside", start, children, loading = false, resolved = false, box, notice, actions, onClose, title = "Replies", bodyRef, className }) {
6046
+ function Thread({
6047
+ place = "beside",
6048
+ start,
6049
+ children,
6050
+ loading = false,
6051
+ resolved = false,
6052
+ box,
6053
+ notice,
6054
+ actions,
6055
+ onClose,
6056
+ closeLabel = "Close",
6057
+ empty = "No replies yet.",
6058
+ title = "Replies",
6059
+ bodyRef,
6060
+ className
6061
+ }) {
5979
6062
  const foot = notice ?? box;
5980
6063
  const layoutLine = useContext13(LineByLayout);
5981
6064
  if (place === "under") {
@@ -5999,16 +6082,16 @@ function Thread({ place = "beside", start, children, loading = false, resolved =
5999
6082
  bodyRef,
6000
6083
  bodyClassName: "flex flex-col",
6001
6084
  title,
6002
- actions: /* @__PURE__ */ jsxs62(Fragment23, { children: [
6085
+ actions: /* @__PURE__ */ jsxs62(Fragment25, { children: [
6003
6086
  resolved && /* @__PURE__ */ jsx85(Chip, { type: "success", label: "Resolved" }),
6004
6087
  actions,
6005
- onClose && /* @__PURE__ */ jsx85(IconButton, { tooltip: "Close", "aria-label": "Close", onClick: onClose, children: /* @__PURE__ */ jsx85(IconX6, { size: 16, stroke: 1.5 }) })
6088
+ onClose && /* @__PURE__ */ jsx85(IconButton, { tooltip: "Close", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ jsx85(IconX6, { size: 16, stroke: 1.5 }) })
6006
6089
  ] }),
6007
6090
  footer: foot && /* @__PURE__ */ jsx85("div", { className: "p-3", children: foot }),
6008
6091
  children: [
6009
- start && /* @__PURE__ */ jsx85("div", { className: "px-4 pb-2 pt-4", children: /* @__PURE__ */ jsx85(PinnedComment, { ...start }) }),
6092
+ start && /* @__PURE__ */ jsx85("div", { className: "px-4 pb-2 pt-4", "data-thread-start": start.id, children: /* @__PURE__ */ jsx85(PinnedComment, { author: start.author, time: start.time, words: start.words, deleted: start.deleted }) }),
6010
6093
  /* @__PURE__ */ jsx85(Divider, { look: "section", label: "Replies", className: "px-4 py-2" }),
6011
- /* @__PURE__ */ jsx85("div", { className: "flex flex-col gap-2 px-4 pb-4", children: /* @__PURE__ */ jsx85(caretOnOpen.Provider, { value: 0, children: /* @__PURE__ */ jsx85(Replies, { loading, children }) }) })
6094
+ /* @__PURE__ */ jsx85("div", { className: "flex flex-col gap-2 px-4 pb-4", children: /* @__PURE__ */ jsx85(caretOnOpen.Provider, { value: 0, children: /* @__PURE__ */ jsx85(Replies, { loading, empty, children }) }) })
6012
6095
  ]
6013
6096
  }
6014
6097
  );
@@ -6046,9 +6129,9 @@ function SearchInput({ shortcut, className, placeholder = "Search\u2026", ...pro
6046
6129
  }
6047
6130
 
6048
6131
  // src/PageHeader.tsx
6049
- import { Fragment as Fragment24 } from "react";
6132
+ import { Fragment as Fragment26 } from "react";
6050
6133
  import { IconLock } from "@tabler/icons-react";
6051
- import { Fragment as Fragment25, jsx as jsx87, jsxs as jsxs64 } from "react/jsx-runtime";
6134
+ import { Fragment as Fragment27, jsx as jsx87, jsxs as jsxs64 } from "react/jsx-runtime";
6052
6135
  function PageHeader({ title, leading, private: locked = false, after, meta, time, members, actions, className }) {
6053
6136
  const words = (meta ?? []).map((one) => typeof one === "string" ? { label: one } : one);
6054
6137
  const quiet = words.length > 0 || time != null || members != null;
@@ -6058,11 +6141,11 @@ function PageHeader({ title, leading, private: locked = false, after, meta, time
6058
6141
  typeof title === "string" ? /* @__PURE__ */ jsx87("span", { className: "truncate text-body-2-strong text-text-primary", children: title }) : /* @__PURE__ */ jsx87("div", { className: "flex min-w-0 items-center", children: title }),
6059
6142
  after != null && /* @__PURE__ */ jsx87("span", { className: "flex shrink-0 items-center", children: after })
6060
6143
  ] });
6061
- const right = quiet || actions != null ? /* @__PURE__ */ jsxs64(Fragment25, { children: [
6144
+ const right = quiet || actions != null ? /* @__PURE__ */ jsxs64(Fragment27, { children: [
6062
6145
  quiet && // The quiet group: 12px between its parts, and 12px clear of the buttons — the bar sets
6063
6146
  // its actions 4px apart, so the group adds the other 8px, as Peek's and Leaf's bars do.
6064
6147
  /* @__PURE__ */ jsxs64("div", { className: cn("flex items-center gap-3", actions != null && "pr-2"), children: [
6065
- words.length > 0 && /* @__PURE__ */ jsx87("div", { className: "flex items-center gap-2", children: words.map((one, i) => /* @__PURE__ */ jsxs64(Fragment24, { children: [
6148
+ words.length > 0 && /* @__PURE__ */ jsx87("div", { className: "flex items-center gap-2", children: words.map((one, i) => /* @__PURE__ */ jsxs64(Fragment26, { children: [
6066
6149
  i > 0 && // eslint-disable-next-line token-spacing/no-restricted-classes -- @estiva-escape: Peek's dot between its counts, 3px measured on 31 October; the scale steps from 2px to 4px
6067
6150
  /* @__PURE__ */ jsx87("span", { "aria-hidden": "true", className: "size-[3px] shrink-0 rounded-full bg-text-muted" }),
6068
6151
  /* @__PURE__ */ jsx87(MetaText, { tone: one.done ? "success" : "secondary", children: one.label })
@@ -6117,7 +6200,7 @@ function ListColumn(props) {
6117
6200
 
6118
6201
  // src/Tabs.tsx
6119
6202
  import { Tabs as BaseTabs } from "@base-ui/react/tabs";
6120
- import { Fragment as Fragment26, jsx as jsx89, jsxs as jsxs66 } from "react/jsx-runtime";
6203
+ import { Fragment as Fragment28, jsx as jsx89, jsxs as jsxs66 } from "react/jsx-runtime";
6121
6204
  function Tabs({ tabs, active, onChange, size = "default", className, ...aria }) {
6122
6205
  return /* @__PURE__ */ jsx89(
6123
6206
  BaseTabs.Root,
@@ -6151,7 +6234,7 @@ function Tabs({ tabs, active, onChange, size = "default", className, ...aria })
6151
6234
  tab.label,
6152
6235
  tab.count !== void 0 ? /* @__PURE__ */ jsx89("span", { className: "ml-2.5 font-mono text-caption tabular-nums text-text-secondary", children: tab.count }) : null
6153
6236
  ] }),
6154
- tab.unread ? /* @__PURE__ */ jsxs66(Fragment26, { children: [
6237
+ tab.unread ? /* @__PURE__ */ jsxs66(Fragment28, { children: [
6155
6238
  /* @__PURE__ */ jsx89(UnreadDot, { className: "h-auto w-auto" }),
6156
6239
  /* @__PURE__ */ jsx89("span", { className: "sr-only", children: "new" })
6157
6240
  ] }) : null