@vite-hub/ui 0.6.0 → 0.7.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 (325) 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-BZxkf3Tt.js +112 -0
  5. package/dist/ChatMessage-Blr5F-zi.js +94 -0
  6. package/dist/CodeBlockContent-BjXJm8lO.js +92 -0
  7. package/dist/CodeBlockTitle-DYrYpc1U.js +99 -0
  8. package/dist/CommentRow-ViZ7r8nr.js +86 -0
  9. package/dist/CopyButton-Dtg_Oc9_.js +115 -0
  10. package/dist/Markdown-_w7feFzl.js +70 -0
  11. package/dist/MarkdownCodeBlock-B4j7x0H6.js +127 -0
  12. package/dist/MarkdownImage-CJN3myt4.js +111 -0
  13. package/dist/MessageHeader-CJ9eBHSS.js +61 -0
  14. package/dist/MessageParts-FVyYZNsn.js +57 -0
  15. package/dist/MessageScrollerViewport-BaTlWLki.js +142 -0
  16. package/dist/MorphText-CYTndbyp.js +36 -0
  17. package/dist/RollNumber-Bo2tzfAp.js +49 -0
  18. package/dist/TraceTitle-Cp0y7RRD.js +133 -0
  19. package/dist/agent-session-BwZSMi4S.d.ts +312 -0
  20. package/dist/agent-session-DhlTKCQG.js +875 -0
  21. package/dist/{announce-B0DLwflT.js → announce-CJNXaYbT.js} +1 -3
  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-nQErr0qn.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-hjZRL6jY.js +43 -0
  33. package/dist/choices-input-DqgXl5a-.d.ts +97 -0
  34. package/dist/client-BG-oCUtv-5i4sRwXP.js +6587 -0
  35. package/dist/code-block-Bp8y-XJp.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/{colors-BghReA9C-DEq4bhEP.js → colors-BghReA9C-A4M9YE0s.js} +1 -1
  40. package/dist/{comment-composer-BP-CJx7f.js → comment-composer-BUt6vbnr.js} +176 -38
  41. package/dist/{comment-composer-BI6CNJyO.d.ts → comment-composer-CIsbz-78.d.ts} +7 -7
  42. package/dist/comment-layer-BlVNORgj.d.ts +139 -0
  43. package/dist/comment-layer-Ck2H24oJ.js +1206 -0
  44. package/dist/comment-panel-Djx-KxVa.d.ts +173 -0
  45. package/dist/comment-selection-bar-CbOEI98x.d.ts +33 -0
  46. package/dist/comment-selection-bar-CxPkJxVl.js +145 -0
  47. package/dist/comment-send.css +2 -2
  48. package/dist/{comment-thread-5h93DXds.js → comment-thread-C_Q4UDaV.js} +78 -53
  49. package/dist/{comment-thread-DSkWODKG.d.ts → comment-thread-X6gYMNay.d.ts} +11 -14
  50. package/dist/comments-B1itauwb.d.ts +52 -0
  51. package/dist/{comments-D9dONfs9.js → comments-BaSrroRV.js} +65 -44
  52. package/dist/comments-BtD28xEn.js +390 -0
  53. package/dist/{comments-CnG_c-_c.d.ts → comments-ZfV6IZs8.d.ts} +15 -7
  54. package/dist/{comments-context-CrjhleVA.js → comments-context-3js2YFl2.js} +2 -2
  55. package/dist/components-CM5mZe0a.js +269 -0
  56. package/dist/{config-BDvnaVUn.js → config-CFwvNt4Y.js} +16 -29
  57. package/dist/{config-xL4EBeXw.d.ts → config-JmsTI7gs.d.ts} +21 -33
  58. package/dist/connection-status-BVSH2ZVo.js +72 -0
  59. package/dist/connection-status-g62BTn44.d.ts +37 -0
  60. package/dist/copy-button-CRiXUFsl.d.ts +17 -0
  61. package/dist/device-frame-BW6IjB6P.d.ts +78 -0
  62. package/dist/device-frame-DDWoyB-G.js +515 -0
  63. package/dist/diffs-BTKaVnsb.d.ts +272 -0
  64. package/dist/diffs.d.ts +3 -0
  65. package/dist/{pierre-code-view-C49BVDrc.js → diffs.js} +147 -4223
  66. package/dist/{draw-DzSmD7uo-Cb7s9kxJ.js → draw-DzSmD7uo-BvtKi0oE.js} +2 -2
  67. package/dist/drop-field-C0bXv1J-.d.ts +35 -0
  68. package/dist/drop-field-DKpYQ3tO.js +77 -0
  69. package/dist/editor-BsOTjnnN.d.ts +540 -0
  70. package/dist/{markdown-editor-3gY9MLvy.js → editor-DJPUs1nt.js} +877 -116
  71. package/dist/editor.d.ts +2 -0
  72. package/dist/editor.js +3 -0
  73. package/dist/element-BpjNQvZ0.js +6 -0
  74. package/dist/{file-tree-CRFIdtzw.js → file-tree-B4JKbp4r.js} +19 -18
  75. package/dist/{file-tree-DOtkeBaq.d.ts → file-tree-BdnKA6UA.d.ts} +33 -8
  76. package/dist/file-tree-DDSIafDn.d.ts +22 -0
  77. package/dist/file-tree-DS5shGSL.js +46 -0
  78. package/dist/file-tree.d.ts +2 -0
  79. package/dist/file-tree.js +1 -0
  80. package/dist/files-cuVXzWlx.js +30 -0
  81. package/dist/filter-search-C9e6sGij.d.ts +28 -0
  82. package/dist/filter-search-COZsoRiR.js +73 -0
  83. package/dist/formatCSSVariablePrefix-DLS1Ed1_.js +5 -0
  84. package/dist/headless-2IcUWHMq.d.ts +51 -0
  85. package/dist/headless.d.ts +7 -4
  86. package/dist/headless.js +5 -3
  87. package/dist/highlight.d.ts +2 -0
  88. package/dist/highlight.js +1 -0
  89. package/dist/{highlights-C2AbEdDI.js → highlights-8Al0-h-v.js} +3 -2
  90. package/dist/{hold-to-delete-BSMrpE-i.d.ts → hold-to-delete-CQc1JaG_.d.ts} +7 -0
  91. package/dist/{hold-to-delete-Cludb56v.js → hold-to-delete-CcQbfiQx.js} +111 -20
  92. package/dist/hold-to-delete-cOPqQ9FJ.js +85 -0
  93. package/dist/hold-to-delete-ksBE7wxc.d.ts +58 -0
  94. package/dist/index-9Z6Gwtnf.d.ts +77 -0
  95. package/dist/{index-B2cbt3py.d.ts → index-D3-uYBqH.d.ts} +1 -1
  96. package/dist/index.d.ts +165 -52
  97. package/dist/index.js +127 -670
  98. package/dist/markdown-BLALLOc0.d.ts +45 -0
  99. package/dist/{markdown-renderer-BgsmNqv7.js → markdown-DDyOdYq_.js} +13044 -12356
  100. package/dist/{parts/components/markdown-renderer.d.ts → markdown-DkDxdpMU.d.ts} +10 -7
  101. package/dist/markdown-editor.d.ts +51 -98
  102. package/dist/markdown-editor.js +70 -3
  103. package/dist/markdown.d.ts +2 -0
  104. package/dist/markdown.js +1 -0
  105. package/dist/marker-CvcWZ3Zp.d.ts +59 -0
  106. package/dist/marker-DNL6QR3L.js +63 -0
  107. package/dist/message-BwivYIEl.js +13 -0
  108. package/dist/message-DEq4K5cQ.d.ts +72 -0
  109. package/dist/message-parts-B1BZFVKe.d.ts +3 -0
  110. package/dist/message-parts-CG3gNWn8.d.ts +11 -0
  111. package/dist/message-parts.d.ts +2 -0
  112. package/dist/message-parts.js +1 -0
  113. package/dist/message-scroller-D7AvM31v.d.ts +41 -0
  114. package/dist/motion/core.d.ts +4 -4
  115. package/dist/motion/core.js +5 -11
  116. package/dist/motion-BH6ShUam.d.ts +12 -0
  117. package/dist/{effects-DEoFFycD.js → motion-core-BdTfxAhY.js} +1779 -55
  118. package/dist/{motion-core-DNl7TR1T.d.ts → motion-core-BfIefToe.d.ts} +32 -74
  119. package/dist/motion-dPwxx3Wk.js +76 -0
  120. package/dist/{install-qNaj4OY4.js → motion-itHFtXwA.js} +1 -1
  121. package/dist/motion-list-BBbz93WT.js +49 -0
  122. package/dist/motion.d.ts +5 -14
  123. package/dist/motion.js +6 -13
  124. package/dist/nuxt-ui-CPdiTwwD.js +22 -0
  125. package/dist/nuxt.d.ts +9 -5
  126. package/dist/nuxt.js +28 -32
  127. package/dist/parts/components/agent-session.d.ts +2 -252
  128. package/dist/parts/components/agent-session.js +1 -639
  129. package/dist/parts/components/attachment.d.ts +2 -85
  130. package/dist/parts/components/attachment.js +3 -72
  131. package/dist/parts/components/avatar-stack.d.ts +3 -2
  132. package/dist/parts/components/avatar-stack.js +1 -60
  133. package/dist/parts/components/bubble.d.ts +2 -69
  134. package/dist/parts/components/bubble.js +3 -52
  135. package/dist/parts/components/chat-message.d.ts +3 -25
  136. package/dist/parts/components/chat-message.js +1 -50
  137. package/dist/parts/components/chat-session.d.ts +2 -26
  138. package/dist/parts/components/chat-session.js +1 -37
  139. package/dist/parts/components/chat.d.ts +3 -52
  140. package/dist/parts/components/chat.js +1 -105
  141. package/dist/parts/components/code-block.d.ts +2 -102
  142. package/dist/parts/components/code-block.js +4 -109
  143. package/dist/parts/components/code-view.d.ts +3 -268
  144. package/dist/parts/components/code-view.js +1 -1
  145. package/dist/parts/components/comment-composer.d.ts +1 -1
  146. package/dist/parts/components/comment-composer.js +1 -1
  147. package/dist/parts/components/comment-layer.d.ts +1 -1
  148. package/dist/parts/components/comment-layer.js +1 -645
  149. package/dist/parts/components/comment-panel.d.ts +2 -2
  150. package/dist/parts/components/comment-panel.js +49 -40
  151. package/dist/parts/components/comment-selection-bar.d.ts +2 -2
  152. package/dist/parts/components/comment-selection-bar.js +1 -116
  153. package/dist/parts/components/comment-thread.d.ts +2 -2
  154. package/dist/parts/components/comment-thread.js +1 -3
  155. package/dist/parts/components/comments.d.ts +8 -9
  156. package/dist/parts/components/comments.js +6 -9
  157. package/dist/parts/components/connection-status.d.ts +2 -36
  158. package/dist/parts/components/connection-status.js +1 -64
  159. package/dist/parts/components/copy-button.d.ts +3 -126
  160. package/dist/parts/components/copy-button.js +3 -226
  161. package/dist/parts/components/device-frame.d.ts +2 -128
  162. package/dist/parts/components/device-frame.js +1 -470
  163. package/dist/parts/components/drop-field.d.ts +2 -67
  164. package/dist/parts/components/drop-field.js +1 -76
  165. package/dist/parts/components/file-tree.d.ts +3 -2
  166. package/dist/parts/components/file-tree.js +3 -1
  167. package/dist/parts/components/filter-search.d.ts +2 -45
  168. package/dist/parts/components/filter-search.js +1 -57
  169. package/dist/parts/components/hold-to-delete.d.ts +2 -80
  170. package/dist/parts/components/hold-to-delete.js +1 -75
  171. package/dist/parts/components/markdown.d.ts +3 -45
  172. package/dist/parts/components/markdown.js +1 -46
  173. package/dist/parts/components/marker.d.ts +2 -32
  174. package/dist/parts/components/marker.js +1 -22
  175. package/dist/parts/components/message-parts.d.ts +3 -25
  176. package/dist/parts/components/message-parts.js +1 -45
  177. package/dist/parts/components/message.d.ts +2 -32
  178. package/dist/parts/components/message.js +3 -22
  179. package/dist/parts/components/motion-list.d.ts +2 -40
  180. package/dist/parts/components/motion-list.js +1 -41
  181. package/dist/parts/components/motion.d.ts +5 -118
  182. package/dist/parts/components/motion.js +4 -171
  183. package/dist/parts/components/patch-parsers.d.ts +1 -1
  184. package/dist/parts/components/progress.d.ts +2 -39
  185. package/dist/parts/components/progress.js +1 -53
  186. package/dist/parts/components/prompt-input.d.ts +2 -134
  187. package/dist/parts/components/prompt-input.js +1 -253
  188. package/dist/parts/components/relative-time.d.ts +2 -71
  189. package/dist/parts/components/relative-time.js +1 -1
  190. package/dist/parts/components/status.d.ts +2 -58
  191. package/dist/parts/components/status.js +1 -47
  192. package/dist/parts/components/sync-status.d.ts +2 -22
  193. package/dist/parts/components/sync-status.js +1 -48
  194. package/dist/parts/components/tool-list.d.ts +2 -28
  195. package/dist/parts/components/tool-list.js +1 -118
  196. package/dist/parts/components/trace-run.d.ts +2 -25
  197. package/dist/parts/components/trace-run.js +1 -89
  198. package/dist/parts/components/trace.d.ts +2 -59
  199. package/dist/parts/components/trace.js +1 -76
  200. package/dist/parts/composables/attachments.js +75 -1
  201. package/dist/parts/headless/choices-input.d.ts +2 -2
  202. package/dist/parts/headless/choices-input.js +49 -37
  203. package/dist/parts/headless/comments.d.ts +1 -1
  204. package/dist/parts/headless/comments.js +1 -1
  205. package/dist/parts/headless/message-scroller.d.ts +2 -2
  206. package/dist/parts/headless/message-scroller.js +211 -309
  207. package/dist/parts/headless/relative-time.d.ts +2 -0
  208. package/dist/parts/headless/relative-time.js +1 -0
  209. package/dist/parts/workspace/browser-support-notice.d.ts +1 -1
  210. package/dist/parts/workspace/browser-support-notice.js +6 -5
  211. package/dist/parts/workspace/connect-panel.js +1 -1
  212. package/dist/parts/workspace/runners/web-container.js +2 -2
  213. package/dist/parts/workspace/workspace-bar.d.ts +1 -1
  214. package/dist/parts/workspace/workspace-bar.js +1 -1
  215. package/dist/parts/workspace/workspace-boot-status.d.ts +1 -1
  216. package/dist/parts/workspace/workspace-boot-status.js +1 -206
  217. package/dist/parts/workspace/workspace-editor-head.d.ts +1 -1
  218. package/dist/parts/workspace/workspace-editor-head.js +1 -1
  219. package/dist/parts/workspace/workspace-editor.d.ts +2 -2
  220. package/dist/parts/workspace/workspace-examples.js +1 -1
  221. package/dist/parts/workspace/workspace-file-tree.d.ts +1 -1
  222. package/dist/parts/workspace/workspace-file-tree.js +3 -2
  223. package/dist/parts/workspace/workspace-guide.js +1 -1
  224. package/dist/parts/workspace/workspace-preview.d.ts +1 -1
  225. package/dist/parts/workspace/workspace-preview.js +14 -12
  226. package/dist/parts/workspace/workspace-shell.d.ts +1 -1
  227. package/dist/parts/workspace/workspace-shell.js +11 -11
  228. package/dist/parts/workspace/workspace-sidebar.d.ts +3 -3
  229. package/dist/parts/workspace/workspace-sidebar.js +2 -2
  230. package/dist/parts/workspace/workspace-start.js +1 -1
  231. package/dist/parts/workspace/workspace-steps.js +1 -1
  232. package/dist/parts/workspace/workspace.d.ts +4 -4
  233. package/dist/parts/workspace/workspace.js +5 -5
  234. package/dist/press-BuEC-XvZ.d.ts +83 -0
  235. package/dist/progress-Ch0fA-bf.d.ts +8 -0
  236. package/dist/progress-D_9sG648.js +47 -0
  237. package/dist/prompt-input-CRXEJBAK.js +412 -0
  238. package/dist/prompt-input-j4OFTF5p.d.ts +116 -0
  239. package/dist/relative-time-BnJfjeEm.js +131 -0
  240. package/dist/relative-time-BuP-Gvzn.d.ts +43 -0
  241. package/dist/{relative-time-DJnw45tr.js → relative-time-Dz2DR4eb.js} +64 -114
  242. package/dist/relative-time-grHFu1kY.d.ts +11 -0
  243. package/dist/{ring-BN4d8vtw.js → ring-DoL9jivj.js} +64 -14
  244. package/dist/runtime/nuxt-plugin.js +2 -5
  245. package/dist/{sankey-CAYwt82B-BAAk7WkJ.js → sankey-CAYwt82B-e6k34wtW.js} +3 -3
  246. package/dist/{shiki-CbfEu_Az.js → shiki-CxzM_xNo.js} +3 -2
  247. package/dist/stand-ins-CuKM1UH1.js +339 -0
  248. package/dist/status-B2Yhrwv8.js +67 -0
  249. package/dist/status-ySiRa-8O.d.ts +38 -0
  250. package/dist/{stream-tokenizer-ByC3l0HQ.js → stream-tokenizer-BsjV6wxW.js} +1 -1
  251. package/dist/styles.css +4315 -3362
  252. package/dist/sync-status-BRroyOre.js +59 -0
  253. package/dist/sync-status-D4KdGO6y.d.ts +35 -0
  254. package/dist/theme.css +3 -0
  255. package/dist/theme.d.ts +14 -0
  256. package/dist/theme.js +19 -8
  257. package/dist/{themes-DKugPHlg.js → themes-B0_ioVT0.js} +1 -1
  258. package/dist/tool-list-DDaCqpR6.js +209 -0
  259. package/dist/tool-list-DMRPM0Yi.d.ts +50 -0
  260. package/dist/trace-KCBvOsw_.d.ts +113 -0
  261. package/dist/trace-run-Dk962P5a.d.ts +49 -0
  262. package/dist/trace-run-nh6FIsl6.js +202 -0
  263. package/dist/{opt-out-D66l60sg.js → tween-lVMRCUEv.js} +60 -1
  264. package/dist/types-BF_U0tgp.d.ts +74 -0
  265. package/dist/types-CTk3aNb5.d.ts +15 -0
  266. package/dist/types-D0a3i4Fw.d.ts +21 -0
  267. package/dist/types-DTecvcsZ.d.ts +35 -0
  268. package/dist/types-D_BWab7g.d.ts +75 -0
  269. package/dist/types-RHaQ4gj1.d.ts +27 -0
  270. package/dist/ui-components-CKQAPI-W.js +7 -0
  271. package/dist/unwrapDefault-CExq-4rm.js +5 -0
  272. package/dist/use-copy-DK1SSZkh.js +66 -0
  273. package/dist/utils-hi9-xROt.js +37 -0
  274. package/dist/vite.d.ts +0 -1
  275. package/dist/vite.js +8 -14
  276. package/dist/{vue-Cs_HmYsp.js → vue-DdYvDVOr.js} +1 -1
  277. package/dist/workspace-boot-status-CyGlJS06.js +216 -0
  278. package/dist/{workspace-shell-ChCwWPyv.d.ts → workspace-shell-B4A7CINd.d.ts} +1 -1
  279. package/dist/workspace.d.ts +1 -1
  280. package/dist/workspace.js +1 -2
  281. package/package.json +49 -15
  282. package/dist/attachments-DgwoQZKY.js +0 -88
  283. package/dist/avatar-stack-C0IKwj6g.d.ts +0 -57
  284. package/dist/choices-input-BUf-QqGj.d.ts +0 -92
  285. package/dist/code-view-Cg4nyTNA.js +0 -172
  286. package/dist/comment-attachments-CMpYOJod.js +0 -19
  287. package/dist/comment-layer-Ba2DV4L7.d.ts +0 -174
  288. package/dist/comment-list-BJdZu0DS.d.ts +0 -60
  289. package/dist/comment-panel-DISGe7yM.d.ts +0 -206
  290. package/dist/comment-person-D_IyIjXo.js +0 -39
  291. package/dist/comment-pin-C5UeLPTa.d.ts +0 -66
  292. package/dist/comment-row-DPMWI5Z0.js +0 -38
  293. package/dist/comment-selection-bar-CVuS-FNL.d.ts +0 -40
  294. package/dist/comment-send-CH46zawK.js +0 -275
  295. package/dist/comment-send-MmxFsOQf.d.ts +0 -23
  296. package/dist/drop-field-CNZgwFVO.js +0 -162
  297. package/dist/editor-BuByBIkJ.js +0 -620
  298. package/dist/format-Bc9m7-r0.js +0 -38
  299. package/dist/handlers-CnbkvXjX.js +0 -181
  300. package/dist/icon-XZaCUZTG.d.ts +0 -29
  301. package/dist/image-preview-EqfPcFZ9.js +0 -104
  302. package/dist/index-B_PSX-5h.d.ts +0 -69
  303. package/dist/list-DUTAo0uC.js +0 -270
  304. package/dist/markdown-editor-B7gD60tp.d.ts +0 -189
  305. package/dist/message-scroller-a6qaYHno.d.ts +0 -173
  306. package/dist/nuxt-ui-7ByUrymx.js +0 -43
  307. package/dist/parts/components/comment-list.d.ts +0 -2
  308. package/dist/parts/components/comment-list.js +0 -172
  309. package/dist/parts/components/comment-pin.d.ts +0 -2
  310. package/dist/parts/components/comment-pin.js +0 -74
  311. package/dist/parts/components/comment-send.d.ts +0 -2
  312. package/dist/parts/components/comment-send.js +0 -1
  313. package/dist/parts/components/markdown-editor.d.ts +0 -2
  314. package/dist/parts/components/markdown-editor.js +0 -1
  315. package/dist/parts/components/markdown-renderer.js +0 -1
  316. package/dist/payload-text-DQNRbJY5.js +0 -31
  317. package/dist/progress-DL9k-ERG.js +0 -265
  318. package/dist/registry-DAIjCjWd.js +0 -77
  319. package/dist/slot-part-BWHvQ3mK.js +0 -25
  320. package/dist/text-BWzZFnGY.js +0 -822
  321. package/dist/travel-CwVhU_GS.js +0 -180
  322. package/dist/tween-Dv3IIIQG.js +0 -61
  323. package/dist/types-Ceh7h7NT.d.ts +0 -31
  324. package/dist/visual-copy-CHHBfJ6O.js +0 -14
  325. package/dist/vue-BlknIGIm.js +0 -2501
