@estiva-app/ui 0.96.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.
Files changed (72) hide show
  1. package/dist/Avatar.d.ts +6 -1
  2. package/dist/Avatar.d.ts.map +1 -1
  3. package/dist/AvatarGroup.d.ts +2 -0
  4. package/dist/AvatarGroup.d.ts.map +1 -1
  5. package/dist/ComposerTriggers.d.ts +2 -0
  6. package/dist/ComposerTriggers.d.ts.map +1 -1
  7. package/dist/ConversationCard.d.ts +26 -6
  8. package/dist/ConversationCard.d.ts.map +1 -1
  9. package/dist/ConversationLayout.d.ts +18 -6
  10. package/dist/ConversationLayout.d.ts.map +1 -1
  11. package/dist/ConversationMenu.d.ts +14 -5
  12. package/dist/ConversationMenu.d.ts.map +1 -1
  13. package/dist/LinkParts.d.ts +1 -0
  14. package/dist/LinkParts.d.ts.map +1 -1
  15. package/dist/MembersDialog.d.ts +4 -0
  16. package/dist/MembersDialog.d.ts.map +1 -1
  17. package/dist/Person.d.ts +3 -1
  18. package/dist/Person.d.ts.map +1 -1
  19. package/dist/PersonTrigger.d.ts +1 -1
  20. package/dist/PersonTrigger.d.ts.map +1 -1
  21. package/dist/RepliesRow.d.ts +1 -0
  22. package/dist/RepliesRow.d.ts.map +1 -1
  23. package/dist/Thread.d.ts +9 -2
  24. package/dist/Thread.d.ts.map +1 -1
  25. package/dist/editor.js +1 -1
  26. package/dist/editor.js.map +2 -2
  27. package/dist/index.js +196 -92
  28. package/dist/index.js.map +3 -3
  29. package/dist/linked.d.ts +4 -0
  30. package/dist/linked.d.ts.map +1 -1
  31. package/dist/linkedFrom.d.ts +2 -0
  32. package/dist/linkedFrom.d.ts.map +1 -1
  33. package/package.json +1 -1
  34. package/registry.json +153 -19
  35. package/src/Avatar.agent.test.tsx +63 -0
  36. package/src/Avatar.mdx +25 -0
  37. package/src/Avatar.stories.tsx +13 -0
  38. package/src/Avatar.tsx +51 -3
  39. package/src/AvatarGroup.tsx +3 -1
  40. package/src/ComposerTriggers.stories.tsx +2 -0
  41. package/src/ComposerTriggers.tsx +3 -1
  42. package/src/ConversationCard.mdx +3 -2
  43. package/src/ConversationCard.states.test.tsx +25 -5
  44. package/src/ConversationCard.stories.tsx +3 -3
  45. package/src/ConversationCard.test.tsx +4 -4
  46. package/src/ConversationCard.tsx +60 -38
  47. package/src/ConversationLayout.mdx +12 -0
  48. package/src/ConversationLayout.stories.tsx +47 -0
  49. package/src/ConversationLayout.test.tsx +100 -0
  50. package/src/ConversationLayout.tsx +98 -20
  51. package/src/ConversationMenu.mdx +5 -2
  52. package/src/ConversationMenu.stories.tsx +19 -1
  53. package/src/ConversationMenu.test.tsx +17 -4
  54. package/src/ConversationMenu.tsx +37 -16
  55. package/src/LinkCard.tsx +3 -3
  56. package/src/LinkChip.tsx +1 -1
  57. package/src/LinkParts.tsx +4 -4
  58. package/src/LinkRow.tsx +1 -1
  59. package/src/MembersDialog.stories.tsx +11 -0
  60. package/src/MembersDialog.tsx +7 -3
  61. package/src/Person.tsx +4 -2
  62. package/src/PersonTrigger.tsx +3 -3
  63. package/src/PinnedComment.tsx +1 -1
  64. package/src/RepliesRow.tsx +2 -2
  65. package/src/Thread.mdx +2 -0
  66. package/src/Thread.test.tsx +17 -0
  67. package/src/Thread.tsx +32 -8
  68. package/src/linked.ts +4 -0
  69. package/src/linkedFrom.test.tsx +18 -0
  70. package/src/linkedFrom.ts +7 -5
  71. package/src/registry/registry.test.ts +2 -1
  72. package/stories/Choosing.mdx +1 -1
package/dist/index.js CHANGED
@@ -977,12 +977,33 @@ var hueFor = (key) => {
977
977
  for (let i = 0; i < key.length; i++) h = h * 31 + key.charCodeAt(i) | 0;
978
978
  return HUES[Math.abs(h) % HUES.length];
979
979
  };
980
+ var groundFor = (hue) => `linear-gradient(160deg, color-mix(in srgb, ${hue} 92%, #fff) 0%, color-mix(in srgb, ${hue} 70%, #0b0d11) 100%)`;
980
981
  var initialsFor = (name) => {
981
982
  const words = name.split(/\s+/).slice(0, 2).filter((w) => /^[\p{L}\p{N}]/u.test(w));
982
983
  const initials = words.map((w) => w[0]).join("") || name.trim().charAt(0);
983
984
  return initials.toUpperCase();
984
985
  };
