@vite-hub/ui 0.4.1 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/README.md +102 -76
  2. package/dist/andromeeda-DaUPZ4_A.js +147 -0
  3. package/dist/announce-B0DLwflT.js +31 -0
  4. package/dist/{attachments-BzTwqRTU.js → attachments-DgwoQZKY.js} +3 -5
  5. package/dist/aurora-x-B5RPZ9i5.js +162 -0
  6. package/dist/{avatar-stack-DPRFuezh.d.ts → avatar-stack-C0IKwj6g.d.ts} +1 -3
  7. package/dist/ayu-dark-DXTaGA7I.js +137 -0
  8. package/dist/ayu-light-BCYi80Fe.js +137 -0
  9. package/dist/ayu-mirage-CgbXz-N5.js +137 -0
  10. package/dist/catppuccin-frappe-MV2xzv44.js +266 -0
  11. package/dist/catppuccin-latte-CL6jjlVD.js +266 -0
  12. package/dist/catppuccin-macchiato-Bp6oZJVK.js +266 -0
  13. package/dist/catppuccin-mocha-DOHrQ4dw.js +266 -0
  14. package/dist/{choices-input-ByXJvDn1.d.ts → choices-input-BUf-QqGj.d.ts} +0 -2
  15. package/dist/{code-view-DsU-xzic.js → code-view-Cg4nyTNA.js} +6 -8
  16. package/dist/{colors-BghReA9C-CjF9gnmy.js → colors-BghReA9C-DEq4bhEP.js} +1 -2
  17. package/dist/{comment-attachments-C4yNbcx5.js → comment-attachments-CMpYOJod.js} +1 -2
  18. package/dist/{comment-composer-fINL5bxo.d.ts → comment-composer-BI6CNJyO.d.ts} +3 -5
  19. package/dist/{comment-composer-jYv2ULNP.js → comment-composer-CzU7DdfD.js} +260 -16
  20. package/dist/{comment-layer-C_sbPIR5.d.ts → comment-layer-DyVstrs-.d.ts} +5 -7
  21. package/dist/{comment-list-BcSaLngS.d.ts → comment-list-CSK5o-Ua.d.ts} +3 -5
  22. package/dist/comment-marks.css +18 -22
  23. package/dist/{comment-panel-CfvdRUMX.d.ts → comment-panel-CEvOI3gk.d.ts} +3 -5
  24. package/dist/{comment-person-CLPlW_SS.js → comment-person-D_IyIjXo.js} +1 -2
  25. package/dist/{comment-pin-DHOdRvUw.d.ts → comment-pin-C5UeLPTa.d.ts} +1 -3
  26. package/dist/{comment-row-Bn3nr8l5.js → comment-row-DPMWI5Z0.js} +3 -4
  27. package/dist/{comment-selection-bar-CyVBNYl9.d.ts → comment-selection-bar-CVuS-FNL.d.ts} +0 -2
  28. package/dist/comment-send-DPzV9B8S.js +275 -0
  29. package/dist/comment-send-MmxFsOQf.d.ts +23 -0
  30. package/dist/comment-send.css +267 -0
  31. package/dist/comment-thread-CbPtoi8-.js +796 -0
  32. package/dist/{comment-thread-DKJjmWN0.d.ts → comment-thread-DGm1cGJt.d.ts} +4 -8
  33. package/dist/{comment-visibility-DsVuVndP.d.ts → comment-visibility-CYctacNx.d.ts} +0 -2
  34. package/dist/{comments-D0d26ghV.js → comments-C0OdHh_F.js} +5 -8
  35. package/dist/{comments-D8hulVPy.d.ts → comments-DrE9DU-E.d.ts} +1 -3
  36. package/dist/{comments-context-C2lOZyQ5.js → comments-context-CrjhleVA.js} +4 -5
  37. package/dist/{config-Dk67emQt.js → config-DztmAYYn.js} +9 -3
  38. package/dist/{config-DgxBW013.d.ts → config-xL4EBeXw.d.ts} +11 -4
  39. package/dist/dark-plus-CXEBSjk4.js +148 -0
  40. package/dist/dracula-Bvyz6eCo.js +165 -0
  41. package/dist/dracula-soft-a9indxAQ.js +115 -0
  42. package/dist/{draw-DzSmD7uo-Dwz8zoH2.js → draw-DzSmD7uo-Cb7s9kxJ.js} +359 -708
  43. package/dist/drop-field-CNZgwFVO.js +162 -0
  44. package/dist/{editor-C_wt4RRV.js → editor-CGiEVOnB.js} +44 -6
  45. package/dist/effects-g4QucvgO.js +2955 -0
  46. package/dist/{error-diagnostics-SXtnk6bz.js → error-diagnostics-BlgA9rI2.js} +1 -2
  47. package/dist/everforest-dark-9sVAxG7I.js +99 -0
  48. package/dist/everforest-light-BocTn_Hd.js +99 -0
  49. package/dist/{file-tree-C4OYgbV-.js → file-tree-CRFIdtzw.js} +58 -116
  50. package/dist/{file-tree-DlT9RGhu.d.ts → file-tree-DOtkeBaq.d.ts} +0 -14
  51. package/dist/{format-orwcdZL_.js → format-Bc9m7-r0.js} +1 -2
  52. package/dist/{getSingularPatch-Dsb8EgxR.js → getSingularPatch-C7LmmBrW.js} +375 -79
  53. package/dist/github-dark-BO9SXswM.js +142 -0
  54. package/dist/github-dark-default-XB_RHfBI.js +90 -0
  55. package/dist/github-dark-dimmed-BoGxaWUQ.js +137 -0
  56. package/dist/github-dark-high-contrast-B3X6t2fG.js +137 -0
  57. package/dist/github-light-D7VHHlUH.js +142 -0
  58. package/dist/github-light-default-BuDsGtcR.js +137 -0
  59. package/dist/github-light-high-contrast-GodZiAwh.js +137 -0
  60. package/dist/gruvbox-dark-hard-CU4LuKJc.js +140 -0
  61. package/dist/gruvbox-dark-medium-DjAsuXuH.js +140 -0
  62. package/dist/gruvbox-dark-soft-D3Zttj6R.js +140 -0
  63. package/dist/gruvbox-light-hard-4M_9onwE.js +140 -0
  64. package/dist/gruvbox-light-medium-D9QwS4kQ.js +140 -0
  65. package/dist/gruvbox-light-soft-DhYcfQql.js +140 -0
  66. package/dist/{handlers-DMl-Na3x.js → handlers-CnbkvXjX.js} +1 -2
  67. package/dist/headless.d.ts +4 -4
  68. package/dist/headless.js +1 -1
  69. package/dist/highlights-C2AbEdDI.js +2630 -0
  70. package/dist/hold-to-delete-BSMrpE-i.d.ts +49 -0
  71. package/dist/hold-to-delete-Cludb56v.js +433 -0
  72. package/dist/horizon-bright-B9u59onx.js +97 -0
  73. package/dist/horizon-tItY9ATR.js +97 -0
  74. package/dist/houston-BqKrKNQv.js +207 -0
  75. package/dist/icon-XZaCUZTG.d.ts +29 -0
  76. package/dist/{image-preview-C9tdkmEj.js → image-preview-DrLXrHpp.js} +3 -4
  77. package/dist/{index-CNY1uNTh.d.ts → index-B2cbt3py.d.ts} +3945 -2445
  78. package/dist/{index-BYRFQfCd.d.ts → index-B_PSX-5h.d.ts} +5 -11
  79. package/dist/index.d.ts +35 -32
  80. package/dist/index.js +71 -73
  81. package/dist/install-Ba9mkkqI.js +16 -0
  82. package/dist/kanagawa-dragon-BH1K3aMw.js +159 -0
  83. package/dist/kanagawa-lotus-C-4JB2io.js +159 -0
  84. package/dist/kanagawa-wave-DTQqNe5k.js +159 -0
  85. package/dist/laserwave-BkV0uIaG.js +84 -0
  86. package/dist/light-plus-CxYgEz7U.js +149 -0
  87. package/dist/list-DUTAo0uC.js +270 -0
  88. package/dist/loader-CYMEjzwc.js +79 -0
  89. package/dist/{markdown-editor-CMbNZOdN.js → markdown-editor-3gY9MLvy.js} +237 -38
  90. package/dist/{markdown-editor-wQF0yD5o.d.ts → markdown-editor-B7gD60tp.d.ts} +0 -6
  91. package/dist/markdown-editor.d.ts +1 -5
  92. package/dist/markdown-editor.js +2 -2
  93. package/dist/markdown-renderer-DFS1vf1h.js +26578 -0
  94. package/dist/material-theme-Xdm37UUJ.js +105 -0
  95. package/dist/material-theme-darker-Blaz0cgN.js +105 -0
  96. package/dist/material-theme-lighter-BddVxBVA.js +105 -0
  97. package/dist/material-theme-ocean-C4qhfFHi.js +105 -0
  98. package/dist/material-theme-palenight-ChHDqoiA.js +105 -0
  99. package/dist/{message-scroller-jrYN9dG9.d.ts → message-scroller-a6qaYHno.d.ts} +2 -4
  100. package/dist/min-dark-DpGSNjaW.js +125 -0
  101. package/dist/min-light-BMfJUsU2.js +122 -0
  102. package/dist/monokai-DW19E-zg.js +162 -0
  103. package/dist/motion/core.d.ts +4 -0
  104. package/dist/motion/core.js +11 -0
  105. package/dist/motion-core-DNl7TR1T.d.ts +402 -0
  106. package/dist/motion.d.ts +14 -0
  107. package/dist/motion.js +13 -0
  108. package/dist/night-owl-B7Of8ee9.js +188 -0
  109. package/dist/night-owl-light-Vu9tTNpS.js +189 -0
  110. package/dist/nord-CDzJumeN.js +128 -0
  111. package/dist/nuxt-ui-7ByUrymx.js +43 -0
  112. package/dist/nuxt.d.ts +1 -7
  113. package/dist/nuxt.js +16 -11
  114. package/dist/one-dark-pro-hS_sNo5p.js +124 -0
  115. package/dist/one-light-CD4ItzSC.js +153 -0
  116. package/dist/opt-out-D66l60sg.js +205 -0
  117. package/dist/parts/components/agent-session.d.ts +1 -3
  118. package/dist/parts/components/agent-session.js +3 -4
  119. package/dist/parts/components/attachment.d.ts +2 -4
  120. package/dist/parts/components/attachment.js +3 -4
  121. package/dist/parts/components/avatar-stack.d.ts +1 -1
  122. package/dist/parts/components/avatar-stack.js +4 -4
  123. package/dist/parts/components/bubble.d.ts +2 -4
  124. package/dist/parts/components/bubble.js +2 -3
  125. package/dist/parts/components/chat-message.d.ts +1 -3
  126. package/dist/parts/components/chat-message.js +1 -2
  127. package/dist/parts/components/chat-session.d.ts +2 -4
  128. package/dist/parts/components/chat-session.js +1 -2
  129. package/dist/parts/components/chat.d.ts +1 -3
  130. package/dist/parts/components/chat.js +4 -5
  131. package/dist/parts/components/code-block.d.ts +2 -4
  132. package/dist/parts/components/code-block.js +3 -4
  133. package/dist/parts/components/code-view.d.ts +1 -3
  134. package/dist/parts/components/code-view.js +1 -2
  135. package/dist/parts/components/comment-composer.d.ts +1 -1
  136. package/dist/parts/components/comment-composer.js +1 -2
  137. package/dist/parts/components/comment-layer.d.ts +1 -1
  138. package/dist/parts/components/comment-layer.js +28 -11
  139. package/dist/parts/components/comment-list.d.ts +1 -1
  140. package/dist/parts/components/comment-list.js +13 -9
  141. package/dist/parts/components/comment-panel.d.ts +1 -1
  142. package/dist/parts/components/comment-panel.js +27 -14
  143. package/dist/parts/components/comment-pin.d.ts +1 -1
  144. package/dist/parts/components/comment-pin.js +2 -3
  145. package/dist/parts/components/comment-selection-bar.d.ts +1 -1
  146. package/dist/parts/components/comment-selection-bar.js +4 -4
  147. package/dist/parts/components/comment-send.d.ts +2 -0
  148. package/dist/parts/components/comment-send.js +1 -0
  149. package/dist/parts/components/comment-thread.d.ts +1 -1
  150. package/dist/parts/components/comment-thread.js +2 -597
  151. package/dist/parts/components/comments.d.ts +9 -8
  152. package/dist/parts/components/comments.js +7 -6
  153. package/dist/parts/components/connection-status.d.ts +1 -3
  154. package/dist/parts/components/connection-status.js +1 -2
  155. package/dist/parts/components/copy-button.d.ts +14 -6
  156. package/dist/parts/components/copy-button.js +225 -1
  157. package/dist/parts/components/device-frame.d.ts +3 -5
  158. package/dist/parts/components/device-frame.js +1 -2
  159. package/dist/parts/components/drop-field.d.ts +67 -0
  160. package/dist/parts/components/drop-field.js +76 -0
  161. package/dist/parts/components/file-tree.d.ts +1 -1
  162. package/dist/parts/components/file-tree.js +1 -2
  163. package/dist/parts/components/filter-search.d.ts +2 -4
  164. package/dist/parts/components/filter-search.js +2 -3
  165. package/dist/parts/components/hold-to-delete.d.ts +80 -0
  166. package/dist/parts/components/hold-to-delete.js +75 -0
  167. package/dist/parts/components/markdown-editor.d.ts +1 -1
  168. package/dist/parts/components/markdown-editor.js +1 -2
  169. package/dist/parts/components/markdown-renderer.d.ts +1 -3
  170. package/dist/parts/components/markdown-renderer.js +1 -23077
  171. package/dist/parts/components/markdown.d.ts +1 -3
  172. package/dist/parts/components/markdown.js +2 -3
  173. package/dist/parts/components/marker.d.ts +2 -4
  174. package/dist/parts/components/marker.js +2 -3
  175. package/dist/parts/components/message-parts.d.ts +1 -3
  176. package/dist/parts/components/message-parts.js +14 -7
  177. package/dist/parts/components/message.d.ts +1 -3
  178. package/dist/parts/components/message.js +2 -3
  179. package/dist/parts/components/motion-list.d.ts +40 -0
  180. package/dist/parts/components/motion-list.js +41 -0
  181. package/dist/parts/components/motion.d.ts +122 -0
  182. package/dist/parts/components/motion.js +171 -0
  183. package/dist/parts/components/patch-parsers.d.ts +1 -1
  184. package/dist/parts/components/patch-parsers.js +1 -2
  185. package/dist/parts/components/progress.d.ts +39 -0
  186. package/dist/parts/components/progress.js +53 -0
  187. package/dist/parts/components/prompt-input.d.ts +5 -7
  188. package/dist/parts/components/prompt-input.js +5 -6
  189. package/dist/parts/components/relative-time.d.ts +1 -3
  190. package/dist/parts/components/relative-time.js +1 -2
  191. package/dist/parts/components/status.d.ts +1 -3
  192. package/dist/parts/components/status.js +1 -2
  193. package/dist/parts/components/sync-status.d.ts +1 -3
  194. package/dist/parts/components/sync-status.js +3 -3
  195. package/dist/parts/components/tool-list.d.ts +2 -4
  196. package/dist/parts/components/tool-list.js +2 -3
  197. package/dist/parts/components/trace-run.d.ts +2 -4
  198. package/dist/parts/components/trace-run.js +4 -5
  199. package/dist/parts/components/trace.d.ts +2 -4
  200. package/dist/parts/components/trace.js +2 -3
  201. package/dist/parts/composables/attachments.d.ts +1 -3
  202. package/dist/parts/composables/attachments.js +1 -2
  203. package/dist/parts/composables/highlighted-code.d.ts +1 -3
  204. package/dist/parts/composables/highlighted-code.js +1 -2
  205. package/dist/parts/headless/choices-input.d.ts +1 -1
  206. package/dist/parts/headless/choices-input.js +3 -4
  207. package/dist/parts/headless/comment-visibility.d.ts +1 -1
  208. package/dist/parts/headless/comment-visibility.js +1 -2
  209. package/dist/parts/headless/comments.d.ts +1 -1
  210. package/dist/parts/headless/comments.js +1 -2
  211. package/dist/parts/headless/message-scroller.d.ts +1 -1
  212. package/dist/parts/headless/message-scroller.js +2 -3
  213. package/dist/parts/playground/paths.d.ts +1 -3
  214. package/dist/parts/playground/paths.js +1 -2
  215. package/dist/parts/playground/share.d.ts +34 -2
  216. package/dist/parts/playground/share.js +1 -2
  217. package/dist/parts/playground/zip.d.ts +1 -3
  218. package/dist/parts/playground/zip.js +2 -3
  219. package/dist/parts/workspace/browser-support-notice.d.ts +2 -4
  220. package/dist/parts/workspace/browser-support-notice.js +13 -6
  221. package/dist/parts/workspace/codemirror.d.ts +10 -3
  222. package/dist/parts/workspace/codemirror.js +40 -8
  223. package/dist/parts/workspace/connect-panel.d.ts +2 -4
  224. package/dist/parts/workspace/connect-panel.js +2 -3
  225. package/dist/parts/workspace/connect-store.d.ts +1 -3
  226. package/dist/parts/workspace/connect-store.js +1 -2
  227. package/dist/parts/workspace/file-icons.d.ts +14 -0
  228. package/dist/parts/workspace/file-icons.js +81 -0
  229. package/dist/parts/workspace/icons.d.ts +2 -2
  230. package/dist/parts/workspace/icons.js +2 -2
  231. package/dist/parts/workspace/runners/render.d.ts +24 -0
  232. package/dist/parts/workspace/runners/render.js +123 -0
  233. package/dist/parts/workspace/runners/web-container.d.ts +27 -0
  234. package/dist/parts/workspace/runners/web-container.js +185 -0
  235. package/dist/parts/workspace/workspace-bar.d.ts +49 -0
  236. package/dist/parts/workspace/workspace-bar.js +50 -0
  237. package/dist/parts/workspace/workspace-boot-status.d.ts +1 -2
  238. package/dist/parts/workspace/workspace-boot-status.js +2 -3
  239. package/dist/parts/workspace/workspace-editor-head.d.ts +45 -0
  240. package/dist/parts/workspace/workspace-editor-head.js +65 -0
  241. package/dist/parts/workspace/workspace-editor.d.ts +18 -3
  242. package/dist/parts/workspace/workspace-editor.js +30 -5
  243. package/dist/parts/workspace/workspace-examples.d.ts +72 -0
  244. package/dist/parts/workspace/workspace-examples.js +71 -0
  245. package/dist/parts/workspace/workspace-file-link.d.ts +33 -0
  246. package/dist/parts/workspace/workspace-file-link.js +38 -0
  247. package/dist/parts/workspace/workspace-file-tree.d.ts +9 -11
  248. package/dist/parts/workspace/workspace-file-tree.js +28 -22
  249. package/dist/parts/workspace/workspace-guide.d.ts +50 -0
  250. package/dist/parts/workspace/workspace-guide.js +90 -0
  251. package/dist/parts/workspace/workspace-issues.d.ts +44 -0
  252. package/dist/parts/workspace/workspace-issues.js +48 -0
  253. package/dist/parts/workspace/workspace-preview.d.ts +1 -3
  254. package/dist/parts/workspace/workspace-preview.js +2 -3
  255. package/dist/parts/workspace/workspace-shell.d.ts +2 -88
  256. package/dist/parts/workspace/workspace-shell.js +132 -80
  257. package/dist/parts/workspace/workspace-sidebar.d.ts +73 -0
  258. package/dist/parts/workspace/workspace-sidebar.js +131 -0
  259. package/dist/parts/workspace/workspace-start.d.ts +45 -0
  260. package/dist/parts/workspace/workspace-start.js +59 -0
  261. package/dist/parts/workspace/workspace-status.d.ts +67 -0
  262. package/dist/parts/workspace/workspace-status.js +73 -0
  263. package/dist/parts/workspace/workspace-steps.d.ts +2 -0
  264. package/dist/parts/workspace/workspace-steps.js +127 -0
  265. package/dist/parts/workspace/workspace-task.d.ts +18 -0
  266. package/dist/parts/workspace/workspace-task.js +19 -0
  267. package/dist/parts/workspace/workspace-terminal.d.ts +1 -3
  268. package/dist/parts/workspace/workspace-terminal.js +1 -2
  269. package/dist/parts/workspace/workspace.d.ts +249 -0
  270. package/dist/parts/workspace/workspace.js +664 -0
  271. package/dist/{payload-text-sjkYAwvw.js → payload-text-DQNRbJY5.js} +1 -2
  272. package/dist/{pierre-code-view-NE35tkmR.js → pierre-code-view-C49BVDrc.js} +11333 -6718
  273. package/dist/pierre-dark-BtKHt2e4.js +166 -0
  274. package/dist/pierre-dark-CXW3KeKO.js +5 -0
  275. package/dist/pierre-dark-protanopia-deuteranopia-CS0Gs25Q.js +166 -0
  276. package/dist/pierre-dark-protanopia-deuteranopia-DajNv_A3.js +3 -0
  277. package/dist/pierre-dark-soft-BUFoeBEf.js +3 -0
  278. package/dist/pierre-dark-soft-D__0FtYP.js +166 -0
  279. package/dist/pierre-dark-tritanopia-C6fHROmA.js +166 -0
  280. package/dist/pierre-dark-tritanopia-oa3gpgIR.js +3 -0
  281. package/dist/pierre-dark-vibrant-COXpyAHb.js +166 -0
  282. package/dist/pierre-dark-vibrant-CYRHyDoW.js +3 -0
  283. package/dist/pierre-light-BD28C_vh.js +166 -0
  284. package/dist/pierre-light-BN0rL1e5.js +5 -0
  285. package/dist/pierre-light-protanopia-deuteranopia-CYsDHJt0.js +3 -0
  286. package/dist/pierre-light-protanopia-deuteranopia-CwWH1xGL.js +166 -0
  287. package/dist/pierre-light-soft-BkKY4pMj.js +166 -0
  288. package/dist/pierre-light-soft-F2QIpNbb.js +3 -0
  289. package/dist/pierre-light-tritanopia-BbKKIkua.js +3 -0
  290. package/dist/pierre-light-tritanopia-Mpubahl7.js +166 -0
  291. package/dist/pierre-light-vibrant-CdV9Besm.js +3 -0
  292. package/dist/pierre-light-vibrant-x11J3_aO.js +166 -0
  293. package/dist/plastic-BQnXkmvK.js +137 -0
  294. package/dist/playground.d.ts +1 -1
  295. package/dist/poimandres-DEfG-8RI.js +124 -0
  296. package/dist/progress-DL9k-ERG.js +265 -0
  297. package/dist/red-BfKrAjYG.js +169 -0
  298. package/dist/registry-DAIjCjWd.js +77 -0
  299. package/dist/{relative-time-BVmjOsYG.js → relative-time-DJnw45tr.js} +5 -8
  300. package/dist/ring-BN4d8vtw.js +173 -0
  301. package/dist/{rolldown-runtime-C9mWXvCC.js → rolldown-runtime-CahUhzF3.js} +2 -3
  302. package/dist/rose-pine-D0rhGGFg.js +136 -0
  303. package/dist/rose-pine-dawn-7jVaYUiD.js +136 -0
  304. package/dist/rose-pine-moon-CFyS0Mvu.js +136 -0
  305. package/dist/runtime/nuxt-plugin.d.ts +0 -2
  306. package/dist/runtime/nuxt-plugin.js +3 -4
  307. package/dist/{sankey-CAYwt82B-D4uDQoMR.js → sankey-CAYwt82B-BAAk7WkJ.js} +147 -151
  308. package/dist/shiki-CbfEu_Az.js +607 -0
  309. package/dist/slack-dark-Bv-KFSBD.js +87 -0
  310. package/dist/slack-ochin-Dg2BAv1D.js +107 -0
  311. package/dist/{slot-part-Doic71uh.js → slot-part-BWHvQ3mK.js} +1 -2
  312. package/dist/snazzy-light-sYDdR9rx.js +93 -0
  313. package/dist/solarized-dark-COt2tTmN.js +160 -0
  314. package/dist/solarized-light-BJrwFarZ.js +160 -0
  315. package/dist/stream-tokenizer-ByC3l0HQ.js +263 -0
  316. package/dist/styles.css +590 -573
  317. package/dist/synthwave-84-NUDBykTM.js +410 -0
  318. package/dist/{temml-BilSAAws.js → temml-m3ad3bfq.js} +2 -3
  319. package/dist/text-BWzZFnGY.js +822 -0
  320. package/dist/theme.d.ts +44 -3
  321. package/dist/theme.js +23 -9
  322. package/dist/themes-DKugPHlg.js +323 -0
  323. package/dist/tokyo-night-DD3B2QcO.js +153 -0
  324. package/dist/travel-CwVhU_GS.js +180 -0
  325. package/dist/tween-Dv3IIIQG.js +61 -0
  326. package/dist/{types-Dj7vp0lZ.d.ts → types-Ceh7h7NT.d.ts} +1 -3
  327. package/dist/vesper-oVQYrv8Y.js +99 -0
  328. package/dist/visual-copy-CHHBfJ6O.js +14 -0
  329. package/dist/vite.d.ts +1 -3
  330. package/dist/vite.js +13 -3
  331. package/dist/vitesse-black-D84DQZAP.js +196 -0
  332. package/dist/vitesse-dark-CMZ6olk_.js +196 -0
  333. package/dist/vitesse-light-D9d8hLOY.js +196 -0
  334. package/dist/{vue-DGstVdGn.js → vue-BlknIGIm.js} +43 -34
  335. package/dist/{vue-BDmSCtay.js → vue-kCdzBu0N.js} +4 -7
  336. package/dist/workspace-shell-ChCwWPyv.d.ts +110 -0
  337. package/dist/workspace-steps-BKByX9DW.d.ts +70 -0
  338. package/dist/workspace.d.ts +16 -5
  339. package/dist/workspace.js +16 -3
  340. package/package.json +66 -55
  341. package/dist/copy-button-CRN3kmSD.js +0 -253
  342. package/dist/icon-swap.css +0 -69
  343. package/dist/nuxt-ui-DSQFzq3s.js +0 -38
  344. package/dist/parts/playground/highlight.d.ts +0 -5
  345. package/dist/parts/playground/highlight.js +0 -23
  346. package/dist/parts/playground/playground-render.d.ts +0 -126
  347. package/dist/parts/playground/playground-render.js +0 -356
  348. package/dist/parts/workspace/playground-container.d.ts +0 -192
  349. package/dist/parts/workspace/playground-container.js +0 -603
  350. package/dist/pierre-dark-CzUmjETS.js +0 -6
  351. package/dist/pierre-dark-protanopia-deuteranopia-C35UMuvO.js +0 -4
  352. package/dist/pierre-dark-soft-Bb-4-biO.js +0 -4
  353. package/dist/pierre-dark-tritanopia-CIJISGWF.js +0 -4
  354. package/dist/pierre-dark-vibrant-8oZzB3gw.js +0 -4
  355. package/dist/pierre-light-Dn6E0sWv.js +0 -6
  356. package/dist/pierre-light-protanopia-deuteranopia-u0U7N4Hn.js +0 -4
  357. package/dist/pierre-light-soft-BCU6fuhO.js +0 -4
  358. package/dist/pierre-light-tritanopia-3c8Yx3co.js +0 -4
  359. package/dist/pierre-light-vibrant-Cwh332o_.js +0 -4
  360. package/dist/share-DM4eNy4q.d.ts +0 -37
