@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
@@ -0,0 +1,185 @@
1
+ import { useCopy } from "../../components/copy-button.js";
2
+ import { ConnectPanel } from "../connect-panel.js";
3
+ import { useConnectStore } from "../connect-store.js";
4
+ import { WorkspaceBootStatus } from "../workspace-boot-status.js";
5
+ import { WorkspacePreview, workspacePreviewScript } from "../workspace-preview.js";
6
+ import { WorkspaceTerminal } from "../workspace-terminal.js";
7
+ import { computed, getCurrentInstance, h, onMounted, onScopeDispose, ref, shallowRef, watch } from "vue";
8
+ import { checkWebContainerSupport } from "@vite-hub/web-container";
9
+ import { useWebContainer } from "@vite-hub/web-container/vue";
10
+ // src/workspace/runners/web-container.ts
11
+ const stageLabels = {
12
+ checking: "Checking the browser",
13
+ booting: "Starting WebContainer",
14
+ mounting: "Loading files",
15
+ installing: "Installing dependencies",
16
+ starting: "Starting the dev server"
17
+ };
18
+ function runState(workspace) {
19
+ const failure = workspace.failure.value;
20
+ if (failure) return {
21
+ tone: "error",
22
+ label: failure.kind === "install" ? "Install failed" : failure.kind === "server" ? "The dev server stopped" : "Did not start"
23
+ };
24
+ if (workspace.status.value === "ready" && workspace.previewUrl.value) return {
25
+ tone: "ready",
26
+ label: "Running"
27
+ };
28
+ return {
29
+ tone: "busy",
30
+ label: stageLabels[workspace.status.value] ?? "Starting"
31
+ };
32
+ }
33
+ /**
34
+ * Runs the files of a `Workspace` as an app in a WebContainer, with a dev server, a Preview tab, a Terminal tab, and a
35
+ * Connect tab for `connect`. Only desktops start it on their own.
36
+ */
37
+ function webContainer(options = {}) {
38
+ const current = shallowRef();
39
+ let queue = Promise.resolve();
40
+ function start({ example: booted, files, showTab }) {
41
+ const snapshot = options.snapshot?.(booted);
42
+ const bootManifest = booted.files?.["package.json"];
43
+ const sameManifest = files["package.json"] === bootManifest;
44
+ const store = useConnectStore();
45
+ const { copy } = useCopy();
46
+ const workspace = useWebContainer({
47
+ files,
48
+ assets: booted.assets,
49
+ immediate: false,
50
+ port: options.port,
51
+ previewScript: workspacePreviewScript,
52
+ env: options.connect && store.env(options.connect),
53
+ ...snapshot && {
54
+ snapshot,
55
+ install: sameManifest ? false : "install"
56
+ }
57
+ });
58
+ current.value = workspace;
59
+ let disposed = false;
60
+ let release;
61
+ const turn = queue;
62
+ queue = new Promise((resolve) => {
63
+ release = resolve;
64
+ });
65
+ const boots = /* @__PURE__ */ new Set();
66
+ function inTurn(action) {
67
+ return turn.then(() => {
68
+ if (disposed) return;
69
+ if (workspace.container.value) return action();
70
+ const boot = workspace.boot();
71
+ boots.add(boot);
72
+ const done = () => {
73
+ boots.delete(boot);
74
+ };
75
+ boot.then(done, done);
76
+ return boot;
77
+ });
78
+ }
79
+ let booting;
80
+ const ownTurn = () => {
81
+ booting ??= inTurn(() => workspace.boot());
82
+ return booting;
83
+ };
84
+ const restart = () => inTurn(() => workspace.restart());
85
+ if (getCurrentInstance()) onMounted(ownTurn);
86
+ else ownTurn();
87
+ onScopeDispose(() => {
88
+ disposed = true;
89
+ workspace.teardown();
90
+ if (current.value === workspace) current.value = void 0;
91
+ Promise.allSettled([turn, ...boots]).then(release);
92
+ });
93
+ watch(() => store.credentials.value, () => {
94
+ if (workspace.container.value && workspace.status.value === "ready") restart();
95
+ });
96
+ const states = computed(() => {
97
+ const result = {};
98
+ for (const provider of options.connect?.providers ?? []) if (store.credentials.value[provider.name]) result[provider.name] = { status: "connected" };
99
+ return result;
100
+ });
101
+ let opened = booted;
102
+ const previewPath = ref(booted.preview ?? "/");
103
+ const starting = computed(() => workspace.status.value !== "ready" || !!workspace.failure.value || !workspace.previewUrl.value);
104
+ const tabs = computed(() => {
105
+ const connected = Object.keys(states.value).length;
106
+ return [
107
+ {
108
+ label: "Preview",
109
+ value: "preview"
110
+ },
111
+ {
112
+ label: "Terminal",
113
+ value: "terminal"
114
+ },
115
+ ...options.connect?.providers.length ? [{
116
+ badge: connected || void 0,
117
+ label: "Connect",
118
+ value: "connect"
119
+ }] : []
120
+ ];
121
+ });
122
+ const actions = computed(() => [{
123
+ disabled: !workspace.container.value,
124
+ icon: "i-lucide-refresh-cw",
125
+ label: "Restart dev server",
126
+ onSelect: () => void restart()
127
+ }]);
128
+ return {
129
+ files: workspace.files,
130
+ setFiles: (next, setOptions) => workspace.setFiles(next, setOptions),
131
+ keeps: (next) => sameManifest && next.assets === booted.assets && options.snapshot?.(next) === snapshot && workspace.files.value["package.json"] === opened.files?.["package.json"] && (snapshot !== void 0 || next.files?.["package.json"] === bootManifest),
132
+ async open(next, nextFiles) {
133
+ opened = next;
134
+ previewPath.value = next.preview ?? "/";
135
+ try {
136
+ await workspace.setFiles(nextFiles, { mode: "replace" });
137
+ } catch {
138
+ return;
139
+ }
140
+ if (workspace.container.value) await restart();
141
+ },
142
+ tabs,
143
+ panel(tab) {
144
+ if (tab === "preview") {
145
+ if (!starting.value) return h(WorkspacePreview, {
146
+ path: previewPath.value,
147
+ url: workspace.previewUrl.value,
148
+ "onUpdate:path": (path) => {
149
+ previewPath.value = path;
150
+ }
151
+ });
152
+ return h("div", { class: "vh-workspace-boot" }, h(WorkspaceBootStatus, {
153
+ failure: workspace.failure.value,
154
+ online: workspace.online.value,
155
+ status: workspace.status.value,
156
+ steps: workspace.steps.value,
157
+ onRestart: () => void restart(),
158
+ onRetry: () => void inTurn(() => workspace.boot()),
159
+ "onRetry-install": () => void inTurn(() => workspace.install()),
160
+ "onShow-output": () => showTab("terminal")
161
+ }));
162
+ }
163
+ if (tab === "terminal") return h(WorkspaceTerminal, { output: workspace.logs.value });
164
+ const connect = options.connect;
165
+ if (tab === "connect" && connect) return h("div", { class: "vh-workspace-scroll" }, h(ConnectPanel, {
166
+ connect,
167
+ states: states.value,
168
+ onConnect: (name, token) => store.set(name, token),
169
+ onDisconnect: (name) => store.remove(name),
170
+ "onRemove-all": () => store.clear(),
171
+ "onCopy-command": (command) => void copy(command)
172
+ }));
173
+ },
174
+ state: computed(() => runState(workspace)),
175
+ actions
176
+ };
177
+ }
178
+ return {
179
+ desktop: true,
180
+ start,
181
+ supported: () => checkWebContainerSupport().supported,
182
+ workspace: current
183
+ };
184
+ }
185
+ export { webContainer };
@@ -0,0 +1,49 @@
1
+ import { SlotsType, VNode } from "vue";
2
+ /**
3
+ * The 44px bar over a workspace. From the start: the sidebar button (when `sidebar` is set), the `lead` slot (such as a
4
+ * logo and a title), the `examples` slot (a `WorkspaceExamples`), the step label, the default slot (such as the run
5
+ * state), a spacer, and the `actions` slot. Inside the `bar` slot of `WorkspaceShell` it takes the border and the
6
+ * height of the shell.
7
+ */
8
+ export declare const WorkspaceBar: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
9
+ sidebar: {
10
+ default: undefined;
11
+ type: BooleanConstructor;
12
+ };
13
+ sidebarId: {
14
+ default: undefined;
15
+ type: StringConstructor;
16
+ };
17
+ step: {
18
+ default: undefined;
19
+ type: StringConstructor;
20
+ };
21
+ }>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
22
+ [key: string]: any;
23
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
24
+ "update:sidebar": (open: boolean) => boolean;
25
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
26
+ sidebar: {
27
+ default: undefined;
28
+ type: BooleanConstructor;
29
+ };
30
+ sidebarId: {
31
+ default: undefined;
32
+ type: StringConstructor;
33
+ };
34
+ step: {
35
+ default: undefined;
36
+ type: StringConstructor;
37
+ };
38
+ }>> & Readonly<{
39
+ "onUpdate:sidebar"?: ((open: boolean) => any) | undefined;
40
+ }>, {
41
+ step: string;
42
+ sidebar: boolean;
43
+ sidebarId: string;
44
+ }, SlotsType<{
45
+ lead?: () => VNode[];
46
+ examples?: () => VNode[];
47
+ default?: () => VNode[];
48
+ actions?: () => VNode[];
49
+ }>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,50 @@
1
+ import { r as useUIComponent } from "../../nuxt-ui-7ByUrymx.js";
2
+ import { defineComponent, h } from "vue";
3
+ // src/workspace/workspace-bar.ts
4
+ /**
5
+ * The 44px bar over a workspace. From the start: the sidebar button (when `sidebar` is set), the `lead` slot (such as a
6
+ * logo and a title), the `examples` slot (a `WorkspaceExamples`), the step label, the default slot (such as the run
7
+ * state), a spacer, and the `actions` slot. Inside the `bar` slot of `WorkspaceShell` it takes the border and the
8
+ * height of the shell.
9
+ */
10
+ const WorkspaceBar = defineComponent({
11
+ name: "WorkspaceBar",
12
+ props: {
13
+ sidebar: {
14
+ default: void 0,
15
+ type: Boolean
16
+ },
17
+ sidebarId: {
18
+ default: void 0,
19
+ type: String
20
+ },
21
+ step: {
22
+ default: void 0,
23
+ type: String
24
+ }
25
+ },
26
+ emits: { "update:sidebar": (open) => typeof open === "boolean" },
27
+ slots: Object,
28
+ setup(props, { emit, slots }) {
29
+ const UButton = useUIComponent("UButton");
30
+ return () => h("header", { class: "vh-ws-topbar" }, [
31
+ props.sidebar === void 0 ? void 0 : h(UButton, {
32
+ "aria-controls": props.sidebarId,
33
+ "aria-expanded": String(props.sidebar),
34
+ "aria-label": props.sidebar ? "Close the sidebar" : "Open the sidebar",
35
+ class: "vh-ws-bar-button vh-ws-bar-icon",
36
+ color: "neutral",
37
+ icon: "i-lucide-panel-left",
38
+ variant: "ghost",
39
+ onClick: () => emit("update:sidebar", !props.sidebar)
40
+ }),
41
+ slots.lead?.(),
42
+ slots.examples?.(),
43
+ props.step ? h("span", { class: "vh-ws-step" }, props.step) : void 0,
44
+ slots.default?.(),
45
+ h("span", { class: "vh-ws-spacer" }),
46
+ slots.actions?.()
47
+ ]);
48
+ }
49
+ });
50
+ export { WorkspaceBar };
@@ -1,7 +1,6 @@
1
1
  import { PropType } from "vue";
