vue-stream-markdown 0.1.3 → 0.1.5

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 (193) hide show
  1. package/README.md +3 -1
  2. package/dist/arrow-left-C5s0Sn8o.js +25 -0
  3. package/dist/{blockquote-DdEg2gww.js → blockquote-bkADuiGm.js} +1 -9
  4. package/dist/{button-CJyeXWq2.js → button-BQhuT7wh.js} +2 -3
  5. package/dist/button-JYC8d-B-.js +5 -0
  6. package/dist/{code-CJ4tMt6L.js → code-DF8PTNol.js} +10 -18
  7. package/dist/code-block-BhMDz2ZL.js +9 -0
  8. package/dist/{code-block-CQ4lgva1.js → code-block-Dm2wl0cb.js} +87 -77
  9. package/dist/{composables-Cj6_jbwr.js → composables-yny5gJo3.js} +570 -234
  10. package/dist/{delete-BdWzKJCy.js → delete-D17YBeI-.js} +1 -9
  11. package/dist/dropdown-Y5_Z4a_u.js +5 -0
  12. package/dist/{emphasis-CTuGt1Ok.js → emphasis-B-2R_0Q5.js} +1 -9
  13. package/dist/{en-US-Bfc50l3I.js → en-US-Kw2LYAMk.js} +7 -1
  14. package/dist/{error-component-ClGLfmwy.js → error-component-Bb0gIZsx.js} +4 -3
  15. package/dist/error-component-DEIWb6kB.js +4 -0
  16. package/dist/flip-horizontal-BFWjqDbQ.js +25 -0
  17. package/dist/{heading-2vpQQtTH.js → heading-DyJIwNrN.js} +1 -9
  18. package/dist/{html-DL0PcUXX.js → html-DXNqMvt_.js} +0 -8
  19. package/dist/{image-xeiC5YFM.js → image-BPhFn1xp.js} +40 -76
  20. package/dist/image-DXBD47sF.js +8 -0
  21. package/dist/image-DvOGBhi-.js +327 -0
  22. package/dist/index.css +44 -64
  23. package/dist/index.d.ts +155 -81
  24. package/dist/index.js +55 -63
  25. package/dist/{inline-code-CBoqhfz7.js → inline-code-C44UJ2TH.js} +0 -8
  26. package/dist/{inline-math-C2NUSasr.js → inline-math-wO1rMt9T.js} +2 -10
  27. package/dist/{link-BceXudNH.js → link-sGo7CEll.js} +3 -11
  28. package/dist/{list-BCiFKGaz.js → list-C0I1ysSI.js} +1 -9
  29. package/dist/{list-item-p-OLUR_9.js → list-item-BoC2wKBL.js} +1 -9
  30. package/dist/{math-DXOLG3Xg.js → math-BlqtUf2r.js} +2 -10
  31. package/dist/{mermaid-CU4hpB6S.js → mermaid-Ka1jnXrR.js} +6 -14
  32. package/dist/modal-Duhc-vVa.js +4 -0
  33. package/dist/modal-Rc_RoeYA.js +94 -0
  34. package/dist/node-list-C1je2nLd.js +3 -0
  35. package/dist/{node-list-CGr_EVtn.js → node-list-YhpHXdM_.js} +0 -16
  36. package/dist/{paragraph-DYjqr_Sa.js → paragraph-BN-4-Dn7.js} +1 -9
  37. package/dist/previewers-D0VVcdjL.js +10 -0
  38. package/dist/rotate-ccw-square-C2KVFUF3.js +24 -0
  39. package/dist/{segmented-CF6exjdD.js → segmented-CaC54iz_.js} +1 -1
  40. package/dist/segmented-XdoLnuuq.js +6 -0
  41. package/dist/{shiki-BlfngIRi.js → shiki-sJNZTn1K.js} +4 -12
  42. package/dist/spin-wM2KE8mO.js +3 -0
  43. package/dist/{strong-CvOjLZiq.js → strong-NdAS3VjP.js} +1 -9
  44. package/dist/{table-C5VHgkTQ.js → table-CWX5B2i1.js} +14 -18
  45. package/dist/table-R9gmCXm_.js +3 -0
  46. package/dist/{text-DuONUqRA.js → text-DpleLvNh.js} +0 -8
  47. package/dist/{thematic-break-CcNPEI9Y.js → thematic-break-D5GvzU5S.js} +0 -8
  48. package/dist/tooltip-BJDs-A8d.js +4 -0
  49. package/dist/tooltip-Bgbzbk4Q.js +68 -0
  50. package/dist/{vanilla-D5DzB31q.js → vanilla-BTOVqKl7.js} +1 -1
  51. package/dist/vanilla-DA5bwIkr.js +4 -0
  52. package/dist/{yaml-DJHrmzSe.js → yaml-y0snrPRx.js} +1 -9
  53. package/dist/{zh-CN-CL1XGe0H.js → zh-CN-Dfow4Yn2.js} +7 -1
  54. package/dist/zoom-container-B1qbA-7z.js +153 -0
  55. package/dist/zoom-container-KztuE4ri.js +6 -0
  56. package/package.json +9 -10
  57. package/dist/button-2wMU7qkH.js +0 -5
  58. package/dist/code-block-BucFZooo.js +0 -9
  59. package/dist/dropdown-dsCfq0Hl.js +0 -5
  60. package/dist/error-component-B0mmLhh6.js +0 -4
  61. package/dist/modal-CuQR21UD.js +0 -71
  62. package/dist/modal-DcpxxDDX.js +0 -3
  63. package/dist/node-list-lgY1wbfQ.js +0 -3
  64. package/dist/previewers-qHMi6xZ3.js +0 -10
  65. package/dist/segmented-BeHqXuFx.js +0 -6
  66. package/dist/spin-Bz4zGBEo.js +0 -3
  67. package/dist/table-CZLbUHiJ.js +0 -3
  68. package/dist/tooltip-BzVZqo7w.js +0 -4
  69. package/dist/tooltip-gxsqaBNg.js +0 -71
  70. package/dist/vanilla-CKj7EQLx.js +0 -4
  71. package/dist/zoom-container-CwEDlKRx.js +0 -6
  72. package/dist/zoom-container-D_fBClW2.js +0 -111
  73. /package/dist/{angular-Chs-UKBr.js → angular-Mip1mspI.js} +0 -0
  74. /package/dist/{angular-component-Cc_FANXU.js → angular-component-Cq5UbX7R.js} +0 -0
  75. /package/dist/{apache-COYnc6xR.js → apache-BSq7fX32.js} +0 -0
  76. /package/dist/{asciidoc-BabXBDAL.js → asciidoc-DS-PMOLv.js} +0 -0
  77. /package/dist/{assembly-CDqKhexW.js → assembly-BPatlOM7.js} +0 -0
  78. /package/dist/{astro-C9kftzFG.js → astro-CSD_ZjXp.js} +0 -0
  79. /package/dist/{bash-Ce4pNIkV.js → bash-RITislE1.js} +0 -0
  80. /package/dist/{batch-CHQBRjFL.js → batch-DWPShYhN.js} +0 -0
  81. /package/dist/{bicep-8jxWtuBF.js → bicep-C6BEHfP6.js} +0 -0
  82. /package/dist/{c-FBUef746.js → c-DNo3tsNy.js} +0 -0
  83. /package/dist/{check-C4xOk8um.js → check-BfpxIITS.js} +0 -0
  84. /package/dist/{chevron-down-cnOJ4h1g.js → chevron-down-LeNeemjn.js} +0 -0
  85. /package/dist/{circle-alert-CLX-h5rZ.js → circle-alert-BjDuIzgc.js} +0 -0
  86. /package/dist/{clojure-BulUroSy.js → clojure-C1DEYHW0.js} +0 -0
  87. /package/dist/{cmake-CW3vz1Mo.js → cmake-B69mdXcH.js} +0 -0
  88. /package/dist/{cobol-CIn3oFju.js → cobol-qmL-zIWi.js} +0 -0
  89. /package/dist/{code-D8LSp8rK.js → code-D9CiymEK.js} +0 -0
  90. /package/dist/{codeowners-CJggXF_b.js → codeowners-Crklt5nF.js} +0 -0
  91. /package/dist/{coffeescript-CBrVvzGY.js → coffeescript-k3huSp23.js} +0 -0
  92. /package/dist/{copy-Cabve0xf.js → copy-C4580J93.js} +0 -0
  93. /package/dist/{cpp-BTKeuyd-.js → cpp-Cn3MB35e.js} +0 -0
  94. /package/dist/{crystal-DyIYvZbm.js → crystal-D5aGETSx.js} +0 -0
  95. /package/dist/{csharp-NqZ1vyF9.js → csharp-CgkTkbPx.js} +0 -0
  96. /package/dist/{css-BpR5Lajb.js → css-DRH4n_IV.js} +0 -0
  97. /package/dist/{csv-eCMFnKKK.js → csv-D5nNTIzO.js} +0 -0
  98. /package/dist/{cue-TY97dGOQ.js → cue-B5mC88-N.js} +0 -0
  99. /package/dist/{d-NftUsdTd.js → d-BdQRMgma.js} +0 -0
  100. /package/dist/{dart-DJpwZZbk.js → dart-BGnfn0NN.js} +0 -0
  101. /package/dist/{database-aZwE71Px.js → database-Ca1VGX7u.js} +0 -0
  102. /package/dist/{diff-CYRzypaU.js → diff-DVaTsnqu.js} +0 -0
  103. /package/dist/{docker-CxHBuukH.js → docker-E47qYlmL.js} +0 -0
  104. /package/dist/{download-Bnn7rtYw.js → download-DytrK56a.js} +0 -0
  105. /package/dist/{elixir-BKSxVc1h.js → elixir-C-jqqu6q.js} +0 -0
  106. /package/dist/{elm-DScuAf3X.js → elm-CmeHvaWl.js} +0 -0
  107. /package/dist/{env-CDAKsodl.js → env-Ck1BHoxR.js} +0 -0
  108. /package/dist/{erlang-D2M1ZL3m.js → erlang-CIP8kpGJ.js} +0 -0
  109. /package/dist/{eye-CdeX8PhP.js → eye-TaEwQS2Z.js} +0 -0
  110. /package/dist/{fortran-CORyQ0wt.js → fortran-DJVP2s7V.js} +0 -0
  111. /package/dist/{fsharp-BJz_Jgpl.js → fsharp-Bp6mUcG0.js} +0 -0
  112. /package/dist/{git-DgrlTr1E.js → git-BDcqJ1Gp.js} +0 -0
  113. /package/dist/{gleam-t_xad9Kw.js → gleam-JLiZVlev.js} +0 -0
  114. /package/dist/{go-Cvlh1xtL.js → go-ClcCiS7e.js} +0 -0
  115. /package/dist/{graphql-ApIm0mDD.js → graphql-D2RDo-DF.js} +0 -0
  116. /package/dist/{groovy-CaLnK8PV.js → groovy-DLZBw8xE.js} +0 -0
  117. /package/dist/{haml-MwijEO_6.js → haml-Da74jRwZ.js} +0 -0
  118. /package/dist/{handlebars-CKdUPI9h.js → handlebars-CNgS57Sz.js} +0 -0
  119. /package/dist/{haskell-NPOXEnck.js → haskell-DCvfD6VB.js} +0 -0
  120. /package/dist/{haxe-DyKBMsDE.js → haxe-CHVK1TId.js} +0 -0
  121. /package/dist/{html-CMgES1dE.js → html-Du4235Z-.js} +0 -0
  122. /package/dist/{http-B9FFNmUr.js → http-B8VAFeQ5.js} +0 -0
  123. /package/dist/{image-CMZAakWu.js → image-D8MZj4W5.js} +0 -0
  124. /package/dist/{java-iU-L9wJz.js → java-CoSdnK1N.js} +0 -0
  125. /package/dist/{javascript-DtnWdTFC.js → javascript-BCDeVll0.js} +0 -0
  126. /package/dist/{jinja-CoWszo_D.js → jinja-DYbiqZy0.js} +0 -0
  127. /package/dist/{json-C80qKCnh.js → json-CdzCyWJA.js} +0 -0
  128. /package/dist/{julia-DG2BCBLx.js → julia-pswJGtpP.js} +0 -0
  129. /package/dist/{kdl-7twRfIlJ.js → kdl-M8rfQ85l.js} +0 -0
  130. /package/dist/{kotlin-BjrOgP7R.js → kotlin-CfCV33oB.js} +0 -0
  131. /package/dist/{latex-DIQfUvG8.js → latex-DK8DFhTm.js} +0 -0
  132. /package/dist/{less-BJ1yEAWt.js → less-BFnNZiIs.js} +0 -0
  133. /package/dist/{link-DeV4CQOB.js → link-C7eU_yi-.js} +0 -0
  134. /package/dist/{liquid-BqKFZ1wQ.js → liquid-C8h46DoX.js} +0 -0
  135. /package/dist/{lisp-oekhB2ti.js → lisp-C3FbGuD1.js} +0 -0
  136. /package/dist/{log-D1XEqR9q.js → log-D-O3FXf2.js} +0 -0
  137. /package/dist/{lua-C5Q97-1D.js → lua-BC_aR1_i.js} +0 -0
  138. /package/dist/{luau-BT8KwqZ2.js → luau-DFUOrNN7.js} +0 -0
  139. /package/dist/{makefile-B4a0ciG4.js → makefile-Ck67veVV.js} +0 -0
  140. /package/dist/{markdown-DvNyKsiJ.js → markdown-BX13X3kd.js} +0 -0
  141. /package/dist/{marko-BzsIf6bg.js → marko-CQE8YTCc.js} +0 -0
  142. /package/dist/{matlab-cMBkmDhQ.js → matlab-Bd9O2Ml3.js} +0 -0
  143. /package/dist/{maximize-4PIqBONS.js → maximize-CDZ9rnYF.js} +0 -0
  144. /package/dist/{mermaid-8JIH2gkQ.js → mermaid-Dv-Pr0W-.js} +0 -0
  145. /package/dist/{minimize-BJ8htyDF.js → minimize-B9ER7p2X.js} +0 -0
  146. /package/dist/{nextflow-DNmqU1xg.js → nextflow-D3lDq1Yi.js} +0 -0
  147. /package/dist/{nginx-DDfYF_rj.js → nginx-CgsqCL4l.js} +0 -0
  148. /package/dist/{nim-D9xEmy4k.js → nim-BJdSu3c6.js} +0 -0
  149. /package/dist/{nix-BV1Deshw.js → nix-B7K_D6CN.js} +0 -0
  150. /package/dist/{ocaml-BkFn4LL3.js → ocaml-gYS1Y45s.js} +0 -0
  151. /package/dist/{perl-BytUHDE7.js → perl-DXFhFWhI.js} +0 -0
  152. /package/dist/{php-BImJJtNM.js → php-We35bF4E.js} +0 -0
  153. /package/dist/{postcss-CrZ9_0sT.js → postcss-BWovY_YV.js} +0 -0
  154. /package/dist/{powershell-DYSGu7TM.js → powershell-C6teiBsq.js} +0 -0
  155. /package/dist/{prisma-BhRvcOFY.js → prisma-UyJEg0_X.js} +0 -0
  156. /package/dist/{prolog-DuaCKek_.js → prolog-YZsPgdnw.js} +0 -0
  157. /package/dist/{properties-BbIJwuP-.js → properties-DaPbL0e2.js} +0 -0
  158. /package/dist/{proto-CE0aVW11.js → proto-1LIwu2O1.js} +0 -0
  159. /package/dist/{pug-B1-IC-Tc.js → pug-CzkUK-Ec.js} +0 -0
  160. /package/dist/{puppet-8nYquiMG.js → puppet-CNhB1MHb.js} +0 -0
  161. /package/dist/{python-DhRyfBrD.js → python-B_hgEobv.js} +0 -0
  162. /package/dist/{r-Cjje17IA.js → r-CVeKYmPK.js} +0 -0
  163. /package/dist/{racket-Dx0gMnpg.js → racket-D5UfvXuw.js} +0 -0
  164. /package/dist/{razor-DPht_bdD.js → razor-RIKaANTN.js} +0 -0
  165. /package/dist/{ruby-B8RxtCzI.js → ruby-C8wV0pMO.js} +0 -0
  166. /package/dist/{rust-Cjtli6yf.js → rust-75Gei1mP.js} +0 -0
  167. /package/dist/{sass-Dv3DMzjs.js → sass-Cq68xmQ4.js} +0 -0
  168. /package/dist/{scala-B7bZGKXq.js → scala-C_E5rjSc.js} +0 -0
  169. /package/dist/{scheme-B2PsEdVN.js → scheme-Bm-q-nLL.js} +0 -0
  170. /package/dist/{shader-BZzu3zGr.js → shader-DPaRkMCs.js} +0 -0
  171. /package/dist/{shiki-token-renderer-D164wC7Y.js → shiki-token-renderer-CLmUjKa3.js} +0 -0
  172. /package/dist/{solidity-CLieFYpL.js → solidity-DvHG_0CD.js} +0 -0
  173. /package/dist/{spin-Ds5W7qC_.js → spin--f5jNjBn.js} +0 -0
  174. /package/dist/{stata-C0yUiO47.js → stata-DoVloJLm.js} +0 -0
  175. /package/dist/{svelte-rtF4yNGL.js → svelte-tlbA11de.js} +0 -0
  176. /package/dist/{swift-CzvYoIM0.js → swift-BZn5eRnK.js} +0 -0
  177. /package/dist/{table-4ec9FVB_.js → table-CaUMjs4M.js} +0 -0
  178. /package/dist/{terraform-CD_BZGb-.js → terraform-c5-k7yB1.js} +0 -0
  179. /package/dist/{text-D1-vbZ7l.js → text-DPCGWvDK.js} +0 -0
  180. /package/dist/{toml-C6jUF0Xd.js → toml-DdLGBe1A.js} +0 -0
  181. /package/dist/{twig-C4dfP84J.js → twig-D_jzZxh6.js} +0 -0
  182. /package/dist/{typescript-Bk-pp-cK.js → typescript-B95hq2ns.js} +0 -0
  183. /package/dist/{typst-DPCpaVSH.js → typst-CSAEQ4yK.js} +0 -0
  184. /package/dist/{v-nRGMJ2Ki.js → v-BAhebuOB.js} +0 -0
  185. /package/dist/{vala-B78bKcY0.js → vala-RAu83-lp.js} +0 -0
  186. /package/dist/{verilog-CRpkl76S.js → verilog-BgmTn52U.js} +0 -0
  187. /package/dist/{vim-DpKnut7b.js → vim-c8oTCLkH.js} +0 -0
  188. /package/dist/{vue-D5eadhjo.js → vue-TGT6HTBA.js} +0 -0
  189. /package/dist/{xml-Dvx5F-hl.js → xml-C1HDr874.js} +0 -0
  190. /package/dist/{yaml-n1S8nAOh.js → yaml-BO7FjFQZ.js} +0 -0
  191. /package/dist/{zig-R-iFzxfW.js → zig-qANBp1SU.js} +0 -0
  192. /package/dist/{zoomIn-CEukuh3x.js → zoomIn-iVMAUxIz.js} +0 -0
  193. /package/dist/{zoomOut-qlzQyQli.js → zoomOut-Cxq1_dIQ.js} +0 -0
