vue-stream-markdown 0.1.6 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/README.md +1 -0
  2. package/dist/{blockquote-CxA1dQZe.js → blockquote-C68fU4lp.js} +2 -2
  3. package/dist/{button-B2ebQt7R.js → button-BDO3n0n_.js} +36 -28
  4. package/dist/button-CdUyT8T_.js +6 -0
  5. package/dist/{code-CPG6B2Cw.js → code-2Dd0EGfm.js} +10 -9
  6. package/dist/code-block-Co2UoPPS.js +10 -0
  7. package/dist/{code-block-I_Yd1Flg.js → code-block-hQLDeAmP.js} +66 -78
  8. package/dist/{composables-DWipZHuF.js → composables-DuQ72m6O.js} +402 -365
  9. package/dist/{delete-DQ21z5-F.js → delete-CB-OS2WZ.js} +2 -2
  10. package/dist/dropdown-BB3nyts8.js +6 -0
  11. package/dist/{emphasis-BjLkIDQB.js → emphasis-BmUoyBRK.js} +2 -2
  12. package/dist/{error-component-DSOVrE5J.js → error-component-CtZr0_st.js} +10 -4
  13. package/dist/error-component-biOT0E-h.js +5 -0
  14. package/dist/{footnote-definition-BmS8hchP.js → footnote-definition-55TjXXwa.js} +8 -7
  15. package/dist/{footnote-reference-Z2tITeCE.js → footnote-reference-lk2rvC4Q.js} +1 -1
  16. package/dist/{heading-BwBFJB_E.js → heading-BlOK3uk2.js} +2 -2
  17. package/dist/icon-PEivHbuv.js +67 -0
  18. package/dist/icon-mUoYnA6R.js +4 -0
  19. package/dist/image-B6Pw2YBI.js +9 -0
  20. package/dist/{image-IKvFWz2r.js → image-Bqn98dDB.js} +12 -11
  21. package/dist/{image-BLlap3ce.js → image-VMGQj_VU.js} +75 -59
  22. package/dist/{index.css → index.css/index.css} +6 -4
  23. package/dist/index.d.ts +224 -188
  24. package/dist/index.js +2280 -88
  25. package/dist/{inline-math-C2Ryxm-K.js → inline-math--lfq9WCW.js} +3 -2
  26. package/dist/{link-BXl7E_6o.js → link-DAOjAX6n.js} +4 -3
  27. package/dist/{list-DLcwTZns.js → list-EOEqkWEi.js} +2 -2
  28. package/dist/{list-item-H0eYeIdB.js → list-item-ZG4eadLp.js} +2 -2
  29. package/dist/{math-C-0d5PaJ.js → math-3zyrsc0O.js} +3 -2
  30. package/dist/{mermaid-0x6C2MY5.js → mermaid-VkvXdOuQ.js} +27 -15
  31. package/dist/modal-BKzT1TQI.js +4 -0
  32. package/dist/{modal-CEqU9Ubu.js → modal-DrPdD2g1.js} +2 -2
  33. package/dist/{node-list--v2wbxOo.js → node-list-D7eKaZGS.js} +1 -1
  34. package/dist/node-list-DtNGUnnI.js +4 -0
  35. package/dist/{paragraph-DRPfp6DV.js → paragraph-DEyWEFYY.js} +2 -2
  36. package/dist/previewers-DYnyVv4Y.js +10 -0
  37. package/dist/segmented-6Ch-Ees3.js +7 -0
  38. package/dist/{segmented-Drf8EBQD.js → segmented-CeLXMLZa.js} +1 -1
  39. package/dist/{shiki-CkwRD3TS.js → shiki-Dgoch7Q6.js} +3 -3
  40. package/dist/spin-DElj7VPm.js +3 -0
  41. package/dist/{strong-D6V4fCRG.js → strong-CFjQLk1h.js} +2 -2
  42. package/dist/table-20vwclBI.js +3 -0
  43. package/dist/{table-DLUgGL5Q.js → table-DI25RphX.js} +19 -23
  44. package/dist/tooltip-CAyfm3_l.js +4 -0
  45. package/dist/{tooltip-Bdt9-aQx.js → tooltip-CnO7OPL1.js} +1 -1
  46. package/dist/vanilla-BZ1fQWZQ.js +4 -0
  47. package/dist/{vanilla-BSgZTIo9.js → vanilla-YFxsSfhA.js} +1 -1
  48. package/dist/{yaml-3cd5rdJj.js → yaml-eOuEqAWX.js} +1 -1
  49. package/dist/{zoom-container-f44XxzOI.js → zoom-container-CrKx_BbS.js} +32 -32
  50. package/dist/zoom-container-j4kY9qX_.js +7 -0
  51. package/package.json +19 -12
  52. package/dist/button-C6zIegam.js +0 -5
  53. package/dist/code-block--1wFjtmu.js +0 -9
  54. package/dist/dropdown-CtWjJiAf.js +0 -5
  55. package/dist/error-component-DtcRn_0A.js +0 -4
  56. package/dist/image-aT9xxnwh.js +0 -8
  57. package/dist/modal-BDgfKnFl.js +0 -4
  58. package/dist/node-list-CHvX62Zh.js +0 -4
  59. package/dist/previewers-DsN-cTwd.js +0 -10
  60. package/dist/segmented-DIVDGfR5.js +0 -6
  61. package/dist/spin-DWkKEP0G.js +0 -3
  62. package/dist/table-B2mghd3l.js +0 -3
  63. package/dist/tooltip-DQ1-yPia.js +0 -4
  64. package/dist/vanilla-DUbuBied.js +0 -4
  65. package/dist/zoom-container-D2DxS8V5.js +0 -6
  66. /package/dist/{angular-CEQtRU3N.js → angular-CJL7ngrz.js} +0 -0
  67. /package/dist/{angular-component-QEWXDi5W.js → angular-component-COlDvuNE.js} +0 -0
  68. /package/dist/{apache-D1WYHuA2.js → apache-CVvmKdUn.js} +0 -0
  69. /package/dist/{arrow-left-DiHYz8df.js → arrow-left-Dqeb1_Um.js} +0 -0
  70. /package/dist/{asciidoc-BbV_Tvaj.js → asciidoc-DOmevTVz.js} +0 -0
  71. /package/dist/{assembly-DOdgqSeT.js → assembly-Bj0yQVcL.js} +0 -0
  72. /package/dist/{astro-I7-Zr25r.js → astro-DUti0QFn.js} +0 -0
  73. /package/dist/{bash-BC7HOdMh.js → bash-BfyNXzLO.js} +0 -0
  74. /package/dist/{batch-XAv7F3kV.js → batch-Dp6N3cFQ.js} +0 -0
  75. /package/dist/{bicep-B9IAZzHb.js → bicep-CEkCHedl.js} +0 -0
  76. /package/dist/{c-B3pMu4KG.js → c-CTmG9vr2.js} +0 -0
  77. /package/dist/{check-BjAiKMbo.js → check-C6XCJVPi.js} +0 -0
  78. /package/dist/{chevron-down-B4lkjpIC.js → chevron-down-aK8OlmM2.js} +0 -0
  79. /package/dist/{circle-alert-DlAafH7h.js → circle-alert-C5r2kfnc.js} +0 -0
  80. /package/dist/{clojure-DwxK-YDX.js → clojure-CHjliXb8.js} +0 -0
  81. /package/dist/{cmake-DtnmI6Z6.js → cmake-BsKz8Gt4.js} +0 -0
  82. /package/dist/{cobol--wWeXL_f.js → cobol-BvWYwPFU.js} +0 -0
  83. /package/dist/{code-lfRPXNJI.js → code-Bwlpb4mV.js} +0 -0
  84. /package/dist/{codeowners-Dtwyh-5g.js → codeowners-CfTM6yvs.js} +0 -0
  85. /package/dist/{coffeescript-BlF7y2QG.js → coffeescript-BDiFe_B2.js} +0 -0
  86. /package/dist/{copy-BTFPPhff.js → copy-VpvA-5VS.js} +0 -0
  87. /package/dist/{corner-down-left-jxlwq3ox.js → corner-down-left-B77X84F8.js} +0 -0
  88. /package/dist/{cpp-D_TbJeEH.js → cpp-BfV_KWzp.js} +0 -0
  89. /package/dist/{crystal-lJ2ZzJQu.js → crystal-BXT0x2i3.js} +0 -0
  90. /package/dist/{csharp-D-5hlCJT.js → csharp-C6rkxA6x.js} +0 -0
  91. /package/dist/{css-Drykp8uH.js → css-Drxb2cuf.js} +0 -0
  92. /package/dist/{csv-oLjD_o9N.js → csv-CHKRaQ9l.js} +0 -0
  93. /package/dist/{cue-BBe_9OA4.js → cue-DksiF2mE.js} +0 -0
  94. /package/dist/{d-CPNK2-3G.js → d-C8JgmiVc.js} +0 -0
  95. /package/dist/{dart-BNaQZJdJ.js → dart-BX3GppmW.js} +0 -0
  96. /package/dist/{database-DRAhifbf.js → database-Lmva5T5u.js} +0 -0
  97. /package/dist/{diff-D_vIvULL.js → diff-C61xHcnV.js} +0 -0
  98. /package/dist/{docker-BgJkkqCD.js → docker-Dws0Euuu.js} +0 -0
  99. /package/dist/{download-Bk2mYZyf.js → download-BB76SD0m.js} +0 -0
  100. /package/dist/{elixir-CTx5aScS.js → elixir-CtaCeLkf.js} +0 -0
  101. /package/dist/{elm-nHy9iRuu.js → elm-CFvSvo-7.js} +0 -0
  102. /package/dist/{en-US-K7SXR3gy.js → en-US-Cw-sFSiZ.js} +0 -0
  103. /package/dist/{env-CrWzDcwP.js → env-BwMmmmE5.js} +0 -0
  104. /package/dist/{erlang-CxR4-Qdt.js → erlang-DJRbvPSq.js} +0 -0
  105. /package/dist/{eye-DpAj1af-.js → eye-VjweBQoW.js} +0 -0
  106. /package/dist/{flip-horizontal-CEf7aAdM.js → flip-horizontal-D4IxaKDu.js} +0 -0
  107. /package/dist/{fortran-DhUZYzo3.js → fortran-D3Vf5GTV.js} +0 -0
  108. /package/dist/{fsharp-DyIvnsyH.js → fsharp-C2iQH5b1.js} +0 -0
  109. /package/dist/{git-D4qjCZtd.js → git-DN4z97-P.js} +0 -0
  110. /package/dist/{gleam-D-ovCBt_.js → gleam-PhX3VC_5.js} +0 -0
  111. /package/dist/{go-CEH2y3pJ.js → go-xPznl0oK.js} +0 -0
  112. /package/dist/{graphql-DbV-8_AJ.js → graphql-sVzb1_rA.js} +0 -0
  113. /package/dist/{groovy-B-_VVp4c.js → groovy-Bvkrc3eE.js} +0 -0
  114. /package/dist/{haml-Cnm_v56B.js → haml-Y_qa35Lk.js} +0 -0
  115. /package/dist/{handlebars-8EEQS0El.js → handlebars-Bo6cxn4k.js} +0 -0
  116. /package/dist/{haskell-cLvKQFrd.js → haskell-D8t1pxAr.js} +0 -0
  117. /package/dist/{haxe-DtCGwrr1.js → haxe-C-sdXVB9.js} +0 -0
  118. /package/dist/{html-DFU0myJP.js → html-D7bGx0Cz.js} +0 -0
  119. /package/dist/{html-C2NHp3i4.js → html-I3JKB_2G.js} +0 -0
  120. /package/dist/{http-DYO1Ugj7.js → http-Dj2NVTPO.js} +0 -0
  121. /package/dist/{image-DDiNDOKJ.js → image-DzKVFSaY.js} +0 -0
  122. /package/dist/{inline-code-Bqu84Yyu.js → inline-code-BZNE1ALQ.js} +0 -0
  123. /package/dist/{java-it6UCC5M.js → java-BulcCUaV.js} +0 -0
  124. /package/dist/{javascript-DVxfoa-a.js → javascript-DQlby440.js} +0 -0
  125. /package/dist/{jinja-CUKX2CXM.js → jinja-HRQZM5oZ.js} +0 -0
  126. /package/dist/{json-O68iFOiu.js → json-wUPUX2x-.js} +0 -0
  127. /package/dist/{julia-Dq3BwHeZ.js → julia-DjHYSWzj.js} +0 -0
  128. /package/dist/{kdl-CFVZba8u.js → kdl-CGLuct22.js} +0 -0
  129. /package/dist/{kotlin-BKhxhG0q.js → kotlin-CnR9eg7m.js} +0 -0
  130. /package/dist/{latex-B3hQqfJO.js → latex-CesDKd8G.js} +0 -0
  131. /package/dist/{less-Bw2JZJkw.js → less-215r2nUv.js} +0 -0
  132. /package/dist/{link-DCaSecEI.js → link-4JB1WqYS.js} +0 -0
  133. /package/dist/{liquid-BsGDMxjJ.js → liquid-FFTnvZwx.js} +0 -0
  134. /package/dist/{lisp-CnrazyOe.js → lisp-BNWIo3S3.js} +0 -0
  135. /package/dist/{log-BuRjhdbZ.js → log-C3BhnPjM.js} +0 -0
  136. /package/dist/{lua-CA97s0xX.js → lua-jBHQD7Fh.js} +0 -0
  137. /package/dist/{luau-hq6gk9_N.js → luau-CJKAqC3L.js} +0 -0
  138. /package/dist/{makefile-mNhrnPWo.js → makefile-DZmoFYpF.js} +0 -0
  139. /package/dist/{markdown-El6B7b99.js → markdown-BEABBw2C.js} +0 -0
  140. /package/dist/{marko-8nTOMumd.js → marko-DE7d51Q2.js} +0 -0
  141. /package/dist/{matlab-DuqengFv.js → matlab-n99nEoGl.js} +0 -0
  142. /package/dist/{maximize-B1-N6kOL.js → maximize-VRncBaHe.js} +0 -0
  143. /package/dist/{mermaid-Byu8TsQE.js → mermaid-Dv9_1JlU.js} +0 -0
  144. /package/dist/{minimize-CVVLdf2H.js → minimize-k8aU78V4.js} +0 -0
  145. /package/dist/{nextflow-DRCOPmGT.js → nextflow-DjdDVx1j.js} +0 -0
  146. /package/dist/{nginx-DTgW--wm.js → nginx-DH4jOOdC.js} +0 -0
  147. /package/dist/{nim-r-ftp-xj.js → nim-Cb0hPGv5.js} +0 -0
  148. /package/dist/{nix-BdWPBS1Z.js → nix-Bf4Vwv5v.js} +0 -0
  149. /package/dist/{ocaml-vXi6ujuu.js → ocaml-BwJ1z9S7.js} +0 -0
  150. /package/dist/{perl-C_g5vs30.js → perl-P6bAYvN9.js} +0 -0
  151. /package/dist/{php-C_b0sjdl.js → php-BGTGPBW1.js} +0 -0
  152. /package/dist/{postcss-Bsz3PPjI.js → postcss-D8a2Jx1D.js} +0 -0
  153. /package/dist/{powershell-D0kxdwKl.js → powershell-DNOnus4K.js} +0 -0
  154. /package/dist/{prisma-BocqbK7a.js → prisma-DquVk_GR.js} +0 -0
  155. /package/dist/{prolog-D-zd1rzT.js → prolog-BxJJGnOg.js} +0 -0
  156. /package/dist/{properties-Dds-063G.js → properties-DjauSeDE.js} +0 -0
  157. /package/dist/{proto-CzD9trm_.js → proto-3aU1SxxY.js} +0 -0
  158. /package/dist/{pug-B1V2RxQS.js → pug-OiYFRnMd.js} +0 -0
  159. /package/dist/{puppet-BcnVd0q5.js → puppet-8Sq4QIbE.js} +0 -0
  160. /package/dist/{python-BcZnB7mH.js → python-CBYVyhMm.js} +0 -0
  161. /package/dist/{r-CxSFFuvL.js → r-DfzMNaiK.js} +0 -0
  162. /package/dist/{racket-DJ_82PRG.js → racket-EkEmTJtD.js} +0 -0
  163. /package/dist/{razor-D7IkXHVQ.js → razor-BSd-q379.js} +0 -0
  164. /package/dist/{rotate-ccw-square-5sO65BY9.js → rotate-ccw-square-Dy0doneR.js} +0 -0
  165. /package/dist/{ruby-Cidk52Rl.js → ruby-CNn-W_DF.js} +0 -0
  166. /package/dist/{rust-DJvcpkbm.js → rust-BW9y4Ksf.js} +0 -0
  167. /package/dist/{sass-DTFDeixE.js → sass-Cyleqehh.js} +0 -0
  168. /package/dist/{scala-GlHhGi5O.js → scala-2YqaI_aG.js} +0 -0
  169. /package/dist/{scheme-rNcj5mL9.js → scheme-CWx6sQlk.js} +0 -0
  170. /package/dist/{shader-Df9eByRK.js → shader-CLzSKNOz.js} +0 -0
  171. /package/dist/{shiki-token-renderer-BMveKuYt.js → shiki-token-renderer-BjxmGfXH.js} +0 -0
  172. /package/dist/{solidity-CfuYjRuT.js → solidity-CgjJUETv.js} +0 -0
  173. /package/dist/{spin-D4Oi_m7j.js → spin-DzERwGWy.js} +0 -0
  174. /package/dist/{stata-BB5c_hbh.js → stata-CI3W9UFN.js} +0 -0
  175. /package/dist/{svelte-2ISqxu6B.js → svelte-D-OV6frL.js} +0 -0
  176. /package/dist/{swift-wpybyudn.js → swift-CcBwS4X5.js} +0 -0
  177. /package/dist/{table-iNA4la0w.js → table-BMlD4JhL.js} +0 -0
  178. /package/dist/{terraform-CLzhaCaX.js → terraform-BwM_GPTy.js} +0 -0
  179. /package/dist/{text-DoY1TIw3.js → text-DP2IAZrc.js} +0 -0
  180. /package/dist/{text-C0mKr3tC.js → text-hIzRUiKs.js} +0 -0
  181. /package/dist/{thematic-break-DXDZ5dcO.js → thematic-break-DIO-A8eY.js} +0 -0
  182. /package/dist/{theme.css → theme.css/theme.css} +0 -0
  183. /package/dist/{toml-DImd1uev.js → toml-CXJ7B-C1.js} +0 -0
  184. /package/dist/{twig-DEBVmtOq.js → twig-CXQNsdEx.js} +0 -0
  185. /package/dist/{typescript-Xo5tgeOd.js → typescript-0uiFYOof.js} +0 -0
  186. /package/dist/{typst-_Ui0vNYP.js → typst-gIi5b52E.js} +0 -0
  187. /package/dist/{v-Ch6vEAHG.js → v-Ct-HfSu0.js} +0 -0
  188. /package/dist/{vala-Ds_Ad1cC.js → vala-BZbAZj2w.js} +0 -0
  189. /package/dist/{verilog-CUqRomTC.js → verilog-NzFyyNP_.js} +0 -0
  190. /package/dist/{vim-BFUPh6oM.js → vim-CN-tRagW.js} +0 -0
  191. /package/dist/{vue-DzgIlbJ2.js → vue-BmLzKAao.js} +0 -0
  192. /package/dist/{xml-CmbQxaqc.js → xml-CBzkooc-.js} +0 -0
  193. /package/dist/{yaml-BhwCoLnZ.js → yaml-CT7I_lPM.js} +0 -0
  194. /package/dist/{zh-CN-CykTNqF_.js → zh-CN-B9lWRP8O.js} +0 -0
  195. /package/dist/{zig-Bmrmp8vo.js → zig-B7F-QzJD.js} +0 -0
  196. /package/dist/{zoomIn-CCKcyIEv.js → zoomIn-DlPeXZbT.js} +0 -0
  197. /package/dist/{zoomOut-BrSwLQZ_.js → zoomOut-Lvyw8SOW.js} +0 -0