2
2
  import { WebContainerStage, WebContainerStep } from "@vite-hub/web-container";
3
3
  import { UseWebContainerStatus, WebContainerFailure } from "@vite-hub/web-container/vue";
4
- //#region src/workspace/workspace-boot-status.d.ts
5
4
  type ChecklistStage = Extract<WebContainerStage, "checking" | "booting" | "mounting" | "installing" | "starting">;
6
5
  export type BootStepState = "pending" | "running" | "done" | "failed" | "skipped";
7
6
  export interface BootStepView {
@@ -72,4 +71,4 @@ export declare const WorkspaceBootStatus: import("vue").DefineComponent<import("
72
71
  failure: WebContainerFailure;
73
72
  online: boolean;
74
73
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
75
- //#endregion
74
+ export {};
@@ -1,7 +1,7 @@
1
- import { t as formatDuration } from "../../format-orwcdZL_.js";
1
+ import { t as formatDuration } from "../../format-Bc9m7-r0.js";
2
2
  import { icon } from "./icons.js";
3
3
  import { computed, defineComponent, h, onBeforeUnmount, ref, watch } from "vue";
4
- //#region src/workspace/workspace-boot-status.ts
4
+ // src/workspace/workspace-boot-status.ts
5
5
  const checklist = [
6
6
  {
7
7
  label: "Check browser support",
@@ -203,5 +203,4 @@ const WorkspaceBootStatus = defineComponent({
203
203
  };
204
204
  }
205
205
  });
206
- //#endregion
207
206
  export { WorkspaceBootStatus, bootChecklist };
@@ -0,0 +1,45 @@
1
+ /**
2
+ * The row over the editor: the path of the open file as a breadcrumb, a "Read-only" mark for a file that the reader
3
+ * cannot edit, and a button that wraps long lines. Put it in the `editor-head` slot of `WorkspaceShell`, which makes the
4
+ * row 32px high, as high as the tab bar of the output.
5
+ */
6
+ export declare const WorkspaceEditorHead: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
7
+ /** The path of the open file, such as `src/components/Greeting.vue`. */
8
+ path: {
9
+ required: true;
10
+ type: StringConstructor;
11
+ };
12
+ readonly: {
13
+ default: boolean;
14
+ type: BooleanConstructor;
15
+ };
16
+ /** Whether the editor wraps long lines. Use `v-model:wrap`, and give the same value to `WorkspaceEditor`. */
17
+ wrap: {
18
+ default: boolean;
19
+ type: BooleanConstructor;
20
+ };
21
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
22
+ [key: string]: any;
23
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
24
+ "update:wrap": (wrap: boolean) => boolean;
25
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
26
+ /** The path of the open file, such as `src/components/Greeting.vue`. */
27
+ path: {
28
+ required: true;
29
+ type: StringConstructor;
30
+ };
31
+ readonly: {
32
+ default: boolean;
33
+ type: BooleanConstructor;
34
+ };
35
+ /** Whether the editor wraps long lines. Use `v-model:wrap`, and give the same value to `WorkspaceEditor`. */
36
+ wrap: {
37
+ default: boolean;
38
+ type: BooleanConstructor;
39
+ };
40
+ }>> & Readonly<{
41
+ "onUpdate:wrap"?: ((wrap: boolean) => any) | undefined;
42
+ }>, {
43
+ wrap: boolean;
44
+ readonly: boolean;
45
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,65 @@
1
+ import { r as useUIComponent } from "../../nuxt-ui-7ByUrymx.js";
2
+ import { fileIcon } from "./file-icons.js";
3
+ import { icon } from "./icons.js";
4
+ import { defineComponent, h } from "vue";
5
+ // src/workspace/workspace-editor-head.ts
6
+ /**
7
+ * The row over the editor: the path of the open file as a breadcrumb, a "Read-only" mark for a file that the reader
8
+ * cannot edit, and a button that wraps long lines. Put it in the `editor-head` slot of `WorkspaceShell`, which makes the
9
+ * row 32px high, as high as the tab bar of the output.
10
+ */
11
+ const WorkspaceEditorHead = defineComponent({
12
+ name: "WorkspaceEditorHead",
13
+ props: {
14
+ /** The path of the open file, such as `src/components/Greeting.vue`. */
15
+ path: {
16
+ required: true,
17
+ type: String
18
+ },
19
+ readonly: {
20
+ default: false,
21
+ type: Boolean
22
+ },
23
+ /** Whether the editor wraps long lines. Use `v-model:wrap`, and give the same value to `WorkspaceEditor`. */
24
+ wrap: {
25
+ default: false,
26
+ type: Boolean
27
+ }
28
+ },
29
+ emits: { "update:wrap": (wrap) => typeof wrap === "boolean" },
30
+ setup(props, { emit, slots }) {
31
+ const UButton = useUIComponent("UButton");
32
+ return () => {
33
+ const folders = props.path.split("/").filter(Boolean);
34
+ const name = folders.pop() ?? props.path;
35
+ return h("div", { class: "vh-ws-file-head" }, [
36
+ h("nav", {
37
+ "aria-label": "File path",
38
+ class: "vh-ws-breadcrumb",
39
+ title: props.path
40
+ }, [
41
+ ...folders.flatMap((folder) => [h("span", folder), icon("chevron-right", "vh-ws-breadcrumb-separator")]),
42
+ fileIcon(name),
43
+ h("b", name)
44
+ ]),
45
+ props.readonly ? h("span", { class: "vh-ws-readonly" }, [icon("lock", "vh-ws-readonly-icon"), "Read-only"]) : void 0,
46
+ h("span", { class: "vh-ws-file-head-spacer" }),
47
+ slots.default?.(),
48
+ h(UButton, {
49
+ "aria-keyshortcuts": "Alt+Z",
50
+ "aria-label": "Wrap lines",
51
+ "aria-pressed": props.wrap ? "true" : "false",
52
+ class: "vh-ws-wrap-button",
53
+ color: "neutral",
54
+ icon: "i-lucide-text-wrap",
55
+ size: "xs",
56
+ square: true,
57
+ title: "Wrap lines (Alt+Z)",
58
+ variant: "ghost",
59
+ onClick: () => emit("update:wrap", !props.wrap)
60
+ })
61
+ ]);
62
+ };
63
+ }
64
+ });
65
+ export { WorkspaceEditorHead };
@@ -1,4 +1,4 @@
1
- //#region src/workspace/workspace-editor.d.ts
1
+ import { WorkspaceCursor } from "./workspace-status.js";
2
2
  /** A CodeMirror 6 editor for one file. CodeMirror loads when the editor mounts, so it stays out of pages that do not show code. */
3
3
  export declare const WorkspaceEditor: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
4
  /** The file path. It picks the language. */
@@ -15,10 +15,18 @@ export declare const WorkspaceEditor: import("vue").DefineComponent<import("vue"
15
15
  default: boolean;
16
16
  type: BooleanConstructor;
17
17
  };
18
+ /** Whether long lines wrap. Use `v-model:wrap`: Alt+Z toggles it, as in VS Code. */
19
+ wrap: {
20
+ default: boolean;
21
+ type: BooleanConstructor;
22
+ };
18
23
  }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
19
24
  [key: string]: any;
20
25
  }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