package/README.md CHANGED
@@ -18,13 +18,14 @@ Markdown images and image attachments use compact thumbnails with an expanded pr
18
18
  | `@vite-hub/ui` | Every styled component: chat, prompt, Markdown, session, trace, diff, file tree, comments, and the shadcn/ui part families | State, transport, persistence, routes, and authorization |
19
19
  | `@vite-hub/ui/headless` | Message viewport, live-edge following, prepend preservation, message jumps, `useComments()`, and the Choices input parts | Markup and styles; Nuxt UI is not required |
20
20
  | `@vite-hub/ui/markdown-editor` | `MarkdownEditor`, with Tiptap | Uploads and where the Markdown is saved |
21
- | `@vite-hub/ui/workspace` | A live app in the browser: editor, terminal, preview, boot checklist, Connect, and `PlaygroundContainer`, with CodeMirror and xterm | Files, tokens, and the cross-origin isolated route |
21
+ | `@vite-hub/ui/workspace` | A live app in the browser: editor, terminal, preview, boot checklist, Connect, and `Workspace` with the `webContainer()` and `render()` runners, with CodeMirror and xterm | Files, tokens, and the cross-origin isolated route |
22
+ | `@vite-hub/ui/motion` | The motion layer: press, toggle, select, drag, and appear motion by role, the shared spring engine, and reduced motion. No Vue, so a plain TypeScript page or a shadow root can use it | Nothing: `createViteHubUI()` and the Nuxt module install it |
23
+ | `@vite-hub/ui/motion/core` | The same layer, where `installMotion(root, { effects })` runs only the effects that you list, such as `pressEffect`, so a small script bundles only those | Which effects the script runs |
22
24
  | `@vite-hub/ui/playground` | Share links and zips for any playground, with no UI. It runs in Node too | Where the links and zips go |
