@vite-hub/ui 0.6.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. package/README.md +106 -46
  2. package/dist/AttachmentTitle-BWw0ck0T.js +110 -0
  3. package/dist/BubbleContent-B1a4e3vE.js +45 -0
  4. package/dist/Chat-CuSthJVg.js +112 -0
  5. package/dist/ChatMessage-CFQs0v4N.js +94 -0
  6. package/dist/CodeBlockContent-BjXJm8lO.js +92 -0
  7. package/dist/CodeBlockTitle-DIu8Ef3V.js +99 -0
  8. package/dist/CommentRow-XY3FNp30.js +86 -0
  9. package/dist/CopyButton-Bs6DT-Z8.js +188 -0
  10. package/dist/Markdown-Da5t-931.js +70 -0
  11. package/dist/MarkdownCodeBlock-BWDLOWPO.js +127 -0
  12. package/dist/MarkdownImage-CJN3myt4.js +111 -0
  13. package/dist/MessageHeader-CJ9eBHSS.js +61 -0
  14. package/dist/MessageParts-CyJLG34y.js +57 -0
  15. package/dist/MessageScrollerViewport-BaTlWLki.js +142 -0
  16. package/dist/MorphText-B6MWdeIv.js +36 -0
  17. package/dist/RollNumber-CnF52zJM.js +49 -0
  18. package/dist/SwapIcon-CUIq1TU5.js +67 -0
  19. package/dist/TraceTitle-Cp0y7RRD.js +133 -0
  20. package/dist/agent-session-2j2gbGpp.js +875 -0
  21. package/dist/agent-session-BwZSMi4S.d.ts +312 -0
  22. package/dist/appendItems-hQ4aBd9Q.js +4047 -0
  23. package/dist/attachment-BllgHx9Q.d.ts +124 -0
  24. package/dist/attachment-DQMJNfj0.js +35 -0
  25. package/dist/avatar-stack-Bj1xUkzY.d.ts +4 -0
  26. package/dist/avatar-stack-CoLlsmwJ.js +72 -0
  27. package/dist/bubble-D3M2_InY.js +32 -0
  28. package/dist/bubble-DmplVxLr.d.ts +64 -0
  29. package/dist/chat-DWdyMSuj.d.ts +13 -0
  30. package/dist/chat-message-QLHnX_ED.d.ts +11 -0
  31. package/dist/chat-session-BOj5L3Ey.d.ts +29 -0
  32. package/dist/chat-session-cxUzvwdj.js +43 -0
  33. package/dist/choices-input-DqgXl5a-.d.ts +97 -0
  34. package/dist/{vue-d2Td6uu2.js → client-BG-oCUtv-5i4sRwXP.js} +4156 -4156
  35. package/dist/code-block-BqOEVWPh.d.ts +182 -0
  36. package/dist/code-block-CMERLfew.js +14 -0
  37. package/dist/code-view-26RY6dX8.js +137 -0
  38. package/dist/code-view-D8yYdFUc.d.ts +184 -0
  39. package/dist/{comment-composer-DmDM3XYP.d.ts → comment-composer-CsVOvG9j.d.ts} +6 -6
  40. package/dist/{comment-composer-X7vJKh5b.js → comment-composer-D_mcH3Ts.js} +175 -37
  41. package/dist/{comment-layer-KnnVfdRV.d.ts → comment-layer-C3xmg-0_.d.ts} +14 -5
  42. package/dist/comment-layer-Ci6ipGi2.js +1206 -0
  43. package/dist/{comment-panel-DoLDOw3E.d.ts → comment-panel-DxN21VoY.d.ts} +24 -17
  44. package/dist/comment-selection-bar-B_bchB2O.d.ts +33 -0
  45. package/dist/comment-selection-bar-DZAtiRZ9.js +144 -0
  46. package/dist/{comment-thread-DPV2kqA4.d.ts → comment-thread-BmsqcjVQ.d.ts} +9 -8
  47. package/dist/{comment-thread-jqPx6aJ8.js → comment-thread-BzOZVqF2.js} +74 -49
  48. package/dist/comments-BU8cTt5o.d.ts +50 -0
  49. package/dist/{comments-9MDSNm-9.js → comments-BaSrroRV.js} +32 -4
  50. package/dist/{comments-OWjNidkP.d.ts → comments-ZfV6IZs8.d.ts} +9 -2
  51. package/dist/components-B_2Q0dJ3.js +269 -0
  52. package/dist/{config-LRonN53j.js → config-BDQYUjjp.js} +10 -29
  53. package/dist/{config-COSdO-ay.d.ts → config-JmsTI7gs.d.ts} +20 -33
  54. package/dist/connection-status-BVSH2ZVo.js +72 -0
  55. package/dist/connection-status-g62BTn44.d.ts +37 -0
  56. package/dist/copy-button-CRiXUFsl.d.ts +17 -0
  57. package/dist/device-frame-BW6IjB6P.d.ts +78 -0
  58. package/dist/device-frame-DDWoyB-G.js +515 -0
  59. package/dist/diffs-BTKaVnsb.d.ts +272 -0
  60. package/dist/diffs.d.ts +3 -0
  61. package/dist/{pierre-code-view-C49BVDrc.js → diffs.js} +147 -4223
  62. package/dist/drop-field-C0bXv1J-.d.ts +35 -0
  63. package/dist/drop-field-DeIvKoJs.js +77 -0
  64. package/dist/editor-BsOTjnnN.d.ts +540 -0
  65. package/dist/{markdown-editor-D1irG9Xl.js → editor-hXea1i46.js} +833 -106
  66. package/dist/editor.d.ts +2 -0
  67. package/dist/editor.js +3 -0
  68. package/dist/element-BpjNQvZ0.js +6 -0
  69. package/dist/{file-tree-CRFIdtzw.js → file-tree-B4JKbp4r.js} +19 -18
  70. package/dist/{file-tree-DOtkeBaq.d.ts → file-tree-BdnKA6UA.d.ts} +33 -8
  71. package/dist/file-tree-DDSIafDn.d.ts +22 -0
  72. package/dist/file-tree-DS5shGSL.js +46 -0
  73. package/dist/file-tree.d.ts +2 -0
  74. package/dist/file-tree.js +1 -0
  75. package/dist/files-cuVXzWlx.js +30 -0
  76. package/dist/filter-search-C9e6sGij.d.ts +28 -0
  77. package/dist/filter-search-COZsoRiR.js +73 -0
  78. package/dist/formatCSSVariablePrefix-DLS1Ed1_.js +5 -0
  79. package/dist/headless-2IcUWHMq.d.ts +51 -0
  80. package/dist/headless.d.ts +7 -4
  81. package/dist/headless.js +5 -3
  82. package/dist/highlight.d.ts +2 -0
  83. package/dist/highlight.js +1 -0
  84. package/dist/{highlights-C2AbEdDI.js → highlights-8Al0-h-v.js} +3 -2
  85. package/dist/{hold-to-delete-BSMrpE-i.d.ts → hold-to-delete-CQc1JaG_.d.ts} +7 -0
  86. package/dist/{hold-to-delete-Cludb56v.js → hold-to-delete-D1Vy40w5.js} +138 -20
  87. package/dist/hold-to-delete-DazElJT2.js +85 -0
  88. package/dist/hold-to-delete-ksBE7wxc.d.ts +58 -0
  89. package/dist/index-CffOzibW.d.ts +77 -0
  90. package/dist/{index-B2cbt3py.d.ts → index-D3-uYBqH.d.ts} +1 -1
  91. package/dist/index.d.ts +165 -52
  92. package/dist/index.js +126 -670
  93. package/dist/markdown-BLALLOc0.d.ts +45 -0
  94. package/dist/{parts/components/markdown-renderer.d.ts → markdown-DkDxdpMU.d.ts} +10 -7
  95. package/dist/{markdown-renderer-DMyYKeil.js → markdown-_0HhbsOo.js} +125 -127
  96. package/dist/markdown-editor.d.ts +51 -98
  97. package/dist/markdown-editor.js +70 -3
  98. package/dist/markdown.d.ts +2 -0
  99. package/dist/markdown.js +1 -0
  100. package/dist/marker-CvcWZ3Zp.d.ts +59 -0
  101. package/dist/marker-DNL6QR3L.js +63 -0
  102. package/dist/message-BwivYIEl.js +13 -0
  103. package/dist/message-DEq4K5cQ.d.ts +72 -0
  104. package/dist/message-parts-B1BZFVKe.d.ts +3 -0
  105. package/dist/message-parts-CG3gNWn8.d.ts +11 -0
  106. package/dist/message-parts.d.ts +2 -0
  107. package/dist/message-parts.js +1 -0
  108. package/dist/message-scroller-D7AvM31v.d.ts +41 -0
  109. package/dist/motion/core.d.ts +4 -4
  110. package/dist/motion/core.js +5 -11
  111. package/dist/motion-BH6ShUam.d.ts +12 -0
  112. package/dist/{install-C4LwcJda.js → motion-BhARaNBB.js} +1 -1
  113. package/dist/{effects-C1zYpSpg.js → motion-core-JZZiPKEk.js} +1829 -120
  114. package/dist/{motion-core-Dh20n5Se.d.ts → motion-core-gfsTPLbh.d.ts} +35 -74
  115. package/dist/motion-list-9vD1hSS0.js +49 -0
  116. package/dist/motion.d.ts +5 -14
  117. package/dist/motion.js +6 -13
  118. package/dist/nuxt-ui-D3Qda35W.js +22 -0
  119. package/dist/nuxt.d.ts +9 -5
  120. package/dist/nuxt.js +28 -33
  121. package/dist/parts/components/agent-session.d.ts +2 -295
  122. package/dist/parts/components/agent-session.js +1 -659
  123. package/dist/parts/components/attachment.d.ts +2 -85
  124. package/dist/parts/components/attachment.js +3 -72
  125. package/dist/parts/components/avatar-stack.d.ts +3 -2
  126. package/dist/parts/components/avatar-stack.js +1 -60
  127. package/dist/parts/components/bubble.d.ts +2 -69
  128. package/dist/parts/components/bubble.js +3 -52
  129. package/dist/parts/components/chat-message.d.ts +3 -25
  130. package/dist/parts/components/chat-message.js +1 -50
  131. package/dist/parts/components/chat-session.d.ts +2 -26
  132. package/dist/parts/components/chat-session.js +1 -37
  133. package/dist/parts/components/chat.d.ts +3 -52
  134. package/dist/parts/components/chat.js +1 -105
  135. package/dist/parts/components/code-block.d.ts +2 -102
  136. package/dist/parts/components/code-block.js +4 -109
  137. package/dist/parts/components/code-view.d.ts +3 -268
  138. package/dist/parts/components/code-view.js +1 -1
  139. package/dist/parts/components/comment-composer.d.ts +1 -1
  140. package/dist/parts/components/comment-composer.js +1 -1
  141. package/dist/parts/components/comment-layer.d.ts +1 -1
  142. package/dist/parts/components/comment-layer.js +1 -634
  143. package/dist/parts/components/comment-panel.d.ts +2 -2
  144. package/dist/parts/components/comment-panel.js +22 -16
  145. package/dist/parts/components/comment-selection-bar.d.ts +2 -2
  146. package/dist/parts/components/comment-selection-bar.js +1 -116
  147. package/dist/parts/components/comment-thread.d.ts +1 -1
  148. package/dist/parts/components/comment-thread.js +1 -3
  149. package/dist/parts/components/comments.d.ts +8 -9
  150. package/dist/parts/components/comments.js +5 -9
  151. package/dist/parts/components/connection-status.d.ts +2 -36
  152. package/dist/parts/components/connection-status.js +1 -64
  153. package/dist/parts/components/copy-button.d.ts +3 -126
  154. package/dist/parts/components/copy-button.js +1 -226
  155. package/dist/parts/components/device-frame.d.ts +2 -128
  156. package/dist/parts/components/device-frame.js +1 -470
  157. package/dist/parts/components/drop-field.d.ts +2 -67
  158. package/dist/parts/components/drop-field.js +1 -76
  159. package/dist/parts/components/file-tree.d.ts +3 -2
  160. package/dist/parts/components/file-tree.js +3 -1
  161. package/dist/parts/components/filter-search.d.ts +2 -45
  162. package/dist/parts/components/filter-search.js +1 -57
  163. package/dist/parts/components/hold-to-delete.d.ts +2 -80
  164. package/dist/parts/components/hold-to-delete.js +1 -75
  165. package/dist/parts/components/markdown.d.ts +3 -45
  166. package/dist/parts/components/markdown.js +1 -46
  167. package/dist/parts/components/marker.d.ts +2 -32
  168. package/dist/parts/components/marker.js +1 -22
  169. package/dist/parts/components/message-parts.d.ts +3 -25
  170. package/dist/parts/components/message-parts.js +1 -45
  171. package/dist/parts/components/message.d.ts +2 -32
  172. package/dist/parts/components/message.js +3 -22
  173. package/dist/parts/components/motion-list.d.ts +2 -40
  174. package/dist/parts/components/motion-list.js +1 -41
  175. package/dist/parts/components/motion.d.ts +5 -118
  176. package/dist/parts/components/motion.js +5 -163
  177. package/dist/parts/components/patch-parsers.d.ts +1 -1
  178. package/dist/parts/components/progress.d.ts +2 -39
  179. package/dist/parts/components/progress.js +1 -53
  180. package/dist/parts/components/prompt-input.d.ts +2 -134
  181. package/dist/parts/components/prompt-input.js +1 -253
  182. package/dist/parts/components/relative-time.d.ts +2 -71
  183. package/dist/parts/components/relative-time.js +1 -1
  184. package/dist/parts/components/status.d.ts +2 -58
  185. package/dist/parts/components/status.js +1 -47
  186. package/dist/parts/components/sync-status.d.ts +2 -22
  187. package/dist/parts/components/sync-status.js +1 -48
  188. package/dist/parts/components/tool-list.d.ts +2 -28
  189. package/dist/parts/components/tool-list.js +1 -118
  190. package/dist/parts/components/trace-run.d.ts +2 -25
  191. package/dist/parts/components/trace-run.js +1 -89
  192. package/dist/parts/components/trace.d.ts +2 -59
  193. package/dist/parts/components/trace.js +1 -76
  194. package/dist/parts/composables/attachments.js +75 -1
  195. package/dist/parts/headless/choices-input.d.ts +2 -2
  196. package/dist/parts/headless/choices-input.js +49 -37
  197. package/dist/parts/headless/comments.d.ts +1 -1
  198. package/dist/parts/headless/comments.js +1 -1
  199. package/dist/parts/headless/message-scroller.d.ts +2 -2
  200. package/dist/parts/headless/message-scroller.js +211 -309
  201. package/dist/parts/headless/relative-time.d.ts +2 -0
  202. package/dist/parts/headless/relative-time.js +1 -0
  203. package/dist/parts/workspace/browser-support-notice.d.ts +1 -1
  204. package/dist/parts/workspace/browser-support-notice.js +6 -5
  205. package/dist/parts/workspace/connect-panel.js +1 -1
  206. package/dist/parts/workspace/runners/web-container.js +2 -2
  207. package/dist/parts/workspace/workspace-bar.d.ts +1 -1
  208. package/dist/parts/workspace/workspace-bar.js +1 -1
  209. package/dist/parts/workspace/workspace-boot-status.d.ts +1 -1
  210. package/dist/parts/workspace/workspace-boot-status.js +1 -206
  211. package/dist/parts/workspace/workspace-editor-head.d.ts +1 -1
  212. package/dist/parts/workspace/workspace-editor-head.js +1 -1
  213. package/dist/parts/workspace/workspace-editor.d.ts +2 -2
  214. package/dist/parts/workspace/workspace-examples.js +1 -1
  215. package/dist/parts/workspace/workspace-file-tree.d.ts +1 -1
  216. package/dist/parts/workspace/workspace-file-tree.js +3 -2
  217. package/dist/parts/workspace/workspace-guide.d.ts +1 -1
  218. package/dist/parts/workspace/workspace-guide.js +1 -1
  219. package/dist/parts/workspace/workspace-preview.d.ts +1 -1
  220. package/dist/parts/workspace/workspace-preview.js +14 -12
  221. package/dist/parts/workspace/workspace-shell.d.ts +1 -1
  222. package/dist/parts/workspace/workspace-shell.js +11 -11
  223. package/dist/parts/workspace/workspace-sidebar.d.ts +2 -2
  224. package/dist/parts/workspace/workspace-sidebar.js +2 -2
  225. package/dist/parts/workspace/workspace-start.d.ts +1 -1
  226. package/dist/parts/workspace/workspace-start.js +1 -1
  227. package/dist/parts/workspace/workspace-steps.js +1 -1
  228. package/dist/parts/workspace/workspace.d.ts +3 -3
  229. package/dist/parts/workspace/workspace.js +5 -5
  230. package/dist/press-BuEC-XvZ.d.ts +83 -0
  231. package/dist/progress-8P8RLYMy.js +47 -0
  232. package/dist/progress-Ch0fA-bf.d.ts +8 -0
  233. package/dist/prompt-input-CRXEJBAK.js +412 -0
  234. package/dist/prompt-input-j4OFTF5p.d.ts +116 -0
  235. package/dist/relative-time-BnJfjeEm.js +131 -0
  236. package/dist/relative-time-BuP-Gvzn.d.ts +43 -0
  237. package/dist/{relative-time-DJnw45tr.js → relative-time-Dz2DR4eb.js} +64 -114
  238. package/dist/relative-time-grHFu1kY.d.ts +11 -0
  239. package/dist/{ring-GaJsg32c.js → ring-B0nZBnU0.js} +1 -2
  240. package/dist/runtime/nuxt-plugin.js +2 -5
  241. package/dist/{shiki-CbfEu_Az.js → shiki-CxzM_xNo.js} +3 -2
  242. package/dist/stand-ins-CuKM1UH1.js +339 -0
  243. package/dist/status-B2Yhrwv8.js +67 -0
  244. package/dist/status-ySiRa-8O.d.ts +38 -0
  245. package/dist/{stream-tokenizer-ByC3l0HQ.js → stream-tokenizer-BsjV6wxW.js} +1 -1
  246. package/dist/styles.css +4348 -3410
  247. package/dist/sync-status-B29eG_n-.js +59 -0
  248. package/dist/sync-status-D4KdGO6y.d.ts +35 -0
  249. package/dist/theme.css +3 -0
  250. package/dist/theme.d.ts +14 -0
  251. package/dist/theme.js +19 -8
  252. package/dist/{themes-DKugPHlg.js → themes-B0_ioVT0.js} +1 -1
  253. package/dist/tool-list-DDaCqpR6.js +209 -0
  254. package/dist/tool-list-DMRPM0Yi.d.ts +50 -0
  255. package/dist/trace-KCBvOsw_.d.ts +113 -0
  256. package/dist/trace-run-Dk962P5a.d.ts +49 -0
  257. package/dist/trace-run-nh6FIsl6.js +202 -0
  258. package/dist/{opt-out-D66l60sg.js → tween-1W-LlKk9.js} +65 -2
  259. package/dist/types-CMU8Vmew.d.ts +71 -0
  260. package/dist/types-CTk3aNb5.d.ts +15 -0
  261. package/dist/types-D0a3i4Fw.d.ts +21 -0
  262. package/dist/types-DTecvcsZ.d.ts +35 -0
  263. package/dist/types-D_BWab7g.d.ts +75 -0
  264. package/dist/types-RHaQ4gj1.d.ts +27 -0
  265. package/dist/ui-components-CKQAPI-W.js +7 -0
  266. package/dist/unwrapDefault-CExq-4rm.js +5 -0
  267. package/dist/utils-hi9-xROt.js +37 -0
  268. package/dist/vite.d.ts +0 -1
  269. package/dist/vite.js +8 -14
  270. package/dist/{vue-vUGpdMct.js → vue-BdA18K5-.js} +1 -1
  271. package/dist/workspace-boot-status-CyGlJS06.js +216 -0
  272. package/dist/{workspace-shell-ChCwWPyv.d.ts → workspace-shell-B4A7CINd.d.ts} +1 -1
  273. package/dist/workspace.d.ts +1 -1
  274. package/dist/workspace.js +1 -2
  275. package/package.json +46 -15
  276. package/dist/announce-B0DLwflT.js +0 -31
  277. package/dist/attachments-DgwoQZKY.js +0 -88
  278. package/dist/avatar-stack-C0IKwj6g.d.ts +0 -57
  279. package/dist/choices-input-BUf-QqGj.d.ts +0 -92
  280. package/dist/code-view-Cg4nyTNA.js +0 -172
  281. package/dist/comment-attachments-DAzUbRmJ.js +0 -23
  282. package/dist/comment-list-ncwaCSVX.d.ts +0 -60
  283. package/dist/comment-person-D_IyIjXo.js +0 -39
  284. package/dist/comment-pin-hBJFiSYW.d.ts +0 -66
  285. package/dist/comment-row-DPMWI5Z0.js +0 -38
  286. package/dist/comment-selection-bar-CVuS-FNL.d.ts +0 -40
  287. package/dist/comment-send-CUkL3TbZ.js +0 -275
  288. package/dist/comment-send-MmxFsOQf.d.ts +0 -23
  289. package/dist/comment-send.css +0 -267
  290. package/dist/comment-status-nsCdrRk_.js +0 -20
  291. package/dist/drop-field-CNZgwFVO.js +0 -162
  292. package/dist/editor-Dmk3k6f6.js +0 -620
  293. package/dist/format-CPipR1FP.js +0 -19
  294. package/dist/handlers-CnbkvXjX.js +0 -181
  295. package/dist/icon-XZaCUZTG.d.ts +0 -29
  296. package/dist/image-preview-BKVUtfwQ.js +0 -104
  297. package/dist/index-B_PSX-5h.d.ts +0 -69
  298. package/dist/list-DUTAo0uC.js +0 -270
  299. package/dist/markdown-editor-B7gD60tp.d.ts +0 -189
  300. package/dist/message-scroller-BZqS63IX.d.ts +0 -173
  301. package/dist/nuxt-ui-7ByUrymx.js +0 -43
  302. package/dist/parts/components/comment-list.d.ts +0 -2
  303. package/dist/parts/components/comment-list.js +0 -173
  304. package/dist/parts/components/comment-pin.d.ts +0 -2
  305. package/dist/parts/components/comment-pin.js +0 -74
  306. package/dist/parts/components/comment-send.d.ts +0 -2
  307. package/dist/parts/components/comment-send.js +0 -1
  308. package/dist/parts/components/markdown-editor.d.ts +0 -2
  309. package/dist/parts/components/markdown-editor.js +0 -1
  310. package/dist/parts/components/markdown-renderer.js +0 -1
  311. package/dist/payload-text-DQNRbJY5.js +0 -31
  312. package/dist/progress-DL9k-ERG.js +0 -265
  313. package/dist/registry-DAIjCjWd.js +0 -77
  314. package/dist/slot-part-BWHvQ3mK.js +0 -25
  315. package/dist/text-gacox6bp.js +0 -822
  316. package/dist/travel-BliEidau.js +0 -180
  317. package/dist/tween-Dv3IIIQG.js +0 -61
  318. package/dist/types-Ceh7h7NT.d.ts +0 -31
  319. package/dist/visual-copy-CHHBfJ6O.js +0 -14