package/README.md CHANGED
@@ -33,6 +33,7 @@ pnpm add vue-stream-markdown
33
33
  - **Theme-aware scoped styles** - Scoped styles under `.stream-markdown` with semantic `data-stream-markdown` attributes, following [shadcn/ui](https://ui.shadcn.com/) design system
34
34
  - **Beautiful built-in typography** - No atomic CSS required (Tailwind/UnoCSS), self-contained styles
35
35
  - **Content hardening & security** - Built-in protection against malicious Markdown with URL validation and protocol blocking
36
+ - **SSR support** - Full server-side rendering compatibility with environment detection utilities
36
37
 
37
38
  ## Usage
38
39
 
@@ -1,5 +1,5 @@
1
- import "./composables-DWipZHuF.js";
2
- import { t as node_list_default } from "./node-list--v2wbxOo.js";
1
+ import "./composables-DuQ72m6O.js";
2
+ import { t as node_list_default } from "./node-list-D7eKaZGS.js";
3
3
  import { createElementBlock, createVNode, defineComponent, mergeProps, openBlock } from "vue";
4
4
 
5
5
  //#region src/components/renderers/blockquote.vue?vue&type=script&setup=true&lang.ts
@@ -1,5 +1,7 @@
1
- import { t as tooltip_default } from "./tooltip-Bdt9-aQx.js";
2
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, h, normalizeClass, normalizeStyle, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, withCtx } from "vue";
1
+ import { t as tooltip_default } from "./tooltip-CnO7OPL1.js";
2
+ import { t as icon_default } from "./icon-PEivHbuv.js";
3
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, normalizeClass, normalizeStyle, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, withCtx } from "vue";
4
+ import { createReusableTemplate } from "@vueuse/core";
3
5
 