985
- function Avatar({ src, name, alt = "", size = 36, label: spoken, className }) {
986
+ var ROBOT_PATH = "M13.5 2C13.5 2.44425 13.3069 2.84339 13 3.11805V5H18C19.6569 5 21 6.34315 21 8V18C21 19.6569 19.6569 21 18 21H6C4.34315 21 3 19.6569 3 18V8C3 6.34315 4.34315 5 6 5H11V3.11805C10.6931 2.84339 10.5 2.44425 10.5 2C10.5 1.17157 11.1716 0.5 12 0.5C12.8284 0.5 13.5 1.17157 13.5 2ZM0 10H2V16H0V10ZM24 10H22V16H24V10ZM9 14.5C9.82843 14.5 10.5 13.8284 10.5 13C10.5 12.1716 9.82843 11.5 9 11.5C8.17157 11.5 7.5 12.1716 7.5 13C7.5 13.8284 8.17157 14.5 9 14.5ZM16.5 13C16.5 12.1716 15.8284 11.5 15 11.5C14.1716 11.5 13.5 12.1716 13.5 13C13.5 13.8284 14.1716 14.5 15 14.5C15.8284 14.5 16.5 13.8284 16.5 13Z";
987
+ var AGENT_HUE = "#d4ee4a";
988
+ function AgentFace({ size }) {
989
+ const glyph = Math.round(size * 0.625);
990
+ return /* @__PURE__ */ jsx13(
991
+ BaseAvatar.Fallback,
992
+ {
993
+ render: /* @__PURE__ */ jsx13("div", {}),
994
+ className: "w-full h-full flex items-center justify-center",
995
+ style: {
996
+ /* eslint-disable no-restricted-syntax -- @estiva-escape: one colour in every theme, on the initials' light
997
+ and shade, and their ink: a palette, as HUES, so none of it can be a token. */
998
+ background: groundFor(AGENT_HUE),
999
+ color: "#08121c"
1000
+ /* eslint-enable no-restricted-syntax */
1001
+ },
1002
+ children: /* @__PURE__ */ jsx13("svg", { width: glyph, height: glyph, viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": true, children: /* @__PURE__ */ jsx13("path", { d: ROBOT_PATH }) })
1003
+ }
1004
+ );
1005
+ }
1006
+ function Avatar({ src, name, alt = "", size = 36, label: spoken, bot = false, className }) {
986
1007
  const label = name || alt;
987
1008
  const pictureFor = usePictureFor();
988
1009
  const picture = src ?? (label && pictureFor ? pictureFor(label) ?? void 0 : void 0);
@@ -1003,7 +1024,7 @@ function Avatar({ src, name, alt = "", size = 36, label: spoken, className }) {
1003
1024
  className: "w-full h-full object-cover data-[error]:hidden"
1004
1025
  }
1005
1026
  ),
1006
- label ? /* @__PURE__ */ jsx13(
1027
+ bot ? /* @__PURE__ */ jsx13(AgentFace, { size }) : label ? /* @__PURE__ */ jsx13(
1007
1028
  BaseAvatar.Fallback,
1008
1029
  {
1009
1030
  render: /* @__PURE__ */ jsx13("div", {}),
@@ -1017,7 +1038,7 @@ function Avatar({ src, name, alt = "", size = 36, label: spoken, className }) {
1017
1038
  // ink cannot be a token either.
1018
1039
  color: "#08121c",
1019
1040
  fontSize: Math.round(size * 0.36),
1020
- background: `linear-gradient(160deg, color-mix(in srgb, ${hueFor(label)} 92%, #fff) 0%, color-mix(in srgb, ${hueFor(label)} 70%, #0b0d11) 100%)`
1041
+ background: groundFor(hueFor(label))
1021
1042
  /* eslint-enable no-restricted-syntax */
1022
1043
  },
1023
1044
  children: /* @__PURE__ */ jsx13("span", { className: "[text-box:trim-both_cap_alphabetic]", children: initialsFor(label) })
@@ -1045,7 +1066,7 @@ function AvatarGroup({ members, size = 24, on = "surface" }) {
1045
1066
  {
1046
1067
  className: "relative flex rounded-sm",
1047
1068
  style: { marginRight: -overlap, boxShadow: `0 0 0 ${ring}px var(--bg-${on})` },
1048
- children: /* @__PURE__ */ jsx14(Avatar, { size, name: member.name, src: member.picture, label: member.name })
1069
+ children: /* @__PURE__ */ jsx14(Avatar, { size, name: member.name, src: member.picture, bot: member.bot, label: member.name })
1049
1070
  },
1050
1071
  i
1051
1072
  )
@@ -1892,8 +1913,8 @@ function MembersDialog({ members, count, self, candidates = [], onAdd, note, ini
1892
1913
  options: candidates,
1893
1914
  placeholder: "Search people...",
1894
1915
  excludeIds: members.map((m) => m.id),
1895
- chipLeading: (o) => /* @__PURE__ */ jsx26(Avatar, { name: o.label, src: o.picture, size: 16 }),
1896
- rowLeading: (o) => /* @__PURE__ */ jsx26(Avatar, { name: o.label, src: o.picture, size: 32 }),
1916
+ chipLeading: (o) => /* @__PURE__ */ jsx26(Avatar, { name: o.label, src: o.picture, bot: o.bot, size: 16 }),
1917
+ rowLeading: (o) => /* @__PURE__ */ jsx26(Avatar, { name: o.label, src: o.picture, bot: o.bot, size: 32 }),
1897
1918
  autoFocus: true
1898
1919
  }
1899
1920
  ) }) })
@@ -1936,7 +1957,7 @@ function MembersDialog({ members, count, self, candidates = [], onAdd, note, ini
1936
1957
  )
1937
1958
  ] }),