package/README.md CHANGED
@@ -69,7 +69,9 @@ This project also uses and benefits from:
69
69
  ### Code Sources
70
70
  - [markstream-vue](https://github.com/Simon-He95/markstream-vue) - The original inspiration for learning AST-based custom markdown rendering, and the source of the animation implementation used in this project
71
71
  - [ast-explorer](https://github.com/sxzz/ast-explorer) - Learned AST knowledge from this project, and the playground layout inspiration and AST syntax tree filtering code are derived from it
72
-
72
+ - [medium-zoom](https://github.com/francoischalifour/medium-zoom) - Inspired the custom image zoom implementation
73
+ - [markdown-sanitizers](https://github.com/vercel-labs/markdown-sanitizers) - URL validation and security hardening logic in `src/utils/harden.ts` is ported from `rehype-harden`
74
+ - [Dify](https://github.com/langgenius/dify) - LaTeX preprocessing logic in `src/preprocess/vendored/markdown-utils.ts` is ported from Dify
73
75
  ## Acknowledgments
74
76
 
75
77
  I would like to express my sincere gratitude to those who provided guidance and support during the project selection phase and promotion phase of this project. Without their encouragement and support, I would not have been able to complete this work. In particular, the [streamdown](https://streamdown.ai/) community provided excellent code guidance and even helped fix several issues.
@@ -0,0 +1,25 @@
1
+ import { createElementBlock, createElementVNode, markRaw, openBlock } from "vue";
2
+
3
+ //#region ~icons/lucide/arrow-left
4
+ const _hoisted_1 = {
5
+ viewBox: "0 0 24 24",
6
+ width: "1.2em",
7
+ height: "1.2em"
8
+ };
9
+ function render(_ctx, _cache) {
10
+ return openBlock(), createElementBlock("svg", _hoisted_1, [..._cache[0] || (_cache[0] = [createElementVNode("path", {
11
+ fill: "none",
12
+ stroke: "currentColor",
13
+ "stroke-linecap": "round",
14
+ "stroke-linejoin": "round",
15
+ "stroke-width": "2",
16
+ d: "m12 19l-7-7l7-7m7 7H5"
17
+ }, null, -1)])]);
18
+ }
19
+ var arrow_left_default = markRaw({
20
+ name: "lucide-arrow-left",
21
+ render
22
+ });
23
+
24
+ //#endregion
25
+ export { arrow_left_default as default };
@@ -1,4 +1,4 @@
1
- import { t as node_list_default } from "./node-list-CGr_EVtn.js";
1
+ import { t as node_list_default } from "./node-list-YhpHXdM_.js";
2
2
  import { createElementBlock, createVNode, defineComponent, mergeProps, openBlock } from "vue";
3
3
 
4
4
  //#region src/components/renderers/blockquote.vue?vue&type=script&setup=true&lang.ts
@@ -18,18 +18,10 @@ var blockquote_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
18
18
  type: Object,
19
19
  required: true
20
20
  },
21
- mediumZoom: {
22
- type: Object,
23
- required: true
24
- },
25
21
  indexKey: {
26
22
  type: [Number, String],
27
23
  required: true
28
24
  },
29
- getContainer: {
30
- type: Function,
31
- required: true
32
- },
33
25
  controls: {
34
26
  type: [Boolean, Object],
35
27
  required: false
@@ -1,4 +1,4 @@
1
- import { t as tooltip_default } from "./tooltip-gxsqaBNg.js";
1
+ import { t as tooltip_default } from "./tooltip-Bgbzbk4Q.js";
2
2
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, h, normalizeClass, normalizeStyle, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, withCtx } from "vue";
3
3
 
4
4
  //#region src/components/dropdown.vue?vue&type=script&setup=true&lang.ts
@@ -38,8 +38,7 @@ var dropdown_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
38
38
  ref_key: "tooltipRef",
39
39
  ref: tooltipRef,
40
40
  trigger: "click",
41
- placement: "bottom",
42
- interactive: true,
41
+ placement: "bottom-end",
43
42
  "data-stream-markdown": "dropdown"
44
43
  }, {
45
44
  content: withCtx(() => [createElementVNode("div", _hoisted_1, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option) => {
@@ -0,0 +1,5 @@
1
+ import "./composables-yny5gJo3.js";
2
+ import "./tooltip-Bgbzbk4Q.js";
3
+ import { t as button_default } from "./button-BQhuT7wh.js";
4
+
5
+ export { button_default as default };
@@ -1,11 +1,11 @@
1
- import "./previewers-qHMi6xZ3.js";
2
- import { i as useShiki } from "./composables-Cj6_jbwr.js";
3
- import "./tooltip-gxsqaBNg.js";
4
- import "./button-CJyeXWq2.js";
5
- import "./modal-CuQR21UD.js";
6
- import { t as code_block_default } from "./code-block-CQ4lgva1.js";
7
- import "./segmented-CF6exjdD.js";
8
- import { computed, createBlock, createCommentVNode, defineAsyncComponent, defineComponent, mergeProps, normalizeProps, openBlock, resolveDynamicComponent, withCtx } from "vue";
1
+ import "./previewers-D0VVcdjL.js";
2
+ import { r as useShiki } from "./composables-yny5gJo3.js";
3
+ import "./tooltip-Bgbzbk4Q.js";
4
+ import "./button-BQhuT7wh.js";
5
+ import "./modal-Rc_RoeYA.js";
6
+ import { t as code_block_default } from "./code-block-Dm2wl0cb.js";
7
+ import "./segmented-CaC54iz_.js";
8
+ import { computed, createBlock, createCommentVNode, defineAsyncComponent, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, resolveDynamicComponent, withCtx } from "vue";
9
9
 
10
10
  //#region src/components/renderers/code/index.vue?vue&type=script&setup=true&lang.ts
11
11
  var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
@@ -23,18 +23,10 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
23
23
  type: Object,
24
24
  required: true
25
25
  },
26
- mediumZoom: {
27
- type: Object,
28
- required: true
29
- },
30
26
  indexKey: {
31
27
  type: [Number, String],
32
28
  required: true
33
29
  },
34
- getContainer: {
35
- type: Function,
36
- required: true
37
- },
38
30
  controls: {
39
31
  type: [Boolean, Object],
40
32
  required: false
@@ -82,8 +74,8 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
82
74
  const languageClass = computed(() => `language-${props.node.lang}`);
83
75
  const { installed: hasShiki } = useShiki();
84
76
  const components = {
85
- vanilla: defineAsyncComponent(() => import("./vanilla-CKj7EQLx.js")),
86
- shiki: defineAsyncComponent(() => import("./shiki-BlfngIRi.js"))
77
+ vanilla: defineAsyncComponent(() => import("./vanilla-DA5bwIkr.js")),
78
+ shiki: defineAsyncComponent(() => import("./shiki-sJNZTn1K.js"))
87
79
  };
88
80
  const component = computed(() => {
89
81
  if (hasShiki.value) return components.shiki;
@@ -0,0 +1,9 @@
1
+ import "./previewers-D0VVcdjL.js";
2
+ import "./composables-yny5gJo3.js";
3
+ import "./tooltip-Bgbzbk4Q.js";
4
+ import "./button-BQhuT7wh.js";
5
+ import "./modal-Rc_RoeYA.js";
6
+ import { t as code_block_default } from "./code-block-Dm2wl0cb.js";
7
+ import "./segmented-CaC54iz_.js";
8
+
9
+ export { code_block_default as default };
@@ -1,10 +1,10 @@
1
- import { t as CODE_PREVIEWERS } from "./previewers-qHMi6xZ3.js";
2
- import { B as useContext, I as LANGUAGE_ALIAS, L as LANGUAGE_EXTENSIONS, M as ICONS, O as save, R as LANGUAGE_ICONS, V as useCodeOptions, a as useMermaid, u as useI18n, z as useControls } from "./composables-Cj6_jbwr.js";
3
- import { t as button_default } from "./button-CJyeXWq2.js";
4
- import { t as modal_default } from "./modal-CuQR21UD.js";
5
- import { t as segmented_default } from "./segmented-CF6exjdD.js";
6
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineAsyncComponent, defineComponent, mergeProps, normalizeClass, normalizeProps, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, toRefs, unref, useModel, vShow, watch, withCtx, withDirectives } from "vue";
7
- import { useClipboard } from "@vueuse/core";
1
+ import { t as CODE_PREVIEWERS } from "./previewers-D0VVcdjL.js";
2
+ import { H as useContext, L as LANGUAGE_ALIAS, O as save, R as LANGUAGE_EXTENSIONS, U as useCodeOptions, V as useControls, i as useMermaid, u as useI18n, z as LANGUAGE_ICONS } from "./composables-yny5gJo3.js";
3
+ import { t as button_default } from "./button-BQhuT7wh.js";
4
+ import { t as modal_default } from "./modal-Rc_RoeYA.js";
5
+ import { t as segmented_default } from "./segmented-CaC54iz_.js";
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
+ import { createReusableTemplate, useClipboard } from "@vueuse/core";
8
8
 
9
9
  //#region src/components/code-block/actions.vue?vue&type=script&setup=true&lang.ts
10
10
  const _hoisted_1$2 = { "data-stream-markdown": "actions" };
@@ -104,14 +104,15 @@ var preview_segmented_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
104
104
  const mode = useModel(__props, "mode");
105
105
  const collapsed = useModel(__props, "collapsed");
106
106
  const { t } = useI18n();
107
+ const { icons } = useContext();
107
108
  const SEGMENTED_OPTIONS = computed(() => [{
108
109
  label: t("button.preview"),
109
110
  value: "preview",
110
- icon: ICONS.preview
111
+ icon: icons.value.preview
111
112
  }, {
112
113
  label: t("button.source"),
113
114
  value: "source",
114
- icon: ICONS.code
115
+ icon: icons.value.code
115
116
  }]);
116
117
  return (_ctx, _cache) => {
117
118
  return openBlock(), createBlock(segmented_default, {
@@ -131,12 +132,10 @@ var preview_segmented_default = preview_segmented_vue_vue_type_script_setup_true
131
132
 
132
133
  //#endregion
133
134
  //#region src/components/code-block/index.vue?vue&type=script&setup=true&lang.ts
134
- const _hoisted_1 = ["data-collapsed"];
135
- const _hoisted_2 = { "data-stream-markdown": "code-block-header" };
136
- const _hoisted_3 = { key: 2 };
135
+ const _hoisted_1 = { key: 2 };
136
+ const _hoisted_2 = ["data-collapsed"];
137
+ const _hoisted_3 = { "data-stream-markdown": "code-block-header" };
137
138
  const _hoisted_4 = { key: 1 };
138
- const _hoisted_5 = { "data-stream-markdown": "code-block-content" };
139
- const _hoisted_6 = { key: 2 };
140
139
  var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
141
140
  inheritAttrs: false,
142
141
  __name: "index",
@@ -153,18 +152,10 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
153
152
  type: Object,
154
153
  required: true
155
154
  },
156
- mediumZoom: {
157
- type: Object,
158
- required: true
159
- },
160
155
  indexKey: {
161
156
  type: [Number, String],
162
157
  required: true
163
158
  },
164
- getContainer: {
165
- type: Function,
166
- required: true
167
- },
168
159
  controls: {
169
160
  type: [Boolean, Object],
170
161
  required: false
@@ -204,11 +195,13 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
204
195
  },
205
196
  setup(__props) {
206
197
  const props = __props;
198
+ const CodeNode = defineAsyncComponent(() => import("./code-DF8PTNol.js"));
207
199
  const { controls, previewers, codeOptions } = toRefs(props);
200
+ const [DefineTemplate, ReuseTemplate] = createReusableTemplate();
208
201
  const { t } = useI18n();
202
+ const { icons } = useContext();
209
203
  const { isControlEnabled } = useControls({ controls });
210
204
  const { installed: hasMermaid } = useMermaid();
211
- const CodeNode = defineAsyncComponent(() => import("./code-CJ4tMt6L.js"));
212
205
  const { onCopied } = useContext();
213
206
  const { copy, copied } = useClipboard({ legacy: true });
214
207
  const { saveMermaid } = useMermaid();
@@ -230,17 +223,30 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
230
223
  const showCopy = computed(() => isControlEnabled("code.copy"));
231
224
  const showDownload = computed(() => isControlEnabled("code.download"));
232
225
  const showFullscreen = computed(() => isControlEnabled("code.fullscreen"));
233
- const icon = computed(() => LANGUAGE_ICONS[language.value] || LANGUAGE_ICONS.text);
226
+ const icon = computed(() => {
227
+ var _codeOptions$value;
228
+ const custom = (_codeOptions$value = codeOptions.value) === null || _codeOptions$value === void 0 || (_codeOptions$value = _codeOptions$value.language) === null || _codeOptions$value === void 0 || (_codeOptions$value = _codeOptions$value[language.value]) === null || _codeOptions$value === void 0 ? void 0 : _codeOptions$value.languageIcon;
229
+ if (typeof custom === "object") return custom;
230
+ return LANGUAGE_ICONS[language.value] || LANGUAGE_ICONS.text;
231
+ });
234
232
  const previewable = computed(() => {
235
233
  if (previewers.value === false) return false;
236
- const mermaid = language.value === "mermaid" && hasMermaid.value;
237
234
  const html = language.value === "html" && !props.node.loading;
235
+ const mermaid = language.value === "mermaid" && hasMermaid.value;
236
+ if (previewers.value === true) {
237
+ if (language.value === "html" && html) return true;
238
+ if (language.value === "mermaid" && mermaid) return true;
239
+ return false;
240
+ }
238
241
  if (typeof previewers.value === "object") {
239
- const _mermaid = previewers.value.mermaid !== false && mermaid;
240
- const _html = previewers.value.html !== false && html;
241
- return _mermaid || _html;
242
+ if (previewers.value[language.value] === false) return false;
243
+ if (language.value === "html" && html) return true;
244
+ if (language.value === "mermaid" && mermaid) return true;
245
+ const component = previewers.value[language.value];
246
+ if (typeof component === "object" && !props.node.loading) return !!component;
247
+ return false;
242
248
  }
243
- return mermaid || html;
249
+ return false;
244
250
  });
245
251
  const PreviewComponent = computed(() => {
246
252
  if (!previewers.value || typeof previewers.value === "boolean") return CODE_PREVIEWERS[language.value];
@@ -249,6 +255,17 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
249
255
  if (data && typeof data !== "boolean") return data;
250
256
  return CODE_PREVIEWERS[language.value];
251
257
  });
258
+ function normalizeHeight(height) {
259
+ return typeof height === "number" ? `${height}px` : height;
260
+ }
261
+ const maxHeight = computed(() => {
262
+ var _codeOptions$value2, _codeOptions$value3;
263
+ if (mode.value === "preview") return void 0;
264
+ const specific = (_codeOptions$value2 = codeOptions.value) === null || _codeOptions$value2 === void 0 || (_codeOptions$value2 = _codeOptions$value2.language) === null || _codeOptions$value2 === void 0 || (_codeOptions$value2 = _codeOptions$value2[language.value]) === null || _codeOptions$value2 === void 0 ? void 0 : _codeOptions$value2.maxHeight;
265
+ if (specific) return normalizeHeight(specific);
266
+ const height = (_codeOptions$value3 = codeOptions.value) === null || _codeOptions$value3 === void 0 ? void 0 : _codeOptions$value3.maxHeight;
267
+ if (height) return normalizeHeight(height);
268
+ });
252
269
  const downloadOptions = computed(() => {
253
270
  if (language.value !== "mermaid" || !hasMermaid.value) return [];
254
271
  return [
@@ -271,7 +288,7 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
271
288
  {
272
289
  name: t("button.collapse"),
273
290
  key: "collapse",
274
- icon: ICONS.collapse,
291
+ icon: icons.value.collapse,
275
292
  iconStyle: {
276
293
  transform: collapsed.value ? "rotate(180deg)" : void 0,
277
294
  transition: "transform var(--default-transition-duration)"
@@ -282,7 +299,7 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
282
299
  {
283
300
  name: t("button.copy"),
284
301
  key: "copy",
285
- icon: copied.value ? ICONS.check : ICONS.copy,
302
+ icon: copied.value ? icons.value.check : icons.value.copy,
286
303
  visible: () => showCopy.value,
287
304
  onClick: () => {
288
305
  if (!props.node.value) return;
@@ -293,7 +310,7 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
293
310
  {
294
311
  name: t("button.download"),
295
312
  key: "download",
296
- icon: ICONS.download,
313
+ icon: icons.value.download,
297
314
  options: downloadOptions.value.length > 0 ? downloadOptions.value : void 0,
298
315
  visible: () => showDownload.value && !!LANGUAGE_EXTENSIONS[language.value],
299
316
  onClick: (_event, item) => {
@@ -309,7 +326,7 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
309
326
  {
310
327
  name: fullscreen.value ? t("button.minimize") : t("button.maximize"),
311
328
  key: "fullscreen",
312
- icon: fullscreen.value ? ICONS.minimize : ICONS.maximize,
329
+ icon: fullscreen.value ? icons.value.minimize : icons.value.maximize,
313
330
  visible: () => showFullscreen.value,
314
331
  onClick: () => fullscreen.value = !fullscreen.value
315
332
  }
@@ -320,7 +337,27 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
320
337
  if (previewable.value) mode.value = "preview";
321
338
  }, { immediate: true });
322
339
  return (_ctx, _cache) => {
323
- return openBlock(), createElementBlock("div", {
340
+ return openBlock(), createElementBlock(Fragment, null, [createVNode(unref(DefineTemplate), null, {
341
+ default: withCtx(() => [showLanguageTitle.value ? (openBlock(), createBlock(language_title_default, {
342
+ key: 0,
343
+ icon: icon.value,
344
+ language: language.value,
345
+ "show-icon": unref(showLanguageIcon),
346
+ "show-name": unref(showLanguageName)
347
+ }, null, 8, [
348
+ "icon",
349
+ "language",
350
+ "show-icon",
351
+ "show-name"
352
+ ])) : previewable.value ? (openBlock(), createBlock(preview_segmented_default, {
353
+ key: 1,
354
+ mode: mode.value,
355
+ "onUpdate:mode": _cache[0] || (_cache[0] = ($event) => mode.value = $event),
356
+ collapsed: collapsed.value,
357
+ "onUpdate:collapsed": _cache[1] || (_cache[1] = ($event) => collapsed.value = $event)
358
+ }, null, 8, ["mode", "collapsed"])) : (openBlock(), createElementBlock("div", _hoisted_1))]),
359
+ _: 1
360
+ }), createElementVNode("div", {
324
361
  "data-stream-markdown": "code-block",
325
362
  "data-collapsed": collapsed.value,
326
363
  class: normalizeClass({
@@ -328,25 +365,8 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
328
365
  "dark": props.isDark
329
366
  })
330
367
  }, [
331
- createElementVNode("header", _hoisted_2, [
332
- renderSlot(_ctx.$slots, "title", {}, () => [showLanguageTitle.value ? (openBlock(), createBlock(language_title_default, {
333
- key: 0,
334
- icon: icon.value,
335
- language: language.value,
336
- "show-icon": unref(showLanguageIcon),
337
- "show-name": unref(showLanguageName)
338
- }, null, 8, [
339
- "icon",
340
- "language",
341
- "show-icon",
342
- "show-name"
343
- ])) : previewable.value ? (openBlock(), createBlock(preview_segmented_default, {
344
- key: 1,
345
- mode: mode.value,
346
- "onUpdate:mode": _cache[0] || (_cache[0] = ($event) => mode.value = $event),
347
- collapsed: collapsed.value,
348
- "onUpdate:collapsed": _cache[1] || (_cache[1] = ($event) => collapsed.value = $event)
349
- }, null, 8, ["mode", "collapsed"])) : (openBlock(), createElementBlock("div", _hoisted_3))]),
368
+ createElementVNode("header", _hoisted_3, [
369
+ renderSlot(_ctx.$slots, "title", {}, () => [createVNode(unref(ReuseTemplate))]),
350
370
  renderSlot(_ctx.$slots, "header-center", {}, () => [previewable.value && showLanguageTitle.value ? (openBlock(), createBlock(preview_segmented_default, {
351
371
  key: 0,
352
372
  mode: mode.value,
@@ -356,42 +376,32 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
356
376
  }, null, 8, ["mode", "collapsed"])) : (openBlock(), createElementBlock("div", _hoisted_4))]),
357
377
  renderSlot(_ctx.$slots, "actions", {}, () => [createVNode(actions_default, { actions: actions.value }, null, 8, ["actions"])])
358
378
  ]),
359
- withDirectives(createElementVNode("main", _hoisted_5, [previewable.value ? withDirectives((openBlock(), createBlock(resolveDynamicComponent(PreviewComponent.value), normalizeProps(mergeProps({ key: 0 }, props)), null, 16)), [[vShow, mode.value === "preview"]]) : createCommentVNode("v-if", true), withDirectives(createElementVNode("main", null, [renderSlot(_ctx.$slots, "default")], 512), [[vShow, mode.value === "source"]])], 512), [[vShow, !collapsed.value]]),
379
+ withDirectives(createElementVNode("main", {
380
+ "data-stream-markdown": "code-block-content",
381
+ style: normalizeStyle({ maxHeight: maxHeight.value })
382
+ }, [previewable.value ? withDirectives((openBlock(), createBlock(resolveDynamicComponent(PreviewComponent.value), normalizeProps(mergeProps({ key: 0 }, props)), null, 16)), [[vShow, mode.value === "preview"]]) : createCommentVNode("v-if", true), withDirectives(createElementVNode("main", null, [renderSlot(_ctx.$slots, "default")], 512), [[vShow, mode.value === "source"]])], 4), [[vShow, !collapsed.value]]),
360
383
  createVNode(modal_default, {
361
384
  open: fullscreen.value,
362
- "onUpdate:open": _cache[8] || (_cache[8] = ($event) => fullscreen.value = $event),
363
- "get-container": props.getContainer
385
+ "onUpdate:open": _cache[6] || (_cache[6] = ($event) => fullscreen.value = $event),
386
+ "header-style": {
387
+ backgroundColor: "color-mix(in oklab, var(--muted) 80%, transparent)",
388
+ color: "var(--muted-foreground)",
389
+ borderBottom: "1px solid var(--border)"
390
+ }
364
391
  }, {
365
- title: withCtx(() => [showLanguageTitle.value ? (openBlock(), createBlock(language_title_default, {
392
+ title: withCtx(() => [createVNode(unref(ReuseTemplate))]),
393
+ "header-center": withCtx(() => [previewable.value && showLanguageTitle.value ? (openBlock(), createBlock(preview_segmented_default, {
366
394
  key: 0,
367
- icon: icon.value,
368
- language: language.value,
369
- "show-icon": unref(showLanguageIcon),
370
- "show-name": unref(showLanguageName)
371
- }, null, 8, [
372
- "icon",
373
- "language",
374
- "show-icon",
375
- "show-name"
376
- ])) : previewable.value ? (openBlock(), createBlock(preview_segmented_default, {
377
- key: 1,
378
395
  mode: mode.value,
379
396
  "onUpdate:mode": _cache[4] || (_cache[4] = ($event) => mode.value = $event),
380
397
  collapsed: collapsed.value,
381
398
  "onUpdate:collapsed": _cache[5] || (_cache[5] = ($event) => collapsed.value = $event)
382
- }, null, 8, ["mode", "collapsed"])) : (openBlock(), createElementBlock("div", _hoisted_6))]),
383
- "header-center": withCtx(() => [previewable.value && showLanguageTitle.value ? (openBlock(), createBlock(preview_segmented_default, {
384
- key: 0,
385
- mode: mode.value,
386
- "onUpdate:mode": _cache[6] || (_cache[6] = ($event) => mode.value = $event),
387
- collapsed: collapsed.value,
388
- "onUpdate:collapsed": _cache[7] || (_cache[7] = ($event) => collapsed.value = $event)
389
399
  }, null, 8, ["mode", "collapsed"])) : createCommentVNode("v-if", true)]),
390
400
  actions: withCtx(() => [createVNode(actions_default, { actions: ModalActions.value }, null, 8, ["actions"])]),
391
401
  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"]])]),
392
402
  _: 1
393
- }, 8, ["open", "get-container"])
394
- ], 10, _hoisted_1);
403
+ }, 8, ["open"])
404
+ ], 10, _hoisted_2)], 64);
395
405
  };
396
406
  }
397
407
  });