4
6
  //#region src/components/dropdown.vue?vue&type=script&setup=true&lang.ts
5
7
  const _hoisted_1 = { "data-stream-markdown": "dropdown-overlay" };
@@ -69,6 +71,7 @@ var dropdown_default = dropdown_vue_vue_type_script_setup_true_lang_default;
69
71
  //#endregion
70
72
  //#region src/components/button.vue?vue&type=script&setup=true&lang.ts
71
73
  var button_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
74
+ inheritAttrs: false,
72
75
  __name: "button",
73
76
  props: {
74
77
  variant: {
@@ -130,6 +133,7 @@ var button_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
130
133
  setup(__props, { emit: __emit }) {
131
134
  const props = __props;
132
135
  const emits = __emit;
136
+ const [DefineTemplate, ReuseTemplate] = createReusableTemplate();
133
137
  const isDropdown = computed(() => props.options.length > 0);
134
138
  function onClick(event) {
135
139
  if (isDropdown.value) return;
@@ -138,57 +142,61 @@ var button_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
138
142
  function onDropdownClick(event, item) {
139
143
  if (item) emits("click", event, item);
140
144
  }
141
- const Icon = computed(() => {
142
- if (!props.icon) return null;
143
- return h(props.icon, {
144
- width: props.iconWidth,
145
- height: props.iconHeight,
146
- class: props.iconClass,
147
- style: props.iconStyle
148
- });
149
- });
150
145
  return (_ctx, _cache) => {
151
- return __props.variant === "icon" ? (openBlock(), createBlock(resolveDynamicComponent(isDropdown.value ? dropdown_default : tooltip_default), {
152
- key: 0,
146
+ return openBlock(), createElementBlock(Fragment, null, [createVNode(unref(DefineTemplate), null, {
147
+ default: withCtx(() => [__props.icon ? (openBlock(), createBlock(icon_default, {
148
+ key: 0,
149
+ icon: __props.icon,
150
+ width: __props.iconWidth,
151
+ height: __props.iconHeight,
152
+ class: normalizeClass(__props.iconClass),
153
+ style: normalizeStyle(__props.iconStyle)
154
+ }, null, 8, [
155
+ "icon",
156
+ "width",
157
+ "height",
158
+ "class",
159
+ "style"
160
+ ])) : createCommentVNode("v-if", true)]),
161
+ _: 1
162
+ }), __props.variant === "icon" ? (openBlock(), createBlock(resolveDynamicComponent(isDropdown.value ? dropdown_default : tooltip_default), mergeProps({ key: 0 }, _ctx.$attrs, {
153
163
  content: isDropdown.value ? void 0 : __props.name,
154
164
  title: __props.name,
155
165
  options: __props.options,
156
166
  onClick: onDropdownClick
157
- }, {
158
- default: withCtx(() => [createElementVNode("button", {
167
+ }), {
168
+ default: withCtx(() => [createElementVNode("button", mergeProps(_ctx.$attrs, {
159
169
  "data-stream-markdown": "button",
160
170
  type: "button",
161
- class: normalizeClass(__props.buttonClass),
162
- style: normalizeStyle(__props.buttonStyle),
171
+ class: __props.buttonClass,
172
+ style: __props.buttonStyle,
163
173
  onClick
164
- }, [(openBlock(), createBlock(resolveDynamicComponent(Icon.value)))], 6)]),
174
+ }), [createVNode(unref(ReuseTemplate))], 16)]),
165
175
  _: 1
166
- }, 8, [
176
+ }, 16, [
167
177
  "content",
168
178
  "title",
169
179
  "options"
170
- ])) : __props.variant === "text" && !isDropdown.value ? (openBlock(), createElementBlock("button", {
171
- key: 1,
180
+ ])) : __props.variant === "text" && !isDropdown.value ? (openBlock(), createElementBlock("button", mergeProps({ key: 1 }, _ctx.$attrs, {
172
181
  "data-stream-markdown": "button",
173
182
  type: "button",
174
- class: normalizeClass(__props.buttonClass),
175
- style: normalizeStyle(__props.buttonStyle),
183
+ class: __props.buttonClass,
184
+ style: __props.buttonStyle,
176
185
  onClick
177
- }, [(openBlock(), createBlock(resolveDynamicComponent(Icon.value))), createTextVNode(" " + toDisplayString(__props.name), 1)], 6)) : (openBlock(), createBlock(dropdown_default, {
178
- key: 2,
186
+ }), [createVNode(unref(ReuseTemplate)), createTextVNode(" " + toDisplayString(__props.name), 1)], 16)) : (openBlock(), createBlock(dropdown_default, mergeProps({ key: 2 }, _ctx.$attrs, {
179
187
  title: __props.name,
180
188
  options: __props.options,
181
189
  onClick: onDropdownClick
182
- }, {
190
+ }), {
183
191
  default: withCtx(() => [createElementVNode("button", {
184
192
  "data-stream-markdown": "button",
185
193
  type: "button",
186
194
  class: normalizeClass(__props.buttonClass),
187
195
  style: normalizeStyle(__props.buttonStyle),
188
196
  onClick
189
- }, [(openBlock(), createBlock(resolveDynamicComponent(Icon.value))), createTextVNode(" " + toDisplayString(__props.name), 1)], 6)]),
197
+ }, [createVNode(unref(ReuseTemplate)), createTextVNode(" " + toDisplayString(__props.name), 1)], 6)]),
190
198
  _: 1
191
- }, 8, ["title", "options"]));
199
+ }, 16, ["title", "options"]))], 64);
192
200
  };