26
  "update:modelValue": (value: string) => boolean;
27
+ "update:wrap": (wrap: boolean) => boolean;
28
+ /** The cursor moved. Give it to `WorkspaceStatus`. */
29
+ cursor: (cursor: WorkspaceCursor) => boolean;
22
30
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
23
31
  /** The file path. It picks the language. */
24
32
  path: {
@@ -34,10 +42,17 @@ export declare const WorkspaceEditor: import("vue").DefineComponent<import("vue"
34
42
  default: boolean;
35
43
  type: BooleanConstructor;
36
44
  };
45
+ /** Whether long lines wrap. Use `v-model:wrap`: Alt+Z toggles it, as in VS Code. */
46
+ wrap: {
47
+ default: boolean;
48
+ type: BooleanConstructor;
49
+ };
37
50
  }>> & Readonly<{
38
51
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
52
+ onCursor?: ((cursor: WorkspaceCursor) => any) | undefined;
53
+ "onUpdate:wrap"?: ((wrap: boolean) => any) | undefined;
39
54
  }>, {
55
+ wrap: boolean;
40
56
  modelValue: string;
41
57
  readonly: boolean;
42
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
43
- //#endregion
58
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, h, onBeforeUnmount, onMounted, ref, watch } from "vue";
2
- //#region src/workspace/workspace-editor.ts
2
+ // src/workspace/workspace-editor.ts
3
3
  /** A CodeMirror 6 editor for one file. CodeMirror loads when the editor mounts, so it stays out of pages that do not show code. */
