@estiva-app/ui 0.97.0 → 0.98.1

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
  {
@@ -5578,6 +5583,12 @@ function ConversationCard(props) {
5578
5583
  attention: attentionOf(isNew || !!replies?.isNew, urgent, inThreadCard),
5579
5584
  className: cn("relative", className),
5580
5585
  onClick: press && !isEditing && !overlay ? (e) => pressed(e, press) : void 0,
5586
+ tabIndex: press && !isEditing ? 0 : void 0,
5587
+ onKeyDown: press && !isEditing && !overlay ? (e) => {
5588
+ if (e.target !== e.currentTarget || e.key !== "Enter" && e.key !== " ") return;
5589
+ e.preventDefault();
5590
+ press();
5591
+ } : void 0,
5581
5592
  onMouseEnter: () => setHovered(true),
5582
5593
  onMouseLeave: () => {
5583
5594
  if (picking || menuOpen) return;
@@ -5590,13 +5601,14 @@ function ConversationCard(props) {
5590
5601
  },
5591
5602
  children: [
5592
5603
  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: [
5604
+ 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
5605
  /* @__PURE__ */ jsx79(
5595
5606
  Head,
5596
5607
  {
5597
5608
  author,
5598
5609
  time: props.time,
5599
5610
  timeHref: props.timeHref,
5611
+ timeLabel: props.timeLabel,
5600
5612
  edited: props.edited,
5601
5613
  isNew,
5602
5614
  urgent,
@@ -5605,10 +5617,10 @@ function ConversationCard(props) {
5605
5617
  ),
5606
5618
  aboutShown && // Under the name, above the words (Katerina, 1 November).
5607
5619
  /* @__PURE__ */ jsx79("div", { className: "relative w-full pl-8 pr-2 pt-0.5", children: about }),
5608
- /* @__PURE__ */ jsx79(Words, { oneLine: folded, children })
5620
+ /* @__PURE__ */ jsx79(Words, { children })
5609
5621
  ] }),
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 }),
5622
+ !deleted && files && /* @__PURE__ */ jsx79("div", { className: "relative flex w-full flex-wrap items-start gap-2 pb-2 pl-8 pr-2", children: files }),
5623
+ /* @__PURE__ */ jsx79(Reactions, { reactions, refused: reactionRefused, readOnly }),
5612
5624
  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
5625
  /* @__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
5626
  repliesRow && /* @__PURE__ */ jsx79("div", { className: "relative w-full", children: repliesRow })
@@ -5641,7 +5653,11 @@ function ConversationCard(props) {
5641
5653
  resolved: !!resolved,
5642
5654
  onResolve: onResolve && (() => setResolving(true)),
5643
5655
  onReopen,
5656
+ resolveHint,
5657
+ label: menuLabel,
5644
5658
  onEdit: own && editor ? () => setEditing(true) : void 0,
5659
+ editLabel,
5660
+ after: menuAfter,
5645
5661
  onDelete: own && onDelete ? () => setDeleting(true) : void 0,
5646
5662
  children: menu
5647
5663
  }
@@ -5651,14 +5667,14 @@ function ConversationCard(props) {
5651
5667
  ]
5652
5668
  }
5653
5669
  ),
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." }),
5670
+ 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: [
5671
+ /* @__PURE__ */ jsx79("p", { children: "It is deleted for everyone." }),
5656
5672
  replies && replies.count > 0 && /* @__PURE__ */ jsxs55("p", { children: [
5657
5673
  "Its ",
5658
5674
  replies.count === 1 ? "reply stays" : `${replies.count} replies stay`,
5659
5675
  "."
5660
5676
  ] })
5661
- ] }),
5677
+ ] }) }),
5662
5678
  resolving && onResolve && /* @__PURE__ */ jsx79(
5663
5679
  ResolveDialog,
5664
5680
  {
@@ -5674,7 +5690,7 @@ function ConversationCard(props) {
5674
5690
  ] });
5675
5691
  }
