vue-stream-markdown 0.1.5 → 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 (199) hide show
  1. package/README.md +1 -0
  2. package/dist/{blockquote-bkADuiGm.js → blockquote-C68fU4lp.js} +4 -3
  3. package/dist/{button-BQhuT7wh.js → button-BDO3n0n_.js} +36 -28
  4. package/dist/button-CdUyT8T_.js +6 -0
  5. package/dist/{code-DF8PTNol.js → code-2Dd0EGfm.js} +12 -11
  6. package/dist/code-block-Co2UoPPS.js +10 -0
  7. package/dist/{code-block-Dm2wl0cb.js → code-block-hQLDeAmP.js} +68 -80
  8. package/dist/{composables-yny5gJo3.js → composables-DuQ72m6O.js} +1163 -1115
  9. package/dist/corner-down-left-B77X84F8.js +24 -0
  10. package/dist/{delete-D17YBeI-.js → delete-CB-OS2WZ.js} +4 -3
  11. package/dist/dist-CYkm26BF.js +119 -0
  12. package/dist/dropdown-BB3nyts8.js +6 -0
  13. package/dist/{emphasis-B-2R_0Q5.js → emphasis-BmUoyBRK.js} +4 -3
  14. package/dist/{en-US-Kw2LYAMk.js → en-US-Cw-sFSiZ.js} +2 -1
  15. package/dist/{error-component-Bb0gIZsx.js → error-component-CtZr0_st.js} +10 -4
  16. package/dist/error-component-biOT0E-h.js +5 -0
  17. package/dist/footnote-definition-55TjXXwa.js +104 -0
  18. package/dist/footnote-reference-lk2rvC4Q.js +86 -0
  19. package/dist/{heading-DyJIwNrN.js → heading-BlOK3uk2.js} +4 -3
  20. package/dist/{html-DXNqMvt_.js → html-D7bGx0Cz.js} +2 -2
  21. package/dist/icon-PEivHbuv.js +67 -0
  22. package/dist/icon-mUoYnA6R.js +4 -0
  23. package/dist/image-B6Pw2YBI.js +9 -0
  24. package/dist/{image-BPhFn1xp.js → image-Bqn98dDB.js} +18 -15
  25. package/dist/image-VMGQj_VU.js +258 -0
  26. package/dist/{index.css → index.css/index.css} +31 -4
  27. package/dist/index.d.ts +297 -196
  28. package/dist/index.js +2511 -74
  29. package/dist/{inline-code-C44UJ2TH.js → inline-code-BZNE1ALQ.js} +2 -2
  30. package/dist/{inline-math-wO1rMt9T.js → inline-math--lfq9WCW.js} +5 -4
  31. package/dist/{link-sGo7CEll.js → link-DAOjAX6n.js} +7 -6
  32. package/dist/{list-C0I1ysSI.js → list-EOEqkWEi.js} +4 -3
  33. package/dist/{list-item-BoC2wKBL.js → list-item-ZG4eadLp.js} +4 -3
  34. package/dist/{math-BlqtUf2r.js → math-3zyrsc0O.js} +5 -4
  35. package/dist/{mermaid-Ka1jnXrR.js → mermaid-VkvXdOuQ.js} +32 -18
  36. package/dist/modal-BKzT1TQI.js +4 -0
  37. package/dist/{modal-Rc_RoeYA.js → modal-DrPdD2g1.js} +4 -4
  38. package/dist/{node-list-YhpHXdM_.js → node-list-D7eKaZGS.js} +19 -10
  39. package/dist/node-list-DtNGUnnI.js +4 -0
  40. package/dist/{paragraph-BN-4-Dn7.js → paragraph-DEyWEFYY.js} +4 -3
  41. package/dist/previewers-DYnyVv4Y.js +10 -0
  42. package/dist/segmented-6Ch-Ees3.js +7 -0
  43. package/dist/{segmented-CaC54iz_.js → segmented-CeLXMLZa.js} +1 -1
  44. package/dist/{shiki-sJNZTn1K.js → shiki-Dgoch7Q6.js} +5 -5
  45. package/dist/spin-DElj7VPm.js +3 -0
  46. package/dist/{strong-NdAS3VjP.js → strong-CFjQLk1h.js} +4 -3
  47. package/dist/table-20vwclBI.js +3 -0
  48. package/dist/{table-CWX5B2i1.js → table-DI25RphX.js} +21 -25
  49. package/dist/{text-DpleLvNh.js → text-DP2IAZrc.js} +2 -2
  50. package/dist/{thematic-break-D5GvzU5S.js → thematic-break-DIO-A8eY.js} +2 -2
  51. package/dist/tooltip-CAyfm3_l.js +4 -0
  52. package/dist/{tooltip-Bgbzbk4Q.js → tooltip-CnO7OPL1.js} +1 -1
  53. package/dist/vanilla-BZ1fQWZQ.js +4 -0
  54. package/dist/{vanilla-BTOVqKl7.js → vanilla-YFxsSfhA.js} +1 -1
  55. package/dist/{yaml-y0snrPRx.js → yaml-eOuEqAWX.js} +3 -3
  56. package/dist/{zh-CN-Dfow4Yn2.js → zh-CN-B9lWRP8O.js} +3 -2
  57. package/dist/{zoom-container-B1qbA-7z.js → zoom-container-CrKx_BbS.js} +32 -32
  58. package/dist/zoom-container-j4kY9qX_.js +7 -0
  59. package/package.json +19 -12
  60. package/dist/button-JYC8d-B-.js +0 -5
  61. package/dist/code-block-BhMDz2ZL.js +0 -9
  62. package/dist/dropdown-Y5_Z4a_u.js +0 -5
  63. package/dist/error-component-DEIWb6kB.js +0 -4
  64. package/dist/image-DXBD47sF.js +0 -8
  65. package/dist/image-DvOGBhi-.js +0 -327
  66. package/dist/modal-Duhc-vVa.js +0 -4
  67. package/dist/node-list-C1je2nLd.js +0 -3
  68. package/dist/previewers-D0VVcdjL.js +0 -10
  69. package/dist/segmented-XdoLnuuq.js +0 -6
  70. package/dist/spin-wM2KE8mO.js +0 -3
  71. package/dist/table-R9gmCXm_.js +0 -3
  72. package/dist/tooltip-BJDs-A8d.js +0 -4
  73. package/dist/vanilla-DA5bwIkr.js +0 -4
  74. package/dist/zoom-container-KztuE4ri.js +0 -6
  75. /package/dist/{angular-Mip1mspI.js → angular-CJL7ngrz.js} +0 -0
  76. /package/dist/{angular-component-Cq5UbX7R.js → angular-component-COlDvuNE.js} +0 -0
  77. /package/dist/{apache-BSq7fX32.js → apache-CVvmKdUn.js} +0 -0
  78. /package/dist/{arrow-left-C5s0Sn8o.js → arrow-left-Dqeb1_Um.js} +0 -0
  79. /package/dist/{asciidoc-DS-PMOLv.js → asciidoc-DOmevTVz.js} +0 -0
  80. /package/dist/{assembly-BPatlOM7.js → assembly-Bj0yQVcL.js} +0 -0
  81. /package/dist/{astro-CSD_ZjXp.js → astro-DUti0QFn.js} +0 -0
  82. /package/dist/{bash-RITislE1.js → bash-BfyNXzLO.js} +0 -0
  83. /package/dist/{batch-DWPShYhN.js → batch-Dp6N3cFQ.js} +0 -0
  84. /package/dist/{bicep-C6BEHfP6.js → bicep-CEkCHedl.js} +0 -0
  85. /package/dist/{c-DNo3tsNy.js → c-CTmG9vr2.js} +0 -0
  86. /package/dist/{check-BfpxIITS.js → check-C6XCJVPi.js} +0 -0
  87. /package/dist/{chevron-down-LeNeemjn.js → chevron-down-aK8OlmM2.js} +0 -0
  88. /package/dist/{circle-alert-BjDuIzgc.js → circle-alert-C5r2kfnc.js} +0 -0
  89. /package/dist/{clojure-C1DEYHW0.js → clojure-CHjliXb8.js} +0 -0
  90. /package/dist/{cmake-B69mdXcH.js → cmake-BsKz8Gt4.js} +0 -0
  91. /package/dist/{cobol-qmL-zIWi.js → cobol-BvWYwPFU.js} +0 -0
  92. /package/dist/{code-D9CiymEK.js → code-Bwlpb4mV.js} +0 -0
  93. /package/dist/{codeowners-Crklt5nF.js → codeowners-CfTM6yvs.js} +0 -0
  94. /package/dist/{coffeescript-k3huSp23.js → coffeescript-BDiFe_B2.js} +0 -0
  95. /package/dist/{copy-C4580J93.js → copy-VpvA-5VS.js} +0 -0
  96. /package/dist/{cpp-Cn3MB35e.js → cpp-BfV_KWzp.js} +0 -0
  97. /package/dist/{crystal-D5aGETSx.js → crystal-BXT0x2i3.js} +0 -0
  98. /package/dist/{csharp-CgkTkbPx.js → csharp-C6rkxA6x.js} +0 -0
  99. /package/dist/{css-DRH4n_IV.js → css-Drxb2cuf.js} +0 -0
  100. /package/dist/{csv-D5nNTIzO.js → csv-CHKRaQ9l.js} +0 -0
  101. /package/dist/{cue-B5mC88-N.js → cue-DksiF2mE.js} +0 -0
  102. /package/dist/{d-BdQRMgma.js → d-C8JgmiVc.js} +0 -0
  103. /package/dist/{dart-BGnfn0NN.js → dart-BX3GppmW.js} +0 -0
  104. /package/dist/{database-Ca1VGX7u.js → database-Lmva5T5u.js} +0 -0
  105. /package/dist/{diff-DVaTsnqu.js → diff-C61xHcnV.js} +0 -0
  106. /package/dist/{docker-E47qYlmL.js → docker-Dws0Euuu.js} +0 -0
  107. /package/dist/{download-DytrK56a.js → download-BB76SD0m.js} +0 -0
  108. /package/dist/{elixir-C-jqqu6q.js → elixir-CtaCeLkf.js} +0 -0
  109. /package/dist/{elm-CmeHvaWl.js → elm-CFvSvo-7.js} +0 -0
  110. /package/dist/{env-Ck1BHoxR.js → env-BwMmmmE5.js} +0 -0
  111. /package/dist/{erlang-CIP8kpGJ.js → erlang-DJRbvPSq.js} +0 -0
  112. /package/dist/{eye-TaEwQS2Z.js → eye-VjweBQoW.js} +0 -0
  113. /package/dist/{flip-horizontal-BFWjqDbQ.js → flip-horizontal-D4IxaKDu.js} +0 -0
  114. /package/dist/{fortran-DJVP2s7V.js → fortran-D3Vf5GTV.js} +0 -0
  115. /package/dist/{fsharp-Bp6mUcG0.js → fsharp-C2iQH5b1.js} +0 -0
  116. /package/dist/{git-BDcqJ1Gp.js → git-DN4z97-P.js} +0 -0
  117. /package/dist/{gleam-JLiZVlev.js → gleam-PhX3VC_5.js} +0 -0
  118. /package/dist/{go-ClcCiS7e.js → go-xPznl0oK.js} +0 -0
  119. /package/dist/{graphql-D2RDo-DF.js → graphql-sVzb1_rA.js} +0 -0
  120. /package/dist/{groovy-DLZBw8xE.js → groovy-Bvkrc3eE.js} +0 -0
  121. /package/dist/{haml-Da74jRwZ.js → haml-Y_qa35Lk.js} +0 -0
  122. /package/dist/{handlebars-CNgS57Sz.js → handlebars-Bo6cxn4k.js} +0 -0
  123. /package/dist/{haskell-DCvfD6VB.js → haskell-D8t1pxAr.js} +0 -0
  124. /package/dist/{haxe-CHVK1TId.js → haxe-C-sdXVB9.js} +0 -0
  125. /package/dist/{html-Du4235Z-.js → html-I3JKB_2G.js} +0 -0
  126. /package/dist/{http-B8VAFeQ5.js → http-Dj2NVTPO.js} +0 -0
  127. /package/dist/{image-D8MZj4W5.js → image-DzKVFSaY.js} +0 -0
  128. /package/dist/{java-CoSdnK1N.js → java-BulcCUaV.js} +0 -0
  129. /package/dist/{javascript-BCDeVll0.js → javascript-DQlby440.js} +0 -0
  130. /package/dist/{jinja-DYbiqZy0.js → jinja-HRQZM5oZ.js} +0 -0
  131. /package/dist/{json-CdzCyWJA.js → json-wUPUX2x-.js} +0 -0
  132. /package/dist/{julia-pswJGtpP.js → julia-DjHYSWzj.js} +0 -0
  133. /package/dist/{kdl-M8rfQ85l.js → kdl-CGLuct22.js} +0 -0
  134. /package/dist/{kotlin-CfCV33oB.js → kotlin-CnR9eg7m.js} +0 -0
  135. /package/dist/{latex-DK8DFhTm.js → latex-CesDKd8G.js} +0 -0
  136. /package/dist/{less-BFnNZiIs.js → less-215r2nUv.js} +0 -0
  137. /package/dist/{link-C7eU_yi-.js → link-4JB1WqYS.js} +0 -0
  138. /package/dist/{liquid-C8h46DoX.js → liquid-FFTnvZwx.js} +0 -0
  139. /package/dist/{lisp-C3FbGuD1.js → lisp-BNWIo3S3.js} +0 -0
  140. /package/dist/{log-D-O3FXf2.js → log-C3BhnPjM.js} +0 -0
  141. /package/dist/{lua-BC_aR1_i.js → lua-jBHQD7Fh.js} +0 -0
  142. /package/dist/{luau-DFUOrNN7.js → luau-CJKAqC3L.js} +0 -0
  143. /package/dist/{makefile-Ck67veVV.js → makefile-DZmoFYpF.js} +0 -0
  144. /package/dist/{markdown-BX13X3kd.js → markdown-BEABBw2C.js} +0 -0
  145. /package/dist/{marko-CQE8YTCc.js → marko-DE7d51Q2.js} +0 -0
  146. /package/dist/{matlab-Bd9O2Ml3.js → matlab-n99nEoGl.js} +0 -0
  147. /package/dist/{maximize-CDZ9rnYF.js → maximize-VRncBaHe.js} +0 -0
  148. /package/dist/{mermaid-Dv-Pr0W-.js → mermaid-Dv9_1JlU.js} +0 -0
  149. /package/dist/{minimize-B9ER7p2X.js → minimize-k8aU78V4.js} +0 -0
  150. /package/dist/{nextflow-D3lDq1Yi.js → nextflow-DjdDVx1j.js} +0 -0
  151. /package/dist/{nginx-CgsqCL4l.js → nginx-DH4jOOdC.js} +0 -0
  152. /package/dist/{nim-BJdSu3c6.js → nim-Cb0hPGv5.js} +0 -0
  153. /package/dist/{nix-B7K_D6CN.js → nix-Bf4Vwv5v.js} +0 -0
  154. /package/dist/{ocaml-gYS1Y45s.js → ocaml-BwJ1z9S7.js} +0 -0
  155. /package/dist/{perl-DXFhFWhI.js → perl-P6bAYvN9.js} +0 -0
  156. /package/dist/{php-We35bF4E.js → php-BGTGPBW1.js} +0 -0
  157. /package/dist/{postcss-BWovY_YV.js → postcss-D8a2Jx1D.js} +0 -0
  158. /package/dist/{powershell-C6teiBsq.js → powershell-DNOnus4K.js} +0 -0
  159. /package/dist/{prisma-UyJEg0_X.js → prisma-DquVk_GR.js} +0 -0
  160. /package/dist/{prolog-YZsPgdnw.js → prolog-BxJJGnOg.js} +0 -0
  161. /package/dist/{properties-DaPbL0e2.js → properties-DjauSeDE.js} +0 -0
  162. /package/dist/{proto-1LIwu2O1.js → proto-3aU1SxxY.js} +0 -0
  163. /package/dist/{pug-CzkUK-Ec.js → pug-OiYFRnMd.js} +0 -0
  164. /package/dist/{puppet-CNhB1MHb.js → puppet-8Sq4QIbE.js} +0 -0
  165. /package/dist/{python-B_hgEobv.js → python-CBYVyhMm.js} +0 -0
  166. /package/dist/{r-CVeKYmPK.js → r-DfzMNaiK.js} +0 -0
  167. /package/dist/{racket-D5UfvXuw.js → racket-EkEmTJtD.js} +0 -0
  168. /package/dist/{razor-RIKaANTN.js → razor-BSd-q379.js} +0 -0
  169. /package/dist/{rotate-ccw-square-C2KVFUF3.js → rotate-ccw-square-Dy0doneR.js} +0 -0
  170. /package/dist/{ruby-C8wV0pMO.js → ruby-CNn-W_DF.js} +0 -0
  171. /package/dist/{rust-75Gei1mP.js → rust-BW9y4Ksf.js} +0 -0
  172. /package/dist/{sass-Cq68xmQ4.js → sass-Cyleqehh.js} +0 -0
  173. /package/dist/{scala-C_E5rjSc.js → scala-2YqaI_aG.js} +0 -0
  174. /package/dist/{scheme-Bm-q-nLL.js → scheme-CWx6sQlk.js} +0 -0
  175. /package/dist/{shader-DPaRkMCs.js → shader-CLzSKNOz.js} +0 -0
  176. /package/dist/{shiki-token-renderer-CLmUjKa3.js → shiki-token-renderer-BjxmGfXH.js} +0 -0
  177. /package/dist/{solidity-DvHG_0CD.js → solidity-CgjJUETv.js} +0 -0
  178. /package/dist/{spin--f5jNjBn.js → spin-DzERwGWy.js} +0 -0
  179. /package/dist/{stata-DoVloJLm.js → stata-CI3W9UFN.js} +0 -0
  180. /package/dist/{svelte-tlbA11de.js → svelte-D-OV6frL.js} +0 -0
  181. /package/dist/{swift-BZn5eRnK.js → swift-CcBwS4X5.js} +0 -0
  182. /package/dist/{table-CaUMjs4M.js → table-BMlD4JhL.js} +0 -0
  183. /package/dist/{terraform-c5-k7yB1.js → terraform-BwM_GPTy.js} +0 -0
  184. /package/dist/{text-DPCGWvDK.js → text-hIzRUiKs.js} +0 -0
  185. /package/dist/{theme.css → theme.css/theme.css} +0 -0
  186. /package/dist/{toml-DdLGBe1A.js → toml-CXJ7B-C1.js} +0 -0
  187. /package/dist/{twig-D_jzZxh6.js → twig-CXQNsdEx.js} +0 -0
  188. /package/dist/{typescript-B95hq2ns.js → typescript-0uiFYOof.js} +0 -0
  189. /package/dist/{typst-CSAEQ4yK.js → typst-gIi5b52E.js} +0 -0
  190. /package/dist/{v-BAhebuOB.js → v-Ct-HfSu0.js} +0 -0
  191. /package/dist/{vala-RAu83-lp.js → vala-BZbAZj2w.js} +0 -0
  192. /package/dist/{verilog-BgmTn52U.js → verilog-NzFyyNP_.js} +0 -0
  193. /package/dist/{vim-c8oTCLkH.js → vim-CN-tRagW.js} +0 -0
  194. /package/dist/{vue-TGT6HTBA.js → vue-BmLzKAao.js} +0 -0
  195. /package/dist/{xml-C1HDr874.js → xml-CBzkooc-.js} +0 -0
  196. /package/dist/{yaml-BO7FjFQZ.js → yaml-CT7I_lPM.js} +0 -0
  197. /package/dist/{zig-qANBp1SU.js → zig-B7F-QzJD.js} +0 -0
  198. /package/dist/{zoomIn-iVMAUxIz.js → zoomIn-DlPeXZbT.js} +0 -0
  199. /package/dist/{zoomOut-Cxq1_dIQ.js → zoomOut-Lvyw8SOW.js} +0 -0