1938
1959
  roster.map((member) => /* @__PURE__ */ jsxs17("div", { className: "flex h-12 items-center gap-3 px-5", children: [
1939
- /* @__PURE__ */ jsx26(Avatar, { size: 32, name: member.name, src: member.picture }),
1960
+ /* @__PURE__ */ jsx26(Avatar, { size: 32, name: member.name, src: member.picture, bot: member.bot }),
1940
1961
  /* @__PURE__ */ jsxs17("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-[2px]", children: [
1941
1962
  /* @__PURE__ */ jsx26("div", { className: "truncate text-body-2 text-text-primary", children: member.name }),
1942
1963
  member.caption && /* @__PURE__ */ jsx26("div", { className: "truncate text-caption text-text-secondary", children: member.caption })
@@ -2858,13 +2879,13 @@ import { useCallback as useCallback3, useRef as useRef8 } from "react";
2858
2879
 
2859
2880
  // src/Person.tsx
2860
2881
  import { jsx as jsx36, jsxs as jsxs26 } from "react/jsx-runtime";
2861
- function Person({ name, picture, fallback = "\u2014", size = 20, className }) {
2882
+ function Person({ name, picture, bot, fallback = "\u2014", size = 20, className }) {
2862
2883
  return (
2863
2884
  // gap-2: the face-to-name distance is one rule (8px) wherever a person
2864
2885
  // appears — Katerina, 2026-09-01, set on Person so PersonTrigger and every
2865
2886
  // row agree by construction.
2866
2887
  /* @__PURE__ */ jsxs26("span", { className: cn("flex min-w-0 items-center gap-2", className), children: [
2867
- /* @__PURE__ */ jsx36(Avatar, { name, src: picture, size }),
2888
+ /* @__PURE__ */ jsx36(Avatar, { name, src: picture, bot, size }),
2868
2889
  /* @__PURE__ */ jsx36("span", { className: cn("truncate", !name && "text-text-muted"), children: name ?? fallback })
2869
2890
  ] })
2870
2891
  );
@@ -2874,7 +2895,7 @@ function Person({ name, picture, fallback = "\u2014", size = 20, className }) {
2874
2895
  import { Button as BaseButton7 } from "@base-ui/react/button";
2875
2896
  import { IconChevronDown as IconChevronDown2 } from "@tabler/icons-react";
2876
2897
  import { jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
2877
- function PersonTrigger({ name, picture, fallback, size, open = false, compact = false, className, ...props }) {
2898
+ function PersonTrigger({ name, picture, bot, fallback, size, open = false, compact = false, className, ...props }) {
2878
2899
  if (compact) {
2879
2900
  return /* @__PURE__ */ jsx37(
2880
2901
  BaseButton7,
@@ -2885,7 +2906,7 @@ function PersonTrigger({ name, picture, fallback, size, open = false, compact =
2885
2906
  "aria-label": props["aria-label"] ?? name ?? fallback,
2886
2907
  className: cn("cursor-pointer rounded-full", className),
2887
2908
  ...props,
2888
- children: /* @__PURE__ */ jsx37(Avatar, { name, src: picture, size: size ?? 36 })
2909
+ children: /* @__PURE__ */ jsx37(Avatar, { name, src: picture, bot, size: size ?? 36 })
2889
2910
  }
2890
2911
  );
2891
2912
  }
@@ -2909,7 +2930,7 @@ function PersonTrigger({ name, picture, fallback, size, open = false, compact =
2909
2930
  ),
2910
2931
  ...props,
2911
2932
  children: [
2912
- /* @__PURE__ */ jsx37(Person, { name, picture, fallback, size: size ?? 22 }),
2933
+ /* @__PURE__ */ jsx37(Person, { name, picture, bot, fallback, size: size ?? 22 }),
2913
2934
  /* @__PURE__ */ jsx37(IconChevronDown2, { size: 14, stroke: 1.5, className: "shrink-0 text-text-muted" })
2914
2935
  ]
2915
2936
  }
@@ -4462,7 +4483,7 @@ function childrenOf(object, options) {
4462
4483
  href: options.hrefOf(child, false),
4463
4484
  ...key ? { key } : {},
4464
4485
  status: { label: status?.value ?? nounOf(child) ?? "File", colour: colourOf(status?.colour) ?? "muted" },
4465
- ...person?.displayName ? { owner: { name: person.displayName, ...person.picture ? { picture: person.picture } : {} } } : {}
4486
+ ...person?.displayName ? { owner: { name: person.displayName, ...person.picture ? { picture: person.picture } : {}, ...person.bot ? { bot: true } : {} } } : {}
4466
4487
  };
4467
4488
  });
4468
4489
  }
@@ -4497,7 +4518,7 @@ function ownerOf(object, options, onAct) {
4497
4518
  value: action.current || void 0,
4498
4519
  options: [
4499
4520
  { value: "", label: "Unassigned" },
4500
- ...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))
4501
4522
  ],
4502
4523
  ...onAct ? { onChange: (value) => onAct(action.id, value) } : {}
4503
4524
  },
@@ -4508,7 +4529,7 @@ function ownerOf(object, options, onAct) {
4508
4529
  if (!slot) return void 0;
4509
4530
  const person = people?.[slot.value];
4510
4531
  return {
4511
- owner: { value: slot.value, options: [{ value: slot.value, label: person?.displayName ?? "\u2014", ...person?.picture ? { picture: person.picture } : {} }] },
4532
+ owner: { value: slot.value, options: [{ value: slot.value, label: person?.displayName ?? "\u2014", ...person?.picture ? { picture: person.picture } : {}, ...person?.bot ? { bot: true } : {} }] },
4512
4533
  ...slot.label ? { ownerLabel: slot.label } : {}
4513
4534
  };
4514
4535
  }
@@ -4518,7 +4539,7 @@ function authorOf(object, directory) {
4518
4539
  if (!pubkey || !/^[0-9a-f]{64}$/.test(pubkey)) return void 0;
4519
4540
  const profile = object.people?.[pubkey] ?? directory?.[pubkey];
4520
4541
  if (!profile?.displayName) return void 0;
4521
- return { name: profile.displayName, ...profile.picture ? { picture: profile.picture } : {} };
4542
+ return { name: profile.displayName, ...profile.picture ? { picture: profile.picture } : {}, ...profile.bot ? { bot: true } : {} };
4522
4543
  }
4523
4544
  function linkedFrom(object, options) {
4524
4545
  const { slots, people } = object;
@@ -4534,7 +4555,7 @@ function linkedFrom(object, options) {
4534
4555
  kind: "message",
4535
4556
  title: name,
4536
4557
  href,
4537
- author: { name, ...person?.picture ? { picture: person.picture } : {} },
4558
+ author: { name, ...person?.picture ? { picture: person.picture } : {}, ...person?.bot ? { bot: true } : {} },
4538
4559
  ...body ? { body } : {},
4539
4560
  ...updated ? { updated } : {}
4540
4561
  };
@@ -4617,7 +4638,7 @@ function kindNounOf(linked) {
4617
4638
  return linked.noun ?? KIND_NOUN[linked.kind];
4618
4639
  }
4619
4640
  function LinkTile({ kind, author }) {
4620
- if (author) return /* @__PURE__ */ jsx61(Avatar, { name: author.name, src: author.picture, size: 36 });
4641
+ if (author) return /* @__PURE__ */ jsx61(Avatar, { name: author.name, src: author.picture, bot: author.bot, size: 36 });
4621
4642
  return /* @__PURE__ */ jsx61("span", { className: TYPE_TILE_CLASSES, children: /* @__PURE__ */ jsx61(LinkedIcon, { kind }) });
4622
4643
  }
4623
4644
  function ProgressRing({ done, total }) {
@@ -4671,7 +4692,7 @@ function CommentCount({ conversation, noun = "comments" }) {
4671
4692
  }
4672
4693
  function OwnerFace({ option }) {
4673
4694
  const nobody = !option || option.value === "";
4674
- return /* @__PURE__ */ jsx61(Avatar, { name: nobody ? void 0 : option.label, src: nobody ? void 0 : option.picture, size: 16 });
4695
+ return /* @__PURE__ */ jsx61(Avatar, { name: nobody ? void 0 : option.label, src: nobody ? void 0 : option.picture, bot: !nobody && option.bot, size: 16 });
4675
4696
  }
4676
4697
  function LinkPickers({ status, owner, ownerLabel = "Owner", readOnly = false, disabledReason }) {
4677
4698
  const statusNow = chosenOf(status);
@@ -4785,7 +4806,7 @@ function LinkRow({ link, preview = true }) {
4785
4806
  /* @__PURE__ */ jsxs42("span", { className: "flex h-[19.6px] shrink-0 items-center gap-2 self-start", children: [
4786
4807
  linked.done ? /* @__PURE__ */ jsx62(ProgressRing, { done: linked.done.done, total: linked.done.total }) : status?.colour && /* @__PURE__ */ jsx62(StatusMark, { status: { label: status.label, colour: status.colour } }),
4787
4808
  linked.conversation && /* @__PURE__ */ jsx62(CommentCount, { conversation: linked.conversation, noun: linked.conversation.noun }),
4788
- owner && /* @__PURE__ */ jsx62(Avatar, { name: owner.label, src: owner.picture, size: 16 }),
4809
+ owner && /* @__PURE__ */ jsx62(Avatar, { name: owner.label, src: owner.picture, bot: owner.bot, size: 16 }),
4789
4810
  linked.members && /* @__PURE__ */ jsx62(AvatarGroup, { members: linked.members, size: 16, on: "inset" }),
4790
4811
  linked.authors && /* @__PURE__ */ jsx62(AvatarGroup, { members: linked.authors, size: 16, on: "inset" })
4791
4812
  ] })
@@ -4838,14 +4859,14 @@ function CardBody({ linked, readOnly }) {
4838
4859
  /* @__PURE__ */ jsx63(StatusMark, { status: child.status }),
4839
4860
  child.key && /* @__PURE__ */ jsx63(LinkKey, { children: child.key }),
4840
4861
  /* @__PURE__ */ jsx63("span", { className: "contents text-body-2 text-text-primary", children: boxed || !child.href ? /* @__PURE__ */ jsx63("span", { className: "min-w-0 flex-1 truncate", children: child.title }) : /* @__PURE__ */ jsx63(Link, { href: child.href, variant: "quiet", cover: true, truncate: true, className: "min-w-0 flex-1", children: child.title }) }),
4841
- child.owner ? /* @__PURE__ */ jsx63(Avatar, { name: child.owner.name, src: child.owner.picture, size: 16 }) : /* @__PURE__ */ jsx63("span", { className: "size-4 shrink-0", "aria-hidden": true })
4862
+ child.owner ? /* @__PURE__ */ jsx63(Avatar, { name: child.owner.name, src: child.owner.picture, bot: child.owner.bot, size: 16 }) : /* @__PURE__ */ jsx63("span", { className: "size-4 shrink-0", "aria-hidden": true })
4842
4863
  ] }, child.id)) }),
4843
4864
  linked.latest && // 12px between the words "Latest conversation" and the quote they name (Katerina, 29 Oct).
4844
4865
  /* @__PURE__ */ jsxs43("div", { className: "flex flex-col gap-3", children: [
4845
4866
  /* @__PURE__ */ jsx63("span", { className: "text-caption text-text-muted", children: "Latest conversation" }),
4846
4867
  /* @__PURE__ */ jsxs43("div", { className: cn("flex flex-col gap-1", QUOTE_BAR_CLASSES), children: [
4847
4868
  /* @__PURE__ */ jsxs43("span", { className: "flex items-center gap-2 text-caption", children: [
4848
- /* @__PURE__ */ jsx63(Avatar, { name: linked.latest.author.name, src: linked.latest.author.picture, size: 16 }),
4869
+ /* @__PURE__ */ jsx63(Avatar, { name: linked.latest.author.name, src: linked.latest.author.picture, bot: linked.latest.author.bot, size: 16 }),
4849
4870
  /* @__PURE__ */ jsx63("span", { className: "text-text-primary", children: linked.latest.author.name }),
4850
4871
  /* @__PURE__ */ jsx63("span", { className: cn("text-text-muted", TIME_CLASSES), children: linked.latest.at })
4851
4872
  ] }),
@@ -4871,7 +4892,7 @@ function SaidBody({ linked }) {
4871
4892
  const author = linked.author;
4872
4893
  return /* @__PURE__ */ jsxs43(Fragment14, { children: [
4873
4894
  /* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-2", children: [
4874
- /* @__PURE__ */ jsx63(Avatar, { name: author.name, src: author.picture, size: 24 }),
4895
+ /* @__PURE__ */ jsx63(Avatar, { name: author.name, src: author.picture, bot: author.bot, size: 24 }),
4875
4896
  /* @__PURE__ */ jsx63("span", { className: "text-body-2-strong text-text-primary", children: linked.updated ? author.name : /* @__PURE__ */ jsx63(CardLink, { href: linked.href, children: author.name }) }),
4876
4897
  linked.updated && /* @__PURE__ */ jsx63("span", { className: cn("text-caption text-text-muted", TIME_CLASSES), children: /* @__PURE__ */ jsx63(CardLink, { href: linked.href, children: linked.updated }) })
4877
4898
  ] }),
@@ -4964,7 +4985,7 @@ function LinkChip({ link, preview = true }) {
4964
4985
  const chip = /* @__PURE__ */ jsxs44(
4965
4986
  InlineChip,
4966
4987
  {
4967
- icon: said ? /* @__PURE__ */ jsx65(Avatar, { name: said.name, src: said.picture, size: 14 }) : /* @__PURE__ */ jsx65(LinkedIcon, { kind: linked.kind, size: 14, tone: "inherit" }),
4988
+ icon: said ? /* @__PURE__ */ jsx65(Avatar, { name: said.name, src: said.picture, bot: said.bot, size: 14 }) : /* @__PURE__ */ jsx65(LinkedIcon, { kind: linked.kind, size: 14, tone: "inherit" }),
4968
4989
  href: linked.href || void 0,
4969
4990
  className: preview ? "min-w-0 max-w-[40ch]" : "max-w-[min(40ch,calc(100%_-_4px))]",
4970
4991
  children: [
@@ -5187,9 +5208,17 @@ import { IconArrowNarrowRight, IconCircleCheck as IconCircleCheck4, IconDotsVert
5187
5208
 
5188
5209
  // src/ConversationMenu.tsx
5189
5210
  import { IconCircleCheck as IconCircleCheck3, IconCircleDashed as IconCircleDashed4, IconDotsVertical as IconDotsVertical3 } from "@tabler/icons-react";
5190
- import { jsx as jsx73, jsxs as jsxs51 } from "react/jsx-runtime";
5191
- 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 }) {
5192
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
+ ] });
5193
5222
  return /* @__PURE__ */ jsxs51(
5194
5223
  Menu,
5195
5224
  {
@@ -5199,10 +5228,10 @@ function ConversationMenu({ resolved = false, onResolve, onReopen, children, onE
5199
5228
  onOpenChange,
5200
5229
  className: "w-[244px]",
5201
5230
  children: [
5202
- 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 })),
5203
- children,
5204
- (resolves || children) && (onEdit || onDelete) && /* @__PURE__ */ jsx73(MenuSeparator, {}),
5205
- 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, {}),
5206
5235
  onDelete && /* @__PURE__ */ jsx73(MenuItem, { label: "Delete", destructive: true, onClick: onDelete })
5207
5236
  ]
5208
5237
  }
@@ -5302,15 +5331,15 @@ function ReactionRow({ reactions, options, nameOf, viewer, onToggle, className }
5302
5331
 
5303
5332
  // src/RepliesRow.tsx
5304
5333
  import { IconChevronRight as IconChevronRight4, IconMessage2 as IconMessage24 } from "@tabler/icons-react";
5305
- 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";
5306
5335
  var ROW_CLASSES3 = "flex w-full items-center gap-2 pb-1.5 pl-8 pr-2";
5307
5336
  var OPEN_CLASSES = "border-accent-outline bg-accent-wash";
5308
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";
5309
5338
  function RepliesRow({ count, faces, last, isNew = false, urgent = false, onOpen, open = false }) {
5310
5339
  const withFaces = !!faces && faces.length > 0;
5311
5340
  const label = `${count} ${count === 1 ? "reply" : "replies"}`;
5312
- const inner = /* @__PURE__ */ jsxs53(Fragment18, { children: [
5313
- 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 })) }) }),
5341
+ const inner = /* @__PURE__ */ jsxs53(Fragment19, { children: [
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 })) }) }),
5314
5343
  /* @__PURE__ */ jsx77(
5315
5344
  IconMessage24,
5316
5345
  {
@@ -5333,7 +5362,7 @@ function RepliesRow({ count, faces, last, isNew = false, urgent = false, onOpen,
5333
5362
  }
5334
5363
  )
5335
5364
  ] });
5336
- const chip = isNew && /* @__PURE__ */ jsxs53(Fragment18, { children: [
5365
+ const chip = isNew && /* @__PURE__ */ jsxs53(Fragment19, { children: [
5337
5366
  /* @__PURE__ */ jsx77("span", { className: "h-0.5 w-0.5 shrink-0 rounded-full bg-text-muted" }),
5338
5367
  /* @__PURE__ */ jsx77(Chip, { type: urgent ? "warning" : "brand", label: "1 new" })
5339
5368
  ] });
@@ -5354,7 +5383,7 @@ function RepliesRow({ count, faces, last, isNew = false, urgent = false, onOpen,
5354
5383
 
5355
5384
  // src/ResolveDialog.tsx
5356
5385
  import { useId as useId5, useState as useState17 } from "react";
5357
- 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";
5358
5387
  function ResolveDialog({ onResolve, onCancel, refused }) {
5359
5388
  const [note, setNote] = useState17("");
5360
5389
  const [busy, setBusy] = useState17(false);
@@ -5364,7 +5393,7 @@ function ResolveDialog({ onResolve, onCancel, refused }) {
5364
5393
  {
5365
5394
  title: "Resolve",
5366
5395
  onClose: onCancel,
5367
- footer: /* @__PURE__ */ jsxs54(Fragment19, { children: [
5396
+ footer: /* @__PURE__ */ jsxs54(Fragment20, { children: [
5368
5397
  /* @__PURE__ */ jsx78(Button, { variant: "muted", onClick: onCancel, children: "Cancel" }),
5369
5398
  /* @__PURE__ */ jsx78(Button, { variant: "resolve", type: "submit", form: formId, disabled: busy, children: "Resolve" })
5370
5399
  ] }),
@@ -5428,13 +5457,13 @@ function useFaceLine(root, active, toDot = false) {
5428
5457
  }
5429
5458
 
5430
5459
  // src/ConversationCard.tsx
5431
- import { Fragment as Fragment20, jsx as jsx79, jsxs as jsxs55 } from "react/jsx-runtime";
5432
- 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 }) {
5433
5462
  return /* @__PURE__ */ jsxs55("div", { className: "flex w-full items-center gap-2", children: [
5434
5463
  /* @__PURE__ */ jsxs55("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
5435
- /* @__PURE__ */ jsx79("span", { "data-face": true, className: "relative flex shrink-0", children: /* @__PURE__ */ jsx79(Avatar, { size: 24, src: author.picture, alt: author.name }) }),
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 }) }),
5436
5465
  /* @__PURE__ */ jsx79("span", { className: "min-w-0 truncate text-body-2-strong text-text-primary", children: author.name }),
5437
- 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 }),
5438
5467
  /* @__PURE__ */ jsx79(EditedMarker, { edited }),
5439
5468
  meta
5440
5469
  ] }),
@@ -5466,9 +5495,8 @@ function ResolvedCheck({ by, note, at }) {
5466
5495
  "Resolved"
5467
5496
  ] }) });
5468
5497
  }
5469
- 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";
5470
- function Words({ children, oneLine = false }) {
5471
- 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 }) });
5472
5500
  }
5473
5501
  function Reactions({ reactions, refused, readOnly }) {
5474
5502
  if ((!reactions || reactions.reactions.length === 0) && !refused) return null;
@@ -5483,7 +5511,7 @@ function Reactions({ reactions, refused, readOnly }) {
5483
5511
  }
5484
5512
  function Editing({ author, children }) {
5485
5513
  return /* @__PURE__ */ jsx79("div", { className: "p-2", children: /* @__PURE__ */ jsxs55("div", { className: "flex items-start gap-2", children: [
5486
- /* @__PURE__ */ jsx79(Avatar, { size: 24, src: author.picture, alt: author.name, className: "mt-1 shrink-0" }),
5514
+ /* @__PURE__ */ jsx79(Avatar, { size: 24, src: author.picture, alt: author.name, bot: author.bot, className: "mt-1 shrink-0" }),
5487
5515
  /* @__PURE__ */ jsx79("div", { className: "min-w-0 flex-1", children })
5488
5516
  ] }) });
5489
5517
  }
@@ -5514,7 +5542,7 @@ function useEditing(editing, onEditingChange) {
5514
5542
  return [now, set];
5515
5543
  }
5516
5544
  function ConversationCard(props) {
5517
- 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;
5518
5546
  const readOnly = (props.readOnly ?? false) || deleted;
5519
5547
  const inThreadCard = useContext12(InThreadCard);
5520
5548
  const item = useContext12(InConversationItem);
@@ -5532,18 +5560,16 @@ function ConversationCard(props) {
5532
5560
  const root = useRef15(null);
5533
5561
  const dotLine = useFaceLine(root, toDot, true);
5534
5562
  const settle = () => requestAnimationFrame(() => setHovered(stillHere(root.current)));
5535
- const offersMenu = !!resolves || !!menu || own && (!!editor || !!onDelete);
5563
+ const offersMenu = !!resolves || !!menu || !!menuAfter || own && (!!editor || !!onDelete);
5536
5564
  const showStrip = hovered && !isEditing && !readOnly;
5537
5565
  const react = reactions?.onToggle;
5538
5566
  const press = onClick ?? (readOnly && !replies?.count ? void 0 : item?.toggle);
5539
5567
  const reply = onReply ?? item?.show;
5540
5568
  const marked = selected ?? (item && !item.under ? item.open : void 0);
5541
5569
  const under = !!item?.under;
5542
- const closed = !inThreadCard && !marked;
5543
- const folded = !!resolved && closed;
5544
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 });
5545
5571
  const aboutShown = !!about && !deleted;
5546
- return /* @__PURE__ */ jsxs55(Fragment20, { children: [
5572
+ return /* @__PURE__ */ jsxs55(Fragment21, { children: [
5547
5573
  /* @__PURE__ */ jsxs55(
5548
5574
  Card,
5549
5575
  {
@@ -5569,13 +5595,14 @@ function ConversationCard(props) {
5569
5595
  },
5570
5596
  children: [
5571
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: [
5572
- 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: [
5573
5599
  /* @__PURE__ */ jsx79(
5574
5600
  Head,
5575
5601
  {
5576
5602
  author,
5577
5603
  time: props.time,
5578
5604
  timeHref: props.timeHref,
5605
+ timeLabel: props.timeLabel,
5579
5606
  edited: props.edited,
5580
5607
  isNew,
5581
5608
  urgent,
@@ -5584,10 +5611,10 @@ function ConversationCard(props) {
5584
5611
  ),
5585
5612
  aboutShown && // Under the name, above the words (Katerina, 1 November).
5586
5613
  /* @__PURE__ */ jsx79("div", { className: "relative w-full pl-8 pr-2 pt-0.5", children: about }),
5587
- /* @__PURE__ */ jsx79(Words, { oneLine: folded, children })
5614
+ /* @__PURE__ */ jsx79(Words, { children })
5588
5615
  ] }),
5589
- !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 }),
5590
- !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 }),
5591
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).
5592
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 }) }) }),
5593
5620
  repliesRow && /* @__PURE__ */ jsx79("div", { className: "relative w-full", children: repliesRow })
@@ -5620,7 +5647,11 @@ function ConversationCard(props) {
5620
5647
  resolved: !!resolved,
5621
5648
  onResolve: onResolve && (() => setResolving(true)),
5622
5649
  onReopen,
5650
+ resolveHint,
5651
+ label: menuLabel,
5623
5652
  onEdit: own && editor ? () => setEditing(true) : void 0,
5653
+ editLabel,
5654
+ after: menuAfter,
5624
5655
  onDelete: own && onDelete ? () => setDeleting(true) : void 0,
5625
5656
  children: menu
5626
5657
  }
@@ -5630,14 +5661,14 @@ function ConversationCard(props) {
5630
5661
  ]
5631
5662
  }
5632
5663
  ),
5633
- deleting && onDelete && /* @__PURE__ */ jsxs55(ConfirmDialog, { title: "Delete this comment?", confirmLabel: "Delete comment", destructive: true, onConfirm: onDelete, onClose: () => setDeleting(false), children: [
5634
- /* @__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." }),
5635
5666
  replies && replies.count > 0 && /* @__PURE__ */ jsxs55("p", { children: [
5636
5667
  "Its ",
5637
5668
  replies.count === 1 ? "reply stays" : `${replies.count} replies stay`,
5638
5669
  "."
5639
5670
  ] })
5640
- ] }),
5671
+ ] }) }),
5641
5672
  resolving && onResolve && /* @__PURE__ */ jsx79(
5642
5673
  ResolveDialog,
5643
5674
  {
@@ -5653,7 +5684,7 @@ function ConversationCard(props) {
5653
5684
  ] });