@@ -1,66 +0,0 @@
1
- import { PropType } from "vue";
2
- import { CommentStatus, CommentUser } from "@vite-hub/comments/client";
3
- declare const CommentPin: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
- /** The thread number. A draft has none. */
5
- n: {
6
- type: NumberConstructor;
7
- };
8
- author: {
9
- type: PropType<CommentUser>;
10
- };
11
- status: {
12
- default: string;
13
- type: PropType<CommentStatus>;
14
- };
15
- /** A short piece of the comment. It is part of the label that a screen reader says. */
16
- excerpt: {
17
- type: StringConstructor;
18
- };
19
- /** The thread of this pin is open. */
20
- active: {
21
- default: boolean;
22
- type: BooleanConstructor;
23
- };
24
- /** The comment is still being written. */
25
- draft: {
26
- default: boolean;
27
- type: BooleanConstructor;
28
- };
29
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
30
- [key: string]: any;
31
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "hover" | "leave")[], "select" | "hover" | "leave", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
32
- /** The thread number. A draft has none. */
33
- n: {
34
- type: NumberConstructor;
35
- };
36
- author: {
37
- type: PropType<CommentUser>;
38
- };
39
- status: {
40
- default: string;
41
- type: PropType<CommentStatus>;
42
- };
43
- /** A short piece of the comment. It is part of the label that a screen reader says. */
44
- excerpt: {
45
- type: StringConstructor;
46
- };
47
- /** The thread of this pin is open. */
48
- active: {
49
- default: boolean;
50
- type: BooleanConstructor;
51
- };
52
- /** The comment is still being written. */
53
- draft: {
54
- default: boolean;
55
- type: BooleanConstructor;
56
- };
57
- }>> & Readonly<{
58
- onSelect?: ((...args: any[]) => any) | undefined;
59
- onHover?: ((...args: any[]) => any) | undefined;
60
- onLeave?: ((...args: any[]) => any) | undefined;
61
- }>, {
62
- active: boolean;
63
- status: CommentStatus;
64
- draft: boolean;
65
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
66
- export { CommentPin as t };
@@ -1,38 +0,0 @@
1
- import { AvatarStack } from "./parts/components/avatar-stack.js";
2
- import { t as RelativeTime } from "./relative-time-DJnw45tr.js";
3
- import { a as writerName, o as writerPerson, r as plainText } from "./comment-person-D_IyIjXo.js";
4
- import { h } from "vue";
5
- // 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
- export { threadRow as n, rowSlotScope as t };
@@ -1,40 +0,0 @@
1
- import { PropType, VNode } from "vue";
2
- /** The side of the selected text that the bar sits on. */
3
- type CommentSelectionBarSide = "top" | "bottom";
4
- /**
5
- * The bar over selected text: Comment, and Suggest when the page takes suggested changes. It is the dark surface on a
6
- * 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
7
- * keys. A press on the bar keeps the selection on the page.
8
- */
9
- declare const CommentSelectionBar: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
10
- /** Show Suggest (E), for a page that takes suggested changes. */
11
- suggest: {
12
- default: boolean;
13
- type: BooleanConstructor;
14
- };
15
- /** The side of the text that the bar is on. The bar grows from that side, and its tooltips open away from the text. */
16
- side: {
17
- default: string;
18
- type: PropType<CommentSelectionBarSide>;
19
- };
20
- }>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
21
- [key: string]: any;
22
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("comment" | "suggest")[], "comment" | "suggest", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
23
- /** Show Suggest (E), for a page that takes suggested changes. */
24
- suggest: {
25
- default: boolean;
26
- type: BooleanConstructor;
27
- };
28
- /** The side of the text that the bar is on. The bar grows from that side, and its tooltips open away from the text. */
29
- side: {
30
- default: string;
31
- type: PropType<CommentSelectionBarSide>;
32
- };
33
- }>> & Readonly<{
34
- onComment?: ((...args: any[]) => any) | undefined;
35
- onSuggest?: ((...args: any[]) => any) | undefined;
36
- }>, {
37
- side: CommentSelectionBarSide;
38
- suggest: boolean;
39
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
40
- export { CommentSelectionBarSide as n, CommentSelectionBar as t };
@@ -1,275 +0,0 @@
1
- import { n as prepareAnnouncer, t as announce } from "./announce-B0DLwflT.js";
2
- import { r as useUIComponent } from "./nuxt-ui-7ByUrymx.js";
3
- import { o as motionSkipped } from "./ring-BN4d8vtw.js";
4
- import { r as createSpring } from "./opt-out-D66l60sg.js";
5
- import { useCopy } from "./parts/components/copy-button.js";
6
- import { defineComponent, h, nextTick, onBeforeUnmount, onBeforeUpdate, onMounted, onUpdated, ref, shallowRef, watch } from "vue";
7
- // src/internal/agent-logos.ts
8
- const agentLogos = {
9
- t3: {
10
- viewBox: "15.5309 37 94.3941 56.96",
11
- path: "M33.4509 93V47.56H15.5309V37H64.3309V47.56H46.4109V93H33.4509ZM86.7253 93.96C82.832 93.96 78.9653 93.4533 75.1253 92.44C71.2853 91.3733 68.032 89.88 65.3653 87.96L70.4053 78.04C72.5386 79.5867 75.0186 80.8133 77.8453 81.72C80.672 82.6267 83.5253 83.08 86.4053 83.08C89.6586 83.08 92.2186 82.44 94.0853 81.16C95.952 79.88 96.8853 78.12 96.8853 75.88C96.8853 73.7467 96.0586 72.0667 94.4053 70.84C92.752 69.6133 90.0853 69 86.4053 69H80.4853V60.44L96.0853 42.76L97.5253 47.4H68.1653V37H107.365V45.4L91.8453 63.08L85.2853 59.32H89.0453C95.9253 59.32 101.125 60.8667 104.645 63.96C108.165 67.0533 109.925 71.0267 109.925 75.88C109.925 79.0267 109.099 81.9867 107.445 84.76C105.792 87.48 103.259 89.6933 99.8453 91.4C96.432 93.1067 92.0586 93.96 86.7253 93.96Z",
12
- thread: "T3 thread"
13
- },
14
- claude: {
15
- viewBox: "0 0 24 24",
16
- path: "m4.714 15.956l4.718-2.648l.079-.23l-.08-.128h-.23l-.79-.048l-2.695-.073l-2.337-.097l-2.265-.122l-.57-.121l-.535-.704l.055-.353l.48-.321l.685.06l1.518.104l2.277.157l1.651.098l2.447.255h.389l.054-.158l-.133-.097l-.103-.098l-2.356-1.596l-2.55-1.688l-1.336-.972l-.722-.491L2 6.223l-.158-1.008l.656-.722l.88.06l.224.061l.893.686l1.906 1.476l2.49 1.833l.364.304l.146-.104l.018-.072l-.164-.274l-1.354-2.446l-1.445-2.49l-.644-1.032l-.17-.619a3 3 0 0 1-.103-.729L6.287.133L6.7 0l.995.134l.42.364l.619 1.415L9.735 4.14l1.555 3.03l.455.898l.243.832l.09.255h.159V9.01l.127-1.706l.237-2.095l.23-2.695l.08-.76l.376-.91l.747-.492l.583.28l.48.685l-.067.444l-.286 1.851l-.558 2.903l-.365 1.942h.213l.243-.242l.983-1.306l1.652-2.064l.728-.82l.85-.904l.547-.431h1.032l.759 1.129l-.34 1.166l-1.063 1.347l-.88 1.142l-1.263 1.7l-.79 1.36l.074.11l.188-.02l2.853-.606l1.542-.28l1.84-.315l.832.388l.09.395l-.327.807l-1.967.486l-2.307.462l-3.436.813l-.043.03l.049.061l1.548.146l.662.036h1.62l3.018.225l.79.522l.473.638l-.08.485l-1.213.62l-1.64-.389l-3.825-.91l-1.31-.329h-.183v.11l1.093 1.068l2.003 1.81l2.508 2.33l.127.578l-.321.455l-.34-.049l-2.204-1.657l-.85-.747l-1.925-1.62h-.127v.17l.443.649l2.343 3.521l.122 1.08l-.17.353l-.607.213l-.668-.122l-1.372-1.924l-1.415-2.168l-1.141-1.943l-.14.08l-.674 7.254l-.316.37l-.728.28l-.607-.461l-.322-.747l.322-1.476l.388-1.924l.316-1.53l.285-1.9l.17-.632l-.012-.042l-.14.018l-1.432 1.967l-2.18 2.945l-1.724 1.845l-.413.164l-.716-.37l.066-.662l.401-.589l2.386-3.036l1.439-1.882l.929-1.086l-.006-.158h-.055L4.138 18.56l-1.13.146l-.485-.456l.06-.746l.231-.243l1.907-1.312Z",
17
- thread: "Claude Code session"
18
- },
19
- codex: {
20
- viewBox: "0 0 24 24",
21
- path: "M22.282 9.821a6 6 0 0 0-.516-4.91a6.05 6.05 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a6 6 0 0 0-3.998 2.9a6.05 6.05 0 0 0 .743 7.097a5.98 5.98 0 0 0 .51 4.911a6.05 6.05 0 0 0 6.515 2.9A6 6 0 0 0 13.26 24a6.06 6.06 0 0 0 5.772-4.206a6 6 0 0 0 3.997-2.9a6.06 6.06 0 0 0-.747-7.073M13.26 22.43a4.48 4.48 0 0 1-2.876-1.04l.141-.081l4.779-2.758a.8.8 0 0 0 .392-.681v-6.737l2.02 1.168a.07.07 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494M3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085l4.783 2.759a.77.77 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646M2.34 7.896a4.5 4.5 0 0 1 2.366-1.973V11.6a.77.77 0 0 0 .388.677l5.815 3.354l-2.02 1.168a.08.08 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872zm16.597 3.855l-5.833-3.387L15.119 7.2a.08.08 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.407-.667m2.01-3.023l-.141-.085l-4.774-2.782a.78.78 0 0 0-.785 0L9.409 9.23V6.897a.07.07 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66zm-12.64 4.135l-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.8.8 0 0 0-.393.681zm1.097-2.365l2.602-1.5l2.607 1.5v2.999l-2.597 1.5l-2.607-1.5Z",
22
- thread: "Codex thread"
23
- }
24
- };
25
- // src/components/comment-send.ts
26
- const time = new Intl.DateTimeFormat(void 0, {
27
- hour: "2-digit",
28
- minute: "2-digit",
29
- hourCycle: "h23"
30
- });
31
- const comments = (count) => `${count} ${count === 1 ? "comment" : "comments"}`;
32
- function message(state) {
33
- switch (state.status) {
34
- case "pairing":
35
- if (state.reason === "expired") return "Setup code expired.";
36
- if (state.reason === "refused") return `That URL isn't ${state.agent.host}.`;
37
- return `Setup prompt copied. Paste it in the ${agentLogos[state.agent.logo].thread} that should get your comments.`;
38
- case "confirm": return `${state.agent.name} at ${state.agent.host} wants your comments from this site.`;
39
- case "sent": return state.inbox ? "In inbox." : "Sent.";
40
- case "working": return "Working.";
41
- case "failed": return "Not delivered.";
42
- case "limited": return `Limit reached, try at ${time.format(state.retryAt)}.`;
43
- default: return;
44
- }
45
- }
46
- /**
47
- * The Send segment of a comment pill: **Send N** hands the member's waiting comments to their agent, and its state
48
- * takes the place of the button: Sending, Sent, Working with **Open thread**, or Not delivered with **Retry**. Without
49
- * an agent, Send copies a setup prompt and pairs one in place, and asks once: **Allow and send N**. It renders
50
- * `createCommentSend()` of `vite-hub/comments/client`, starts it on mount, and stops it on unmount. It draws one row,
51
- * so it fits in the ViteHub pill and in Drop's.
52
- */
53
- const CommentSend = defineComponent({
54
- name: "CommentSend",
55
- props: { client: {
56
- required: true,
57
- type: Object
58
- } },
59
- setup(props) {
60
- const UIcon = useUIComponent("UIcon");
61
- const { copy } = useCopy();
62
- const copyPrompt = (prompt) => copy(() => prompt);
63
- const state = shallowRef(props.client.state);
64
- const root = ref();
65
- let stop;
66
- let unsubscribe;
67
- const follow = (client) => {
68
- unsubscribe?.();
69
- stop?.();
70
- state.value = client.state;
71
- unsubscribe = client.onChange(() => state.value = client.state);
72
- stop = client.start();
73
- };
74
- onMounted(() => {
75
- prepareAnnouncer(root.value);
76
- follow(props.client);
77
- });
78
- watch(() => props.client, follow);
79
- onBeforeUnmount(() => {
80
- unsubscribe?.();
81
- stop?.();
82
- });
83
- watch(() => state.value.status === "pairing" ? `${state.value.status}:${state.value.reason ?? ""}` : state.value.status, () => {
84
- const text = message(state.value);
85
- if (text) announce(root.value, text);
86
- });
87
- const onKeydown = (event) => {
88
- if (event.key !== "Escape" || event.defaultPrevented) return;
89
- if (state.value.status !== "pairing" && state.value.status !== "confirm") return;
90
- event.preventDefault();
91
- props.client.cancel();
92
- };
93
- watch(() => state.value.status === "pairing" || state.value.status === "confirm", (listening) => {
94
- if (listening) document.addEventListener("keydown", onKeydown);
95
- else document.removeEventListener("keydown", onKeydown);
96
- });
97
- onBeforeUnmount(() => document.removeEventListener("keydown", onKeydown));
98
- let before = 0;
99
- let focused = false;
100
- const clearWidth = (element) => {
101
- element.style.removeProperty("width");
102
- element.style.removeProperty("overflow");
103
- element.style.removeProperty("box-sizing");
104
- };
105
- const renderWidth = (value) => {
106
- const element = root.value;
107
- if (!element) return;
108
- if (!width.active) return clearWidth(element);
109
- element.style.boxSizing = "border-box";
110
- element.style.overflow = "hidden";
111
- element.style.width = `${value}px`;
112
- };
113
- const width = createSpring(0, renderWidth);
114
- onBeforeUnmount(() => width.stop());
115
- const activeElement = () => (root.value?.getRootNode())?.activeElement ?? null;
116
- onBeforeUpdate(() => {
117
- before = root.value?.offsetWidth ?? 0;
118
- const active = activeElement();
119
- focused ||= Boolean(active && root.value?.contains(active));
120
- });
121
- onUpdated(() => {
122
- const element = root.value;
123
- if (!element) return;
124
- clearWidth(element);
125
- const after = element.offsetWidth;
126
- if (before && after && before !== after && !motionSkipped(element)) {
127
- if (!width.active) width.set(before);
128
- width.to(after);
129
- if (width.active) renderWidth(width.value);
130
- } else width.stop();
131
- const active = activeElement();
132
- if (!focused || active && active !== element.ownerDocument.body && !element.contains(active)) return void (focused = false);
133
- if (active && element.contains(active)) return;
134
- const next = element.querySelector("button, a");
135
- if (!next) return;
136
- focused = false;
137
- nextTick(() => next.focus({ preventScroll: true }));
138
- });
139
- const icon = (name, spin = false) => h(UIcon, {
140
- "aria-hidden": "true",
141
- class: spin ? "vh-comment-send-icon vh-comment-send-spin" : "vh-comment-send-icon",
142
- name
143
- });
144
- const logo = (agent) => {
145
- const drawn = agentLogos[agent.logo];
146
- return h("span", {
147
- "aria-hidden": "true",
148
- "data-logo": agent.logo,
149
- "data-slot": "comment-send-logo"
150
- }, h("svg", {
151
- fill: "currentColor",
152
- viewBox: drawn.viewBox,
153
- xmlns: "http://www.w3.org/2000/svg"
154
- }, h("path", { d: drawn.path })));
155
- };
156
- const status = (tone, children, attrs = {}) => h("span", {
157
- ...attrs,
158
- "data-slot": "comment-send-status",
159
- "data-tone": tone
160
- }, children);
161
- const action = (name, children, attrs = {}) => h("button", {
162
- ...attrs,
163
- "data-action": name,
164
- "data-slot": "comment-send-action",
165
- type: "button"
166
- }, children);
167
- const close = (label) => action("cancel", [icon("i-lucide-x")], {
168
- "aria-label": label,
169
- "data-icon": "",
170
- onClick: () => props.client.cancel(),
171
- title: `${label} (Esc)`
172
- });
173
- const copyAgain = () => action("copy-again", [icon("i-lucide-copy"), "Copy again"], { onClick: () => void props.client.copyAgain(copyPrompt) });
174
- const sendContent = (count, inbox) => [
175
- icon(inbox ? "i-lucide-inbox" : "i-lucide-send"),
176
- inbox ? "To inbox" : "Send",
177
- h("span", { "data-slot": "comment-send-count" }, String(count))
178
- ];
179
- let lastInbox = false;
180
- const sendButton = (count, toInbox) => {
181
- lastInbox = toInbox;
182
- return action("send", sendContent(count, toInbox), {
183
- "aria-label": `${toInbox ? "Send to inbox" : "Send"}: ${comments(count)}`,
184
- onClick: () => void props.client.send(copyPrompt),
185
- title: `Send ${comments(count)} that wait for an answer to your agent`
186
- });
187
- };
188
- const parts = (current) => {
189
- switch (current.status) {
190
- case "idle": return current.count > 0 ? [sendButton(current.count, current.inbox), ...current.canPairAnother ? [action("pair-another", [icon("i-lucide-link"), "Pair another agent"], { onClick: () => void props.client.pairAnother(copyPrompt) })] : []] : [];
191
- case "pairing":
192
- if (current.reason === "expired") return [
193
- status("warning", [icon("i-lucide-circle-alert"), "Setup code expired"]),
194
- copyAgain(),
195
- close("Cancel connect")
196
- ];
197
- if (current.reason === "refused") return [
198
- status("error", [icon("i-lucide-circle-alert"), `That URL isn't ${current.agent.host}`]),
199
- copyAgain(),
200
- close("Cancel connect")
201
- ];
202
- return [
203
- status(void 0, [logo(current.agent), h("span", { "data-slot": "comment-send-message" }, [
204
- h("span", { "data-wide": "" }, "Setup prompt copied. "),
205
- h("b", `Paste it in the ${agentLogos[current.agent.logo].thread}`),
206
- h("span", { "data-wide": "" }, " that should get your comments")
207
- ])]),
208
- status(void 0, [icon("i-lucide-loader-circle", true)], {
209
- "aria-label": "Waiting for the agent",
210
- "data-icon": "",
211
- role: "img"
212
- }),
213
- close("Cancel connect")
214
- ];
215
- case "confirm": return [
216
- status(void 0, [logo(current.agent), h("span", {
217
- "data-slot": "comment-send-message",
218
- title: current.agent.host
219
- }, [
220
- h("b", current.agent.name),
221
- current.agent.host ? ` · ${current.agent.host}` : null,
222
- h("span", { "data-wide": "" }, " wants your comments from this site")
223
- ])]),
224
- action("allow", [icon("i-lucide-check"), `Allow and send ${current.count}`], {
225
- "data-variant": "on",
226
- onClick: () => void props.client.allow()
227
- }),
228
- close("Don't allow")
229
- ];
230
- case "sending": return [h("span", { "data-slot": "comment-send-hold" }, [status(void 0, [icon("i-lucide-loader-circle", true), "Sending"]), h("span", {
231
- "aria-hidden": "true",
232
- "data-slot": "comment-send-hold-copy"
233
- }, sendContent(current.count, lastInbox))])];
234
- case "sent": return [status(void 0, [icon("i-lucide-check"), current.inbox ? "In inbox" : "Sent"]), current.count > 0 ? sendButton(current.count, Boolean(current.agent && !current.agent.host)) : null].filter((part) => part !== null);
235
- case "working": return [
236
- status(void 0, [h("span", {
237
- "aria-hidden": "true",
238
- "data-slot": "comment-send-dot"
239
- }), "Working"]),
240
- current.thread ? h("a", {
241
- "aria-label": `Open the ${current.agent?.name ?? "agent"} thread`,
242
- "data-action": "open",
243
- "data-slot": "comment-send-action",
244
- href: current.thread,
245
- rel: "noopener",
246
- target: "_blank"
247
- }, ["Open thread", icon("i-lucide-arrow-up-right")]) : null,
248
- current.count > 0 ? sendButton(current.count, Boolean(current.agent && !current.agent.host)) : null
249
- ].filter((part) => part !== null);
250
- case "failed": return [status("error", [icon("i-lucide-circle-alert"), "Not delivered"], { title: current.reason }), action("retry", [icon("i-lucide-rotate-ccw"), "Retry"], {
251
- "aria-label": `Retry: send ${comments(current.count)} again`,
252
- onClick: () => void props.client.send(copyPrompt)
253
- })];
254
- case "limited": return [status("warning", [icon("i-lucide-circle-alert"), `Limit reached, try at ${time.format(current.retryAt)}`])];
255
- }
256
- };
257
- return () => {
258
- const current = state.value;
259
- const children = parts(current);
260
- return h("div", {
261
- "aria-label": "Send comments to your agent",
262
- "data-slot": "comment-send",
263
- "data-state": current.status,
264
- "data-reason": current.status === "pairing" ? current.reason : void 0,
265
- hidden: children.length === 0 || void 0,
266
- ref: root,
267
- role: "group"
268
- }, h("span", {
269
- key: current.status === "pairing" ? `pairing-${current.reason ?? ""}` : current.status,
270
- "data-slot": "comment-send-content"
271
- }, children));
272
- };
273
- }
274
- });
275
- export { CommentSend as t };
@@ -1,23 +0,0 @@
1
- import { PropType, VNode } from "vue";
2
- import { CommentSendClient } from "@vite-hub/comments/client";
3
- /**
4
- * The Send segment of a comment pill: **Send N** hands the member's waiting comments to their agent, and its state
5
- * takes the place of the button: Sending, Sent, Working with **Open thread**, or Not delivered with **Retry**. Without
6
- * an agent, Send copies a setup prompt and pairs one in place, and asks once: **Allow and send N**. It renders
7
- * `createCommentSend()` of `vite-hub/comments/client`, starts it on mount, and stops it on unmount. It draws one row,
8
- * so it fits in the ViteHub pill and in Drop's.
9
- */
10
- declare const CommentSend: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
11
- client: {
12
- required: true;
13
- type: PropType<CommentSendClient>;
14
- };
15
- }>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
16
- [key: string]: any;
17
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
18
- client: {
19
- required: true;
20
- type: PropType<CommentSendClient>;
21
- };
22
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
23
- export { CommentSend as t };
@@ -1,162 +0,0 @@
1
- import { a as onEachFrame, t as isMotionOff, u as prefersReducedMotion } from "./opt-out-D66l60sg.js";
2
- // src/motion/drop-field.ts
3
- const gap = 14;
4
- const reach = 110;
5
- const lean = 3;
6
- const powerRate = .15;
7
- const dotRate = .2;
8
- const carriesFiles = (event) => [...event.dataTransfer?.types ?? []].includes("Files");
9
- const rate = (perFrame, seconds) => 1 - (1 - perFrame) ** (seconds * 60);
10
- /**
11
- * The drop field of docs/design/motion.md: "Files are dragged in". A grid of dots behind the content of `surface` leans
12
- * toward the dragged file and rests again when it leaves or drops. It wraps the native file drop of `field`: the drag
13
- * events, `dropEffect`, and `onFiles`. A click or a key that opens a file picker stays with the field's own controls.
14
- *
15
- * The dots use `--vh-drop-dot`, or the text color of the surface. Under reduced motion and inside `data-motion="none"`
16
- * the dots stay still; `data-over` still marks the field, so its colors change.
17
- */
18
- function createDropField(field, options = {}) {
19
- const surface = options.surface ?? field;
20
- const accepts = options.accepts ?? carriesFiles;
21
- const canvas = document.createElement("canvas");
22
- canvas.dataset.part = "dots";
23
- canvas.setAttribute("aria-hidden", "true");
24
- Object.assign(canvas.style, {
25
- height: "100%",
26
- inset: "0",
27
- pointerEvents: "none",
28
- position: "absolute",
29
- width: "100%",
30
- zIndex: "-1"
31
- });
32
- if (getComputedStyle(surface).position === "static") surface.style.position = "relative";
33
- surface.style.isolation = "isolate";
34
- surface.prepend(canvas);
35
- const context = canvas.getContext("2d");
36
- let dots = [];
37
- let pointer = {
38
- x: -999,
39
- y: -999
40
- };
41
- let over = false;
42
- let depth = 0;
43
- let power = 0;
44
- let stop;
45
- const still = () => prefersReducedMotion() || isMotionOff(surface);
46
- function build() {
47
- dots = [];
48
- for (let y = 10; y < surface.clientHeight; y += gap) for (let x = 10; x < surface.clientWidth; x += gap) dots.push({
49
- x,
50
- y,
51
- pull: 0
52
- });
53
- }
54
- function draw(seconds) {
55
- if (!context) return false;
56
- const ratio = devicePixelRatio || 1;
57
- const width = surface.clientWidth;
58
- const height = surface.clientHeight;
59
- if (canvas.width !== Math.round(width * ratio) || canvas.height !== Math.round(height * ratio)) {
60
- canvas.width = Math.round(width * ratio);
61
- canvas.height = Math.round(height * ratio);
62
- }
63
- context.setTransform(ratio, 0, 0, ratio, 0, 0);
64
- context.clearRect(0, 0, width, height);
65
- const style = getComputedStyle(surface);
66
- context.fillStyle = style.getPropertyValue("--vh-drop-dot").trim() || style.color;
67
- const target = over ? 1 : 0;
68
- const quiet = still();
69
- power += (target - power) * rate(powerRate, seconds);
70
- let moving = false;
71
- for (const dot of dots) {
72
- const distance = Math.hypot(dot.x - pointer.x, dot.y - pointer.y);
73
- const want = quiet ? 0 : power * Math.max(0, 1 - distance / reach) ** 2;
74
- dot.pull += (want - dot.pull) * rate(dotRate, seconds);
75
- if (Math.abs(want - dot.pull) > .002) moving = true;
76
- const shift = quiet ? 0 : dot.pull * lean;
77
- const angle = Math.atan2(pointer.y - dot.y, pointer.x - dot.x);
78
- context.globalAlpha = .16 + dot.pull * .7;
79
- context.beginPath();
80
- context.arc(dot.x + Math.cos(angle) * shift, dot.y + Math.sin(angle) * shift, .9 + dot.pull * 1.9, 0, Math.PI * 2);
81
- context.fill();
82
- }
83
- context.globalAlpha = 1;
84
- return moving || Math.abs(power - target) > .01;
85
- }
86
- function kick() {
87
- if (stop) return;
88
- stop = onEachFrame((seconds) => {
89
- if (draw(seconds)) return true;
90
- stop = void 0;
91
- return false;
92
- });
93
- }
94
- function setOver(next) {
95
- if (next === over) return;
96
- over = next;
97
- if (next) field.dataset.over = "";
98
- else delete field.dataset.over;
99
- kick();
100
- }
101
- function locate(event) {
102
- const box = surface.getBoundingClientRect();
103
- pointer = {
104
- x: event.clientX - box.left,
105
- y: event.clientY - box.top
106
- };
107
- }
108
- const onEnter = (event) => {
109
- if (!accepts(event)) return;
110
- event.preventDefault();
111
- depth++;
112
- locate(event);
113
- setOver(true);
114
- };
115
- const onOver = (event) => {
116
- if (!accepts(event)) return;
117
- event.preventDefault();
118
- if (event.dataTransfer) event.dataTransfer.dropEffect = "copy";
119
- locate(event);
120
- setOver(true);
121
- kick();
122
- };
123
- const onLeave = (event) => {
124
- if (!accepts(event)) return;
125
- depth = Math.max(0, depth - 1);
126
- if (!depth) setOver(false);
127
- };
128
- const onDrop = (event) => {
129
- if (!accepts(event)) return;
130
- event.preventDefault();
131
- depth = 0;
132
- setOver(false);
133
- options.onFiles?.([...event.dataTransfer?.files ?? []], event);
134
- };
135
- field.addEventListener("dragenter", onEnter);
136
- field.addEventListener("dragover", onOver);
137
- field.addEventListener("dragleave", onLeave);
138
- field.addEventListener("drop", onDrop);
139
- const resize = typeof ResizeObserver === "function" ? new ResizeObserver(() => {
140
- build();
141
- draw(0);
142
- }) : void 0;
143
- resize?.observe(surface);
144
- build();
145
- draw(0);
146
- return {
147
- get over() {
148
- return over;
149
- },
150
- destroy() {
151
- stop?.();
152
- resize?.disconnect();
153
- field.removeEventListener("dragenter", onEnter);
154
- field.removeEventListener("dragover", onOver);
155
- field.removeEventListener("dragleave", onLeave);
156
- field.removeEventListener("drop", onDrop);
157
- delete field.dataset.over;
158
- canvas.remove();
159
- }
160
- };
161
- }
162
- export { createDropField as t };