@@ -1,6 +1,6 @@
1
- import { H as useContext, t as useZoom, u as useI18n } from "./composables-yny5gJo3.js";
2
- import { t as button_default } from "./button-BQhuT7wh.js";
3
- import { computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, normalizeStyle, openBlock, ref, renderSlot, unref, withModifiers } from "vue";
1
+ import { t as useZoom, y as useI18n } from "./composables-DuQ72m6O.js";
2
+ import { t as button_default } from "./button-BDO3n0n_.js";
3
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, normalizeStyle, openBlock, ref, renderList, renderSlot, unref, withModifiers } from "vue";
4
4
 
5
5
  //#region src/components/zoom-container.vue?vue&type=script&setup=true&lang.ts
6
6
  const _hoisted_1 = { "data-stream-markdown": "zoom-inner" };
@@ -32,7 +32,6 @@ var zoom_container_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
32
32
  const props = __props;
33
33
  const containerRef = ref();
34
34
  const { t } = useI18n();
35
- const { icons } = useContext();
36
35
  const { zoom, isDragging, transformStyle, zoomIn, zoomOut, resetZoom, startDrag, onDrag, stopDrag, handleWheel, handleTouchStart, handleTouchMove, handleTouchEnd } = useZoom();
37
36
  const zoomPercent = computed(() => `${Math.round(zoom.value * 100)}%`);