5676
5692
  function ReplyCard(props) {
5677
- const { author, about, files, reactions, reactionRefused, isNew = false, urgent = false, own = false, editor, onDelete, deleteNote, menu, className, children } = props;
5693
+ const { author, about, files, reactions, reactionRefused, isNew = false, urgent = false, own = false, editor, onDelete, deleteNote, menu, menuAfter, menuLabel, editLabel, className, children } = props;
5678
5694
  const readOnly = props.readOnly ?? false;
5679
5695
  const [hovered, setHovered] = useState19(false);
5680
5696
  const [menuOpen, setMenuOpen] = useState19(false);
@@ -5682,11 +5698,11 @@ function ReplyCard(props) {
5682
5698
  const [deleting, setDeleting] = useState19(false);
5683
5699
  const [editing, setEditing] = useEditing(props.editing, props.onEditingChange);
5684
5700
  const isEditing = editing && !readOnly && !!editor;
5685
- const offersMenu = !!menu || own && (!!editor || !!onDelete);
5701
+ const offersMenu = !!menu || !!menuAfter || own && (!!editor || !!onDelete);
5686
5702
  const showStrip = hovered && !isEditing && !readOnly && (offersMenu || !!reactions?.onToggle);
5687
5703
  const root = useRef15(null);
5688
5704
  const settle = () => requestAnimationFrame(() => setHovered(stillHere(root.current)));
5689
- return /* @__PURE__ */ jsxs55(Fragment20, { children: [
5705
+ return /* @__PURE__ */ jsxs55(Fragment21, { children: [
5690
5706
  /* @__PURE__ */ jsxs55(
5691
5707
  Card,
5692
5708
  {
@@ -5710,7 +5726,7 @@ function ReplyCard(props) {
5710
5726
  },
5711
5727
  children: [
5712
5728
  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 }),
5729
+ /* @__PURE__ */ jsx79(Head, { author, time: props.time, timeHref: props.timeHref, timeLabel: props.timeLabel, edited: props.edited, isNew, urgent }),
5714
5730
  about && /* @__PURE__ */ jsx79("div", { className: "w-full pl-8 pr-2 pt-0.5", children: about }),
5715
5731
  /* @__PURE__ */ jsx79(Words, { children }),
5716
5732
  files && /* @__PURE__ */ jsx79("div", { className: "flex w-full flex-wrap items-start gap-2 pb-2 pl-8 pr-2", children: files }),
@@ -5735,7 +5751,10 @@ function ReplyCard(props) {
5735
5751
  setMenuOpen(next);
5736
5752
  if (!next) settle();
5737
5753
  },
5754
+ label: menuLabel,
5738
5755
  onEdit: own && editor ? () => setEditing(true) : void 0,
5756
+ editLabel,
5757
+ after: menuAfter,
5739
5758
  onDelete: own && onDelete ? () => setDeleting(true) : void 0,
5740
5759
  children: menu
5741
5760
  }
@@ -5745,12 +5764,12 @@ function ReplyCard(props) {
5745
5764
  ]
5746
5765
  }
5747
5766
  ),
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." }) })
5767
+ 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
5768
  ] });
5750
5769
  }
5751
5770
 
5752
5771
  // src/ConversationLayout.tsx
5753
- import { useEffect as useEffect10, useLayoutEffect as useLayoutEffect7, useRef as useRef16, useState as useState20 } from "react";
5772
+ import { Fragment as Fragment22, useEffect as useEffect10, useLayoutEffect as useLayoutEffect7, useRef as useRef16, useState as useState20 } from "react";
5754
5773
 
5755
5774
  // src/Panel.tsx
5756
5775
  import { jsx as jsx80, jsxs as jsxs56 } from "react/jsx-runtime";
@@ -5779,10 +5798,10 @@ function Panel(props) {
5779
5798
  }
5780
5799
 
5781
5800
  // src/ConversationLayout.tsx
5782
- import { Fragment as Fragment21, jsx as jsx81, jsxs as jsxs57 } from "react/jsx-runtime";
5801
+ import { Fragment as Fragment23, jsx as jsx81, jsxs as jsxs57 } from "react/jsx-runtime";
5783
5802
  function List({ items, open, under, above, loading, empty, change, caret }) {
5784
5803
  if (loading) return /* @__PURE__ */ jsx81(SkeletonConversation, {});
5785
- if (items.length === 0) return /* @__PURE__ */ jsx81(EmptyState, { scope: "section", message: empty });
5804
+ if (items.length === 0) return typeof empty === "string" ? /* @__PURE__ */ jsx81(EmptyState, { scope: "section", message: empty }) : /* @__PURE__ */ jsx81(Fragment23, { children: empty });
5786
5805
  const stateOf = (item) => change && item.thread ? {
5787
5806
  under,
5788
5807
  open: open === item.id,
@@ -5791,14 +5810,35 @@ function List({ items, open, under, above, loading, empty, change, caret }) {
5791
5810
  } : null;
5792
5811
  const draw2 = (item) => {
5793
5812
  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);
5813
+ return /* @__PURE__ */ jsxs57(Fragment22, { children: [
5814
+ item.before,
5815
+ /* @__PURE__ */ jsx81("div", { "data-conversation-item": item.id, className: "flex flex-col", children: /* @__PURE__ */ jsx81(InConversationItem.Provider, { value: stateOf(item), children: item.card }) })
5816
+ ] }, item.id);
5795
5817
  }
5796
5818
  return /* @__PURE__ */ jsx81(UnderItem, { item, isOpen: open === item.id && !!item.thread, state: stateOf(item), caret }, item.id);
5797
5819
  };
5798
5820
  if (!under) {
5799
- return /* @__PURE__ */ jsxs57(Fragment21, { children: [
5821
+ const stretches = [];
5822
+ const seen = /* @__PURE__ */ new Map();
5823
+ for (const item of items) {
5824
+ const last = stretches[stretches.length - 1];
5825
+ if (last && last.day === item.day) {
5826
+ last.items.push(item);
5827
+ continue;
5828
+ }
5829
+ const name = item.day ?? "";
5830
+ const count = (seen.get(name) ?? 0) + 1;
5831
+ seen.set(name, count);
5832
+ stretches.push({ key: `${item.day === void 0 ? "no-day" : `day:${name}`}#${count}`, day: item.day, items: [item] });
5833
+ }
5834
+ return /* @__PURE__ */ jsxs57(Fragment23, { children: [
5800
5835
  above,
5801
- items.map(draw2)
5836
+ stretches.map(
5837
+ (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: [
5838
+ /* @__PURE__ */ jsx81(Divider, { look: "section", label: stretch.day, sticky: true }),
5839
+ stretch.items.map(draw2)
5840
+ ] }, stretch.key)
5841
+ )
5802
5842
  ] });
5803
5843
  }
5804
5844
  const resolved = items.filter((item) => item.resolved);
@@ -5815,7 +5855,7 @@ function List({ items, open, under, above, loading, empty, change, caret }) {
5815
5855
  children: list.map(draw2)
5816
5856
  }
5817
5857
  );
5818
- return /* @__PURE__ */ jsxs57(Fragment21, { children: [
5858
+ return /* @__PURE__ */ jsxs57(Fragment23, { children: [
5819
5859
  above,
5820
5860
  items.filter((item) => !item.resolved && !item.gone).map(draw2),
5821
5861
  group("On deleted blocks", gone),
@@ -5848,7 +5888,24 @@ function UnderItem({ item, isOpen, state, caret }) {
5848
5888
  }
5849
5889
  );
5850
5890
  }
5851
- function ConversationLayout({ threads, items, open, onOpenChange, box, above, loading = false, empty = "No comments yet.", header, title = "Comments", actions, className }) {
5891
+ function ConversationLayout({
5892
+ threads,
5893
+ items,
5894
+ open,
5895
+ onOpenChange,
5896
+ box,
5897
+ above,
5898
+ below,
5899
+ top,
5900
+ loading = false,
5901
+ empty = "No comments yet.",
5902
+ header,
5903
+ title = "Comments",
5904
+ actions,
5905
+ bodyRef,
5906
+ onBodyScroll,
5907
+ className
5908
+ }) {
5852
5909
  const body = useRef16(null);
5853
5910
  const pressed2 = useRef16(null);
5854
5911
  const itemAt = (id) => body.current?.querySelector(`[data-conversation-item="${CSS.escape(id)}"]`) ?? null;
@@ -5880,11 +5937,28 @@ function ConversationLayout({ threads, items, open, onOpenChange, box, above, lo
5880
5937
  }
5881
5938
  const opened = items.find((item) => item.id === open)?.thread;
5882
5939
  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
- ] }),
5940
+ /* @__PURE__ */ jsx81(
5941
+ ErrorBoundary,
5942
+ {
5943
+ label: "conversation",
5944
+ frame: (message) => /* @__PURE__ */ jsxs57("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
5945
+ /* @__PURE__ */ jsx81(ContainerHeader, { title }),
5946
+ /* @__PURE__ */ jsx81("div", { className: "flex min-h-0 flex-1 flex-col px-4", children: message })
5947
+ ] }),
5948
+ children: /* @__PURE__ */ jsxs57("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
5949
+ header,
5950
+ /* @__PURE__ */ jsxs57(ScrollArea, { className: "min-h-0 flex-1", viewportRef: bodyRef, onScroll: onBodyScroll, contentClassName: "flex min-h-full flex-col", children: [
5951
+ top != null && top !== false && top !== "" && /* @__PURE__ */ jsx81("div", { className: "shrink-0 px-4 pt-4", children: top }),
5952
+ /* @__PURE__ */ jsx81("div", { className: "min-h-0 flex-1" }),
5953
+ /* @__PURE__ */ jsxs57("div", { className: "flex shrink-0 flex-col gap-2 p-4", children: [
5954
+ /* @__PURE__ */ jsx81(List, { items, open, under: false, above, loading, empty, change, caret }),
5955
+ !loading && below
5956
+ ] })
5957
+ ] }),
5958
+ box && /* @__PURE__ */ jsx81("div", { className: "shrink-0 p-3", children: box })
5959
+ ] })
5960
+ }
5961
+ ),
5888
5962
  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
5963
  ] });