23
25
  | `@vite-hub/ui/theme` and `@vite-hub/ui/theme.css` | `vitehubTheme`, the Nuxt UI app config, and the tokens and focus ring. The tokens use shadcn/ui names, such as `--background` and `--radius`, which an app can override. Import the theme in `nuxt.config` or `app.config` | Loading Nuxt UI and Tailwind CSS |
24
26
  | `@vite-hub/ui/vite` | Vue with Vite setup | Configures the Nuxt UI and Comark Vite plugins |
25
27
  | `@vite-hub/ui/styles.css` | The styles of every part | Tailwind CSS and the Nuxt UI imports |
26
28
  | `@vite-hub/ui/comment-marks.css` | Comment pins, areas, and text highlights in plain CSS, for a page or a shadow root without Vue. `styles.css` includes it | Rendering the marks with their data attributes |
27
- | `@vite-hub/ui/icon-swap.css` | The copy and check icon cross-fade of `CopyButton` in plain CSS, for a page or a shadow root without Vue. `styles.css` includes it | Rendering the button with its data attributes |
28
29
 
29
30
  Import components from the root. A production build keeps only the components that the app imports. `markdown-editor` and `workspace` have their own entries because their dependencies are large, and a chat page must not load them. The components do not need a ViteHub Agent: `Chat` and `PromptInput` render the messages and status of any AI SDK chat, such as `new Chat()` of `@ai-sdk/vue` on a route that returns `streamText().toUIMessageStreamResponse()`.