@@ -1,27 +1,16 @@
1
- import { s as CommentsState, t as CommentCan } from "./comments-OWjNidkP.js";
2
- import { l as CommentThreadSlots, n as CommentAttachmentUrl } from "./comment-thread-DPV2kqA4.js";
1
+ import { s as CommentsState, t as CommentCan } from "./comments-ZfV6IZs8.js";
2
+ import { u as CommentRowSlots } from "./types-CMU8Vmew.js";
3
+ import { l as CommentThreadSlots, n as CommentAttachmentUrl } from "./comment-thread-BmsqcjVQ.js";
3
4
  import { PropType, SlotsType, VNode } from "vue";
4
5
  import { CommentStatus, CommentSubject, CommentThread, CommentUser, CommentsClient } from "@vite-hub/comments/client";
5
6
  type CommentPanelVariant = "docked" | "floating";
6
7
  /** Turns files into attachment keys, such as Blob keys, before a comment or a reply is sent. */
7
8
  type CommentUpload = (files: File[]) => Promise<string[]>;
8
- /** The scope of the `row` and `preview` slots of `CommentPanel` and `CommentList`. */
9
- interface CommentRowSlotScope {
10
- thread: CommentThread;
11
- /** The text that the row shows without a `preview` slot: the first message as plain text, else the quoted text. */
12
- text: string;
13
- }
14
9
  /** The scope of the `group-header` slot: the label that `group` gave, and the threads under it. */
