@estiva-app/ui 0.112.0 → 0.114.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3978,7 +3978,7 @@ function Breadcrumb({ items, className }) {
3978
3978
  }
3979
3979
 
3980
3980
  // src/NavItem.tsx
3981
- import { useId as useId4, useState as useState16 } from "react";
3981
+ import { useId as useId4, useState as useState17 } from "react";
3982
3982
  import { Collapsible as Collapsible2 } from "@base-ui/react/collapsible";
3983
3983
  import { IconChevronRight as IconChevronRight3, IconDotsVertical as IconDotsVertical2 } from "@tabler/icons-react";
3984
3984
 
@@ -4160,14 +4160,74 @@ function CollapsibleSection({ title, defaultOpen = true, open: openProp, onOpenC
4160
4160
  ] });
4161
4161
  }
4162
4162
 
4163
+ // src/PreviewCard.tsx
4164
+ import { useRef as useRef15, useState as useState16 } from "react";
4165
+ import { PreviewCard as BasePreviewCard } from "@base-ui/react/preview-card";
4166
+ import { jsx as jsx56, jsxs as jsxs41 } from "react/jsx-runtime";
4167
+ var GAP5 = 12;
4168
+ var VIEWPORT_PAD5 = 8;
4169
+ var OPEN_DELAY2 = 350;
4170
+ var CLOSE_DELAY = 200;
4171
+ function PreviewCard({ content, children, side = "right", delay = OPEN_DELAY2, closeDelay = CLOSE_DELAY, className, contentClassName, wrapperClassName, openOnTap = false }) {
4172
+ const [open, setOpen] = useState16(false);
4173
+ const press = useRef15(void 0);
4174
+ const lastPointer = useRef15(void 0);
4175
+ const onOpenChange = (next, details) => {
4176
+ if (openOnTap && next && details.reason === "trigger-focus" && lastPointer.current === "touch") return;
4177
+ setOpen(next);
4178
+ };
4179
+ const tapHandlers = openOnTap ? {
4180
+ onPointerDown: (event) => {
4181
+ press.current = { pointerType: event.pointerType, wasOpen: open };
4182
+ lastPointer.current = event.pointerType;
4183
+ },
4184
+ onClick: () => {
4185
+ const last = press.current;
4186
+ press.current = void 0;
4187
+ if (last?.pointerType === "mouse" || last?.pointerType === "pen") return;
4188
+ setOpen(!(last ? last.wasOpen : open));
4189
+ }
4190
+ } : {};
4191
+ return /* @__PURE__ */ jsxs41(BasePreviewCard.Root, { open, onOpenChange, children: [
4192
+ /* @__PURE__ */ jsx56(
4193
+ BasePreviewCard.Trigger,
4194
+ {
4195
+ delay,
4196
+ closeDelay,
4197
+ render: /* @__PURE__ */ jsx56("span", { className: cn("inline-flex", wrapperClassName) }),
4198
+ ...tapHandlers,
4199
+ children
4200
+ }
4201
+ ),
4202
+ /* @__PURE__ */ jsx56(BasePreviewCard.Portal, { children: /* @__PURE__ */ jsx56(
4203
+ BasePreviewCard.Positioner,
4204
+ {
4205
+ side,
4206
+ align: "start",
4207
+ sideOffset: GAP5,
4208
+ collisionPadding: VIEWPORT_PAD5,
4209
+ className: "z-50 data-[anchor-hidden]:hidden",
4210
+ children: /* @__PURE__ */ jsx56(
4211
+ BasePreviewCard.Popup,
4212
+ {
4213
+ className: cn("w-[360px] p-0 outline-none", className),
4214
+ render: /* @__PURE__ */ jsx56(MenuPanel, {}),
4215
+ children: /* @__PURE__ */ jsx56(ScrollArea, { viewportClassName: "max-h-[min(300px,var(--available-height))]", contentClassName: cn("flex flex-col gap-3 p-3", contentClassName), children: content })
4216
+ }
4217
+ )
4218
+ }
4219
+ ) })
4220
+ ] });
4221
+ }
4222
+
4163
4223
  // src/UnreadDot.tsx
