vue-stream-markdown 0.1.6 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/{blockquote-CxA1dQZe.js → blockquote-Bv0immvx.js} +2 -2
- package/dist/{button-B2ebQt7R.js → button-CRnH8Rzt.js} +36 -28
- package/dist/button-CpZL9Dhf.js +6 -0
- package/dist/{code-CPG6B2Cw.js → code-BcAa_-2j.js} +10 -9
- package/dist/code-block-C1Hz5oQb.js +10 -0
- package/dist/{code-block-I_Yd1Flg.js → code-block-mylXl6jG.js} +66 -78
- package/dist/{composables-DWipZHuF.js → composables-CL-BX9Ri.js} +464 -366
- package/dist/{delete-DQ21z5-F.js → delete-drdYWAXs.js} +2 -2
- package/dist/dropdown-CS5Df_eY.js +6 -0
- package/dist/{emphasis-BjLkIDQB.js → emphasis-CdEFGQdu.js} +2 -2
- package/dist/error-component-Csr-ujUx.js +5 -0
- package/dist/{error-component-DSOVrE5J.js → error-component-xzXxODeR.js} +10 -4
- package/dist/{footnote-definition-BmS8hchP.js → footnote-definition-BTSXdQZi.js} +8 -7
- package/dist/{footnote-reference-Z2tITeCE.js → footnote-reference-CV_67vK7.js} +1 -1
- package/dist/{heading-BwBFJB_E.js → heading-BH7urRHb.js} +2 -2
- package/dist/icon-DcKmEBsy.js +4 -0
- package/dist/icon-MRs2P5TP.js +67 -0
- package/dist/image-BRCbBLI5.js +9 -0
- package/dist/{image-IKvFWz2r.js → image-Bo_26KHM.js} +12 -11
- package/dist/{image-BLlap3ce.js → image-BypX6qku.js} +75 -59
- package/dist/index.css +19 -4
- package/dist/index.d.ts +657 -198
- package/dist/index.js +2291 -89
- package/dist/{inline-math-C2Ryxm-K.js → inline-math-DFUJNhmp.js} +3 -2
- package/dist/{link-BXl7E_6o.js → link-ClKb1qAC.js} +4 -3
- package/dist/{list-DLcwTZns.js → list-BdM_gwie.js} +2 -2
- package/dist/{list-item-H0eYeIdB.js → list-item-DaRd7Yu3.js} +2 -2
- package/dist/{math-C-0d5PaJ.js → math-CLweuHzM.js} +3 -2
- package/dist/{mermaid-0x6C2MY5.js → mermaid-CyLU2UYz.js} +27 -15
- package/dist/modal-JW5JgjbN.js +4 -0
- package/dist/{modal-CEqU9Ubu.js → modal-vHG2jmSe.js} +2 -2
- package/dist/{node-list--v2wbxOo.js → node-list-3yGs9Kcx.js} +1 -1
- package/dist/node-list-Cl7nXqfm.js +4 -0
- package/dist/{paragraph-DRPfp6DV.js → paragraph-LV8LrqLS.js} +2 -2
- package/dist/previewers-BUz7EQbB.js +10 -0
- package/dist/{segmented-Drf8EBQD.js → segmented-ChmGPy3i.js} +1 -1
- package/dist/segmented-STxjOAhU.js +7 -0
- package/dist/{shiki-CkwRD3TS.js → shiki-Dp1kiUyz.js} +35 -10
- package/dist/{shiki-token-renderer-BMveKuYt.js → shiki-token-renderer-l2VX-xoX.js} +4 -2
- package/dist/spin-DElj7VPm.js +3 -0
- package/dist/{strong-D6V4fCRG.js → strong-CcKSE5Jo.js} +2 -2
- package/dist/table-20vwclBI.js +3 -0
- package/dist/{table-DLUgGL5Q.js → table-Bk4vJ8-K.js} +19 -23
- package/dist/tooltip-BElCxO8W.js +4 -0
- package/dist/{tooltip-Bdt9-aQx.js → tooltip-DkCGsj0S.js} +2 -2
- package/dist/vanilla-79xxpygI.js +4 -0
- package/dist/{vanilla-BSgZTIo9.js → vanilla-D2g3JpWZ.js} +1 -1
- package/dist/{yaml-3cd5rdJj.js → yaml-eOuEqAWX.js} +1 -1
- package/dist/zoom-container-C5vP44cr.js +7 -0
- package/dist/{zoom-container-f44XxzOI.js → zoom-container-H5FZmzwY.js} +32 -32
- package/package.json +20 -13
- package/dist/button-C6zIegam.js +0 -5
- package/dist/code-block--1wFjtmu.js +0 -9
- package/dist/dropdown-CtWjJiAf.js +0 -5
- package/dist/error-component-DtcRn_0A.js +0 -4
- package/dist/image-aT9xxnwh.js +0 -8
- package/dist/modal-BDgfKnFl.js +0 -4
- package/dist/node-list-CHvX62Zh.js +0 -4
- package/dist/previewers-DsN-cTwd.js +0 -10
- package/dist/segmented-DIVDGfR5.js +0 -6
- package/dist/spin-DWkKEP0G.js +0 -3
- package/dist/table-B2mghd3l.js +0 -3
- package/dist/tooltip-DQ1-yPia.js +0 -4
- package/dist/vanilla-DUbuBied.js +0 -4
- package/dist/zoom-container-D2DxS8V5.js +0 -6
- /package/dist/{angular-CEQtRU3N.js → angular-CJL7ngrz.js} +0 -0
- /package/dist/{angular-component-QEWXDi5W.js → angular-component-COlDvuNE.js} +0 -0
- /package/dist/{apache-D1WYHuA2.js → apache-CVvmKdUn.js} +0 -0
- /package/dist/{arrow-left-DiHYz8df.js → arrow-left-Dqeb1_Um.js} +0 -0
- /package/dist/{asciidoc-BbV_Tvaj.js → asciidoc-DOmevTVz.js} +0 -0
- /package/dist/{assembly-DOdgqSeT.js → assembly-Bj0yQVcL.js} +0 -0
- /package/dist/{astro-I7-Zr25r.js → astro-DUti0QFn.js} +0 -0
- /package/dist/{bash-BC7HOdMh.js → bash-BfyNXzLO.js} +0 -0
- /package/dist/{batch-XAv7F3kV.js → batch-Dp6N3cFQ.js} +0 -0
- /package/dist/{bicep-B9IAZzHb.js → bicep-CEkCHedl.js} +0 -0
- /package/dist/{c-B3pMu4KG.js → c-CTmG9vr2.js} +0 -0
- /package/dist/{check-BjAiKMbo.js → check-C6XCJVPi.js} +0 -0
- /package/dist/{chevron-down-B4lkjpIC.js → chevron-down-aK8OlmM2.js} +0 -0
- /package/dist/{circle-alert-DlAafH7h.js → circle-alert-C5r2kfnc.js} +0 -0
- /package/dist/{clojure-DwxK-YDX.js → clojure-CHjliXb8.js} +0 -0
- /package/dist/{cmake-DtnmI6Z6.js → cmake-BsKz8Gt4.js} +0 -0
- /package/dist/{cobol--wWeXL_f.js → cobol-BvWYwPFU.js} +0 -0
- /package/dist/{code-lfRPXNJI.js → code-Bwlpb4mV.js} +0 -0
- /package/dist/{codeowners-Dtwyh-5g.js → codeowners-CfTM6yvs.js} +0 -0
- /package/dist/{coffeescript-BlF7y2QG.js → coffeescript-BDiFe_B2.js} +0 -0
- /package/dist/{copy-BTFPPhff.js → copy-VpvA-5VS.js} +0 -0
- /package/dist/{corner-down-left-jxlwq3ox.js → corner-down-left-B77X84F8.js} +0 -0
- /package/dist/{cpp-D_TbJeEH.js → cpp-BfV_KWzp.js} +0 -0
- /package/dist/{crystal-lJ2ZzJQu.js → crystal-BXT0x2i3.js} +0 -0
- /package/dist/{csharp-D-5hlCJT.js → csharp-C6rkxA6x.js} +0 -0
- /package/dist/{css-Drykp8uH.js → css-Drxb2cuf.js} +0 -0
- /package/dist/{csv-oLjD_o9N.js → csv-CHKRaQ9l.js} +0 -0
- /package/dist/{cue-BBe_9OA4.js → cue-DksiF2mE.js} +0 -0
- /package/dist/{d-CPNK2-3G.js → d-C8JgmiVc.js} +0 -0
- /package/dist/{dart-BNaQZJdJ.js → dart-BX3GppmW.js} +0 -0
- /package/dist/{database-DRAhifbf.js → database-Lmva5T5u.js} +0 -0
- /package/dist/{diff-D_vIvULL.js → diff-C61xHcnV.js} +0 -0
- /package/dist/{docker-BgJkkqCD.js → docker-Dws0Euuu.js} +0 -0
- /package/dist/{download-Bk2mYZyf.js → download-BB76SD0m.js} +0 -0
- /package/dist/{elixir-CTx5aScS.js → elixir-CtaCeLkf.js} +0 -0
- /package/dist/{elm-nHy9iRuu.js → elm-CFvSvo-7.js} +0 -0
- /package/dist/{en-US-K7SXR3gy.js → en-US-Cw-sFSiZ.js} +0 -0
- /package/dist/{env-CrWzDcwP.js → env-BwMmmmE5.js} +0 -0
- /package/dist/{erlang-CxR4-Qdt.js → erlang-DJRbvPSq.js} +0 -0
- /package/dist/{eye-DpAj1af-.js → eye-VjweBQoW.js} +0 -0
- /package/dist/{flip-horizontal-CEf7aAdM.js → flip-horizontal-D4IxaKDu.js} +0 -0
- /package/dist/{fortran-DhUZYzo3.js → fortran-D3Vf5GTV.js} +0 -0
- /package/dist/{fsharp-DyIvnsyH.js → fsharp-C2iQH5b1.js} +0 -0
- /package/dist/{git-D4qjCZtd.js → git-DN4z97-P.js} +0 -0
- /package/dist/{gleam-D-ovCBt_.js → gleam-PhX3VC_5.js} +0 -0
- /package/dist/{go-CEH2y3pJ.js → go-xPznl0oK.js} +0 -0
- /package/dist/{graphql-DbV-8_AJ.js → graphql-sVzb1_rA.js} +0 -0
- /package/dist/{groovy-B-_VVp4c.js → groovy-Bvkrc3eE.js} +0 -0
- /package/dist/{haml-Cnm_v56B.js → haml-Y_qa35Lk.js} +0 -0
- /package/dist/{handlebars-8EEQS0El.js → handlebars-Bo6cxn4k.js} +0 -0
- /package/dist/{haskell-cLvKQFrd.js → haskell-D8t1pxAr.js} +0 -0
- /package/dist/{haxe-DtCGwrr1.js → haxe-C-sdXVB9.js} +0 -0
- /package/dist/{html-DFU0myJP.js → html-D7bGx0Cz.js} +0 -0
- /package/dist/{html-C2NHp3i4.js → html-I3JKB_2G.js} +0 -0
- /package/dist/{http-DYO1Ugj7.js → http-Dj2NVTPO.js} +0 -0
- /package/dist/{image-DDiNDOKJ.js → image-DzKVFSaY.js} +0 -0
- /package/dist/{inline-code-Bqu84Yyu.js → inline-code-BZNE1ALQ.js} +0 -0
- /package/dist/{java-it6UCC5M.js → java-BulcCUaV.js} +0 -0
- /package/dist/{javascript-DVxfoa-a.js → javascript-DQlby440.js} +0 -0
- /package/dist/{jinja-CUKX2CXM.js → jinja-HRQZM5oZ.js} +0 -0
- /package/dist/{json-O68iFOiu.js → json-wUPUX2x-.js} +0 -0
- /package/dist/{julia-Dq3BwHeZ.js → julia-DjHYSWzj.js} +0 -0
- /package/dist/{kdl-CFVZba8u.js → kdl-CGLuct22.js} +0 -0
- /package/dist/{kotlin-BKhxhG0q.js → kotlin-CnR9eg7m.js} +0 -0
- /package/dist/{latex-B3hQqfJO.js → latex-CesDKd8G.js} +0 -0
- /package/dist/{less-Bw2JZJkw.js → less-215r2nUv.js} +0 -0
- /package/dist/{link-DCaSecEI.js → link-4JB1WqYS.js} +0 -0
- /package/dist/{liquid-BsGDMxjJ.js → liquid-FFTnvZwx.js} +0 -0
- /package/dist/{lisp-CnrazyOe.js → lisp-BNWIo3S3.js} +0 -0
- /package/dist/{log-BuRjhdbZ.js → log-C3BhnPjM.js} +0 -0
- /package/dist/{lua-CA97s0xX.js → lua-jBHQD7Fh.js} +0 -0
- /package/dist/{luau-hq6gk9_N.js → luau-CJKAqC3L.js} +0 -0
- /package/dist/{makefile-mNhrnPWo.js → makefile-DZmoFYpF.js} +0 -0
- /package/dist/{markdown-El6B7b99.js → markdown-BEABBw2C.js} +0 -0
- /package/dist/{marko-8nTOMumd.js → marko-DE7d51Q2.js} +0 -0
- /package/dist/{matlab-DuqengFv.js → matlab-n99nEoGl.js} +0 -0
- /package/dist/{maximize-B1-N6kOL.js → maximize-VRncBaHe.js} +0 -0
- /package/dist/{mermaid-Byu8TsQE.js → mermaid-Dv9_1JlU.js} +0 -0
- /package/dist/{minimize-CVVLdf2H.js → minimize-k8aU78V4.js} +0 -0
- /package/dist/{nextflow-DRCOPmGT.js → nextflow-DjdDVx1j.js} +0 -0
- /package/dist/{nginx-DTgW--wm.js → nginx-DH4jOOdC.js} +0 -0
- /package/dist/{nim-r-ftp-xj.js → nim-Cb0hPGv5.js} +0 -0
- /package/dist/{nix-BdWPBS1Z.js → nix-Bf4Vwv5v.js} +0 -0
- /package/dist/{ocaml-vXi6ujuu.js → ocaml-BwJ1z9S7.js} +0 -0
- /package/dist/{perl-C_g5vs30.js → perl-P6bAYvN9.js} +0 -0
- /package/dist/{php-C_b0sjdl.js → php-BGTGPBW1.js} +0 -0
- /package/dist/{postcss-Bsz3PPjI.js → postcss-D8a2Jx1D.js} +0 -0
- /package/dist/{powershell-D0kxdwKl.js → powershell-DNOnus4K.js} +0 -0
- /package/dist/{prisma-BocqbK7a.js → prisma-DquVk_GR.js} +0 -0
- /package/dist/{prolog-D-zd1rzT.js → prolog-BxJJGnOg.js} +0 -0
- /package/dist/{properties-Dds-063G.js → properties-DjauSeDE.js} +0 -0
- /package/dist/{proto-CzD9trm_.js → proto-3aU1SxxY.js} +0 -0
- /package/dist/{pug-B1V2RxQS.js → pug-OiYFRnMd.js} +0 -0
- /package/dist/{puppet-BcnVd0q5.js → puppet-8Sq4QIbE.js} +0 -0
- /package/dist/{python-BcZnB7mH.js → python-CBYVyhMm.js} +0 -0
- /package/dist/{r-CxSFFuvL.js → r-DfzMNaiK.js} +0 -0
- /package/dist/{racket-DJ_82PRG.js → racket-EkEmTJtD.js} +0 -0
- /package/dist/{razor-D7IkXHVQ.js → razor-BSd-q379.js} +0 -0
- /package/dist/{rotate-ccw-square-5sO65BY9.js → rotate-ccw-square-Dy0doneR.js} +0 -0
- /package/dist/{ruby-Cidk52Rl.js → ruby-CNn-W_DF.js} +0 -0
- /package/dist/{rust-DJvcpkbm.js → rust-BW9y4Ksf.js} +0 -0
- /package/dist/{sass-DTFDeixE.js → sass-Cyleqehh.js} +0 -0
- /package/dist/{scala-GlHhGi5O.js → scala-2YqaI_aG.js} +0 -0
- /package/dist/{scheme-rNcj5mL9.js → scheme-CWx6sQlk.js} +0 -0
- /package/dist/{shader-Df9eByRK.js → shader-CLzSKNOz.js} +0 -0
- /package/dist/{solidity-CfuYjRuT.js → solidity-CgjJUETv.js} +0 -0
- /package/dist/{spin-D4Oi_m7j.js → spin-DzERwGWy.js} +0 -0
- /package/dist/{stata-BB5c_hbh.js → stata-CI3W9UFN.js} +0 -0
- /package/dist/{svelte-2ISqxu6B.js → svelte-D-OV6frL.js} +0 -0
- /package/dist/{swift-wpybyudn.js → swift-CcBwS4X5.js} +0 -0
- /package/dist/{table-iNA4la0w.js → table-BMlD4JhL.js} +0 -0
- /package/dist/{terraform-CLzhaCaX.js → terraform-BwM_GPTy.js} +0 -0
- /package/dist/{text-DoY1TIw3.js → text-DP2IAZrc.js} +0 -0
- /package/dist/{text-C0mKr3tC.js → text-hIzRUiKs.js} +0 -0
- /package/dist/{thematic-break-DXDZ5dcO.js → thematic-break-DIO-A8eY.js} +0 -0
- /package/dist/{toml-DImd1uev.js → toml-CXJ7B-C1.js} +0 -0
- /package/dist/{twig-DEBVmtOq.js → twig-CXQNsdEx.js} +0 -0
- /package/dist/{typescript-Xo5tgeOd.js → typescript-0uiFYOof.js} +0 -0
- /package/dist/{typst-_Ui0vNYP.js → typst-gIi5b52E.js} +0 -0
- /package/dist/{v-Ch6vEAHG.js → v-Ct-HfSu0.js} +0 -0
- /package/dist/{vala-Ds_Ad1cC.js → vala-BZbAZj2w.js} +0 -0
- /package/dist/{verilog-CUqRomTC.js → verilog-NzFyyNP_.js} +0 -0
- /package/dist/{vim-BFUPh6oM.js → vim-CN-tRagW.js} +0 -0
- /package/dist/{vue-DzgIlbJ2.js → vue-BmLzKAao.js} +0 -0
- /package/dist/{xml-CmbQxaqc.js → xml-CBzkooc-.js} +0 -0
- /package/dist/{yaml-BhwCoLnZ.js → yaml-CT7I_lPM.js} +0 -0
- /package/dist/{zh-CN-CykTNqF_.js → zh-CN-B9lWRP8O.js} +0 -0
- /package/dist/{zig-Bmrmp8vo.js → zig-B7F-QzJD.js} +0 -0
- /package/dist/{zoomIn-CCKcyIEv.js → zoomIn-DlPeXZbT.js} +0 -0
- /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-
|
|
2
|
-
import { t as node_list_default } from "./node-list
|
|
1
|
+
import "./composables-CL-BX9Ri.js";
|
|
2
|
+
import { t as node_list_default } from "./node-list-3yGs9Kcx.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-
|
|
2
|
-
import {
|
|
1
|
+
import { t as tooltip_default } from "./tooltip-DkCGsj0S.js";
|
|
2
|
+
import { t as icon_default } from "./icon-MRs2P5TP.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
|
|
152
|
-
|
|
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:
|
|
162
|
-
style:
|
|
171
|
+
class: __props.buttonClass,
|
|
172
|
+
style: __props.buttonStyle,
|
|
163
173
|
onClick
|
|
164
|
-
}, [(
|
|
174
|
+
}), [createVNode(unref(ReuseTemplate))], 16)]),
|
|
165
175
|
_: 1
|
|
166
|
-
},
|
|
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:
|
|
175
|
-
style:
|
|
183
|
+
class: __props.buttonClass,
|
|
184
|
+
style: __props.buttonStyle,
|
|
176
185
|
onClick
|
|
177
|
-
}, [(
|
|
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
|
-
}, [(
|
|
197
|
+
}, [createVNode(unref(ReuseTemplate)), createTextVNode(" " + toDisplayString(__props.name), 1)], 6)]),
|
|
190
198
|
_: 1
|
|
191
|
-
},
|
|
199
|
+
}, 16, ["title", "options"]))], 64);
|
|
192
200
|
};
|
|
193
201
|
}
|
|
194
202
|
});
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import "./previewers-
|
|
2
|
-
import { r as useShiki } from "./composables-
|
|
3
|
-
import "./tooltip-
|
|
4
|
-
import "./button-
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import "./
|
|
1
|
+
import "./previewers-BUz7EQbB.js";
|
|
2
|
+
import { r as useShiki } from "./composables-CL-BX9Ri.js";
|
|
3
|
+
import "./tooltip-DkCGsj0S.js";
|
|
4
|
+
import "./button-CRnH8Rzt.js";
|
|
5
|
+
import "./icon-MRs2P5TP.js";
|
|
6
|
+
import "./modal-vHG2jmSe.js";
|
|
7
|
+
import { t as code_block_default } from "./code-block-mylXl6jG.js";
|
|
8
|
+
import "./segmented-ChmGPy3i.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-
|
|
78
|
-
shiki: defineAsyncComponent(() => import("./shiki-
|
|
78
|
+
vanilla: defineAsyncComponent(() => import("./vanilla-79xxpygI.js")),
|
|
79
|
+
shiki: defineAsyncComponent(() => import("./shiki-Dp1kiUyz.js"))
|
|
79
80
|
};
|
|
80
81
|
const component = computed(() => {
|
|
81
82
|
if (hasShiki.value) return components.shiki;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "./previewers-BUz7EQbB.js";
|
|
2
|
+
import "./composables-CL-BX9Ri.js";
|
|
3
|
+
import "./tooltip-DkCGsj0S.js";
|
|
4
|
+
import "./button-CRnH8Rzt.js";
|
|
5
|
+
import "./icon-MRs2P5TP.js";
|
|
6
|
+
import "./modal-vHG2jmSe.js";
|
|
7
|
+
import { t as code_block_default } from "./code-block-mylXl6jG.js";
|
|
8
|
+
import "./segmented-ChmGPy3i.js";
|
|
9
|
+
|
|
10
|
+
export { code_block_default as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as CODE_PREVIEWERS } from "./previewers-
|
|
2
|
-
import {
|
|
3
|
-
import { t as button_default } from "./button-
|
|
4
|
-
import { t as modal_default } from "./modal-
|
|
5
|
-
import { t as segmented_default } from "./segmented-
|
|
1
|
+
import { t as CODE_PREVIEWERS } from "./previewers-BUz7EQbB.js";
|
|
2
|
+
import { G as useControls, K as useContext, V as save, b as useI18n, d as LANGUAGE_ALIAS, f as LANGUAGE_EXTENSIONS, m as useMermaid, p as LANGUAGE_ICONS, q as useCodeOptions } from "./composables-CL-BX9Ri.js";
|
|
3
|
+
import { t as button_default } from "./button-CRnH8Rzt.js";
|
|
4
|
+
import { t as modal_default } from "./modal-vHG2jmSe.js";
|
|
5
|
+
import { t as segmented_default } from "./segmented-ChmGPy3i.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, (
|
|
21
|
-
return openBlock(), createBlock(button_default, {
|
|
22
|
-
key:
|
|
23
|
-
|
|
24
|
-
|
|
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:
|
|
100
|
+
icon: "preview"
|
|
112
101
|
}, {
|
|
113
102
|
label: t("button.source"),
|
|
114
103
|
value: "source",
|
|
115
|
-
icon:
|
|
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-
|
|
187
|
+
const CodeNode = defineAsyncComponent(() => import("./code-BcAa_-2j.js"));
|
|
199
188
|
const { controls, previewers, codeOptions } = toRefs(props);
|
|
200
189
|
const [DefineTemplate, ReuseTemplate] = createReusableTemplate();
|
|
201
190
|
const { t } = useI18n();
|
|
202
|
-
const {
|
|
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
|
-
|
|
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
|
|
243
|
+
if (data === false) return previewer;
|
|
255
244
|
if (data && typeof data !== "boolean") return data;
|
|
256
|
-
return
|
|
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
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
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
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
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
|
-
|
|
334
|
-
|
|
335
|
-
|
|
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:
|
|
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:
|
|
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"])
|