15
10
  interface CommentGroupSlotScope {
16
11
  group: string;
17
12
  threads: CommentThread[];
18
13
  }
19
- type CommentRowSlots = {
20
- /** The inside of one row of the list. Replaces the number, avatar, text, and facts. */
21
- row?: (scope: CommentRowSlotScope) => VNode[];
22
- /** The text of one row. Replaces the start of the first message, as plain text. Render `text` to keep it for some rows. */
23
- preview?: (scope: CommentRowSlotScope) => VNode[];
24
- };
25
14
  type CommentPanelSlots = CommentThreadSlots & CommentRowSlots & {
26
15
  /** The heading of a group of rows. Replaces the label that `group` gave. */
27
16
  "group-header"?: (scope: CommentGroupSlotScope) => VNode[];
@@ -58,6 +47,14 @@ declare const CommentPanel: import("vue").DefineComponent<import("vue").ExtractP
58
47
  default: string;
59
48
  type: StringConstructor;
60
49
  };
50
+ heading: {
51
+ default: boolean;
52
+ type: BooleanConstructor;
53
+ };
54
+ composer: {
55
+ default: boolean;
56
+ type: BooleanConstructor;
57
+ };
61
58
  readOnly: {
62
59
  default: boolean;
63
60
  type: BooleanConstructor;
@@ -119,6 +116,14 @@ declare const CommentPanel: import("vue").DefineComponent<import("vue").ExtractP
119
116
  default: string;
120
117
  type: StringConstructor;
121
118
  };