193
201
  }
194
202
  });
@@ -0,0 +1,6 @@
1
+ import "./composables-DuQ72m6O.js";
2
+ import "./tooltip-CnO7OPL1.js";
3
+ import { t as button_default } from "./button-BDO3n0n_.js";
4
+ import "./icon-PEivHbuv.js";
5
+
6
+ export { button_default as default };
@@ -1,10 +1,11 @@
1
- import "./previewers-DsN-cTwd.js";
2
- import { r as useShiki } from "./composables-DWipZHuF.js";
3
- import "./tooltip-Bdt9-aQx.js";
4
- import "./button-B2ebQt7R.js";
5
- import "./modal-CEqU9Ubu.js";
6
- import { t as code_block_default } from "./code-block-I_Yd1Flg.js";
7
- import "./segmented-Drf8EBQD.js";
1
+ import "./previewers-DYnyVv4Y.js";
2
+ import { r as useShiki } from "./composables-DuQ72m6O.js";
3
+ import "./tooltip-CnO7OPL1.js";
4
+ import "./button-BDO3n0n_.js";
5
+ import "./icon-PEivHbuv.js";
6
+ import "./modal-DrPdD2g1.js";
7
+ import { t as code_block_default } from "./code-block-hQLDeAmP.js";
8
+ import "./segmented-CeLXMLZa.js";
8
9
  import { computed, createBlock, createCommentVNode, defineAsyncComponent, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, resolveDynamicComponent, withCtx } from "vue";