30
31
 
@@ -76,11 +77,13 @@ The menus run each item's `kind`, such as `{ kind: "heading", level: 2 }`, throu
76
77
 
77
78
  ## Run an app in the browser
78
79
 
79
- The workspace parts render a live app next to a docs page: a tutorial with the lesson on the left and the workspace on the right, or a playground. `useWebContainer()` from [`@vite-hub/web-container/vue`](../web-container/README.md) runs the app in a WebContainer, and the parts render its state. The page that boots it must be cross-origin isolated, as the [WebContainer docs](https://vitehub.dev/docs/web-container/get-started#make-the-page-cross-origin-isolated) show.
80
+ The workspace parts render a live app next to a docs page: a tutorial with the lesson in a column on the left, or a playground. `useWebContainer()` from [`@vite-hub/web-container/vue`](../web-container/README.md) runs the app in a WebContainer, and the parts render its state. The page that boots it must be cross-origin isolated, as the [WebContainer docs](https://vitehub.dev/docs/web-container/get-started#make-the-page-cross-origin-isolated) show.
80
81
 
81
- `@vite-hub/ui/workspace` exports `WorkspaceShell` (with `layout: "tutorial" | "playground"`), `WorkspaceFileTree` (a `FileTree` with a dot on modified files), `WorkspaceEditor` (CodeMirror 6 with the Pierre colors of `FileView`), `WorkspaceTerminal` (xterm.js), `WorkspacePreview` (the preview in a browser frame: Back, Forward, Reload, the page address, a Desktop, Tablet, and Phone width switch, and Open in new tab), `WorkspaceBootStatus` (the boot checklist with live times), `BrowserSupportNotice`, `ConnectPanel`, `ConnectProviderRow`, and `useConnectStore()`, which connect the reader's accounts, and `PlaygroundContainer` with `usePlaygroundDevice()`, a complete playground built from these parts. The entry is not in the root barrel. CodeMirror and xterm load when the editor or the terminal mounts.
82
+ `@vite-hub/ui/workspace` exports `WorkspaceShell` (with `layout: "side" | "guide-top" | "guide-side"`), `WorkspaceFileTree` (a `FileTree` with a dot on modified files), `WorkspaceEditor` (CodeMirror 6 with the Pierre colors of `FileView`), `WorkspaceTerminal` (xterm.js), `WorkspacePreview` (the preview in a browser frame: Back, Forward, Reload, the page address, a Desktop, Tablet, and Phone width switch, and Open in new tab), `WorkspaceBootStatus` (the boot checklist with live times), `BrowserSupportNotice`, `ConnectPanel`, `ConnectProviderRow`, and `useConnectStore()`, which connect the reader's accounts, and `Workspace` with `useWorkspace()` and `useWorkspaceDevice()`, a complete playground or lesson built from these parts. The bar parts are `WorkspaceBar` (the 44px bar), `WorkspaceExamples` (the examples menu, with group headings), `WorkspaceSidebar` (a panel over the workspace with Reset, Download, and Copy link at the bottom), and `WorkspaceStart` (the examples as cards on a first visit). See [Workspace bar](https://vitehub.dev/docs/ui/workspace-bar). The entry is not in the root barrel. CodeMirror and xterm load when the editor or the terminal mounts.
82
83
 
83
- `PlaygroundRender`, a playground that renders files in the page, is in the root `@vite-hub/ui`. See [Render files in the page](#render-files-in-the-page). `@vite-hub/ui/playground` has the share links and zips: `encodePlaygroundLink()`, `decodePlaygroundLink()`, `readPlaygroundHash()`, `playgroundUrl()`, `zipFiles()`, and `downloadZip()`.
84
+ The code side has four parts for the slots of `WorkspaceShell`: `WorkspaceFileTree` takes the edited paths as `edited`, a list or a set, and draws a type icon per file and a dot per edited file. `WorkspaceEditorHead` shows the path as a breadcrumb and a wrap button. `WorkspaceEditor` takes `v-model:wrap`, which Alt+Z toggles, and emits `cursor`. `WorkspaceStatus` shows the cursor, the language from `workspaceLanguage(path)`, and the indentation.
85
+
86
+ `@vite-hub/ui/playground` has the share links and zips: `encodePlaygroundLink()`, `decodePlaygroundLink()`, `readPlaygroundHash()`, `playgroundUrl()`, `zipFiles()`, and `downloadZip()`.
84
87
 
85
88
  A share link holds the files in its URL hash, so nothing is stored on a server. Only the changes from the template go into the link, deflated and in base64url. `@vite-hub/ui/playground` has no UI and runs in browsers and in Node, so a build can write links and starter zips too.
86
89
 
@@ -98,11 +101,11 @@ const state = await decodePlaygroundLink(readPlaygroundHash(location.hash) ?? ""
98
101
 
99
102
  A playground without templates, such as one Markdown file, leaves `template` out. Links longer than `playgroundLinkLimit` (16,000 characters) are cut by chat apps, so offer `downloadZip()` instead.
100
103
 
101
- `PlaygroundContainer` is the whole page part: a toolbar with the run state, a template menu, Download, Copy link, and Restart and Discard changes. Under it are the file tree, the editor, the preview, and the dev server console. It marks edited files, asks before it replaces edits, and opens `#code=` links. Desktops boot it on their own, tablets boot it on a tap, and phones get a card with Copy link and Download files. A browser without WebContainer support gets `BrowserSupportNotice`.
104
+ `Workspace` is the whole page part: a bar with the run state, an examples menu, Reset, Download, Copy link, and a More menu. Under it are the file tree, the editor, and the output of its runner. It marks edited files, asks before it replaces edits, and opens `#code=` links. `webContainer()` runs the files as an app with a Preview tab, a Terminal tab, and a Connect tab for `connect`. Desktops boot it on their own, tablets boot it on a tap, and phones get a card with Copy link and Download files. A browser without WebContainer support gets `BrowserSupportNotice`. `render()` runs the files through a function in the page, on every device. See [Workspace](https://vitehub.dev/docs/ui/workspace).
102
105
 
103
106
  ```vue
104
107
  <script setup lang="ts">
105
- import { PlaygroundContainer } from "@vite-hub/ui/workspace";
108
+ import { webContainer, Workspace } from "@vite-hub/ui/workspace";
106
109
  import { fetchSnapshot } from "@vite-hub/web-container";
107
110
  import { defineConnect } from "@vite-hub/web-container/connect";
108
111
 
@@ -111,104 +114,67 @@ const files = {
111
114
  "package.json": JSON.stringify({ scripts: { dev: "vite --port 3000" }, devDependencies: { vite: "^8.0.0" } }),
112
115
  "index.html": "<h1>Hello</h1>",
113
116
  };
114
- const templates = [
115
- { id: "hello", label: "Hello", files, open: "index.html", snapshot: () => fetchSnapshot(["/snapshots/hello.0.bin"]) },
117
+ const examples = [
118
+ { id: "hello", label: "Hello", files, open: "index.html" },
116
119
  { id: "empty", label: "Empty", files: { ...files, "index.html": "" } },
117
120
  ];
121
+ const hello = () => fetchSnapshot(["/snapshots/hello.0.bin"]);
122
+ const runner = webContainer({ port: 3000, connect, snapshot: () => hello });
118
123
  </script>
119
124
 
120
125
  <template>
121
- <PlaygroundContainer :templates="templates" label="playground" name="my-app" :port="3000" :connect="connect" :tabs="[{ value: 'messages', label: 'Messages' }]">
122
- <template #messages="{ workspace }">
123
- <pre>{{ workspace.files.value["index.html"] }}</pre>
126
+ <Workspace :examples :runner label="playground" name="my-app" :tabs="[{ value: 'messages', label: 'Messages' }]">
127
+ <template #messages="{ files }">
128
+ <pre>{{ files["index.html"] }}</pre>
124
129
  </template>
125
- </PlaygroundContainer>
130
+ </Workspace>
126
131
  </template>
127
132
  ```
128
133
 
129
- - Props: `templates` (one or more, each `{ id, label, files, description?, open?, preview?, snapshot? }`), `template` (the id to open first), `layout` (`"playground"` or `"tutorial"`), `label` (the lowercase name in the Open button and the cards, default `"workspace"`), `name` (the start of the zip name), `port`, `connect`, `tabs`, `share` (default `true`), `v-model:selected`, and `v-model:open`.
130
- - Templates with the same `snapshot` function switch in place. Another snapshot, or an edited `package.json`, boots a new workspace.
131
- - Slots: `#toolbar` adds buttons before Download, `#banner` shows under the toolbar, and each tab of `tabs` shows the slot with its `value`. These slots get `{ workspace, template, edited, show, showTab, guard }`, and `@context` gives the same object to code outside the container. `#intro` and `#fallback` show around the card when the workspace does not show.
132
- - It emits `update:template` when the reader opens a template or discards the changes to one.
133
- - A tutorial gives one template with the files of its step, sets `layout="tutorial"` and `:share="false"`, adds Solve in `#toolbar`, and writes the next step through `workspace.setFiles()`. A change to the files of the open template moves the edit baseline, so the next step starts with no edits.
134
-
135
- ```vue
136
- <script setup lang="ts">
137
- import { WorkspaceBootStatus, WorkspaceEditor, WorkspacePreview, WorkspaceShell, WorkspaceTerminal, workspacePreviewScript } from "@vite-hub/ui/workspace";
138
- import { useWebContainer } from "@vite-hub/web-container/vue";
139
- import { computed, ref } from "vue";
140
-
141
- const workspace = useWebContainer({ files: { "package.json": "...", "server.js": "..." }, previewScript: workspacePreviewScript });
142
- const tab = ref<"preview" | "terminal">("preview");
143
- const source = computed({
144
- get: () => workspace.files.value["server.js"] ?? "",
145
- set: value => workspace.setFiles({ "server.js": value }),
146
- });
147
- </script>
148
-
149
- <template>
150
- <WorkspaceShell v-model:tab="tab" layout="tutorial">
151
- <template #editor><WorkspaceEditor v-model="source" path="server.js" /></template>
152
- <template #preview><WorkspacePreview :url="workspace.previewUrl.value" /></template>
153
- <template #terminal><WorkspaceTerminal :output="workspace.logs.value" /></template>
154
- <template v-if="workspace.status.value !== 'ready'" #overlay>
155
- <WorkspaceBootStatus
156
- :status="workspace.status.value"
157
- :steps="workspace.steps.value"
158
- :failure="workspace.failure.value"
159
- :online="workspace.online.value"
160
- @retry="workspace.boot()"
161
- @retry-install="workspace.install()"
162
- @restart="workspace.restart()"
163
- @show-output="tab = 'terminal'"
164
- />
165
- </template>
166
- </WorkspaceShell>
167
- </template>
168
- ```
169
-
170
- - `useWebContainer()` returns the state that the parts take: `status`, `steps`, `failure`, `files`, `modified`, `previewUrl`, `logs`, and `online`. Its [README](../web-container/README.md#run-it-from-vue) lists the options. Pass `env: useConnectStore().env(connect)` to give the dev server the reader's tokens.
171
- - `WorkspaceShell` has the slots `#toolbar`, `#files`, `#editor`, `#terminal`, `#preview`, `#connect`, and `#overlay`. A tutorial shows Preview, Terminal, and Connect as tabs under the editor. A playground puts the preview at the side and the other tabs under the editor. `tabs` sets the tabs and their order, with a label and an optional `badge` each, and each tab shows the slot with its `value`. Split sizes are kept in localStorage under `storageKey`. Hidden tab panels stay mounted and are `inert`.
172
- - The preview origin does not answer a `fetch()` from the page, so `WorkspacePreview` shows it only in an iframe. The page cannot read the address or the history of that cross-origin frame either, so pass `previewScript: workspacePreviewScript` to `useWebContainer()`. The script reports the address of each preview page, and Back and Forward work. Without it, the bar shows the path that it opened, and Back and Forward stay disabled. `PlaygroundContainer` passes it.
134
+ - Props: `examples` (one or more, each `{ id, label, files, description?, group?, open?, preview? }`), `runner`, `v-model:example` (the open example), `v-model:selected`, `steps` with `v-model:step` and `guide` (`"top"` or `"side"`) for a lesson, `tabs`, `share` (default `true`), `name` (the start of the zip name), `start` (show the examples as cards on a first visit without a share link), `label` (the lowercase name in the Open button and the cards, default `"workspace"`), `reset` (the files that Reset writes, from the current files and the example), and `v-model:open`. The examples menu groups the examples by `group`.
135
+ - Examples with the same `snapshot` loader and the same `package.json` switch in place. Another snapshot, or an edited `package.json`, boots a new run. One runner boots one WebContainer at a time.
136
+ - Slots: `#bar-lead` and `#bar-actions` add controls to the bar, `#sidebar` fills the sidebar and moves Reset, Download, and Copy link to its bottom, `#guide` holds the text of a step, `#banner` shows under the bar, and each tab of `tabs` shows the slot with its `value`. These slots get `{ files, setFile, edited, example, show, showTab, guard, runner, run }`, and `useWorkspace()` gives the same values to a component in a slot. `#intro` and `#fallback` show around the card when the workspace does not show.
137
+ - The share link keeps the key `template` for the example id, so older links open.
138
+ - While the start screen shows, the workspace starts no run and loads no snapshot. A pick of a card or a menu item starts the picked example and moves focus to the bar.
139
+ - `WorkspaceShell` has three layouts:
140
+ - `side` (default): the code on the left and the output at the side, with a draggable line between them.
141
+ - `guide-top`: the `#guide` pane over the code, with a draggable line between them, and the output at the side.
142
+ - `guide-side`: the `#guide` pane on the left is up to 360px wide and takes at most half the available width. On the right, the output takes 40% at the top and the code sits under it.
143
+ - The `#bar` slot is 44px high. The `#editor-head` row and the output tab bar are 32px high, so their bottom lines align. The `#status` line is 24px high. The draggable lines also move with the arrow keys, Home, and End. Split sizes are kept in localStorage under `storageKey`. Hidden tab panels stay mounted and are `inert`.
144
+ - `tabs` sets the tabs and their order, with a label and an optional `badge` each. For custom tabs, use `#tab-<value>` (for example, `#tab-status`). A slot named by the value alone still works if it is not a layout slot and does not start with `tab-`.
145
+ - The preview origin does not answer a `fetch()` from the page, so `WorkspacePreview` shows it only in an iframe. The page cannot read the address or the history of that cross-origin frame either, so pass `previewScript: workspacePreviewScript` to `useWebContainer()`. The script reports the address of each preview page, and Back and Forward work. Without it, the bar shows the path that it opened, and Back and Forward stay disabled. `webContainer()` passes it.
173
146
  - The width switch of `WorkspacePreview` shows the page at 768 (Tablet) or 390 (Phone) CSS pixels in a `DeviceFrame`, scaled down to fit the pane. Desktop fills the pane. Use `v-model:device`, or let it keep the last width in localStorage.
174
147
  - `BrowserSupportNotice` shows only when `supported` is `false`, and only on the client. Pass `workspace.support.value?.supported` and, when unsupported, its `reason` to distinguish missing page isolation from browser limitations. `description` replaces the text for a tutorial with what the reader of your page can do instead.
148
+ - The learn parts fill the `#guide` and `#bar` slots of a lesson. `WorkspaceGuide` shows the position and title of the step, your rendered Markdown in its default slot (it never parses Markdown), and Back and Next at the bottom of the pane. `WorkspaceSteps` is the steps menu with Previous and Next for the bar. Bind both with `v-model:step`. `WorkspaceTask` is the task box of a step. `WorkspaceFileLink` opens its `path` through the opener of `provideWorkspaceFileOpener({ show })` and emits `open`. `WorkspaceIssues` lists `{ message, line? }` issues, and the Issues tab of `render()` uses it. See [Workspace guide](https://vitehub.dev/docs/ui/workspace-guide).
149
+
150
+ The demo page in `test/browser/page` shows every part in the `guide-side` layout. `pnpm --filter @vite-hub/ui test:browser` boots it with a real WebContainer in headless Chromium. It needs a Playwright Chromium and network access to StackBlitz and the npm registry. Set `WORKSPACE_TEST_PORT` to change its port (default `4796`) and `WORKSPACE_SCREENSHOTS=<dir>` to save a screenshot of each state.
175
151
 
176
- The demo page in `test/browser/page` shows every part in the tutorial layout. `pnpm --filter @vite-hub/ui test:browser` boots it with a real WebContainer in headless Chromium. It needs a Playwright Chromium and network access to StackBlitz and the npm registry. Set `WORKSPACE_TEST_PORT` to change its port (default `4796`) and `WORKSPACE_SCREENSHOTS=<dir>` to save a screenshot of each state.
152
+ `pnpm --filter @vite-hub/ui test:workspace-parts` mounts the parts on a fake WebContainer in headless Chromium at 1280x760 and checks their sizes against the design. Each part is a file in `test/browser/workspace-parts/fixtures` and its checks are a file in `test/browser/workspace-parts/checks`. Set `WORKSPACE_PARTS_SCREENSHOTS=<dir>` to save a screenshot of each part.
177
153
 
178
154
  ## Render files in the page
179
155
 
180
- `PlaygroundRender` from `@vite-hub/ui` is a playground for code that renders in the browser, such as Markdown or YAML. It needs no WebContainer. You give it a `render` function, the editor panes, and the examples. It shows the editors, the examples, the issues, and the preview.
156
+ `render(fn)` from `@vite-hub/ui/workspace` is a runner for code that renders in the browser, such as Markdown or YAML. It needs no WebContainer, so every device runs it.
181
157
 
182
158
  ```vue
183
159
  <script setup lang="ts">
184
- import { PlaygroundRender, type PlaygroundFiles } from "@vite-hub/ui";
160
+ import { render, Workspace } from "@vite-hub/ui/workspace";
185
161
  import { marked } from "marked";
186
162
 
187
- const presets = [
163
+ const examples = [
188
164
  { id: "hello", label: "Hello", group: "Basics", files: { "content.md": "# Hello\n" } },
189
165
  { id: "list", label: "A list", group: "Basics", files: { "content.md": "- One\n- Two\n" } },
190
166
  ];
191
- const panes = [{ file: "content.md", label: "Markdown", language: "markdown" }];
192
- const languages = [() => import("shiki/langs/markdown.mjs")];
193
-
194
- async function render(files: PlaygroundFiles) {
195
- return { html: await marked.parse(files["content.md"] ?? ""), issues: [] };
196
- }
167
+ const runner = render(async files => ({ html: await marked.parse(files["content.md"] ?? "") }));
197
168
  </script>
198
169
 
199
170
  <template>
200
- <PlaygroundRender :presets :panes :languages :render class="h-[70vh]" />
171
+ <Workspace :examples :runner name="markdown" class="h-[70vh]" />
201
172
  </template>
202
173
  ```
203
174
 
204
- - The state is a set of files. Each edit renders 200 ms after the last key, and a render that ends after a newer one is dropped. The preview keeps its scroll position.
205
- - The URL hash holds the files as a share link of `@vite-hub/ui/playground`, with the open example as its template. The playground replaces the hash, so Back leaves the page. It loads the hash again on `hashchange`, and says so when a link cannot be read.
206
- - `render(files)` returns `{ html, issues? }`. An issue is `{ message, line? }`. A thrown error shows as an issue.
207
- - `previewDocument(html, files)` wraps the HTML in the preview page, with your stylesheets, body class, and theme. The default is a plain white page. The preview runs scripts in a sandboxed frame with its own origin, so a shared link cannot reach your page.
208
- - `languages` are Shiki languages for the `language` of each pane. Shiki loads after the first render. Without `languages`, the panes are plain text.
209
- - `preset` is the id of the example that opens first. Copy link refuses links longer than `playgroundLinkLimit`; Download gives a zip of the files instead. Reset asks first, then goes back to the example.
210
- - A pane with `slot: "theme"` shows the `#theme` slot in place of the editor, with `{ pane, value, files, setFile }`. The `#toolbar` slot gets `{ files, preset, setFile }`, and the `#preset` slot gets `{ preset, active }` to draw each example. The `#group` slot gets `{ group, presets }` to draw the heading of a group of examples.
211
- - `@load` fires with `{ preset, files }` when files open from the hash or the opening example. `@preset-change` fires with the same payload when another example opens, from a click or a link.
175
+ - Each edit renders 200 ms after the last key, and a render that ends after a newer one is dropped. The output keeps its scroll position.
176
+ - `fn(files)` returns `{ html, issues? }`. An issue is `{ message, line? }`. A thrown error shows as an issue in the Issues tab.
177
+ - `document(html, files)`, the second argument, wraps the HTML in the output page, with your stylesheets, body class, and theme. The default is a plain white page. The output runs scripts in a sandboxed frame with its own origin, so a shared link cannot reach your page.
212
178
 
213
179
  ## Nuxt
214
180
 
@@ -287,6 +253,66 @@ Load Tailwind, Nuxt UI, and the package styles in that order:
287
253
 
288
254
  Unlike `vite-hub/nuxt`, the Vite integration does not auto-register ViteHub UI components. Import them from `@vite-hub/ui` in each component or use the application's component-registration convention.
289
255
 
256
+ ## Motion
257
+
258
+ Controls get the same motion from what a person does with them, not from code of their own (see [docs/design/motion.md](../../docs/design/motion.md)). `createViteHubUI()` installs the motion layer in the browser, and the Nuxt module does it through the same plugin. A pressed `button`, link, tab, radio, option, menu item, or checkbox squashes and springs back past rest. A pressed switch grows its knob instead of squashing the whole control. Non-transformable inline controls, such as links in running text, keep their layout and do not squash. A pointer press near the edge of a control stays still if a squash would risk missing the click. Under `prefers-reduced-motion`, the press stays still.
259
+
260
+ - Turn the layer off for one subtree with `data-motion="none"`, such as a canvas or an animated figure that draws its own motion.
261
+ - Turn it off for the app with `createViteHubUI({ motion: false })`.
262
+ - Without Vue, call it yourself. With no argument it covers the document. A surface on someone else's page, such as a bar in a shadow root, passes its host element and its shadow roots instead, so the page around it does not move:
263
+
264
+ ```ts
265
+ import { installMotion } from "@vite-hub/ui/motion";
266
+
267
+ const host = document.createElement("div");
268
+ document.body.append(host);
269
+ const uninstall = installMotion(host.attachShadow({ mode: "open" }));
270
+ ```
271
+
272
+ That brings every effect. A script with its own small bundle, such as a toolbar that you put on other pages, takes `installMotion` from `@vite-hub/ui/motion/core` and lists the effects it runs, so the others stay out of the bundle:
273
+
274
+ ```ts
275
+ import { appearEffect, installMotion, pressEffect } from "@vite-hub/ui/motion/core";
276
+
277
+ const bar = document.createElement("div");
278
+ document.body.append(bar);
279
+ const uninstall = installMotion(bar.attachShadow({ mode: "open" }), { effects: [pressEffect, appearEffect] });
280
+ ```
281
+
282
+ Four parts move with the helpers of the motion layer, for events that only the component knows:
283
+
284
+ - `MotionList` replaces `<TransitionGroup>`. Render keyed items in its slot: neighbors spring to their new place, a new item grows from `origin` (the row it duplicates) or from its slot, and a removed item folds away.
285
+ - `Progress` shows work that runs: `value` from 0 to 1 fills the bar with a head, `null` shows a wave while the total is not known, and `done` draws a dot into a check. It has `role="progressbar"` and `aria-valuenow`.
286
+ - `DropField` is a label around a file input. The dots behind its text lean toward a dragged file. A click and the keyboard open the file picker. It emits `files`.
287
+ - `HoldToDelete` is a button that deletes when it is held. It emits `delete` (hide the item), shows Undo for `undoFor` ms (emits `undo`), and only then calls `commit`. Unmounting it during the Undo window commits. A click from a screen reader asks `confirm` first.
288
+
289
+ ```vue
290
+ <MotionList tag="ul">
291
+ <li v-for="file in files" :key="file.id">{{ file.name }}</li>
292
+ </MotionList>
293
+ <Progress :value="upload.progress" :done="upload.done" label="Upload cover.png" />
294
+ <HoldToDelete :commit="() => removeFile(file.id)" @delete="hidden = true" @undo="hidden = false" />
295
+ ```
296
+
297
+ Without Vue, `createMotionList`, `createProgress`, `createDropField`, and `createHoldToDelete` from `@vite-hub/ui/motion` do the same on any element.
298
+
299
+ ### Labels, icons, counts, and rings
300
+
301
+ The layer also morphs what changes with state. When the label of a `UButton` changes, such as `:label="loading ? 'Publishing' : 'Publish'"`, its letters change one at a time and the button's width follows with a spring. When Vue draws another icon into the button's leading or trailing icon, such as the spinner of `loading`, the old icon blurs out and the spinner draws its stroke in. The app only changes the label and the icon. With `@nuxt/icon` in CSS mode an icon is a class, which the layer does not watch, so the icon changes at once there; use `SwapIcon` in the button's `leading` slot.
302
+
303
+ For everything else, use the component or the helper:
304
+
305
+ | Vue | Helper in `@vite-hub/ui/motion` | Use it for |
306
+ | --- | --- | --- |
307
+ | `<MorphText :text="copied ? 'Copied' : 'Copy link'" />` | `morphText(element, text)` | A label outside a `UButton` |
308
+ | `<SwapIcon :name="icon" enter="draw" />` | `swapIcon(container, icon, { exit, enter })` | An icon that says what happened: `exit: "right"` for an arrow that leaves the way it points, `enter: "draw"` for a check or a spinner |
309
+ | `<RollNumber :value="count" />` | `rollNumber(element, value, format?)` | A count: only the changed digits roll, up when it grows, down when it shrinks |
310
+ | `<UButton v-ring="saved" />` | `ring(element)` | A finished action, such as saved or copied: a ring in the border color grows once and fades |
311
+
312
+ `CopyButton` uses all of them. Each helper can be called again in the middle of its motion and continues from where it is. The element keeps the final text for screen readers the whole time and holds plain text again at the end. Under reduced motion a label, an icon, or a digit crossfades in 150ms, and there is no ring. Inside `data-motion="none"` the change happens at once.
313
+
314
+ The entry also has the spring engine (`createSpring`, `springs.snappy`, `springs.soft`), reduced motion (`prefersReducedMotion`, `onReducedMotionChange`, `forceReducedMotion`), `setMotionSlowFactor(4)` to watch an effect at ¼×, and `defineMotionEffect` to add an effect for a role. The motion page in `test/browser/motion/` renders every role; `pnpm --filter @vite-hub/ui test:motion` checks it in Chromium, and `MOTION_RECORD=<dir>` records each press at ¼×.
315
+
290
316
  ## The ui-sdk set
291
317
 
292
318
  The styled parts render a few Nuxt UI components by name: `UButton`, `UIcon`, `UInput`, `UModal`, `UTabs`, `UDropdownMenu`, and the editor parts `UEditorToolbar`, `UEditorSuggestionMenu`, and `UEditorDragHandle`. `uiSdkComponents` holds the same names built on [ui-sdk](https://ui-sdk.dev), styled by the `@vite-hub/kit` style family. Give it to `createViteHubUI()`, and a page with these parts loads no Nuxt UI component:
@@ -0,0 +1,147 @@
1
+ // ../../node_modules/.pnpm/@pierre+highlights@0.5.2/node_modules/@pierre/highlights/dist/themes/andromeeda.js
2
+ var andromeeda_default = {
3
+ "name": "Andromeeda",
4
+ "appearance": "dark",
5
+ "style": {
6
+ "background": "#23262E",
7
+ "text": "#e1dde4",
8
+ "editor.background": "#23262E",
9
+ "editor.foreground": "#D5CED9",
10
+ "editor.active_line.background": "#2e323d",
11
+ "editor.document_highlight.bracket_background": "#4F5666",
12
+ "search.match_background": "#f39d1256",
13
+ "players": [
14
+ {
15
+ "cursor": "#D5CED9",
16
+ "background": "#3D4352",
17
+ "selection": "#3D4352"
18
+ },
19
+ {
20
+ "cursor": "#FFB8B8",
21
+ "background": "#2F3646",
22
+ "selection": "#4A3A4A"
23
+ },
24
+ {
25
+ "cursor": "#A5FFD6",
26
+ "background": "#3A424F",
27
+ "selection": "#2D4A4A"
28
+ },
29
+ {
30
+ "cursor": "#FFD6A5",
31
+ "background": "#353D4A",
32
+ "selection": "#4A3D2D"
33
+ },
34
+ {
35
+ "cursor": "#C6B8FF",
36
+ "background": "#2D3542",
37
+ "selection": "#3D2D4A"
38
+ }
39
+ ],
40
+ "error": "#FC644D",
41
+ "warning": "#FF9F2E",
42
+ "info": "#969696ff",
43
+ "hint": "#969696ff",
44
+ "terminal.ansi.black": "#000000f2",
45
+ "terminal.ansi.red": "#ee5d43",
46
+ "terminal.ansi.green": "#96E072",
47
+ "terminal.ansi.yellow": "#FFE66D",
48
+ "terminal.ansi.blue": "#7cb7ff",
49
+ "terminal.ansi.magenta": "#FF66C4",
50
+ "terminal.ansi.cyan": "#5DFFDF",
51
+ "terminal.ansi.white": "#D5CED9",
52
+ "terminal.ansi.bright_black": "#000000e6",
53
+ "terminal.ansi.bright_red": "#D04A32",
54
+ "terminal.ansi.bright_green": "#5dcd26",
55
+ "terminal.ansi.bright_yellow": "#fbd831",
56
+ "terminal.ansi.bright_blue": "#5A8FD6",
57
+ "terminal.ansi.bright_magenta": "#ff00aa",
58
+ "terminal.ansi.bright_cyan": "#00e8c6",
59
+ "terminal.ansi.bright_white": "#D5CED9",
60
+ "syntax": {
61
+ "attribute": { "color": "#FFE66D" },
62
+ "comment": { "color": "#81898f" },
63
+ "comment.doc": { "color": "#A0A1A7cc" },
64
+ "comment.documentation": { "color": "#A0A1A7cc" },
65
+ "diff.plus": { "color": "#9BC53D40" },
66
+ "diff.minus": { "color": "#FC644D40" },
67
+ "constant": { "color": "#74c7ec" },
68
+ "constant.macro": { "color": "#c74ded" },
69
+ "constant.builtin": { "color": "#ee7843" },
70
+ "constructor": { "color": "#f92672" },
71
+ "emphasis": { "color": "#c74ded" },
72
+ "emphasis.strong": { "color": "#f39c12" },
73
+ "function": { "color": "#FFE66D" },
74
+ "include": { "color": "#c74ded" },
75
+ "keyword": { "color": "#c74ded" },
76
+ "keyword.modifier": { "color": "#c74ded" },
77
+ "keyword.type": { "color": "#c74ded" },
78
+ "keyword.coroutine": { "color": "#c74ded" },
79
+ "keyword.function": { "color": "#c74ded" },
80
+ "keyword.operator": { "color": "#c74ded" },
81
+ "keyword.import": { "color": "#c74ded" },
82
+ "keyword.repeat": { "color": "#c74ded" },
83
+ "keyword.return": { "color": "#c74ded" },
84
+ "keyword.debug": { "color": "#c74ded" },
85
+ "keyword.exception": { "color": "#c74ded" },
86
+ "keyword.conditional": { "color": "#c74ded" },
87
+ "keyword.conditional.ternary": { "color": "#ee5d43" },
88
+ "repeat": { "color": "#c74ded" },
89
+ "conditional": { "color": "#c74ded" },
90
+ "exception": { "color": "#ee5d43" },
91
+ "module": { "color": "#FFE66D" },
92
+ "field": { "color": "#00e8c6" },
93
+ "variable.member": { "color": "#00e8c6" },
94
+ "property": { "color": "#00e8c6" },
95
+ "punctuation": { "color": "#D5CED9" },
96
+ "punctuation.bracket": { "color": "#D5CED9" },
97
+ "punctuation.delimiter": { "color": "#D5CED9" },
98
+ "punctuation.special": { "color": "#D5CED9" },
99
+ "punctuation.list_marker": { "color": "#FFE66D" },
100
+ "number": { "color": "#f39c12" },
101
+ "operator": { "color": "#ee5d43" },
102
+ "boolean": { "color": "#f92672" },
103
+ "string": { "color": "#96E072" },
104
+ "string.escape": { "color": "#96E072" },
105
+ "string.regex": { "color": "#7cb7ff" },
106
+ "regex": { "color": "#7cb7ff" },
107
+ "string.special": { "color": "#7cb7ff" },
108
+ "string.special.symbol": { "color": "#96E072" },
109
+ "string.special.url": { "color": "#96E072" },
110
+ "tag": { "color": "#f92672" },
111
+ "tag.delimiter": { "color": "#D5CED9" },
112
+ "tag.attribute": { "color": "#FFE66D" },
113
+ "tag.punctuation.bracket": { "color": "#D5CED9" },
114
+ "tag.punctuation.special": { "color": "#D5CED9" },
115
+ "tag.punctuation.delimiter": { "color": "#D5CED9" },
116
+ "text.literal": { "color": "#96E072" },
117
+ "text.title": { "color": "#fe00aa" },
118
+ "title": {
119
+ "color": "#fe00aa",
120
+ "font_weight": 400
121
+ },
122
+ "link_text": { "color": "#ee5d43" },
123
+ "link_uri": { "color": "#c74ded" },
124
+ "namespace": { "color": "#FFE66D" },
125
+ "type": { "color": "#FFE66D" },
126
+ "type.builtin": { "color": "#c74ded" },
127
+ "type.definition": { "color": "#FFE66D" },
128
+ "type.interface": { "color": "#FFE66D" },
129
+ "type.super": { "color": "#FFE66D" },
130
+ "variable": { "color": "#00e8c6" },
131
+ "variable.special": { "color": "#00e8c6" },
132
+ "embedded": { "color": "#D5CED9" },
133
+ "label": { "color": "#00e8c6" },
134
+ "predictive": { "color": "#81898f" },
135
+ "preproc": { "color": "#c74ded" },
136
+ "primary": { "color": "#D5CED9" },
137
+ "selector": { "color": "#F92672" },
138
+ "enum": { "color": "#FFE66D" },
139
+ "hint": { "color": "#969696ff" },
140
+ "variant": { "color": "#00E8C6" },
141
+ "selector.class": { "color": "#FFE66D" },
142
+ "selector.id": { "color": "#EE5D43" },
143
+ "selector.pseudo": { "color": "#FFE66D" }
144
+ }
145
+ }
146
+ };
147
+ export { andromeeda_default as default };
@@ -0,0 +1,31 @@
1
+ // src/internal/announce.ts
2
+ const regionSlot = "live-announcer";
3
+ const hidden = "position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0";
4
+ function regionFor(element) {
5
+ const container = element.closest("[role=dialog], [role=alertdialog]") ?? element.ownerDocument.body;
6
+ for (const child of container.children) if (child instanceof HTMLElement && child.dataset.slot === regionSlot) return child;
7
+ const region = element.ownerDocument.createElement("div");
8
+ region.dataset.slot = regionSlot;
9
+ region.setAttribute("aria-live", "polite");
10
+ region.setAttribute("aria-atomic", "true");
11
+ region.style.cssText = hidden;
12
+ container.append(region);
13
+ return region;
14
+ }
15
+ /** Adds the live region that `announce()` will use for `element`, so that the first message is read. */
16
+ function prepareAnnouncer(element) {
17
+ if (element) regionFor(element);
18
+ }
19
+ const clearTimers = /* @__PURE__ */ new WeakMap();
20
+ /** Reads `message` to screen readers without moving focus, and clears it after `duration` ms. */
21
+ function announce(element, message, duration = 2e3) {
22
+ if (!element) return;
23
+ const region = regionFor(element);
24
+ clearTimeout(clearTimers.get(region));
25
+ region.textContent = "";
26
+ requestAnimationFrame(() => {
27
+ region.textContent = message;
28
+ });
29
+ clearTimers.set(region, setTimeout(() => region.textContent = "", duration));
30
+ }
31
+ export { prepareAnnouncer as n, announce as t };
@@ -1,6 +1,6 @@
1
- import { t as uiErrorDiagnostics } from "./error-diagnostics-SXtnk6bz.js";
1
+ import { t as uiErrorDiagnostics } from "./error-diagnostics-BlgA9rI2.js";
2
2
  import { computed, onScopeDispose, ref } from "vue";
3
- //#region src/internal/prompt-files.ts
3
+ // src/internal/prompt-files.ts
4
4
  function nextPromptFiles(current, selected, multiple) {
5
5
  return multiple ? [...current, ...selected] : selected.slice(-1);
6
6
  }
@@ -14,8 +14,7 @@ function matchesAccept(file, accept) {
14
14
  return file.type === value;
15
15
  });
16
16
  }
17
- //#endregion
18
- //#region src/composables/attachments.ts
17
+ // src/composables/attachments.ts
19
18
  function fileToDataUrl(file) {
20
19
  return new Promise((resolve, reject) => {
21
20
  const reader = new FileReader();
@@ -86,5 +85,4 @@ function useAgentAttachments(options = {}) {
86
85
  }
87
86
  };
88
87
  }
89
- //#endregion
90
88
  export { nextPromptFiles as a, matchesAccept as i, fileToUIPart as n, useAgentAttachments as r, fileToDataUrl as t };