5890
5964
  }
@@ -5901,14 +5975,16 @@ function QuotedLine({ words, state = "here", label }) {
5901
5975
  }
5902
5976
 
5903
5977
  // src/ReactionHorizon.tsx
5904
- import { Fragment as Fragment22, jsxs as jsxs59 } from "react/jsx-runtime";
5905
- function ReactionHorizon({ limit, omitted, cut = false }) {
5978
+ import { Fragment as Fragment24, jsxs as jsxs59 } from "react/jsx-runtime";
5979
+ function ReactionHorizon({ limit, omitted, cut = false, noun = "comments" }) {
5906
5980
  if (omitted <= 0 && !cut) return null;
5907
5981
  return /* @__PURE__ */ jsxs59("p", { className: "text-caption text-text-muted", children: [
5908
- omitted > 0 && /* @__PURE__ */ jsxs59(Fragment22, { children: [
5982
+ omitted > 0 && /* @__PURE__ */ jsxs59(Fragment24, { children: [
5909
5983
  "Reactions are shown for the latest ",
5910
5984
  limit,
5911
- " comments and replies here. ",
5985
+ " ",
5986
+ noun,
5987
+ " and replies here. ",
5912
5988
  omitted,
5913
5989
  " older ",
5914
5990
  omitted === 1 ? "one was" : "ones were",
@@ -5968,14 +6044,29 @@ function ArchivedNotice({ by, when, resolution, withWhat, withTitle, onUnarchive
5968
6044
  import { Children } from "react";
5969
6045
  import { IconX as IconX6 } from "@tabler/icons-react";
5970
6046
  import { useContext as useContext13 } from "react";
5971
- import { Fragment as Fragment23, jsx as jsx85, jsxs as jsxs62 } from "react/jsx-runtime";
6047
+ import { Fragment as Fragment25, jsx as jsx85, jsxs as jsxs62 } from "react/jsx-runtime";
5972
6048
  var anyIn = (children) => Children.toArray(children).length > 0;
5973
- function Replies({ children, loading }) {
6049
+ function Replies({ children, loading, empty }) {
5974
6050
  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 });
6051
+ if (!anyIn(children)) return typeof empty === "string" ? /* @__PURE__ */ jsx85(EmptyState, { scope: "section", message: empty }) : /* @__PURE__ */ jsx85(Fragment25, { children: empty });
6052
+ return /* @__PURE__ */ jsx85(Fragment25, { children });
5977
6053
  }
5978
- function Thread({ place = "beside", start, children, loading = false, resolved = false, box, notice, actions, onClose, title = "Replies", bodyRef, className }) {
6054
+ function Thread({
6055
+ place = "beside",
6056
+ start,
6057
+ children,
6058
+ loading = false,
6059
+ resolved = false,
6060
+ box,
6061
+ notice,
6062
+ actions,
6063
+ onClose,
6064
+ closeLabel = "Close",
6065
+ empty = "No replies yet.",
6066
+ title = "Replies",
6067
+ bodyRef,
6068
+ className
6069
+ }) {
5979
6070
  const foot = notice ?? box;
5980
6071
  const layoutLine = useContext13(LineByLayout);
5981
6072
  if (place === "under") {
@@ -5999,16 +6090,16 @@ function Thread({ place = "beside", start, children, loading = false, resolved =
5999
6090
  bodyRef,
6000
6091
  bodyClassName: "flex flex-col",
6001
6092
  title,
6002
- actions: /* @__PURE__ */ jsxs62(Fragment23, { children: [
6093
+ actions: /* @__PURE__ */ jsxs62(Fragment25, { children: [
6003
6094
  resolved && /* @__PURE__ */ jsx85(Chip, { type: "success", label: "Resolved" }),
6004
6095
  actions,
6005
- onClose && /* @__PURE__ */ jsx85(IconButton, { tooltip: "Close", "aria-label": "Close", onClick: onClose, children: /* @__PURE__ */ jsx85(IconX6, { size: 16, stroke: 1.5 }) })
6096
+ onClose && /* @__PURE__ */ jsx85(IconButton, { tooltip: "Close", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ jsx85(IconX6, { size: 16, stroke: 1.5 }) })
6006
6097
  ] }),
6007
6098
  footer: foot && /* @__PURE__ */ jsx85("div", { className: "p-3", children: foot }),
6008
6099
  children: [
6009
- start && /* @__PURE__ */ jsx85("div", { className: "px-4 pb-2 pt-4", children: /* @__PURE__ */ jsx85(PinnedComment, { ...start }) }),
6100
+ 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
6101
  /* @__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 }) }) })
6102
+ /* @__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
6103
  ]
6013
6104
  }
6014
6105
  );
@@ -6046,9 +6137,9 @@ function SearchInput({ shortcut, className, placeholder = "Search\u2026", ...pro
6046
6137
  }
6047
6138
 
6048
6139
  // src/PageHeader.tsx
6049
- import { Fragment as Fragment24 } from "react";
6140
+ import { Fragment as Fragment26 } from "react";
6050
6141
  import { IconLock } from "@tabler/icons-react";
6051
- import { Fragment as Fragment25, jsx as jsx87, jsxs as jsxs64 } from "react/jsx-runtime";
6142
+ import { Fragment as Fragment27, jsx as jsx87, jsxs as jsxs64 } from "react/jsx-runtime";
6052
6143
  function PageHeader({ title, leading, private: locked = false, after, meta, time, members, actions, className }) {
6053
6144
  const words = (meta ?? []).map((one) => typeof one === "string" ? { label: one } : one);
6054
6145
  const quiet = words.length > 0 || time != null || members != null;
@@ -6058,11 +6149,11 @@ function PageHeader({ title, leading, private: locked = false, after, meta, time
6058
6149
  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
6150
  after != null && /* @__PURE__ */ jsx87("span", { className: "flex shrink-0 items-center", children: after })
6060
6151
  ] });
6061
- const right = quiet || actions != null ? /* @__PURE__ */ jsxs64(Fragment25, { children: [
6152
+ const right = quiet || actions != null ? /* @__PURE__ */ jsxs64(Fragment27, { children: [
6062
6153
  quiet && // The quiet group: 12px between its parts, and 12px clear of the buttons — the bar sets
6063
6154
  // its actions 4px apart, so the group adds the other 8px, as Peek's and Leaf's bars do.
6064
6155
  /* @__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: [
6156
+ words.length > 0 && /* @__PURE__ */ jsx87("div", { className: "flex items-center gap-2", children: words.map((one, i) => /* @__PURE__ */ jsxs64(Fragment26, { children: [
6066
6157
  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
6158
  /* @__PURE__ */ jsx87("span", { "aria-hidden": "true", className: "size-[3px] shrink-0 rounded-full bg-text-muted" }),
6068
6159
  /* @__PURE__ */ jsx87(MetaText, { tone: one.done ? "success" : "secondary", children: one.label })
@@ -6117,7 +6208,7 @@ function ListColumn(props) {
6117
6208
 
6118
6209
  // src/Tabs.tsx
6119
6210
  import { Tabs as BaseTabs } from "@base-ui/react/tabs";
6120
- import { Fragment as Fragment26, jsx as jsx89, jsxs as jsxs66 } from "react/jsx-runtime";
6211
+ import { Fragment as Fragment28, jsx as jsx89, jsxs as jsxs66 } from "react/jsx-runtime";
6121
6212
  function Tabs({ tabs, active, onChange, size = "default", className, ...aria }) {
6122
6213
  return /* @__PURE__ */ jsx89(
6123
6214
  BaseTabs.Root,
@@ -6151,7 +6242,7 @@ function Tabs({ tabs, active, onChange, size = "default", className, ...aria })
6151
6242
  tab.label,
6152
6243
  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
6244
  ] }),
6154
- tab.unread ? /* @__PURE__ */ jsxs66(Fragment26, { children: [
6245
+ tab.unread ? /* @__PURE__ */ jsxs66(Fragment28, { children: [
6155
6246
  /* @__PURE__ */ jsx89(UnreadDot, { className: "h-auto w-auto" }),
6156
6247
  /* @__PURE__ */ jsx89("span", { className: "sr-only", children: "new" })
6157
6248
  ] }) : null