5654
5685
  }
5655
5686
  function ReplyCard(props) {
5656
- 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;
5657
5688
  const readOnly = props.readOnly ?? false;
5658
5689
  const [hovered, setHovered] = useState19(false);
5659
5690
  const [menuOpen, setMenuOpen] = useState19(false);
@@ -5661,11 +5692,11 @@ function ReplyCard(props) {
5661
5692
  const [deleting, setDeleting] = useState19(false);
5662
5693
  const [editing, setEditing] = useEditing(props.editing, props.onEditingChange);
5663
5694
  const isEditing = editing && !readOnly && !!editor;
5664
- const offersMenu = !!menu || own && (!!editor || !!onDelete);
5695
+ const offersMenu = !!menu || !!menuAfter || own && (!!editor || !!onDelete);
5665
5696
  const showStrip = hovered && !isEditing && !readOnly && (offersMenu || !!reactions?.onToggle);
5666
5697
  const root = useRef15(null);
5667
5698
  const settle = () => requestAnimationFrame(() => setHovered(stillHere(root.current)));
5668
- return /* @__PURE__ */ jsxs55(Fragment20, { children: [
5699
+ return /* @__PURE__ */ jsxs55(Fragment21, { children: [
5669
5700
  /* @__PURE__ */ jsxs55(
5670
5701
  Card,
5671
5702
  {
@@ -5689,7 +5720,7 @@ function ReplyCard(props) {
5689
5720
  },
5690
5721
  children: [
5691
5722
  isEditing ? /* @__PURE__ */ jsx79(Editing, { author, children: editor(() => setEditing(false)) }) : /* @__PURE__ */ jsxs55("div", { className: "flex flex-col items-start px-2 pt-2", children: [
5692
- /* @__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 }),
5693
5724
  about && /* @__PURE__ */ jsx79("div", { className: "w-full pl-8 pr-2 pt-0.5", children: about }),
5694
5725
  /* @__PURE__ */ jsx79(Words, { children }),
5695
5726
  files && /* @__PURE__ */ jsx79("div", { className: "flex w-full flex-wrap items-start gap-2 pb-2 pl-8 pr-2", children: files }),
@@ -5714,7 +5745,10 @@ function ReplyCard(props) {
5714
5745
  setMenuOpen(next);
5715
5746
  if (!next) settle();
5716
5747
  },
5748
+ label: menuLabel,
5717
5749
  onEdit: own && editor ? () => setEditing(true) : void 0,
5750
+ editLabel,
5751
+ after: menuAfter,
5718
5752
  onDelete: own && onDelete ? () => setDeleting(true) : void 0,
5719
5753
  children: menu
5720
5754
  }
@@ -5724,12 +5758,12 @@ function ReplyCard(props) {
5724
5758
  ]
5725
5759
  }
5726
5760
  ),
5727
- 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 })
5728
5762
  ] });
5729
5763
  }
5730
5764
 
5731
5765
  // src/ConversationLayout.tsx
5732
- 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";
5733
5767
 
5734
5768
  // src/Panel.tsx
5735
5769
  import { jsx as jsx80, jsxs as jsxs56 } from "react/jsx-runtime";
@@ -5758,10 +5792,10 @@ function Panel(props) {
5758
5792
  }
5759
5793
 
5760
5794
  // src/ConversationLayout.tsx
5761
- 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";
5762
5796
  function List({ items, open, under, above, loading, empty, change, caret }) {
5763
5797
  if (loading) return /* @__PURE__ */ jsx81(SkeletonConversation, {});
5764
- 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 });
5765
5799
  const stateOf = (item) => change && item.thread ? {
5766
5800
  under,
5767
5801
  open: open === item.id,
@@ -5770,14 +5804,35 @@ function List({ items, open, under, above, loading, empty, change, caret }) {
5770
5804
  } : null;
5771
5805
  const draw2 = (item) => {
5772
5806
  if (!under) {
5773
- 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);
5774
5811
  }
5775
5812
  return /* @__PURE__ */ jsx81(UnderItem, { item, isOpen: open === item.id && !!item.thread, state: stateOf(item), caret }, item.id);
5776
5813
  };
5777
5814
  if (!under) {
5778
- 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: [
5779
5829
  above,
5780
- 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
+ )
5781
5836
  ] });
5782
5837
  }
5783
5838
  const resolved = items.filter((item) => item.resolved);
@@ -5794,7 +5849,7 @@ function List({ items, open, under, above, loading, empty, change, caret }) {
5794
5849
  children: list.map(draw2)
5795
5850
  }
5796
5851
  );