9
10
 
10
11
  //#region src/components/renderers/code/index.vue?vue&type=script&setup=true&lang.ts
@@ -74,8 +75,8 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
74
75
  const languageClass = computed(() => `language-${props.node.lang}`);
75
76
  const { installed: hasShiki } = useShiki();
76
77
  const components = {
77
- vanilla: defineAsyncComponent(() => import("./vanilla-DUbuBied.js")),
78
- shiki: defineAsyncComponent(() => import("./shiki-CkwRD3TS.js"))
78
+ vanilla: defineAsyncComponent(() => import("./vanilla-BZ1fQWZQ.js")),
79
+ shiki: defineAsyncComponent(() => import("./shiki-Dgoch7Q6.js"))
79
80
  };
80
81
  const component = computed(() => {
81
82
  if (hasShiki.value) return components.shiki;
@@ -0,0 +1,10 @@
1
+ import "./previewers-DYnyVv4Y.js";
2
+ import "./composables-DuQ72m6O.js";
3
+ import "./tooltip-CnO7OPL1.js";
4
+ import "./button-BDO3n0n_.js";
5
+ import "./icon-PEivHbuv.js";
6
+ import "./modal-DrPdD2g1.js";
7
+ import { t as code_block_default } from "./code-block-hQLDeAmP.js";
8
+ import "./segmented-CeLXMLZa.js";
9
+
10
+ export { code_block_default as default };
@@ -1,8 +1,8 @@
1
- import { t as CODE_PREVIEWERS } from "./previewers-DsN-cTwd.js";
2
- import { A as save, H as useContext, P as useI18n, U as useCodeOptions, V as useControls, d as LANGUAGE_EXTENSIONS, f as LANGUAGE_ICONS, p as useMermaid, u as LANGUAGE_ALIAS } from "./composables-DWipZHuF.js";
3
- import { t as button_default } from "./button-B2ebQt7R.js";
4
- import { t as modal_default } from "./modal-CEqU9Ubu.js";
5
- import { t as segmented_default } from "./segmented-Drf8EBQD.js";
1
+ import { t as CODE_PREVIEWERS } from "./previewers-DYnyVv4Y.js";
2
+ import { G as useCodeOptions, U as useControls, W as useContext, d as LANGUAGE_EXTENSIONS, f as LANGUAGE_ICONS, p as useMermaid, u as LANGUAGE_ALIAS, y as useI18n, z as save } from "./composables-DuQ72m6O.js";
3
+ import { t as button_default } from "./button-BDO3n0n_.js";
4
+ import { t as modal_default } from "./modal-DrPdD2g1.js";
5
+ import { t as segmented_default } from "./segmented-CeLXMLZa.js";
6
6
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineAsyncComponent, defineComponent, guardReactiveProps, mergeProps, normalizeClass, normalizeProps, normalizeStyle, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, toRefs, unref, useModel, vShow, watch, withCtx, withDirectives } from "vue";
7
7
  import { createReusableTemplate, useClipboard } from "@vueuse/core";
8
8
 
@@ -17,21 +17,11 @@ var actions_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
17
17
  } },
