@vite-hub/ui 0.6.1 → 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 (318) hide show
  1. package/README.md +105 -45
  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/{vue-d2Td6uu2.js → client-BG-oCUtv-5i4sRwXP.js} +4156 -4156
  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/{comment-composer-X7vJKh5b.js → comment-composer-BUt6vbnr.js} +175 -37
  40. package/dist/{comment-composer-DmDM3XYP.d.ts → comment-composer-CIsbz-78.d.ts} +7 -7
  41. package/dist/{comment-layer-KnnVfdRV.d.ts → comment-layer-BlVNORgj.d.ts} +17 -8
  42. package/dist/comment-layer-Ck2H24oJ.js +1206 -0
  43. package/dist/{comment-panel-DoLDOw3E.d.ts → comment-panel-Djx-KxVa.d.ts} +28 -21
  44. package/dist/comment-selection-bar-CbOEI98x.d.ts +33 -0
  45. package/dist/comment-selection-bar-CxPkJxVl.js +145 -0
  46. package/dist/comment-send.css +2 -2
  47. package/dist/{comment-thread-jqPx6aJ8.js → comment-thread-C_Q4UDaV.js} +74 -49
  48. package/dist/{comment-thread-DPV2kqA4.d.ts → comment-thread-X6gYMNay.d.ts} +11 -10
  49. package/dist/comments-B1itauwb.d.ts +52 -0
  50. package/dist/{comments-9MDSNm-9.js → comments-BaSrroRV.js} +32 -4
  51. package/dist/comments-BtD28xEn.js +390 -0
  52. package/dist/{comments-OWjNidkP.d.ts → comments-ZfV6IZs8.d.ts} +9 -2
  53. package/dist/components-CM5mZe0a.js +269 -0
  54. package/dist/{config-LRonN53j.js → config-CFwvNt4Y.js} +11 -30
  55. package/dist/{config-COSdO-ay.d.ts → config-JmsTI7gs.d.ts} +20 -33
  56. package/dist/connection-status-BVSH2ZVo.js +72 -0
  57. package/dist/connection-status-g62BTn44.d.ts +37 -0
  58. package/dist/copy-button-CRiXUFsl.d.ts +17 -0
  59. package/dist/device-frame-BW6IjB6P.d.ts +78 -0
  60. package/dist/device-frame-DDWoyB-G.js +515 -0
  61. package/dist/diffs-BTKaVnsb.d.ts +272 -0
  62. package/dist/diffs.d.ts +3 -0
  63. package/dist/{pierre-code-view-C49BVDrc.js → diffs.js} +147 -4223
  64. package/dist/drop-field-C0bXv1J-.d.ts +35 -0
  65. package/dist/drop-field-DKpYQ3tO.js +77 -0
  66. package/dist/editor-BsOTjnnN.d.ts +540 -0
  67. package/dist/{markdown-editor-D1irG9Xl.js → editor-DJPUs1nt.js} +833 -106
  68. package/dist/editor.d.ts +2 -0
  69. package/dist/editor.js +3 -0
  70. package/dist/element-BpjNQvZ0.js +6 -0
  71. package/dist/{file-tree-CRFIdtzw.js → file-tree-B4JKbp4r.js} +19 -18
  72. package/dist/{file-tree-DOtkeBaq.d.ts → file-tree-BdnKA6UA.d.ts} +33 -8
  73. package/dist/file-tree-DDSIafDn.d.ts +22 -0
  74. package/dist/file-tree-DS5shGSL.js +46 -0
  75. package/dist/file-tree.d.ts +2 -0
  76. package/dist/file-tree.js +1 -0
  77. package/dist/files-cuVXzWlx.js +30 -0
  78. package/dist/filter-search-C9e6sGij.d.ts +28 -0
  79. package/dist/filter-search-COZsoRiR.js +73 -0
  80. package/dist/formatCSSVariablePrefix-DLS1Ed1_.js +5 -0
  81. package/dist/headless-2IcUWHMq.d.ts +51 -0
  82. package/dist/headless.d.ts +7 -4
  83. package/dist/headless.js +5 -3
  84. package/dist/highlight.d.ts +2 -0
  85. package/dist/highlight.js +1 -0
  86. package/dist/{highlights-C2AbEdDI.js → highlights-8Al0-h-v.js} +3 -2
  87. package/dist/{hold-to-delete-BSMrpE-i.d.ts → hold-to-delete-CQc1JaG_.d.ts} +7 -0
  88. package/dist/{hold-to-delete-Cludb56v.js → hold-to-delete-CcQbfiQx.js} +111 -20
  89. package/dist/hold-to-delete-cOPqQ9FJ.js +85 -0
  90. package/dist/hold-to-delete-ksBE7wxc.d.ts +58 -0
  91. package/dist/index-9Z6Gwtnf.d.ts +77 -0
  92. package/dist/{index-B2cbt3py.d.ts → index-D3-uYBqH.d.ts} +1 -1
  93. package/dist/index.d.ts +165 -52
  94. package/dist/index.js +127 -671
  95. package/dist/markdown-BLALLOc0.d.ts +45 -0
  96. package/dist/{markdown-renderer-DMyYKeil.js → markdown-DDyOdYq_.js} +125 -127
  97. package/dist/{parts/components/markdown-renderer.d.ts → markdown-DkDxdpMU.d.ts} +10 -7
  98. package/dist/markdown-editor.d.ts +51 -98
  99. package/dist/markdown-editor.js +70 -3
  100. package/dist/markdown.d.ts +2 -0
  101. package/dist/markdown.js +1 -0
  102. package/dist/marker-CvcWZ3Zp.d.ts +59 -0
  103. package/dist/marker-DNL6QR3L.js +63 -0
  104. package/dist/message-BwivYIEl.js +13 -0
  105. package/dist/message-DEq4K5cQ.d.ts +72 -0
  106. package/dist/message-parts-B1BZFVKe.d.ts +3 -0
  107. package/dist/message-parts-CG3gNWn8.d.ts +11 -0
  108. package/dist/message-parts.d.ts +2 -0
  109. package/dist/message-parts.js +1 -0
  110. package/dist/message-scroller-D7AvM31v.d.ts +41 -0
  111. package/dist/motion/core.d.ts +4 -4
  112. package/dist/motion/core.js +5 -11
  113. package/dist/motion-BH6ShUam.d.ts +12 -0
  114. package/dist/{effects-C1zYpSpg.js → motion-core-BdTfxAhY.js} +1779 -55
  115. package/dist/{motion-core-Dh20n5Se.d.ts → motion-core-BfIefToe.d.ts} +30 -73
  116. package/dist/motion-dPwxx3Wk.js +76 -0
  117. package/dist/{install-C4LwcJda.js → motion-itHFtXwA.js} +1 -1
  118. package/dist/motion-list-BBbz93WT.js +49 -0
  119. package/dist/motion.d.ts +5 -14
  120. package/dist/motion.js +6 -13
  121. package/dist/nuxt-ui-CPdiTwwD.js +22 -0
  122. package/dist/nuxt.d.ts +9 -5
  123. package/dist/nuxt.js +28 -32
  124. package/dist/parts/components/agent-session.d.ts +2 -295
  125. package/dist/parts/components/agent-session.js +1 -659
  126. package/dist/parts/components/attachment.d.ts +2 -85
  127. package/dist/parts/components/attachment.js +3 -72
  128. package/dist/parts/components/avatar-stack.d.ts +3 -2
  129. package/dist/parts/components/avatar-stack.js +1 -60
  130. package/dist/parts/components/bubble.d.ts +2 -69
  131. package/dist/parts/components/bubble.js +3 -52
  132. package/dist/parts/components/chat-message.d.ts +3 -25
  133. package/dist/parts/components/chat-message.js +1 -50
  134. package/dist/parts/components/chat-session.d.ts +2 -26
  135. package/dist/parts/components/chat-session.js +1 -37
  136. package/dist/parts/components/chat.d.ts +3 -52
  137. package/dist/parts/components/chat.js +1 -105
  138. package/dist/parts/components/code-block.d.ts +2 -102
  139. package/dist/parts/components/code-block.js +4 -109
  140. package/dist/parts/components/code-view.d.ts +3 -268
  141. package/dist/parts/components/code-view.js +1 -1
  142. package/dist/parts/components/comment-composer.d.ts +1 -1
  143. package/dist/parts/components/comment-composer.js +1 -1
  144. package/dist/parts/components/comment-layer.d.ts +1 -1
  145. package/dist/parts/components/comment-layer.js +1 -634
  146. package/dist/parts/components/comment-panel.d.ts +2 -2
  147. package/dist/parts/components/comment-panel.js +22 -16
  148. package/dist/parts/components/comment-selection-bar.d.ts +2 -2
  149. package/dist/parts/components/comment-selection-bar.js +1 -116
  150. package/dist/parts/components/comment-thread.d.ts +1 -1
  151. package/dist/parts/components/comment-thread.js +1 -3
  152. package/dist/parts/components/comments.d.ts +8 -9
  153. package/dist/parts/components/comments.js +6 -9
  154. package/dist/parts/components/connection-status.d.ts +2 -36
  155. package/dist/parts/components/connection-status.js +1 -64
  156. package/dist/parts/components/copy-button.d.ts +3 -126
  157. package/dist/parts/components/copy-button.js +3 -226
  158. package/dist/parts/components/device-frame.d.ts +2 -128
  159. package/dist/parts/components/device-frame.js +1 -470
  160. package/dist/parts/components/drop-field.d.ts +2 -67
  161. package/dist/parts/components/drop-field.js +1 -76
  162. package/dist/parts/components/file-tree.d.ts +3 -2
  163. package/dist/parts/components/file-tree.js +3 -1
  164. package/dist/parts/components/filter-search.d.ts +2 -45
  165. package/dist/parts/components/filter-search.js +1 -57
  166. package/dist/parts/components/hold-to-delete.d.ts +2 -80
  167. package/dist/parts/components/hold-to-delete.js +1 -75
  168. package/dist/parts/components/markdown.d.ts +3 -45
  169. package/dist/parts/components/markdown.js +1 -46
  170. package/dist/parts/components/marker.d.ts +2 -32
  171. package/dist/parts/components/marker.js +1 -22
  172. package/dist/parts/components/message-parts.d.ts +3 -25
  173. package/dist/parts/components/message-parts.js +1 -45
  174. package/dist/parts/components/message.d.ts +2 -32
  175. package/dist/parts/components/message.js +3 -22
  176. package/dist/parts/components/motion-list.d.ts +2 -40
  177. package/dist/parts/components/motion-list.js +1 -41
  178. package/dist/parts/components/motion.d.ts +5 -118
  179. package/dist/parts/components/motion.js +4 -171
  180. package/dist/parts/components/patch-parsers.d.ts +1 -1
  181. package/dist/parts/components/progress.d.ts +2 -39
  182. package/dist/parts/components/progress.js +1 -53
  183. package/dist/parts/components/prompt-input.d.ts +2 -134
  184. package/dist/parts/components/prompt-input.js +1 -253
  185. package/dist/parts/components/relative-time.d.ts +2 -71
  186. package/dist/parts/components/relative-time.js +1 -1
  187. package/dist/parts/components/status.d.ts +2 -58
  188. package/dist/parts/components/status.js +1 -47
  189. package/dist/parts/components/sync-status.d.ts +2 -22
  190. package/dist/parts/components/sync-status.js +1 -48
  191. package/dist/parts/components/tool-list.d.ts +2 -28
  192. package/dist/parts/components/tool-list.js +1 -118
  193. package/dist/parts/components/trace-run.d.ts +2 -25
  194. package/dist/parts/components/trace-run.js +1 -89
  195. package/dist/parts/components/trace.d.ts +2 -59
  196. package/dist/parts/components/trace.js +1 -76
  197. package/dist/parts/composables/attachments.js +75 -1
  198. package/dist/parts/headless/choices-input.d.ts +2 -2
  199. package/dist/parts/headless/choices-input.js +49 -37
  200. package/dist/parts/headless/comments.d.ts +1 -1
  201. package/dist/parts/headless/comments.js +1 -1
  202. package/dist/parts/headless/message-scroller.d.ts +2 -2
  203. package/dist/parts/headless/message-scroller.js +211 -309
  204. package/dist/parts/headless/relative-time.d.ts +2 -0
  205. package/dist/parts/headless/relative-time.js +1 -0
  206. package/dist/parts/workspace/browser-support-notice.js +6 -5
  207. package/dist/parts/workspace/connect-panel.js +1 -1
  208. package/dist/parts/workspace/runners/web-container.js +2 -2
  209. package/dist/parts/workspace/workspace-bar.d.ts +1 -1
  210. package/dist/parts/workspace/workspace-bar.js +1 -1
  211. package/dist/parts/workspace/workspace-boot-status.d.ts +1 -1
  212. package/dist/parts/workspace/workspace-boot-status.js +1 -206
  213. package/dist/parts/workspace/workspace-editor-head.d.ts +1 -1
  214. package/dist/parts/workspace/workspace-editor-head.js +1 -1
  215. package/dist/parts/workspace/workspace-editor.d.ts +2 -2
  216. package/dist/parts/workspace/workspace-examples.js +1 -1
  217. package/dist/parts/workspace/workspace-file-tree.d.ts +1 -1
  218. package/dist/parts/workspace/workspace-file-tree.js +3 -2
  219. package/dist/parts/workspace/workspace-guide.js +1 -1
  220. package/dist/parts/workspace/workspace-preview.d.ts +1 -1
  221. package/dist/parts/workspace/workspace-preview.js +14 -12
  222. package/dist/parts/workspace/workspace-shell.d.ts +1 -1
  223. package/dist/parts/workspace/workspace-shell.js +11 -11
  224. package/dist/parts/workspace/workspace-sidebar.d.ts +2 -2
  225. package/dist/parts/workspace/workspace-sidebar.js +2 -2
  226. package/dist/parts/workspace/workspace-start.js +1 -1
  227. package/dist/parts/workspace/workspace-steps.js +1 -1
  228. package/dist/parts/workspace/workspace.d.ts +3 -3
  229. package/dist/parts/workspace/workspace.js +5 -5
  230. package/dist/press-BuEC-XvZ.d.ts +83 -0
  231. package/dist/progress-Ch0fA-bf.d.ts +8 -0
  232. package/dist/progress-D_9sG648.js +47 -0
  233. package/dist/prompt-input-CRXEJBAK.js +412 -0
  234. package/dist/prompt-input-j4OFTF5p.d.ts +116 -0
  235. package/dist/relative-time-BnJfjeEm.js +131 -0
  236. package/dist/relative-time-BuP-Gvzn.d.ts +43 -0
  237. package/dist/{relative-time-DJnw45tr.js → relative-time-Dz2DR4eb.js} +64 -114
  238. package/dist/relative-time-grHFu1kY.d.ts +11 -0
  239. package/dist/{ring-GaJsg32c.js → ring-DoL9jivj.js} +1 -2
  240. package/dist/runtime/nuxt-plugin.js +2 -5
  241. package/dist/{shiki-CbfEu_Az.js → shiki-CxzM_xNo.js} +3 -2
  242. package/dist/stand-ins-CuKM1UH1.js +339 -0
  243. package/dist/status-B2Yhrwv8.js +67 -0
  244. package/dist/status-ySiRa-8O.d.ts +38 -0
  245. package/dist/{stream-tokenizer-ByC3l0HQ.js → stream-tokenizer-BsjV6wxW.js} +1 -1
  246. package/dist/styles.css +4343 -3403
  247. package/dist/sync-status-BRroyOre.js +59 -0
  248. package/dist/sync-status-D4KdGO6y.d.ts +35 -0
  249. package/dist/theme.css +3 -0
  250. package/dist/theme.d.ts +14 -0
  251. package/dist/theme.js +19 -8
  252. package/dist/{themes-DKugPHlg.js → themes-B0_ioVT0.js} +1 -1
  253. package/dist/tool-list-DDaCqpR6.js +209 -0
  254. package/dist/tool-list-DMRPM0Yi.d.ts +50 -0
  255. package/dist/trace-KCBvOsw_.d.ts +113 -0
  256. package/dist/trace-run-Dk962P5a.d.ts +49 -0
  257. package/dist/trace-run-nh6FIsl6.js +202 -0
  258. package/dist/{opt-out-D66l60sg.js → tween-lVMRCUEv.js} +60 -1
  259. package/dist/types-BF_U0tgp.d.ts +74 -0
  260. package/dist/types-CTk3aNb5.d.ts +15 -0
  261. package/dist/types-D0a3i4Fw.d.ts +21 -0
  262. package/dist/types-DTecvcsZ.d.ts +35 -0
  263. package/dist/types-D_BWab7g.d.ts +75 -0
  264. package/dist/types-RHaQ4gj1.d.ts +27 -0
  265. package/dist/ui-components-CKQAPI-W.js +7 -0
  266. package/dist/unwrapDefault-CExq-4rm.js +5 -0
  267. package/dist/use-copy-DK1SSZkh.js +66 -0
  268. package/dist/utils-hi9-xROt.js +37 -0
  269. package/dist/vite.d.ts +0 -1
  270. package/dist/vite.js +8 -14
  271. package/dist/{vue-vUGpdMct.js → vue-DdYvDVOr.js} +1 -1
  272. package/dist/workspace-boot-status-CyGlJS06.js +216 -0
  273. package/dist/{workspace-shell-ChCwWPyv.d.ts → workspace-shell-B4A7CINd.d.ts} +1 -1
  274. package/dist/workspace.d.ts +1 -1
  275. package/dist/workspace.js +1 -2
  276. package/package.json +48 -14
  277. package/dist/attachments-DgwoQZKY.js +0 -88
  278. package/dist/avatar-stack-C0IKwj6g.d.ts +0 -57
  279. package/dist/choices-input-BUf-QqGj.d.ts +0 -92
  280. package/dist/code-view-Cg4nyTNA.js +0 -172
  281. package/dist/comment-attachments-DAzUbRmJ.js +0 -23
  282. package/dist/comment-list-ncwaCSVX.d.ts +0 -60
  283. package/dist/comment-person-D_IyIjXo.js +0 -39
  284. package/dist/comment-pin-hBJFiSYW.d.ts +0 -66
  285. package/dist/comment-row-DPMWI5Z0.js +0 -38
  286. package/dist/comment-selection-bar-CVuS-FNL.d.ts +0 -40
  287. package/dist/comment-send-CUkL3TbZ.js +0 -275
  288. package/dist/comment-send-MmxFsOQf.d.ts +0 -23
  289. package/dist/comment-status-nsCdrRk_.js +0 -20
  290. package/dist/drop-field-CNZgwFVO.js +0 -162
  291. package/dist/editor-Dmk3k6f6.js +0 -620
  292. package/dist/format-CPipR1FP.js +0 -19
  293. package/dist/handlers-CnbkvXjX.js +0 -181
  294. package/dist/icon-XZaCUZTG.d.ts +0 -29
  295. package/dist/image-preview-BKVUtfwQ.js +0 -104
  296. package/dist/index-B_PSX-5h.d.ts +0 -69
  297. package/dist/list-DUTAo0uC.js +0 -270
  298. package/dist/markdown-editor-B7gD60tp.d.ts +0 -189
  299. package/dist/message-scroller-BZqS63IX.d.ts +0 -173
  300. package/dist/nuxt-ui-7ByUrymx.js +0 -43
  301. package/dist/parts/components/comment-list.d.ts +0 -2
  302. package/dist/parts/components/comment-list.js +0 -173
  303. package/dist/parts/components/comment-pin.d.ts +0 -2
  304. package/dist/parts/components/comment-pin.js +0 -74
  305. package/dist/parts/components/comment-send.d.ts +0 -2
  306. package/dist/parts/components/comment-send.js +0 -1
  307. package/dist/parts/components/markdown-editor.d.ts +0 -2
  308. package/dist/parts/components/markdown-editor.js +0 -1
  309. package/dist/parts/components/markdown-renderer.js +0 -1
  310. package/dist/payload-text-DQNRbJY5.js +0 -31
  311. package/dist/progress-DL9k-ERG.js +0 -265
  312. package/dist/registry-DAIjCjWd.js +0 -77
  313. package/dist/slot-part-BWHvQ3mK.js +0 -25
  314. package/dist/text-gacox6bp.js +0 -822
  315. package/dist/travel-BliEidau.js +0 -180
  316. package/dist/tween-Dv3IIIQG.js +0 -61
  317. package/dist/types-Ceh7h7NT.d.ts +0 -31
  318. package/dist/visual-copy-CHHBfJ6O.js +0 -14