38
37
  const controlsPosition = computed(() => {
@@ -74,6 +73,29 @@ var zoom_container_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
74
73
  buttonStyle: { fontSize: "0.875rem" }
75
74
  };
76
75
  });
76
+ const controls = computed(() => [
77
+ {
78
+ ...controlButtonProps.value,
79
+ key: "zoomIn",
80
+ icon: "zoomIn",
81
+ name: t("button.zoomIn"),
82
+ onClick: zoomIn
83
+ },
84
+ {
85
+ ...controlButtonProps.value,
86
+ key: "zoomOut",
87
+ icon: "zoomOut",
88
+ name: t("button.zoomOut"),
89
+ onClick: zoomOut
90
+ },
91
+ {
92
+ ...controlButtonProps.value,
93
+ key: "resetZoom",
94
+ variant: "text",
95
+ name: zoomPercent.value,
96
+ onClick: resetZoom
97
+ }
98
+ ]);
77
99
  function onWheel(event) {
78
100
  if (containerRef.value) handleWheel(event, containerRef.value);
79
101
  }
@@ -105,34 +127,12 @@ var zoom_container_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
105
127
  "data-stream-markdown": "zoom-controls",
106
128
  style: normalizeStyle(controlsPosition.value),
107
129
  onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"]))
108
- }, [
109
- renderSlot(_ctx.$slots, "controls", normalizeProps(guardReactiveProps(controlButtonProps.value))),
110
- createVNode(button_default, mergeProps({
111
- icon: unref(icons).zoomIn,
112
- name: unref(t)("button.zoomIn")
113
- }, controlButtonProps.value, { onClick: unref(zoomIn) }), null, 16, [
114
- "icon",
115
- "name",
116
- "onClick"
117
- ]),
118
- createVNode(button_default, mergeProps({
119
- icon: unref(icons).zoomOut,
120
- name: unref(t)("button.zoomOut")
121
- }, controlButtonProps.value, { onClick: unref(zoomOut) }), null, 16, [
122
- "icon",
123
- "name",
124
- "onClick"
125
- ]),
126
- createVNode(button_default, mergeProps({
127
- title: unref(t)("button.resetZoom"),
128
- name: zoomPercent.value,
129
- variant: "text"
130
- }, controlButtonProps.value, { onClick: unref(resetZoom) }), null, 16, [
131
- "title",
132
- "name",
133
- "onClick"
134
- ])
135
- ], 4)) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_1, [createElementVNode("div", {
130
+ }, [renderSlot(_ctx.$slots, "controls", normalizeProps(guardReactiveProps(controlButtonProps.value))), (openBlock(true), createElementBlock(Fragment, null, renderList(controls.value, (item) => {
131
+ return openBlock(), createBlock(button_default, mergeProps({ ref_for: true }, item, {
132
+ key: item.key,
133
+ onClick: item.onClick
134
+ }), null, 16, ["onClick"]);
135
+ }), 128))], 4)) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_1, [createElementVNode("div", {
136
136
  "data-stream-markdown": "zoom-transform-container",
137
137
  style: normalizeStyle({
138
138
  ...unref(transformStyle),
@@ -0,0 +1,7 @@
1
+ import "./composables-DuQ72m6O.js";
2
+ import "./tooltip-CnO7OPL1.js";
3
+ import "./button-BDO3n0n_.js";
4
+ import "./icon-PEivHbuv.js";
5
+ import { t as zoom_container_default } from "./zoom-container-CrKx_BbS.js";
6
+
7
+ export { zoom_container_default as default };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vue-stream-markdown",
3
3
  "type": "module",
4
- "version": "0.1.5",
4
+ "version": "0.2.0",
5
5
  "description": "Streaming markdown output, Useful for text streams like LLM outputs.",
6
6
  "author": "jinghaihan",
7
7
  "license": "MIT",
@@ -58,16 +58,21 @@
58
58
  "remend": "^1.0.1"
59
59
  },
60
60
  "devDependencies": {
61
- "@antfu/eslint-config": "^6.6.1",
61
+ "@antfu/eslint-config": "^6.7.1",
62
62
  "@antfu/utils": "^9.3.0",
63
63
  "@iconify-json/catppuccin": "^1.2.17",
64
- "@iconify-json/lucide": "^1.2.79",
65
- "@types/node": "^24.10.3",
64
+ "@iconify-json/lucide": "^1.2.81",
65
+ "@nuxt/devtools": "^3.1.1",
66
+ "@nuxt/eslint": "^1.12.1",
67
+ "@nuxtjs/color-mode": "^4.0.0",
68
+ "@types/node": "^24.10.4",
66
69
  "@unocss/eslint-plugin": "66.5.9",
67
- "@vitejs/plugin-vue": "^6.0.2",
70
+ "@unocss/nuxt": "^66.5.10",
71
+ "@vitejs/plugin-vue": "^6.0.3",
68
72
  "@vue/test-utils": "^2.4.6",
73
+ "@vueuse/nuxt": "^14.1.0",
69
74
  "bumpp": "^10.3.2",
70
- "eslint": "^9.39.1",
75
+ "eslint": "^9.39.2",
71
76
  "eslint-plugin-format": "^1.1.0",
72
77
  "happy-dom": "^20.0.11",
73
78
  "lint-staged": "^16.2.7",
@@ -82,11 +87,12 @@
82
87
  "micromark-extension-gfm": "^3.0.0",
83
88
  "micromark-extension-math": "^3.1.0",
84
89
  "micromark-util-types": "^2.0.2",
90
+ "nuxt": "^4.2.2",
85
91
  "pncat": "^0.7.7",
86
92
  "simple-git-hooks": "^2.13.1",
87
93
  "taze": "^19.9.2",
88
94
  "treechop": "^0.1.2",
89
- "tsdown": "^0.17.2",
95
+ "tsdown": "^0.17.4",
90
96
  "tsx": "^4.21.0",
91
97
  "typescript": "^5.9.3",
92
98
  "unocss": "^66.5.10",
@@ -104,14 +110,15 @@
104
110
  "*": "eslint --fix"
105
111
  },
106
112
  "scripts": {
107
- "dev": "vite",
108
- "dev:docs": "pnpm --filter documentation dev",
113
+ "dev": "pnpm playground:dev",
109
114
  "build": "tsdown",
110
- "build:play": "vite build",
111
- "build:docs": "pnpm --filter documentation build",
115
+ "playground:dev": "pnpm -F playground dev",
116
+ "playground:build": "pnpm -F playground generate",
117
+ "docs:dev": "pnpm -F docs dev",
118
+ "docs:build": "pnpm -F docs build",
112
119
  "deps": "taze major -I",
113
120
  "lint": "eslint",
114
- "typecheck": "vue-tsc --noEmit",
121
+ "typecheck": "vue-tsc --noEmit && pnpm -F playground typecheck",
115
122
  "test": "vitest",
116
123
  "release": "bumpp",
117
124
  "bootstrap": "pnpm install"
@@ -1,5 +0,0 @@
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,9 +0,0 @@
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,5 +0,0 @@
1
- import "./composables-yny5gJo3.js";
2
- import "./tooltip-Bgbzbk4Q.js";
3
- import { n as dropdown_default } from "./button-BQhuT7wh.js";
4
-
5
- export { dropdown_default as default };
@@ -1,4 +0,0 @@
1
- import "./composables-yny5gJo3.js";
2
- import { t as error_component_default } from "./error-component-Bb0gIZsx.js";
3
-
4
- export { error_component_default as default };
@@ -1,8 +0,0 @@
1
- import "./composables-yny5gJo3.js";
2
- import "./tooltip-Bgbzbk4Q.js";
3
- import "./button-BQhuT7wh.js";
4
- import "./modal-Rc_RoeYA.js";
5
- import { t as image_default } from "./image-DvOGBhi-.js";
6
- import "./zoom-container-B1qbA-7z.js";
7
-
8
- export { image_default as default };
@@ -1,327 +0,0 @@
1
- import { H as useContext, V as useControls, a as useMediumZoom, k as saveImage, u as useI18n } from "./composables-yny5gJo3.js";
2
- import { t as button_default } from "./button-BQhuT7wh.js";
3
- import { t as modal_default } from "./modal-Rc_RoeYA.js";
4
- import { t as zoom_container_default } from "./zoom-container-B1qbA-7z.js";
5
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, normalizeStyle, openBlock, ref, toRefs, unref, watch, withCtx } from "vue";
6
- import { useCycleList } from "@vueuse/core";
7
-
8
- //#region node_modules/.pnpm/treechop@0.1.2/node_modules/treechop/dist/index.js
9
- const DEFAULT_CHILDREN_KEY = "children";
10
- function createTreeUtils(options = {}) {
11
- const { childrenKey = DEFAULT_CHILDREN_KEY } = options;
12
- return {
13
- childrenKey,
14
- getChildrenKey(node, meta) {
15
- return typeof this.childrenKey === "function" ? this.childrenKey(node, meta) : this.childrenKey;
16
- },
17
- getChildren(node, meta) {
18
- return node[this.getChildrenKey(node, meta)] || [];
19
- },
20
- hasChildren(node, meta) {
21
- const children = this.getChildren(node, meta);
22
- return Array.isArray(children) && children.length > 0;
23
- }
24
- };
25
- }
26
- function preOrderTraverse(tree, callback, utils) {
27
- const result = [];
28
- const traverse = (nodes, parents = [], depth = 0) => {
29
- nodes.forEach((node, index) => {
30
- const meta = {
31
- depth,
32
- index,
33
- parents
34
- };
35
- result.push(callback(node, meta));
36
- if (utils.hasChildren(node, meta)) traverse(utils.getChildren(node, meta), [...parents, node], depth + 1);
37
- });
38
- };
39
- traverse(tree);
40
- return result;
41
- }
42
- function postOrderTraverse(tree, callback, utils) {
43
- const result = [];
44
- const traverse = (nodes, parents = [], depth = 0) => {
45
- nodes.forEach((node, index) => {
46
- const meta = {
47
- depth,
48
- index,
49
- parents
50
- };
51
- if (utils.hasChildren(node, meta)) traverse(utils.getChildren(node, meta), [...parents, node], depth + 1);
52
- result.push(callback(node, meta));
53
- });
54
- };
55
- traverse(tree);
56
- return result;
57
- }
58
- function breadthTraverse(tree, callback, utils) {
59
- const result = [];
60
- const queue = tree.map((node, index) => [
61
- node,
62
- index,
63
- [],
64
- 0
65
- ]);
66
- while (queue.length) {
67
- const [node, index, parents, depth] = queue.shift();
68
- const meta = {
69
- depth,
70
- index,
71
- parents
72
- };
73
- result.push(callback(node, meta));
74
- if (utils.hasChildren(node, meta)) utils.getChildren(node, meta).forEach((child, childIndex) => {
75
- queue.push([
76
- child,
77
- childIndex,
78
- [...parents, node],
79
- depth + 1
80
- ]);
81
- });
82
- }
83
- return result;
84
- }
85
- function treeFlatFilter(tree, predicate, options = {}) {
86
- const { strategy = "pre" } = options;
87
- const utils = createTreeUtils(options);
88
- const callback = (node, meta) => {
89
- return predicate(node, meta) ? node : null;
90
- };
91
- switch (strategy) {
92
- case "post": return postOrderTraverse(tree, callback, utils).filter(Boolean);
93
- case "breadth": return breadthTraverse(tree, callback, utils).filter(Boolean);
94
- case "pre":
95
- default: return preOrderTraverse(tree, callback, utils).filter(Boolean);
96
- }
97
- }
98
-
99
- //#endregion
100
- //#region src/components/image.vue?vue&type=script&setup=true&lang.ts
101
- const _hoisted_1 = [
102
- "src",
103
- "alt",
104
- "title"
105
- ];
106
- const _hoisted_2 = [
107
- "src",
108
- "alt",
109
- "title"
110
- ];
111
- var image_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
112
- __name: "image",
113
- props: {
114
- src: {
115
- type: String,
116
- required: false
117
- },
118
- alt: {
119
- type: String,
120
- required: false
121
- },
122
- title: {
123
- type: String,
124
- required: false
125
- },
126
- preview: {
127
- type: Boolean,
128
- required: false,
129
- default: true
130
- },
131
- margin: {
132
- type: Number,
133
- required: false,
134
- default: 16
135
- },
136
- controls: {
137
- type: [Boolean, Object],
138
- required: false,
139
- default: true
140
- }
141
- },
142
- emits: ["load", "error"],
143
- setup(__props, { emit: __emit }) {
144
- const props = __props;
145
- const emits = __emit;
146
- const { margin, controls } = toRefs(props);
147
- const { t } = useI18n();
148
- const { icons, parsedNodes } = useContext();
149
- const { isControlEnabled, getControlValue } = useControls({ controls });
150
- const imageNodes = computed(() => treeFlatFilter(parsedNodes.value, (node) => node.type === "image" && !node.loading));
151
- const imageList = computed(() => [...new Set(imageNodes.value.map((node) => node.url))]);
152
- const { state: imageSrc, prev, next } = useCycleList(imageList, {
153
- initialValue: props.src,
154
- fallbackIndex: 0
155
- });
156
- const enableDownload = computed(() => isControlEnabled("image.download"));
157
- const enableCarousel = computed(() => isControlEnabled("image.carousel"));
158
- const enableFlip = computed(() => isControlEnabled("image.flip"));
159
- const enableRotate = computed(() => isControlEnabled("image.rotate"));
160
- const controlPosition = computed(() => {
161
- const position = getControlValue("image.controlPosition");
162
- if (typeof position === "boolean") return "bottom-center";
163
- return position || "bottom-center";
164
- });
165
- const loaded = ref(false);
166
- const open = ref(false);
167
- const scaleX = ref(1);
168
- const scaleY = ref(1);
169
- const rotate = ref(0);
170
- const { isAnimating, elementRef, zoomElementRef: _zoomElementRef, elementStyle, zoomIn, zoomOut } = useMediumZoom({
171
- margin,
172
- open: () => open.value = true,
173
- close: () => open.value = false
174
- });
175
- const imageStyle = computed(() => ({
176
- transform: `
177
- scaleX(${scaleX.value})
178
- scaleY(${scaleY.value})
179
- rotate(${rotate.value}deg)
180
- `,
181
- transition: "transform 0.3s ease",
182
- ...elementStyle.value
183
- }));
184
- function handleLoad(event) {
185
- loaded.value = true;
186
- emits("load", event);
187
- }
188
- function handleError(event) {
189
- emits("error", event);
190
- }
191
- function handleOpen() {
192
- if (!props.preview || !elementRef.value || !loaded.value) return;
193
- zoomIn();
194
- }
195
- function handleClose() {
196
- if (isAnimating.value) return;
197
- zoomOut();
198
- }
199
- function download() {
200
- if (!imageSrc.value) return;
201
- saveImage(imageSrc.value, props.alt);
202
- }
203
- function flipHorizontal() {
204
- scaleX.value *= -1;
205
- }
206
- function flipVertical() {
207
- scaleY.value *= -1;
208
- }
209
- function rotateLeft() {
210
- rotate.value -= 90;
211
- }
212
- function rotateRight() {
213
- rotate.value += 90;
214
- }
215
- watch(open, (data) => {
216
- if (!data) {
217
- scaleX.value = 1;
218
- scaleY.value = 1;
219
- rotate.value = 0;
220
- if (props.src) imageSrc.value = props.src;
221
- }
222
- });
223
- return (_ctx, _cache) => {
224
- return openBlock(), createElementBlock(Fragment, null, [createElementVNode("img", {
225
- ref_key: "elementRef",
226
- ref: elementRef,
227
- "data-stream-markdown": "image",
228
- src: __props.src,
229
- alt: __props.alt,
230
- title: __props.title,
231
- style: { transition: "transform 300ms cubic-bezier(0.2, 0, 0.2, 1)" },
232
- loading: "lazy",
233
- decoding: "async",
234
- onLoad: handleLoad,
235
- onError: handleError,
236
- onClick: handleOpen
237
- }, null, 40, _hoisted_1), createVNode(modal_default, {
238
- open: open.value,
239
- "onUpdate:open": _cache[2] || (_cache[2] = ($event) => open.value = $event),
240
- transition: "",
241
- "modal-style": { backgroundColor: "rgba(0, 0, 0, 0.45)" },
242
- close: handleClose
243
- }, {
244
- default: withCtx(() => [createVNode(zoom_container_default, {
245
- "control-size": "large",
246
- position: controlPosition.value,
247
- "container-style": {
248
- width: "auto",
249
- maxWidth: `calc(100% - ${props.margin * 2}px)`,
250
- cursor: "grab"
251
- },
252
- onClick: handleClose
253
- }, {
254
- controls: withCtx((buttonProps) => [
255
- unref(imageSrc) && enableDownload.value ? (openBlock(), createBlock(button_default, mergeProps({ key: 0 }, buttonProps, {
256
- icon: unref(icons).download,
257
- name: unref(t)("button.download"),
258
- onClick: download
259
- }), null, 16, ["icon", "name"])) : createCommentVNode("v-if", true),
260
- imageList.value.length > 1 && enableCarousel.value ? (openBlock(), createBlock(button_default, mergeProps({ key: 1 }, buttonProps, {
261
- icon: unref(icons).arrowLeft,
262
- name: unref(t)("button.previous"),
263
- onClick: _cache[0] || (_cache[0] = () => unref(prev)())
264
- }), null, 16, ["icon", "name"])) : createCommentVNode("v-if", true),
265
- imageList.value.length > 1 && enableCarousel.value ? (openBlock(), createBlock(button_default, mergeProps({ key: 2 }, buttonProps, {
266
- icon: unref(icons).arrowRight || unref(icons).arrowLeft,
267
- name: unref(t)("button.next"),
268
- "button-style": { transform: unref(icons).arrowRight ? void 0 : "scaleX(-1)" },
269
- onClick: _cache[1] || (_cache[1] = () => unref(next)())
270
- }), null, 16, [
271
- "icon",
272
- "name",
273
- "button-style"
274
- ])) : createCommentVNode("v-if", true),
275
- enableFlip.value ? (openBlock(), createBlock(button_default, mergeProps({ key: 3 }, buttonProps, {
276
- icon: unref(icons).flipHorizontal,
277
- name: unref(t)("button.flipX"),
278
- onClick: flipHorizontal
279
- }), null, 16, ["icon", "name"])) : createCommentVNode("v-if", true),
280
- enableFlip.value ? (openBlock(), createBlock(button_default, mergeProps({ key: 4 }, buttonProps, {
281
- icon: unref(icons).flipVertical || unref(icons).flipHorizontal,
282
- name: unref(t)("button.flipY"),
283
- "button-style": { rotate: unref(icons).flipVertical ? void 0 : "90deg" },
284
- onClick: flipVertical
285
- }), null, 16, [
286
- "icon",
287
- "name",
288
- "button-style"
289
- ])) : createCommentVNode("v-if", true),
290
- enableRotate.value ? (openBlock(), createBlock(button_default, mergeProps({ key: 5 }, buttonProps, {
291
- icon: unref(icons).rotateLeft,
292
- name: unref(t)("button.rotateLeft"),
293
- onClick: rotateLeft
294
- }), null, 16, ["icon", "name"])) : createCommentVNode("v-if", true),
295
- enableRotate.value ? (openBlock(), createBlock(button_default, mergeProps({ key: 6 }, buttonProps, {
296
- icon: unref(icons).rotateRight || unref(icons).rotateLeft,
297
- name: unref(t)("button.rotateRight"),
298
- "button-style": { transform: unref(icons).rotateRight ? void 0 : "scaleX(-1)" },
299
- onClick: rotateRight
300
- }), null, 16, [
301
- "icon",
302
- "name",
303
- "button-style"
304
- ])) : createCommentVNode("v-if", true)
305
- ]),
306
- default: withCtx(() => [createElementVNode("img", {
307
- ref_key: "_zoomElementRef",
308
- ref: _zoomElementRef,
309
- src: unref(imageSrc),
310
- alt: __props.alt,
311
- title: __props.title,
312
- style: normalizeStyle(imageStyle.value)
313
- }, null, 12, _hoisted_2)]),
314
- _: 1
315
- }, 8, ["position", "container-style"])]),
316
- _: 1
317
- }, 8, ["open"])], 64);
318
- };
319
- }
320
- });
321
-
322
- //#endregion
323
- //#region src/components/image.vue
324
- var image_default = image_vue_vue_type_script_setup_true_lang_default;
325
-
326
- //#endregion
327
- export { image_default as t };
@@ -1,4 +0,0 @@
1
- import "./composables-yny5gJo3.js";
2
- import { t as modal_default } from "./modal-Rc_RoeYA.js";
3
-
4
- export { modal_default as default };
@@ -1,3 +0,0 @@
1
- import { t as node_list_default } from "./node-list-YhpHXdM_.js";
2
-
3
- export { node_list_default as default };
@@ -1,10 +0,0 @@
1
- import { defineAsyncComponent } from "vue";
2
-
3
- //#region src/components/previewers/index.ts
4
- const CODE_PREVIEWERS = {
5
- html: defineAsyncComponent(() => import("./html-DXNqMvt_.js")),
6
- mermaid: defineAsyncComponent(() => import("./mermaid-Ka1jnXrR.js"))
7
- };
8
-
9
- //#endregion
10
- export { CODE_PREVIEWERS as t };
@@ -1,6 +0,0 @@
1
- import "./composables-yny5gJo3.js";
2
- import "./tooltip-Bgbzbk4Q.js";
3
- import "./button-BQhuT7wh.js";
4
- import { t as segmented_default } from "./segmented-CaC54iz_.js";
5
-
6
- export { segmented_default as default };
@@ -1,3 +0,0 @@
1
- import { t as spin_default } from "./spin--f5jNjBn.js";
2
-
3
- export { spin_default as default };
@@ -1,3 +0,0 @@
1
- import { t as table_default } from "./table-CaUMjs4M.js";
2
-
3
- export { table_default as default };
@@ -1,4 +0,0 @@
1
- import "./composables-yny5gJo3.js";
2
- import { t as tooltip_default } from "./tooltip-Bgbzbk4Q.js";
3
-
4
- export { tooltip_default as default };
@@ -1,4 +0,0 @@
1
- import "./composables-yny5gJo3.js";
2
- import { t as vanilla_default } from "./vanilla-BTOVqKl7.js";
3
-
4
- export { vanilla_default as default };
@@ -1,6 +0,0 @@
1
- import "./composables-yny5gJo3.js";
2
- import "./tooltip-Bgbzbk4Q.js";
3
- import "./button-BQhuT7wh.js";
4
- import { t as zoom_container_default } from "./zoom-container-B1qbA-7z.js";
5
-
6
- export { zoom_container_default as default };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes