@arbidocs/blocks 0.4.5 → 0.4.6

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 (131) hide show
  1. package/README.md +46 -6
  2. package/dist/agents/index.cjs +163 -162
  3. package/dist/agents/index.js +6 -5
  4. package/dist/chat/ChatMessageContent.d.ts +16 -0
  5. package/dist/chat/ChatPage.d.ts +11 -8
  6. package/dist/chat/ChatThreads.d.ts +3 -1
  7. package/dist/chat/CitationMark.d.ts +18 -0
  8. package/dist/chat/chat-page-types.d.ts +75 -1
  9. package/dist/chat/index.cjs +126 -117
  10. package/dist/chat/index.d.ts +3 -1
  11. package/dist/chat/index.js +5 -4
  12. package/dist/{chunk-3MIQASHO.cjs → chunk-23XL6SVZ.cjs} +39 -19
  13. package/dist/chunk-23XL6SVZ.cjs.map +1 -0
  14. package/dist/{chunk-ULWRNGGE.cjs → chunk-2ZTONLT5.cjs} +4 -25
  15. package/dist/chunk-2ZTONLT5.cjs.map +1 -0
  16. package/dist/{chunk-O637DUKS.cjs → chunk-56BUD74K.cjs} +28 -28
  17. package/dist/{chunk-O637DUKS.cjs.map → chunk-56BUD74K.cjs.map} +1 -1
  18. package/dist/{chunk-YLOKCIQJ.cjs → chunk-5SLLMK5K.cjs} +421 -115
  19. package/dist/chunk-5SLLMK5K.cjs.map +1 -0
  20. package/dist/{chunk-SS23F63U.cjs → chunk-5ZBP7TCD.cjs} +55 -3
  21. package/dist/chunk-5ZBP7TCD.cjs.map +1 -0
  22. package/dist/{chunk-3PZPRAAR.cjs → chunk-67HGXV4I.cjs} +14 -14
  23. package/dist/{chunk-3PZPRAAR.cjs.map → chunk-67HGXV4I.cjs.map} +1 -1
  24. package/dist/{chunk-RCP6THBS.js → chunk-7OCFHEE6.js} +3 -3
  25. package/dist/{chunk-RCP6THBS.js.map → chunk-7OCFHEE6.js.map} +1 -1
  26. package/dist/{chunk-TX2ZICS7.js → chunk-CPMNAJLF.js} +4 -24
  27. package/dist/chunk-CPMNAJLF.js.map +1 -0
  28. package/dist/{chunk-5XTZFH65.js → chunk-CVFBSUXL.js} +5 -5
  29. package/dist/{chunk-5XTZFH65.js.map → chunk-CVFBSUXL.js.map} +1 -1
  30. package/dist/chunk-DCDVWPMB.cjs +29 -0
  31. package/dist/chunk-DCDVWPMB.cjs.map +1 -0
  32. package/dist/{chunk-TI4UTYRL.js → chunk-EY2RJW27.js} +258 -10
  33. package/dist/chunk-EY2RJW27.js.map +1 -0
  34. package/dist/{chunk-7YADKWZT.js → chunk-G2E3O3HI.js} +3 -3
  35. package/dist/{chunk-7YADKWZT.js.map → chunk-G2E3O3HI.js.map} +1 -1
  36. package/dist/{chunk-6YHWXMPQ.js → chunk-G2T3KTZ3.js} +419 -115
  37. package/dist/chunk-G2T3KTZ3.js.map +1 -0
  38. package/dist/{chunk-2NNTQLBY.js → chunk-IAKUTBPX.js} +4 -4
  39. package/dist/{chunk-2NNTQLBY.js.map → chunk-IAKUTBPX.js.map} +1 -1
  40. package/dist/{chunk-IZHWP6WQ.cjs → chunk-JG4TFS3Z.cjs} +6 -6
  41. package/dist/{chunk-IZHWP6WQ.cjs.map → chunk-JG4TFS3Z.cjs.map} +1 -1
  42. package/dist/chunk-JLOYWXRB.js +1156 -0
  43. package/dist/chunk-JLOYWXRB.js.map +1 -0
  44. package/dist/{chunk-WJZBJUPX.js → chunk-KXMDOTGW.js} +56 -4
  45. package/dist/chunk-KXMDOTGW.js.map +1 -0
  46. package/dist/{chunk-2VBJ763Y.js → chunk-KZJAG7T3.js} +37 -7
  47. package/dist/chunk-KZJAG7T3.js.map +1 -0
  48. package/dist/{chunk-RIL7G7AS.cjs → chunk-MGUHR3JI.cjs} +4 -4
  49. package/dist/{chunk-RIL7G7AS.cjs.map → chunk-MGUHR3JI.cjs.map} +1 -1
  50. package/dist/{chunk-NPKGUQU5.js → chunk-NJL4LIXX.js} +4 -4
  51. package/dist/{chunk-NPKGUQU5.js.map → chunk-NJL4LIXX.js.map} +1 -1
  52. package/dist/{chunk-DN3NFNIA.cjs → chunk-QMDLPO3M.cjs} +266 -10
  53. package/dist/chunk-QMDLPO3M.cjs.map +1 -0
  54. package/dist/chunk-TJMKFY5P.js +27 -0
  55. package/dist/chunk-TJMKFY5P.js.map +1 -0
  56. package/dist/{chunk-3PJCET7H.js → chunk-UHVNYKV2.js} +38 -18
  57. package/dist/chunk-UHVNYKV2.js.map +1 -0
  58. package/dist/{chunk-6CHMNKXC.cjs → chunk-UTYQPVIW.cjs} +11 -11
  59. package/dist/chunk-UTYQPVIW.cjs.map +1 -0
  60. package/dist/{chunk-KHX2BX3S.cjs → chunk-VGOFFCMT.cjs} +37 -5
  61. package/dist/chunk-VGOFFCMT.cjs.map +1 -0
  62. package/dist/{chunk-67MKU5U7.js → chunk-YMHGF6R5.js} +8 -8
  63. package/dist/chunk-YMHGF6R5.js.map +1 -0
  64. package/dist/chunk-YVIOCITQ.cjs +1186 -0
  65. package/dist/chunk-YVIOCITQ.cjs.map +1 -0
  66. package/dist/{chunk-MVNCQDDE.cjs → chunk-ZVPTFTGV.cjs} +4 -4
  67. package/dist/{chunk-MVNCQDDE.cjs.map → chunk-ZVPTFTGV.cjs.map} +1 -1
  68. package/dist/collaboration/index.cjs +38 -37
  69. package/dist/collaboration/index.js +3 -2
  70. package/dist/connect/index.cjs +358 -19
  71. package/dist/connect/index.cjs.map +1 -1
  72. package/dist/connect/index.d.ts +1 -0
  73. package/dist/connect/index.js +341 -9
  74. package/dist/connect/index.js.map +1 -1
  75. package/dist/connection/ConnectedSettings.d.ts +64 -0
  76. package/dist/facts/index.cjs +2 -2
  77. package/dist/facts/index.js +2 -2
  78. package/dist/files/index.cjs +15 -14
  79. package/dist/files/index.cjs.map +1 -1
  80. package/dist/files/index.js +5 -4
  81. package/dist/files/index.js.map +1 -1
  82. package/dist/home/index.cjs +19 -19
  83. package/dist/home/index.js +4 -4
  84. package/dist/index.cjs +526 -477
  85. package/dist/index.cjs.map +1 -1
  86. package/dist/index.js +17 -16
  87. package/dist/index.js.map +1 -1
  88. package/dist/lib/bottom-inset.d.ts +16 -0
  89. package/dist/lib/useElementSize.d.ts +13 -0
  90. package/dist/lib/useFillHeight.d.ts +10 -0
  91. package/dist/settings/account-views.d.ts +55 -0
  92. package/dist/settings/index.cjs +179 -1148
  93. package/dist/settings/index.cjs.map +1 -1
  94. package/dist/settings/index.d.ts +1 -0
  95. package/dist/settings/index.js +10 -1073
  96. package/dist/settings/index.js.map +1 -1
  97. package/dist/shell/InstallPrompt.d.ts +28 -0
  98. package/dist/shell/MobileBars.d.ts +1 -1
  99. package/dist/shell/index.cjs +85 -45
  100. package/dist/shell/index.d.ts +4 -0
  101. package/dist/shell/index.js +3 -3
  102. package/dist/shell/install-instructions.d.ts +19 -0
  103. package/dist/shell/types.d.ts +6 -0
  104. package/dist/shell/use-install-prompt.d.ts +49 -0
  105. package/dist/site/index.cjs +62 -62
  106. package/dist/site/index.js +2 -2
  107. package/dist/studio/index.cjs +78 -77
  108. package/dist/studio/index.cjs.map +1 -1
  109. package/dist/studio/index.js +8 -7
  110. package/dist/studio/index.js.map +1 -1
  111. package/dist/theme/ThemeEditor.d.ts +4 -2
  112. package/dist/workspaces/index.cjs +4 -3
  113. package/dist/workspaces/index.cjs.map +1 -1
  114. package/dist/workspaces/index.js +3 -2
  115. package/dist/workspaces/index.js.map +1 -1
  116. package/package.json +8 -4
  117. package/src/blocks.css +30 -0
  118. package/dist/chunk-2VBJ763Y.js.map +0 -1
  119. package/dist/chunk-3MIQASHO.cjs.map +0 -1
  120. package/dist/chunk-3PJCET7H.js.map +0 -1
  121. package/dist/chunk-67MKU5U7.js.map +0 -1
  122. package/dist/chunk-6CHMNKXC.cjs.map +0 -1
  123. package/dist/chunk-6YHWXMPQ.js.map +0 -1
  124. package/dist/chunk-DN3NFNIA.cjs.map +0 -1
  125. package/dist/chunk-KHX2BX3S.cjs.map +0 -1
  126. package/dist/chunk-SS23F63U.cjs.map +0 -1
  127. package/dist/chunk-TI4UTYRL.js.map +0 -1
  128. package/dist/chunk-TX2ZICS7.js.map +0 -1
  129. package/dist/chunk-ULWRNGGE.cjs.map +0 -1
  130. package/dist/chunk-WJZBJUPX.js.map +0 -1
  131. package/dist/chunk-YLOKCIQJ.cjs.map +0 -1
@@ -1,9 +1,10 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkKHX2BX3S_cjs = require('./chunk-KHX2BX3S.cjs');
5
- var chunkMHVNT4J3_cjs = require('./chunk-MHVNT4J3.cjs');
4
+ var chunkVGOFFCMT_cjs = require('./chunk-VGOFFCMT.cjs');
5
+ var chunkPPCATBOY_cjs = require('./chunk-PPCATBOY.cjs');
6
6
  var chunkKDG6FER6_cjs = require('./chunk-KDG6FER6.cjs');
7
+ var chunkMHVNT4J3_cjs = require('./chunk-MHVNT4J3.cjs');
7
8
  var react = require('react');
8
9
  var lucideReact = require('lucide-react');
9
10
  var ui = require('@arbidocs/react/ui');
@@ -675,9 +676,12 @@ function ComposerRoot({
675
676
  children,
676
677
  ...rest
677
678
  }) {
679
+ const rootRef = react.useRef(null);
680
+ chunkVGOFFCMT_cjs.useShellBottomInset(rootRef);
678
681
  return /* @__PURE__ */ jsxRuntime.jsxs(
679
682
  "div",
680
683
  {
684
+ ref: rootRef,
681
685
  "data-slot": "composer",
682
686
  className: ui.cn("relative z-[20] shrink-0", isBranching && "bg-muted/30"),
683
687
  "data-testid": testId,
@@ -1249,6 +1253,168 @@ var ContextChip = react.forwardRef(function ContextChip2({
1249
1253
  }
1250
1254
  );
1251
1255
  });
1256
+ var MARK = "ml-px align-super text-[0.7em] font-medium leading-none tabular-nums text-muted-foreground";
1257
+ function sourceLabel(citation, labels) {
1258
+ return [citation.documentTitle, citation.page != null ? labels.page(citation.page) : ""].filter(Boolean).join(", ");
1259
+ }
1260
+ function CitationMark({ num, citation, labels, onOpen, className }) {
1261
+ const [isOpen2, setIsOpen] = react.useState(false);
1262
+ if (!citation) {
1263
+ return /* @__PURE__ */ jsxRuntime.jsx("sup", { className: ui.cn(MARK, className), "data-cite": num, children: num });
1264
+ }
1265
+ const open = (passage) => {
1266
+ setIsOpen(false);
1267
+ onOpen?.({
1268
+ documentId: passage?.documentId ?? null,
1269
+ documentTitle: passage?.documentTitle ?? citation.documentTitle,
1270
+ page: passage?.page ?? citation.page,
1271
+ passage,
1272
+ citation
1273
+ });
1274
+ };
1275
+ return /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { open: isOpen2, onOpenChange: setIsOpen, children: [
1276
+ /* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1277
+ "button",
1278
+ {
1279
+ type: "button",
1280
+ "data-cite": num,
1281
+ "data-testid": `chat-citation-${num}`,
1282
+ "aria-label": labels.citation(num, sourceLabel(citation, labels)),
1283
+ className: ui.cn(
1284
+ MARK,
1285
+ // A pill hit area: 44px on touch without moving the text.
1286
+ "relative -my-1 inline-flex min-w-[1.1em] justify-center rounded px-1 py-1 hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:bg-muted data-[state=open]:text-foreground",
1287
+ "pointer-coarse:after:absolute pointer-coarse:after:-inset-3 pointer-coarse:after:content-['']",
1288
+ className
1289
+ ),
1290
+ children: num
1291
+ }
1292
+ ) }),
1293
+ /* @__PURE__ */ jsxRuntime.jsxs(
1294
+ ui.PopoverContent,
1295
+ {
1296
+ align: "start",
1297
+ "aria-label": labels.citationHeading(num),
1298
+ "data-testid": `chat-citation-popover-${num}`,
1299
+ className: "w-96 max-w-[calc(100vw-1rem)] p-0 text-sm",
1300
+ children: [
1301
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-border px-3 py-2 text-xs font-semibold text-muted-foreground", children: labels.citationHeading(num) }),
1302
+ citation.passages.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-3 py-3 text-muted-foreground", children: labels.citationNoSource }) : /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "divide-y divide-border", children: citation.passages.map((passage) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "space-y-1.5 px-3 py-3", children: [
1303
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2", children: [
1304
+ /* @__PURE__ */ jsxRuntime.jsx(
1305
+ lucideReact.FileText,
1306
+ {
1307
+ className: "mt-0.5 size-4 shrink-0 text-muted-foreground",
1308
+ "aria-hidden": "true"
1309
+ }
1310
+ ),
1311
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
1312
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "break-words font-medium text-foreground", children: passage.documentTitle }),
1313
+ passage.page != null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground", children: labels.page(passage.page) })
1314
+ ] })
1315
+ ] }),
1316
+ /* @__PURE__ */ jsxRuntime.jsx("blockquote", { className: "line-clamp-6 border-l-2 border-border pl-3 text-xs italic text-muted-foreground", children: passage.text }),
1317
+ onOpen && /* @__PURE__ */ jsxRuntime.jsx(
1318
+ ui.Button,
1319
+ {
1320
+ type: "button",
1321
+ variant: "outline",
1322
+ size: "sm",
1323
+ className: "pointer-coarse:min-h-11",
1324
+ onClick: () => open(passage),
1325
+ "data-testid": `chat-citation-open-${num}`,
1326
+ children: labels.openDocument
1327
+ }
1328
+ )
1329
+ ] }, passage.id)) })
1330
+ ]
1331
+ }
1332
+ )
1333
+ ] });
1334
+ }
1335
+
1336
+ // src/chat/chat-page-types.ts
1337
+ var DEFAULT_CHAT_PAGE_LABELS = {
1338
+ chat: "Assistant chat",
1339
+ conversations: "Conversations",
1340
+ newChat: "New chat",
1341
+ untitled: "New chat",
1342
+ deleteConversation: (title) => `Delete conversation ${title}`,
1343
+ assistant: "Assistant",
1344
+ thinking: "Thinking\u2026",
1345
+ steps: (count) => count === 1 ? "1 step" : `${count} steps`,
1346
+ responseFailed: "Response failed",
1347
+ answerFailedTitle: "The answer could not be completed",
1348
+ uploadFailedTitle: "The upload failed",
1349
+ placeholder: "Ask about your documents",
1350
+ composerAriaLabel: "Message the assistant",
1351
+ documentsInChat: (selected, total) => `${selected} of ${total} documents in this chat`,
1352
+ documentsHeading: "Documents in this chat",
1353
+ selectAllDocuments: "Select all",
1354
+ noDocuments: "No documents yet",
1355
+ uploadDocuments: "Upload documents",
1356
+ uploading: "Uploading\u2026",
1357
+ emptyTitle: "Ask about your documents",
1358
+ emptyDescription: "Every answer is grounded in the selected documents and cites its sources.",
1359
+ emptyUploadTitle: "Add a document to start",
1360
+ emptyUploadDescription: "Upload the documents you want to ask about.",
1361
+ workflows: "Workflows",
1362
+ loadingDocuments: "Loading documents\u2026",
1363
+ stop: "Stop generating",
1364
+ stopped: "Stopped",
1365
+ loadingConversation: "Loading conversation\u2026",
1366
+ historyFailedTitle: "The conversation history could not be used",
1367
+ citation: (num, source) => source ? `Source ${num}: ${source}` : `Source ${num}`,
1368
+ citationHeading: (num) => `Source ${num}`,
1369
+ citationNoSource: "The passage for this source is not available.",
1370
+ openDocument: "Open document",
1371
+ page: (page) => `Page ${page}`,
1372
+ morePassages: (count) => count === 1 ? "1 more passage" : `${count} more passages`
1373
+ };
1374
+ function ChatMessageContent({
1375
+ message,
1376
+ labels,
1377
+ onOpenCitation,
1378
+ className
1379
+ }) {
1380
+ const l = { ...DEFAULT_CHAT_PAGE_LABELS, ...labels };
1381
+ const { citation, citationHeading, citationNoSource, openDocument, page } = l;
1382
+ const citationLabels = react.useMemo(
1383
+ () => ({ citation, citationHeading, citationNoSource, openDocument, page }),
1384
+ [citation, citationHeading, citationNoSource, openDocument, page]
1385
+ );
1386
+ const byNum = react.useMemo(
1387
+ () => new Map((message.citations ?? []).map((c) => [c.num, c])),
1388
+ [message.citations]
1389
+ );
1390
+ const renderCitation = react.useCallback(
1391
+ ({ num, children }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1392
+ children,
1393
+ /* @__PURE__ */ jsxRuntime.jsx(
1394
+ CitationMark,
1395
+ {
1396
+ num,
1397
+ citation: byNum.get(num),
1398
+ labels: citationLabels,
1399
+ onOpen: onOpenCitation
1400
+ }
1401
+ )
1402
+ ] }),
1403
+ [byNum, citationLabels, onOpenCitation]
1404
+ );
1405
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1406
+ /* @__PURE__ */ jsxRuntime.jsx(
1407
+ ui.MarkdownRenderer,
1408
+ {
1409
+ isStreaming: message.status === "streaming",
1410
+ renderCitation,
1411
+ className,
1412
+ children: message.status === "streaming" || message.stopped ? ui.trimOpenCitation(message.content) : message.content
1413
+ }
1414
+ ),
1415
+ message.stopped && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-xs italic text-muted-foreground", "data-testid": "chat-stopped", children: l.stopped })
1416
+ ] });
1417
+ }
1252
1418
  function ChatDocuments({ chat, labels, onPickFiles, testIds }) {
1253
1419
  const [isOpen2, setIsOpen] = react.useState(false);
1254
1420
  const selected = chat.documents.filter((d) => d.isSelected).length;
@@ -1326,6 +1492,7 @@ function ChatThreadList({
1326
1492
  onSelect,
1327
1493
  onNew,
1328
1494
  onDelete,
1495
+ isLoading,
1329
1496
  testIds
1330
1497
  }) {
1331
1498
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -1350,38 +1517,45 @@ function ChatThreadList({
1350
1517
  ]
1351
1518
  }
1352
1519
  ),
1353
- /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto", children: threads.map((thread) => {
1354
- const isActive = thread.id === activeId;
1355
- const title = thread.title || labels.untitled;
1356
- return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "group relative", children: [
1357
- /* @__PURE__ */ jsxRuntime.jsx(
1358
- "button",
1359
- {
1360
- type: "button",
1361
- onClick: () => onSelect(thread.id),
1362
- "aria-current": isActive ? "true" : void 0,
1363
- title,
1364
- "data-testid": `${chunkMHVNT4J3_cjs.testIdOr(testIds?.row, { testId: "chat-conversation" })}-${thread.id}`,
1365
- className: ui.cn(
1366
- "flex w-full items-center rounded-md px-3 py-2 pr-10 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11",
1367
- isActive ? "bg-muted font-medium text-foreground" : "text-muted-foreground hover:bg-muted/60 hover:text-foreground"
1520
+ /* @__PURE__ */ jsxRuntime.jsx(
1521
+ "ul",
1522
+ {
1523
+ className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto",
1524
+ "aria-busy": isLoading ? "true" : void 0,
1525
+ children: threads.map((thread) => {
1526
+ const isActive = thread.id === activeId;
1527
+ const title = thread.title || labels.untitled;
1528
+ return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "group relative", children: [
1529
+ /* @__PURE__ */ jsxRuntime.jsx(
1530
+ "button",
1531
+ {
1532
+ type: "button",
1533
+ onClick: () => onSelect(thread.id),
1534
+ "aria-current": isActive ? "true" : void 0,
1535
+ title,
1536
+ "data-testid": `${chunkMHVNT4J3_cjs.testIdOr(testIds?.row, { testId: "chat-conversation" })}-${thread.id}`,
1537
+ className: ui.cn(
1538
+ "flex w-full items-center rounded-md px-3 py-2 pr-10 text-left text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11",
1539
+ isActive ? "bg-muted font-medium text-foreground" : "text-muted-foreground hover:bg-muted/60 hover:text-foreground"
1540
+ ),
1541
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: title })
1542
+ }
1368
1543
  ),
1369
- children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: title })
1370
- }
1371
- ),
1372
- onDelete && /* @__PURE__ */ jsxRuntime.jsx(
1373
- "button",
1374
- {
1375
- type: "button",
1376
- onClick: () => onDelete(thread.id),
1377
- "aria-label": labels.deleteConversation(title),
1378
- "data-testid": `${chunkMHVNT4J3_cjs.testIdOr(testIds?.delete, { testId: "chat-delete" })}-${thread.id}`,
1379
- className: "absolute right-1 top-1/2 flex size-8 -translate-y-1/2 items-center justify-center rounded-md text-muted-foreground opacity-100 hover:bg-background hover:text-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-fine:opacity-0 pointer-fine:group-hover:opacity-100 pointer-coarse:size-11",
1380
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "size-4", "aria-hidden": "true" })
1381
- }
1382
- )
1383
- ] }, thread.id);
1384
- }) })
1544
+ onDelete && /* @__PURE__ */ jsxRuntime.jsx(
1545
+ "button",
1546
+ {
1547
+ type: "button",
1548
+ onClick: () => onDelete(thread.id),
1549
+ "aria-label": labels.deleteConversation(title),
1550
+ "data-testid": `${chunkMHVNT4J3_cjs.testIdOr(testIds?.delete, { testId: "chat-delete" })}-${thread.id}`,
1551
+ className: "absolute right-1 top-1/2 flex size-8 -translate-y-1/2 items-center justify-center rounded-md text-muted-foreground opacity-100 hover:bg-background hover:text-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-fine:opacity-0 pointer-fine:group-hover:opacity-100 pointer-coarse:size-11",
1552
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "size-4", "aria-hidden": "true" })
1553
+ }
1554
+ )
1555
+ ] }, thread.id);
1556
+ })
1557
+ }
1558
+ )
1385
1559
  ]
1386
1560
  }
1387
1561
  );
@@ -1433,38 +1607,88 @@ function useChatSurface() {
1433
1607
  );
1434
1608
  return { hasEmbeddedChat: count > 0, isDockAvailable: count === 0 };
1435
1609
  }
1436
-
1437
- // src/chat/chat-page-types.ts
1438
- var DEFAULT_CHAT_PAGE_LABELS = {
1439
- chat: "Assistant chat",
1440
- conversations: "Conversations",
1441
- newChat: "New chat",
1442
- untitled: "New chat",
1443
- deleteConversation: (title) => `Delete conversation ${title}`,
1444
- assistant: "Assistant",
1445
- thinking: "Thinking\u2026",
1446
- steps: (count) => count === 1 ? "1 step" : `${count} steps`,
1447
- responseFailed: "Response failed",
1448
- answerFailedTitle: "The answer could not be completed",
1449
- uploadFailedTitle: "The upload failed",
1450
- placeholder: "Ask about your documents",
1451
- composerAriaLabel: "Message the assistant",
1452
- documentsInChat: (selected, total) => `${selected} of ${total} documents in this chat`,
1453
- documentsHeading: "Documents in this chat",
1454
- selectAllDocuments: "Select all",
1455
- noDocuments: "No documents yet",
1456
- uploadDocuments: "Upload documents",
1457
- uploading: "Uploading\u2026",
1458
- emptyTitle: "Ask about your documents",
1459
- emptyDescription: "Every answer is grounded in the selected documents and cites its sources.",
1460
- emptyUploadTitle: "Add a document to start",
1461
- emptyUploadDescription: "Upload the documents you want to ask about.",
1462
- workflows: "Workflows",
1463
- loadingDocuments: "Loading documents\u2026"
1464
- };
1610
+ function useElementSize(ref) {
1611
+ const [size, setSize] = react.useState({ width: 0, height: 0 });
1612
+ react.useLayoutEffect(() => {
1613
+ const el = ref.current;
1614
+ if (!el) return;
1615
+ const measure = () => {
1616
+ const rect = el.getBoundingClientRect();
1617
+ setSize(
1618
+ (prev) => prev.width === rect.width && prev.height === rect.height ? prev : { width: rect.width, height: rect.height }
1619
+ );
1620
+ };
1621
+ measure();
1622
+ window.addEventListener("resize", measure);
1623
+ const stopObserving = chunkPPCATBOY_cjs.observeResize(el, measure);
1624
+ return () => {
1625
+ window.removeEventListener("resize", measure);
1626
+ stopObserving();
1627
+ };
1628
+ }, [ref]);
1629
+ return size;
1630
+ }
1631
+ function rootFontSizePx() {
1632
+ if (typeof document === "undefined") return 16;
1633
+ const size = parseFloat(getComputedStyle(document.documentElement).fontSize);
1634
+ return Number.isFinite(size) && size > 0 ? size : 16;
1635
+ }
1636
+ function bottomSpace(el, until) {
1637
+ let space = 0;
1638
+ for (let node = el.parentElement; node; node = node.parentElement) {
1639
+ const style = getComputedStyle(node);
1640
+ space += (parseFloat(style.paddingBottom) || 0) + (parseFloat(style.borderBottomWidth) || 0);
1641
+ if (node === until) break;
1642
+ }
1643
+ return space;
1644
+ }
1645
+ function scrollParent(el) {
1646
+ for (let node = el.parentElement; node; node = node.parentElement) {
1647
+ const overflowY = getComputedStyle(node).overflowY;
1648
+ if (overflowY === "auto" || overflowY === "scroll") return node;
1649
+ }
1650
+ return null;
1651
+ }
1652
+ function useFillHeight(ref, enabled, minHeight) {
1653
+ const [height, setHeight] = react.useState(null);
1654
+ react.useLayoutEffect(() => {
1655
+ const el = ref.current;
1656
+ if (!enabled || !el) return;
1657
+ const scroller = scrollParent(el);
1658
+ const measure = () => {
1659
+ const viewport = window.visualViewport?.height ?? window.innerHeight;
1660
+ const rect = el.getBoundingClientRect();
1661
+ const scrolled = scroller ? scroller.scrollTop : window.scrollY;
1662
+ let available;
1663
+ if (scroller) {
1664
+ const top = rect.top - scroller.getBoundingClientRect().top;
1665
+ available = scroller.clientHeight - (top + scrolled) - bottomSpace(el, scroller);
1666
+ } else {
1667
+ available = viewport - rect.top;
1668
+ }
1669
+ const bar = document.querySelector('[data-slot="mobile-tab-bar"]')?.getBoundingClientRect();
1670
+ const barHeight = bar && bar.height > 0 ? Math.max(0, viewport - bar.top) : 0;
1671
+ available = Math.min(available, viewport - barHeight - (rect.top + scrolled));
1672
+ setHeight(Math.max(minHeight, Math.floor(available)));
1673
+ };
1674
+ measure();
1675
+ window.addEventListener("resize", measure);
1676
+ window.visualViewport?.addEventListener("resize", measure);
1677
+ const stopObserving = scroller ? chunkPPCATBOY_cjs.observeResize(scroller, measure) : () => {
1678
+ };
1679
+ return () => {
1680
+ window.removeEventListener("resize", measure);
1681
+ window.visualViewport?.removeEventListener("resize", measure);
1682
+ stopObserving();
1683
+ };
1684
+ }, [ref, enabled, minHeight]);
1685
+ return enabled ? height : null;
1686
+ }
1465
1687
  var USER_BUBBLE = "bg-[color:hsl(var(--chat-user-bubble,var(--muted)))] text-[color:hsl(var(--chat-user-bubble-foreground,var(--foreground)))]";