119
+ heading: {
120
+ default: boolean;
121
+ type: BooleanConstructor;
122
+ };
123
+ composer: {
124
+ default: boolean;
125
+ type: BooleanConstructor;
126
+ };
122
127
  readOnly: {
123
128
  default: boolean;
124
129
  type: BooleanConstructor;
@@ -156,11 +161,13 @@ declare const CommentPanel: import("vue").DefineComponent<import("vue").ExtractP
156
161
  "onUpdate:status"?: ((...args: any[]) => any) | undefined;
157
162
  }>, {
158
163
  title: string;
159
- variant: CommentPanelVariant;
160
164
  people: CommentUser[];
161
- allowEmpty: boolean;
162
165
  readOnly: boolean;
163
166
  queueFiles: boolean;
164
167
  thread: string | null;
168
+ variant: CommentPanelVariant;
169
+ allowEmpty: boolean;
170
+ composer: boolean;
171
+ heading: boolean;
165
172
  }, SlotsType<CommentPanelSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
166
- export { CommentPanelVariant as a, CommentUpload as c, CommentPanelSlots as i, CommentGroupSlotScope as n, CommentRowSlotScope as o, CommentPanel as r, CommentRowSlots as s, CommentGroup as t };
173
+ export { CommentPanelVariant as a, CommentPanelSlots as i, CommentGroupSlotScope as n, CommentUpload as o, CommentPanel as r, CommentGroup as t };
@@ -0,0 +1,33 @@
1
+ import { m as CommentSelectionBarSlots, p as CommentSelectionBarSide } from "./types-CMU8Vmew.js";
2
+ import { PropType, SlotsType } from "vue";
3
+ declare const CommentSelectionBar: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ side: {
5
+ default: string;
6
+ type: PropType<CommentSelectionBarSide>;
7
+ };
8
+ suggest: {
9
+ default: boolean;
10
+ type: BooleanConstructor;
11
+ };
12
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
13
+ [key: string]: any;
14
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
+ comment: () => true;
16
+ suggest: () => true;
17
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
18
+ side: {
19
+ default: string;
20
+ type: PropType<CommentSelectionBarSide>;
21
+ };
22
+ suggest: {
23
+ default: boolean;
24
+ type: BooleanConstructor;
25
+ };
26
+ }>> & Readonly<{
27
+ onComment?: (() => any) | undefined;
28
+ onSuggest?: (() => any) | undefined;
29
+ }>, {
30
+ side: CommentSelectionBarSide;
31
+ suggest: boolean;
32
+ }, SlotsType<CommentSelectionBarSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
33
+ export { CommentSelectionBar as t };
@@ -0,0 +1,144 @@
1
+ import { t as useUIComponent } from "./nuxt-ui-D3Qda35W.js";
2
+ import { Fragment, cloneVNode, computed, createBlock, createElementBlock, createElementVNode, createTextVNode, defineComponent, h, mergeProps, onErrorCaptured, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, withCtx, withModifiers } from "vue";
3
+ import { MessageCircle, Pencil } from "@lucide/vue";
4
+ // registry/comments/CommentSelectionBar.vue?vue&type=script&setup=true&lang.ts
5
+ const _hoisted_1 = ["data-side"];
6
+ const _hoisted_2 = [
7
+ "data-action",
8
+ "aria-keyshortcuts",
9
+ "title",
10
+ "onClick"
11
+ ];
12
+ // registry/comments/CommentSelectionBar.vue
13
+ var CommentSelectionBar_default = /* @__PURE__ */ defineComponent({
14
+ name: "CommentSelectionBar",
15
+ __name: "CommentSelectionBar",
16
+ props: {
17
+ suggest: {
18
+ type: Boolean,
19
+ default: false
20
+ },
21
+ side: { default: "top" },
22
+ tooltip: { type: [Object, Function] }
23
+ },
24
+ emits: ["comment", "suggest"],
25
+ setup(__props, { emit: __emit }) {
26
+ const emit = __emit;
27
+ const NativeHint = (_props, { slots }) => slots.default?.();
28
+ const actions = computed(() => [{
29
+ name: "comment",
30
+ label: "Comment",
31
+ hint: "Comment on the selected text",
32
+ key: "C",
33
+ icon: MessageCircle
34
+ }, ...__props.suggest ? [{
35
+ name: "suggest",
36
+ label: "Suggest",
37
+ hint: "Suggest new words",
38
+ key: "E",
39
+ icon: Pencil
40
+ }] : []]);
41
+ function run(name) {
42
+ if (name === "comment") emit("comment");
43
+ else emit("suggest");
44
+ }
45
+ return (_ctx, _cache) => {
46
+ return openBlock(), createElementBlock("div", {
47
+ "data-slot": "comment-selection-bar",
48
+ "data-side": __props.side,
49
+ role: "group",
50
+ "aria-label": "Selected text",
51
+ onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {}, ["prevent"]))
52
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(actions.value, (action) => {
53
+ return openBlock(), createBlock(resolveDynamicComponent(__props.tooltip || NativeHint), mergeProps({ key: action.name }, { ref_for: true }, __props.tooltip ? {
54
+ side: __props.side,
55
+ hint: action.hint,
56
+ shortcut: action.key
57
+ } : {}), {
58
+ default: withCtx(() => [createElementVNode("button", {
59
+ type: "button",
60
+ "data-slot": "comment-selection-bar-action",
61
+ "data-action": action.name,
62
+ "aria-keyshortcuts": action.key,
63
+ title: __props.tooltip ? void 0 : `${action.hint} (${action.key})`,
64
+ onClick: ($event) => run(action.name)
65
+ }, [renderSlot(_ctx.$slots, `${action.name}-icon`, {}, () => [(openBlock(), createBlock(resolveDynamicComponent(action.icon), {
66
+ "data-slot": "comment-icon",
67
+ "aria-hidden": "true"
68
+ }))]), createTextVNode(toDisplayString(action.label), 1)], 8, _hoisted_2)]),
69
+ _: 2
70
+ }, 1040);
71
+ }), 128))], 40, _hoisted_1);
72
+ };
73
+ }
74
+ });
75
+ // src/components/comment-selection-bar.ts
76
+ const SelectionHint = defineComponent({
77
+ props: {
78
+ hint: {
79
+ required: true,
80
+ type: String
81
+ },
82
+ shortcut: {
83
+ required: true,
84
+ type: String
85
+ },
86
+ side: {
87
+ required: true,
88
+ type: String
89
+ }
90
+ },
91
+ setup(props, { slots }) {
92
+ const Tooltip = useUIComponent("UTooltip");
93
+ const failed = ref(false);
94
+ let mounted = false;
95
+ onErrorCaptured(() => {
96
+ if (mounted || failed.value) return;
97
+ failed.value = true;
98
+ return false;
99
+ });
100
+ return () => {
101
+ const title = `${props.hint} (${props.shortcut})`;
102
+ if (failed.value) return slots.default?.().map((node) => cloneVNode(node, { title }));
103
+ return h(Tooltip, {
104
+ content: {
105
+ side: props.side,
106
+ sideOffset: 8
107
+ },
108
+ onVnodeMounted: () => mounted = true,
109
+ text: title
110
+ }, {
111
+ content: () => [props.hint, h("kbd", { "data-slot": "comment-selection-bar-kbd" }, props.shortcut)],
112
+ default: slots.default
113
+ });
114
+ };
115
+ }
116
+ });
117
+ const CommentSelectionBar = defineComponent({
118
+ name: "CommentSelectionBar",
119
+ props: {
120
+ side: {
121
+ default: "top",
122
+ type: String
123
+ },
124
+ suggest: {
125
+ default: false,
126
+ type: Boolean
127
+ }
128
+ },
129
+ emits: {
130
+ comment: () => true,
131
+ suggest: () => true
132
+ },
133
+ slots: Object,
134
+ setup(props, { emit, slots }) {
135
+ return () => h(CommentSelectionBar_default, {
136
+ ...props,
137
+ "data-slot": "comment-selection-bar",
138
+ tooltip: SelectionHint,
139
+ onComment: () => emit("comment"),
140
+ onSuggest: () => emit("suggest")
141
+ }, slots);
142
+ }
143
+ });
144
+ export { CommentSelectionBar as t };
@@ -1,8 +1,7 @@
1
- import { t as CommentCan } from "./comments-OWjNidkP.js";
2
- import { i as CommentComposerSlots, r as CommentComposerSize } from "./comment-composer-DmDM3XYP.js";
1
+ import { t as CommentCan } from "./comments-ZfV6IZs8.js";
2
+ import { i as CommentComposerSlots, r as CommentComposerSize } from "./comment-composer-CsVOvG9j.js";
3
3
  import { PropType, SlotsType, VNode } from "vue";