18
18
  setup(__props) {
19
19
  return (_ctx, _cache) => {
20
- return openBlock(), createElementBlock("div", _hoisted_1$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.actions, (action) => {
21
- return openBlock(), createBlock(button_default, {
22
- key: action.key,
23
- name: action.name,
24
- icon: action.icon,
25
- "icon-style": action.iconStyle,
26
- options: action.options,
27
- onClick: action.onClick
28
- }, null, 8, [
29
- "name",
30
- "icon",
31
- "icon-style",
32
- "options",
33
- "onClick"
34
- ]);
20
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.actions, (item) => {
21
+ return openBlock(), createBlock(button_default, mergeProps({ ref_for: true }, item, {
22
+ key: item.key,
23
+ onClick: item.onClick
24
+ }), null, 16, ["onClick"]);
35
25
  }), 128))]);
36
26
  };
37
27
  }
@@ -104,15 +94,14 @@ var preview_segmented_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
104
94
  const mode = useModel(__props, "mode");
105
95
  const collapsed = useModel(__props, "collapsed");
106
96
  const { t } = useI18n();
107
- const { icons } = useContext();
108
97
  const SEGMENTED_OPTIONS = computed(() => [{
109
98
  label: t("button.preview"),
110
99
  value: "preview",
111
- icon: icons.value.preview
100
+ icon: "preview"
112
101
  }, {
113
102
  label: t("button.source"),
114
103
  value: "source",
115
- icon: icons.value.code
104
+ icon: "code"
116
105
  }]);