@@ -1,620 +0,0 @@
1
- import { a as useViteHubUIIcons } from "./config-LRonN53j.js";
2
- import { t as createMotionList } from "./list-DUTAo0uC.js";
3
- import { n as editorHandlersKey, t as createEditorHandlers } from "./handlers-CnbkvXjX.js";
4
- import { r as useUIComponent } from "./nuxt-ui-7ByUrymx.js";
5
- import { computed, defineComponent, h, inject, onBeforeUnmount, onMounted, ref, shallowRef } from "vue";
6
- import { Menu, MenuContent, MenuGroup, MenuGroupLabel, MenuItem, MenuItemIcon, MenuSeparator, MenuTrigger } from "@ui-sdk/vue/menu";
7
- import { flip, offset, shift } from "@floating-ui/dom";
8
- import DragHandle from "@tiptap/extension-drag-handle-vue-3";
9
- import { ReplaceStep } from "@tiptap/pm/transform";
10
- import { BubbleMenu } from "@tiptap/vue-3/menus";
11
- import { Toggle, ToggleIcon } from "@ui-sdk/vue/toggle";
12
- import { Toolbar, ToolbarButton, ToolbarGroup, ToolbarSeparator } from "@ui-sdk/vue/toolbar";
13
- import { Tooltip, TooltipContent, TooltipShortcut, TooltipTrigger } from "@ui-sdk/vue/tooltip";
14
- import { TriggerMenu, TriggerMenuContent, TriggerMenuGroup, TriggerMenuGroupLabel, TriggerMenuItem, TriggerMenuItemIcon, TriggerMenuList, TriggerMenuSeparator, TriggerMenuStatus } from "@ui-sdk/vue/trigger-menu";
15
- // src/ui-sdk/editor.ts
16
- /**
17
- * The editor parts on ui-sdk: Nuxt UI's `UEditorToolbar`, `UEditorSuggestionMenu`, and `UEditorDragHandle`, with the
18
- * props, slots, and events that ViteHub's editors use. Positioning at the selection and the block, and dragging blocks,
19
- * stay with Tiptap's own menu plugins. They run items through the handlers that the editor provides under
20
- * `editorHandlersKey`, as Nuxt UI's do.
21
- */
22
- const ToggleButton = Toggle;
23
- const ToggleButtonIcon = ToggleIcon;
24
- const Bar = Toolbar;
25
- const BarButton = ToolbarButton;
26
- const BarGroup = ToolbarGroup;
27
- const BarSeparator = ToolbarSeparator;
28
- const Tip = Tooltip;
29
- const TipTrigger = TooltipTrigger;
30
- const TipContent = TooltipContent;
31
- const TipShortcut = TooltipShortcut;
32
- const DropdownMenu = Menu;
33
- const DropdownTrigger = MenuTrigger;
34
- const DropdownContent = MenuContent;
35
- const DropdownItem = MenuItem;
36
- const SlashMenu = TriggerMenu;
37
- const SlashContent = TriggerMenuContent;
38
- const SlashList = TriggerMenuList;
39
- const SlashItem = TriggerMenuItem;
40
- const SlashStatus = TriggerMenuStatus;
41
- const BlockHandle = DragHandle;
42
- const BubbleMenu$1 = BubbleMenu;
43
- function useHandlers() {
44
- return inject(editorHandlersKey, computed(createEditorHandlers), true);
45
- }
46
- const isGroups = (items) => items.length > 0 && Array.isArray(items[0]);
47
- const groupsOf = (items) => !items?.length ? [] : isGroups(items) ? items : [items];
48
- const shortcutOf = (kbds) => kbds?.length ? kbds.map((key) => key === "meta" ? "mod" : key).join("+") : void 0;
49
- /** Nuxt UI's `UEditorToolbar`, in its `fixed` and `bubble` layouts, on ui-sdk's `Toolbar`, `Toggle`, and `Menu`. */
50
- const UEditorToolbar = defineComponent({
51
- name: "UEditorToolbar",
52
- inheritAttrs: false,
53
- props: {
54
- editor: {
55
- required: true,
56
- type: Object
57
- },
58
- items: {
59
- default: () => [],
60
- type: Array
61
- },
62
- layout: {
63
- default: "fixed",
64
- type: String
65
- },
66
- size: {
67
- default: "sm",
68
- type: String
69
- },
70
- /** For the `bubble` layout, as Tiptap's `BubbleMenu` takes them. */
71
- appendTo: {
72
- default: void 0,
73
- type: [Object, Function]
74
- },
75
- getReferencedVirtualElement: {
76
- default: void 0,
77
- type: Function
78
- },
79
- options: {
80
- default: void 0,
81
- type: Object
82
- },
83
- pluginKey: {
84
- default: void 0,
85
- type: [String, Object]
86
- },
87
- resizeDelay: {
88
- default: void 0,
89
- type: Number
90
- },
91
- shouldShow: {
92
- default: void 0,
93
- type: Function
94
- },
95
- updateDelay: {
96
- default: void 0,
97
- type: Number
98
- },
99
- ui: {
100
- default: () => ({}),
101
- type: Object
102
- }
103
- },
104
- setup(props, { attrs, slots }) {
105
- const UIcon = useUIComponent("UIcon");
106
- const handlers = useHandlers();
107
- const icons = useViteHubUIIcons();
108
- const isActive = (item) => {
109
- if (!props.editor.isEditable) return false;
110
- if ("items" in item && item.items?.length) return groupsOf(item.items).flat().some(isActive);
111
- if (!item.kind) return "active" in item && item.active || false;
112
- return handlers.value[item.kind]?.isActive(props.editor, item) ?? false;
113
- };
114
- const isDisabled = (item) => {
115
- if (!props.editor.isEditable) return true;
116
- if ("items" in item && item.items?.length) {
117
- const actionable = groupsOf(item.items).flat().filter((entry) => entry.type !== "separator" && entry.type !== "label");
118
- return !actionable.length || actionable.every(isDisabled);
119
- }
120
- if (!item.kind) return item.disabled ?? false;
121
- const handler = handlers.value[item.kind];
122
- if (!handler) return false;
123
- return Boolean(handler.isDisabled?.(props.editor, item)) || !handler.canExecute(props.editor, item);
124
- };
125
- const onClick = (event, item) => {
126
- if (!props.editor.isEditable || isDisabled(item)) return;
127
- if (!item.kind || "items" in item && item.items) {
128
- if ("onClick" in item && item.onClick) for (const run of [item.onClick].flat()) run(event);
129
- return;
130
- }
131
- handlers.value[item.kind]?.execute(props.editor, item).run();
132
- };
133
- const content = (item) => {
134
- const child = item.items ? groupsOf(item.items).flat().find((entry) => entry.kind && isActive(entry)) : void 0;
135
- const icon = child?.icon ?? item.icon;
136
- const label = item.label !== void 0 && child?.label ? child.label : item.label;
137
- return [
138
- icon ? h(ToggleButtonIcon, () => h(UIcon, { name: icon })) : null,
139
- label ? h("span", { "data-slot": "editor-toolbar-label" }, label) : null,
140
- item.trailingIcon ? h(UIcon, {
141
- "data-slot": "editor-toolbar-trailing-icon",
142
- name: item.trailingIcon
143
- }) : null
144
- ];
145
- };
146
- const named = (item) => ({ "aria-label": item["aria-label"] ?? (item.label ? void 0 : item.tooltip?.text) });
147
- const withTooltip = (item, control) => {
148
- if (!item.tooltip?.text) return control({});
149
- const shortcut = shortcutOf(item.tooltip.kbds);
150
- return h(Tip, {
151
- disabled: isDisabled(item),
152
- shortcut,
153
- type: "description"
154
- }, () => [h(TipTrigger, null, { render: ({ props: trigger }) => control(trigger) }), h(TipContent, { sideOffset: 6 }, () => [item.tooltip?.text, shortcut ? h(TipShortcut) : null])]);
155
- };
156
- const menuEntry = (entry, index) => {
157
- if (entry.type === "label") return h(MenuGroupLabel, { key: index }, () => entry.label);
158
- if (entry.type === "separator") return h(MenuSeparator, { key: index });
159
- const active = Boolean(entry.kind) && isActive(entry);
160
- return h(DropdownItem, {
161
- "data-active": active ? "" : void 0,
162
- disabled: isDisabled(entry),
163
- key: index,
164
- label: entry.label,
165
- onSelect: (event) => entry.kind ? onClick(event, entry) : entry.onSelect?.(event)
166
- }, () => [
167
- entry.icon ? h(MenuItemIcon, () => h(UIcon, { name: entry.icon })) : null,
168
- h("span", entry.label),
169
- active ? h(UIcon, {
170
- "data-slot": "editor-toolbar-check",
171
- name: icons.value.check
172
- }) : null
173
- ]);
174
- };
175
- const control = (item, index) => {
176
- const slot = slots[item.slot ?? "item"];
177
- if (slot) return slot({
178
- index,
179
- isActive,
180
- isDisabled,
181
- item,
182
- onClick
183
- });
184
- const data = {
185
- "data-size": props.size,
186
- key: index
187
- };
188
- if (item.items?.length) {
189
- const groups = groupsOf(item.items);
190
- return h(DropdownMenu, { key: index }, () => [withTooltip(item, (trigger) => h(BarButton, {
191
- ...data,
192
- disabled: isDisabled(item)
193
- }, { render: ({ props: button }) => h(DropdownTrigger, {
194
- ...trigger,
195
- ...button,
196
- ...named(item),
197
- "data-active": isActive(item) ? "" : void 0,
198
- "data-slot": "toggle"
199
- }, () => content(item)) })), h(DropdownContent, {
200
- align: item.content?.align ?? "start",
201
- class: item.ui?.content,
202
- side: item.content?.side,
203
- sideOffset: item.content?.sideOffset ?? 8
204
- }, () => groups.flatMap((group, groupIndex) => [groupIndex ? h(MenuSeparator, { key: `separator-${groupIndex}` }) : null, h(MenuGroup, { key: `group-${groupIndex}` }, () => group.map(menuEntry))]))]);
205
- }
206
- if (item.kind) return withTooltip(item, (trigger) => h(ToggleButton, {
207
- ...trigger,
208
- ...data,
209
- ...named(item),
210
- disabled: isDisabled(item),
211
- pressed: isActive(item),
212
- onPressedChange: (_pressed, details) => onClick(details.event ?? new Event("click"), item)
213
- }, () => content(item)));
214
- return withTooltip(item, (trigger) => h(BarButton, {
215
- ...trigger,
216
- ...data,
217
- ...named(item),
218
- "data-active": isActive(item) ? "" : void 0,
219
- "data-slot": "toggle",
220
- disabled: isDisabled(item),
221
- onClick: (event) => onClick(event, item)
222
- }, () => content(item)));
223
- };
224
- return () => {
225
- props.editor.state;
226
- const groups = groupsOf(props.items);
227
- const { class: baseClass, ...rootAttrs } = attrs;
228
- const bar = h(Bar, {
229
- "aria-label": "Formatting",
230
- ...props.layout === "fixed" ? rootAttrs : {},
231
- class: [
232
- "vh-editor-toolbar",
233
- props.ui.base,
234
- baseClass
235
- ],
236
- "data-layout": props.layout
237
- }, () => groups.flatMap((group, groupIndex) => [h(BarGroup, {
238
- class: props.ui.group,
239
- key: `group-${groupIndex}`
240
- }, () => group.map(control)), groupIndex < groups.length - 1 ? h(BarSeparator, {
241
- class: props.ui.separator,
242
- key: `separator-${groupIndex}`
243
- }) : null]));
244
- if (props.layout !== "bubble") return bar;
245
- return h(BubbleMenu$1, {
246
- ...rootAttrs,
247
- appendTo: props.appendTo,
248
- class: ["vh-editor-toolbar-root", props.ui.root],
249
- editor: props.editor,
250
- getReferencedVirtualElement: props.getReferencedVirtualElement,
251
- options: {
252
- offset: 8,
253
- shift: { padding: 8 },
254
- ...props.options
255
- },
256
- pluginKey: props.pluginKey,
257
- resizeDelay: props.resizeDelay,
258
- shouldShow: props.shouldShow ?? null,
259
- tabindex: -1,
260
- updateDelay: props.updateDelay
261
- }, () => bar);
262
- };
263
- }
264
- });
265
- const collator = new Intl.Collator(void 0, {
266
- sensitivity: "base",
267
- usage: "search"
268
- });
269
- function contains(value, part) {
270
- if (!part) return true;
271
- const text = value.normalize("NFC");
272
- const search = part.normalize("NFC");
273
- for (let index = 0; index + search.length <= text.length; index++) if (collator.compare(text.slice(index, index + search.length), search) === 0) return true;
274
- return false;
275
- }
276
- function score(value, query) {
277
- if (!contains(value, query)) return void 0;
278
- if (contains(query, value)) return 0;
279
- if (collator.compare(value.slice(0, query.length), query) === 0) return 1;
280
- return 2;
281
- }
282
- function rank(items, query, fields) {
283
- if (!query) return items;
284
- const scored = [];
285
- for (const item of items) {
286
- let best;
287
- for (const field of fields) {
288
- const value = item[field];
289
- if (value == null) continue;
290
- for (const text of [value].flat().map(String)) {
291
- const found = Math.min(score(text, query) ?? 3, score(text.replace(/[\s_-]/g, ""), query) ?? 3);
292
- if (best === void 0 || found < best) best = found;
293
- }
294
- }
295
- if (best !== void 0 && best < 3) scored.push({
296
- item,
297
- score: best
298
- });
299
- }
300
- return scored.sort((a, b) => a.score - b.score).map(({ item }) => item);
301
- }
302
- const OBJECT = "";
303
- const choosable = (item) => item.type !== "label" && item.type !== "separator";
304
- /**
305
- * The editor as ui-sdk's `TriggerMenu` reads it. Offsets are document positions. The text before the caret is the text
306
- * of its block, after a line break that stands for the block's start, so a trigger at the start of a block matches as
307
- * one after a space does.
308
- */
309
- function tiptapAdapter(editor) {
310
- return {
311
- get element() {
312
- return editor.isDestroyed ? void 0 : editor.view.dom;
313
- },
314
- textBefore(length) {
315
- const { $head } = editor.state.selection;
316
- if (!$head.parent.isTextblock) return null;
317
- const from = Math.max(0, $head.parentOffset - length);
318
- const text = $head.parent.textBetween(from, $head.parentOffset, void 0, OBJECT);
319
- return from === 0 && text.length < length ? {
320
- offset: $head.start() - 1,
321
- text: `\n${text}`
322
- } : {
323
- offset: $head.start() + from,
324
- text
325
- };
326
- },
327
- selection() {
328
- if (editor.isDestroyed || !editor.view.hasFocus()) return null;
329
- const { from, to } = editor.state.selection;
330
- return {
331
- end: to,
332
- start: from
333
- };
334
- },
335
- rectAt(offset) {
336
- try {
337
- const rect = editor.view.coordsAtPos(offset);
338
- return {
339
- height: rect.bottom - rect.top,
340
- width: Math.max(0, rect.right - rect.left),
341
- x: rect.left,
342
- y: rect.top
343
- };
344
- } catch {
345
- return null;
346
- }
347
- },
348
- replace(range, content) {
349
- editor.chain().focus().insertContentAt({
350
- from: range.start,
351
- to: range.end
352
- }, typeof content === "string" ? content : content.label ?? "").run();
353
- },
354
- subscribe(listener) {
355
- const onTransaction = ({ transaction }) => {
356
- if (!transaction.docChanged) {
357
- if (transaction.selectionSet) listener({ type: "selection" });
358
- return;
359
- }
360
- const user = !transaction.getMeta("y-sync$");
361
- for (const step of transaction.steps) {
362
- if (!(step instanceof ReplaceStep)) continue;
363
- listener({
364
- inserted: step.slice.content.textBetween(0, step.slice.content.size, "\n", OBJECT),
365
- range: {
366
- end: step.to,
367
- start: step.from
368
- },
369
- type: "input",
370
- user
371
- });
372
- }
373
- };
374
- const onComposition = (event) => listener({ type: event.type === "compositionstart" ? "compositionstart" : "compositionend" });
375
- editor.on("transaction", onTransaction);
376
- editor.view.dom.addEventListener("compositionstart", onComposition);
377
- editor.view.dom.addEventListener("compositionend", onComposition);
378
- return () => {
379
- editor.off("transaction", onTransaction);
380
- if (!editor.isDestroyed) {
381
- editor.view.dom.removeEventListener("compositionstart", onComposition);
382
- editor.view.dom.removeEventListener("compositionend", onComposition);
383
- }
384
- };
385
- },
386
- composing: () => editor.view.composing
387
- };
388
- }
389
- /**
390
- * Nuxt UI's `UEditorSuggestionMenu` on ui-sdk's `TriggerMenu`. Typing `char` opens a list at the caret, the text after
391
- * it filters `items` with Nuxt UI's ranking, the arrow keys move the highlight and wrap, Enter or Tab runs it, and
392
- * Escape closes the list until the trigger is typed again. The caret stays in the editor, which points at the list
393
- * with `aria-controls` and `aria-activedescendant`.
394
- */
395
- const UEditorSuggestionMenu = defineComponent({
396
- name: "UEditorSuggestionMenu",
397
- inheritAttrs: false,
398
- props: {
399
- editor: {
400
- required: true,
401
- type: Object
402
- },
403
- items: {
404
- default: () => [],
405
- type: Array
406
- },
407
- char: {
408
- default: "/",
409
- type: String
410
- },
411
- filterFields: {
412
- default: () => ["label"],
413
- type: Array
414
- },
415
- limit: {
416
- default: 42,
417
- type: Number
418
- },
419
- ui: {
420
- default: () => ({}),
421
- type: Object
422
- }
423
- },
424
- setup(props, { attrs }) {
425
- const UIcon = useUIComponent("UIcon");
426
- const handlers = useHandlers();
427
- const query = ref("");
428
- const adapter = shallowRef();
429
- onMounted(() => {
430
- if (!props.editor.isDestroyed) adapter.value = tiptapAdapter(props.editor);
431
- });
432
- const flat = computed(() => groupsOf(props.items).flat());
433
- const matches = computed(() => rank(flat.value, query.value, props.filterFields).slice(0, props.limit));
434
- const groups = computed(() => groupsOf(props.items).map((group) => group.filter((item) => matches.value.includes(item)).sort((a, b) => matches.value.indexOf(a) - matches.value.indexOf(b))).filter((group) => group.some(choosable)));
435
- const triggers = computed(() => [{
436
- char: props.char,
437
- filter: false
438
- }]);
439
- const onSelect = (value, details) => {
440
- details.preventDefault();
441
- const item = flat.value[Number(value)];
442
- if (!item?.kind) return;
443
- props.editor.chain().focus().deleteRange({
444
- from: details.match.start,
445
- to: details.match.end
446
- }).run();
447
- handlers.value[item.kind]?.execute(props.editor, item).run();
448
- };
449
- return () => h(SlashMenu, {
450
- editor: adapter.value,
451
- loop: true,
452
- triggers: triggers.value,
453
- onQueryChange: (next) => query.value = next,
454
- onSelect
455
- }, () => [h(SlashStatus, { class: "vh-editor-suggestion-menu__status" }), h(SlashContent, {
456
- ...attrs,
457
- align: "start",
458
- class: [
459
- "vh-editor-suggestion-menu",
460
- props.ui.content,
461
- attrs.class
462
- ],
463
- collisionPadding: 8,
464
- side: "bottom",
465
- sideOffset: 8
466
- }, () => h(SlashList, { "aria-label": "Insert block" }, () => groups.value.flatMap((group, groupIndex) => [groupIndex ? h(TriggerMenuSeparator, { key: `separator-${groupIndex}` }) : null, h(TriggerMenuGroup, { key: `group-${groupIndex}` }, () => group.map((item, index) => {
467
- if (item.type === "label") return h(TriggerMenuGroupLabel, {
468
- class: item.class,
469
- key: `label-${index}`
470
- }, () => item.label);
471
- if (item.type === "separator") return h(TriggerMenuSeparator, { key: `separator-${index}` });
472
- const value = String(flat.value.indexOf(item));
473
- return h(SlashItem, {
474
- class: item.class,
475
- disabled: item.disabled,
476
- key: value,
477
- keywords: item.keywords,
478
- label: item.label,
479
- value
480
- }, () => [item.icon ? h(TriggerMenuItemIcon, () => h(UIcon, { name: item.icon })) : null, h("span", { "data-slot": "editor-suggestion-text" }, [h("span", { "data-slot": "editor-suggestion-label" }, item.label), item.description ? h("span", { "data-slot": "editor-suggestion-description" }, item.description) : null])]);
481
- }))])))]);
482
- }
483
- });
484
- /**
485
- * Moves the drag handle to each new place with the list mover of the motion layer, as a neighbor of a list moves. The
486
- * drag handle extension places it with `left` and `top`. A handle that was hidden shows at its new place at once.
487
- */
488
- function followPlace(element) {
489
- const parent = element.parentElement;
490
- if (!parent) return () => {};
491
- const list = createMotionList(parent, { items: () => [element] });
492
- const read = () => ({
493
- place: `${element.style.left} ${element.style.top}`,
494
- shown: element.style.visibility !== "hidden"
495
- });
496
- let last = read();
497
- list.measure();
498
- const observer = new MutationObserver(() => {
499
- const next = read();
500
- if (next.place === last.place && next.shown === last.shown) return;
501
- if (next.shown && last.shown) list.play();
502
- last = next;
503
- list.measure();
504
- });
505
- observer.observe(element, {
506
- attributes: true,
507
- attributeFilter: ["style"]
508
- });
509
- return () => {
510
- observer.disconnect();
511
- list.destroy();
512
- };
513
- }
514
- /**
515
- * Nuxt UI's `UEditorDragHandle`: a handle beside the block under the pointer, which drags the block to move it. A press
516
- * selects the block and emits `nodeChange`. The default slot replaces the button and gets `onClick`, which selects the
517
- * block and returns it, and `ui.handle()`, the class of a handle button.
518
- */
519
- const UEditorDragHandle = defineComponent({
520
- name: "UEditorDragHandle",
521
- inheritAttrs: false,
522
- props: {
523
- editor: {
524
- required: true,
525
- type: Object
526
- },
527
- icon: {
528
- default: void 0,
529
- type: String
530
- },
531
- nested: {
532
- default: false,
533
- type: [Boolean, Object]
534
- },
535
- pluginKey: {
536
- default: void 0,
537
- type: [String, Object]
538
- },
539
- ui: {
540
- default: () => ({}),
541
- type: Object
542
- }
543
- },
544
- emits: {
545
- hover: (_node) => true,
546
- nodeChange: (_node) => true
547
- },
548
- setup(props, { attrs, emit, slots }) {
549
- const UButton = useUIComponent("UButton");
550
- const current = ref();
551
- const nodeAt = (pos) => {
552
- if (pos == null || pos < 0) return void 0;
553
- const node = props.editor.state.doc.nodeAt(pos);
554
- return node ? {
555
- node: node.toJSON(),
556
- pos
557
- } : void 0;
558
- };
559
- const onNodeChange = ({ pos }) => {
560
- current.value = pos;
561
- const found = nodeAt(pos);
562
- if (found) emit("hover", found);
563
- };
564
- const onClick = () => {
565
- const found = nodeAt(current.value);
566
- if (!found) return void 0;
567
- emit("nodeChange", found);
568
- props.editor.chain().setNodeSelection(found.pos).run();
569
- return found;
570
- };
571
- const ui = { handle: (options) => [
572
- "vh-editor-drag-handle__handle",
573
- props.ui.handle,
574
- options?.class
575
- ].filter(Boolean).join(" ") };
576
- const handle = ref();
577
- let stopFollowing;
578
- onMounted(() => {
579
- const element = handle.value?.$el;
580
- if (element instanceof HTMLElement) stopFollowing = followPlace(element);
581
- });
582
- onBeforeUnmount(() => stopFollowing?.());
583
- const computePositionConfig = {
584
- middleware: [
585
- offset(({ rects }) => ({
586
- alignmentAxis: rects.reference.height > 40 ? 0 : (rects.reference.height - rects.floating.height) / 2,
587
- mainAxis: 8
588
- })),
589
- flip(),
590
- shift()
591
- ],
592
- placement: "left-start",
593
- strategy: "absolute"
594
- };
595
- return () => h(BlockHandle, {
596
- class: ["vh-editor-drag-handle", props.ui.root].filter(Boolean).join(" "),
597
- computePositionConfig,
598
- ref: handle,
599
- "data-slot": "editor-drag-handle",
600
- editor: props.editor,
601
- nested: props.nested,
602
- onClick,
603
- onNodeChange,
604
- ...props.pluginKey ? { pluginKey: props.pluginKey } : {}
605
- }, () => slots.default ? slots.default({
606
- onClick,
607
- ui
608
- }) : h(UButton, {
609
- "aria-label": "Drag to move, or press to select the block",
610
- color: "neutral",
611
- icon: props.icon ?? "i-lucide-grip-vertical",
612
- size: "sm",
613
- variant: "ghost",
614
- ...attrs,
615
- class: ui.handle({ class: attrs.class }),
616
- "data-slot": "editor-drag-handle-button"
617
- }));
618
- }
619
- });
620
- export { UEditorDragHandle, UEditorSuggestionMenu, UEditorToolbar };
@@ -1,19 +0,0 @@
1
- // src/internal/format.ts
2
- /** "320ms", "1.2s", "30s", or "1m 35s". Seconds round down, so a running counter never shows "60s". */
3
- function formatDuration(ms) {
4
- const whole = Math.round(ms);
5
- if (whole < 1e3) return `${whole}ms`;
6
- const elapsed = Math.max(ms, 1e3);
7
- const seconds = Math.floor(elapsed / 1e3);
8
- if (seconds < 10) return `${seconds}.${Math.floor(elapsed % 1e3 / 100)}s`;
9
- if (seconds < 60) return `${seconds}s`;
10
- return `${Math.floor(seconds / 60)}m ${seconds % 60}s`;
11
- }
12
- /** Two letters for an avatar without an image: `Ana Lopez` and `ana.lopez@vitehub.dev` are `AL`, `Ana` is `AN`. */
13
- function initials(name) {
14
- const words = name.replace(/@.*/, "").trim().split(/[\s._-]+/).filter(Boolean);
15
- const first = words[0] ?? "";
16
- const second = words.length > 1 ? words.at(-1) ?? "" : first.slice(1);
17
- return (first.slice(0, 1) + second.slice(0, 1)).toUpperCase() || "?";
18
- }
19
- export { initials as n, formatDuration as t };