4
4
  const WorkspaceEditor = defineComponent({
5
5
  name: "WorkspaceEditor",
@@ -17,13 +17,28 @@ const WorkspaceEditor = defineComponent({
17
17
  readonly: {
18
18
  default: false,
19
19
  type: Boolean
20
+ },
21
+ /** Whether long lines wrap. Use `v-model:wrap`: Alt+Z toggles it, as in VS Code. */
22
+ wrap: {
23
+ default: false,
24
+ type: Boolean
20
25
  }
21
26
  },
22
- emits: { "update:modelValue": (value) => typeof value === "string" },
27
+ emits: {
28
+ "update:modelValue": (value) => typeof value === "string",
29
+ "update:wrap": (wrap) => typeof wrap === "boolean",
30
+ /** The cursor moved. Give it to `WorkspaceStatus`. */
31
+ cursor: (cursor) => typeof cursor.line === "number"
32
+ },
23
33
  setup(props, { emit, expose }) {
24
34
  const host = ref(null);
35
+ const wrap = ref(props.wrap);
25
36
  let editor;
26
37
  let disposed = false;
38
+ function setWrap(next) {
39
+ wrap.value = next;
40
+ emit("update:wrap", next);
41
+ }
27
42
  onMounted(async () => {
28
43
  const { createCodeEditor } = await import("./codemirror.js");
29
44
  if (disposed || !host.value) return;
@@ -31,24 +46,34 @@ const WorkspaceEditor = defineComponent({
31
46
  editor = createCodeEditor({
32
47
  doc: props.modelValue,
33
48
  onChange: (value) => emit("update:modelValue", value),
49
+ onCursor: (cursor) => emit("cursor", cursor),
50
+ onToggleWrap: () => setWrap(!wrap.value),
34
51
  parent: host.value,
35
52
  path: props.path,
36
- readonly: props.readonly
53
+ readonly: props.readonly,
54
+ wrap: wrap.value
37
55
  });
38
56
  });
39
57
  watch(() => [props.modelValue, props.path], ([value, path]) => editor?.setDoc(value, path));
40
58
  watch(() => props.readonly, (readonly) => editor?.setReadonly(readonly));
59
+ watch(() => props.wrap, (next) => {
60
+ wrap.value = next;
61
+ });
62
+ watch(wrap, (next) => editor?.setWrap(next));
41
63
  onBeforeUnmount(() => {
42
64
  disposed = true;
43
65
  editor?.destroy();
44
66
  });
45
- expose({ focus: () => editor?.focus() });
67
+ expose({
68
+ focus: () => editor?.focus(),
69
+ toggleWrap: () => setWrap(!wrap.value)
70
+ });
46
71
  return () => h("div", {
47
72
  class: "vh-ws-editor",
48
73
  "data-path": props.path,
74
+ "data-wrap": wrap.value ? "" : void 0,
49
75
  ref: host
50
76
  }, [h("pre", { class: "vh-ws-editor-fallback" }, props.modelValue)]);
51
77
  }
52
78
  });
53
- //#endregion
54
79
  export { WorkspaceEditor };
@@ -0,0 +1,72 @@
1
+ import { PropType } from "vue";
2
+ /** One example of a workspace: an app that the reader can open. */
3
+ export interface WorkspaceExample {
4
+ /** The id in share links, where the key stays `template` so older links open. */
5
+ id: string;
6
+ label: string;
7
+ description?: string;
8
+ /** The heading that the example sits under in the menu. Examples without one come first, with no heading. */
9
+ group?: string;
10
+ /** The files of the example. The start screen shows how many there are. */
11
+ files?: Readonly<Record<string, string>>;
12
+ /**
13
+ * The paths of `files` that the reader cannot edit, such as a generated file. The editor refuses typing in them and
14
+ * says "Read-only". Code can still change them with `setFile`.
15
+ */
16
+ readonly?: readonly string[];
17
+ /**
18
+ * Binary files, such as model weights, by path. The tree and the editor never show them. `webContainer()` mounts them
19
+ * next to the files, and `render()` gives them to its function as `example.assets`.
20
+ */
21
+ assets?: Readonly<Record<string, Uint8Array>>;
22
+ /** The file that the editor of a `Workspace` opens first. Defaults to the first file. */
23
+ open?: string;
24
+ /** The path that the preview of a `webContainer()` runner opens. Defaults to `/`. */
25
+ preview?: string;
26
+ }
27
+ /** The examples by group, in the order of their first example. Examples without a group come first. */
28
+ export declare function groupExamples<T extends WorkspaceExample>(examples: readonly T[]): {
29
+ group?: string;
30
+ examples: T[];
31
+ }[];
32
+ /**
33
+ * The examples menu of the workspace bar. The button shows the open example. The menu lists the examples under their
34
+ * group headings and checks the open one. The arrow keys move, a typed letter jumps to an example, and Enter opens it.
35
+ * It does not open the example itself: it emits `update:modelValue`, so the page can ask before it replaces edits.
36
+ */
37
+ export declare const WorkspaceExamples: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
38
+ examples: {
39
+ required: true;
40
+ type: PropType<readonly WorkspaceExample[]>;
41
+ };
42
+ modelValue: {
43
+ default: undefined;
44
+ type: PropType<string | null>;
45
+ };
46
+ label: {
47
+ default: string;
48
+ type: StringConstructor;
49
+ };
50
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
51
+ [key: string]: any;
52
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
53
+ "update:modelValue": (id: string) => boolean;
54
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
55
+ examples: {
56
+ required: true;
57
+ type: PropType<readonly WorkspaceExample[]>;
58
+ };
59
+ modelValue: {
60
+ default: undefined;
61
+ type: PropType<string | null>;
62
+ };
63
+ label: {
64
+ default: string;
65
+ type: StringConstructor;
66
+ };
67
+ }>> & Readonly<{
68
+ "onUpdate:modelValue"?: ((id: string) => any) | undefined;
69
+ }>, {
70
+ label: string;
71
+ modelValue: string | null;
72
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;