117
106
  return (_ctx, _cache) => {
118
107
  return openBlock(), createBlock(segmented_default, {
@@ -195,12 +184,11 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
195
184
  },
196
185
  setup(__props) {
197
186
  const props = __props;
198
- const CodeNode = defineAsyncComponent(() => import("./code-CPG6B2Cw.js"));
187
+ const CodeNode = defineAsyncComponent(() => import("./code-2Dd0EGfm.js"));
199
188
  const { controls, previewers, codeOptions } = toRefs(props);
200
189
  const [DefineTemplate, ReuseTemplate] = createReusableTemplate();
201
190
  const { t } = useI18n();
202
- const { icons } = useContext();
203
- const { isControlEnabled } = useControls({ controls });
191
+ const { isControlEnabled, resolveControls } = useControls({ controls });
204
192
  const { installed: hasMermaid } = useMermaid();
205
193
  const { onCopied } = useContext();
206
194
  const { copy, copied } = useClipboard({ legacy: true });
@@ -249,11 +237,12 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
249
237
  return false;
250
238
  });
251
239
  const PreviewComponent = computed(() => {
252
- if (!previewers.value || typeof previewers.value === "boolean") return CODE_PREVIEWERS[language.value];
240
+ const previewer = CODE_PREVIEWERS[language.value];
241
+ if (!previewers.value || typeof previewers.value === "boolean") return previewer;
253
242
  const data = previewers.value[language.value];
254
- if (data === false) return CODE_PREVIEWERS[language.value];
243
+ if (data === false) return previewer;
255
244
  if (data && typeof data !== "boolean") return data;
256
- return CODE_PREVIEWERS[language.value];
245
+ return previewer;
257
246
  });
258
247
  function normalizeHeight(height) {
259
248
  return typeof height === "number" ? `${height}px` : height;
@@ -283,56 +272,55 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
283
272
  }
284
273
  ];
285
274
  });