4
4
  import { CommentDelivery, CommentMessage, CommentThread, CommentUser } from "@vite-hub/comments/client";
5
- /** The messages written after the thread was resolved. Empty for an open thread. */
6
5
  declare function messagesSinceResolved(thread: Pick<CommentThread, "status" | "resolvedAt" | "messages">): CommentMessage[];
7
6
  declare const repliedSinceResolved: (thread: Pick<CommentThread, "status" | "resolvedAt" | "messages">) => boolean;
8
7
  type Done = Promise<unknown> | void;
@@ -18,7 +17,7 @@ interface CommentAttachmentLink {
18
17
  * key as a file without a link. An image shows as a thumbnail that opens full size.
19
18
  */
20
19
  type CommentAttachmentUrl = (key: string) => string | CommentAttachmentLink | undefined;
21
- /** The scope of the `body` and `attachments` slots of `CommentReply`. */
20
+ /** The scope of the `body`, `attachments`, and `footer` slots of `CommentReply`. */
22
21
  interface CommentReplySlotScope {
23
22
  message: CommentMessage;
24
23
  }
@@ -39,6 +38,8 @@ type CommentReplySlots = {
39
38
  body?: (scope: CommentReplySlotScope) => VNode[];
40
39
  /** The attachments of the message. Replaces the default thumbnails. */
41
40
  attachments?: (scope: CommentReplySlotScope) => VNode[];
41
+ /** Below the text and attachments of the message, such as actions on it. Hidden while it is edited and in previews. */
42
+ footer?: (scope: CommentReplySlotScope) => VNode[];
42
43
  /**
43
44
  * Below a message that has not reached the server, such as "Waiting to send" or a refusal with Retry and Discard.
44
45
  * Nothing shows without it. The message also gets `data-pending` or `data-failed`.
@@ -169,10 +170,10 @@ declare const CommentReply: import("vue").DefineComponent<import("vue").ExtractP
169
170
  };
170
171
  }>> & Readonly<{}>, {
171
172
  size: CommentComposerSize;
172
- compact: boolean;
173
173
  people: CommentUser[];
174
174
  editable: boolean;
175
175
  deletable: boolean;
176
+ compact: boolean;
176
177
  confirmDelete: boolean;
177
178
  }, SlotsType<CommentReplySlots & Pick<CommentComposerSlots, "mention-item" | "mention-empty">>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
178
179
  declare const CommentThread$1: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -365,12 +366,12 @@ declare const CommentThread$1: import("vue").DefineComponent<import("vue").Extra
365
366
  onClose?: ((...args: any[]) => any) | undefined;
366
367
  }>, {
367
368
  size: CommentComposerSize;
368
- preview: boolean;
369
- busy: boolean;
370
369
  people: CommentUser[];
371
- attachments: boolean;
372
370
  readOnly: boolean;
371
+ preview: boolean;
372
+ busy: boolean;
373
373
  detached: boolean;
374
+ attachments: boolean;
374
375
  navigation: "close" | "back";
375
376
  dismissible: boolean;
376
377
  }, SlotsType<CommentThreadSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,19 +1,36 @@
1
- import { RollNumber } from "./parts/components/motion.js";
1
+ import { t as RollNumber_default } from "./RollNumber-CnF52zJM.js";
2
2
  import { i as consumedPointerEvents, l as swallowNextClick, n as injectComments, o as pathOf, r as commentThreadPortals, s as shakeDirtyComposers, u as useDocumentPointerDown } from "./comments-context-3js2YFl2.js";
3
- import { n as mentionPlugin, r as mentionTag, t as CommentComposer } from "./comment-composer-X7vJKh5b.js";
4
- import { a as writerName, o as writerPerson, t as displayName } from "./comment-person-D_IyIjXo.js";
5
- import { n as deliveryAttributes, r as messagesSinceResolved, t as commentTitle } from "./comment-status-nsCdrRk_.js";
6
- import { t as defaultCommentCan } from "./comments-9MDSNm-9.js";
7
- import { a as useViteHubUIIcons } from "./config-LRonN53j.js";
8
- import { t as travel } from "./travel-BliEidau.js";
9
- import { r as useUIComponent } from "./nuxt-ui-7ByUrymx.js";
10
- import { Attachment, AttachmentContent, AttachmentGroup, AttachmentMedia, AttachmentTitle } from "./parts/components/attachment.js";
11
- import { AvatarStack } from "./parts/components/avatar-stack.js";
12
- import { Markdown } from "./parts/components/markdown.js";
13
- import { Marker, MarkerContent } from "./parts/components/marker.js";
14
- import { MotionList } from "./parts/components/motion-list.js";
15
- import { t as RelativeTime } from "./relative-time-DJnw45tr.js";
3
+ import { c as writerName, i as displayName, l as writerPerson, n as mentionPlugin, r as mentionTag, t as CommentComposer } from "./comment-composer-D_mcH3Ts.js";
4
+ import { t as defaultCommentCan } from "./comments-BaSrroRV.js";
5
+ import { n as useViteHubUIIcons } from "./config-BDQYUjjp.js";
6
+ import { i as travel } from "./motion-core-JZZiPKEk.js";
7
+ import { t as useUIComponent } from "./nuxt-ui-D3Qda35W.js";
8
+ import { i as AttachmentContent_default, n as AttachmentMedia_default, r as AttachmentGroup_default, s as Attachment_default, t as AttachmentTitle_default } from "./AttachmentTitle-BWw0ck0T.js";
9
+ import { t as AvatarStack_default } from "./avatar-stack-CoLlsmwJ.js";
10
+ import { t as Markdown_default } from "./Markdown-Da5t-931.js";
11
+ import { i as Marker_default, r as MarkerContent_default } from "./marker-DNL6QR3L.js";
12
+ import { t as MotionList_default } from "./motion-list-9vD1hSS0.js";
13
+ import { t as RelativeTime_default } from "./relative-time-BnJfjeEm.js";
16
14
  import { computed, defineComponent, h, inject, nextTick, onBeforeUnmount, provide, ref, watch } from "vue";
15
+ // registry/comments/status.ts
16
+ function messagesSinceResolved(thread) {
17
+ const { resolvedAt } = thread;
18
+ if (thread.status !== "resolved" || resolvedAt === void 0) return [];
19
+ return thread.messages.filter((message) => message.createdAt > resolvedAt);
20
+ }
21
+ const repliedSinceResolved = (thread) => messagesSinceResolved(thread).length > 0;
22
+ function commentTitle(thread) {
23
+ return thread.n ? `Comment ${thread.n}` : "Comment";
24
+ }
25
+ function commentHeading(thread) {
26
+ return thread.n ? `#${thread.n}` : "Comment";
27
+ }
28
+ function deliveryAttributes(delivery) {
29
+ return {
30
+ "data-failed": delivery?.status === "failed" ? "true" : void 0,
31
+ "data-pending": delivery?.status === "pending" ? "true" : void 0
32
+ };
33
+ }
17
34
  // src/internal/image-gallery.ts
18
35
  const tileCount = 4;
19
36
  /** The box of `width` by `height` that covers `box`, centered on it: the picture with the shape it has full size. */
@@ -155,7 +172,7 @@ const ImageGallery = defineComponent({
155
172
  class: "vh-image-dialog__name",
156
173
  title: shown.value?.name
157
174
  }, shown.value?.name),
158
- many ? h("span", { class: "vh-image-gallery__count" }, [h(RollNumber, { value: (current.value ?? 0) + 1 }), ` of ${count}`]) : null,
175
+ many ? h("span", { class: "vh-image-gallery__count" }, [h(RollNumber_default, { value: (current.value ?? 0) + 1 }), ` of ${count}`]) : null,
159
176
  h(UButton, {
160
177
  "aria-label": "Open original image",
161
178
  class: "vh-image-dialog__action",
@@ -254,10 +271,10 @@ function attachmentList(message, url, icon, fileIcon) {
254
271
  src: item.href
255
272
  }] : []);
256
273
  const files = items.filter((item) => !item.image);
257
- return [images.length > 0 ? h(ImageGallery, { images }) : null, files.length > 0 ? h(AttachmentGroup, { "data-slot": "comment-reply-attachments" }, () => files.map((item) => h(Attachment, {
274
+ return [images.length > 0 ? h(ImageGallery, { images }) : null, files.length > 0 ? h(AttachmentGroup_default, { "data-slot": "comment-reply-attachments" }, () => files.map((item) => h(Attachment_default, {
258
275
  key: item.key,
259
276
  size: "xs"
260
- }, () => [h(AttachmentMedia, { variant: "icon" }, () => h(icon, { name: fileIcon })), h(AttachmentContent, () => h(AttachmentTitle, () => item.href ? h("a", {
277
+ }, () => [h(AttachmentMedia_default, { kind: "icon" }, () => h(icon, { name: fileIcon })), h(AttachmentContent_default, () => h(AttachmentTitle_default, () => item.href ? h("a", {
261
278
  href: item.href,
262
279
  rel: "noreferrer",
263
280
  target: "_blank"
@@ -417,7 +434,7 @@ const CommentReply = defineComponent({
417
434
  "data-slot": "comment-reply"
418
435
  }, [h("div", { "data-slot": "comment-reply-content" }, [
419
436
  h("div", { "data-slot": "comment-reply-header" }, [
420
- h(AvatarStack, {
437
+ h(AvatarStack_default, {
421
438
  "aria-hidden": "true",
422
439
  people: [writerPerson(message)],
423
440
  size: "sm"
@@ -426,7 +443,7 @@ const CommentReply = defineComponent({
426
443
  "data-agent": message.actor ? "true" : void 0,
427
444
  "data-slot": "comment-reply-author"
428
445
  }, writerName(message)),
429
- h(RelativeTime, {
446
+ h(RelativeTime_default, {
430
447
  at: message.createdAt,
431
448
  "data-slot": "comment-reply-time"
432
449
  }),
@@ -452,13 +469,14 @@ const CommentReply = defineComponent({
452
469
  }, {
453
470
  ...slots["mention-item"] ? { "mention-item": slots["mention-item"] } : {},
454
471
  ...slots["mention-empty"] ? { "mention-empty": slots["mention-empty"] } : {}
455
- }) : slots.body?.({ message }) ?? h(Markdown, {
472
+ }) : slots.body?.({ message }) ?? h(Markdown_default, {
456
473
  components: bodyComponents,
457
474
  "data-slot": "comment-reply-body",
458
475
  plugins: bodyPlugins.value,
459
476
  value: message.body
460
477
  }),
461
478
  editing.value || props.compact ? null : slots.attachments?.({ message }) ?? attachmentList(message, props.attachmentUrl, UIcon, icons.value.file),
479
+ editing.value || props.compact || !slots.footer ? null : h("div", { "data-slot": "comment-reply-footer" }, slots.footer({ message })),
462
480
  !editing.value && message.delivery ? statusOf(message, message.delivery) : null,
463
481
  confirming.value ? h("div", {
464
482
  "aria-label": "Confirm delete",
@@ -504,10 +522,10 @@ const CommentReply = defineComponent({
504
522
  }
505
523
  });
506
524
  /** "Resolved by Ana", or "Resolved by Claude (Ana)" when her agent did, as a line across the thread. */
507
- const resolvedMarker = (thread) => h(Marker, {
525
+ const resolvedMarker = (thread) => h(Marker_default, {
508
526
  key: "resolved",
509
527
  variant: "separator"
510
- }, () => h(MarkerContent, () => `Resolved${thread.resolvedBy ? ` by ${writerName({
528
+ }, () => h(MarkerContent_default, () => `Resolved${thread.resolvedBy ? ` by ${writerName({
511
529
  author: thread.resolvedBy,
512
530
  ...thread.resolvedActor ? { actor: thread.resolvedActor } : {}
513
531
  })}` : ""}`));
@@ -597,7 +615,7 @@ const CommentThread = defineComponent({
597
615
  const sending = ref(false);
598
616
  const failure = ref();
599
617
  const composer = ref(null);
600
- const portals = /* @__PURE__ */ new Set();
618
+ const portals = inject(commentThreadPortals, void 0) ?? /* @__PURE__ */ new Set();
601
619
  provide(commentThreadPortals, portals);
602
620
  const user = computed(() => props.user ?? comments?.user.value);
603
621
  const users = computed(() => props.users ?? (comments ? (query) => comments.users(query, props.thread.id) : void 0));
@@ -666,6 +684,7 @@ const CommentThread = defineComponent({
666
684
  const replySlots = () => ({
667
685
  ...slots.body ? { body: slots.body } : {},
668
686
  ...slots.attachments ? { attachments: slots.attachments } : {},
687
+ ...slots.footer ? { footer: slots.footer } : {},
669
688
  ...slots.status ? { status: slots.status } : {},
670
689
  ...slots["mention-item"] ? { "mention-item": slots["mention-item"] } : {},
671
690
  ...slots["mention-empty"] ? { "mention-empty": slots["mention-empty"] } : {}
@@ -698,7 +717,7 @@ const CommentThread = defineComponent({
698
717
  }, {
699
718
  ...slots.body ? { body: slots.body } : {},
700
719
  ...slots.status ? { status: slots.status } : {}
701
- }) : null, replies > 0 ? h("p", { "data-slot": "comment-thread-count" }, [h(RollNumber, { value: replies }), replies === 1 ? " reply" : " replies"]) : null]);
720
+ }) : null, replies > 0 ? h("p", { "data-slot": "comment-thread-count" }, [h(RollNumber_default, { value: replies }), replies === 1 ? " reply" : " replies"]) : null]);
702
721
  }
703
722
  const back = props.navigation === "back";
704
723
  const anchor = slots.anchor ? slots.anchor({ thread }) : quote ? h("blockquote", { "data-slot": "comment-thread-quote" }, quote) : null;
@@ -721,7 +740,7 @@ const CommentThread = defineComponent({
721
740
  size: "xs",
722
741
  variant: "ghost"
723
742
  }) : null,
724
- h("span", { "data-slot": "comment-thread-title" }, commentTitle(thread)),
743
+ h("span", { "data-slot": "comment-thread-title" }, commentHeading(thread)),
725
744
  h("span", { "data-slot": "comment-thread-spacer" }),
726
745
  slots.actions ? h("div", { "data-slot": "comment-thread-actions" }, slots.actions({ thread })) : null,
727
746
  !allowed("resolve") ? null : h(UButton, {
@@ -741,29 +760,35 @@ const CommentThread = defineComponent({
741
760
  variant: "ghost"
742
761
  })
743
762
  ]),
744
- h(MotionList, { "data-slot": "comment-thread-messages" }, () => [
745
- anchor,
746
- props.detached ? h("p", {
747
- "data-slot": "comment-thread-detached",
748
- role: "status"
749
- }, "The place of this comment is no longer on the page.") : null,
750
- ...thread.messages.flatMap((message, index) => [resolved && message === later[0] ? resolvedMarker(thread) : null, h(CommentReply, {
751
- attachmentUrl: props.attachmentUrl,
752
- confirmDelete: index === 0,
753
- deletable: allowed("delete", message),
754
- editable: allowed("edit", message),
755
- key: message.id,
756
- message,
757
- onDelete: props.onDelete,
758
- onEdit: props.onEdit,
759
- people: people.value,
760
- size: props.size,
761
- user: user.value,
762
- users: users.value
763
- }, replySlots())]),
764
- resolved && later.length === 0 ? resolvedMarker(thread) : null,
765
- slots.after ? h("div", { "data-slot": "comment-thread-after" }, slots.after({ thread })) : null
766
- ]),
763
+ h(MotionList_default, null, {
764
+ render: ({ props: list, children }) => h("div", {
765
+ ...list,
766
+ "data-slot": "comment-thread-messages"
767
+ }, [children]),
768
+ default: () => [
769
+ anchor,
770
+ props.detached ? h("p", {
771
+ "data-slot": "comment-thread-detached",
772
+ role: "status"
773
+ }, "The place of this comment is no longer on the page.") : null,
774
+ ...thread.messages.flatMap((message, index) => [resolved && message === later[0] ? resolvedMarker(thread) : null, h(CommentReply, {
775
+ attachmentUrl: props.attachmentUrl,
776
+ confirmDelete: index === 0,
777
+ deletable: allowed("delete", message),
778
+ editable: allowed("edit", message),
779
+ key: message.id,
780
+ message,
781
+ onDelete: props.onDelete,
782
+ onEdit: props.onEdit,
783
+ people: people.value,
784
+ size: props.size,
785
+ user: user.value,
786
+ users: users.value
787
+ }, replySlots())]),
788
+ resolved && later.length === 0 ? resolvedMarker(thread) : null,
789
+ slots.after ? h("div", { "data-slot": "comment-thread-after" }, slots.after({ thread })) : null
790
+ ]
791
+ }),
767
792
  !allowed("reply") && (failure.value ?? props.error) ? h("p", { role: "alert" }, failure.value ?? props.error) : null,
768
793
  !allowed("reply") ? null : h(CommentComposer, {
769
794
  accept: props.accept,
@@ -793,4 +818,4 @@ const CommentThread = defineComponent({
793
818
  };
794
819
  }
795
820
  });
796
- export { CommentThread as n, CommentReply as t };
821
+ export { messagesSinceResolved as a, deliveryAttributes as i, CommentThread as n, repliedSinceResolved as o, commentTitle as r, CommentReply as t };
@@ -0,0 +1,50 @@
1
+ import "./comment-composer-CsVOvG9j.js";
2
+ import "./comment-layer-C3xmg-0_.js";
3
+ import "./comment-panel-DxN21VoY.js";
4
+ import "./comment-thread-BmsqcjVQ.js";
5
+ import { g as CommentToolbarSlots, h as CommentToolbarProps, i as CommentListSlots, o as CommentPinProps, r as CommentListProps, t as CommentFiltersProps } from "./types-CMU8Vmew.js";
6
+ import { t as AvatarStackPerson } from "./types-CTk3aNb5.js";
7
+ import "./comment-selection-bar-B_bchB2O.js";
8
+ import { Component } from "vue";
9
+ import { CommentThread } from "@vite-hub/comments/client";
10
+ declare const __VLS_export$3: import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<CommentFiltersProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<CommentFiltersProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>;
11
+ declare const _default$3: typeof __VLS_export$3;
12
+ type __VLS_Slots$1 = CommentListSlots;
13
+ declare const __VLS_base$1: import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<CommentListProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {
14
+ select: (event: {
15
+ thread: CommentThread;
16
+ }) => any;
17
+ }, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<CommentListProps> & Readonly<{
18
+ onSelect?: ((event: {
19
+ thread: CommentThread;
20
+ }) => any) | undefined;
21
+ }>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>;
22
+ declare const __VLS_export$2: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
23
+ declare const _default$2: typeof __VLS_export$2;
24
+ type __VLS_WithSlots$1<T, S> = T & {
25
+ new (): {
26
+ $slots: S;
27
+ };
28
+ };
29
+ declare const __VLS_export$1: import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<CommentPinProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {
30
+ select: () => any;
31
+ hover: () => any;
32
+ leave: () => any;
33
+ }, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<CommentPinProps> & Readonly<{
34
+ onSelect?: (() => any) | undefined;
35
+ onHover?: (() => any) | undefined;
36
+ onLeave?: (() => any) | undefined;
37
+ }>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>;
38
+ declare const _default$1: typeof __VLS_export$1;
39
+ type __VLS_Slots = CommentToolbarSlots;
40
+ declare const __VLS_base: import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<CommentToolbarProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<CommentToolbarProps> & Readonly<{}>, {
41
+ people: AvatarStackPerson[];
42
+ }, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>;
43
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
44
+ declare const _default: typeof __VLS_export;
45
+ type __VLS_WithSlots<T, S> = T & {
46
+ new (): {
47
+ $slots: S;
48
+ };
49
+ };
50
+ export { _default$3 as i, _default$1 as n, _default$2 as r, _default as t };
@@ -2,7 +2,7 @@ import { t as uiErrorDiagnostics } from "./error-diagnostics-BlgA9rI2.js";
2
2
  import { createCommentVisibility } from "./parts/headless/comment-visibility.js";
3
3
  import { a as hasDirtyComposer, n as injectComments, s as shakeDirtyComposers, t as commentsKey } from "./comments-context-3js2YFl2.js";
4
4
  import { computed, getCurrentInstance, isRef, onBeforeUnmount, onMounted, provide, reactive, ref, shallowRef, toRaw, toValue, watch } from "vue";
5
- import { createAnchor, resolveAnchor } from "@vite-hub/comments/client";
5
+ import { appCommentsBase, commentsApiCan, commentsGuestUser, createAnchor, createCommentsClient, createCommentsRestRequest, onCommentsGuestSaved, readCommentsGuest, resolveAnchor } from "@vite-hub/comments/client";
6
6
  // src/internal/comment-selection.ts
7
7
  function commentThreadKey(thread) {
8
8
  return thread.requestId === void 0 ? thread.id : JSON.stringify([
@@ -66,12 +66,16 @@ function describeError(error) {
66
66
  }
67
67
  /** The comment state of one page. The styled parts, `CommentLayer` and the others, are built on it. */
68
68
  function useComments(options) {
69
- const { client } = options;
69
+ const client = options.client ?? createCommentsClient();
70
+ const serverUser = shallowRef();
71
+ const savedGuest = shallowRef(options.client ? void 0 : readCommentsGuest());
72
+ const pageCan = shallowRef();
73
+ const sessionUser = computed(() => serverUser.value ?? (savedGuest.value ? commentsGuestUser(savedGuest.value) : void 0));
70
74
  const param = options.param ?? "comment";
71
75
  const hotkey = options.hotkey === void 0 ? "c" : options.hotkey === false ? false : options.hotkey.toLowerCase();
72
76
  const ignore = options.ignore ?? defaultIgnore;
73
77
  const subject = computed(() => toValue(options.subject));
74
- const user = computed(() => toValue(options.user) ?? client.user);
78
+ const user = computed(() => toValue(options.user) ?? client.user ?? sessionUser.value);
75
79
  const active = ref(false);
76
80
  const scopeValue = ref("page");
77
81
  const scope = computed({
@@ -364,6 +368,29 @@ function useComments(options) {
364
368
  status.value = client.status;
365
369
  threads.value = client.threads;
366
370
  stops.push(client.start());
371
+ if (!options.client) {
372
+ const request = createCommentsRestRequest({
373
+ base: appCommentsBase(),
374
+ guest: readCommentsGuest
375
+ });
376
+ stops.push(watch([() => subject.value.kind, () => subject.value.id], ([kind, id], _, onCleanup) => {
377
+ pageCan.value = void 0;
378
+ const controller = new AbortController();
379
+ onCleanup(() => controller.abort());
380
+ const query = new URLSearchParams({
381
+ subjectKind: kind,
382
+ subjectId: id
383
+ });
384
+ request(`/session?${query}`, { signal: controller.signal }).then(({ data }) => {
385
+ if (controller.signal.aborted) return;
386
+ serverUser.value = data.user ?? void 0;
387
+ pageCan.value = data.can;
388
+ }, () => {});
389
+ }, { immediate: true }));
390
+ stops.push(onCommentsGuestSaved((guest) => {
391
+ savedGuest.value = guest;
392
+ }));
393
+ }
367
394
  document.addEventListener("keydown", onKeydown);
368
395
  stops.push(() => document.removeEventListener("keydown", onKeydown));
369
396
  let frame = 0;
@@ -479,7 +506,8 @@ function useComments(options) {
479
506
  }
480
507
  return result;
481
508
  }
482
- const can = (action, target) => user.value !== void 0 && (options.can ?? defaultCommentCan(user.value))(action, target);
509
+ const apiCan = (action, target) => commentsApiCan(user.value, pageCan.value, action, target);
510
+ const can = (action, target) => user.value !== void 0 && (options.can ?? (options.client ? defaultCommentCan(user.value) : apiCan))(action, target);
483
511
  const state = {
484
512
  client,
485
513
  subject,