@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,645 +1 @@
1
- import { i as useComments, n as draftPositionKey, o as commentTitle, r as provideComments, s as deliveryAttributes, u as commentThreadKey } from "../../comments-D9dONfs9.js";
2
- import { t as uiErrorDiagnostics } from "../../error-diagnostics-BlgA9rI2.js";
3
- import { t as useCommentAttachments } from "../../comment-attachments-CMpYOJod.js";
4
- import { i as consumedPointerEvents } from "../../comments-context-CrjhleVA.js";
5
- import { n as excerpt } from "../../comment-person-D_IyIjXo.js";
6
- import { n as threadRow } from "../../comment-row-DPMWI5Z0.js";
7
- import { t as createMotionList } from "../../list-DUTAo0uC.js";
8
- import { t as CommentComposer } from "../../comment-composer-BP-CJx7f.js";
9
- import { CommentList, CommentToolbar } from "./comment-list.js";
10
- import { CommentPin } from "./comment-pin.js";
11
- import { n as CommentThread } from "../../comment-thread-5h93DXds.js";
12
- import { computed, defineComponent, h, nextTick, onBeforeUnmount, onMounted, onUpdated, reactive, ref, shallowRef, watch } from "vue";
13
- // src/components/comment-layer.ts
14
- const popoverWidth = 360;
15
- const popoverHeight = 420;
16
- function placeDraft(point, page, width, viewport) {
17
- const inset = (Number.parseFloat(window.getComputedStyle(document.documentElement).fontSize) || 16) / 2;
18
- const x = page ? (viewport - width) / 2 - inset : point.x;
19
- const flipX = x > viewport / 2 && x + inset + width > viewport - inset;
20
- const left = Math.max(inset, Math.min(flipX ? x - inset - width : x + inset, viewport - inset - width));
21
- return {
22
- x,
23
- y: point.y,
24
- flipX,
25
- left: left - x
26
- };
27
- }
28
- /** A pin on an area or an image is round. Elsewhere it is a drop whose small corner points at the spot. */
29
- const pinShape = (kind) => kind === "area" || kind === "image" ? "round" : "point";
30
- const clickSlop = 6;
31
- const pinSpacing = 32;
32
- const minimumArea = 8;
33
- const marginMinWidth = 900;
34
- const marginGap = 8;
35
- const marginCardHeight = 72;
36
- function containerOf(box) {
37
- const center = {
38
- x: box.left + box.width / 2,
39
- y: box.top + box.height / 2
40
- };
41
- const under = document.elementsFromPoint(center.x, center.y).find((element) => !element.closest("[data-comments-ui]") && !element.localName.startsWith("vitehub-") && element !== document.documentElement);
42
- for (let element = under ?? null; element && element !== document.documentElement; element = element.parentElement) {
43
- const rect = element.getBoundingClientRect();
44
- if (rect.left <= box.left + 1 && rect.top <= box.top + 1 && rect.right >= box.left + box.width - 1 && rect.bottom >= box.top + box.height - 1) return element;
45
- }
46
- }
47
- const CommentLayer = defineComponent({
48
- name: "CommentLayer",
49
- props: {
50
- client: { type: Object },
51
- /** What the threads of this page are about. For a page, `{ kind: "page", id: "/pricing" }`. */
52
- subject: { type: Object },
53
- /** The signed-in user. Defaults to the client's user. */
54
- user: { type: Object },
55
- /** A state from `useComments()`, instead of `client` and `subject`. */
56
- comments: { type: Object },
57
- /** The people on this page, shown in the toolbar. */
58
- people: {
59
- default: () => [],
60
- type: Array
61
- },
62
- /** The key that toggles comment mode. `false` turns it off. */
63
- hotkey: {
64
- default: "c",
65
- type: [String, Boolean]
66
- },
67
- /** Hide thread mutation controls when the viewer may only read. */
68
- readOnly: {
69
- default: false,
70
- type: Boolean
71
- },
72
- /** The URL of the page that a subject lives on, for the links of threads that are not page threads. */
73
- subjectUrl: { type: Function },
74
- /** Navigates to the page of a thread from the list. Defaults to `location.assign`. */
75
- navigate: { type: Function },
76
- /** What the signed-in user may do in a thread. Defaults to the `can` of the comments state. */
77
- can: { type: Function },
78
- /** Turns attached files into attachment keys before the comment is saved or sent. */
79
- upload: { type: Function },
80
- /** Save raw files with outbox entries. Set only when the server accepts file uploads. `upload` takes precedence. */
81
- queueFiles: {
82
- default: false,
83
- type: Boolean
84
- },
85
- /** The file types that the boxes take, such as `image/*`. */
86
- accept: { type: String },
87
- /** Gives the URL of an attachment key. With it, image attachments show as thumbnails. */
88
- attachmentUrl: { type: Function },
89
- /**
90
- * Where threads open. `"pin"` opens a thread in a card beside its pin. `"margin"` shows every thread as a card in a
91
- * column on the right edge of the screen, level with its pin, and opens it in that card, with the reply box there.
92
- * A new comment is written there too. On a screen narrower than 900px, `"margin"` works as `"pin"`.
93
- */
94
- placement: {
95
- default: "pin",
96
- type: String
97
- },
98
- /**
99
- * The size of the thread cards and of the box for a new comment. `"sm"`, the default, is Drop's floating card: 14px
100
- * text, tight rows, and Edit and Delete over the name's row. `"md"` is the size of a thread in a panel.
101
- */
102
- size: {
103
- default: "sm",
104
- type: String
105
- }
106
- },
107
- setup(props, { slots }) {
108
- const { client, subject } = props;
109
- if (!props.comments && (!client || !subject)) throw uiErrorDiagnostics.UI_R0002({ message: "CommentLayer needs a `client` and a `subject`, or the `comments` state from useComments()." });
110
- const layer = ref(null);
111
- const uiRoot = () => {
112
- const node = layer.value?.getRootNode();
113
- return node instanceof ShadowRoot ? node : document;
114
- };
115
- const state = props.comments ?? useComments({
116
- client,
117
- hotkey: props.hotkey,
118
- subject: () => props.subject,
119
- subjectUrl: props.subjectUrl,
120
- uiRoot,
121
- user: () => props.user
122
- });
123
- provideComments(state);
124
- const draftFiles = ref([]);
125
- const uploadingDraft = shallowRef(null);
126
- watch(() => state.draft.value, (next, previous) => {
127
- if (next !== previous) draftFiles.value = next?.files ? [...next.files] : [];
128
- });
129
- const { enabled: attachmentsOn, prepare } = useCommentAttachments(state, props);
130
- const user = computed(() => state.user.value);
131
- const pinned = computed(() => state.threads.value.filter((thread) => state.pageThreads.value.includes(thread) || state.shown.value.has(thread.id) || state.leaving.value.has(thread.id)));
132
- const drawn = computed(() => pinned.value.filter((thread) => state.shown.value.has(thread.id) || state.leaving.value.has(thread.id)));
133
- let down = null;
134
- const drawing = ref(null);
135
- const boxFrom = (start, event) => ({
136
- left: Math.min(start.x, event.clientX),
137
- top: Math.min(start.y, event.clientY),
138
- width: Math.abs(event.clientX - start.x),
139
- height: Math.abs(event.clientY - start.y)
140
- });
141
- const press = (event) => {
142
- drawing.value = null;
143
- down = consumedPointerEvents.has(event) || event.button !== 0 ? null : {
144
- x: event.clientX,
145
- y: event.clientY,
146
- draw: event.pointerType !== "touch"
147
- };
148
- if (down?.draw && event.target instanceof Element) event.target.setPointerCapture?.(event.pointerId);
149
- };
150
- const move = (event) => {
151
- if (!down?.draw) return;
152
- if (!drawing.value && Math.hypot(event.clientX - down.x, event.clientY - down.y) <= clickSlop) return;
153
- drawing.value = boxFrom(down, event);
154
- };
155
- const release = (event) => {
156
- const start = down;
157
- const drawn = drawing.value;
158
- down = null;
159
- drawing.value = null;
160
- if (!start) return;
161
- if (drawn) {
162
- const box = boxFrom(start, event);
163
- const element = box.width >= minimumArea && box.height >= minimumArea ? containerOf(box) : void 0;
164
- if (!element) return;
165
- event.preventDefault();
166
- try {
167
- state.startDraft(element, {
168
- area: box,
169
- point: {
170
- x: box.left,
171
- y: box.top
172
- }
173
- });
174
- } catch {}
175
- return;
176
- }
177
- if (Math.hypot(event.clientX - start.x, event.clientY - start.y) > clickSlop) return;
178
- event.preventDefault();
179
- try {
180
- state.startDraft({
181
- x: event.clientX,
182
- y: event.clientY
183
- });
184
- } catch {}
185
- };
186
- let returnTo = null;
187
- let restoring = false;
188
- watch(() => state.opened.value && commentThreadKey(state.opened.value), (key) => {
189
- if (key) nextTick(() => layer.value?.querySelector("[data-slot='comment-thread']:not([data-preview])")?.focus());
190
- });
191
- watch(() => state.openId.value, (id, previous) => {
192
- if (id) return;
193
- returnTo = null;
194
- const active = uiRoot().activeElement;
195
- const thread = layer.value?.querySelector("[data-slot='comment-thread']:not([data-preview])");
196
- if (previous && (!active || active === document.body || thread?.contains(active))) returnTo = previous;
197
- }, { flush: "pre" });
198
- watch(() => state.openId.value, (id) => {
199
- if (id || !returnTo) return;
200
- const target = returnTo;
201
- returnTo = null;
202
- nextTick(() => {
203
- const pins = layer.value?.querySelectorAll("[data-slot='comment-pin']") ?? [];
204
- restoring = true;
205
- ([...pins].find((pin) => pin.getAttribute("data-thread-id") === target) ?? layer.value?.querySelector("[data-slot='comment-toolbar-mode']"))?.focus();
206
- restoring = false;
207
- });
208
- }, { flush: "post" });
209
- let draftReturn = null;
210
- watch(() => state.draft.value, (next, previous) => {
211
- if (next && !previous) {
212
- const active = document.activeElement;
213
- const root = uiRoot();
214
- draftReturn = active instanceof HTMLElement && active !== document.body && !(root instanceof ShadowRoot && active === root.host) && !layer.value?.contains(active) ? active : null;
215
- return;
216
- }
217
- if (next || !previous) return;
218
- const target = draftReturn;
219
- draftReturn = null;
220
- nextTick(() => {
221
- const focused = uiRoot().activeElement;
222
- if (target?.isConnected && (!focused || focused === document.body)) target.focus({ preventScroll: true });
223
- });
224
- }, { flush: "sync" });
225
- const draftAboveRoom = 72;
226
- const draftCard = ref(null);
227
- const draftBelow = ref(false);
228
- const draftWidth = ref(0);
229
- const measureDraft = () => {
230
- draftWidth.value = draftCard.value?.offsetWidth ?? 0;
231
- };
232
- watch(() => state.draft.value, (next, previous) => {
233
- if (next !== previous) draftBelow.value = false;
234
- });
235
- const fits = typeof ResizeObserver === "function" ? new ResizeObserver(() => {
236
- measureDraft();
237
- const card = draftCard.value;
238
- if (card?.parentElement?.hasAttribute("data-above") && card.getBoundingClientRect().top < 8) draftBelow.value = true;
239
- }) : void 0;
240
- watch(draftCard, (card, previous) => {
241
- if (previous) fits?.unobserve(previous);
242
- if (card) fits?.observe(card);
243
- measureDraft();
244
- });
245
- onBeforeUnmount(() => fits?.disconnect());
246
- const place = ({ x, y }) => ({
247
- left: `${x}px`,
248
- top: `${y}px`,
249
- "--vh-comment-x": `${x}px`
250
- });
251
- const picked = reactive(/* @__PURE__ */ new Map());
252
- const placedItems = /* @__PURE__ */ new Map();
253
- const observedCards = /* @__PURE__ */ new Map();
254
- const observeCard = (key, card) => {
255
- const previous = observedCards.get(key);
256
- if (previous === card) return;
257
- if (previous) cardSizes?.unobserve(previous);
258
- observedCards.delete(key);
259
- if (card) {
260
- observedCards.set(key, card);
261
- cardSizes?.observe(card);
262
- }
263
- };
264
- const readSides = () => {
265
- for (const [key, item] of placedItems) {
266
- const card = item.querySelector(":scope > [data-slot='comment-layer-popover']");
267
- const area = card ? getComputedStyle(card).getPropertyValue("position-area") : "";
268
- observeCard(key, card && area && area !== "none" ? card : null);
269
- if (!card || !area || area === "none") {
270
- picked.delete(key);
271
- continue;
272
- }
273
- const spot = item.getBoundingClientRect();
274
- const box = card.getBoundingClientRect();
275
- const next = {
276
- x: box.left + box.right < spot.left * 2,
277
- y: box.top + box.bottom < spot.top * 2
278
- };
279
- const now = picked.get(key);
280
- if (now?.x !== next.x || now?.y !== next.y) picked.set(key, next);
281
- }
282
- };
283
- const cardSizes = typeof ResizeObserver === "function" ? new ResizeObserver(readSides) : void 0;
284
- let sideFrame = 0;
285
- const readSidesSoon = () => {
286
- if (!sideFrame) sideFrame = requestAnimationFrame(() => {
287
- sideFrame = 0;
288
- readSides();
289
- });
290
- };
291
- onMounted(() => {
292
- readSides();
293
- window.addEventListener("resize", readSidesSoon, { passive: true });
294
- window.visualViewport?.addEventListener("resize", readSidesSoon, { passive: true });
295
- });
296
- let marginList;
297
- const moveMargin = () => {
298
- const element = layer.value;
299
- if (!element) return;
300
- if (marginList) marginList.play();
301
- else marginList = createMotionList(element, {
302
- items: (root) => [...root.querySelectorAll("[data-margin-key]")],
303
- movesOnly: true
304
- });
305
- marginList.measure();
306
- };
307
- onMounted(moveMargin);
308
- onUpdated(() => {
309
- readSides();
310
- moveMargin();
311
- });
312
- onBeforeUnmount(() => {
313
- marginList?.destroy();
314
- cardSizes?.disconnect();
315
- cancelAnimationFrame(sideFrame);
316
- window.removeEventListener("resize", readSidesSoon);
317
- window.visualViewport?.removeEventListener("resize", readSidesSoon);
318
- });
319
- const placedItem = (key) => (element) => {
320
- if (element instanceof HTMLElement) placedItems.set(key, element);
321
- else {
322
- placedItems.delete(key);
323
- observeCard(key, null);
324
- picked.delete(key);
325
- }
326
- };
327
- const side = (x, y, key) => {
328
- const seen = key === void 0 ? void 0 : picked.get(key);
329
- const flipX = seen ? seen.x : x + popoverWidth > window.innerWidth;
330
- const flipY = seen ? seen.y : y + popoverHeight > window.innerHeight;
331
- return {
332
- "data-flip-x": flipX ? "true" : void 0,
333
- "data-flip-y": flipY ? "true" : void 0
334
- };
335
- };
336
- const composerView = (draft) => h(CommentComposer, {
337
- accept: props.accept,
338
- attachments: attachmentsOn.value,
339
- busy: draft.busy || uploadingDraft.value === draft,
340
- error: draft.error,
341
- mentions: draft.mentions,
342
- modelValue: draft.body,
343
- onCancel: () => state.cancelDraft(),
344
- files: draftFiles.value,
345
- frame: "none",
346
- layout: "row",
347
- onSubmit: async (submit) => {
348
- if (draft.busy || uploadingDraft.value === draft || state.draft.value !== draft) return;
349
- uploadingDraft.value = draft;
350
- draft.error = void 0;
351
- draft.mentions = submit.mentions;
352
- const submitted = draftFiles.value;
353
- const body = draft.body;
354
- const mentions = draft.mentions;
355
- try {
356
- const { attachments, files } = await prepare(submit.files);
357
- if (state.draft.value !== draft || draft.body !== body || draft.mentions !== mentions || draftFiles.value !== submitted) return;
358
- draft.attachments = attachments;
359
- if (await state.send({ files }) && draftFiles.value === submitted) draftFiles.value = [];
360
- } catch (error) {
361
- draft.error = error instanceof Error ? error.message : "The files could not be uploaded. Try again.";
362
- } finally {
363
- if (uploadingDraft.value === draft) uploadingDraft.value = null;
364
- }
365
- },
366
- "onUpdate:files": (value) => draftFiles.value = value,
367
- "onUpdate:mentions": (value) => draft.mentions = value,
368
- "onUpdate:modelValue": (value) => draft.body = value,
369
- people: user.value ? [user.value] : [],
370
- size: props.size,
371
- user: user.value,
372
- users: state.users
373
- });
374
- const screenWidth = ref(0);
375
- const onResize = () => {
376
- screenWidth.value = window.innerWidth;
377
- measureDraft();
378
- };
379
- onMounted(() => {
380
- screenWidth.value = window.innerWidth;
381
- window.addEventListener("resize", onResize, { passive: true });
382
- });
383
- onBeforeUnmount(() => window.removeEventListener("resize", onResize));
384
- const inMargin = computed(() => props.placement === "margin" && screenWidth.value >= marginMinWidth);
385
- const cardHeights = reactive(/* @__PURE__ */ new Map());
386
- const cards = /* @__PURE__ */ new Map();
387
- const measure = typeof ResizeObserver === "function" ? new ResizeObserver((entries) => {
388
- for (const entry of entries) {
389
- const key = entry.target.getAttribute("data-margin-key");
390
- const height = Math.round(entry.target.getBoundingClientRect().height);
391
- if (key && height && cardHeights.get(key) !== height) cardHeights.set(key, height);
392
- }
393
- }) : void 0;
394
- onBeforeUnmount(() => measure?.disconnect());
395
- const measured = (key) => (element) => {
396
- const before = cards.get(key);
397
- if (before && before !== element) measure?.unobserve(before);
398
- if (element instanceof Element) {
399
- cards.set(key, element);
400
- measure?.observe(element);
401
- } else cards.delete(key);
402
- };
403
- const statusSlot = () => slots.status ? { status: slots.status } : void 0;
404
- const threadView = (thread) => h(CommentThread, {
405
- accept: props.accept,
406
- attachmentUrl: props.attachmentUrl,
407
- attachments: attachmentsOn.value,
408
- can: props.can,
409
- key: commentThreadKey(thread),
410
- detached: state.positions.value.get(thread.id)?.detached === true,
411
- readOnly: props.readOnly,
412
- size: props.size,
413
- onClose: () => state.close(),
414
- onDelete: (messageId) => state.remove(thread.id, messageId),
415
- onEdit: (messageId, body, mentions) => state.edit(thread.id, messageId, body, mentions),
416
- onReopen: () => state.reopen(thread.id),
417
- onReply: async (body, mentions, list) => {
418
- const { attachments, files } = await prepare(list);
419
- return state.reply(thread.id, body, mentions, attachments, files);
420
- },
421
- onResolve: async () => {
422
- await state.resolve(thread.id);
423
- state.close();
424
- },
425
- thread,
426
- user: user.value
427
- }, statusSlot());
428
- const marginLayout = (spots, draftY) => {
429
- const entries = pinned.value.flatMap((thread) => {
430
- const spot = state.shown.value.has(thread.id) ? spots.get(thread.id) : void 0;
431
- return spot ? [{
432
- active: state.openId.value === thread.id,
433
- key: thread.id,
434
- thread,
435
- y: spot.y
436
- }] : [];
437
- });
438
- if (draftY !== void 0) entries.push({
439
- active: true,
440
- key: draftPositionKey,
441
- y: draftY
442
- });
443
- entries.sort((a, b) => a.y - b.y);
444
- const height = (entry) => cardHeights.get(entry.key) ?? (entry.active ? popoverHeight : marginCardHeight);
445
- const tops = [];
446
- let below = -Infinity;
447
- for (const entry of entries) {
448
- const top = Math.max(entry.y - 16, below + marginGap);
449
- tops.push(top);
450
- below = top + height(entry);
451
- }
452
- const edge = window.innerHeight - 16;
453
- entries.forEach((entry, index) => {
454
- if (!entry.active || tops[index] + height(entry) <= edge) return;
455
- tops[index] = Math.max(16, edge - height(entry));
456
- for (let before = index - 1; before >= 0; before--) tops[before] = Math.min(tops[before], tops[before + 1] - marginGap - height(entries[before]));
457
- for (let after = index + 1; after < entries.length; after++) tops[after] = Math.max(tops[after], tops[after - 1] + marginGap + height(entries[after - 1]));
458
- });
459
- const at = new Map(entries.map((entry, index) => [entry.key, tops[index]]));
460
- const cards = entries.flatMap((entry, index) => {
461
- const thread = entry.thread;
462
- if (!thread || entry.active) return [];
463
- return [h("button", {
464
- "aria-label": `${commentTitle(thread)}: ${excerpt(thread.messages[0]?.body ?? "")}`,
465
- "data-margin-key": entry.key,
466
- "data-slot": "comment-margin-card",
467
- "data-status": thread.status,
468
- ...deliveryAttributes(thread.delivery),
469
- key: entry.key,
470
- onClick: () => state.open(thread),
471
- onPointerenter: () => {
472
- if (!state.draft.value) state.hoverId.value = thread.id;
473
- },
474
- onPointerleave: () => {
475
- if (state.hoverId.value === thread.id) state.hoverId.value = null;
476
- },
477
- ref: measured(entry.key),
478
- style: { top: `${tops[index]}px` },
479
- type: "button"
480
- }, threadRow(thread))];
481
- });
482
- return {
483
- at,
484
- node: h("div", { "data-slot": "comment-margin" }, cards)
485
- };
486
- };
487
- return () => {
488
- const spots = /* @__PURE__ */ new Map();
489
- for (const thread of drawn.value) {
490
- const position = state.positions.value.get(thread.id);
491
- if (!position || position.detached || position.clipped || thread.anchor.kind === "page") continue;
492
- const taken = (y) => [...spots.values()].some((spot) => Math.abs(spot.x - position.x) < pinSpacing && Math.abs(spot.y - y) < pinSpacing);
493
- let y = position.y;
494
- while (taken(y)) y += pinSpacing;
495
- if (y !== position.y && y > window.innerHeight - pinSpacing) {
496
- y = position.y - pinSpacing;
497
- while (taken(y)) y -= pinSpacing;
498
- }
499
- spots.set(thread.id, {
500
- ...position,
501
- y
502
- });
503
- }
504
- const items = drawn.value.flatMap((thread) => {
505
- const position = spots.get(thread.id);
506
- if (!position) return [];
507
- const leaving = !state.shown.value.has(thread.id);
508
- const open = state.openId.value === thread.id;
509
- const hover = state.hoverId.value === thread.id && !leaving && !open && !state.draft.value && !inMargin.value;
510
- return [h("div", {
511
- ...side(position.x, position.y, thread.id),
512
- "data-kind": thread.anchor.kind,
513
- "data-leaving": leaving ? "true" : void 0,
514
- "data-slot": "comment-layer-item",
515
- inert: leaving || void 0,
516
- key: thread.id,
517
- ref: placedItem(thread.id),
518
- style: place(position)
519
- }, [h(CommentPin, {
520
- active: open,
521
- author: thread.author,
522
- "data-shape": pinShape(thread.anchor.kind),
523
- "data-thread-id": thread.id,
524
- excerpt: excerpt(thread.messages[0]?.body ?? ""),
525
- ...thread.n ? { n: thread.n } : {},
526
- onHover: () => {
527
- if (!open && !restoring && !state.draft.value) state.hoverId.value = thread.id;
528
- },
529
- onLeave: () => {
530
- if (state.hoverId.value === thread.id) state.hoverId.value = null;
531
- },
532
- onSelect: () => open ? state.close() : state.open(thread),
533
- status: thread.status
534
- }), hover ? h("div", {
535
- "data-preview": "true",
536
- "data-slot": "comment-layer-popover"
537
- }, h(CommentThread, {
538
- preview: true,
539
- size: props.size,
540
- thread
541
- }, statusSlot())) : null])];
542
- });
543
- const draft = state.draft.value;
544
- const draftPosition = draft && state.positions.value.get("draft");
545
- const point = draftPosition && !draftPosition.detached && draft?.anchor.kind !== "page" ? draftPosition : draft?.point;
546
- const draftInMargin = Boolean(inMargin.value && draft && point && draft.anchor.kind !== "page");
547
- const margin = inMargin.value ? marginLayout(spots, draftInMargin ? point.y : void 0) : null;
548
- const inColumn = (key) => {
549
- const top = margin?.at.get(key);
550
- return top === void 0 ? void 0 : {
551
- "data-margin": "true",
552
- "data-margin-key": key,
553
- style: { top: `${top}px` }
554
- };
555
- };
556
- const opened = state.opened.value;
557
- const openedPosition = opened && state.positions.value.get(opened.id);
558
- const pointForThread = openedPosition && !openedPosition.detached && !openedPosition.clipped && opened?.anchor.kind !== "page" ? spots.get(opened.id) ?? openedPosition : void 0;
559
- const openedColumn = opened && pointForThread ? inColumn(opened.id) : void 0;
560
- const openThread = opened ? h("div", {
561
- ...pointForThread ? side(pointForThread.x, pointForThread.y, "opened-thread") : {},
562
- "data-kind": opened.anchor.kind,
563
- "data-slot": "comment-layer-item",
564
- key: "opened-thread",
565
- ref: placedItem("opened-thread"),
566
- style: pointForThread ? place(pointForThread) : void 0
567
- }, h("div", {
568
- ...openedColumn,
569
- "data-floating": pointForThread ? void 0 : "true",
570
- "data-slot": "comment-layer-popover",
571
- ref: (element) => openedColumn && measured(opened.id)(element)
572
- }, threadView(opened))) : null;
573
- const placement = draft && point ? placeDraft(point, draft.anchor.kind === "page", draftWidth.value, screenWidth.value) : void 0;
574
- const draftColumn = draftInMargin ? inColumn(draftPositionKey) : void 0;
575
- const composing = draft && placement ? h("div", {
576
- ...side(placement.x, placement.y),
577
- "data-flip-x": placement.flipX ? "true" : void 0,
578
- ...(draft.anchor.kind === "area" || draft.anchor.kind === "image") && placement.y > draftAboveRoom && !draftBelow.value ? { "data-above": "true" } : {},
579
- "data-draft": "true",
580
- "data-kind": draft.anchor.kind,
581
- "data-slot": "comment-layer-item",
582
- style: place(placement)
583
- }, [h(CommentPin, {
584
- author: user.value,
585
- "data-shape": pinShape(draft.anchor.kind),
586
- draft: true
587
- }), h("div", {
588
- ...draftColumn,
589
- "data-motion-appear": draftColumn ? void 0 : "[data-slot=comment-pin]",
590
- "data-slot": "comment-layer-popover",
591
- style: draftColumn?.style ?? { "--vh-comment-draft-left": `${placement.left}px` },
592
- ref: (element) => {
593
- draftCard.value = element instanceof HTMLElement ? element : null;
594
- if (draftColumn) measured(draftPositionKey)(element);
595
- }
596
- }, composerView(draft))]) : null;
597
- return h("div", {
598
- "data-active": state.active.value ? "true" : void 0,
599
- "data-comments-ui": "",
600
- "data-slot": "comment-layer",
601
- ref: layer
602
- }, [
603
- state.active.value ? h("div", {
604
- "data-slot": "comment-layer-overlay",
605
- onPointercancel: () => {
606
- down = null;
607
- drawing.value = null;
608
- },
609
- onPointerdown: press,
610
- onPointermove: move,
611
- onPointerup: release
612
- }, drawing.value ? [h("div", {
613
- "data-slot": "comment-layer-area",
614
- style: {
615
- left: `${drawing.value.left}px`,
616
- top: `${drawing.value.top}px`,
617
- width: `${drawing.value.width}px`,
618
- height: `${drawing.value.height}px`
619
- }
620
- }, [...[
621
- "top-left",
622
- "top-right",
623
- "bottom-left",
624
- "bottom-right"
625
- ].map((corner) => h("span", {
626
- "data-corner": corner,
627
- "data-slot": "comment-layer-area-handle",
628
- key: corner
629
- })), h("span", { "data-slot": "comment-layer-area-size" }, `${Math.round(drawing.value.width)} × ${Math.round(drawing.value.height)}`)])] : []) : null,
630
- ...items,
631
- composing,
632
- openThread,
633
- margin?.node,
634
- slots.default?.({ comments: state }) ?? [h(CommentToolbar, {
635
- comments: state,
636
- people: props.people
637
- }), state.listOpen.value ? h(CommentList, {
638
- comments: state,
639
- navigate: props.navigate
640
- }) : null]
641
- ]);
642
- };
643
- }
644
- });
645
- export { CommentLayer };
1
+ export { t as CommentLayer } from "../../comment-layer-Ck2H24oJ.js";
@@ -1,2 +1,2 @@
1
- import { a as CommentPanelVariant, c as CommentUpload, i as CommentPanelSlots, n as CommentGroupSlotScope, o as CommentRowSlotScope, r as CommentPanel, s as CommentRowSlots, t as CommentGroup } from "../../comment-panel-DISGe7yM.js";
2
- export { CommentGroup, CommentGroupSlotScope, CommentPanel, CommentPanelSlots, CommentPanelVariant, CommentRowSlotScope, CommentRowSlots, CommentUpload };
1
+ import { a as CommentPanelVariant, i as CommentPanelSlots, n as CommentGroupSlotScope, o as CommentUpload, r as CommentPanel, t as CommentGroup } from "../../comment-panel-Djx-KxVa.js";
2
+ export { CommentGroup, CommentGroupSlotScope, CommentPanel, CommentPanelSlots, CommentPanelVariant, CommentUpload };