@vite-hub/ui 0.1.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/README.md +247 -21
  2. package/dist/attachments-BzTwqRTU.js +90 -0
  3. package/dist/{avatar-stack-DXmCQhxd.d.ts → avatar-stack-DPRFuezh.d.ts} +1 -1
  4. package/dist/choices-input-ByXJvDn1.d.ts +94 -0
  5. package/dist/{code-view-J4OsgEdh.js → code-view-DsU-xzic.js} +20 -4
  6. package/dist/colors-BghReA9C-CjF9gnmy.js +28 -0
  7. package/dist/comment-attachments-C4yNbcx5.js +20 -0
  8. package/dist/comment-composer-fINL5bxo.d.ts +243 -0
  9. package/dist/comment-composer-jYv2ULNP.js +591 -0
  10. package/dist/comment-layer-C_sbPIR5.d.ts +176 -0
  11. package/dist/comment-list-BcSaLngS.d.ts +62 -0
  12. package/dist/comment-marks.css +234 -0
  13. package/dist/comment-panel-CfvdRUMX.d.ts +208 -0
  14. package/dist/comment-person-CLPlW_SS.js +40 -0
  15. package/dist/comment-pin-DHOdRvUw.d.ts +68 -0
  16. package/dist/comment-row-Bn3nr8l5.js +39 -0
  17. package/dist/comment-selection-bar-CyVBNYl9.d.ts +42 -0
  18. package/dist/comment-thread-DKJjmWN0.d.ts +385 -0
  19. package/dist/comment-visibility-DsVuVndP.d.ts +40 -0
  20. package/dist/{comments-C08J3z4e.js → comments-D0d26ghV.js} +210 -59
  21. package/dist/comments-D8hulVPy.d.ts +198 -0
  22. package/dist/comments-context-C2lOZyQ5.js +38 -0
  23. package/dist/config-DgxBW013.d.ts +80 -0
  24. package/dist/config-Dk67emQt.js +63 -0
  25. package/dist/copy-button-CRN3kmSD.js +253 -0
  26. package/dist/draw-DzSmD7uo-Dwz8zoH2.js +72976 -0
  27. package/dist/editor-C_wt4RRV.js +582 -0
  28. package/dist/error-diagnostics-SXtnk6bz.js +38 -0
  29. package/dist/{file-tree-C1pv4_AI.js → file-tree-C4OYgbV-.js} +292 -145
  30. package/dist/{file-tree-Ctb8hZ_g.d.ts → file-tree-DlT9RGhu.d.ts} +51 -15
  31. package/dist/format-orwcdZL_.js +39 -0
  32. package/dist/handlers-DMl-Na3x.js +182 -0
  33. package/dist/headless.d.ts +5 -176
  34. package/dist/headless.js +5 -3
  35. package/dist/icon-swap.css +69 -0
  36. package/dist/{image-preview-VfknBEFu.js → image-preview-C9tdkmEj.js} +8 -5
  37. package/dist/{index-DcH0QSI5.d.ts → index-BYRFQfCd.d.ts} +14 -0
  38. package/dist/{code-view-vDM-hph-.d.ts → index-CNY1uNTh.d.ts} +14 -228
  39. package/dist/index.d.ts +55 -57
  40. package/dist/index.js +678 -25
  41. package/dist/markdown-editor-CMbNZOdN.js +2394 -0
  42. package/dist/markdown-editor-wQF0yD5o.d.ts +195 -0
  43. package/dist/markdown-editor.d.ts +108 -0
  44. package/dist/markdown-editor.js +3 -0
  45. package/dist/message-scroller-jrYN9dG9.d.ts +175 -0
  46. package/dist/nuxt-ui-DSQFzq3s.js +38 -0
  47. package/dist/nuxt.d.ts +84 -2
  48. package/dist/nuxt.js +243 -35
  49. package/dist/parts/components/agent-session.d.ts +254 -0
  50. package/dist/parts/components/agent-session.js +640 -0
  51. package/dist/{attachment-BBndG9_P.d.ts → parts/components/attachment.d.ts} +14 -15
  52. package/dist/{attachment-B3dXC7jM.js → parts/components/attachment.js} +6 -4
  53. package/dist/{avatar-stack.d.ts → parts/components/avatar-stack.d.ts} +1 -1
  54. package/dist/{avatar-stack-DM6HRnc0.js → parts/components/avatar-stack.js} +2 -5
  55. package/dist/{bubble-BJH2rfii.d.ts → parts/components/bubble.d.ts} +7 -8
  56. package/dist/{bubble-BPyFQlW7.js → parts/components/bubble.js} +2 -2
  57. package/dist/{chat-message-mpDmZbIC.d.ts → parts/components/chat-message.d.ts} +2 -3
  58. package/dist/{chat-message-BNK9G7xF.js → parts/components/chat-message.js} +4 -4
  59. package/dist/{chat-session-D6C7VJBR.d.ts → parts/components/chat-session.d.ts} +3 -4
  60. package/dist/{chat-session-DYEHB1HC.js → parts/components/chat-session.js} +2 -2
  61. package/dist/{chat-B9HlZWA2.d.ts → parts/components/chat.d.ts} +8 -4
  62. package/dist/{chat-BoFHlu9V.js → parts/components/chat.js} +42 -9
  63. package/dist/{highlighted-code-Dzf6o54i.d.ts → parts/components/code-block.d.ts} +15 -23
  64. package/dist/{code-block-Br-02hn-.js → parts/components/code-block.js} +9 -38
  65. package/dist/parts/components/code-view.d.ts +270 -0
  66. package/dist/parts/components/code-view.js +2 -0
  67. package/dist/parts/components/comment-composer.d.ts +2 -0
  68. package/dist/parts/components/comment-composer.js +2 -0
  69. package/dist/parts/components/comment-layer.d.ts +2 -0
  70. package/dist/parts/components/comment-layer.js +631 -0
  71. package/dist/parts/components/comment-list.d.ts +2 -0
  72. package/dist/parts/components/comment-list.js +168 -0
  73. package/dist/parts/components/comment-panel.d.ts +2 -0
  74. package/dist/parts/components/comment-panel.js +311 -0
  75. package/dist/parts/components/comment-pin.d.ts +2 -0
  76. package/dist/parts/components/comment-pin.js +75 -0
  77. package/dist/parts/components/comment-selection-bar.d.ts +2 -0
  78. package/dist/parts/components/comment-selection-bar.js +116 -0
  79. package/dist/parts/components/comment-thread.d.ts +2 -0
  80. package/dist/parts/components/comment-thread.js +598 -0
  81. package/dist/parts/components/comments.d.ts +8 -0
  82. package/dist/parts/components/comments.js +9 -0
  83. package/dist/{connection-status-DjGBw6xX.d.ts → parts/components/connection-status.d.ts} +6 -7
  84. package/dist/{connection-status-CzuWBENf.js → parts/components/connection-status.js} +1 -1
  85. package/dist/parts/components/copy-button.d.ts +118 -0
  86. package/dist/parts/components/copy-button.js +2 -0
  87. package/dist/parts/components/device-frame.d.ts +130 -0
  88. package/dist/parts/components/device-frame.js +471 -0
  89. package/dist/parts/components/file-tree.d.ts +2 -0
  90. package/dist/parts/components/file-tree.js +2 -0
  91. package/dist/parts/components/filter-search.d.ts +47 -0
  92. package/dist/parts/components/filter-search.js +58 -0
  93. package/dist/parts/components/markdown-editor.d.ts +2 -0
  94. package/dist/parts/components/markdown-editor.js +2 -0
  95. package/dist/parts/components/markdown-renderer.d.ts +52 -0
  96. package/dist/parts/components/markdown-renderer.js +23077 -0
  97. package/dist/{markdown-Dse5ldJe.d.ts → parts/components/markdown.d.ts} +7 -7
  98. package/dist/parts/components/markdown.js +47 -0
  99. package/dist/{marker-ea-tvx-J.d.ts → parts/components/marker.d.ts} +6 -7
  100. package/dist/{marker-Di2ZG_k1.js → parts/components/marker.js} +2 -2
  101. package/dist/{message-parts-BBFUkluC.d.ts → parts/components/message-parts.d.ts} +2 -3
  102. package/dist/{message-parts-DQnfioAH.js → parts/components/message-parts.js} +6 -6
  103. package/dist/{message-CW_paC1k.d.ts → parts/components/message.d.ts} +8 -9
  104. package/dist/{message-DiyBthIq.js → parts/components/message.js} +2 -2
  105. package/dist/parts/components/patch-parsers.d.ts +2 -0
  106. package/dist/parts/components/patch-parsers.js +2 -0
  107. package/dist/{prompt-input-Cy_Ue6B5.d.ts → parts/components/prompt-input.d.ts} +53 -10
  108. package/dist/{prompt-input-BbnCb80O.js → parts/components/prompt-input.js} +66 -111
  109. package/dist/parts/components/relative-time.d.ts +73 -0
  110. package/dist/parts/components/relative-time.js +2 -0
  111. package/dist/parts/components/status.d.ts +60 -0
  112. package/dist/parts/components/status.js +48 -0
  113. package/dist/{sync-status-refELOZn.d.ts → parts/components/sync-status.d.ts} +5 -6
  114. package/dist/{sync-status-BpxYdZIJ.js → parts/components/sync-status.js} +1 -1
  115. package/dist/{tool-list-E7CA52rz.d.ts → parts/components/tool-list.d.ts} +3 -4
  116. package/dist/{tool-list-BdSr5CT4.js → parts/components/tool-list.js} +7 -38
  117. package/dist/{trace-run-COeXn46Z.d.ts → parts/components/trace-run.d.ts} +3 -4
  118. package/dist/{trace-run-BIQ17CED.js → parts/components/trace-run.js} +15 -23
  119. package/dist/{trace-V7rM3Pyd.d.ts → parts/components/trace.d.ts} +11 -12
  120. package/dist/{trace-llBCDiSW.js → parts/components/trace.js} +20 -13
  121. package/dist/parts/composables/attachments.d.ts +32 -0
  122. package/dist/parts/composables/attachments.js +2 -0
  123. package/dist/parts/composables/highlighted-code.d.ts +9 -0
  124. package/dist/{highlighted-code-Ck4zexJX.js → parts/composables/highlighted-code.js} +5 -2
  125. package/dist/parts/headless/choices-input.d.ts +2 -0
  126. package/dist/parts/headless/choices-input.js +162 -0
  127. package/dist/parts/headless/comment-visibility.d.ts +2 -0
  128. package/dist/parts/headless/comment-visibility.js +128 -0
  129. package/dist/parts/headless/comments.d.ts +2 -0
  130. package/dist/parts/headless/comments.js +2 -0
  131. package/dist/parts/headless/message-scroller.d.ts +2 -0
  132. package/dist/{message-scroller-CX6NJTdm.js → parts/headless/message-scroller.js} +2 -2
  133. package/dist/parts/playground/highlight.d.ts +5 -0
  134. package/dist/parts/playground/highlight.js +23 -0
  135. package/dist/parts/playground/paths.d.ts +4 -0
  136. package/dist/parts/playground/paths.js +7 -0
  137. package/dist/parts/playground/playground-render.d.ts +126 -0
  138. package/dist/parts/playground/playground-render.js +356 -0
  139. package/dist/parts/playground/share.d.ts +2 -0
  140. package/dist/parts/playground/share.js +92 -0
  141. package/dist/parts/playground/zip.d.ts +6 -0
  142. package/dist/parts/playground/zip.js +76 -0
  143. package/dist/parts/workspace/browser-support-notice.d.ts +76 -0
  144. package/dist/parts/workspace/browser-support-notice.js +105 -0
  145. package/dist/parts/workspace/codemirror.d.ts +16 -0
  146. package/dist/parts/workspace/codemirror.js +243 -0
  147. package/dist/parts/workspace/connect-panel.d.ts +129 -0
  148. package/dist/parts/workspace/connect-panel.js +285 -0
  149. package/dist/parts/workspace/connect-store.d.ts +26 -0
  150. package/dist/parts/workspace/connect-store.js +59 -0
  151. package/dist/parts/workspace/icons.d.ts +34 -0
  152. package/dist/parts/workspace/icons.js +46 -0
  153. package/dist/parts/workspace/playground-container.d.ts +192 -0
  154. package/dist/parts/workspace/playground-container.js +603 -0
  155. package/dist/parts/workspace/workspace-boot-status.d.ts +75 -0
  156. package/dist/parts/workspace/workspace-boot-status.js +207 -0
  157. package/dist/parts/workspace/workspace-editor.d.ts +43 -0
  158. package/dist/parts/workspace/workspace-editor.js +54 -0
  159. package/dist/parts/workspace/workspace-file-tree.d.ts +53 -0
  160. package/dist/parts/workspace/workspace-file-tree.js +68 -0
  161. package/dist/parts/workspace/workspace-preview.d.ts +72 -0
  162. package/dist/parts/workspace/workspace-preview.js +307 -0
  163. package/dist/parts/workspace/workspace-shell.d.ts +88 -0
  164. package/dist/parts/workspace/workspace-shell.js +291 -0
  165. package/dist/parts/workspace/workspace-terminal.d.ts +39 -0
  166. package/dist/parts/workspace/workspace-terminal.js +130 -0
  167. package/dist/payload-text-sjkYAwvw.js +32 -0
  168. package/dist/{pierre-code-view-T7V67hwT.js → pierre-code-view-NE35tkmR.js} +245 -102
  169. package/dist/{pierre-dark-DDWDl8g6.js → pierre-dark-CzUmjETS.js} +3 -1
  170. package/dist/{pierre-light-CWhW4NrH.js → pierre-light-Dn6E0sWv.js} +3 -1
  171. package/dist/playground.d.ts +4 -0
  172. package/dist/playground.js +4 -0
  173. package/dist/relative-time-BVmjOsYG.js +309 -0
  174. package/dist/rolldown-runtime-C9mWXvCC.js +29 -0
  175. package/dist/runtime/nuxt-plugin.js +23 -4
  176. package/dist/sankey-CAYwt82B-D4uDQoMR.js +2887 -0
  177. package/dist/share-DM4eNy4q.d.ts +37 -0
  178. package/dist/{slot-part-C7Ocxn3b.js → slot-part-Doic71uh.js} +7 -1
  179. package/dist/styles.css +2609 -620
  180. package/dist/temml-BilSAAws.js +12362 -0
  181. package/dist/theme-focus-ring.css +42 -0
  182. package/dist/theme.css +376 -0
  183. package/dist/theme.d.ts +355 -0
  184. package/dist/theme.js +265 -0
  185. package/dist/{types-CqDwuJAm.d.ts → types-Dj7vp0lZ.d.ts} +1 -1
  186. package/dist/vue-BDmSCtay.js +30779 -0
  187. package/dist/vue-DGstVdGn.js +2492 -0
  188. package/dist/workspace.d.ts +15 -0
  189. package/dist/workspace.js +12 -0
  190. package/package.json +135 -149
  191. package/dist/andromeeda-BASpqCeJ.js +0 -4
  192. package/dist/attachment.d.ts +0 -2
  193. package/dist/attachment.js +0 -2
  194. package/dist/aurora-x-DugsLcii.js +0 -4
  195. package/dist/avatar-stack.js +0 -2
  196. package/dist/ayu-dark-BT3qdi3o.js +0 -4
  197. package/dist/ayu-light-BVZyHoh9.js +0 -4
  198. package/dist/ayu-mirage-XFwUVZQZ.js +0 -4
  199. package/dist/bubble.d.ts +0 -2
  200. package/dist/bubble.js +0 -2
  201. package/dist/catppuccin-frappe-D20KODDN.js +0 -4
  202. package/dist/catppuccin-latte-eGLVHIUJ.js +0 -4
  203. package/dist/catppuccin-macchiato-bQGch4PY.js +0 -4
  204. package/dist/catppuccin-mocha-Bes8-0Mr.js +0 -4
  205. package/dist/chat-message.d.ts +0 -2
  206. package/dist/chat-message.js +0 -2
  207. package/dist/chat-session.d.ts +0 -2
  208. package/dist/chat-session.js +0 -2
  209. package/dist/chat.d.ts +0 -2
  210. package/dist/chat.js +0 -2
  211. package/dist/code-block.d.ts +0 -2
  212. package/dist/code-block.js +0 -3
  213. package/dist/code-view.d.ts +0 -2
  214. package/dist/code-view.js +0 -2
  215. package/dist/comment-layer-CBlxJ8eK.js +0 -1113
  216. package/dist/comments-ChNJkV1d.d.ts +0 -108
  217. package/dist/comments-Cq5eewsu.d.ts +0 -537
  218. package/dist/comments.d.ts +0 -2
  219. package/dist/comments.js +0 -2
  220. package/dist/config-Bux_AJzm.d.ts +0 -29
  221. package/dist/config-bHqE4JOs.js +0 -38
  222. package/dist/connection-status.d.ts +0 -2
  223. package/dist/connection-status.js +0 -2
  224. package/dist/dark-plus-BGuiqa1B.js +0 -4
  225. package/dist/dracula-0CVA2XY5.js +0 -4
  226. package/dist/dracula-soft-Dk9bpbVU.js +0 -4
  227. package/dist/error-diagnostics-B4hMpJRL.js +0 -13
  228. package/dist/everforest-dark-CRjTbhh5.js +0 -4
  229. package/dist/everforest-light-CEeYFLn8.js +0 -4
  230. package/dist/file-diff.d.ts +0 -2
  231. package/dist/file-diff.js +0 -2
  232. package/dist/file-tree.d.ts +0 -2
  233. package/dist/file-tree.js +0 -2
  234. package/dist/file-view.d.ts +0 -2
  235. package/dist/file-view.js +0 -2
  236. package/dist/github-dark-BXgKmOw_.js +0 -4
  237. package/dist/github-dark-default-DzJQXksd.js +0 -4
  238. package/dist/github-dark-dimmed-B1pEmGtS.js +0 -4
  239. package/dist/github-dark-high-contrast-BkHIa6jc.js +0 -4
  240. package/dist/github-light-BKRlUbaB.js +0 -4
  241. package/dist/github-light-default-BU3eYkzs.js +0 -4
  242. package/dist/github-light-high-contrast-B3MumDcI.js +0 -4
  243. package/dist/gruvbox-dark-hard-B0ecF443.js +0 -4
  244. package/dist/gruvbox-dark-medium-BQnpC39k.js +0 -4
  245. package/dist/gruvbox-dark-soft-DFZUgESr.js +0 -4
  246. package/dist/gruvbox-light-hard-CuB_LOJr.js +0 -4
  247. package/dist/gruvbox-light-medium-idDHgxjs.js +0 -4
  248. package/dist/gruvbox-light-soft-CfWH49MY.js +0 -4
  249. package/dist/horizon-bright-Ba6M8QSV.js +0 -4
  250. package/dist/horizon-h92C5OlZ.js +0 -4
  251. package/dist/houston-EQnPegWq.js +0 -4
  252. package/dist/kanagawa-dragon-DgDvwi3B.js +0 -4
  253. package/dist/kanagawa-lotus-BgoQro20.js +0 -4
  254. package/dist/kanagawa-wave-DgXEowHs.js +0 -4
  255. package/dist/laserwave-IxBH_3yW.js +0 -4
  256. package/dist/light-plus-S8JBx6is.js +0 -4
  257. package/dist/markdown-BoLBN0qH.js +0 -197
  258. package/dist/markdown.d.ts +0 -2
  259. package/dist/markdown.js +0 -2
  260. package/dist/marker.d.ts +0 -2
  261. package/dist/marker.js +0 -2
  262. package/dist/material-theme-D1f3HBq-.js +0 -4
  263. package/dist/material-theme-darker-ExzYhT0j.js +0 -4
  264. package/dist/material-theme-lighter-D6gH9nnA.js +0 -4
  265. package/dist/material-theme-ocean-D1w5BPAa.js +0 -4
  266. package/dist/material-theme-palenight-CkqWmVpF.js +0 -4
  267. package/dist/message-parts.d.ts +0 -2
  268. package/dist/message-parts.js +0 -2
  269. package/dist/message.d.ts +0 -2
  270. package/dist/message.js +0 -2
  271. package/dist/min-dark-npsJH98j.js +0 -4
  272. package/dist/min-light-DUk1XsVt.js +0 -4
  273. package/dist/monokai-CfFRWUNl.js +0 -4
  274. package/dist/multi-file-diff.d.ts +0 -2
  275. package/dist/multi-file-diff.js +0 -2
  276. package/dist/night-owl-BS7V-av_.js +0 -4
  277. package/dist/night-owl-light-CZtRawYE.js +0 -4
  278. package/dist/nord-BFh54Nqz.js +0 -4
  279. package/dist/one-dark-pro-zDovGosB.js +0 -4
  280. package/dist/one-light-gmHK3iK6.js +0 -4
  281. package/dist/patch-diff.d.ts +0 -2
  282. package/dist/patch-diff.js +0 -2
  283. package/dist/plastic-DtdaCjub.js +0 -4
  284. package/dist/poimandres-Hdda6aHK.js +0 -4
  285. package/dist/primitive-rail.d.ts +0 -222
  286. package/dist/primitive-rail.js +0 -348
  287. package/dist/prompt-input.d.ts +0 -2
  288. package/dist/prompt-input.js +0 -2
  289. package/dist/red-VqZFRByZ.js +0 -4
  290. package/dist/rose-pine-DiTkEueR.js +0 -4
  291. package/dist/rose-pine-dawn-tfo5y2X0.js +0 -4
  292. package/dist/rose-pine-moon-C0gON9XN.js +0 -4
  293. package/dist/runtime-type-DlCscMfw.js +0 -59
  294. package/dist/slack-dark-v8P_eXr6.js +0 -4
  295. package/dist/slack-ochin-D8SyEdKz.js +0 -4
  296. package/dist/snazzy-light-BtkQkvXb.js +0 -4
  297. package/dist/solarized-dark-B8nAdMfM.js +0 -4
  298. package/dist/solarized-light-B-3F1INj.js +0 -4
  299. package/dist/sync-status.d.ts +0 -2
  300. package/dist/sync-status.js +0 -2
  301. package/dist/synthwave-84-DcsXCF_c.js +0 -4
  302. package/dist/tokyo-night-Bvpqduda.js +0 -4
  303. package/dist/tool-list.d.ts +0 -2
  304. package/dist/tool-list.js +0 -2
  305. package/dist/trace-run.d.ts +0 -2
  306. package/dist/trace-run.js +0 -2
  307. package/dist/trace.d.ts +0 -2
  308. package/dist/trace.js +0 -2
  309. package/dist/unresolved-file.d.ts +0 -2
  310. package/dist/unresolved-file.js +0 -2
  311. package/dist/vesper-CfxmMOy3.js +0 -4
  312. package/dist/vitesse-black-D9-_1mjV.js +0 -4
  313. package/dist/vitesse-dark-DlSMLlr9.js +0 -4
  314. package/dist/vitesse-light-KRWWWztf.js +0 -4
