vue-stream-markdown 0.1.4 → 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.
- package/README.md +3 -1
- package/dist/arrow-left-C5s0Sn8o.js +25 -0
- package/dist/{blockquote-DdEg2gww.js → blockquote-bkADuiGm.js} +1 -9
- package/dist/{button-jFTF378X.js → button-BQhuT7wh.js} +2 -3
- package/dist/button-JYC8d-B-.js +5 -0
- package/dist/{code-BxWvKFxG.js → code-DF8PTNol.js} +10 -18
- package/dist/code-block-BhMDz2ZL.js +9 -0
- package/dist/{code-block-uZcUI59D.js → code-block-Dm2wl0cb.js} +60 -65
- package/dist/{composables-Cx0nvyHl.js → composables-yny5gJo3.js} +495 -227
- package/dist/{delete-BdWzKJCy.js → delete-D17YBeI-.js} +1 -9
- package/dist/dropdown-Y5_Z4a_u.js +5 -0
- package/dist/{emphasis-CTuGt1Ok.js → emphasis-B-2R_0Q5.js} +1 -9
- package/dist/{en-US-Bfc50l3I.js → en-US-Kw2LYAMk.js} +7 -1
- package/dist/{error-component-Bhl770lu.js → error-component-Bb0gIZsx.js} +1 -1
- package/dist/error-component-DEIWb6kB.js +4 -0
- package/dist/flip-horizontal-BFWjqDbQ.js +25 -0
- package/dist/{heading-2vpQQtTH.js → heading-DyJIwNrN.js} +1 -9
- package/dist/{html-DL0PcUXX.js → html-DXNqMvt_.js} +0 -8
- package/dist/{image-BDtPwitR.js → image-BPhFn1xp.js} +38 -75
- package/dist/image-DXBD47sF.js +8 -0
- package/dist/image-DvOGBhi-.js +327 -0
- package/dist/index.css +44 -64
- package/dist/index.d.ts +115 -70
- package/dist/index.js +42 -61
- package/dist/{inline-code-CBoqhfz7.js → inline-code-C44UJ2TH.js} +0 -8
- package/dist/{inline-math-CAqboT7h.js → inline-math-wO1rMt9T.js} +2 -10
- package/dist/{link-C8BSlPhZ.js → link-sGo7CEll.js} +3 -11
- package/dist/{list-BCiFKGaz.js → list-C0I1ysSI.js} +1 -9
- package/dist/{list-item-p-OLUR_9.js → list-item-BoC2wKBL.js} +1 -9
- package/dist/{math-CT1TB2pK.js → math-BlqtUf2r.js} +2 -10
- package/dist/{mermaid-CYrA8rCl.js → mermaid-Ka1jnXrR.js} +6 -14
- package/dist/modal-Duhc-vVa.js +4 -0
- package/dist/modal-Rc_RoeYA.js +94 -0
- package/dist/node-list-C1je2nLd.js +3 -0
- package/dist/{node-list-CGr_EVtn.js → node-list-YhpHXdM_.js} +0 -16
- package/dist/{paragraph-DYjqr_Sa.js → paragraph-BN-4-Dn7.js} +1 -9
- package/dist/previewers-D0VVcdjL.js +10 -0
- package/dist/rotate-ccw-square-C2KVFUF3.js +24 -0
- package/dist/{segmented-DBW9ignu.js → segmented-CaC54iz_.js} +1 -1
- package/dist/segmented-XdoLnuuq.js +6 -0
- package/dist/{shiki-bQYWLdW3.js → shiki-sJNZTn1K.js} +4 -12
- package/dist/spin-wM2KE8mO.js +3 -0
- package/dist/{strong-CvOjLZiq.js → strong-NdAS3VjP.js} +1 -9
- package/dist/{table-l_3z210v.js → table-CWX5B2i1.js} +11 -16
- package/dist/table-R9gmCXm_.js +3 -0
- package/dist/{text-DuONUqRA.js → text-DpleLvNh.js} +0 -8
- package/dist/{thematic-break-CcNPEI9Y.js → thematic-break-D5GvzU5S.js} +0 -8
- package/dist/tooltip-BJDs-A8d.js +4 -0
- package/dist/tooltip-Bgbzbk4Q.js +68 -0
- package/dist/{vanilla-CFWVwBvD.js → vanilla-BTOVqKl7.js} +1 -1
- package/dist/vanilla-DA5bwIkr.js +4 -0
- package/dist/{yaml-DJHrmzSe.js → yaml-y0snrPRx.js} +1 -9
- package/dist/{zh-CN-CL1XGe0H.js → zh-CN-Dfow4Yn2.js} +7 -1
- package/dist/{zoom-container-gjQ0EMyk.js → zoom-container-B1qbA-7z.js} +52 -23
- package/dist/zoom-container-KztuE4ri.js +6 -0
- package/package.json +9 -10
- package/dist/button-D6ccVxGm.js +0 -5
- package/dist/code-block-B72JfFy-.js +0 -9
- package/dist/dropdown-oiCw8QVq.js +0 -5
- package/dist/error-component-8y13-fYG.js +0 -4
- package/dist/modal-CuQR21UD.js +0 -71
- package/dist/modal-DcpxxDDX.js +0 -3
- package/dist/node-list-lgY1wbfQ.js +0 -3
- package/dist/previewers-ByaS2Ksa.js +0 -10
- package/dist/segmented-B4IEw3wg.js +0 -6
- package/dist/spin-Bz4zGBEo.js +0 -3
- package/dist/table-CZLbUHiJ.js +0 -3
- package/dist/tooltip-3UDC9mw-.js +0 -71
- package/dist/tooltip-CAoc_U1X.js +0 -4
- package/dist/vanilla-De7W3PpS.js +0 -4
- package/dist/zoom-container-DBgGdbJS.js +0 -6
- /package/dist/{angular-Chs-UKBr.js → angular-Mip1mspI.js} +0 -0
- /package/dist/{angular-component-Cc_FANXU.js → angular-component-Cq5UbX7R.js} +0 -0
- /package/dist/{apache-COYnc6xR.js → apache-BSq7fX32.js} +0 -0
- /package/dist/{asciidoc-BabXBDAL.js → asciidoc-DS-PMOLv.js} +0 -0
- /package/dist/{assembly-CDqKhexW.js → assembly-BPatlOM7.js} +0 -0
- /package/dist/{astro-C9kftzFG.js → astro-CSD_ZjXp.js} +0 -0
- /package/dist/{bash-Ce4pNIkV.js → bash-RITislE1.js} +0 -0
- /package/dist/{batch-CHQBRjFL.js → batch-DWPShYhN.js} +0 -0
- /package/dist/{bicep-8jxWtuBF.js → bicep-C6BEHfP6.js} +0 -0
- /package/dist/{c-FBUef746.js → c-DNo3tsNy.js} +0 -0
- /package/dist/{check-C4xOk8um.js → check-BfpxIITS.js} +0 -0
- /package/dist/{chevron-down-cnOJ4h1g.js → chevron-down-LeNeemjn.js} +0 -0
- /package/dist/{circle-alert-CLX-h5rZ.js → circle-alert-BjDuIzgc.js} +0 -0
- /package/dist/{clojure-BulUroSy.js → clojure-C1DEYHW0.js} +0 -0
- /package/dist/{cmake-CW3vz1Mo.js → cmake-B69mdXcH.js} +0 -0
- /package/dist/{cobol-CIn3oFju.js → cobol-qmL-zIWi.js} +0 -0
- /package/dist/{code-D8LSp8rK.js → code-D9CiymEK.js} +0 -0
- /package/dist/{codeowners-CJggXF_b.js → codeowners-Crklt5nF.js} +0 -0
- /package/dist/{coffeescript-CBrVvzGY.js → coffeescript-k3huSp23.js} +0 -0
- /package/dist/{copy-Cabve0xf.js → copy-C4580J93.js} +0 -0
- /package/dist/{cpp-BTKeuyd-.js → cpp-Cn3MB35e.js} +0 -0
- /package/dist/{crystal-DyIYvZbm.js → crystal-D5aGETSx.js} +0 -0
- /package/dist/{csharp-NqZ1vyF9.js → csharp-CgkTkbPx.js} +0 -0
- /package/dist/{css-BpR5Lajb.js → css-DRH4n_IV.js} +0 -0
- /package/dist/{csv-eCMFnKKK.js → csv-D5nNTIzO.js} +0 -0
- /package/dist/{cue-TY97dGOQ.js → cue-B5mC88-N.js} +0 -0
- /package/dist/{d-NftUsdTd.js → d-BdQRMgma.js} +0 -0
- /package/dist/{dart-DJpwZZbk.js → dart-BGnfn0NN.js} +0 -0
- /package/dist/{database-aZwE71Px.js → database-Ca1VGX7u.js} +0 -0
- /package/dist/{diff-CYRzypaU.js → diff-DVaTsnqu.js} +0 -0
- /package/dist/{docker-CxHBuukH.js → docker-E47qYlmL.js} +0 -0
- /package/dist/{download-Bnn7rtYw.js → download-DytrK56a.js} +0 -0
- /package/dist/{elixir-BKSxVc1h.js → elixir-C-jqqu6q.js} +0 -0
- /package/dist/{elm-DScuAf3X.js → elm-CmeHvaWl.js} +0 -0
- /package/dist/{env-CDAKsodl.js → env-Ck1BHoxR.js} +0 -0
- /package/dist/{erlang-D2M1ZL3m.js → erlang-CIP8kpGJ.js} +0 -0
- /package/dist/{eye-CdeX8PhP.js → eye-TaEwQS2Z.js} +0 -0
- /package/dist/{fortran-CORyQ0wt.js → fortran-DJVP2s7V.js} +0 -0
- /package/dist/{fsharp-BJz_Jgpl.js → fsharp-Bp6mUcG0.js} +0 -0
- /package/dist/{git-DgrlTr1E.js → git-BDcqJ1Gp.js} +0 -0
- /package/dist/{gleam-t_xad9Kw.js → gleam-JLiZVlev.js} +0 -0
- /package/dist/{go-Cvlh1xtL.js → go-ClcCiS7e.js} +0 -0
- /package/dist/{graphql-ApIm0mDD.js → graphql-D2RDo-DF.js} +0 -0
- /package/dist/{groovy-CaLnK8PV.js → groovy-DLZBw8xE.js} +0 -0
- /package/dist/{haml-MwijEO_6.js → haml-Da74jRwZ.js} +0 -0
- /package/dist/{handlebars-CKdUPI9h.js → handlebars-CNgS57Sz.js} +0 -0
- /package/dist/{haskell-NPOXEnck.js → haskell-DCvfD6VB.js} +0 -0
- /package/dist/{haxe-DyKBMsDE.js → haxe-CHVK1TId.js} +0 -0
- /package/dist/{html-CMgES1dE.js → html-Du4235Z-.js} +0 -0
- /package/dist/{http-B9FFNmUr.js → http-B8VAFeQ5.js} +0 -0
- /package/dist/{image-CMZAakWu.js → image-D8MZj4W5.js} +0 -0
- /package/dist/{java-iU-L9wJz.js → java-CoSdnK1N.js} +0 -0
- /package/dist/{javascript-DtnWdTFC.js → javascript-BCDeVll0.js} +0 -0
- /package/dist/{jinja-CoWszo_D.js → jinja-DYbiqZy0.js} +0 -0
- /package/dist/{json-C80qKCnh.js → json-CdzCyWJA.js} +0 -0
- /package/dist/{julia-DG2BCBLx.js → julia-pswJGtpP.js} +0 -0
- /package/dist/{kdl-7twRfIlJ.js → kdl-M8rfQ85l.js} +0 -0
- /package/dist/{kotlin-BjrOgP7R.js → kotlin-CfCV33oB.js} +0 -0
- /package/dist/{latex-DIQfUvG8.js → latex-DK8DFhTm.js} +0 -0
- /package/dist/{less-BJ1yEAWt.js → less-BFnNZiIs.js} +0 -0
- /package/dist/{link-DeV4CQOB.js → link-C7eU_yi-.js} +0 -0
- /package/dist/{liquid-BqKFZ1wQ.js → liquid-C8h46DoX.js} +0 -0
- /package/dist/{lisp-oekhB2ti.js → lisp-C3FbGuD1.js} +0 -0
- /package/dist/{log-D1XEqR9q.js → log-D-O3FXf2.js} +0 -0
- /package/dist/{lua-C5Q97-1D.js → lua-BC_aR1_i.js} +0 -0
- /package/dist/{luau-BT8KwqZ2.js → luau-DFUOrNN7.js} +0 -0
- /package/dist/{makefile-B4a0ciG4.js → makefile-Ck67veVV.js} +0 -0
- /package/dist/{markdown-DvNyKsiJ.js → markdown-BX13X3kd.js} +0 -0
- /package/dist/{marko-BzsIf6bg.js → marko-CQE8YTCc.js} +0 -0
- /package/dist/{matlab-cMBkmDhQ.js → matlab-Bd9O2Ml3.js} +0 -0
- /package/dist/{maximize-4PIqBONS.js → maximize-CDZ9rnYF.js} +0 -0
- /package/dist/{mermaid-8JIH2gkQ.js → mermaid-Dv-Pr0W-.js} +0 -0
- /package/dist/{minimize-BJ8htyDF.js → minimize-B9ER7p2X.js} +0 -0
- /package/dist/{nextflow-DNmqU1xg.js → nextflow-D3lDq1Yi.js} +0 -0
- /package/dist/{nginx-DDfYF_rj.js → nginx-CgsqCL4l.js} +0 -0
- /package/dist/{nim-D9xEmy4k.js → nim-BJdSu3c6.js} +0 -0
- /package/dist/{nix-BV1Deshw.js → nix-B7K_D6CN.js} +0 -0
- /package/dist/{ocaml-BkFn4LL3.js → ocaml-gYS1Y45s.js} +0 -0
- /package/dist/{perl-BytUHDE7.js → perl-DXFhFWhI.js} +0 -0
- /package/dist/{php-BImJJtNM.js → php-We35bF4E.js} +0 -0
- /package/dist/{postcss-CrZ9_0sT.js → postcss-BWovY_YV.js} +0 -0
- /package/dist/{powershell-DYSGu7TM.js → powershell-C6teiBsq.js} +0 -0
- /package/dist/{prisma-BhRvcOFY.js → prisma-UyJEg0_X.js} +0 -0
- /package/dist/{prolog-DuaCKek_.js → prolog-YZsPgdnw.js} +0 -0
- /package/dist/{properties-BbIJwuP-.js → properties-DaPbL0e2.js} +0 -0
- /package/dist/{proto-CE0aVW11.js → proto-1LIwu2O1.js} +0 -0
- /package/dist/{pug-B1-IC-Tc.js → pug-CzkUK-Ec.js} +0 -0
- /package/dist/{puppet-8nYquiMG.js → puppet-CNhB1MHb.js} +0 -0
- /package/dist/{python-DhRyfBrD.js → python-B_hgEobv.js} +0 -0
- /package/dist/{r-Cjje17IA.js → r-CVeKYmPK.js} +0 -0
- /package/dist/{racket-Dx0gMnpg.js → racket-D5UfvXuw.js} +0 -0
- /package/dist/{razor-DPht_bdD.js → razor-RIKaANTN.js} +0 -0
- /package/dist/{ruby-B8RxtCzI.js → ruby-C8wV0pMO.js} +0 -0
- /package/dist/{rust-Cjtli6yf.js → rust-75Gei1mP.js} +0 -0
- /package/dist/{sass-Dv3DMzjs.js → sass-Cq68xmQ4.js} +0 -0
- /package/dist/{scala-B7bZGKXq.js → scala-C_E5rjSc.js} +0 -0
- /package/dist/{scheme-B2PsEdVN.js → scheme-Bm-q-nLL.js} +0 -0
- /package/dist/{shader-BZzu3zGr.js → shader-DPaRkMCs.js} +0 -0
- /package/dist/{shiki-token-renderer-D164wC7Y.js → shiki-token-renderer-CLmUjKa3.js} +0 -0
- /package/dist/{solidity-CLieFYpL.js → solidity-DvHG_0CD.js} +0 -0
- /package/dist/{spin-Ds5W7qC_.js → spin--f5jNjBn.js} +0 -0
- /package/dist/{stata-C0yUiO47.js → stata-DoVloJLm.js} +0 -0
- /package/dist/{svelte-rtF4yNGL.js → svelte-tlbA11de.js} +0 -0
- /package/dist/{swift-CzvYoIM0.js → swift-BZn5eRnK.js} +0 -0
- /package/dist/{table-4ec9FVB_.js → table-CaUMjs4M.js} +0 -0
- /package/dist/{terraform-CD_BZGb-.js → terraform-c5-k7yB1.js} +0 -0
- /package/dist/{text-D1-vbZ7l.js → text-DPCGWvDK.js} +0 -0
- /package/dist/{toml-C6jUF0Xd.js → toml-DdLGBe1A.js} +0 -0
- /package/dist/{twig-C4dfP84J.js → twig-D_jzZxh6.js} +0 -0
- /package/dist/{typescript-Bk-pp-cK.js → typescript-B95hq2ns.js} +0 -0
- /package/dist/{typst-DPCpaVSH.js → typst-CSAEQ4yK.js} +0 -0
- /package/dist/{v-nRGMJ2Ki.js → v-BAhebuOB.js} +0 -0
- /package/dist/{vala-B78bKcY0.js → vala-RAu83-lp.js} +0 -0
- /package/dist/{verilog-CRpkl76S.js → verilog-BgmTn52U.js} +0 -0
- /package/dist/{vim-DpKnut7b.js → vim-c8oTCLkH.js} +0 -0
- /package/dist/{vue-D5eadhjo.js → vue-TGT6HTBA.js} +0 -0
- /package/dist/{xml-Dvx5F-hl.js → xml-C1HDr874.js} +0 -0
- /package/dist/{yaml-n1S8nAOh.js → yaml-BO7FjFQZ.js} +0 -0
- /package/dist/{zig-R-iFzxfW.js → zig-qANBp1SU.js} +0 -0
- /package/dist/{zoomIn-CEukuh3x.js → zoomIn-iVMAUxIz.js} +0 -0
- /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-
|
|
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-
|
|
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) => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "./previewers-
|
|
2
|
-
import {
|
|
3
|
-
import "./tooltip-
|
|
4
|
-
import "./button-
|
|
5
|
-
import "./modal-
|
|
6
|
-
import { t as code_block_default } from "./code-block-
|
|
7
|
-
import "./segmented-
|
|
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-
|
|
86
|
-
shiki: defineAsyncComponent(() => import("./shiki-
|
|
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-
|
|
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-
|
|
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" };
|
|
@@ -132,12 +132,10 @@ var preview_segmented_default = preview_segmented_vue_vue_type_script_setup_true
|
|
|
132
132
|
|
|
133
133
|
//#endregion
|
|
134
134
|
//#region src/components/code-block/index.vue?vue&type=script&setup=true&lang.ts
|
|
135
|
-
const _hoisted_1 =
|
|
136
|
-
const _hoisted_2 =
|
|
137
|
-
const _hoisted_3 = {
|
|
135
|
+
const _hoisted_1 = { key: 2 };
|
|
136
|
+
const _hoisted_2 = ["data-collapsed"];
|
|
137
|
+
const _hoisted_3 = { "data-stream-markdown": "code-block-header" };
|
|
138
138
|
const _hoisted_4 = { key: 1 };
|
|
139
|
-
const _hoisted_5 = { "data-stream-markdown": "code-block-content" };
|
|
140
|
-
const _hoisted_6 = { key: 2 };
|
|
141
139
|
var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
142
140
|
inheritAttrs: false,
|
|
143
141
|
__name: "index",
|
|
@@ -154,18 +152,10 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
154
152
|
type: Object,
|
|
155
153
|
required: true
|
|
156
154
|
},
|
|
157
|
-
mediumZoom: {
|
|
158
|
-
type: Object,
|
|
159
|
-
required: true
|
|
160
|
-
},
|
|
161
155
|
indexKey: {
|
|
162
156
|
type: [Number, String],
|
|
163
157
|
required: true
|
|
164
158
|
},
|
|
165
|
-
getContainer: {
|
|
166
|
-
type: Function,
|
|
167
|
-
required: true
|
|
168
|
-
},
|
|
169
159
|
controls: {
|
|
170
160
|
type: [Boolean, Object],
|
|
171
161
|
required: false
|
|
@@ -205,12 +195,13 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
205
195
|
},
|
|
206
196
|
setup(__props) {
|
|
207
197
|
const props = __props;
|
|
198
|
+
const CodeNode = defineAsyncComponent(() => import("./code-DF8PTNol.js"));
|
|
208
199
|
const { controls, previewers, codeOptions } = toRefs(props);
|
|
200
|
+
const [DefineTemplate, ReuseTemplate] = createReusableTemplate();
|
|
209
201
|
const { t } = useI18n();
|
|
210
202
|
const { icons } = useContext();
|
|
211
203
|
const { isControlEnabled } = useControls({ controls });
|
|
212
204
|
const { installed: hasMermaid } = useMermaid();
|
|
213
|
-
const CodeNode = defineAsyncComponent(() => import("./code-BxWvKFxG.js"));
|
|
214
205
|
const { onCopied } = useContext();
|
|
215
206
|
const { copy, copied } = useClipboard({ legacy: true });
|
|
216
207
|
const { saveMermaid } = useMermaid();
|
|
@@ -264,6 +255,17 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
264
255
|
if (data && typeof data !== "boolean") return data;
|
|
265
256
|
return CODE_PREVIEWERS[language.value];
|
|
266
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
|
+
});
|
|
267
269
|
const downloadOptions = computed(() => {
|
|
268
270
|
if (language.value !== "mermaid" || !hasMermaid.value) return [];
|
|
269
271
|
return [
|
|
@@ -335,7 +337,27 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
335
337
|
if (previewable.value) mode.value = "preview";
|
|
336
338
|
}, { immediate: true });
|
|
337
339
|
return (_ctx, _cache) => {
|
|
338
|
-
return openBlock(), createElementBlock(
|
|
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", {
|
|
339
361
|
"data-stream-markdown": "code-block",
|
|
340
362
|
"data-collapsed": collapsed.value,
|
|
341
363
|
class: normalizeClass({
|
|
@@ -343,25 +365,8 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
343
365
|
"dark": props.isDark
|
|
344
366
|
})
|
|
345
367
|
}, [
|
|
346
|
-
createElementVNode("header",
|
|
347
|
-
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
348
|
-
key: 0,
|
|
349
|
-
icon: icon.value,
|
|
350
|
-
language: language.value,
|
|
351
|
-
"show-icon": unref(showLanguageIcon),
|
|
352
|
-
"show-name": unref(showLanguageName)
|
|
353
|
-
}, null, 8, [
|
|
354
|
-
"icon",
|
|
355
|
-
"language",
|
|
356
|
-
"show-icon",
|
|
357
|
-
"show-name"
|
|
358
|
-
])) : previewable.value ? (openBlock(), createBlock(preview_segmented_default, {
|
|
359
|
-
key: 1,
|
|
360
|
-
mode: mode.value,
|
|
361
|
-
"onUpdate:mode": _cache[0] || (_cache[0] = ($event) => mode.value = $event),
|
|
362
|
-
collapsed: collapsed.value,
|
|
363
|
-
"onUpdate:collapsed": _cache[1] || (_cache[1] = ($event) => collapsed.value = $event)
|
|
364
|
-
}, null, 8, ["mode", "collapsed"])) : (openBlock(), createElementBlock("div", _hoisted_3))]),
|
|
368
|
+
createElementVNode("header", _hoisted_3, [
|
|
369
|
+
renderSlot(_ctx.$slots, "title", {}, () => [createVNode(unref(ReuseTemplate))]),
|
|
365
370
|
renderSlot(_ctx.$slots, "header-center", {}, () => [previewable.value && showLanguageTitle.value ? (openBlock(), createBlock(preview_segmented_default, {
|
|
366
371
|
key: 0,
|
|
367
372
|
mode: mode.value,
|
|
@@ -371,42 +376,32 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
371
376
|
}, null, 8, ["mode", "collapsed"])) : (openBlock(), createElementBlock("div", _hoisted_4))]),
|
|
372
377
|
renderSlot(_ctx.$slots, "actions", {}, () => [createVNode(actions_default, { actions: actions.value }, null, 8, ["actions"])])
|
|
373
378
|
]),
|
|
374
|
-
withDirectives(createElementVNode("main",
|
|
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]]),
|
|
375
383
|
createVNode(modal_default, {
|
|
376
384
|
open: fullscreen.value,
|
|
377
|
-
"onUpdate:open": _cache[
|
|
378
|
-
"
|
|
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
|
+
}
|
|
379
391
|
}, {
|
|
380
|
-
title: withCtx(() => [
|
|
392
|
+
title: withCtx(() => [createVNode(unref(ReuseTemplate))]),
|
|
393
|
+
"header-center": withCtx(() => [previewable.value && showLanguageTitle.value ? (openBlock(), createBlock(preview_segmented_default, {
|
|
381
394
|
key: 0,
|
|
382
|
-
icon: icon.value,
|
|
383
|
-
language: language.value,
|
|
384
|
-
"show-icon": unref(showLanguageIcon),
|
|
385
|
-
"show-name": unref(showLanguageName)
|
|
386
|
-
}, null, 8, [
|
|
387
|
-
"icon",
|
|
388
|
-
"language",
|
|
389
|
-
"show-icon",
|
|
390
|
-
"show-name"
|
|
391
|
-
])) : previewable.value ? (openBlock(), createBlock(preview_segmented_default, {
|
|
392
|
-
key: 1,
|
|
393
395
|
mode: mode.value,
|
|
394
396
|
"onUpdate:mode": _cache[4] || (_cache[4] = ($event) => mode.value = $event),
|
|
395
397
|
collapsed: collapsed.value,
|
|
396
398
|
"onUpdate:collapsed": _cache[5] || (_cache[5] = ($event) => collapsed.value = $event)
|
|
397
|
-
}, null, 8, ["mode", "collapsed"])) : (openBlock(), createElementBlock("div", _hoisted_6))]),
|
|
398
|
-
"header-center": withCtx(() => [previewable.value && showLanguageTitle.value ? (openBlock(), createBlock(preview_segmented_default, {
|
|
399
|
-
key: 0,
|
|
400
|
-
mode: mode.value,
|
|
401
|
-
"onUpdate:mode": _cache[6] || (_cache[6] = ($event) => mode.value = $event),
|
|
402
|
-
collapsed: collapsed.value,
|
|
403
|
-
"onUpdate:collapsed": _cache[7] || (_cache[7] = ($event) => collapsed.value = $event)
|
|
404
399
|
}, null, 8, ["mode", "collapsed"])) : createCommentVNode("v-if", true)]),
|
|
405
400
|
actions: withCtx(() => [createVNode(actions_default, { actions: ModalActions.value }, null, 8, ["actions"])]),
|
|
406
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"]])]),
|
|
407
402
|
_: 1
|
|
408
|
-
}, 8, ["open"
|
|
409
|
-
], 10,
|
|
403
|
+
}, 8, ["open"])
|
|
404
|
+
], 10, _hoisted_2)], 64);
|
|
410
405
|
};
|
|
411
406
|
}
|
|
412
407
|
});
|