5797
- return /* @__PURE__ */ jsxs57(Fragment21, { children: [
5852
+ return /* @__PURE__ */ jsxs57(Fragment23, { children: [
5798
5853
  above,
5799
5854
  items.filter((item) => !item.resolved && !item.gone).map(draw2),
5800
5855
  group("On deleted blocks", gone),
@@ -5827,7 +5882,24 @@ function UnderItem({ item, isOpen, state, caret }) {
5827
5882
  }
5828
5883
  );
5829
5884
  }
5830
- 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
+ }) {
5831
5903
  const body = useRef16(null);
5832
5904
  const pressed2 = useRef16(null);
5833
5905
  const itemAt = (id) => body.current?.querySelector(`[data-conversation-item="${CSS.escape(id)}"]`) ?? null;
@@ -5859,11 +5931,28 @@ function ConversationLayout({ threads, items, open, onOpenChange, box, above, lo
5859
5931
  }
5860
5932
  const opened = items.find((item) => item.id === open)?.thread;
5861
5933
  return /* @__PURE__ */ jsxs57("div", { className: cn("flex min-h-0 min-w-0 flex-1", className), children: [
5862
- /* @__PURE__ */ jsxs57("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
5863
- header,
5864
- /* @__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 }) }),
5865
- box && /* @__PURE__ */ jsx81("div", { className: "shrink-0 p-3", children: box })
5866
- ] }),
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
+ ),
5867
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 }) })
5868
5957
  ] });