286
- const actions = computed(() => {
287
- return [
288
- {
289
- name: t("button.collapse"),
290
- key: "collapse",
291
- icon: icons.value.collapse,
292
- iconStyle: {
293
- transform: collapsed.value ? "rotate(180deg)" : void 0,
294
- transition: "transform var(--default-transition-duration)"
295
- },
296
- visible: () => showCollapse.value,
297
- onClick: () => collapsed.value = !collapsed.value
298
- },
299
- {
300
- name: t("button.copy"),
301
- key: "copy",
302
- icon: copied.value ? icons.value.check : icons.value.copy,
303
- visible: () => showCopy.value,
304
- onClick: () => {
305
- if (!props.node.value) return;
306
- copy(props.node.value);
307
- onCopied(props.node.value);
308
- }
275
+ const builtinControls = computed(() => [
276
+ {
277
+ name: t("button.collapse"),
278
+ key: "collapse",
279
+ icon: "collapse",
280
+ iconStyle: {
281
+ transform: collapsed.value ? "rotate(180deg)" : void 0,
282
+ transition: "transform var(--default-transition-duration)"
309
283
  },
310
- {
311
- name: t("button.download"),
312
- key: "download",
313
- icon: icons.value.download,
314
- options: downloadOptions.value.length > 0 ? downloadOptions.value : void 0,
315
- visible: () => showDownload.value && !!LANGUAGE_EXTENSIONS[language.value],
316
- onClick: (_event, item) => {
317
- if (props.node.loading) return;
318
- if (!item || item.value === "code") {
319
- const extension = LANGUAGE_EXTENSIONS[language.value];
320
- save(`file.${extension}`, props.node.value, "text/plain");
321
- return;
322
- }
323
- if ((item === null || item === void 0 ? void 0 : item.value) === "svg" || (item === null || item === void 0 ? void 0 : item.value) === "png") saveMermaid(item === null || item === void 0 ? void 0 : item.value, props.node.value);
284
+ visible: () => showCollapse.value,
285
+ onClick: () => collapsed.value = !collapsed.value
286
+ },
287
+ {
288
+ name: t("button.copy"),
289
+ key: "copy",
290
+ icon: copied.value ? "check" : "copy",
291
+ visible: () => showCopy.value,
292
+ onClick: () => {
293
+ if (!props.node.value) return;
294
+ copy(props.node.value);
295
+ onCopied(props.node.value);
296
+ }
297
+ },
298
+ {
299
+ name: t("button.download"),
300
+ key: "download",
301
+ icon: "download",
302
+ options: downloadOptions.value.length > 0 ? downloadOptions.value : void 0,
303
+ visible: () => showDownload.value && !!LANGUAGE_EXTENSIONS[language.value],
304
+ onClick: (_event, item) => {
305
+ if (props.node.loading) return;
306
+ if (!item || item.value === "code") {
307
+ const extension = LANGUAGE_EXTENSIONS[language.value];
308
+ save(`file.${extension}`, props.node.value, "text/plain");
309
+ return;
324
310
  }
325
- },
326
- {
327
- name: fullscreen.value ? t("button.minimize") : t("button.maximize"),
328
- key: "fullscreen",
329
- icon: fullscreen.value ? icons.value.minimize : icons.value.maximize,
330
- visible: () => showFullscreen.value,
331
- onClick: () => fullscreen.value = !fullscreen.value
311
+ if ((item === null || item === void 0 ? void 0 : item.value) === "svg" || (item === null || item === void 0 ? void 0 : item.value) === "png") saveMermaid(item === null || item === void 0 ? void 0 : item.value, props.node.value);
332
312
  }
333
- ].filter((button) => !button.visible || button.visible());
334
- });
335
- const ModalActions = computed(() => actions.value.filter((i) => i.key !== "collapse"));
313
+ },
314
+ {
315
+ name: fullscreen.value ? t("button.minimize") : t("button.maximize"),
316
+ key: "fullscreen",
317
+ icon: fullscreen.value ? "minimize" : "maximize",
318
+ visible: () => showFullscreen.value,
319
+ onClick: () => fullscreen.value = !fullscreen.value
320
+ }
321
+ ]);
322
+ const headerControls = computed(() => resolveControls("code", builtinControls.value, props));
323
+ const modalControls = computed(() => resolveControls("code", headerControls.value, props).filter((i) => i.key !== "collapse"));
336
324
  watch(() => previewable.value, () => {
337
325
  if (previewable.value) mode.value = "preview";
338
326
  }, { immediate: true });
@@ -374,7 +362,7 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
374
362
  collapsed: collapsed.value,
375
363
  "onUpdate:collapsed": _cache[3] || (_cache[3] = ($event) => collapsed.value = $event)
376
364
  }, null, 8, ["mode", "collapsed"])) : (openBlock(), createElementBlock("div", _hoisted_4))]),
377
- renderSlot(_ctx.$slots, "actions", {}, () => [createVNode(actions_default, { actions: actions.value }, null, 8, ["actions"])])
365
+ renderSlot(_ctx.$slots, "actions", {}, () => [createVNode(actions_default, { actions: headerControls.value }, null, 8, ["actions"])])
378
366
  ]),
379
367
  withDirectives(createElementVNode("main", {
380
368
  "data-stream-markdown": "code-block-content",
@@ -397,7 +385,7 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
397
385
  collapsed: collapsed.value,
398
386
  "onUpdate:collapsed": _cache[5] || (_cache[5] = ($event) => collapsed.value = $event)
399
387
  }, null, 8, ["mode", "collapsed"])) : createCommentVNode("v-if", true)]),
400
- actions: withCtx(() => [createVNode(actions_default, { actions: ModalActions.value }, null, 8, ["actions"])]),
388
+ actions: withCtx(() => [createVNode(actions_default, { actions: modalControls.value }, null, 8, ["actions"])]),
401
389
  default: withCtx(() => [previewable.value ? withDirectives((openBlock(), createBlock(resolveDynamicComponent(PreviewComponent.value), mergeProps({ key: 0 }, props, { "container-height": "100%" }), null, 16)), [[vShow, mode.value === "preview"]]) : createCommentVNode("v-if", true), withDirectives(createVNode(unref(CodeNode), mergeProps(props, { "show-header": false }), null, 16), [[vShow, mode.value === "source"]])]),
402
390
  _: 1
403
391
  }, 8, ["open"])