4164
- import { jsx as jsx56 } from "react/jsx-runtime";
4165
- function UnreadDot({ className }) {
4166
- return /* @__PURE__ */ jsx56("div", { className: cn("flex h-6 w-6 shrink-0 items-center justify-center", className), "data-unread": true, children: /* @__PURE__ */ jsx56("div", { className: "h-1.5 w-1.5 rounded-full bg-accent-primary" }) });
4224
+ import { jsx as jsx57 } from "react/jsx-runtime";
4225
+ function UnreadDot({ className, quiet = false }) {
4226
+ return /* @__PURE__ */ jsx57("div", { className: cn("flex h-6 w-6 shrink-0 items-center justify-center", className), ...quiet ? {} : { "data-unread": "" }, children: /* @__PURE__ */ jsx57("div", { className: cn("h-1.5 w-1.5 rounded-full", quiet ? "border border-border-strong" : "bg-accent-primary") }) });
4167
4227
  }
4168
4228
 
4169
4229
  // src/NavItem.tsx
4170
- import { jsx as jsx57, jsxs as jsxs41 } from "react/jsx-runtime";
4230
+ import { jsx as jsx58, jsxs as jsxs42 } from "react/jsx-runtime";
4171
4231
  function NavItem({
4172
4232
  label,
4173
4233
  href,
@@ -4182,6 +4242,7 @@ function NavItem({
4182
4242
  tooltip,
4183
4243
  unread = false,
4184
4244
  urgent = false,
4245
+ preview,
4185
4246
  children,
4186
4247
  defaultOpen = true,
4187
4248
  open: openProp,
@@ -4193,7 +4254,7 @@ function NavItem({
4193
4254
  ...props
4194
4255
  }) {
4195
4256
  const inApp = useInAppClick(href, onClick, onPlainClick);
4196
- const [openState, setOpenState] = useState16(defaultOpen);
4257
+ const [openState, setOpenState] = useState17(defaultOpen);
4197
4258
  const panelId = useId4();
4198
4259
  const hasRows = children != null && children !== false;
4199
4260
  const open = openProp ?? openState;
@@ -4204,9 +4265,9 @@ function NavItem({
4204
4265
  useOpenFor(hasRows ? openFor : void 0, open, setOpen);
4205
4266
  const buttons = (menu != null ? 1 : 0) + (action ? 1 : 0);
4206
4267
  const besides = buttons > 0 || hasRows;
4207
- const mark = unread ? urgent ? /* @__PURE__ */ jsx57(UrgentMark, {}) : /* @__PURE__ */ jsx57(UnreadDot, {}) : null;
4268
+ const mark = unread ? urgent ? /* @__PURE__ */ jsx58(UrgentMark, {}) : /* @__PURE__ */ jsx58(UnreadDot, {}) : null;
4208
4269
  const stepsAside = buttons > 0 && "transition-opacity group-hover/nav:opacity-0 group-has-[:focus-visible]/nav:opacity-0 group-has-[[data-nav-menu]_[aria-expanded=true]]/nav:opacity-0 [@media(hover:none)]:opacity-0";
4209
- const row = /* @__PURE__ */ jsxs41(
4270
+ const row = /* @__PURE__ */ jsxs42(
4210
4271
  "a",
4211
4272
  {
4212
4273
  href,
@@ -4228,7 +4289,7 @@ function NavItem({
4228
4289
  ...props,
4229
4290
  onClick: inApp,
4230
4291
  children: [
4231
- (icon || hasRows) && /* @__PURE__ */ jsx57(
4292
+ (icon || hasRows) && /* @__PURE__ */ jsx58(
4232
4293
  "span",
4233
4294
  {
4234
4295
  className: cn(
@@ -4239,17 +4300,18 @@ function NavItem({
4239
4300
  children: icon
4240
4301
  }
4241
4302
  ),
4242
- tooltip?.trim() ? (
4303
+ tooltip?.trim() && preview == null ? (
4243
4304
  // On the label alone, not the row: the ⋮ and the action keep their
4244
- // own tooltips, and the two never stand up at once.
4245
- /* @__PURE__ */ jsx57(WithTooltip, { label: tooltip, inline: true, wrapperClassName: "flex min-w-0 flex-1", children: /* @__PURE__ */ jsx57("span", { className: cn("flex-1 truncate", unread && "font-medium"), children: label }) })
4246
- ) : /* @__PURE__ */ jsx57("span", { className: cn("flex-1 truncate", unread && "font-medium"), children: label }),
4305
+ // own tooltips, and the two never stand up at once. A row with a
4306
+ // preview card says more there, so the label has no tooltip beside it.
4307
+ /* @__PURE__ */ jsx58(WithTooltip, { label: tooltip, inline: true, wrapperClassName: "flex min-w-0 flex-1", children: /* @__PURE__ */ jsx58("span", { className: cn("flex-1 truncate", unread && "font-medium"), children: label }) })
4308
+ ) : /* @__PURE__ */ jsx58("span", { className: cn("flex-1 truncate", unread && "font-medium"), children: label }),
4247
4309
  hint != null && // Takes room only while it shows, so the label gives way to it.
4248
- /* @__PURE__ */ jsx57("span", { className: "hidden shrink-0 items-center group-hover/nav:flex group-has-[:focus-visible]/nav:flex", children: hint }),
4310
+ /* @__PURE__ */ jsx58("span", { className: "hidden shrink-0 items-center group-hover/nav:flex group-has-[:focus-visible]/nav:flex", children: hint }),
4249
4311
  buttons > 1 && // Two buttons: the second one's room (24px and the 4px between them, the
4250
4312
  // row's 8px gap making up the rest), kept only while they show.
4251
- /* @__PURE__ */ jsx57("span", { "aria-hidden": "true", className: "hidden w-5 shrink-0 group-hover/nav:block group-has-[:focus-visible]/nav:block group-has-[[data-nav-menu]_[aria-expanded=true]]/nav:block [@media(hover:none)]:block" }),
4252
- count ? /* @__PURE__ */ jsx57(WithTooltip, { label: countLabel ?? `${count} open`, children: /* @__PURE__ */ jsx57(
4313
+ /* @__PURE__ */ jsx58("span", { "aria-hidden": "true", className: "hidden w-5 shrink-0 group-hover/nav:block group-has-[:focus-visible]/nav:block group-has-[[data-nav-menu]_[aria-expanded=true]]/nav:block [@media(hover:none)]:block" }),
4314
+ count ? /* @__PURE__ */ jsx58(WithTooltip, { label: countLabel ?? `${count} open`, children: /* @__PURE__ */ jsx58(
4253
4315
  "span",
4254
4316
  {
4255
4317
  className: cn(
@@ -4265,7 +4327,7 @@ function NavItem({
4265
4327
  // `-mr-1`: the 24px slot's dot then sits on the axis of a count and
4266
4328
  // of the ⋮ (8px from the edge to the 16px box), one column with a
4267
4329
  // folder heading's dot and ⋮ (Katerina, 5 October).
4268
- /* @__PURE__ */ jsx57("span", { className: cn("-mr-1 flex shrink-0", stepsAside), children: mark })
4330
+ /* @__PURE__ */ jsx58("span", { className: cn("-mr-1 flex shrink-0", stepsAside), children: mark })
4269
4331
  ) : buttons > 0 && !count ? (
4270
4332
  // Nothing at the right, but a menu: no room is kept at rest, so the
4271
4333
  // label has the row's whole width; while the ⋮ shows, its 24px slot
@@ -4273,18 +4335,19 @@ function NavItem({
4273
4335
  // `-mr-1`: the ⋮ sits at `right-1`, 4px into the row's padding, so the
4274
4336
  // slot does too — at the padding's edge it kept 4px the ⋮ never
4275
4337
  // covers, and the label stopped 12px short of the button, not 8.
4276
- /* @__PURE__ */ jsx57("span", { "aria-hidden": "true", className: "-mr-1 hidden w-6 shrink-0 group-hover/nav:block group-has-[:focus-visible]/nav:block group-has-[[data-nav-menu]_[aria-expanded=true]]/nav:block [@media(hover:none)]:block" })
4338
+ /* @__PURE__ */ jsx58("span", { "aria-hidden": "true", className: "-mr-1 hidden w-6 shrink-0 group-hover/nav:block group-has-[:focus-visible]/nav:block group-has-[[data-nav-menu]_[aria-expanded=true]]/nav:block [@media(hover:none)]:block" })
4277
4339
  ) : null
4278
4340
  ]
4279
4341
  }
4280
4342
  );
4281
- if (!besides && hint == null) return row;
4343
+ const card = (trigger) => preview == null ? trigger : /* @__PURE__ */ jsx58(PreviewCard, { content: preview, contentClassName: "gap-0.5 p-1", wrapperClassName: "block w-full shrink-0", children: trigger });
4344
+ if (!besides && hint == null) return card(row);
4282
4345
  const name = menuLabel ?? `More options for ${label}`;
4283
- const line = /* @__PURE__ */ jsxs41("div", { className: "group/nav relative shrink-0", children: [
4346
+ const line = /* @__PURE__ */ jsxs42("div", { className: "group/nav relative shrink-0", children: [
4284
4347
  row,
4285
4348
  hasRows && // `left-1`: the 24px button's 16px arrow then sits where the icon
4286
4349
  // sits (the row's px-2), so the icon turns into the arrow in place.
4287
- /* @__PURE__ */ jsx57("div", { className: "absolute inset-y-0 left-1 flex items-center opacity-0 transition-opacity group-hover/nav:opacity-100 group-has-[:focus-visible]/nav:opacity-100", children: /* @__PURE__ */ jsx57(
4350
+ /* @__PURE__ */ jsx58("div", { className: "absolute inset-y-0 left-1 flex items-center opacity-0 transition-opacity group-hover/nav:opacity-100 group-has-[:focus-visible]/nav:opacity-100", children: /* @__PURE__ */ jsx58(
4288
4351
  IconButton,
4289
4352
  {
4290
4353
  tooltip: open ? "Collapse" : "Expand",
@@ -4292,7 +4355,7 @@ function NavItem({
4292
4355
  "aria-expanded": open,
4293
4356
  "aria-controls": panelId,
4294
4357
  onClick: () => setOpen(!open),
4295
- children: /* @__PURE__ */ jsx57(IconChevronRight3, { size: 16, stroke: 1.5, className: cn("transition-transform duration-150", open && "rotate-90") })
4358
+ children: /* @__PURE__ */ jsx58(IconChevronRight3, { size: 16, stroke: 1.5, className: cn("transition-transform duration-150", open && "rotate-90") })
4296
4359
  }
4297
4360
  ) }),
4298
4361
  buttons > 0 && // `right-1`: the 24px button's 16px icon ends 8px from the row's
@@ -4303,36 +4366,36 @@ function NavItem({
4303
4366
  // right of the slot's centre.
4304
4367
  // On a screen with no hover it always shows: nothing there can point
4305
4368
  // at the row, and the menu has no other way in.
4306
- /* @__PURE__ */ jsxs41("div", { "data-nav-menu": true, className: cn("absolute inset-y-0 right-1 flex items-center gap-1", "opacity-0 transition-opacity group-hover/nav:opacity-100 group-has-[:focus-visible]/nav:opacity-100 has-[[aria-expanded=true]]:opacity-100 [@media(hover:none)]:opacity-100"), children: [
4307
- action && /* @__PURE__ */ jsx57(IconButton, { tooltip: action.tooltip, "aria-label": `${action.tooltip}: ${label}`, onClick: action.onClick, children: action.icon }),
4308
- menu != null && /* @__PURE__ */ jsx57(
4369
+ /* @__PURE__ */ jsxs42("div", { "data-nav-menu": true, className: cn("absolute inset-y-0 right-1 flex items-center gap-1", "opacity-0 transition-opacity group-hover/nav:opacity-100 group-has-[:focus-visible]/nav:opacity-100 has-[[aria-expanded=true]]:opacity-100 [@media(hover:none)]:opacity-100"), children: [
4370
+ action && /* @__PURE__ */ jsx58(IconButton, { tooltip: action.tooltip, "aria-label": `${action.tooltip}: ${label}`, onClick: action.onClick, children: action.icon }),
4371
+ menu != null && /* @__PURE__ */ jsx58(
4309
4372
  Menu,
4310
4373
  {
4311
4374
  align: "right",
4312
- trigger: /* @__PURE__ */ jsx57(IconButton, { tooltip: "More options", "aria-label": name, children: /* @__PURE__ */ jsx57(IconDotsVertical2, { size: 16, stroke: 1.5 }) }),
4375
+ trigger: /* @__PURE__ */ jsx58(IconButton, { tooltip: "More options", "aria-label": name, children: /* @__PURE__ */ jsx58(IconDotsVertical2, { size: 16, stroke: 1.5 }) }),
4313
4376
  children: menu
4314
4377
  }
4315
4378
  )
4316
4379
  ] })
4317
4380
  ] });
4318
- if (!hasRows) return line;
4319
- return /* @__PURE__ */ jsxs41(Collapsible2.Root, { open, onOpenChange: setOpen, className: "flex shrink-0 flex-col", children: [
4320
- line,
4321
- /* @__PURE__ */ jsx57(
4381
+ if (!hasRows) return card(line);
4382
+ return /* @__PURE__ */ jsxs42(Collapsible2.Root, { open, onOpenChange: setOpen, className: "flex shrink-0 flex-col", children: [
4383
+ card(line),
4384
+ /* @__PURE__ */ jsx58(
4322
4385
  Collapsible2.Panel,
4323
4386
  {
4324
4387
  id: panelId,
4325
4388
  hiddenUntilFound: true,
4326
4389
  className: COLLAPSIBLE_PANEL_CLASSES,
4327
- children: /* @__PURE__ */ jsx57("div", { className: "flex flex-col gap-0.5 pt-0.5 pl-6", children })
4390
+ children: /* @__PURE__ */ jsx58("div", { className: "flex flex-col gap-0.5 pt-0.5 pl-6", children })
4328
4391
  }
4329
4392
  )
4330
4393
  ] });
4331
4394
  }
4332
4395
 
4333
4396
  // src/NavTree.tsx
4334
- import { createContext as createContext8, useContext as useContext8, useEffect as useEffect9, useRef as useRef15, useState as useState17 } from "react";
4335
- import { jsx as jsx58, jsxs as jsxs42 } from "react/jsx-runtime";
4397
+ import { createContext as createContext8, useContext as useContext8, useEffect as useEffect9, useRef as useRef16, useState as useState18 } from "react";
4398
+ import { jsx as jsx59, jsxs as jsxs43 } from "react/jsx-runtime";
4336
4399
  var NAV_TREE_INTENT_MS = 150;
4337
4400
  var NAV_TREE_REVEAL_MS = 200;
4338
4401
  var NAV_TREE_PENDING_MS = 2e3;
@@ -4369,7 +4432,7 @@ function scrollToRow(row) {
4369
4432
  else if (at.bottom > view.bottom) box.scrollTop += Math.min(at.bottom - view.bottom, at.top - view.top);
4370
4433
  }
4371
4434
  function Line({ message }) {
4372
- return /* @__PURE__ */ jsx58(EmptyState, { scope: "rows", message });
4435
+ return /* @__PURE__ */ jsx59(EmptyState, { scope: "rows", message });
4373
4436
  }
4374
4437
  var groupLinked = createContext8(void 0);
4375
4438
  function groupBox(box, id) {
@@ -4377,8 +4440,8 @@ function groupBox(box, id) {
4377
4440
  return group && group.getBoundingClientRect().height > 0 ? group : void 0;
4378
4441
  }
4379
4442
  function Row({ node, selected, onSelect, opening }) {
4380
- const under = node.childrenMessage !== void 0 ? /* @__PURE__ */ jsx58(Line, { message: node.childrenMessage }) : node.children?.length ? node.children.map((child) => /* @__PURE__ */ jsx58(Row, { node: child, selected, onSelect, opening }, child.id)) : node.children === null || node.hasChildren && node.children === void 0 ? /* @__PURE__ */ jsx58(SkeletonList, { rows: 2 }) : void 0;
4381
- return /* @__PURE__ */ jsx58(
4443
+ const under = node.childrenMessage !== void 0 ? /* @__PURE__ */ jsx59(Line, { message: node.childrenMessage }) : node.children?.length ? node.children.map((child) => /* @__PURE__ */ jsx59(Row, { node: child, selected, onSelect, opening }, child.id)) : node.children === null || node.hasChildren && node.children === void 0 ? /* @__PURE__ */ jsx59(SkeletonList, { rows: 2 }) : void 0;
4444
+ return /* @__PURE__ */ jsx59(
4382
4445
  NavItem,
4383
4446
  {
4384
4447
  href: node.href,
@@ -4401,7 +4464,7 @@ function Row({ node, selected, onSelect, opening }) {
4401
4464
  );
4402
4465
  }
4403
4466
  function Group({ group, selected, onSelect, opening, storageKey }) {
4404
- return /* @__PURE__ */ jsx58(
4467
+ return /* @__PURE__ */ jsx59(
4405
4468
  NavTreeSection,
4406
4469
  {
4407
4470
  id: group.id,
@@ -4418,14 +4481,14 @@ function Group({ group, selected, onSelect, opening, storageKey }) {
4418
4481
  storageKey: storageKey ? `${storageKey}.${group.id}` : void 0,
4419
4482
  openFor: opening?.group === group.id ? opening.item : void 0,
4420
4483
  onIntent: group.onIntent,
4421
- children: group.nodes?.map((node) => /* @__PURE__ */ jsx58(Row, { node, selected, onSelect, opening }, node.id))
4484
+ children: group.nodes?.map((node) => /* @__PURE__ */ jsx59(Row, { node, selected, onSelect, opening }, node.id))
4422
4485
  }
4423
4486
  );
4424
4487
  }
4425
4488
  function NavTreeSection({ id, title, message, loading = false, pending = false, trailing, actions, menu, icon, defaultOpen = true, open, onOpenChange, storageKey, openFor, onIntent, children }) {
4426
- const timer = useRef15(void 0);
4489
+ const timer = useRef16(void 0);
4427
4490
  useEffect9(() => () => clearTimeout(timer.current), []);
4428
- const [slow, setSlow] = useState17(false);
4491
+ const [slow, setSlow] = useState18(false);
4429
4492
  if (!pending && slow) setSlow(false);
4430
4493
  useEffect9(() => {
4431
4494
  if (!pending) return;
@@ -4435,7 +4498,7 @@ function NavTreeSection({ id, title, message, loading = false, pending = false,
4435
4498
  const intent = onIntent;
4436
4499
  const linkedTo = useContext8(groupLinked);
4437
4500
  const linked = id !== void 0 && linkedTo === id ? id : void 0;
4438
- return /* @__PURE__ */ jsx58(
4501
+ return /* @__PURE__ */ jsx59(
4439
4502
  "div",
4440
4503
  {
4441
4504
  className: "shrink-0 [&+&]:mt-1",
@@ -4446,7 +4509,7 @@ function NavTreeSection({ id, title, message, loading = false, pending = false,
4446
4509
  } : void 0,
4447
4510
  onPointerLeave: intent ? () => clearTimeout(timer.current) : void 0,
4448
4511
  onFocus: intent,
4449
- children: /* @__PURE__ */ jsx58(sectionLinked.Provider, { value: linked, children: /* @__PURE__ */ jsx58(
4512
+ children: /* @__PURE__ */ jsx59(sectionLinked.Provider, { value: linked, children: /* @__PURE__ */ jsx59(
4450
4513
  CollapsibleSection,
4451
4514
  {
4452
4515
  title,
@@ -4463,7 +4526,7 @@ function NavTreeSection({ id, title, message, loading = false, pending = false,
4463
4526
  icon,
4464
4527
  className: "shrink-0",
4465
4528
  contentClassName: "gap-0.5",
4466
- children: /* @__PURE__ */ jsx58(sectionLinked.Provider, { value: void 0, children: message !== void 0 ? /* @__PURE__ */ jsx58(Line, { message }) : loading || slow ? /* @__PURE__ */ jsx58(SkeletonList, { rows: 3 }) : children })
4529
+ children: /* @__PURE__ */ jsx59(sectionLinked.Provider, { value: void 0, children: message !== void 0 ? /* @__PURE__ */ jsx59(Line, { message }) : loading || slow ? /* @__PURE__ */ jsx59(SkeletonList, { rows: 3 }) : children })
4467
4530
  }
4468
4531
  ) })
4469
4532
  }
@@ -4471,10 +4534,10 @@ function NavTreeSection({ id, title, message, loading = false, pending = false,
4471
4534
  }
4472
4535
  function NavTree({ title, titleActions, groups, children, selected, selectedParent, selectedGroup, onSelect, emptyMessage = "", storageKey }) {
4473
4536
  const opening = groups ? openingFor(groups, selected, selectedParent) : null;
4474
- const box = useRef15(null);
4475
- const scrolled = useRef15(void 0);
4476
- const waiting = useRef15(void 0);
4477
- const latest = useRef15(selected);
4537
+ const box = useRef16(null);
4538
+ const scrolled = useRef16(void 0);
4539
+ const waiting = useRef16(void 0);
4540
+ const latest = useRef16(selected);
4478
4541
  latest.current = selected;
4479
4542
  useEffect9(() => {
4480
4543
  if (selected === void 0 || scrolled.current === selected || waiting.current !== void 0) return;
@@ -4487,7 +4550,7 @@ function NavTree({ title, titleActions, groups, children, selected, selectedPare
4487
4550
  }, NAV_TREE_REVEAL_MS);
4488
4551
  });
4489
4552
  useEffect9(() => () => clearTimeout(waiting.current), []);
4490
- const groupScrolled = useRef15(void 0);
4553
+ const groupScrolled = useRef16(void 0);
4491
4554
  useEffect9(() => {
4492
4555
  if (selectedGroup === void 0) {
4493
4556
  groupScrolled.current = void 0;
@@ -4501,12 +4564,12 @@ function NavTree({ title, titleActions, groups, children, selected, selectedPare
4501
4564
  });
4502
4565
  return (
4503
4566
  // `contents`: a box to find the current row in, that lays nothing out — the groups stay the column's own.
4504
- /* @__PURE__ */ jsx58("div", { ref: box, className: "contents", children: /* @__PURE__ */ jsxs42(groupLinked.Provider, { value: selectedGroup, children: [
4505
- title && /* @__PURE__ */ jsx58(SectionHeader, { title, look: "quiet", showActions: "always", actions: titleActions, className: "mt-4 shrink-0" }),
4506
- groups === void 0 ? children : groups === null ? /* @__PURE__ */ jsx58(SkeletonList, { rows: 5 }) : groups.length === 0 ? (
4567
+ /* @__PURE__ */ jsx59("div", { ref: box, className: "contents", children: /* @__PURE__ */ jsxs43(groupLinked.Provider, { value: selectedGroup, children: [
4568
+ title && /* @__PURE__ */ jsx59(SectionHeader, { title, look: "quiet", showActions: "always", actions: titleActions, className: "mt-4 shrink-0" }),
4569
+ groups === void 0 ? children : groups === null ? /* @__PURE__ */ jsx59(SkeletonList, { rows: 5 }) : groups.length === 0 ? (
4507
4570
  // No words, no line: an app that says nothing when it has no groups.
4508
- emptyMessage ? /* @__PURE__ */ jsx58(Line, { message: emptyMessage }) : null
4509
- ) : groups.map((group) => /* @__PURE__ */ jsx58(Group, { group, selected, onSelect, opening, storageKey }, group.id))
4571
+ emptyMessage ? /* @__PURE__ */ jsx59(Line, { message: emptyMessage }) : null
4572
+ ) : groups.map((group) => /* @__PURE__ */ jsx59(Group, { group, selected, onSelect, opening, storageKey }, group.id))
4510
4573
  ] }) })
4511
4574
  );
4512
4575
  }
@@ -4514,16 +4577,16 @@ function NavTree({ title, titleActions, groups, children, selected, selectedPare
4514
4577
  // src/Popover.tsx
4515
4578
  import { useMemo as useMemo4 } from "react";
4516
4579
  import { Popover as BasePopover } from "@base-ui/react/popover";
4517
- import { jsx as jsx59, jsxs as jsxs43 } from "react/jsx-runtime";
4518
- var GAP5 = 4;
4519
- var VIEWPORT_PAD5 = 8;
4580
+ import { jsx as jsx60, jsxs as jsxs44 } from "react/jsx-runtime";
4581
+ var GAP6 = 4;
4582
+ var VIEWPORT_PAD6 = 8;
4520
4583
  function Popover({ trigger, anchor, align = "left", side = "bottom", open, onOpenChange, finalFocus, actionsRef, ariaLabel, children, className, contentClassName, maxHeight }) {
4521
4584
  const anchorTarget = useMemo4(() => {
4522
4585
  if (!anchor) return void 0;
4523
4586
  if (anchor instanceof Element || "getBoundingClientRect" in anchor) return anchor;
4524
4587
  return { getBoundingClientRect: () => anchor };
4525
4588
  }, [anchor]);
4526
- return /* @__PURE__ */ jsxs43(
4589
+ return /* @__PURE__ */ jsxs44(
4527
4590
  BasePopover.Root,
4528
4591
  {
4529
4592
  open,
@@ -4531,30 +4594,30 @@ function Popover({ trigger, anchor, align = "left", side = "bottom", open, onOpe
4531
4594
  actionsRef,
4532
4595
  modal: false,
4533
4596
  children: [
4534
- trigger && /* @__PURE__ */ jsx59(BasePopover.Trigger, { render: trigger, disabled: triggerDisabled(trigger) }),
4535
- /* @__PURE__ */ jsx59(BasePopover.Portal, { children: /* @__PURE__ */ jsx59(
4597
+ trigger && /* @__PURE__ */ jsx60(BasePopover.Trigger, { render: trigger, disabled: triggerDisabled(trigger) }),
4598
+ /* @__PURE__ */ jsx60(BasePopover.Portal, { children: /* @__PURE__ */ jsx60(
4536
4599
  BasePopover.Positioner,
4537
4600
  {
4538
4601
  anchor: anchorTarget,
4539
4602
  side,
4540
4603
  align: align === "right" ? "end" : align === "center" ? "center" : "start",
4541
- sideOffset: GAP5,
4542
- collisionPadding: VIEWPORT_PAD5,
4604
+ sideOffset: GAP6,
4605
+ collisionPadding: VIEWPORT_PAD6,
4543
4606
  className: "z-50 data-[anchor-hidden]:hidden",
4544
- children: /* @__PURE__ */ jsx59(
4607
+ children: /* @__PURE__ */ jsx60(
4545
4608
  BasePopover.Popup,
4546
4609
  {
4547
4610
  "aria-label": ariaLabel,
4548
4611
  initialFocus: trigger ? void 0 : false,
4549
4612
  finalFocus,
4550
4613
  className: cn("min-w-[180px] outline-none p-0", className),
4551
- render: /* @__PURE__ */ jsx59(MenuPanel, {}),
4552
- children: /* @__PURE__ */ jsx59(
4614
+ render: /* @__PURE__ */ jsx60(MenuPanel, {}),
4615
+ children: /* @__PURE__ */ jsx60(
4553
4616
  ScrollArea,
4554
4617
  {
4555
4618
  viewportClassName: maxHeight ?? "max-h-[var(--available-height)]",
4556
4619
  contentClassName: cn("flex flex-col p-2", contentClassName),
4557
- children: /* @__PURE__ */ jsx59(DividerInPanel.Provider, { value: true, children })
4620
+ children: /* @__PURE__ */ jsx60(DividerInPanel.Provider, { value: true, children })
4558
4621
  }
4559
4622
  )
4560
4623
  }
@@ -4567,10 +4630,10 @@ function Popover({ trigger, anchor, align = "left", side = "bottom", open, onOpe
4567
4630
  }
4568
4631
 
4569
4632
  // src/SuggestionMenu.tsx
4570
- import { useCallback as useCallback5, useEffect as useEffect10, useId as useId5, useImperativeHandle, useMemo as useMemo5, useRef as useRef16, useState as useState18 } from "react";
4571
- import { jsx as jsx60, jsxs as jsxs44 } from "react/jsx-runtime";
4633
+ import { useCallback as useCallback5, useEffect as useEffect10, useId as useId5, useImperativeHandle, useMemo as useMemo5, useRef as useRef17, useState as useState19 } from "react";
4634
+ import { jsx as jsx61, jsxs as jsxs45 } from "react/jsx-runtime";
4572
4635
  function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sections, itemKey, row, onSelect, handle }) {
4573
- const last = useRef16(null);
4636
+ const last = useRef17(null);
4574
4637
  const anchor = useMemo5(() => {
4575
4638
  if (typeof rect !== "function") return rect;
4576
4639
  return {
@@ -4584,10 +4647,10 @@ function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sect
4584
4647
  const shown2 = useMemo5(() => sections.filter((section) => section.items.length > 0), [sections]);
4585
4648
  const items = useMemo5(() => shown2.flatMap((section) => section.items), [shown2]);
4586
4649
  const keys = items.map(itemKey).join("\n");
4587
- const [highlight, setHighlight] = useState18(0);
4650
+ const [highlight, setHighlight] = useState19(0);
4588
4651
  const base = useId5();
4589
4652
  const listboxId = `${base}-list`;
4590
- const chosen = useRef16(null);
4653
+ const chosen = useRef17(null);
4591
4654
  useEffect10(() => void (chosen.current = highlight > 0 ? keys.split("\n")[highlight] ?? null : null), [highlight]);
4592
4655
  useEffect10(() => {
4593
4656
  const at = chosen.current ? keys.split("\n").indexOf(chosen.current) : -1;
@@ -4644,7 +4707,7 @@ function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sect
4644
4707
  const { label, description, aside, leading, shortcut, hint, size } = row(item);
4645
4708
  return (
4646
4709
  // A row of a list the editor drives from its caret: focus stays in the text, so the row is no Tab stop.
4647
- /* @__PURE__ */ jsx60(
4710
+ /* @__PURE__ */ jsx61(
4648
4711
  MenuItem,
4649
4712
  {
4650
4713
  role: "option",
@@ -4672,22 +4735,22 @@ function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sect
4672
4735
  };
4673
4736
  return (
4674
4737
  // finalFocus={false}: focus never left the text, and a list that closes because focus moved elsewhere must not pull it back (71a4577b).
4675
- /* @__PURE__ */ jsx60(Popover, { anchor, open: rect !== null, side: "top", align: "left", className: width, maxHeight, ariaLabel, finalFocus: false, children: /* @__PURE__ */ jsx60("div", { ref: keepFocus, id: listboxId, role: "listbox", "aria-label": ariaLabel, className: "flex flex-col gap-0.5", children: shown2.map((section, i) => /* @__PURE__ */ jsxs44("div", { className: "contents", children: [
4676
- i > 0 && /* @__PURE__ */ jsx60(MenuSeparator, {}),
4677
- section.label ? /* @__PURE__ */ jsx60("div", { role: "group", "aria-label": section.label, children: /* @__PURE__ */ jsx60(MenuSection, { label: section.label, className: section.className, children: section.items.map(drawRow) }) }) : section.items.map(drawRow)
4738
+ /* @__PURE__ */ jsx61(Popover, { anchor, open: rect !== null, side: "top", align: "left", className: width, maxHeight, ariaLabel, finalFocus: false, children: /* @__PURE__ */ jsx61("div", { ref: keepFocus, id: listboxId, role: "listbox", "aria-label": ariaLabel, className: "flex flex-col gap-0.5", children: shown2.map((section, i) => /* @__PURE__ */ jsxs45("div", { className: "contents", children: [
4739
+ i > 0 && /* @__PURE__ */ jsx61(MenuSeparator, {}),
4740
+ section.label ? /* @__PURE__ */ jsx61("div", { role: "group", "aria-label": section.label, children: /* @__PURE__ */ jsx61(MenuSection, { label: section.label, className: section.className, children: section.items.map(drawRow) }) }) : section.items.map(drawRow)
4678
4741
  ] }, section.label ?? i)) }) })
4679
4742
  );
4680
4743
  }
4681
4744
 
4682
4745
  // src/ShowMore.tsx
4683
- import { useLayoutEffect as useLayoutEffect5, useRef as useRef17, useState as useState19 } from "react";
4746
+ import { useLayoutEffect as useLayoutEffect5, useRef as useRef18, useState as useState20 } from "react";
4684
4747
  import { IconChevronDown as IconChevronDown4, IconChevronUp } from "@tabler/icons-react";
4685
- import { jsx as jsx61, jsxs as jsxs45 } from "react/jsx-runtime";
4748
+ import { jsx as jsx62, jsxs as jsxs46 } from "react/jsx-runtime";
4686
4749
  var FADE = "linear-gradient(to top, transparent, black 40px)";
4687
4750
  function ShowMore({ children, maxHeight = 96, contentClassName, className }) {
4688
- const box = useRef17(null);
4689
- const [open, setOpen] = useState19(false);
4690
- const [overflows, setOverflows] = useState19(false);
4751
+ const box = useRef18(null);
4752
+ const [open, setOpen] = useState20(false);
4753
+ const [overflows, setOverflows] = useState20(false);
4691
4754
  useLayoutEffect5(() => {
4692
4755
  const el = box.current;
4693
4756
  if (!el) return;
@@ -4699,19 +4762,19 @@ function ShowMore({ children, maxHeight = 96, contentClassName, className }) {
4699
4762
  return () => observer.disconnect();
4700
4763
  }, [maxHeight]);
4701
4764
  const cut = overflows && !open;
4702
- return /* @__PURE__ */ jsxs45("div", { className: cn("flex flex-col items-start", className), children: [
4703
- /* @__PURE__ */ jsx61("div", { ref: box, className: cn("relative w-full", cut && "overflow-hidden", contentClassName), style: cut ? { maxHeight, maskImage: FADE, WebkitMaskImage: FADE } : void 0, onFocus: cut ? () => setOpen(true) : void 0, children }),
4704
- overflows && /* @__PURE__ */ jsx61(Toggle, { open, onToggle: () => setOpen((o) => !o), className: "mt-1" })
4765
+ return /* @__PURE__ */ jsxs46("div", { className: cn("flex flex-col items-start", className), children: [
4766
+ /* @__PURE__ */ jsx62("div", { ref: box, className: cn("relative w-full", cut && "overflow-hidden", contentClassName), style: cut ? { maxHeight, maskImage: FADE, WebkitMaskImage: FADE } : void 0, onFocus: cut ? () => setOpen(true) : void 0, children }),
4767
+ overflows && /* @__PURE__ */ jsx62(Toggle, { open, onToggle: () => setOpen((o) => !o), className: "mt-1" })
4705
4768
  ] });
4706
4769
  }
4707
4770
  function Toggle({ open, onToggle, className }) {
4708
4771
  const Icon = open ? IconChevronUp : IconChevronDown4;
4709
- return /* @__PURE__ */ jsx61(
4772
+ return /* @__PURE__ */ jsx62(
4710
4773
  Button,
4711
4774
  {
4712
4775
  variant: "outlined",
4713
4776
  size: "small",
4714
- leadingIcon: /* @__PURE__ */ jsx61(Icon, { stroke: 1.5, className: "size-3.5" }),
4777
+ leadingIcon: /* @__PURE__ */ jsx62(Icon, { stroke: 1.5, className: "size-3.5" }),
4715
4778
  className,
4716
4779
  "aria-expanded": open,
4717
4780
  onClick: onToggle,
@@ -4722,9 +4785,9 @@ function Toggle({ open, onToggle, className }) {
4722
4785
 
4723
4786
  // src/Toolbar.tsx
4724
4787
  import { Toolbar as BaseToolbar } from "@base-ui/react/toolbar";
4725
- import { jsx as jsx62 } from "react/jsx-runtime";
4788
+ import { jsx as jsx63 } from "react/jsx-runtime";
4726
4789
  function Toolbar({ "aria-label": ariaLabel, orientation = "horizontal", loopFocus = true, surface = true, children, className }) {
4727
- const strip = /* @__PURE__ */ jsx62(
4790
+ const strip = /* @__PURE__ */ jsx63(
4728
4791
  BaseToolbar.Root,
4729
4792
  {
4730
4793
  "aria-label": ariaLabel,
@@ -4735,27 +4798,27 @@ function Toolbar({ "aria-label": ariaLabel, orientation = "horizontal", loopFocu
4735
4798
  }
4736
4799
  );
4737
4800
  if (!surface) return strip;
4738
- return /* @__PURE__ */ jsx62(MenuPanel, { className: "w-fit p-1", children: strip });
4801
+ return /* @__PURE__ */ jsx63(MenuPanel, { className: "w-fit p-1", children: strip });
4739
4802
  }
4740
4803
  function ToolbarButton({ ref, disabled, disabledReason, ...props }) {
4741
- return /* @__PURE__ */ jsx62(
4804
+ return /* @__PURE__ */ jsx63(
4742
4805
  BaseToolbar.Button,
4743
4806
  {
4744
4807
  ref,
4745
4808
  disabled: disabled || !!disabledReason,
4746
4809
  focusableWhenDisabled: true,
4747
- render: /* @__PURE__ */ jsx62(IconButton, { disabled, disabledReason, ...props })
4810
+ render: /* @__PURE__ */ jsx63(IconButton, { disabled, disabledReason, ...props })
4748
4811
  }
4749
4812
  );
4750
4813
  }
4751
4814
  function ToolbarLink({ ref, href, ...props }) {
4752
- return /* @__PURE__ */ jsx62(BaseToolbar.Link, { ref, render: /* @__PURE__ */ jsx62(IconButton, { href, ...props }) });
4815
+ return /* @__PURE__ */ jsx63(BaseToolbar.Link, { ref, render: /* @__PURE__ */ jsx63(IconButton, { href, ...props }) });
4753
4816
  }
4754
4817
  function ToolbarInput({ size, ...props }) {
4755
- return /* @__PURE__ */ jsx62(BaseToolbar.Input, { render: /* @__PURE__ */ jsx62(TextInput, { size }), ...props });
4818
+ return /* @__PURE__ */ jsx63(BaseToolbar.Input, { render: /* @__PURE__ */ jsx63(TextInput, { size }), ...props });
4756
4819
  }
4757
4820
  function ToolbarSeparator({ className }) {
4758
- return /* @__PURE__ */ jsx62(
4821
+ return /* @__PURE__ */ jsx63(
4759
4822
  BaseToolbar.Separator,
4760
4823
  {
4761
4824
  orientation: "vertical",
@@ -4765,9 +4828,9 @@ function ToolbarSeparator({ className }) {
4765
4828
  }
4766
4829
 
4767
4830
  // src/ReactionPicker.tsx
4768
- import { jsx as jsx63 } from "react/jsx-runtime";
4831
+ import { jsx as jsx64 } from "react/jsx-runtime";
4769
4832
  function ReactionPicker({ options, onSelect, "aria-label": ariaLabel = "Reactions", surface = true, className }) {
4770
- return /* @__PURE__ */ jsx63(Toolbar, { "aria-label": ariaLabel, surface, className: cn("gap-0.5", className), children: options.map((option) => (
4833
+ return /* @__PURE__ */ jsx64(Toolbar, { "aria-label": ariaLabel, surface, className: cn("gap-0.5", className), children: options.map((option) => (
4771
4834
  /*
4772
4835
  A `ToolbarButton`, not a button in a tooltip wrapper. The wrapper
4773
4836
  would become the toolbar's item and the button inside it would never
@@ -4777,59 +4840,20 @@ function ReactionPicker({ options, onSelect, "aria-label": ariaLabel = "Reaction
4777
4840
  The tooltip names it for a pointer, `aria-label` for everything else,
4778
4841
  and both say the meaning rather than the glyph.
4779
4842
  */
4780
- /* @__PURE__ */ jsx63(
4843
+ /* @__PURE__ */ jsx64(
4781
4844
  ToolbarButton,
4782
4845
  {
4783
4846
  "aria-label": option.label,
4784
4847
  tooltip: option.label,
4785
4848
  onClick: () => onSelect(option.emoji),
4786
4849
  className: "size-7",
4787
- children: /* @__PURE__ */ jsx63("span", { "aria-hidden": "true", className: "text-h3 leading-none", children: option.emoji })
4850
+ children: /* @__PURE__ */ jsx64("span", { "aria-hidden": "true", className: "text-h3 leading-none", children: option.emoji })
4788
4851
  },
4789
4852
  option.emoji
4790
4853
  )
4791
4854
  )) });
4792
4855
  }
4793
4856
 
4794
- // src/PreviewCard.tsx
4795
- import { PreviewCard as BasePreviewCard } from "@base-ui/react/preview-card";
4796
- import { jsx as jsx64, jsxs as jsxs46 } from "react/jsx-runtime";
4797
- var GAP6 = 12;
4798
- var VIEWPORT_PAD6 = 8;
4799
- var OPEN_DELAY2 = 350;
4800
- var CLOSE_DELAY = 200;
4801
- function PreviewCard({ content, children, side = "right", delay = OPEN_DELAY2, closeDelay = CLOSE_DELAY, className, contentClassName, wrapperClassName }) {
4802
- return /* @__PURE__ */ jsxs46(BasePreviewCard.Root, { children: [
4803
- /* @__PURE__ */ jsx64(
4804
- BasePreviewCard.Trigger,
4805
- {
4806
- delay,
4807
- closeDelay,
4808
- render: /* @__PURE__ */ jsx64("span", { className: cn("inline-flex", wrapperClassName) }),
4809
- children
4810
- }
4811
- ),
4812
- /* @__PURE__ */ jsx64(BasePreviewCard.Portal, { children: /* @__PURE__ */ jsx64(
4813
- BasePreviewCard.Positioner,
4814
- {
4815
- side,
4816
- align: "start",
4817
- sideOffset: GAP6,
4818
- collisionPadding: VIEWPORT_PAD6,
4819
- className: "z-50 data-[anchor-hidden]:hidden",
4820
- children: /* @__PURE__ */ jsx64(
4821
- BasePreviewCard.Popup,
4822
- {
4823
- className: cn("w-[360px] p-0 outline-none", className),
4824
- render: /* @__PURE__ */ jsx64(MenuPanel, {}),
4825
- children: /* @__PURE__ */ jsx64(ScrollArea, { viewportClassName: "max-h-[min(300px,var(--available-height))]", contentClassName: cn("flex flex-col gap-3 p-3", contentClassName), children: content })
4826
- }
4827
- )
4828
- }
4829
- ) })
4830
- ] });
4831
- }
4832
-
4833
4857
  // src/linked.ts
4834
4858
  import { createContext as createContext9 } from "react";
4835
4859
  var inTheBox = createContext9(false);
@@ -5602,7 +5626,7 @@ function LinkChip({ link, preview = true }) {
5602
5626
  }
5603
5627
 
5604
5628
  // src/AttachedCard.tsx
5605
- import { createContext as createContext10, useContext as useContext12, useEffect as useEffect11, useRef as useRef18 } from "react";
5629
+ import { createContext as createContext10, useContext as useContext12, useEffect as useEffect11, useRef as useRef19 } from "react";
5606
5630
  import { Fragment as Fragment19, jsx as jsx70, jsxs as jsxs51 } from "react/jsx-runtime";
5607
5631
  var Attached = createContext10(false);
5608
5632
  function useRememberedHeight(link, remember, box) {
@@ -5635,7 +5659,7 @@ function useRememberedHeight(link, remember, box) {
5635
5659
  return { kept, held: kept?.height ? { minHeight: kept.height } : void 0 };
5636
5660
  }
5637
5661
  function AttachedCard({ link, children, onRemove, remember }) {
5638
- const box = useRef18(null);
5662
+ const box = useRef19(null);
5639
5663
  const { kept, held } = useRememberedHeight(link, remember, box);
5640
5664
  const shown2 = link?.state === "loading" && !link.shape && kept ? { ...link, shape: kept } : link;
5641
5665
  const card = shown2 ? /* @__PURE__ */ jsx70(LinkCard, { link: shown2 }) : children;
@@ -5828,12 +5852,12 @@ function Reaction({ emoji, count, pressed = false, className, ...props }) {
5828
5852
  }
5829
5853
 
5830
5854
  // src/ConversationActions.tsx
5831
- import { useState as useState20 } from "react";
5855
+ import { useState as useState21 } from "react";
5832
5856
  import { IconCircleCheck as IconCircleCheck2, IconCircleDashed as IconCircleDashed4, IconMessage2 as IconMessage23, IconMoodPlus } from "@tabler/icons-react";
5833
5857
  import { Fragment as Fragment20, jsx as jsx77, jsxs as jsxs57 } from "react/jsx-runtime";
5834
5858
  function ConversationActions({ options, onReact, onReply, resolved = false, onResolve, onReopen, onPickerOpenChange, more, className }) {
5835
- const [picking, setPicking] = useState20(false);
5836
- const [strip, setStrip] = useState20(null);
5859
+ const [picking, setPicking] = useState21(false);
5860
+ const [strip, setStrip] = useState21(null);
5837
5861
  const setOpen = (open) => {
5838
5862
  setPicking(open);
5839
5863
  onPickerOpenChange?.(open);
@@ -5879,7 +5903,7 @@ function ConversationActions({ options, onReact, onReply, resolved = false, onRe
5879
5903
  }
5880
5904
 
5881
5905
  // src/ConversationCard.tsx
5882
- import { useContext as useContext14, useLayoutEffect as useLayoutEffect7, useRef as useRef19, useState as useState25 } from "react";
5906
+ import { useContext as useContext14, useLayoutEffect as useLayoutEffect7, useRef as useRef20, useState as useState26 } from "react";
5883
5907
  import { IconArrowNarrowRight, IconCircleCheck as IconCircleCheck4, IconDotsVertical as IconDotsVertical5 } from "@tabler/icons-react";
5884
5908
 
5885
5909
  // src/ConversationMenu.tsx
@@ -5915,7 +5939,7 @@ function ConversationMenu({ resolved = false, onResolve, onReopen, resolveHint,
5915
5939
  }
5916
5940
 
5917
5941
  // src/conversationScroll.ts
5918
- import { createContext as createContext11, useEffect as useEffect12, useState as useState21 } from "react";
5942
+ import { createContext as createContext11, useEffect as useEffect12, useState as useState22 } from "react";
5919
5943
  var NEAR_BOTTOM_PX = 80;
5920
5944
  function isNearBottom(el) {
5921
5945
  return el.scrollHeight - el.scrollTop - el.clientHeight <= NEAR_BOTTOM_PX;
@@ -5932,7 +5956,7 @@ function anchorIn(el) {
5932
5956
  }
5933
5957
  var cardIn = (el, id) => el.querySelector(`[data-conversation-item="${CSS.escape(id)}"]`)?.firstElementChild ?? null;
5934
5958
  function useSteadyScroll(scrollRef, atBottom, ready, key, enabled) {
5935
- const [handle] = useState21(() => ({ rebase: () => {
5959
+ const [handle] = useState22(() => ({ rebase: () => {
5936
5960
  } }));
5937
5961
  useEffect12(() => {
5938
5962
  const el = scrollRef.current;
@@ -5987,7 +6011,7 @@ function useSteadyScroll(scrollRef, atBottom, ready, key, enabled) {
5987
6011
  }
5988
6012
  var places = /* @__PURE__ */ new Map();
5989
6013
  function useLeftAt(key) {
5990
- const [taken, setTaken] = useState21();
6014
+ const [taken, setTaken] = useState22();
5991
6015
  if (!key && taken) setTaken(void 0);
5992
6016
  if (key && taken?.key !== key) {
5993
6017
  const left = places.get(key);
@@ -6030,7 +6054,7 @@ function MetaText({ children, tone = "muted", size = "caption", className }) {
6030
6054
  }
6031
6055
 
6032
6056
  // src/ReactionRow.tsx
6033
- import { useState as useState22 } from "react";
6057
+ import { useState as useState23 } from "react";
6034
6058
  import { IconMoodPlus as IconMoodPlus2 } from "@tabler/icons-react";
6035
6059
  import { jsx as jsx81, jsxs as jsxs59 } from "react/jsx-runtime";
6036
6060
  var NAMED = 8;
@@ -6046,7 +6070,7 @@ function whoReacted(reaction, nameOf, options, viewer) {
6046
6070
  return `${list.charAt(0).toUpperCase()}${list.slice(1)} reacted with ${meaningOf(options, reaction.emoji)}`;
6047
6071
  }
6048
6072
  function AddReactionButton({ options, onPick, className }) {
6049
- const [picking, setPicking] = useState22(false);
6073
+ const [picking, setPicking] = useState23(false);
6050
6074
  return /* @__PURE__ */ jsx81(
6051
6075
  Popover,
6052
6076
  {
@@ -6146,10 +6170,10 @@ function RepliesRow({ count, faces, last, isNew = false, newCount, urgent = fals
6146
6170
  }
6147
6171
 
6148
6172
  // src/ResolveDialog.tsx
6149
- import { useState as useState23 } from "react";
6173
+ import { useState as useState24 } from "react";
6150
6174
  import { jsx as jsx83, jsxs as jsxs61 } from "react/jsx-runtime";
6151
6175
  function ResolveDialog({ onResolve, onCancel, refused }) {
6152
- const [note, setNote] = useState23("");
6176
+ const [note, setNote] = useState24("");
6153
6177
  return (
6154
6178
  // Outlined at rest and green on hover in Signal, the kit's `resolve` look.
6155
6179
  /* @__PURE__ */ jsx83(FormDialog, { title: "Resolve", submitLabel: "Resolve", submitVariant: "resolve", onSubmit: () => onResolve(note), onClose: onCancel, children: /* @__PURE__ */ jsxs61(Field, { label: "Resolution message (optional)", children: [
@@ -6160,7 +6184,7 @@ function ResolveDialog({ onResolve, onCancel, refused }) {
6160
6184
  }
6161
6185
 
6162
6186
  // src/threadCard.ts
6163
- import { createContext as createContext12, useLayoutEffect as useLayoutEffect6, useState as useState24 } from "react";
6187
+ import { createContext as createContext12, useLayoutEffect as useLayoutEffect6, useState as useState25 } from "react";
6164
6188
  var InThreadCard = createContext12(false);
6165
6189
  var InConversationItem = createContext12(null);
6166
6190
  var caretOnOpen = createContext12(0);
@@ -6170,7 +6194,7 @@ var momentOf = (at) => at !== void 0 && Number.isFinite(at) ? at : void 0;
6170
6194
  var SHOWN_CLASSES = "data-[shown]:animate-shown data-[shown]:rounded-lg motion-reduce:data-[shown]:animate-none motion-reduce:data-[shown]:bg-accent-wash";
6171
6195
  var FACE_GAP = 4;
6172
6196
  function useFaceLine(root, active, toDot = false) {
6173
- const [line, setLine] = useState24(null);
6197
+ const [line, setLine] = useState25(null);
6174
6198
  useLayoutEffect6(() => {
6175
6199
  const el = root.current;
6176
6200
  if (!active || !el) {
@@ -6230,7 +6254,7 @@ function When({ time, at: given, timeHref, timeLabel = "Link to this" }) {
6230
6254
  }
6231
6255
  var fadeBefore = (end) => `linear-gradient(to right, black ${end - 16}px, transparent ${end}px)`;
6232
6256
  function useClearOfStrip(root, strip, shown2) {
6233
- const [end, setEnd] = useState25();
6257
+ const [end, setEnd] = useState26();
6234
6258
  useLayoutEffect7(() => {
6235
6259
  const words = root.current?.querySelector("[data-head]");
6236
6260
  if (!shown2 || !words || !strip.current) {
@@ -6286,8 +6310,8 @@ function Words({ children }) {
6286
6310
  return /* @__PURE__ */ jsx85("div", { className: "relative w-full break-words pb-2 pl-8 pr-2 pt-1", children: /* @__PURE__ */ jsx85("div", { className: "flex flex-col gap-2 text-body-2 text-text-secondary", children }) });
6287
6311
  }
6288
6312
  function useReactionRefusal(reactions) {
6289
- const [refused, setRefused] = useState25();
6290
- const latest = useRef19(0);
6313
+ const [refused, setRefused] = useState26();
6314
+ const latest = useRef20(0);
6291
6315
  const toggle = reactions?.onToggle;
6292
6316
  if (!reactions || !toggle) return { row: reactions, refused };
6293
6317
  const onToggle = (emoji) => {
@@ -6337,7 +6361,7 @@ function stillHere(root) {
6337
6361
  }
6338
6362
  }
6339
6363
  function DeleteQuestion({ noun, onDelete, refused, onClose, children }) {
6340
- const [answered, setAnswered] = useState25(false);
6364
+ const [answered, setAnswered] = useState26(false);
6341
6365
  return /* @__PURE__ */ jsx85(
6342
6366
  ConfirmDialog,
6343
6367
  {
@@ -6356,7 +6380,7 @@ function DeleteQuestion({ noun, onDelete, refused, onClose, children }) {
6356
6380
  );
6357
6381
  }
6358
6382
  function ResolveQuestion({ onResolve, refused, onClose }) {
6359
- const [answered, setAnswered] = useState25(false);
6383
+ const [answered, setAnswered] = useState26(false);
6360
6384
  return /* @__PURE__ */ jsx85(
6361
6385
  ResolveDialog,
6362
6386
  {
@@ -6372,7 +6396,7 @@ function ResolveQuestion({ onResolve, refused, onClose }) {
6372
6396
  );
6373
6397
  }
6374
6398
  function useEditing(editing, onEditingChange) {
6375
- const [own, setOwn] = useState25(false);
6399
+ const [own, setOwn] = useState26(false);
6376
6400
  const now = editing ?? own;
6377
6401
  const set = (next) => {
6378
6402
  if (editing === void 0) setOwn(next);
@@ -6386,23 +6410,23 @@ function ConversationCard(props) {
6386
6410
  const readOnly = (props.readOnly ?? false) || deleted;
6387
6411
  const inThreadCard = useContext14(InThreadCard);
6388
6412
  const item = useContext14(InConversationItem);
6389
- const [hovered, setHovered] = useState25(false);
6390
- const [menuOpen, setMenuOpen] = useState25(false);
6391
- const [picking, setPicking] = useState25(false);
6392
- const [resolving, setResolving] = useState25(false);
6393
- const [deleting, setDeleting] = useState25(false);
6413
+ const [hovered, setHovered] = useState26(false);
6414
+ const [menuOpen, setMenuOpen] = useState26(false);
6415
+ const [picking, setPicking] = useState26(false);
6416
+ const [resolving, setResolving] = useState26(false);
6417
+ const [deleting, setDeleting] = useState26(false);
6394
6418
  const [editing, setEditing] = useEditing(props.editing, props.onEditingChange);
6395
6419
  const isEditing = editing && !readOnly && !!editor;
6396
6420
  const overlay = menuOpen || picking || resolving || deleting;
6397
6421
  const resolves = resolved ? onReopen : onResolve;
6398
6422
  const lined = inThreadCard;
6399
6423
  const toDot = !lined && !!resolved?.note && !isEditing;
6400
- const root = useRef19(null);
6424
+ const root = useRef20(null);
6401
6425
  const dotLine = useFaceLine(root, toDot, true);
6402
6426
  const settle = () => requestAnimationFrame(() => setHovered(stillHere(root.current)));
6403
6427
  const offersMenu = !!resolves || !!menu || !!menuAfter || own && (!!editor || !!onDelete);
6404
6428
  const showStrip = hovered && !isEditing && !readOnly;
6405
- const strip = useRef19(null);
6429
+ const strip = useRef20(null);
6406
6430
  const wordsEnd = useClearOfStrip(root, strip, showStrip);
6407
6431
  const { row: reactionRow, refused: reactionRefused } = useReactionRefusal(reactions);
6408
6432
  const react = reactionRow?.onToggle;
@@ -6527,16 +6551,16 @@ function ReplyCard(props) {
6527
6551
  const { id, author, about, files, isNew = false, urgent = false, own = false, editor, onDelete, deleteNote, deleteRefused, menu, menuAfter, menuLabel, editLabel, deleteLabel, moreLabel = "More actions", noun = "reply", className, children } = props;
6528
6552
  const { row: reactions, refused: reactionRefused } = useReactionRefusal(props.reactions);
6529
6553
  const readOnly = props.readOnly ?? false;
6530
- const [hovered, setHovered] = useState25(false);
6531
- const [menuOpen, setMenuOpen] = useState25(false);
6532
- const [picking, setPicking] = useState25(false);
6533
- const [deleting, setDeleting] = useState25(false);
6554
+ const [hovered, setHovered] = useState26(false);
6555
+ const [menuOpen, setMenuOpen] = useState26(false);
6556
+ const [picking, setPicking] = useState26(false);
6557
+ const [deleting, setDeleting] = useState26(false);
6534
6558
  const [editing, setEditing] = useEditing(props.editing, props.onEditingChange);
6535
6559
  const isEditing = editing && !readOnly && !!editor;
6536
6560
  const offersMenu = !!menu || !!menuAfter || own && (!!editor || !!onDelete);
6537
6561
  const showStrip = hovered && !isEditing && !readOnly && (offersMenu || !!reactions?.onToggle);
6538
- const root = useRef19(null);
6539
- const strip = useRef19(null);
6562
+ const root = useRef20(null);
6563
+ const strip = useRef20(null);
6540
6564
  const wordsEnd = useClearOfStrip(root, strip, showStrip);
6541
6565
  const settle = () => requestAnimationFrame(() => setHovered(stillHere(root.current)));
6542
6566
  const drawn = useContext14(repliesDrawn);
@@ -6612,7 +6636,7 @@ function ReplyCard(props) {
6612
6636
  }
6613
6637
 
6614
6638
  // src/ConversationLayout.tsx
6615
- import { Fragment as Fragment24, useCallback as useCallback6, useEffect as useEffect14, useLayoutEffect as useLayoutEffect8, useRef as useRef20, useState as useState27 } from "react";
6639
+ import { Fragment as Fragment24, useCallback as useCallback6, useEffect as useEffect14, useLayoutEffect as useLayoutEffect8, useRef as useRef21, useState as useState28 } from "react";
6616
6640
 
6617
6641
  // src/Panel.tsx
6618
6642
  import { jsx as jsx86, jsxs as jsxs64 } from "react/jsx-runtime";
@@ -6641,15 +6665,15 @@ function Panel(props) {
6641
6665
  }
6642
6666
 
6643
6667
  // src/seenOnScreen.ts
6644
- import { useEffect as useEffect13, useMemo as useMemo6, useState as useState26 } from "react";
6668
+ import { useEffect as useEffect13, useMemo as useMemo6, useState as useState27 } from "react";
6645
6669
  var NONE = /* @__PURE__ */ new Set();
6646
6670
  var DWELL_MS = 1500;
6647
6671
  var TALL_ENOUGH_PX = 120;
6648
6672
  var THRESHOLDS = Array.from({ length: 11 }, (_, i) => i / 10);
6649
6673
  var watchers = /* @__PURE__ */ new WeakMap();
6650
6674
  function useSeenOnScreen(key) {
6651
- const [seen, setSeen] = useState26({ key: null, ids: NONE });
6652
- const [watcher] = useState26(() => ({ roots: /* @__PURE__ */ new Map(), watch: { current: null } }));
6675
+ const [seen, setSeen] = useState27({ key: null, ids: NONE });
6676
+ const [watcher] = useState27(() => ({ roots: /* @__PURE__ */ new Map(), watch: { current: null } }));
6653
6677
  useEffect13(() => {
6654
6678
  if (!key) return;
6655
6679
  const timers = /* @__PURE__ */ new Map();
@@ -6805,7 +6829,7 @@ function List({ items, open, under, above, loading, empty, change, caret }) {
6805
6829
  ] });
6806
6830
  }
6807
6831
  function UnderItem({ item, isOpen, state, caret }) {
6808
- const root = useRef20(null);
6832
+ const root = useRef21(null);
6809
6833
  const line = useFaceLine(root, isOpen);
6810
6834
  return /* @__PURE__ */ jsxs65(
6811
6835
  Card,
@@ -6853,7 +6877,7 @@ function ConversationLayout({
6853
6877
  className
6854
6878
  }) {
6855
6879
  const beside = threads === "beside";
6856
- const body = useRef20(null);
6880
+ const body = useRef21(null);
6857
6881
  const setBody = useCallback6(
6858
6882
  (el) => {
6859
6883
  body.current = el;
@@ -6863,9 +6887,9 @@ function ConversationLayout({
6863
6887
  [bodyRef]
6864
6888
  );
6865
6889
  useWatchSeen(seen, body, "data-conversation-item");
6866
- const pressed = useRef20(null);
6890
+ const pressed = useRef21(null);
6867
6891
  const itemAt = (id) => body.current?.querySelector(`[data-conversation-item="${CSS.escape(id)}"]`) ?? null;
6868
- const [caret, setCaret] = useState27(0);
6892
+ const [caret, setCaret] = useState28(0);
6869
6893
  const change = onOpenChange ? (id, next, reply = false) => {
6870
6894
  if (next !== void 0 && next === open) {
6871
6895
  if (reply) setCaret((n) => n + 1);
@@ -6883,13 +6907,13 @@ function ConversationLayout({
6883
6907
  const moved = item.getBoundingClientRect().top - at.top;
6884
6908
  if (moved !== 0) body.current.scrollTop += moved;
6885
6909
  }, [open]);
6886
- const was = useRef20(open);
6910
+ const was = useRef21(open);
6887
6911
  useEffect14(() => {
6888
6912
  if (open !== void 0 && open !== was.current) setCaret((n) => n + 1);
6889
6913
  was.current = open;
6890
6914
  }, [open]);
6891
- const nearBottom = useRef20(true);
6892
- const placedFor = useRef20(null);
6915
+ const nearBottom = useRef21(true);
6916
+ const placedFor = useRef21(null);
6893
6917
  const placeKey = rememberAs ?? FRESH;
6894
6918
  const scrolled = (event) => {
6895
6919
  const el = body.current;
@@ -6935,7 +6959,7 @@ function ConversationLayout({
6935
6959
  const el = body.current;
6936
6960
  if (el) el.scrollTop = el.scrollHeight;
6937
6961
  }, [beside, items.length, loading]);
6938
- const [sends] = useState27(() => ({
6962
+ const [sends] = useState28(() => ({
6939
6963
  sending: () => {
6940
6964
  nearBottom.current = true;
6941
6965
  },
@@ -7063,11 +7087,11 @@ function ReactionHorizon({ limit, omitted, cut = false, noun = "comments", keepR
7063
7087
  }
7064
7088
 
7065
7089
  // src/ArchiveDialog.tsx
7066
- import { useState as useState28 } from "react";
7090
+ import { useState as useState29 } from "react";
7067
7091
  import { jsx as jsx92, jsxs as jsxs70 } from "react/jsx-runtime";
7068
7092
  var listOf = (parts) => parts.length <= 1 ? parts[0] ?? "" : `${parts.slice(0, -1).join(", ")} and ${parts.at(-1)}`;
7069
7093
  function ArchiveDialog({ title, what, hides, staysVisible = [], apps, getBack, onClose, onArchive }) {
7070
- const [resolution, setResolution] = useState28("");
7094
+ const [resolution, setResolution] = useState29("");
7071
7095
  const where = apps.length ? `, ${listOf(apps.map((app) => `in ${app}`))}` : "";
7072
7096
  return /* @__PURE__ */ jsxs70(FormDialog, { title: `Archive \u201C${title}\u201D?`, submitLabel: `Archive ${what}`, ready: hides !== null, onSubmit: () => onArchive(resolution.trim()), onClose, children: [
7073
7097
  /* @__PURE__ */ jsxs70("div", { className: "flex flex-col gap-2 text-body-2 text-text-primary", children: [
@@ -7088,11 +7112,11 @@ function ArchiveDialog({ title, what, hides, staysVisible = [], apps, getBack, o
7088
7112
  }
7089
7113
 
7090
7114
  // src/ArchivedNotice.tsx
7091
- import { useState as useState29 } from "react";
7115
+ import { useState as useState30 } from "react";
7092
7116
  import { IconArchive } from "@tabler/icons-react";
7093
7117
  import { jsx as jsx93, jsxs as jsxs71 } from "react/jsx-runtime";
7094
7118
  function ArchivedNotice({ by, when, resolution, withWhat, withTitle, onUnarchive, onOpenParent }) {
7095
- const [unarchiving, setUnarchiving] = useState29(false);
7119
+ const [unarchiving, setUnarchiving] = useState30(false);
7096
7120
  const parent = withWhat ?? (withTitle ? "parent" : void 0);
7097
7121
  const named2 = withTitle ? ` \u201C${withTitle}\u201D` : "";
7098
7122
  const line = parent ? `Archived with its ${parent}${named2} by ${by} \xB7 ${when}` : `Archived by ${by} \xB7 ${when}`;
@@ -7120,11 +7144,11 @@ function ArchivedNotice({ by, when, resolution, withWhat, withTitle, onUnarchive
7120
7144
  }
7121
7145
 
7122
7146
  // src/DeletedNotice.tsx
7123
- import { useState as useState30 } from "react";
7147
+ import { useState as useState31 } from "react";
7124
7148
  import { IconTrash } from "@tabler/icons-react";
7125
7149
  import { jsx as jsx94, jsxs as jsxs72 } from "react/jsx-runtime";
7126
7150
  function DeletedNotice({ by, when, onRestore }) {
7127
- const [restoring, setRestoring] = useState30(false);
7151
+ const [restoring, setRestoring] = useState31(false);
7128
7152
  return /* @__PURE__ */ jsxs72(Card, { fill: "inset", className: "flex items-start gap-3 px-4 py-3", children: [
7129
7153
  /* @__PURE__ */ jsx94(IconTrash, { size: 16, stroke: 1.5, className: "mt-0.5 shrink-0 text-text-muted" }),
7130
7154
  /* @__PURE__ */ jsx94("span", { className: "min-w-0 flex-1 text-body-2-strong text-text-primary", children: `Deleted by ${by} \xB7 ${when}` }),
@@ -7153,7 +7177,7 @@ function NoAccessNotice({ what }) {
7153
7177
  }
7154
7178
 
7155
7179
  // src/Thread.tsx
7156
- import { Children, useCallback as useCallback7, useContext as useContext15, useLayoutEffect as useLayoutEffect9, useRef as useRef21, useState as useState31 } from "react";
7180
+ import { Children, useCallback as useCallback7, useContext as useContext15, useLayoutEffect as useLayoutEffect9, useRef as useRef22, useState as useState32 } from "react";
7157
7181
  import { IconX as IconX6 } from "@tabler/icons-react";
7158
7182
  import { Fragment as Fragment27, jsx as jsx96, jsxs as jsxs73 } from "react/jsx-runtime";
7159
7183
  var always = () => true;
@@ -7180,7 +7204,7 @@ function Thread({
7180
7204
  seen,
7181
7205
  className
7182
7206
  }) {
7183
- const body = useRef21(null);
7207
+ const body = useRef22(null);
7184
7208
  const setBody = useCallback7(
7185
7209
  (el) => {
7186
7210
  body.current = el;
@@ -7189,10 +7213,10 @@ function Thread({
7189
7213
  },
7190
7214
  [bodyRef]
7191
7215
  );
7192
- const under = useRef21(null);
7216
+ const under = useRef22(null);
7193
7217
  useWatchSeen(seen, place === "under" ? under : body, "data-reply-id");
7194
- const [drawn] = useState31(() => ({ added: 0 }));
7195
- const last = useRef21(null);
7218
+ const [drawn] = useState32(() => ({ added: 0 }));
7219
+ const last = useRef22(null);
7196
7220
  const steady = useSteadyScroll(body, void 0, always, start?.id, place === "beside");
7197
7221
  useLayoutEffect9(() => {
7198
7222
  const el = body.current;