5869
5958
  }
@@ -5880,11 +5969,11 @@ function QuotedLine({ words, state = "here", label }) {
5880
5969
  }
5881
5970
 
5882
5971
  // src/ReactionHorizon.tsx
5883
- import { Fragment as Fragment22, jsxs as jsxs59 } from "react/jsx-runtime";
5972
+ import { Fragment as Fragment24, jsxs as jsxs59 } from "react/jsx-runtime";
5884
5973
  function ReactionHorizon({ limit, omitted, cut = false }) {
5885
5974
  if (omitted <= 0 && !cut) return null;
5886
5975
  return /* @__PURE__ */ jsxs59("p", { className: "text-caption text-text-muted", children: [
5887
- omitted > 0 && /* @__PURE__ */ jsxs59(Fragment22, { children: [
5976
+ omitted > 0 && /* @__PURE__ */ jsxs59(Fragment24, { children: [
5888
5977
  "Reactions are shown for the latest ",
5889
5978
  limit,
5890
5979
  " comments and replies here. ",
@@ -5903,7 +5992,7 @@ import { jsx as jsx83, jsxs as jsxs60 } from "react/jsx-runtime";
5903
5992
  function PinnedComment({ author, time, words, deleted = false }) {
5904
5993
  return /* @__PURE__ */ jsx83(Card, { fill: "elevated", clip: true, children: deleted ? /* @__PURE__ */ jsx83("p", { className: "p-2 text-caption italic text-text-muted", children: "This comment was deleted." }) : /* @__PURE__ */ jsxs60("div", { className: "flex flex-col p-2", children: [
5905
5994
  /* @__PURE__ */ jsxs60("div", { className: "flex items-center gap-2", children: [
5906
- /* @__PURE__ */ jsx83(Avatar, { size: 24, src: author.picture, alt: author.name }),
5995
+ /* @__PURE__ */ jsx83(Avatar, { size: 24, src: author.picture, alt: author.name, bot: author.bot }),
5907
5996
  /* @__PURE__ */ jsx83("span", { className: "min-w-0 truncate text-body-2-strong text-text-primary", children: author.name }),
5908
5997
  /* @__PURE__ */ jsx83(MetaText, { className: "shrink-0", children: time })
5909
5998
  ] }),
@@ -5947,14 +6036,29 @@ function ArchivedNotice({ by, when, resolution, withWhat, withTitle, onUnarchive
5947
6036
  import { Children } from "react";
5948
6037
  import { IconX as IconX6 } from "@tabler/icons-react";
5949
6038
  import { useContext as useContext13 } from "react";
5950
- 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";
5951
6040
  var anyIn = (children) => Children.toArray(children).length > 0;
5952
- function Replies({ children, loading }) {
6041
+ function Replies({ children, loading, empty }) {
5953
6042
  if (loading) return /* @__PURE__ */ jsx85(SkeletonConversation, {});
5954
- if (!anyIn(children)) return /* @__PURE__ */ jsx85(EmptyState, { scope: "section", message: "No replies yet." });
5955
- 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 });
5956
6045
  }
5957
- 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
+ }) {
5958
6062
  const foot = notice ?? box;
5959
6063
  const layoutLine = useContext13(LineByLayout);
5960
6064
  if (place === "under") {
@@ -5978,16 +6082,16 @@ function Thread({ place = "beside", start, children, loading = false, resolved =
5978
6082
  bodyRef,
5979
6083
  bodyClassName: "flex flex-col",
5980
6084
  title,
5981
- actions: /* @__PURE__ */ jsxs62(Fragment23, { children: [
6085
+ actions: /* @__PURE__ */ jsxs62(Fragment25, { children: [
5982
6086
  resolved && /* @__PURE__ */ jsx85(Chip, { type: "success", label: "Resolved" }),
5983
6087
  actions,
5984
- 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 }) })
5985
6089
  ] }),
5986
6090
  footer: foot && /* @__PURE__ */ jsx85("div", { className: "p-3", children: foot }),
5987
6091
  children: [
5988
- 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 }) }),
5989
6093
  /* @__PURE__ */ jsx85(Divider, { look: "section", label: "Replies", className: "px-4 py-2" }),
5990
- /* @__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 }) }) })
5991
6095
  ]
5992
6096
  }
5993
6097
  );
@@ -6025,9 +6129,9 @@ function SearchInput({ shortcut, className, placeholder = "Search\u2026", ...pro
6025
6129
  }
6026
6130
 
6027
6131
  // src/PageHeader.tsx
6028
- import { Fragment as Fragment24 } from "react";
6132
+ import { Fragment as Fragment26 } from "react";
6029
6133
  import { IconLock } from "@tabler/icons-react";
6030
- 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";
6031
6135
  function PageHeader({ title, leading, private: locked = false, after, meta, time, members, actions, className }) {
6032
6136
  const words = (meta ?? []).map((one) => typeof one === "string" ? { label: one } : one);
6033
6137
  const quiet = words.length > 0 || time != null || members != null;
@@ -6037,11 +6141,11 @@ function PageHeader({ title, leading, private: locked = false, after, meta, time
6037
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 }),
6038
6142
  after != null && /* @__PURE__ */ jsx87("span", { className: "flex shrink-0 items-center", children: after })
6039
6143
  ] });
6040
- const right = quiet || actions != null ? /* @__PURE__ */ jsxs64(Fragment25, { children: [
6144
+ const right = quiet || actions != null ? /* @__PURE__ */ jsxs64(Fragment27, { children: [
6041
6145
  quiet && // The quiet group: 12px between its parts, and 12px clear of the buttons — the bar sets
6042
6146
  // its actions 4px apart, so the group adds the other 8px, as Peek's and Leaf's bars do.
6043
6147
  /* @__PURE__ */ jsxs64("div", { className: cn("flex items-center gap-3", actions != null && "pr-2"), children: [
6044
- 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: [
6045
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
6046
6150
  /* @__PURE__ */ jsx87("span", { "aria-hidden": "true", className: "size-[3px] shrink-0 rounded-full bg-text-muted" }),
6047
6151
  /* @__PURE__ */ jsx87(MetaText, { tone: one.done ? "success" : "secondary", children: one.label })
@@ -6096,7 +6200,7 @@ function ListColumn(props) {
6096
6200
 
6097
6201
  // src/Tabs.tsx
6098
6202
  import { Tabs as BaseTabs } from "@base-ui/react/tabs";
6099
- 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";
6100
6204
  function Tabs({ tabs, active, onChange, size = "default", className, ...aria }) {
6101
6205
  return /* @__PURE__ */ jsx89(
6102
6206
  BaseTabs.Root,
@@ -6130,7 +6234,7 @@ function Tabs({ tabs, active, onChange, size = "default", className, ...aria })
6130
6234
  tab.label,
6131
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
6132
6236
  ] }),
6133
- tab.unread ? /* @__PURE__ */ jsxs66(Fragment26, { children: [
6237
+ tab.unread ? /* @__PURE__ */ jsxs66(Fragment28, { children: [
6134
6238
  /* @__PURE__ */ jsx89(UnreadDot, { className: "h-auto w-auto" }),
6135
6239
  /* @__PURE__ */ jsx89("span", { className: "sr-only", children: "new" })
6136
6240
  ] }) : null