1466
1688
  var NEAR_BOTTOM_PX = 96;
1467
- function MessageRow({ message, identity, renderContent, labels }) {
1689
+ var LIST_COLUMN_REM = 48;
1690
+ var DEFAULT_ASIDE_BREAKPOINT_REM = 60;
1691
+ function MessageRow({ message, identity, renderContent, onOpenCitation, labels }) {
1468
1692
  if (message.role === "user") {
1469
1693
  return /* @__PURE__ */ jsxRuntime.jsx(Message.Root, { role: "user", messageId: message.id, children: /* @__PURE__ */ jsxRuntime.jsx(Message.Content, { role: "user", messageId: message.id, children: /* @__PURE__ */ jsxRuntime.jsx(
1470
1694
  Message.Bubble,
@@ -1492,7 +1716,15 @@ function MessageRow({ message, identity, renderContent, labels }) {
1492
1716
  statusLabel: isFailed ? labels.responseFailed : ""
1493
1717
  }
1494
1718
  ),
1495
- hasText && (renderContent?.(message) ?? /* @__PURE__ */ jsxRuntime.jsx(ui.MarkdownRenderer, { isStreaming, children: message.content })),
1719
+ hasText && (renderContent?.(message) ?? /* @__PURE__ */ jsxRuntime.jsx(
1720
+ ChatMessageContent,
1721
+ {
1722
+ message,
1723
+ labels,
1724
+ onOpenCitation
1725
+ }
1726
+ )),
1727
+ !hasText && message.stopped && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs italic text-muted-foreground", "data-testid": "chat-stopped", children: labels.stopped }),
1496
1728
  isStreaming && !hasText && /* @__PURE__ */ jsxRuntime.jsxs(
1497
1729
  "span",
1498
1730
  {
@@ -1517,6 +1749,11 @@ function ChatPage({
1517
1749
  emptyDescription,
1518
1750
  identity,
1519
1751
  renderContent,
1752
+ onOpenCitation,
1753
+ asideBreakpoint = DEFAULT_ASIDE_BREAKPOINT_REM,
1754
+ fillHeight = false,
1755
+ minHeight = 360,
1756
+ compactHeader = false,
1520
1757
  accept,
1521
1758
  labels,
1522
1759
  className,
@@ -1527,9 +1764,40 @@ function ChatPage({
1527
1764
  const [draft, setDraft] = react.useState("");
1528
1765
  const [isAsideOpen, setIsAsideOpen] = react.useState(false);
1529
1766
  const [isAway, setIsAway] = react.useState(false);
1767
+ const rootRef = react.useRef(null);
1768
+ const headerRef = react.useRef(null);
1769
+ const asideToggleRef = react.useRef(null);
1770
+ const asideRef = react.useRef(null);
1530
1771
  const scrollRef = react.useRef(null);
1531
1772
  const fileRef = react.useRef(null);
1532
1773
  const textareaRef = react.useRef(null);
1774
+ const { width } = useElementSize(rootRef);
1775
+ const { height: headerHeight } = useElementSize(headerRef);
1776
+ const rem = rootFontSizePx();
1777
+ const hasListColumn = width >= LIST_COLUMN_REM * rem;
1778
+ const hasAsideColumn = width > 0 && width >= asideBreakpoint * rem;
1779
+ const fillPx = useFillHeight(rootRef, fillHeight, minHeight);
1780
+ const closeAside = react.useCallback(() => setIsAsideOpen(false), []);
1781
+ const isAsidePanelOpen = !!aside && !hasAsideColumn && isAsideOpen;
1782
+ react.useEffect(() => {
1783
+ if (!isAsidePanelOpen) return;
1784
+ const onKey = (e) => {
1785
+ if (e.key !== "Escape") return;
1786
+ closeAside();
1787
+ asideToggleRef.current?.focus();
1788
+ };
1789
+ const onPointer = (e) => {
1790
+ const target = e.target;
1791
+ if (asideRef.current?.contains(target) || asideToggleRef.current?.contains(target)) return;
1792
+ closeAside();
1793
+ };
1794
+ document.addEventListener("keydown", onKey);
1795
+ document.addEventListener("pointerdown", onPointer);
1796
+ return () => {
1797
+ document.removeEventListener("keydown", onKey);
1798
+ document.removeEventListener("pointerdown", onPointer);
1799
+ };
1800
+ }, [isAsidePanelOpen, closeAside]);
1533
1801
  const last = chat.messages[chat.messages.length - 1];
1534
1802
  const announcement = useStreamAnnouncement({
1535
1803
  isStreaming: chat.isRunning,
@@ -1562,27 +1830,34 @@ function ChatPage({
1562
1830
  const onFiles = (files) => {
1563
1831
  if (files.length > 0) void chat.upload(files);
1564
1832
  };
1833
+ const hasHeader = !(compactHeader && hasListColumn && !headerActions && !(aside && !hasAsideColumn));
1565
1834
  const activeThread = chat.threads.find((t) => t.id === chat.activeThreadId);
1566
1835
  const hasDocuments = chat.documents.length > 0;
1567
1836
  const isEmpty = chat.messages.length === 0;
1568
- const heading = header ?? /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "min-w-0 truncate text-sm font-semibold text-foreground", children: activeThread?.title || l.untitled });
1837
+ const heading = compactHeader ? null : header ?? /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "min-w-0 truncate text-sm font-semibold text-foreground", children: activeThread?.title || l.untitled });
1569
1838
  return /* @__PURE__ */ jsxRuntime.jsxs(
1570
1839
  "section",
1571
1840
  {
1841
+ ref: rootRef,
1572
1842
  "aria-label": l.chat,
1573
1843
  "data-slot": "chat-page",
1574
1844
  "data-surface": surface,
1845
+ "data-list": hasListColumn ? "column" : "select",
1846
+ "data-aside": aside ? hasAsideColumn ? "column" : "panel" : void 0,
1575
1847
  "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.root, { testId: "chat-page" }),
1848
+ style: fillPx != null ? { height: fillPx } : void 0,
1576
1849
  className: ui.cn(
1577
- "@container/chat flex h-full min-h-0 w-full overflow-hidden bg-background text-foreground",
1850
+ "@container/chat relative flex min-h-0 w-full overflow-hidden bg-background text-foreground",
1851
+ fillHeight ? "h-[70dvh]" : "h-full",
1578
1852
  className
1579
1853
  ),
1580
1854
  children: [
1581
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "hidden w-64 shrink-0 flex-col border-r border-border @3xl/chat:flex", children: /* @__PURE__ */ jsxRuntime.jsx(
1855
+ hasListColumn && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-64 shrink-0 flex-col border-r border-border", children: /* @__PURE__ */ jsxRuntime.jsx(
1582
1856
  ChatThreadList,
1583
1857
  {
1584
1858
  threads: chat.threads,
1585
1859
  activeId: chat.activeThreadId,
1860
+ isLoading: chat.isLoadingThreads,
1586
1861
  labels: l,
1587
1862
  onSelect: chat.selectThread,
1588
1863
  onNew: chat.newThread,
@@ -1590,48 +1865,48 @@ function ChatPage({
1590
1865
  }
1591
1866
  ) }),
1592
1867
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [
1593
- /* @__PURE__ */ jsxRuntime.jsxs(
1868
+ hasHeader && /* @__PURE__ */ jsxRuntime.jsxs(
1594
1869
  "div",
1595
1870
  {
1871
+ ref: headerRef,
1596
1872
  "data-slot": "chat-page-header",
1597
1873
  className: "flex min-h-12 shrink-0 items-center gap-2 border-b border-border px-3 py-1.5",
1598
1874
  children: [
1599
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
1600
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "hidden min-w-0 flex-1 @3xl/chat:block", children: heading }),
1601
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2 @3xl/chat:hidden", children: [
1602
- header ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 shrink", children: header }) : null,
1603
- /* @__PURE__ */ jsxRuntime.jsx(
1604
- ChatThreadSelect,
1605
- {
1606
- threads: chat.threads,
1607
- activeId: chat.activeThreadId,
1608
- labels: l,
1609
- onSelect: chat.selectThread
1610
- }
1611
- ),
1612
- /* @__PURE__ */ jsxRuntime.jsx(
1613
- ui.Button,
1614
- {
1615
- type: "button",
1616
- variant: "ghost",
1617
- size: "icon",
1618
- className: "size-9 shrink-0 pointer-coarse:size-11",
1619
- "aria-label": l.newChat,
1620
- onClick: chat.newThread,
1621
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquarePlus, { className: "size-4", "aria-hidden": "true" })
1622
- }
1623
- )
1624
- ] })
1875
+ hasListColumn ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-0 flex-1 items-center", children: heading }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
1876
+ heading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 shrink", children: heading }) : null,
1877
+ /* @__PURE__ */ jsxRuntime.jsx(
1878
+ ChatThreadSelect,
1879
+ {
1880
+ threads: chat.threads,
1881
+ activeId: chat.activeThreadId,
1882
+ labels: l,
1883
+ onSelect: chat.selectThread
1884
+ }
1885
+ ),
1886
+ /* @__PURE__ */ jsxRuntime.jsx(
1887
+ ui.Button,
1888
+ {
1889
+ type: "button",
1890
+ variant: "ghost",
1891
+ size: "icon",
1892
+ className: "size-9 shrink-0 pointer-coarse:size-11",
1893
+ "aria-label": l.newChat,
1894
+ onClick: chat.newThread,
1895
+ "data-testid": "chat-new-compact",
1896
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquarePlus, { className: "size-4", "aria-hidden": "true" })
1897
+ }
1898
+ )
1625
1899
  ] }),
1626
- aside && /* @__PURE__ */ jsxRuntime.jsxs(
1900
+ aside && !hasAsideColumn && /* @__PURE__ */ jsxRuntime.jsxs(
1627
1901
  ui.Button,
1628
1902
  {
1903
+ ref: asideToggleRef,
1629
1904
  type: "button",
1630
1905
  variant: "outline",
1631
1906
  size: "sm",
1632
- className: "shrink-0 gap-1.5 pointer-coarse:min-h-11 @6xl/chat:hidden",
1907
+ className: "shrink-0 gap-1.5 pointer-coarse:min-h-11",
1633
1908
  "aria-expanded": isAsideOpen,
1634
- "aria-controls": "chat-page-aside-panel",
1909
+ "aria-controls": "chat-page-aside",
1635
1910
  onClick: () => setIsAsideOpen((v) => !v),
1636
1911
  "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.asideToggle, { testId: "chat-aside-toggle" }),
1637
1912
  children: [
@@ -1644,15 +1919,6 @@ function ChatPage({
1644
1919
  ]
1645
1920
  }
1646
1921
  ),
1647
- aside && isAsideOpen && /* @__PURE__ */ jsxRuntime.jsx(
1648
- "div",
1649
- {
1650
- id: "chat-page-aside-panel",
1651
- "data-slot": "chat-page-aside-panel",
1652
- className: "max-h-[45%] shrink-0 overflow-y-auto border-b border-border p-3 @6xl/chat:hidden",
1653
- children: aside
1654
- }
1655
- ),
1656
1922
  /* @__PURE__ */ jsxRuntime.jsxs(
1657
1923
  MessageList.Root,
1658
1924
  {
@@ -1667,8 +1933,16 @@ function ChatPage({
1667
1933
  ref: scrollRef,
1668
1934
  onScroll,
1669
1935
  "data-slot": "chat-page-scroll",
1670
- className: "relative min-h-0 flex-1 overflow-y-auto overscroll-contain",
1671
- children: isEmpty ? chat.isLoadingDocuments ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center text-sm text-muted-foreground", children: l.loadingDocuments }) : /* @__PURE__ */ jsxRuntime.jsx(
1936
+ className: "scrollbar-themed relative min-h-0 flex-1 overflow-y-auto overscroll-contain",
1937
+ children: isEmpty ? chat.isLoadingDocuments || chat.isLoadingThread ? /* @__PURE__ */ jsxRuntime.jsx(
1938
+ "div",
1939
+ {
1940
+ role: "status",
1941
+ className: "flex h-full items-center justify-center text-sm text-muted-foreground",
1942
+ "data-testid": "chat-loading",
1943
+ children: chat.isLoadingThread ? l.loadingConversation : l.loadingDocuments
1944
+ }
1945
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
1672
1946
  ConversationEmpty,
1673
1947
  {
1674
1948
  hasDocuments,
@@ -1713,6 +1987,7 @@ function ChatPage({
1713
1987
  message,
1714
1988
  identity,
1715
1989
  renderContent,
1990
+ onOpenCitation,
1716
1991
  labels: l
1717
1992
  }
1718
1993
  ) }, message.id))
@@ -1745,6 +2020,14 @@ function ChatPage({
1745
2020
  testId: chunkMHVNT4J3_cjs.testIdOr(testIds?.alert, { testId: "chat-alert" })
1746
2021
  }
1747
2022
  ),
2023
+ chat.historyError && /* @__PURE__ */ jsxRuntime.jsx(
2024
+ MessageAlert,
2025
+ {
2026
+ title: l.historyFailedTitle,
2027
+ description: chat.historyError,
2028
+ testId: "chat-history-alert"
2029
+ }
2030
+ ),
1748
2031
  chat.uploadError && /* @__PURE__ */ jsxRuntime.jsx(
1749
2032
  MessageAlert,
1750
2033
  {
@@ -1777,7 +2060,20 @@ function ChatPage({
1777
2060
  testIds: { documents: testIds?.documents, upload: testIds?.upload }
1778
2061
  }
1779
2062
  ),
1780
- trailing: /* @__PURE__ */ jsxRuntime.jsx(
2063
+ trailing: chat.isRunning && chat.stop ? /* @__PURE__ */ jsxRuntime.jsx(
2064
+ ui.Button,
2065
+ {
2066
+ type: "button",
2067
+ size: "icon",
2068
+ variant: "outline",
2069
+ className: "h-9 w-9 shrink-0 pointer-coarse:h-11 pointer-coarse:w-11",
2070
+ "aria-label": l.stop,
2071
+ title: l.stop,
2072
+ onClick: chat.stop,
2073
+ "data-testid": "chat-stop",
2074
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Square, { className: "h-3.5 w-3.5 fill-current", "aria-hidden": "true" })
2075
+ }
2076
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
1781
2077
  Composer.Send,
1782
2078
  {
1783
2079
  onSend: () => submit(),
@@ -1793,10 +2089,18 @@ function ChatPage({
1793
2089
  aside && /* @__PURE__ */ jsxRuntime.jsx(
1794
2090
  "aside",
1795
2091
  {
2092
+ ref: asideRef,
2093
+ id: "chat-page-aside",
1796
2094
  "aria-label": l.workflows,
1797
2095
  "data-slot": "chat-page-aside",
2096
+ "data-mode": hasAsideColumn ? "column" : "panel",
1798
2097
  "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.aside, { testId: "chat-aside" }),
1799
- className: "hidden w-80 shrink-0 overflow-y-auto border-l border-border p-4 @6xl/chat:block",
2098
+ hidden: !hasAsideColumn && !isAsideOpen,
2099
+ style: hasAsideColumn ? void 0 : { top: headerHeight + 4 },
2100
+ className: ui.cn(
2101
+ "scrollbar-themed overflow-y-auto bg-background",
2102
+ hasAsideColumn ? "w-72 shrink-0 border-l border-border p-4" : "absolute right-2 z-20 max-h-[min(60%,32rem)] w-[min(22rem,calc(100%-1rem))] rounded-lg border border-border bg-popover p-3 text-popover-foreground shadow-lg"
2103
+ ),
1800
2104
  children: aside
1801
2105
  }
1802
2106
  ),
@@ -1847,7 +2151,7 @@ function AssistantDockToggle({
1847
2151
  const { isDockAvailable } = useChatSurface();
1848
2152
  const dock = useAssistantDock();
1849
2153
  if (!isDockAvailable) return null;
1850
- return /* @__PURE__ */ jsxRuntime.jsx(chunkKHX2BX3S_cjs.ToolButton, { onClick: dock.toggle, label, active: dock.isOpen, "data-testid": testId, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "size-4", "aria-hidden": "true" }) });
2154
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkVGOFFCMT_cjs.ToolButton, { onClick: dock.toggle, label, active: dock.isOpen, "data-testid": testId, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "size-4", "aria-hidden": "true" }) });
1851
2155
  }
1852
2156
  function AssistantDock({
1853
2157
  chat,
@@ -1862,7 +2166,7 @@ function AssistantDock({
1862
2166
  const dock = useAssistantDock();
1863
2167
  if (!isDockAvailable) return null;
1864
2168
  return /* @__PURE__ */ jsxRuntime.jsx(
1865
- chunkKHX2BX3S_cjs.Shell.Dock,
2169
+ chunkVGOFFCMT_cjs.Shell.Dock,
1866
2170
  {
1867
2171
  isOpen: dock.isOpen,
1868
2172
  onOpenChange: dock.setOpen,
@@ -1881,7 +2185,7 @@ function AssistantDock({
1881
2185
  headerActions: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1882
2186
  headerActions,
1883
2187
  !isMobile && /* @__PURE__ */ jsxRuntime.jsx(
1884
- chunkKHX2BX3S_cjs.ToolButton,
2188
+ chunkVGOFFCMT_cjs.ToolButton,
1885
2189
  {
1886
2190
  onClick: () => dock.setOpen(false),
1887
2191
  label: closeLabel,
@@ -1899,9 +2203,11 @@ function AssistantDock({
1899
2203
  exports.AssistantDock = AssistantDock;
1900
2204
  exports.AssistantDockToggle = AssistantDockToggle;
1901
2205
  exports.ChatDocuments = ChatDocuments;
2206
+ exports.ChatMessageContent = ChatMessageContent;
1902
2207
  exports.ChatPage = ChatPage;
1903
2208
  exports.ChatThreadList = ChatThreadList;
1904
2209
  exports.ChatThreadSelect = ChatThreadSelect;
2210
+ exports.CitationMark = CitationMark;
1905
2211
  exports.Composer = Composer;
1906
2212
  exports.ComposerBranchingNotice = ComposerBranchingNotice;
1907
2213
  exports.ComposerContainer = ComposerContainer;
@@ -1948,5 +2254,5 @@ exports.useAssistantDock = useAssistantDock;
1948
2254
  exports.useChatSurface = useChatSurface;
1949
2255
  exports.useRegisterEmbeddedChat = useRegisterEmbeddedChat;
1950
2256
  exports.useStreamAnnouncement = useStreamAnnouncement;
1951
- //# sourceMappingURL=chunk-YLOKCIQJ.cjs.map
1952
- //# sourceMappingURL=chunk-YLOKCIQJ.cjs.map
2257
+ //# sourceMappingURL=chunk-5SLLMK5K.cjs.map
2258
+ //# sourceMappingURL=chunk-5SLLMK5K.cjs.map