@vite-hub/ui 0.1.0 → 0.4.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 (314) hide show
  1. package/README.md +247 -21
  2. package/dist/attachments-BzTwqRTU.js +90 -0
  3. package/dist/{avatar-stack-DXmCQhxd.d.ts → avatar-stack-DPRFuezh.d.ts} +1 -1
  4. package/dist/choices-input-ByXJvDn1.d.ts +94 -0
  5. package/dist/{code-view-J4OsgEdh.js → code-view-DsU-xzic.js} +20 -4
  6. package/dist/colors-BghReA9C-CjF9gnmy.js +28 -0
  7. package/dist/comment-attachments-C4yNbcx5.js +20 -0
  8. package/dist/comment-composer-fINL5bxo.d.ts +243 -0
  9. package/dist/comment-composer-jYv2ULNP.js +591 -0
  10. package/dist/comment-layer-C_sbPIR5.d.ts +176 -0
  11. package/dist/comment-list-BcSaLngS.d.ts +62 -0
  12. package/dist/comment-marks.css +234 -0
  13. package/dist/comment-panel-CfvdRUMX.d.ts +208 -0
  14. package/dist/comment-person-CLPlW_SS.js +40 -0
  15. package/dist/comment-pin-DHOdRvUw.d.ts +68 -0
  16. package/dist/comment-row-Bn3nr8l5.js +39 -0
  17. package/dist/comment-selection-bar-CyVBNYl9.d.ts +42 -0
  18. package/dist/comment-thread-DKJjmWN0.d.ts +385 -0
  19. package/dist/comment-visibility-DsVuVndP.d.ts +40 -0
  20. package/dist/{comments-C08J3z4e.js → comments-D0d26ghV.js} +210 -59
  21. package/dist/comments-D8hulVPy.d.ts +198 -0
  22. package/dist/comments-context-C2lOZyQ5.js +38 -0
  23. package/dist/config-DgxBW013.d.ts +80 -0
  24. package/dist/config-Dk67emQt.js +63 -0
  25. package/dist/copy-button-CRN3kmSD.js +253 -0
  26. package/dist/draw-DzSmD7uo-Dwz8zoH2.js +72976 -0
  27. package/dist/editor-C_wt4RRV.js +582 -0
  28. package/dist/error-diagnostics-SXtnk6bz.js +38 -0
  29. package/dist/{file-tree-C1pv4_AI.js → file-tree-C4OYgbV-.js} +292 -145
  30. package/dist/{file-tree-Ctb8hZ_g.d.ts → file-tree-DlT9RGhu.d.ts} +51 -15
  31. package/dist/format-orwcdZL_.js +39 -0
  32. package/dist/handlers-DMl-Na3x.js +182 -0
  33. package/dist/headless.d.ts +5 -176
  34. package/dist/headless.js +5 -3
  35. package/dist/icon-swap.css +69 -0
  36. package/dist/{image-preview-VfknBEFu.js → image-preview-C9tdkmEj.js} +8 -5
  37. package/dist/{index-DcH0QSI5.d.ts → index-BYRFQfCd.d.ts} +14 -0
  38. package/dist/{code-view-vDM-hph-.d.ts → index-CNY1uNTh.d.ts} +14 -228
  39. package/dist/index.d.ts +55 -57
  40. package/dist/index.js +678 -25
  41. package/dist/markdown-editor-CMbNZOdN.js +2394 -0
  42. package/dist/markdown-editor-wQF0yD5o.d.ts +195 -0
  43. package/dist/markdown-editor.d.ts +108 -0
  44. package/dist/markdown-editor.js +3 -0
  45. package/dist/message-scroller-jrYN9dG9.d.ts +175 -0
  46. package/dist/nuxt-ui-DSQFzq3s.js +38 -0
  47. package/dist/nuxt.d.ts +84 -2
  48. package/dist/nuxt.js +243 -35
  49. package/dist/parts/components/agent-session.d.ts +254 -0
  50. package/dist/parts/components/agent-session.js +640 -0
  51. package/dist/{attachment-BBndG9_P.d.ts → parts/components/attachment.d.ts} +14 -15
  52. package/dist/{attachment-B3dXC7jM.js → parts/components/attachment.js} +6 -4
  53. package/dist/{avatar-stack.d.ts → parts/components/avatar-stack.d.ts} +1 -1
  54. package/dist/{avatar-stack-DM6HRnc0.js → parts/components/avatar-stack.js} +2 -5
  55. package/dist/{bubble-BJH2rfii.d.ts → parts/components/bubble.d.ts} +7 -8
  56. package/dist/{bubble-BPyFQlW7.js → parts/components/bubble.js} +2 -2
  57. package/dist/{chat-message-mpDmZbIC.d.ts → parts/components/chat-message.d.ts} +2 -3
  58. package/dist/{chat-message-BNK9G7xF.js → parts/components/chat-message.js} +4 -4
  59. package/dist/{chat-session-D6C7VJBR.d.ts → parts/components/chat-session.d.ts} +3 -4
  60. package/dist/{chat-session-DYEHB1HC.js → parts/components/chat-session.js} +2 -2
  61. package/dist/{chat-B9HlZWA2.d.ts → parts/components/chat.d.ts} +8 -4
  62. package/dist/{chat-BoFHlu9V.js → parts/components/chat.js} +42 -9
  63. package/dist/{highlighted-code-Dzf6o54i.d.ts → parts/components/code-block.d.ts} +15 -23
  64. package/dist/{code-block-Br-02hn-.js → parts/components/code-block.js} +9 -38
  65. package/dist/parts/components/code-view.d.ts +270 -0
  66. package/dist/parts/components/code-view.js +2 -0
  67. package/dist/parts/components/comment-composer.d.ts +2 -0
  68. package/dist/parts/components/comment-composer.js +2 -0
  69. package/dist/parts/components/comment-layer.d.ts +2 -0
  70. package/dist/parts/components/comment-layer.js +631 -0
  71. package/dist/parts/components/comment-list.d.ts +2 -0
  72. package/dist/parts/components/comment-list.js +168 -0
  73. package/dist/parts/components/comment-panel.d.ts +2 -0
  74. package/dist/parts/components/comment-panel.js +311 -0
  75. package/dist/parts/components/comment-pin.d.ts +2 -0
  76. package/dist/parts/components/comment-pin.js +75 -0
  77. package/dist/parts/components/comment-selection-bar.d.ts +2 -0
  78. package/dist/parts/components/comment-selection-bar.js +116 -0
  79. package/dist/parts/components/comment-thread.d.ts +2 -0
  80. package/dist/parts/components/comment-thread.js +598 -0
  81. package/dist/parts/components/comments.d.ts +8 -0
  82. package/dist/parts/components/comments.js +9 -0
  83. package/dist/{connection-status-DjGBw6xX.d.ts → parts/components/connection-status.d.ts} +6 -7
  84. package/dist/{connection-status-CzuWBENf.js → parts/components/connection-status.js} +1 -1
  85. package/dist/parts/components/copy-button.d.ts +118 -0
  86. package/dist/parts/components/copy-button.js +2 -0
  87. package/dist/parts/components/device-frame.d.ts +130 -0
  88. package/dist/parts/components/device-frame.js +471 -0
  89. package/dist/parts/components/file-tree.d.ts +2 -0
  90. package/dist/parts/components/file-tree.js +2 -0
  91. package/dist/parts/components/filter-search.d.ts +47 -0
  92. package/dist/parts/components/filter-search.js +58 -0
  93. package/dist/parts/components/markdown-editor.d.ts +2 -0
  94. package/dist/parts/components/markdown-editor.js +2 -0
  95. package/dist/parts/components/markdown-renderer.d.ts +52 -0
  96. package/dist/parts/components/markdown-renderer.js +23077 -0
  97. package/dist/{markdown-Dse5ldJe.d.ts → parts/components/markdown.d.ts} +7 -7
  98. package/dist/parts/components/markdown.js +47 -0
  99. package/dist/{marker-ea-tvx-J.d.ts → parts/components/marker.d.ts} +6 -7
  100. package/dist/{marker-Di2ZG_k1.js → parts/components/marker.js} +2 -2
  101. package/dist/{message-parts-BBFUkluC.d.ts → parts/components/message-parts.d.ts} +2 -3
  102. package/dist/{message-parts-DQnfioAH.js → parts/components/message-parts.js} +6 -6
  103. package/dist/{message-CW_paC1k.d.ts → parts/components/message.d.ts} +8 -9
  104. package/dist/{message-DiyBthIq.js → parts/components/message.js} +2 -2
  105. package/dist/parts/components/patch-parsers.d.ts +2 -0
  106. package/dist/parts/components/patch-parsers.js +2 -0
  107. package/dist/{prompt-input-Cy_Ue6B5.d.ts → parts/components/prompt-input.d.ts} +53 -10
  108. package/dist/{prompt-input-BbnCb80O.js → parts/components/prompt-input.js} +66 -111
  109. package/dist/parts/components/relative-time.d.ts +73 -0
  110. package/dist/parts/components/relative-time.js +2 -0
  111. package/dist/parts/components/status.d.ts +60 -0
  112. package/dist/parts/components/status.js +48 -0
  113. package/dist/{sync-status-refELOZn.d.ts → parts/components/sync-status.d.ts} +5 -6
  114. package/dist/{sync-status-BpxYdZIJ.js → parts/components/sync-status.js} +1 -1
  115. package/dist/{tool-list-E7CA52rz.d.ts → parts/components/tool-list.d.ts} +3 -4
  116. package/dist/{tool-list-BdSr5CT4.js → parts/components/tool-list.js} +7 -38
  117. package/dist/{trace-run-COeXn46Z.d.ts → parts/components/trace-run.d.ts} +3 -4
  118. package/dist/{trace-run-BIQ17CED.js → parts/components/trace-run.js} +15 -23
  119. package/dist/{trace-V7rM3Pyd.d.ts → parts/components/trace.d.ts} +11 -12
  120. package/dist/{trace-llBCDiSW.js → parts/components/trace.js} +20 -13
  121. package/dist/parts/composables/attachments.d.ts +32 -0
  122. package/dist/parts/composables/attachments.js +2 -0
  123. package/dist/parts/composables/highlighted-code.d.ts +9 -0
  124. package/dist/{highlighted-code-Ck4zexJX.js → parts/composables/highlighted-code.js} +5 -2
  125. package/dist/parts/headless/choices-input.d.ts +2 -0
  126. package/dist/parts/headless/choices-input.js +162 -0
  127. package/dist/parts/headless/comment-visibility.d.ts +2 -0
  128. package/dist/parts/headless/comment-visibility.js +128 -0
  129. package/dist/parts/headless/comments.d.ts +2 -0
  130. package/dist/parts/headless/comments.js +2 -0
  131. package/dist/parts/headless/message-scroller.d.ts +2 -0
  132. package/dist/{message-scroller-CX6NJTdm.js → parts/headless/message-scroller.js} +2 -2
  133. package/dist/parts/playground/highlight.d.ts +5 -0
  134. package/dist/parts/playground/highlight.js +23 -0
  135. package/dist/parts/playground/paths.d.ts +4 -0
  136. package/dist/parts/playground/paths.js +7 -0
  137. package/dist/parts/playground/playground-render.d.ts +126 -0
  138. package/dist/parts/playground/playground-render.js +356 -0
  139. package/dist/parts/playground/share.d.ts +2 -0
  140. package/dist/parts/playground/share.js +92 -0
  141. package/dist/parts/playground/zip.d.ts +6 -0
  142. package/dist/parts/playground/zip.js +76 -0
  143. package/dist/parts/workspace/browser-support-notice.d.ts +76 -0
  144. package/dist/parts/workspace/browser-support-notice.js +105 -0
  145. package/dist/parts/workspace/codemirror.d.ts +16 -0
  146. package/dist/parts/workspace/codemirror.js +243 -0
  147. package/dist/parts/workspace/connect-panel.d.ts +129 -0
  148. package/dist/parts/workspace/connect-panel.js +285 -0
  149. package/dist/parts/workspace/connect-store.d.ts +26 -0
  150. package/dist/parts/workspace/connect-store.js +59 -0
  151. package/dist/parts/workspace/icons.d.ts +34 -0
  152. package/dist/parts/workspace/icons.js +46 -0
  153. package/dist/parts/workspace/playground-container.d.ts +192 -0
  154. package/dist/parts/workspace/playground-container.js +603 -0
  155. package/dist/parts/workspace/workspace-boot-status.d.ts +75 -0
  156. package/dist/parts/workspace/workspace-boot-status.js +207 -0
  157. package/dist/parts/workspace/workspace-editor.d.ts +43 -0
  158. package/dist/parts/workspace/workspace-editor.js +54 -0
  159. package/dist/parts/workspace/workspace-file-tree.d.ts +53 -0
  160. package/dist/parts/workspace/workspace-file-tree.js +68 -0
  161. package/dist/parts/workspace/workspace-preview.d.ts +72 -0
  162. package/dist/parts/workspace/workspace-preview.js +307 -0
  163. package/dist/parts/workspace/workspace-shell.d.ts +88 -0
  164. package/dist/parts/workspace/workspace-shell.js +291 -0
  165. package/dist/parts/workspace/workspace-terminal.d.ts +39 -0
  166. package/dist/parts/workspace/workspace-terminal.js +130 -0
  167. package/dist/payload-text-sjkYAwvw.js +32 -0
  168. package/dist/{pierre-code-view-T7V67hwT.js → pierre-code-view-NE35tkmR.js} +245 -102
  169. package/dist/{pierre-dark-DDWDl8g6.js → pierre-dark-CzUmjETS.js} +3 -1
  170. package/dist/{pierre-light-CWhW4NrH.js → pierre-light-Dn6E0sWv.js} +3 -1
  171. package/dist/playground.d.ts +4 -0
  172. package/dist/playground.js +4 -0
  173. package/dist/relative-time-BVmjOsYG.js +309 -0
  174. package/dist/rolldown-runtime-C9mWXvCC.js +29 -0
  175. package/dist/runtime/nuxt-plugin.js +23 -4
  176. package/dist/sankey-CAYwt82B-D4uDQoMR.js +2887 -0
  177. package/dist/share-DM4eNy4q.d.ts +37 -0
  178. package/dist/{slot-part-C7Ocxn3b.js → slot-part-Doic71uh.js} +7 -1
  179. package/dist/styles.css +2609 -620
  180. package/dist/temml-BilSAAws.js +12362 -0
  181. package/dist/theme-focus-ring.css +42 -0
  182. package/dist/theme.css +376 -0
  183. package/dist/theme.d.ts +355 -0
  184. package/dist/theme.js +265 -0
  185. package/dist/{types-CqDwuJAm.d.ts → types-Dj7vp0lZ.d.ts} +1 -1
  186. package/dist/vue-BDmSCtay.js +30779 -0
  187. package/dist/vue-DGstVdGn.js +2492 -0
  188. package/dist/workspace.d.ts +15 -0
  189. package/dist/workspace.js +12 -0
  190. package/package.json +135 -149
  191. package/dist/andromeeda-BASpqCeJ.js +0 -4
  192. package/dist/attachment.d.ts +0 -2
  193. package/dist/attachment.js +0 -2
  194. package/dist/aurora-x-DugsLcii.js +0 -4
  195. package/dist/avatar-stack.js +0 -2
  196. package/dist/ayu-dark-BT3qdi3o.js +0 -4
  197. package/dist/ayu-light-BVZyHoh9.js +0 -4
  198. package/dist/ayu-mirage-XFwUVZQZ.js +0 -4
  199. package/dist/bubble.d.ts +0 -2
  200. package/dist/bubble.js +0 -2
  201. package/dist/catppuccin-frappe-D20KODDN.js +0 -4
  202. package/dist/catppuccin-latte-eGLVHIUJ.js +0 -4
  203. package/dist/catppuccin-macchiato-bQGch4PY.js +0 -4
  204. package/dist/catppuccin-mocha-Bes8-0Mr.js +0 -4
  205. package/dist/chat-message.d.ts +0 -2
  206. package/dist/chat-message.js +0 -2
  207. package/dist/chat-session.d.ts +0 -2
  208. package/dist/chat-session.js +0 -2
  209. package/dist/chat.d.ts +0 -2
  210. package/dist/chat.js +0 -2
  211. package/dist/code-block.d.ts +0 -2
  212. package/dist/code-block.js +0 -3
  213. package/dist/code-view.d.ts +0 -2
  214. package/dist/code-view.js +0 -2
  215. package/dist/comment-layer-CBlxJ8eK.js +0 -1113
  216. package/dist/comments-ChNJkV1d.d.ts +0 -108
  217. package/dist/comments-Cq5eewsu.d.ts +0 -537
  218. package/dist/comments.d.ts +0 -2
  219. package/dist/comments.js +0 -2
  220. package/dist/config-Bux_AJzm.d.ts +0 -29
  221. package/dist/config-bHqE4JOs.js +0 -38
  222. package/dist/connection-status.d.ts +0 -2
  223. package/dist/connection-status.js +0 -2
  224. package/dist/dark-plus-BGuiqa1B.js +0 -4
  225. package/dist/dracula-0CVA2XY5.js +0 -4
  226. package/dist/dracula-soft-Dk9bpbVU.js +0 -4
  227. package/dist/error-diagnostics-B4hMpJRL.js +0 -13
  228. package/dist/everforest-dark-CRjTbhh5.js +0 -4
  229. package/dist/everforest-light-CEeYFLn8.js +0 -4
  230. package/dist/file-diff.d.ts +0 -2
  231. package/dist/file-diff.js +0 -2
  232. package/dist/file-tree.d.ts +0 -2
  233. package/dist/file-tree.js +0 -2
  234. package/dist/file-view.d.ts +0 -2
  235. package/dist/file-view.js +0 -2
  236. package/dist/github-dark-BXgKmOw_.js +0 -4
  237. package/dist/github-dark-default-DzJQXksd.js +0 -4
  238. package/dist/github-dark-dimmed-B1pEmGtS.js +0 -4
  239. package/dist/github-dark-high-contrast-BkHIa6jc.js +0 -4
  240. package/dist/github-light-BKRlUbaB.js +0 -4
  241. package/dist/github-light-default-BU3eYkzs.js +0 -4
  242. package/dist/github-light-high-contrast-B3MumDcI.js +0 -4
  243. package/dist/gruvbox-dark-hard-B0ecF443.js +0 -4
  244. package/dist/gruvbox-dark-medium-BQnpC39k.js +0 -4
  245. package/dist/gruvbox-dark-soft-DFZUgESr.js +0 -4
  246. package/dist/gruvbox-light-hard-CuB_LOJr.js +0 -4
  247. package/dist/gruvbox-light-medium-idDHgxjs.js +0 -4
  248. package/dist/gruvbox-light-soft-CfWH49MY.js +0 -4
  249. package/dist/horizon-bright-Ba6M8QSV.js +0 -4
  250. package/dist/horizon-h92C5OlZ.js +0 -4
  251. package/dist/houston-EQnPegWq.js +0 -4
  252. package/dist/kanagawa-dragon-DgDvwi3B.js +0 -4
  253. package/dist/kanagawa-lotus-BgoQro20.js +0 -4
  254. package/dist/kanagawa-wave-DgXEowHs.js +0 -4
  255. package/dist/laserwave-IxBH_3yW.js +0 -4
  256. package/dist/light-plus-S8JBx6is.js +0 -4
  257. package/dist/markdown-BoLBN0qH.js +0 -197
  258. package/dist/markdown.d.ts +0 -2
  259. package/dist/markdown.js +0 -2
  260. package/dist/marker.d.ts +0 -2
  261. package/dist/marker.js +0 -2
  262. package/dist/material-theme-D1f3HBq-.js +0 -4
  263. package/dist/material-theme-darker-ExzYhT0j.js +0 -4
  264. package/dist/material-theme-lighter-D6gH9nnA.js +0 -4
  265. package/dist/material-theme-ocean-D1w5BPAa.js +0 -4
  266. package/dist/material-theme-palenight-CkqWmVpF.js +0 -4
  267. package/dist/message-parts.d.ts +0 -2
  268. package/dist/message-parts.js +0 -2
  269. package/dist/message.d.ts +0 -2
  270. package/dist/message.js +0 -2
  271. package/dist/min-dark-npsJH98j.js +0 -4
  272. package/dist/min-light-DUk1XsVt.js +0 -4
  273. package/dist/monokai-CfFRWUNl.js +0 -4
  274. package/dist/multi-file-diff.d.ts +0 -2
  275. package/dist/multi-file-diff.js +0 -2
  276. package/dist/night-owl-BS7V-av_.js +0 -4
  277. package/dist/night-owl-light-CZtRawYE.js +0 -4
  278. package/dist/nord-BFh54Nqz.js +0 -4
  279. package/dist/one-dark-pro-zDovGosB.js +0 -4
  280. package/dist/one-light-gmHK3iK6.js +0 -4
  281. package/dist/patch-diff.d.ts +0 -2
  282. package/dist/patch-diff.js +0 -2
  283. package/dist/plastic-DtdaCjub.js +0 -4
  284. package/dist/poimandres-Hdda6aHK.js +0 -4
  285. package/dist/primitive-rail.d.ts +0 -222
  286. package/dist/primitive-rail.js +0 -348
  287. package/dist/prompt-input.d.ts +0 -2
  288. package/dist/prompt-input.js +0 -2
  289. package/dist/red-VqZFRByZ.js +0 -4
  290. package/dist/rose-pine-DiTkEueR.js +0 -4
  291. package/dist/rose-pine-dawn-tfo5y2X0.js +0 -4
  292. package/dist/rose-pine-moon-C0gON9XN.js +0 -4
  293. package/dist/runtime-type-DlCscMfw.js +0 -59
  294. package/dist/slack-dark-v8P_eXr6.js +0 -4
  295. package/dist/slack-ochin-D8SyEdKz.js +0 -4
  296. package/dist/snazzy-light-BtkQkvXb.js +0 -4
  297. package/dist/solarized-dark-B8nAdMfM.js +0 -4
  298. package/dist/solarized-light-B-3F1INj.js +0 -4
  299. package/dist/sync-status.d.ts +0 -2
  300. package/dist/sync-status.js +0 -2
  301. package/dist/synthwave-84-DcsXCF_c.js +0 -4
  302. package/dist/tokyo-night-Bvpqduda.js +0 -4
  303. package/dist/tool-list.d.ts +0 -2
  304. package/dist/tool-list.js +0 -2
  305. package/dist/trace-run.d.ts +0 -2
  306. package/dist/trace-run.js +0 -2
  307. package/dist/trace.d.ts +0 -2
  308. package/dist/trace.js +0 -2
  309. package/dist/unresolved-file.d.ts +0 -2
  310. package/dist/unresolved-file.js +0 -2
  311. package/dist/vesper-CfxmMOy3.js +0 -4
  312. package/dist/vitesse-black-D9-_1mjV.js +0 -4
  313. package/dist/vitesse-dark-DlSMLlr9.js +0 -4
  314. package/dist/vitesse-light-KRWWWztf.js +0 -4