@@ -0,0 +1,40 @@
1
+ //#region src/internal/comment-person.ts
2
+ const displayName = (user) => user.name ?? user.id;
3
+ function toPerson(user) {
4
+ return {
5
+ id: user.id,
6
+ image: user.image,
7
+ name: displayName(user)
8
+ };
9
+ }
10
+ /**
11
+ * The name to show for who wrote it. An agent's message is the agent's, so it shows as the agent with the person it
12
+ * acts for beside it: `Claude (Ana Ruiz)`.
13
+ */
14
+ const writerName = ({ author, actor }) => actor ? `${actor.name ?? actor.id} (${displayName(author)})` : displayName(author);
15
+ /** The avatar of who wrote it: an agent's logo, never the picture of the person it acts for. */
16
+ function writerPerson(written) {
17
+ const { author, actor } = written;
18
+ if (!actor) return toPerson(author);
19
+ return {
20
+ id: `${author.id}:${actor.id}`,
21
+ image: actor.image,
22
+ name: actor.name ?? actor.id
23
+ };
24
+ }
25
+ /**
26
+ * The text of a Markdown message without its Markdown, for a preview: `**Pro**` shows as `Pro`, a link as its text, and an
27
+ * image as its alt text. Mentions are text already, so `@Ana Ruiz` stays.
28
+ */
29
+ function plainText(body) {
30
+ let text = body.replace(/\\([\\`*_{}[\]()#+\-.!>~|])/g, (_, mark) => String.fromCharCode(57344 + mark.charCodeAt(0))).replace(/^\s*(?:```|~~~).*$/gm, "").replace(/^\s*::+[\w-]*(?:\{[^}\n]*\})?\s*$/gm, "").replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/<\/?[a-z][^>]*>/gi, "").replace(/^\s{0,3}(?:#{1,6}\s+|>\s?|[-*+]\s+\[[ xX]\]\s+|[-*+]\s+|\d+[.)]\s+)/gm, "");
31
+ for (let pass = 0; pass < 3; pass++) text = text.replace(/(`+)([^`]+?)\1/g, "$2").replace(/(\*\*|~~|\*)(?=\S)(.*?\S)\1/g, "$2").replace(/(?<![\p{L}\p{N}_])(__|_)(?=\S)(.*?\S)\1(?![\p{L}\p{N}_])/gu, "$2");
32
+ return text.replace(/[\ue000-\ue07f]/g, (mark) => String.fromCharCode(mark.charCodeAt(0) - 57344)).replace(/\s+/g, " ").trim();
33
+ }
34
+ /** One line of a message for a label: Markdown marks and line breaks gone, and cut at `length`. */
35
+ function excerpt(body, length = 60) {
36
+ const line = plainText(body);
37
+ return line.length > length ? `${line.slice(0, length - 1)}…` : line;
38
+ }
39
+ //#endregion
40
+ export { writerName as a, toPerson as i, excerpt as n, writerPerson as o, plainText as r, displayName as t };
@@ -0,0 +1,68 @@
1
+ import { PropType } from "vue";
2
+ import { CommentStatus, CommentUser } from "@vite-hub/comments/client";
3
+ //#region src/components/comment-pin.d.ts
4
+ declare const CommentPin: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
5
+ /** The thread number. A draft has none. */
6
+ n: {
7
+ type: NumberConstructor;
8
+ };
9
+ author: {
10
+ type: PropType<CommentUser>;
11
+ };
12
+ status: {
13
+ default: string;
14
+ type: PropType<CommentStatus>;
15
+ };
16
+ /** A short piece of the comment. It is part of the label that a screen reader says. */
17
+ excerpt: {
18
+ type: StringConstructor;
19
+ };
20
+ /** The thread of this pin is open. */
21
+ active: {
22
+ default: boolean;
23
+ type: BooleanConstructor;
24
+ };
25
+ /** The comment is still being written. */
26
+ draft: {
27
+ default: boolean;
28
+ type: BooleanConstructor;
29
+ };
30
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
31
+ [key: string]: any;
32
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "hover" | "leave")[], "select" | "hover" | "leave", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
33
+ /** The thread number. A draft has none. */
34
+ n: {
35
+ type: NumberConstructor;
36
+ };
37
+ author: {
38
+ type: PropType<CommentUser>;
39
+ };
40
+ status: {
41
+ default: string;
42
+ type: PropType<CommentStatus>;
43
+ };
44
+ /** A short piece of the comment. It is part of the label that a screen reader says. */
45
+ excerpt: {
46
+ type: StringConstructor;
47
+ };
48
+ /** The thread of this pin is open. */
49
+ active: {
50
+ default: boolean;
51
+ type: BooleanConstructor;
52
+ };
53
+ /** The comment is still being written. */
54
+ draft: {
55
+ default: boolean;
56
+ type: BooleanConstructor;
57
+ };
58
+ }>> & Readonly<{
59
+ onSelect?: ((...args: any[]) => any) | undefined;
60
+ onHover?: ((...args: any[]) => any) | undefined;
61
+ onLeave?: ((...args: any[]) => any) | undefined;
62
+ }>, {
63
+ status: CommentStatus;
64
+ active: boolean;
65
+ draft: boolean;
66
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
67
+ //#endregion
68
+ export { CommentPin as t };
@@ -0,0 +1,39 @@
1
+ import { AvatarStack } from "./parts/components/avatar-stack.js";
2
+ import { a as writerName, o as writerPerson, r as plainText } from "./comment-person-CLPlW_SS.js";
3
+ import { t as RelativeTime } from "./relative-time-BVmjOsYG.js";
4
+ import { h } from "vue";
5
+ //#region src/internal/comment-row.ts
6
+ /** The start of a thread as plain text: its first message, else the text that it is about. */
7
+ function threadPreview(thread) {
8
+ const text = thread.anchor.kind === "text" ? thread.anchor.exact : "";
9
+ return plainText(thread.messages[0]?.body ?? "") || text;
10
+ }
11
+ /** The scope of the `row` and `preview` slots for one thread: `CommentRowSlotScope`. */
12
+ function rowSlotScope(thread) {
13
+ return {
14
+ thread,
15
+ text: threadPreview(thread)
16
+ };
17
+ }
18
+ /** The inside of one row of a thread list: its number, author, start, and facts. `CommentList` and `CommentPanel` use it. */
19
+ function threadRow(thread, options = {}) {
20
+ const replies = thread.messages.length - 1;
21
+ return [
22
+ h("span", { "data-slot": "comment-list-number" }, thread.n ? String(thread.n) : ""),
23
+ h(AvatarStack, {
24
+ "aria-hidden": "true",
25
+ people: [writerPerson(thread)],
26
+ size: "sm"
27
+ }),
28
+ h("span", { "data-slot": "comment-list-body" }, [h("span", { "data-slot": "comment-list-text" }, options.preview ?? threadPreview(thread)), h("span", { "data-slot": "comment-list-meta" }, [
29
+ h("span", writerName(thread)),
30
+ h(RelativeTime, { at: thread.updatedAt }),
31
+ replies > 0 ? h("span", `${replies} ${replies === 1 ? "reply" : "replies"}`) : null,
32
+ thread.status === "resolved" ? h("span", "Resolved") : null,
33
+ options.detached ? h("span", { "data-slot": "comment-list-detached" }, "Detached") : null,
34
+ options.site && thread.subject.kind === "page" ? h("span", thread.subject.id) : null
35
+ ])])
36
+ ];
37
+ }
38
+ //#endregion
39
+ export { threadRow as n, rowSlotScope as t };
@@ -0,0 +1,42 @@
1
+ import { PropType, VNode } from "vue";
2
+ //#region src/components/comment-selection-bar.d.ts
3
+ /** The side of the selected text that the bar sits on. */
4
+ type CommentSelectionBarSide = "top" | "bottom";
5
+ /**
6
+ * The bar over selected text: Comment, and Suggest when the page takes suggested changes. It is the dark surface on a
7
+ * light page and its light twin on a dark one, so it stands out from the text. The page places it and listens for the
8
+ * keys. A press on the bar keeps the selection on the page.
9
+ */
10
+ declare const CommentSelectionBar: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
11
+ /** Show Suggest (E), for a page that takes suggested changes. */
12
+ suggest: {
13
+ default: boolean;
14
+ type: BooleanConstructor;
15
+ };
16
+ /** The side of the text that the bar is on. The bar grows from that side, and its tooltips open away from the text. */
17
+ side: {
18
+ default: string;
19
+ type: PropType<CommentSelectionBarSide>;
20
+ };
21
+ }>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
22
+ [key: string]: any;
23
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("comment" | "suggest")[], "comment" | "suggest", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
24
+ /** Show Suggest (E), for a page that takes suggested changes. */
25
+ suggest: {
26
+ default: boolean;
27
+ type: BooleanConstructor;
28
+ };
29
+ /** The side of the text that the bar is on. The bar grows from that side, and its tooltips open away from the text. */
30
+ side: {
31
+ default: string;
32
+ type: PropType<CommentSelectionBarSide>;
33
+ };
34
+ }>> & Readonly<{
35
+ onComment?: ((...args: any[]) => any) | undefined;
36
+ onSuggest?: ((...args: any[]) => any) | undefined;
37
+ }>, {
38
+ side: CommentSelectionBarSide;
39
+ suggest: boolean;
40
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
41
+ //#endregion
42
+ export { CommentSelectionBarSide as n, CommentSelectionBar as t };
@@ -0,0 +1,385 @@
1
+ import { i as CommentComposerSlots, r as CommentComposerSize } from "./comment-composer-fINL5bxo.js";
2
+ import { t as CommentCan } from "./comments-D8hulVPy.js";
3
+ import { PropType, SlotsType, VNode } from "vue";
4
+ import { CommentDelivery, CommentMessage, CommentThread, CommentUser } from "@vite-hub/comments/client";
5
+ //#region src/internal/comment-status.d.ts
6
+ /** The messages written after the thread was resolved. Empty for an open thread. */
7
+ declare function messagesSinceResolved(thread: Pick<CommentThread, "status" | "resolvedAt" | "messages">): CommentMessage[];
8
+ /**
9
+ * Whether someone replied after the thread was resolved, such as an agent that says what it changed. The thread stays
10
+ * resolved, and lists show it with the open threads until someone resolves it again.
11
+ */
12
+ declare const repliedSinceResolved: (thread: Pick<CommentThread, "status" | "resolvedAt" | "messages">) => boolean;
13
+ //#endregion
14
+ //#region src/components/comment-thread.d.ts
15
+ type Done = Promise<unknown> | void;
16
+ /** An attachment as `attachmentUrl` describes it: its URL, and the file name and media type when the key does not say. */
17
+ interface CommentAttachmentLink {
18
+ url: string;
19
+ name?: string;
20
+ /** The media type, such as `image/png`. An `image/*` attachment shows as an image. */
21
+ type?: string;
22
+ }
23
+ /**
24
+ * Gives the URL of an attachment key, such as a Blob key, or the URL with its name and media type. `undefined` shows the
25
+ * key as a file without a link. An image shows as a thumbnail that opens full size.
26
+ */
27
+ type CommentAttachmentUrl = (key: string) => string | CommentAttachmentLink | undefined;
28
+ /** The scope of the `body` and `attachments` slots of `CommentReply`. */
29
+ interface CommentReplySlotScope {
30
+ message: CommentMessage;
31
+ }
32
+ /** The scope of the `status` slot: a message that the outbox holds, and what the reader can do with it. */
33
+ interface CommentStatusSlotScope {
34
+ message: CommentMessage;
35
+ /** `pending` while it waits or goes out, `failed` when the server refused it, with `error` saying why. */
36
+ delivery: CommentDelivery;
37
+ /** Sends it again now. Only available with edit permission. */
38
+ retry?: () => Promise<void>;
39
+ /** Throws it away. Only available with delete permission. `false` while it is on its way. */
40
+ dismiss?: () => Promise<boolean>;
41
+ /** Changes its text. Only available with edit permission. A refused one goes back in the queue. */
42
+ edit?: (body: string, mentions?: string[]) => Promise<boolean>;
43
+ }
44
+ type CommentReplySlots = {
45
+ /** The text of the message. Replaces the Markdown body with its mention chips. */
46
+ body?: (scope: CommentReplySlotScope) => VNode[];
47
+ /** The attachments of the message. Replaces the default thumbnails. */
48
+ attachments?: (scope: CommentReplySlotScope) => VNode[];
49
+ /**
50
+ * Below a message that has not reached the server, such as "Waiting to send" or a refusal with Retry and Discard.
51
+ * Nothing shows without it. The message also gets `data-pending` or `data-failed`.
52
+ */
53
+ status?: (scope: CommentStatusSlotScope) => VNode[];
54
+ };
55
+ /** The scope of the `actions`, `anchor`, and `after` slots of `CommentThread`. */
56
+ interface CommentThreadSlotScope {
57
+ thread: CommentThread;
58
+ }
59
+ type CommentThreadSlots = CommentReplySlots & CommentComposerSlots & {
60
+ /** More buttons in the header, before Resolve. */
61
+ actions?: (scope: CommentThreadSlotScope) => VNode[];
62
+ /** What the thread is about. Replaces the default quote of the selected text. */
63
+ anchor?: (scope: CommentThreadSlotScope) => VNode[];
64
+ /** Below the messages and above the reply box. */
65
+ after?: (scope: CommentThreadSlotScope) => VNode[];
66
+ };
67
+ declare const CommentReply: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
68
+ message: {
69
+ required: true;
70
+ type: PropType<CommentMessage>;
71
+ };
72
+ /** The signed-in user. A mention of them looks different. Defaults to the user of the comments state. */
73
+ user: {
74
+ type: PropType<CommentUser>;
75
+ };
76
+ /** The signed-in user may edit this message. */
77
+ editable: {
78
+ default: boolean;
79
+ type: BooleanConstructor;
80
+ };
81
+ /** The signed-in user may delete this message. Defaults to `editable`. */
82
+ deletable: {
83
+ default: undefined;
84
+ type: BooleanConstructor;
85
+ };
86
+ /** The message, and its author, show in one line without actions. */
87
+ compact: {
88
+ default: boolean;
89
+ type: BooleanConstructor;
90
+ };
91
+ /** Deleting asks first. Deleting the first message of a thread deletes the whole thread, so a thread sets it there. */
92
+ confirmDelete: {
93
+ default: boolean;
94
+ type: BooleanConstructor;
95
+ };
96
+ /** `sm` sets 14px text and shows Edit and Delete over the end of the name's row. The edit box gets the same size. */
97
+ size: {
98
+ default: string;
99
+ type: PropType<CommentComposerSize>;
100
+ };
101
+ /** People whose `@name` the message may hold, so an edit keeps their mentions and the body marks them. */
102
+ people: {
103
+ default: () => never[];
104
+ type: PropType<CommentUser[]>;
105
+ };
106
+ users: {
107
+ type: PropType<(query: string) => Promise<CommentUser[]>>;
108
+ };
109
+ /** Gives the URL of an attachment key. With it, image attachments show as thumbnails. */
110
+ attachmentUrl: {
111
+ type: PropType<CommentAttachmentUrl>;
112
+ };
113
+ /** Saves an edit. Gets `(messageId, body, mentions)`. */
114
+ onEdit: {
115
+ type: PropType<(messageId: string, body: string, mentions: string[]) => Done>;
116
+ };
117
+ /** Deletes the message. Gets `(messageId)`. */
118
+ onDelete: {
119
+ type: PropType<(messageId: string) => Done>;
120
+ };
121
+ }>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
122
+ [key: string]: any;
123
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
124
+ message: {
125
+ required: true;
126
+ type: PropType<CommentMessage>;
127
+ };
128
+ /** The signed-in user. A mention of them looks different. Defaults to the user of the comments state. */
129
+ user: {
130
+ type: PropType<CommentUser>;
131
+ };
132
+ /** The signed-in user may edit this message. */
133
+ editable: {
134
+ default: boolean;
135
+ type: BooleanConstructor;
136
+ };
137
+ /** The signed-in user may delete this message. Defaults to `editable`. */
138
+ deletable: {
139
+ default: undefined;
140
+ type: BooleanConstructor;
141
+ };
142
+ /** The message, and its author, show in one line without actions. */
143
+ compact: {
144
+ default: boolean;
145
+ type: BooleanConstructor;
146
+ };
147
+ /** Deleting asks first. Deleting the first message of a thread deletes the whole thread, so a thread sets it there. */
148
+ confirmDelete: {
149
+ default: boolean;
150
+ type: BooleanConstructor;
151
+ };
152
+ /** `sm` sets 14px text and shows Edit and Delete over the end of the name's row. The edit box gets the same size. */
153
+ size: {
154
+ default: string;
155
+ type: PropType<CommentComposerSize>;
156
+ };
157
+ /** People whose `@name` the message may hold, so an edit keeps their mentions and the body marks them. */
158
+ people: {
159
+ default: () => never[];
160
+ type: PropType<CommentUser[]>;
161
+ };
162
+ users: {
163
+ type: PropType<(query: string) => Promise<CommentUser[]>>;
164
+ };
165
+ /** Gives the URL of an attachment key. With it, image attachments show as thumbnails. */
166
+ attachmentUrl: {
167
+ type: PropType<CommentAttachmentUrl>;
168
+ };
169
+ /** Saves an edit. Gets `(messageId, body, mentions)`. */
170
+ onEdit: {
171
+ type: PropType<(messageId: string, body: string, mentions: string[]) => Done>;
172
+ };
173
+ /** Deletes the message. Gets `(messageId)`. */
174
+ onDelete: {
175
+ type: PropType<(messageId: string) => Done>;
176
+ };
177
+ }>> & Readonly<{}>, {
178
+ size: CommentComposerSize;
179
+ compact: boolean;
180
+ people: CommentUser[];
181
+ editable: boolean;
182
+ deletable: boolean;
183
+ confirmDelete: boolean;
184
+ }, SlotsType<CommentReplySlots & Pick<CommentComposerSlots, "mention-item" | "mention-empty">>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
185
+ declare const CommentThread$1: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
186
+ thread: {
187
+ required: true;
188
+ type: PropType<CommentThread>;
189
+ };
190
+ /** The signed-in user. Their messages can be edited and deleted. */
191
+ user: {
192
+ type: PropType<CommentUser>;
193
+ };
194
+ /** A read-only card for hovering a pin. */
195
+ preview: {
196
+ default: boolean;
197
+ type: BooleanConstructor;
198
+ };
199
+ /** Keep the full thread readable without reply, edit, delete, or status controls. */
200
+ readOnly: {
201
+ default: boolean;
202
+ type: BooleanConstructor;
203
+ };
204
+ /** What the signed-in user may do: reply, resolve, edit, or delete. Defaults to the `can` of the comments state. */
205
+ can: {
206
+ type: PropType<CommentCan>;
207
+ };
208
+ /** Show a reply as being sent, on top of the thread's own tracking. */
209
+ busy: {
210
+ default: boolean;
211
+ type: BooleanConstructor;
212
+ };
213
+ /** An error to show, on top of the ones from the handlers. */
214
+ error: {
215
+ type: StringConstructor;
216
+ };
217
+ /** The thread is no longer on the page, so no pin shows where it was. */
218
+ detached: {
219
+ default: boolean;
220
+ type: BooleanConstructor;
221
+ };
222
+ /** People that messages may mention, on top of the authors of the thread. Their mentions show as chips. */
223
+ people: {
224
+ default: () => never[];
225
+ type: PropType<CommentUser[]>;
226
+ };
227
+ /** Finds people for `@mentions`. Defaults to the comments state, searching the people who may be mentioned in this thread. */
228
+ users: {
229
+ type: PropType<(query: string) => Promise<CommentUser[]>>;
230
+ };
231
+ /** The reply box takes files. `onReply` gets them. */
232
+ attachments: {
233
+ default: boolean;
234
+ type: BooleanConstructor;
235
+ };
236
+ /** The file types that the reply box takes, such as `image/*`. */
237
+ accept: {
238
+ type: StringConstructor;
239
+ };
240
+ /** Gives the URL of an attachment key. With it, image attachments show as thumbnails. */
241
+ attachmentUrl: {
242
+ type: PropType<CommentAttachmentUrl>;
243
+ };
244
+ /** `"back"` shows a Back button at the start of the header instead of Close, for a thread inside a list. Both emit `close`. */
245
+ navigation: {
246
+ default: string;
247
+ type: PropType<"close" | "back">;
248
+ };
249
+ /** A click outside the thread closes it. Turn it off when the thread is part of a panel. */
250
+ dismissible: {
251
+ default: boolean;
252
+ type: BooleanConstructor;
253
+ };
254
+ /** `sm` is a compact thread for a small floating card: 14px text, tighter rows, and a compact reply box. */
255
+ size: {
256
+ default: string;
257
+ type: PropType<CommentComposerSize>;
258
+ };
259
+ /** Sends a reply. Gets `(body, mentions, files)`. */
260
+ onReply: {
261
+ type: PropType<(body: string, mentions: string[], files: File[]) => Done>;
262
+ };
263
+ /** Saves an edited message. Gets `(messageId, body, mentions)`. */
264
+ onEdit: {
265
+ type: PropType<(messageId: string, body: string, mentions: string[]) => Done>;
266
+ };
267
+ /** Deletes a message. Gets `(messageId)`. Deleting the first message deletes the thread. */
268
+ onDelete: {
269
+ type: PropType<(messageId: string) => Done>;
270
+ };
271
+ onResolve: {
272
+ type: PropType<() => Done>;
273
+ };
274
+ onReopen: {
275
+ type: PropType<() => Done>;
276
+ };
277
+ }>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
278
+ [key: string]: any;
279
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "close"[], "close", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
280
+ thread: {
281
+ required: true;
282
+ type: PropType<CommentThread>;
283
+ };
284
+ /** The signed-in user. Their messages can be edited and deleted. */
285
+ user: {
286
+ type: PropType<CommentUser>;
287
+ };
288
+ /** A read-only card for hovering a pin. */
289
+ preview: {
290
+ default: boolean;
291
+ type: BooleanConstructor;
292
+ };
293
+ /** Keep the full thread readable without reply, edit, delete, or status controls. */
294
+ readOnly: {
295
+ default: boolean;
296
+ type: BooleanConstructor;
297
+ };
298
+ /** What the signed-in user may do: reply, resolve, edit, or delete. Defaults to the `can` of the comments state. */
299
+ can: {
300
+ type: PropType<CommentCan>;
301
+ };
302
+ /** Show a reply as being sent, on top of the thread's own tracking. */
303
+ busy: {
304
+ default: boolean;
305
+ type: BooleanConstructor;
306
+ };
307
+ /** An error to show, on top of the ones from the handlers. */
308
+ error: {
309
+ type: StringConstructor;
310
+ };
311
+ /** The thread is no longer on the page, so no pin shows where it was. */
312
+ detached: {
313
+ default: boolean;
314
+ type: BooleanConstructor;
315
+ };
316
+ /** People that messages may mention, on top of the authors of the thread. Their mentions show as chips. */
317
+ people: {
318
+ default: () => never[];
319
+ type: PropType<CommentUser[]>;
320
+ };
321
+ /** Finds people for `@mentions`. Defaults to the comments state, searching the people who may be mentioned in this thread. */
322
+ users: {
323
+ type: PropType<(query: string) => Promise<CommentUser[]>>;
324
+ };
325
+ /** The reply box takes files. `onReply` gets them. */
326
+ attachments: {
327
+ default: boolean;
328
+ type: BooleanConstructor;
329
+ };
330
+ /** The file types that the reply box takes, such as `image/*`. */
331
+ accept: {
332
+ type: StringConstructor;
333
+ };
334
+ /** Gives the URL of an attachment key. With it, image attachments show as thumbnails. */
335
+ attachmentUrl: {
336
+ type: PropType<CommentAttachmentUrl>;
337
+ };
338
+ /** `"back"` shows a Back button at the start of the header instead of Close, for a thread inside a list. Both emit `close`. */
339
+ navigation: {
340
+ default: string;
341
+ type: PropType<"close" | "back">;
342
+ };
343
+ /** A click outside the thread closes it. Turn it off when the thread is part of a panel. */
344
+ dismissible: {
345
+ default: boolean;
346
+ type: BooleanConstructor;
347
+ };
348
+ /** `sm` is a compact thread for a small floating card: 14px text, tighter rows, and a compact reply box. */
349
+ size: {
350
+ default: string;
351
+ type: PropType<CommentComposerSize>;
352
+ };
353
+ /** Sends a reply. Gets `(body, mentions, files)`. */
354
+ onReply: {
355
+ type: PropType<(body: string, mentions: string[], files: File[]) => Done>;
356
+ };
357
+ /** Saves an edited message. Gets `(messageId, body, mentions)`. */
358
+ onEdit: {
359
+ type: PropType<(messageId: string, body: string, mentions: string[]) => Done>;
360
+ };
361
+ /** Deletes a message. Gets `(messageId)`. Deleting the first message deletes the thread. */
362
+ onDelete: {
363
+ type: PropType<(messageId: string) => Done>;
364
+ };
365
+ onResolve: {
366
+ type: PropType<() => Done>;
367
+ };
368
+ onReopen: {
369
+ type: PropType<() => Done>;
370
+ };
371
+ }>> & Readonly<{
372
+ onClose?: ((...args: any[]) => any) | undefined;
373
+ }>, {
374
+ size: CommentComposerSize;
375
+ people: CommentUser[];
376
+ readOnly: boolean;
377
+ preview: boolean;
378
+ busy: boolean;
379
+ detached: boolean;
380
+ attachments: boolean;
381
+ navigation: "close" | "back";
382
+ dismissible: boolean;
383
+ }, SlotsType<CommentThreadSlots>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
384
+ //#endregion
385
+ export { CommentReplySlots as a, CommentThreadSlotScope as c, repliedSinceResolved as d, CommentReplySlotScope as i, CommentThreadSlots as l, CommentAttachmentUrl as n, CommentStatusSlotScope as o, CommentReply as r, CommentThread$1 as s, CommentAttachmentLink as t, messagesSinceResolved as u };
@@ -0,0 +1,40 @@
1
+ //#region src/headless/comment-visibility.d.ts
2
+ /** `"all"` shows every comment on the page. `"hidden"` shows only the open thread, the draft, and a comment just sent. */
3
+ type CommentVisibility = "all" | "hidden";
4
+ interface CommentVisibilityOptions {
5
+ /** The first value, such as one the reader saved. Default `"all"`. */
6
+ visibility?: CommentVisibility;
7
+ /** How long a comment or reply that was just sent shows while comments are hidden. The time waits while the reader is on it. Default `2500`. */
8
+ flashMs?: number;
9
+ }
10
+ /**
11
+ * Which comments show on the page, with no framework. `useComments()` keeps one, and a page that draws its marks
12
+ * somewhere else, such as in a frame, can keep its own and send `only` there.
13
+ */
14
+ interface CommentVisibilityModel {
15
+ readonly visibility: CommentVisibility;
16
+ /** The ids that still show while comments are hidden: the open thread, then each one that was just sent. Empty while all show. */
17
+ readonly only: readonly string[];
18
+ /** The ids that stopped showing while comments are hidden, for `commentLeaveMs`. Their marks play the pop-out in that time. */
19
+ readonly leaving: readonly string[];
20
+ set: (visibility: CommentVisibility) => void;
21
+ /** The thread that is open. It shows while comments are hidden. */
22
+ open: (id: string | null) => void;
23
+ /** Shows the thread for `flashMs` while comments are hidden. It does nothing while all show. */
24
+ flash: (id: string) => void;
25
+ /**
26
+ * The thread the reader points at or focuses, such as its pin. `hover(null)` when the reader leaves. Like a toast, its
27
+ * flash time stops while the reader is on it, and the rest of the time runs after.
28
+ */
29
+ hover: (id: string | null) => void;
30
+ isShown: (id: string) => boolean;
31
+ /** Calls `listener` after each change. Returns a function that stops it. */
32
+ subscribe: (listener: () => void) => () => void;
33
+ /** Clears the timers. Listeners stay until their own stop function. */
34
+ stop: () => void;
35
+ }
36
+ /** How long a mark that stops showing stays, for its pop-out. The styles of the parts use the same time. */
37
+ declare const commentLeaveMs = 130;
38
+ declare function createCommentVisibility(options?: CommentVisibilityOptions): CommentVisibilityModel;
39
+ //#endregion
40
+ export { createCommentVisibility as a, commentLeaveMs as i, CommentVisibilityModel as n, CommentVisibilityOptions as r, CommentVisibility as t };