@@ -0,0 +1,356 @@
1
+ import { n as useCopy } from "../../copy-button-CRN3kmSD.js";
2
+ import { icon } from "../workspace/icons.js";
3
+ import { decodePlaygroundLink, encodePlaygroundLink, playgroundUrl, readPlaygroundHash } from "./share.js";
4
+ import { downloadZip } from "./zip.js";
5
+ import { computed, defineComponent, h, onBeforeUnmount, onMounted, ref, shallowRef, useId } from "vue";
6
+ //#region src/playground/playground-render.ts
7
+ const debounce = 200;
8
+ const invalidLink = "This link is cut off or changed, so the playground shows an example.";
9
+ const tooLong = "This playground is too big for a link. Download it as a zip.";
10
+ const noLinks = "This browser cannot write share links. Download the files as a zip.";
11
+ const blockedClipboard = "The browser blocked the clipboard. The link is in the address bar.";
12
+ function plainPreviewDocument(html) {
13
+ return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><style>:root{color-scheme:light}body{margin:0;padding:1.5rem;font:1rem/1.6 system-ui,sans-serif}</style></head><body>${html}</body></html>`;
14
+ }
15
+ /**
16
+ * The preview runs in a sandboxed frame with its own origin, so the page cannot read its scroll position. This script
17
+ * sends the position to the page, and goes back to the last position after each render.
18
+ */
19
+ function keepScroll(document, top) {
20
+ const script = `<script>(()=>{const y=${Math.round(top)};const go=()=>scrollTo(0,y);go();addEventListener("load",go);addEventListener("scroll",()=>parent.postMessage({vhPlaygroundScroll:scrollY},"*"),{passive:true})})()<\/script>`;
21
+ const end = document.lastIndexOf("</body>");
22
+ return end === -1 ? document + script : document.slice(0, end) + script + document.slice(end);
23
+ }
24
+ function scrollFrom(data) {
25
+ if (!data || typeof data !== "object" || !("vhPlaygroundScroll" in data)) return void 0;
26
+ return typeof data.vhPlaygroundScroll === "number" ? data.vhPlaygroundScroll : void 0;
27
+ }
28
+ function sameFiles(a, b) {
29
+ const paths = Object.keys(a);
30
+ return paths.length === Object.keys(b).length && paths.every((path) => a[path] === b[path]);
31
+ }
32
+ function groupPresets(presets) {
33
+ const groups = /* @__PURE__ */ new Map();
34
+ for (const preset of presets) groups.set(preset.group, [...groups.get(preset.group) ?? [], preset]);
35
+ return [...groups];
36
+ }
37
+ /**
38
+ * A playground that renders files in the page: editors on one side and the preview on the other. The state is a set
39
+ * of files, kept in the URL hash as a share link of `@vite-hub/ui/playground`.
40
+ */
41
+ const PlaygroundRender = defineComponent({
42
+ name: "PlaygroundRender",
43
+ props: {
44
+ /** The examples. A share link names one of them as its template. */
45
+ presets: {
46
+ required: true,
47
+ type: Array
48
+ },
49
+ /** The id of the preset that opens when the URL has no link. Defaults to the first preset. */
50
+ preset: {
51
+ default: void 0,
52
+ type: String
53
+ },
54
+ /** The editor tabs, one file each. */
55
+ panes: {
56
+ required: true,
57
+ type: Array
58
+ },
59
+ /** Renders the files to HTML. The playground calls it 200 ms after the last edit and drops a result that is out of date. */
60
+ render: {
61
+ required: true,
62
+ type: Function
63
+ },
64
+ /** Shiki languages that color the panes. They load after the first render. Without them, the panes are plain text. */
65
+ languages: {
66
+ default: void 0,
67
+ type: Array
68
+ },
69
+ /** Wraps the rendered HTML in the document of the preview, with its stylesheets and theme. Defaults to a plain page. */
70
+ previewDocument: {
71
+ default: plainPreviewDocument,
72
+ type: Function
73
+ }
74
+ },
75
+ emits: {
76
+ /** The files opened from the URL hash, or from the opening preset when the URL has no link. */
77
+ "load": (_event) => true,
78
+ /** Another preset opened: the reader picked it, or a link names it. */
79
+ "preset-change": (_event) => true
80
+ },
81
+ setup(props, { emit, expose, slots }) {
82
+ const presetById = (id) => props.presets.find((preset) => preset.id === id);
83
+ const opening = () => presetById(props.preset) ?? props.presets[0];
84
+ const files = shallowRef({ ...opening()?.files });
85
+ const template = ref(opening()?.id);
86
+ const base = computed(() => presetById(template.value));
87
+ const edited = computed(() => !!base.value && !sameFiles(files.value, base.value.files));
88
+ const active = ref(0);
89
+ const issues = ref([]);
90
+ const notice = ref();
91
+ const { copy, copied } = useCopy({ duration: 1500 });
92
+ const highlight = shallowRef();
93
+ const frame = ref(null);
94
+ const confirm = ref(null);
95
+ const confirmId = useId();
96
+ const stopped = new AbortController();
97
+ let timer;
98
+ let runs = 0;
99
+ let loads = 0;
100
+ let writes = 0;
101
+ let scrollTop = 0;
102
+ let written;
103
+ function invalidate() {
104
+ clearTimeout(timer);
105
+ runs++;
106
+ writes++;
107
+ loads++;
108
+ written = void 0;
109
+ }
110
+ async function run() {
111
+ const current = ++runs;
112
+ const snapshot = files.value;
113
+ try {
114
+ const result = await props.render(snapshot);
115
+ if (current !== runs || stopped.signal.aborted) return;
116
+ issues.value = result.issues ?? [];
117
+ if (frame.value) frame.value.srcdoc = keepScroll(props.previewDocument(result.html, snapshot), scrollTop);
118
+ } catch (error) {
119
+ if (current === runs && !stopped.signal.aborted) issues.value = [{ message: error instanceof Error ? error.message : String(error) }];
120
+ }
121
+ }
122
+ async function writeHash() {
123
+ const current = ++writes;
124
+ const code = await encodePlaygroundLink({
125
+ template: template.value,
126
+ files: files.value
127
+ }, base.value?.files).catch(() => void 0);
128
+ if (current !== writes || stopped.signal.aborted) return false;
129
+ if (code === void 0) {
130
+ notice.value = noLinks;
131
+ return false;
132
+ }
133
+ written = code;
134
+ history.replaceState(history.state, "", playgroundUrl(location.pathname + location.search, code));
135
+ return true;
136
+ }
137
+ function setFile(path, contents) {
138
+ invalidate();
139
+ files.value = {
140
+ ...files.value,
141
+ [path]: contents
142
+ };
143
+ notice.value = void 0;
144
+ timer = setTimeout(async () => {
145
+ await Promise.all([writeHash(), run()]);
146
+ }, debounce);
147
+ }
148
+ function open(preset, nextFiles) {
149
+ invalidate();
150
+ const changed = template.value !== preset?.id;
151
+ template.value = preset?.id;
152
+ files.value = nextFiles;
153
+ if (changed) emit("preset-change", {
154
+ files: nextFiles,
155
+ preset: preset?.id
156
+ });
157
+ }
158
+ async function load() {
159
+ const code = readPlaygroundHash(location.hash);
160
+ if (code && code === written) return;
161
+ invalidate();
162
+ const current = loads;
163
+ const state = code ? await decodePlaygroundLink(code, props.presets) : void 0;
164
+ if (current !== loads || stopped.signal.aborted) return;
165
+ if (state) open(presetById(state.template), state.files);
166
+ else open(opening(), { ...opening()?.files });
167
+ notice.value = code && !state ? invalidLink : void 0;
168
+ emit("load", {
169
+ files: files.value,
170
+ preset: template.value
171
+ });
172
+ await run();
173
+ }
174
+ async function pick(preset) {
175
+ notice.value = void 0;
176
+ scrollTop = 0;
177
+ open(preset, { ...preset.files });
178
+ await Promise.all([writeHash(), run()]);
179
+ }
180
+ async function copyLink() {
181
+ if (!await writeHash()) return;
182
+ if (location.href.length > 16e3) {
183
+ notice.value = tooLong;
184
+ return;
185
+ }
186
+ if (!await copy(location.href)) notice.value = blockedClipboard;
187
+ }
188
+ onMounted(() => {
189
+ addEventListener("hashchange", load, { signal: stopped.signal });
190
+ addEventListener("message", (event) => {
191
+ const top = event.source === frame.value?.contentWindow ? scrollFrom(event.data) : void 0;
192
+ if (top !== void 0) scrollTop = top;
193
+ }, { signal: stopped.signal });
194
+ const languages = props.languages;
195
+ load().then(async () => {
196
+ if (!languages?.length || stopped.signal.aborted) return;
197
+ const color = await import("./highlight.js").then((module) => module.createHighlight(languages)).catch(() => void 0);
198
+ if (!stopped.signal.aborted) highlight.value = color;
199
+ });
200
+ });
201
+ onBeforeUnmount(() => {
202
+ stopped.abort();
203
+ clearTimeout(timer);
204
+ });
205
+ expose({ setFile });
206
+ const paints = /* @__PURE__ */ new Map();
207
+ function paint(pane, text) {
208
+ const color = highlight.value;
209
+ let cached = paints.get(pane.file);
210
+ if (!cached || cached.text !== text || cached.color !== color) {
211
+ cached = {
212
+ color,
213
+ html: color && pane.language ? color(text, pane.language) : void 0,
214
+ text
215
+ };
216
+ paints.set(pane.file, cached);
217
+ }
218
+ return cached.html === void 0 ? h("div", {
219
+ "aria-hidden": "true",
220
+ class: "vh-pg-paint"
221
+ }, [h("pre", text)]) : h("div", {
222
+ "aria-hidden": "true",
223
+ class: "vh-pg-paint",
224
+ innerHTML: cached.html
225
+ });
226
+ }
227
+ function editor(pane) {
228
+ const value = files.value[pane.file] ?? "";
229
+ const custom = pane.slot ? slots[pane.slot] : void 0;
230
+ if (custom) return custom({
231
+ files: files.value,
232
+ pane,
233
+ setFile,
234
+ value
235
+ });
236
+ return [h("div", { class: "vh-pg-code" }, [paint(pane, `${value}\n `), h("textarea", {
237
+ "aria-label": pane.label,
238
+ autocapitalize: "off",
239
+ autocomplete: "off",
240
+ spellcheck: false,
241
+ value,
242
+ onInput: (event) => setFile(pane.file, event.target.value)
243
+ })])];
244
+ }
245
+ return () => h("div", { class: "vh-pg" }, [
246
+ props.presets.length > 1 ? h("nav", {
247
+ "aria-label": "Examples",
248
+ class: "vh-pg-presets"
249
+ }, groupPresets(props.presets).map(([group, presets]) => h("div", { class: "vh-pg-group" }, [group ? h("p", { class: "vh-pg-group-title" }, slots.group?.({
250
+ group,
251
+ presets
252
+ }) ?? group) : void 0, h("ul", presets.map((preset) => h("li", { key: preset.id }, [h("button", {
253
+ "aria-current": template.value === preset.id && !edited.value ? "true" : void 0,
254
+ "class": "vh-pg-preset",
255
+ "data-focus-inset": "",
256
+ "data-preset": preset.id,
257
+ "type": "button",
258
+ "onClick": () => pick(preset)
259
+ }, slots.preset?.({
260
+ active: template.value === preset.id,
261
+ preset
262
+ }) ?? preset.label)])))]))) : void 0,
263
+ h("div", { class: "vh-pg-editor" }, [
264
+ h("div", { class: "vh-pg-bar" }, [props.panes.length > 1 ? h("div", {
265
+ "aria-label": "Files",
266
+ class: "vh-pg-tabs",
267
+ role: "group"
268
+ }, props.panes.map((pane, index) => h("button", {
269
+ "aria-pressed": String(active.value === index),
270
+ "class": "vh-pg-tab",
271
+ "data-focus-inset": "",
272
+ "type": "button",
273
+ "onClick": () => {
274
+ active.value = index;
275
+ }
276
+ }, pane.label))) : h("span", { class: "vh-pg-title" }, props.panes[0]?.label), h("div", { class: "vh-pg-actions" }, [
277
+ slots.toolbar?.({
278
+ files: files.value,
279
+ preset: base.value,
280
+ setFile
281
+ }),
282
+ edited.value ? h("button", {
283
+ "aria-label": "Reset to the example",
284
+ "class": "vh-ws-icon-button vh-pg-icon-button",
285
+ "data-action": "reset",
286
+ "title": "Reset to the example",
287
+ "type": "button",
288
+ "onClick": () => confirm.value?.showModal()
289
+ }, [icon("rotate-ccw")]) : void 0,
290
+ h("button", {
291
+ "aria-label": "Download as a zip",
292
+ "class": "vh-ws-icon-button vh-pg-icon-button",
293
+ "data-action": "download",
294
+ "title": "Download as a zip",
295
+ "type": "button",
296
+ "onClick": () => downloadZip(files.value, template.value ?? "playground")
297
+ }, [icon("download")]),
298
+ h("button", {
299
+ "class": "vh-ws-button",
300
+ "data-action": "copy-link",
301
+ "type": "button",
302
+ "onClick": copyLink
303
+ }, [icon(copied.value ? "check" : "link"), copied.value ? "Copied" : "Copy link"])
304
+ ])]),
305
+ ...props.panes.map((pane, index) => h("div", {
306
+ key: pane.file,
307
+ "class": "vh-pg-pane",
308
+ "data-file": pane.file,
309
+ "hidden": active.value !== index
310
+ }, editor(pane))),
311
+ notice.value ? h("p", {
312
+ class: "vh-pg-notice",
313
+ role: "status"
314
+ }, notice.value) : void 0,
315
+ h("ul", {
316
+ "aria-label": "Issues",
317
+ "aria-live": "polite",
318
+ "class": "vh-pg-issues",
319
+ "hidden": issues.value.length === 0
320
+ }, issues.value.map((issue) => h("li", [issue.line === void 0 ? void 0 : h("span", { class: "vh-pg-issue-line" }, `Line ${issue.line}`), issue.message]))),
321
+ h("dialog", {
322
+ "aria-labelledby": confirmId,
323
+ "class": "vh-pg-confirm",
324
+ "ref": confirm,
325
+ onClose: (event) => {
326
+ const dialog = event.target;
327
+ if (dialog.returnValue === "reset" && base.value) pick(base.value);
328
+ dialog.returnValue = "";
329
+ }
330
+ }, [h("form", { method: "dialog" }, [
331
+ h("p", {
332
+ class: "vh-pg-confirm-title",
333
+ id: confirmId
334
+ }, "Reset to the example?"),
335
+ h("p", { class: "vh-ws-muted" }, "Your changes will be lost."),
336
+ h("div", { class: "vh-ws-actions" }, [h("button", {
337
+ autofocus: true,
338
+ class: "vh-ws-button",
339
+ value: "cancel"
340
+ }, "Cancel"), h("button", {
341
+ class: "vh-ws-button vh-ws-button--primary",
342
+ value: "reset"
343
+ }, "Reset")])
344
+ ])])
345
+ ]),
346
+ h("iframe", {
347
+ class: "vh-pg-preview",
348
+ ref: frame,
349
+ sandbox: "allow-scripts allow-popups",
350
+ title: "Preview"
351
+ })
352
+ ]);
353
+ }
354
+ });
355
+ //#endregion
356
+ export { PlaygroundRender };
@@ -0,0 +1,2 @@
1
+ import { a as encodePlaygroundLink, c as playgroundUrl, i as decodePlaygroundLink, l as readPlaygroundHash, n as PlaygroundState, o as playgroundHashKey, r as PlaygroundTemplate, s as playgroundLinkLimit, t as PlaygroundFiles } from "../../share-DM4eNy4q.js";
2
+ export { PlaygroundFiles, PlaygroundState, PlaygroundTemplate, decodePlaygroundLink, encodePlaygroundLink, playgroundHashKey, playgroundLinkLimit, playgroundUrl, readPlaygroundHash };
@@ -0,0 +1,92 @@
1
+ import { isProjectPath } from "./paths.js";
2
+ //#region src/playground/share.ts
3
+ /**
4
+ * The longest share link, in characters. Chat apps and issue trackers cut longer URLs, and a link this long already
5
+ * holds about 60 KB of code. A bigger playground goes out as a zip.
6
+ */
7
+ const playgroundLinkLimit = 16e3;
8
+ /** The URL hash key that holds the files, as in `/play#code=…`. */
9
+ const playgroundHashKey = "code";
10
+ const inflatedLimit = 2 * 2 ** 20;
11
+ function toBase64Url(bytes) {
12
+ let binary = "";
13
+ for (const byte of bytes) binary += String.fromCharCode(byte);
14
+ return btoa(binary).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/, "");
15
+ }
16
+ function fromBase64Url(text) {
17
+ const binary = atob(text.replaceAll("-", "+").replaceAll("_", "/"));
18
+ return Uint8Array.from(binary, (char) => char.charCodeAt(0));
19
+ }
20
+ async function deflate(text) {
21
+ const stream = new Blob([new TextEncoder().encode(text)]).stream().pipeThrough(new CompressionStream("deflate-raw"));
22
+ return new Uint8Array(await new Response(stream).arrayBuffer());
23
+ }
24
+ /** Inflates at most `inflatedLimit` bytes, so a crafted link cannot fill the memory of the tab. Undefined above it. */
25
+ async function inflate(bytes) {
26
+ const reader = new Blob([bytes]).stream().pipeThrough(new DecompressionStream("deflate-raw")).getReader();
27
+ const decoder = new TextDecoder();
28
+ let text = "";
29
+ let size = 0;
30
+ for (let chunk = await reader.read(); !chunk.done; chunk = await reader.read()) {
31
+ size += chunk.value.byteLength;
32
+ if (size > inflatedLimit) {
33
+ await reader.cancel();
34
+ return;
35
+ }
36
+ text += decoder.decode(chunk.value, { stream: true });
37
+ }
38
+ return text + decoder.decode();
39
+ }
40
+ /**
41
+ * Encodes the files as their differences from `base`, the files of the template, compressed for a URL hash.
42
+ * It runs in browsers and in Node, so a build can write playground links too.
43
+ */
44
+ async function encodePlaygroundLink(state, base = {}) {
45
+ const changed = Object.fromEntries(Object.entries(state.files).filter(([path, contents]) => base[path] !== contents));
46
+ const removed = Object.keys(base).filter((path) => !Object.hasOwn(state.files, path));
47
+ const payload = {
48
+ ...state.template !== void 0 && { t: state.template },
49
+ ...Object.keys(changed).length > 0 && { f: changed },
50
+ ...removed.length > 0 && { d: removed }
51
+ };
52
+ return toBase64Url(await deflate(JSON.stringify(payload)));
53
+ }
54
+ function isFiles(value) {
55
+ return !!value && typeof value === "object" && !Array.isArray(value) && Object.entries(value).every(([path, contents]) => isProjectPath(path) && typeof contents === "string");
56
+ }
57
+ /**
58
+ * Reads a share code back into files. A malformed code, an unsafe path, or a template that is not in `templates` gives
59
+ * `undefined`.
60
+ */
61
+ async function decodePlaygroundLink(code, templates = []) {
62
+ try {
63
+ const text = await inflate(fromBase64Url(code));
64
+ if (text === void 0) return void 0;
65
+ const payload = JSON.parse(text);
66
+ if (!payload || typeof payload !== "object" || Array.isArray(payload)) return void 0;
67
+ const { t, f = {}, d = [] } = payload;
68
+ const template = t === void 0 ? void 0 : templates.find((candidate) => candidate.id === t);
69
+ if (t !== void 0 && !template || !isFiles(f) || !Array.isArray(d) || !d.every((path) => typeof path === "string" && isProjectPath(path))) return void 0;
70
+ const files = {
71
+ ...template?.files,
72
+ ...f
73
+ };
74
+ for (const path of d) delete files[path];
75
+ return template ? {
76
+ template: template.id,
77
+ files
78
+ } : { files };
79
+ } catch {
80
+ return;
81
+ }
82
+ }
83
+ /** The share code in a URL hash such as `#code=…`, or `undefined`. */
84
+ function readPlaygroundHash(hash) {
85
+ return new URLSearchParams(hash.replace(/^#/, "")).get("code") || void 0;
86
+ }
87
+ /** The link to `path` that opens `code`, such as `/play#code=…`. */
88
+ function playgroundUrl(path, code) {
89
+ return `${path}#${playgroundHashKey}=${code}`;
90
+ }
91
+ //#endregion
92
+ export { decodePlaygroundLink, encodePlaygroundLink, playgroundHashKey, playgroundLinkLimit, playgroundUrl, readPlaygroundHash };
@@ -0,0 +1,6 @@
1
+ //#region src/playground/zip.d.ts
2
+ /** A stored `.zip` of text files under `folder/`, with the same bytes for the same files. */
3
+ export declare function zipFiles(files: Record<string, string>, folder: string): Uint8Array<ArrayBuffer>;
4
+ /** Saves `files` as `<folder>.zip`. */
5
+ export declare function downloadZip(files: Record<string, string>, folder: string): void;
6
+ //#endregion
@@ -0,0 +1,76 @@
1
+ import { t as uiErrorDiagnostics } from "../../error-diagnostics-SXtnk6bz.js";
2
+ import { isProjectPath } from "./paths.js";
3
+ //#region src/playground/zip.ts
4
+ const crcTable = Array.from({ length: 256 }, (_, index) => {
5
+ let value = index;
6
+ for (let bit = 0; bit < 8; bit++) value = value & 1 ? 3988292384 ^ value >>> 1 : value >>> 1;
7
+ return value >>> 0;
8
+ });
9
+ function crc32(data) {
10
+ let crc = 4294967295;
11
+ for (const byte of data) crc = crcTable[(crc ^ byte) & 255] ^ crc >>> 8;
12
+ return (crc ^ 4294967295) >>> 0;
13
+ }
14
+ /** A stored `.zip` of text files under `folder/`, with the same bytes for the same files. */
15
+ function zipFiles(files, folder) {
16
+ if (!isProjectPath(folder) || !Object.keys(files).every(isProjectPath)) throw uiErrorDiagnostics.UI_ZIP_PATH_UNSAFE();
17
+ const encoder = new TextEncoder();
18
+ const local = [];
19
+ const central = [];
20
+ let offset = 0;
21
+ const entries = Object.entries(files).sort(([a], [b]) => a.localeCompare(b));
22
+ for (const [path, contents] of entries) {
23
+ const name = encoder.encode(`${folder}/${path}`);
24
+ const data = encoder.encode(contents);
25
+ const checksum = crc32(data);
26
+ const header = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(30));
27
+ header.setUint32(0, 67324752, true);
28
+ header.setUint16(4, 20, true);
29
+ header.setUint16(6, 2048, true);
30
+ header.setUint16(8, 0, true);
31
+ header.setUint16(12, 33, true);
32
+ header.setUint32(14, checksum, true);
33
+ header.setUint32(18, data.length, true);
34
+ header.setUint32(22, data.length, true);
35
+ header.setUint16(26, name.length, true);
36
+ local.push(new Uint8Array(header.buffer), name, data);
37
+ const entry = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(46));
38
+ entry.setUint32(0, 33639248, true);
39
+ entry.setUint16(4, 788, true);
40
+ new Uint8Array(entry.buffer).set(new Uint8Array(header.buffer, 4, 26), 6);
41
+ entry.setUint32(38, 33188 << 16, true);
42
+ entry.setUint32(42, offset, true);
43
+ central.push(new Uint8Array(entry.buffer), name);
44
+ offset += 30 + name.length + data.length;
45
+ }
46
+ const directorySize = central.reduce((total, part) => total + part.length, 0);
47
+ const end = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(22));
48
+ end.setUint32(0, 101010256, true);
49
+ end.setUint16(8, entries.length, true);
50
+ end.setUint16(10, entries.length, true);
51
+ end.setUint32(12, directorySize, true);
52
+ end.setUint32(16, offset, true);
53
+ const parts = [
54
+ ...local,
55
+ ...central,
56
+ new Uint8Array(end.buffer)
57
+ ];
58
+ const zip = new Uint8Array(parts.reduce((total, part) => total + part.length, 0));
59
+ let position = 0;
60
+ for (const part of parts) {
61
+ zip.set(part, position);
62
+ position += part.length;
63
+ }
64
+ return zip;
65
+ }
66
+ /** Saves `files` as `<folder>.zip`. */
67
+ function downloadZip(files, folder) {
68
+ const url = URL.createObjectURL(new Blob([zipFiles(files, folder)], { type: "application/zip" }));
69
+ const link = document.createElement("a");
70
+ link.href = url;
71
+ link.download = `${folder}.zip`;
72
+ link.click();
73
+ setTimeout(() => URL.revokeObjectURL(url), 1e3);
74
+ }
75
+ //#endregion
76
+ export { downloadZip, zipFiles };
@@ -0,0 +1,76 @@
1
+ import { PropType } from "vue";
2
+ //#region src/workspace/browser-support-notice.d.ts
3
+ export type UnsupportedBrowser = "safari" | "unknown";
4
+ /** Safari, including every browser on iOS, which all use WebKit. */
5
+ export declare function detectUnsupportedBrowser(userAgent: string): UnsupportedBrowser;
6
+ /**
7
+ * Tells the reader that the live workspace cannot run, and that the page still works as text.
8
+ * It renders only on the client, after the support check, so a supported browser never sees it flash.
9
+ * It is an inline banner, not a tooltip, because touch devices have no hover and it holds buttons.
10
+ */
11
+ export declare const BrowserSupportNotice: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
12
+ /** The support result, such as `workspace.support.value?.supported`. The notice shows only when it is `false`. */
13
+ supported: {
14
+ default: undefined;
15
+ type: PropType<boolean | undefined>;
16
+ };
17
+ /** Pass the support check's reason to distinguish page configuration from browser limitations. */
18
+ reason: {
19
+ default: undefined;
20
+ type: StringConstructor;
21
+ };
22
+ /** Overrides the browser that the notice names. Detected from the user agent by default. */
23
+ browser: {
24
+ default: undefined;
25
+ type: PropType<UnsupportedBrowser>;
26
+ };
27
+ /** What the reader can do instead, when the browser is the cause. Defaults to the text for a tutorial. */
28
+ description: {
29
+ default: string;
30
+ type: StringConstructor;
31
+ };
32
+ /** The link that Copy link copies. Defaults to the current page. */
33
+ url: {
34
+ default: undefined;
35
+ type: StringConstructor;
36
+ };
37
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
38
+ [key: string]: any;
39
+ }> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
40
+ copied: (url: string) => boolean;
41
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
42
+ /** The support result, such as `workspace.support.value?.supported`. The notice shows only when it is `false`. */
43
+ supported: {
44
+ default: undefined;
45
+ type: PropType<boolean | undefined>;
46
+ };
47
+ /** Pass the support check's reason to distinguish page configuration from browser limitations. */
48
+ reason: {
49
+ default: undefined;
50
+ type: StringConstructor;
51
+ };
52
+ /** Overrides the browser that the notice names. Detected from the user agent by default. */
53
+ browser: {
54
+ default: undefined;
55
+ type: PropType<UnsupportedBrowser>;
56
+ };
57
+ /** What the reader can do instead, when the browser is the cause. Defaults to the text for a tutorial. */
58
+ description: {
59
+ default: string;
60
+ type: StringConstructor;
61
+ };
62
+ /** The link that Copy link copies. Defaults to the current page. */
63
+ url: {
64
+ default: undefined;
65
+ type: StringConstructor;
66
+ };
67
+ }>> & Readonly<{
68
+ onCopied?: ((url: string) => any) | undefined;
69
+ }>, {
70
+ url: string;
71
+ supported: boolean | undefined;
72
+ reason: string;
73
+ browser: UnsupportedBrowser;
74
+ description: string;
75
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
76
+ //#endregion