vue-stream-markdown 0.0.0-alpha.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.
- package/LICENSE.md +21 -0
- package/README.md +96 -0
- package/dist/angular-Chs-UKBr.js +29 -0
- package/dist/angular-component-Cc_FANXU.js +29 -0
- package/dist/apache-COYnc6xR.js +35 -0
- package/dist/asciidoc-BabXBDAL.js +24 -0
- package/dist/assembly-CDqKhexW.js +35 -0
- package/dist/astro-C9kftzFG.js +28 -0
- package/dist/bash-Ce4pNIkV.js +27 -0
- package/dist/batch-CHQBRjFL.js +23 -0
- package/dist/bicep-8jxWtuBF.js +46 -0
- package/dist/blockquote-DFANmQEB.css +13 -0
- package/dist/blockquote-DdEg2gww.js +83 -0
- package/dist/button-BClRCjnc.js +5 -0
- package/dist/button-C12sn_G5.css +24 -0
- package/dist/button-D8xx1WIP.js +202 -0
- package/dist/c-FBUef746.js +25 -0
- package/dist/check-C4xOk8um.js +25 -0
- package/dist/chevron-down-cnOJ4h1g.js +25 -0
- package/dist/circle-alert-CLX-h5rZ.js +28 -0
- package/dist/clojure-BulUroSy.js +18 -0
- package/dist/cmake-CW3vz1Mo.js +35 -0
- package/dist/cobol-CIn3oFju.js +24 -0
- package/dist/code-CP6mPwkq.js +106 -0
- package/dist/code-D8LSp8rK.js +25 -0
- package/dist/code-NAXHb0o2.css +4 -0
- package/dist/code-block-C4D_QNTq.js +408 -0
- package/dist/code-block-D2zjJAww.css +57 -0
- package/dist/code-block-Dzw63Lki.js +9 -0
- package/dist/codeowners-CJggXF_b.js +27 -0
- package/dist/coffeescript-CBrVvzGY.js +23 -0
- package/dist/composables-qhB1h_ed.js +1567 -0
- package/dist/copy-Cabve0xf.js +31 -0
- package/dist/cpp-BTKeuyd-.js +31 -0
- package/dist/crystal-DyIYvZbm.js +24 -0
- package/dist/csharp-NqZ1vyF9.js +22 -0
- package/dist/css-BpR5Lajb.js +26 -0
- package/dist/csv-eCMFnKKK.js +24 -0
- package/dist/cue-TY97dGOQ.js +32 -0
- package/dist/d-NftUsdTd.js +24 -0
- package/dist/dart-DJpwZZbk.js +23 -0
- package/dist/database-aZwE71Px.js +24 -0
- package/dist/delete-BdWzKJCy.js +83 -0
- package/dist/delete-Ci7IJDoT.css +4 -0
- package/dist/diff-CYRzypaU.js +35 -0
- package/dist/docker-CxHBuukH.js +24 -0
- package/dist/download-Bnn7rtYw.js +24 -0
- package/dist/dropdown-Ca_PKF_d.js +5 -0
- package/dist/elixir-BKSxVc1h.js +24 -0
- package/dist/elm-DScuAf3X.js +24 -0
- package/dist/emphasis-BseYvUae.css +4 -0
- package/dist/emphasis-CTuGt1Ok.js +83 -0
- package/dist/en-US-Bfc50l3I.js +27 -0
- package/dist/env-CDAKsodl.js +24 -0
- package/dist/erlang-D2M1ZL3m.js +23 -0
- package/dist/error-component-BIPPxd-M.css +21 -0
- package/dist/error-component-CLEJmPmM.js +4 -0
- package/dist/error-component-CzarUjhh.js +61 -0
- package/dist/eye-CdeX8PhP.js +28 -0
- package/dist/fortran-CORyQ0wt.js +24 -0
- package/dist/fsharp-BJz_Jgpl.js +24 -0
- package/dist/git-DgrlTr1E.js +28 -0
- package/dist/gleam-t_xad9Kw.js +29 -0
- package/dist/go-Cvlh1xtL.js +24 -0
- package/dist/graphql-ApIm0mDD.js +24 -0
- package/dist/groovy-CaLnK8PV.js +23 -0
- package/dist/haml-MwijEO_6.js +35 -0
- package/dist/handlebars-CKdUPI9h.js +24 -0
- package/dist/haskell-NPOXEnck.js +24 -0
- package/dist/haxe-DyKBMsDE.js +23 -0
- package/dist/heading-2vpQQtTH.js +88 -0
- package/dist/heading-KxpVX3-u.css +30 -0
- package/dist/html-C5_wsY4-.css +5 -0
- package/dist/html-CMgES1dE.js +28 -0
- package/dist/html-DL0PcUXX.js +102 -0
- package/dist/http-B9FFNmUr.js +23 -0
- package/dist/image-B77jbMUB.css +46 -0
- package/dist/image-CMZAakWu.js +39 -0
- package/dist/image-heJSlrNv.js +215 -0
- package/dist/index.css +43 -0
- package/dist/index.d.ts +762 -0
- package/dist/index.js +18674 -0
- package/dist/inline-code-CBoqhfz7.js +81 -0
- package/dist/inline-code-Eo65bj3F.css +12 -0
- package/dist/inline-math-B4XO1wMP.js +110 -0
- package/dist/inline-math-DgBjIrPT.css +7 -0
- package/dist/java-iU-L9wJz.js +35 -0
- package/dist/javascript-DtnWdTFC.js +23 -0
- package/dist/jinja-CoWszo_D.js +24 -0
- package/dist/json-C80qKCnh.js +24 -0
- package/dist/julia-DG2BCBLx.js +35 -0
- package/dist/kdl-7twRfIlJ.js +40 -0
- package/dist/kotlin-BjrOgP7R.js +18 -0
- package/dist/latex-DIQfUvG8.js +24 -0
- package/dist/less-BJ1yEAWt.js +24 -0
- package/dist/link-BA_j8di3.css +12 -0
- package/dist/link-DOtoFtxu.js +107 -0
- package/dist/link-DeV4CQOB.js +24 -0
- package/dist/liquid-BqKFZ1wQ.js +24 -0
- package/dist/lisp-oekhB2ti.js +23 -0
- package/dist/list-BCiFKGaz.js +88 -0
- package/dist/list-CcVBNIly.css +11 -0
- package/dist/list-item-Y6Cphjrp.css +15 -0
- package/dist/list-item-p-OLUR_9.js +95 -0
- package/dist/log-D1XEqR9q.js +23 -0
- package/dist/lua-C5Q97-1D.js +28 -0
- package/dist/luau-BT8KwqZ2.js +28 -0
- package/dist/makefile-B4a0ciG4.js +28 -0
- package/dist/markdown-DvNyKsiJ.js +24 -0
- package/dist/marko-BzsIf6bg.js +18 -0
- package/dist/math-Byka28HI.js +110 -0
- package/dist/math-Cq89zpB6.css +11 -0
- package/dist/matlab-cMBkmDhQ.js +28 -0
- package/dist/maximize-4PIqBONS.js +25 -0
- package/dist/mermaid-8JIH2gkQ.js +24 -0
- package/dist/mermaid-C9ZUejzK.css +8 -0
- package/dist/mermaid-X0AFRzfF.js +203 -0
- package/dist/minimize-BJ8htyDF.js +25 -0
- package/dist/modal-CWdgVkH_.css +48 -0
- package/dist/modal-CuQR21UD.js +71 -0
- package/dist/modal-DcpxxDDX.js +3 -0
- package/dist/nextflow-DNmqU1xg.js +24 -0
- package/dist/nginx-DDfYF_rj.js +23 -0
- package/dist/nim-D9xEmy4k.js +24 -0
- package/dist/nix-BV1Deshw.js +18 -0
- package/dist/node-list-C9O-A1aZ.css +11 -0
- package/dist/node-list-CGr_EVtn.js +199 -0
- package/dist/node-list-lgY1wbfQ.js +3 -0
- package/dist/ocaml-BkFn4LL3.js +27 -0
- package/dist/paragraph-DYjqr_Sa.js +83 -0
- package/dist/paragraph-wRNmMYAI.css +6 -0
- package/dist/perl-BytUHDE7.js +24 -0
- package/dist/php-BImJJtNM.js +24 -0
- package/dist/postcss-CrZ9_0sT.js +18 -0
- package/dist/powershell-DYSGu7TM.js +23 -0
- package/dist/previewers-Drlf7IQF.js +10 -0
- package/dist/prisma-BhRvcOFY.js +24 -0
- package/dist/prolog-DuaCKek_.js +24 -0
- package/dist/properties-BbIJwuP-.js +24 -0
- package/dist/proto-CE0aVW11.js +18 -0
- package/dist/pug-B1-IC-Tc.js +24 -0
- package/dist/puppet-8nYquiMG.js +24 -0
- package/dist/python-DhRyfBrD.js +35 -0
- package/dist/r-Cjje17IA.js +28 -0
- package/dist/racket-Dx0gMnpg.js +28 -0
- package/dist/razor-DPht_bdD.js +24 -0
- package/dist/renderer-CZ41eK_V.js +43 -0
- package/dist/ruby-B8RxtCzI.js +24 -0
- package/dist/rust-Cjtli6yf.js +23 -0
- package/dist/sass-Dv3DMzjs.js +24 -0
- package/dist/scala-B7bZGKXq.js +24 -0
- package/dist/scheme-B2PsEdVN.js +24 -0
- package/dist/segmented-BEtO1eyl.js +69 -0
- package/dist/segmented-CWoQcX-H.js +6 -0
- package/dist/segmented-DLmggl-e.css +8 -0
- package/dist/shader-BZzu3zGr.js +24 -0
- package/dist/shiki-CMgjqKKu.css +20 -0
- package/dist/shiki-vToM7Pz1.js +114 -0
- package/dist/solidity-CLieFYpL.js +24 -0
- package/dist/spin-B2FU3Sx6.css +19 -0
- package/dist/spin-Bz4zGBEo.js +3 -0
- package/dist/spin-Ds5W7qC_.js +23 -0
- package/dist/stata-C0yUiO47.js +33 -0
- package/dist/strong-CvOjLZiq.js +83 -0
- package/dist/strong-DpeQmP2J.css +4 -0
- package/dist/svelte-rtF4yNGL.js +23 -0
- package/dist/swift-CzvYoIM0.js +24 -0
- package/dist/table-4ec9FVB_.js +59 -0
- package/dist/table-BWn_kG8W.css +19 -0
- package/dist/table-CJzlDdmv.css +34 -0
- package/dist/table-CZLbUHiJ.js +3 -0
- package/dist/table-DjkiVd9L.js +188 -0
- package/dist/terraform-CD_BZGb-.js +24 -0
- package/dist/text-D098eCyi.css +5 -0
- package/dist/text-D1-vbZ7l.js +23 -0
- package/dist/text-DuONUqRA.js +81 -0
- package/dist/thematic-break-C5zxgoE9.css +6 -0
- package/dist/thematic-break-CcNPEI9Y.js +81 -0
- package/dist/theme.css +67 -0
- package/dist/toml-C6jUF0Xd.js +24 -0
- package/dist/tooltip-Ac_2x9ps.js +4 -0
- package/dist/tooltip-DAngu9Wp.css +5 -0
- package/dist/tooltip-RiXixMIt.js +71 -0
- package/dist/twig-C4dfP84J.js +30 -0
- package/dist/typescript-Bk-pp-cK.js +23 -0
- package/dist/typst-DPCpaVSH.js +24 -0
- package/dist/v-nRGMJ2Ki.js +23 -0
- package/dist/vala-B78bKcY0.js +24 -0
- package/dist/vanilla-BZ8bn5Yz.css +4 -0
- package/dist/vanilla-CA9QO96X.js +3 -0
- package/dist/vanilla-DkX6g0dm.js +87 -0
- package/dist/verilog-CRpkl76S.js +23 -0
- package/dist/vim-DpKnut7b.js +24 -0
- package/dist/vue-D5eadhjo.js +23 -0
- package/dist/xml-Dvx5F-hl.js +24 -0
- package/dist/yaml-DJHrmzSe.js +94 -0
- package/dist/yaml-McBkYbxI.css +5 -0
- package/dist/yaml-n1S8nAOh.js +24 -0
- package/dist/zh-CN-CL1XGe0H.js +27 -0
- package/dist/zig-R-iFzxfW.js +24 -0
- package/dist/zoom-container-BDEP09K9.js +6 -0
- package/dist/zoom-container-BENM7TpV.css +28 -0
- package/dist/zoom-container-BfUO3Ocp.js +113 -0
- package/dist/zoomIn-CEukuh3x.js +28 -0
- package/dist/zoomOut-qlzQyQli.js +28 -0
- package/package.json +115 -0
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
import { t as CODE_PREVIEWERS } from "./previewers-Drlf7IQF.js";
|
|
2
|
+
import { F as LANGUAGE_ALIAS, I as LANGUAGE_EXTENSIONS, L as LANGUAGE_ICONS, O as save, R as useControls, i as useMermaid, j as ICONS, l as useI18n, z as useContext } from "./composables-qhB1h_ed.js";
|
|
3
|
+
import { t as button_default } from "./button-D8xx1WIP.js";
|
|
4
|
+
import { t as modal_default } from "./modal-CuQR21UD.js";
|
|
5
|
+
import { t as segmented_default } from "./segmented-BEtO1eyl.js";
|
|
6
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineAsyncComponent, defineComponent, mergeProps, normalizeClass, normalizeProps, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, toRefs, unref, useModel, vShow, watch, withCtx, withDirectives } from "vue";
|
|
7
|
+
import { useClipboard } from "@vueuse/core";
|
|
8
|
+
|
|
9
|
+
//#region src/components/code-block/actions.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
+
const _hoisted_1$2 = { "data-stream-markdown": "actions" };
|
|
11
|
+
var actions_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
12
|
+
__name: "actions",
|
|
13
|
+
props: { actions: {
|
|
14
|
+
type: Array,
|
|
15
|
+
required: false,
|
|
16
|
+
default: () => []
|
|
17
|
+
} },
|
|
18
|
+
setup(__props) {
|
|
19
|
+
return (_ctx, _cache) => {
|
|
20
|
+
return openBlock(), createElementBlock("div", _hoisted_1$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.actions, (action) => {
|
|
21
|
+
return openBlock(), createBlock(button_default, {
|
|
22
|
+
key: action.key,
|
|
23
|
+
name: action.name,
|
|
24
|
+
icon: action.icon,
|
|
25
|
+
"icon-style": action.iconStyle,
|
|
26
|
+
options: action.options,
|
|
27
|
+
onClick: action.onClick
|
|
28
|
+
}, null, 8, [
|
|
29
|
+
"name",
|
|
30
|
+
"icon",
|
|
31
|
+
"icon-style",
|
|
32
|
+
"options",
|
|
33
|
+
"onClick"
|
|
34
|
+
]);
|
|
35
|
+
}), 128))]);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/components/code-block/actions.vue
|
|
42
|
+
var actions_default = actions_vue_vue_type_script_setup_true_lang_default;
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/components/code-block/language-title.vue?vue&type=script&setup=true&lang.ts
|
|
46
|
+
const _hoisted_1$1 = { "data-stream-markdown": "language-title" };
|
|
47
|
+
const _hoisted_2$1 = {
|
|
48
|
+
key: 1,
|
|
49
|
+
"data-stream-markdown": "language-name"
|
|
50
|
+
};
|
|
51
|
+
var language_title_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
52
|
+
__name: "language-title",
|
|
53
|
+
props: {
|
|
54
|
+
icon: {
|
|
55
|
+
type: null,
|
|
56
|
+
required: false
|
|
57
|
+
},
|
|
58
|
+
language: {
|
|
59
|
+
type: String,
|
|
60
|
+
required: true
|
|
61
|
+
},
|
|
62
|
+
showIcon: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
required: false,
|
|
65
|
+
default: true
|
|
66
|
+
},
|
|
67
|
+
showName: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
required: false,
|
|
70
|
+
default: true
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
setup(__props) {
|
|
74
|
+
return (_ctx, _cache) => {
|
|
75
|
+
return openBlock(), createElementBlock("header", _hoisted_1$1, [__props.showIcon ? (openBlock(), createBlock(resolveDynamicComponent(__props.icon), { key: 0 })) : createCommentVNode("v-if", true), __props.showName ? (openBlock(), createElementBlock("span", _hoisted_2$1, toDisplayString(__props.language), 1)) : createCommentVNode("v-if", true)]);
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/components/code-block/language-title.vue
|
|
82
|
+
var language_title_default = language_title_vue_vue_type_script_setup_true_lang_default;
|
|
83
|
+
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/components/code-block/preview-segmented.vue?vue&type=script&setup=true&lang.ts
|
|
86
|
+
var preview_segmented_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
87
|
+
__name: "preview-segmented",
|
|
88
|
+
props: {
|
|
89
|
+
"mode": {
|
|
90
|
+
type: String,
|
|
91
|
+
required: false,
|
|
92
|
+
default: "source"
|
|
93
|
+
},
|
|
94
|
+
"modeModifiers": {},
|
|
95
|
+
"collapsed": {
|
|
96
|
+
type: Boolean,
|
|
97
|
+
required: false,
|
|
98
|
+
default: false
|
|
99
|
+
},
|
|
100
|
+
"collapsedModifiers": {}
|
|
101
|
+
},
|
|
102
|
+
emits: ["update:mode", "update:collapsed"],
|
|
103
|
+
setup(__props) {
|
|
104
|
+
const mode = useModel(__props, "mode");
|
|
105
|
+
const collapsed = useModel(__props, "collapsed");
|
|
106
|
+
const { t } = useI18n();
|
|
107
|
+
const SEGMENTED_OPTIONS = computed(() => [{
|
|
108
|
+
label: t("button.preview"),
|
|
109
|
+
value: "preview",
|
|
110
|
+
icon: ICONS.preview
|
|
111
|
+
}, {
|
|
112
|
+
label: t("button.source"),
|
|
113
|
+
value: "source",
|
|
114
|
+
icon: ICONS.code
|
|
115
|
+
}]);
|
|
116
|
+
return (_ctx, _cache) => {
|
|
117
|
+
return openBlock(), createBlock(segmented_default, {
|
|
118
|
+
value: mode.value,
|
|
119
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => mode.value = $event),
|
|
120
|
+
options: SEGMENTED_OPTIONS.value,
|
|
121
|
+
"button-style": { fontFamily: "var(--font-mono)" },
|
|
122
|
+
onChange: _cache[1] || (_cache[1] = () => collapsed.value = false)
|
|
123
|
+
}, null, 8, ["value", "options"]);
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/components/code-block/preview-segmented.vue
|
|
130
|
+
var preview_segmented_default = preview_segmented_vue_vue_type_script_setup_true_lang_default;
|
|
131
|
+
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/components/code-block/index.vue?vue&type=script&setup=true&lang.ts
|
|
134
|
+
const _hoisted_1 = ["data-collapsed"];
|
|
135
|
+
const _hoisted_2 = { "data-stream-markdown": "code-block-header" };
|
|
136
|
+
const _hoisted_3 = { key: 2 };
|
|
137
|
+
const _hoisted_4 = { key: 1 };
|
|
138
|
+
const _hoisted_5 = { "data-stream-markdown": "code-block-content" };
|
|
139
|
+
const _hoisted_6 = { key: 2 };
|
|
140
|
+
var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
141
|
+
inheritAttrs: false,
|
|
142
|
+
__name: "index",
|
|
143
|
+
props: {
|
|
144
|
+
node: {
|
|
145
|
+
type: Object,
|
|
146
|
+
required: true
|
|
147
|
+
},
|
|
148
|
+
markdownParser: {
|
|
149
|
+
type: Object,
|
|
150
|
+
required: true
|
|
151
|
+
},
|
|
152
|
+
nodeRenderers: {
|
|
153
|
+
type: Object,
|
|
154
|
+
required: true
|
|
155
|
+
},
|
|
156
|
+
mediumZoom: {
|
|
157
|
+
type: Object,
|
|
158
|
+
required: true
|
|
159
|
+
},
|
|
160
|
+
indexKey: {
|
|
161
|
+
type: [Number, String],
|
|
162
|
+
required: true
|
|
163
|
+
},
|
|
164
|
+
getContainer: {
|
|
165
|
+
type: Function,
|
|
166
|
+
required: true
|
|
167
|
+
},
|
|
168
|
+
controls: {
|
|
169
|
+
type: [Boolean, Object],
|
|
170
|
+
required: false
|
|
171
|
+
},
|
|
172
|
+
previewers: {
|
|
173
|
+
type: [Boolean, Object],
|
|
174
|
+
required: false
|
|
175
|
+
},
|
|
176
|
+
shikiOptions: {
|
|
177
|
+
type: Object,
|
|
178
|
+
required: false
|
|
179
|
+
},
|
|
180
|
+
mermaidOptions: {
|
|
181
|
+
type: Object,
|
|
182
|
+
required: false
|
|
183
|
+
},
|
|
184
|
+
katexOptions: {
|
|
185
|
+
type: Object,
|
|
186
|
+
required: false
|
|
187
|
+
},
|
|
188
|
+
hardenOptions: {
|
|
189
|
+
type: Object,
|
|
190
|
+
required: false
|
|
191
|
+
},
|
|
192
|
+
codeOptions: {
|
|
193
|
+
type: Object,
|
|
194
|
+
required: false
|
|
195
|
+
},
|
|
196
|
+
imageOptions: {
|
|
197
|
+
type: Object,
|
|
198
|
+
required: false
|
|
199
|
+
},
|
|
200
|
+
isDark: {
|
|
201
|
+
type: Boolean,
|
|
202
|
+
required: false
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
setup(__props) {
|
|
206
|
+
const props = __props;
|
|
207
|
+
const { controls, previewers } = toRefs(props);
|
|
208
|
+
const { t } = useI18n();
|
|
209
|
+
const { isControlEnabled } = useControls({ controls });
|
|
210
|
+
const { installed: hasMermaid } = useMermaid();
|
|
211
|
+
const CodeNode = defineAsyncComponent(() => import("./code-CP6mPwkq.js"));
|
|
212
|
+
const { onCopied } = useContext();
|
|
213
|
+
const { copy, copied } = useClipboard({ legacy: true });
|
|
214
|
+
const { saveMermaid } = useMermaid();
|
|
215
|
+
const collapsed = ref(false);
|
|
216
|
+
const fullscreen = ref(false);
|
|
217
|
+
const mode = ref("source");
|
|
218
|
+
const language = computed(() => {
|
|
219
|
+
const lang = props.node.lang;
|
|
220
|
+
if (!lang) return "plaintext";
|
|
221
|
+
if (LANGUAGE_ALIAS[lang]) return LANGUAGE_ALIAS[lang];
|
|
222
|
+
return lang;
|
|
223
|
+
});
|
|
224
|
+
const showLanguageIcon = computed(() => {
|
|
225
|
+
var _props$codeOptions;
|
|
226
|
+
return typeof ((_props$codeOptions = props.codeOptions) === null || _props$codeOptions === void 0 ? void 0 : _props$codeOptions.languageIcon) === "boolean" ? props.codeOptions.languageIcon : true;
|
|
227
|
+
});
|
|
228
|
+
const showLanguageName = computed(() => {
|
|
229
|
+
var _props$codeOptions2;
|
|
230
|
+
return typeof ((_props$codeOptions2 = props.codeOptions) === null || _props$codeOptions2 === void 0 ? void 0 : _props$codeOptions2.languageName) === "boolean" ? props.codeOptions.languageName : true;
|
|
231
|
+
});
|
|
232
|
+
const showLanguageTitle = computed(() => showLanguageIcon.value || showLanguageName.value);
|
|
233
|
+
const showCollapse = computed(() => isControlEnabled("code.collapse"));
|
|
234
|
+
const showCopy = computed(() => isControlEnabled("code.copy"));
|
|
235
|
+
const showDownload = computed(() => isControlEnabled("code.download"));
|
|
236
|
+
const showFullscreen = computed(() => isControlEnabled("code.fullscreen"));
|
|
237
|
+
const icon = computed(() => LANGUAGE_ICONS[language.value] || LANGUAGE_ICONS.text);
|
|
238
|
+
const previewable = computed(() => {
|
|
239
|
+
if (previewers.value === false) return false;
|
|
240
|
+
const mermaid = language.value === "mermaid" && hasMermaid.value;
|
|
241
|
+
const html = language.value === "html" && !props.node.loading;
|
|
242
|
+
if (typeof previewers.value === "object") {
|
|
243
|
+
const _mermaid = previewers.value.mermaid !== false && mermaid;
|
|
244
|
+
const _html = previewers.value.html !== false && html;
|
|
245
|
+
return _mermaid || _html;
|
|
246
|
+
}
|
|
247
|
+
return mermaid || html;
|
|
248
|
+
});
|
|
249
|
+
const PreviewComponent = computed(() => {
|
|
250
|
+
if (!previewers.value || typeof previewers.value === "boolean") return CODE_PREVIEWERS[language.value];
|
|
251
|
+
const data = previewers.value[language.value];
|
|
252
|
+
if (data === false) return CODE_PREVIEWERS[language.value];
|
|
253
|
+
if (data && typeof data !== "boolean") return data;
|
|
254
|
+
return CODE_PREVIEWERS[language.value];
|
|
255
|
+
});
|
|
256
|
+
const downloadOptions = computed(() => {
|
|
257
|
+
if (language.value !== "mermaid" || !hasMermaid.value) return [];
|
|
258
|
+
return [
|
|
259
|
+
{
|
|
260
|
+
label: "SVG",
|
|
261
|
+
value: "svg"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
label: "PNG",
|
|
265
|
+
value: "png"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
label: "MMD",
|
|
269
|
+
value: "code"
|
|
270
|
+
}
|
|
271
|
+
];
|
|
272
|
+
});
|
|
273
|
+
const actions = computed(() => {
|
|
274
|
+
return [
|
|
275
|
+
{
|
|
276
|
+
name: t("button.collapse"),
|
|
277
|
+
key: "collapse",
|
|
278
|
+
icon: ICONS.collapse,
|
|
279
|
+
iconStyle: {
|
|
280
|
+
transform: collapsed.value ? "rotate(180deg)" : void 0,
|
|
281
|
+
transition: "transform var(--default-transition-duration)"
|
|
282
|
+
},
|
|
283
|
+
visible: () => showCollapse.value,
|
|
284
|
+
onClick: () => collapsed.value = !collapsed.value
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
name: t("button.copy"),
|
|
288
|
+
key: "copy",
|
|
289
|
+
icon: copied.value ? ICONS.check : ICONS.copy,
|
|
290
|
+
visible: () => showCopy.value,
|
|
291
|
+
onClick: () => {
|
|
292
|
+
if (!props.node.value) return;
|
|
293
|
+
copy(props.node.value);
|
|
294
|
+
onCopied(props.node.value);
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
name: t("button.download"),
|
|
299
|
+
key: "download",
|
|
300
|
+
icon: ICONS.download,
|
|
301
|
+
options: downloadOptions.value.length > 0 ? downloadOptions.value : void 0,
|
|
302
|
+
visible: () => showDownload.value && !!LANGUAGE_EXTENSIONS[language.value],
|
|
303
|
+
onClick: (_event, item) => {
|
|
304
|
+
if (props.node.loading) return;
|
|
305
|
+
if (!item || item.value === "code") {
|
|
306
|
+
const extension = LANGUAGE_EXTENSIONS[language.value];
|
|
307
|
+
save(`file.${extension}`, props.node.value, "text/plain");
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
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);
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
name: fullscreen.value ? t("button.minimize") : t("button.maximize"),
|
|
315
|
+
key: "fullscreen",
|
|
316
|
+
icon: fullscreen.value ? ICONS.minimize : ICONS.maximize,
|
|
317
|
+
visible: () => showFullscreen.value,
|
|
318
|
+
onClick: () => fullscreen.value = !fullscreen.value
|
|
319
|
+
}
|
|
320
|
+
].filter((button) => !button.visible || button.visible());
|
|
321
|
+
});
|
|
322
|
+
const ModalActions = computed(() => actions.value.filter((i) => i.key !== "collapse"));
|
|
323
|
+
watch(() => previewable.value, () => {
|
|
324
|
+
if (previewable.value) mode.value = "preview";
|
|
325
|
+
}, { immediate: true });
|
|
326
|
+
return (_ctx, _cache) => {
|
|
327
|
+
return openBlock(), createElementBlock("div", {
|
|
328
|
+
"data-stream-markdown": "code-block",
|
|
329
|
+
"data-collapsed": collapsed.value,
|
|
330
|
+
class: normalizeClass({
|
|
331
|
+
"code-loading": props.node.loading,
|
|
332
|
+
"dark": props.isDark
|
|
333
|
+
})
|
|
334
|
+
}, [
|
|
335
|
+
createElementVNode("header", _hoisted_2, [
|
|
336
|
+
renderSlot(_ctx.$slots, "title", {}, () => [showLanguageTitle.value ? (openBlock(), createBlock(language_title_default, {
|
|
337
|
+
key: 0,
|
|
338
|
+
icon: icon.value,
|
|
339
|
+
language: language.value,
|
|
340
|
+
"show-icon": showLanguageIcon.value,
|
|
341
|
+
"show-name": showLanguageName.value
|
|
342
|
+
}, null, 8, [
|
|
343
|
+
"icon",
|
|
344
|
+
"language",
|
|
345
|
+
"show-icon",
|
|
346
|
+
"show-name"
|
|
347
|
+
])) : previewable.value ? (openBlock(), createBlock(preview_segmented_default, {
|
|
348
|
+
key: 1,
|
|
349
|
+
mode: mode.value,
|
|
350
|
+
"onUpdate:mode": _cache[0] || (_cache[0] = ($event) => mode.value = $event),
|
|
351
|
+
collapsed: collapsed.value,
|
|
352
|
+
"onUpdate:collapsed": _cache[1] || (_cache[1] = ($event) => collapsed.value = $event)
|
|
353
|
+
}, null, 8, ["mode", "collapsed"])) : (openBlock(), createElementBlock("div", _hoisted_3))]),
|
|
354
|
+
renderSlot(_ctx.$slots, "header-center", {}, () => [previewable.value && showLanguageTitle.value ? (openBlock(), createBlock(preview_segmented_default, {
|
|
355
|
+
key: 0,
|
|
356
|
+
mode: mode.value,
|
|
357
|
+
"onUpdate:mode": _cache[2] || (_cache[2] = ($event) => mode.value = $event),
|
|
358
|
+
collapsed: collapsed.value,
|
|
359
|
+
"onUpdate:collapsed": _cache[3] || (_cache[3] = ($event) => collapsed.value = $event)
|
|
360
|
+
}, null, 8, ["mode", "collapsed"])) : (openBlock(), createElementBlock("div", _hoisted_4))]),
|
|
361
|
+
renderSlot(_ctx.$slots, "actions", {}, () => [createVNode(actions_default, { actions: actions.value }, null, 8, ["actions"])])
|
|
362
|
+
]),
|
|
363
|
+
withDirectives(createElementVNode("main", _hoisted_5, [previewable.value ? withDirectives((openBlock(), createBlock(resolveDynamicComponent(PreviewComponent.value), normalizeProps(mergeProps({ key: 0 }, props)), null, 16)), [[vShow, mode.value === "preview"]]) : createCommentVNode("v-if", true), withDirectives(createElementVNode("main", null, [renderSlot(_ctx.$slots, "default")], 512), [[vShow, mode.value === "source"]])], 512), [[vShow, !collapsed.value]]),
|
|
364
|
+
createVNode(modal_default, {
|
|
365
|
+
open: fullscreen.value,
|
|
366
|
+
"onUpdate:open": _cache[8] || (_cache[8] = ($event) => fullscreen.value = $event),
|
|
367
|
+
"get-container": props.getContainer
|
|
368
|
+
}, {
|
|
369
|
+
title: withCtx(() => [showLanguageTitle.value ? (openBlock(), createBlock(language_title_default, {
|
|
370
|
+
key: 0,
|
|
371
|
+
icon: icon.value,
|
|
372
|
+
language: language.value,
|
|
373
|
+
"show-icon": showLanguageIcon.value,
|
|
374
|
+
"show-name": showLanguageName.value
|
|
375
|
+
}, null, 8, [
|
|
376
|
+
"icon",
|
|
377
|
+
"language",
|
|
378
|
+
"show-icon",
|
|
379
|
+
"show-name"
|
|
380
|
+
])) : previewable.value ? (openBlock(), createBlock(preview_segmented_default, {
|
|
381
|
+
key: 1,
|
|
382
|
+
mode: mode.value,
|
|
383
|
+
"onUpdate:mode": _cache[4] || (_cache[4] = ($event) => mode.value = $event),
|
|
384
|
+
collapsed: collapsed.value,
|
|
385
|
+
"onUpdate:collapsed": _cache[5] || (_cache[5] = ($event) => collapsed.value = $event)
|
|
386
|
+
}, null, 8, ["mode", "collapsed"])) : (openBlock(), createElementBlock("div", _hoisted_6))]),
|
|
387
|
+
"header-center": withCtx(() => [previewable.value && showLanguageTitle.value ? (openBlock(), createBlock(preview_segmented_default, {
|
|
388
|
+
key: 0,
|
|
389
|
+
mode: mode.value,
|
|
390
|
+
"onUpdate:mode": _cache[6] || (_cache[6] = ($event) => mode.value = $event),
|
|
391
|
+
collapsed: collapsed.value,
|
|
392
|
+
"onUpdate:collapsed": _cache[7] || (_cache[7] = ($event) => collapsed.value = $event)
|
|
393
|
+
}, null, 8, ["mode", "collapsed"])) : createCommentVNode("v-if", true)]),
|
|
394
|
+
actions: withCtx(() => [createVNode(actions_default, { actions: ModalActions.value }, null, 8, ["actions"])]),
|
|
395
|
+
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"]])]),
|
|
396
|
+
_: 1
|
|
397
|
+
}, 8, ["open", "get-container"])
|
|
398
|
+
], 10, _hoisted_1);
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
//#endregion
|
|
404
|
+
//#region src/components/code-block/index.vue
|
|
405
|
+
var code_block_default = index_vue_vue_type_script_setup_true_lang_default;
|
|
406
|
+
|
|
407
|
+
//#endregion
|
|
408
|
+
export { code_block_default as t };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
.stream-markdown [data-stream-markdown="actions"] {
|
|
2
|
+
align-items: center;
|
|
3
|
+
gap: .25rem;
|
|
4
|
+
display: flex;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.stream-markdown [data-stream-markdown="language-title"] {
|
|
8
|
+
align-items: center;
|
|
9
|
+
gap: .5rem;
|
|
10
|
+
display: flex;
|
|
11
|
+
}
|
|
12
|
+
.stream-markdown [data-stream-markdown="language-name"] {
|
|
13
|
+
font-family: var(--font-mono);
|
|
14
|
+
text-transform: lowercase;
|
|
15
|
+
font-size: .875rem;
|
|
16
|
+
line-height: 1.25rem;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.stream-markdown [data-stream-markdown="code-block"] {
|
|
20
|
+
border: 1px solid var(--border);
|
|
21
|
+
border-radius: .75rem;
|
|
22
|
+
margin-block: 1rem;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
}
|
|
25
|
+
.stream-markdown [data-stream-markdown="code-block"][data-collapsed="true"] [data-stream-markdown="code-block-header"] {
|
|
26
|
+
border-bottom: none;
|
|
27
|
+
}
|
|
28
|
+
.stream-markdown [data-stream-markdown="code-block-header"] {
|
|
29
|
+
border-bottom: 1px solid var(--border);
|
|
30
|
+
background-color: color-mix(in oklab, var(--muted) 80%, transparent);
|
|
31
|
+
color: var(--muted-foreground);
|
|
32
|
+
justify-content: space-between;
|
|
33
|
+
align-items: center;
|
|
34
|
+
padding-block: .375rem;
|
|
35
|
+
padding-inline: 1rem;
|
|
36
|
+
font-size: .875rem;
|
|
37
|
+
line-height: 1.25rem;
|
|
38
|
+
display: flex;
|
|
39
|
+
position: relative;
|
|
40
|
+
}
|
|
41
|
+
.stream-markdown [data-stream-markdown="code-block-content"] {
|
|
42
|
+
overflow: auto;
|
|
43
|
+
}
|
|
44
|
+
.stream-markdown [data-stream-markdown="code-block-header"] > :first-child {
|
|
45
|
+
flex: 1;
|
|
46
|
+
}
|
|
47
|
+
.stream-markdown [data-stream-markdown="code-block-header"] > :last-child {
|
|
48
|
+
flex: 1;
|
|
49
|
+
justify-content: flex-end;
|
|
50
|
+
display: flex;
|
|
51
|
+
}
|
|
52
|
+
.stream-markdown [data-stream-markdown="code-block-header"] > :nth-child(2) {
|
|
53
|
+
position: absolute;
|
|
54
|
+
left: 50%;
|
|
55
|
+
transform: translateX(-50%);
|
|
56
|
+
}
|
|
57
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./previewers-Drlf7IQF.js";
|
|
2
|
+
import "./composables-qhB1h_ed.js";
|
|
3
|
+
import "./tooltip-RiXixMIt.js";
|
|
4
|
+
import "./button-D8xx1WIP.js";
|
|
5
|
+
import "./modal-CuQR21UD.js";
|
|
6
|
+
import { t as code_block_default } from "./code-block-C4D_QNTq.js";
|
|
7
|
+
import "./segmented-BEtO1eyl.js";
|
|
8
|
+
|
|
9
|
+
export { code_block_default as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createElementBlock, createElementVNode, markRaw, openBlock } from "vue";
|
|
2
|
+
|
|
3
|
+
//#region ~icons/catppuccin/codeowners
|
|
4
|
+
const _hoisted_1 = {
|
|
5
|
+
viewBox: "0 0 16 16",
|
|
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("g", {
|
|
11
|
+
fill: "none",
|
|
12
|
+
stroke: "#f5a97f",
|
|
13
|
+
"stroke-linecap": "round",
|
|
14
|
+
"stroke-linejoin": "round"
|
|
15
|
+
}, [createElementVNode("path", { d: "m8.01 1.5l5.728 1.774C15.25 11.154 9.813 14.5 7.984 14.5s-7.281-3.357-5.7-11.226zM8 8.5v2z" }), createElementVNode("circle", {
|
|
16
|
+
cx: "8",
|
|
17
|
+
cy: "7",
|
|
18
|
+
r: "1.5"
|
|
19
|
+
})], -1)])]);
|
|
20
|
+
}
|
|
21
|
+
var codeowners_default = markRaw({
|
|
22
|
+
name: "catppuccin-codeowners",
|
|
23
|
+
render
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { codeowners_default as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createElementBlock, createElementVNode, markRaw, openBlock } from "vue";
|
|
2
|
+
|
|
3
|
+
//#region ~icons/catppuccin/coffeescript
|
|
4
|
+
const _hoisted_1 = {
|
|
5
|
+
viewBox: "0 0 16 16",
|
|
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("g", {
|
|
11
|
+
fill: "none",
|
|
12
|
+
stroke: "#f5a97f",
|
|
13
|
+
"stroke-linecap": "round",
|
|
14
|
+
"stroke-linejoin": "round"
|
|
15
|
+
}, [createElementVNode("path", { d: "M14.5 7c-.5 2.5-2 5.5-3 6.5s-2 1-3 1s-2 0-3.02-1C4.45 12.5 3 9.5 2.5 7c3 2 9 2 12 0m-12-2c3 2 9 2 12 0" }), createElementVNode("path", { d: "M2.5 8.4c-1.73 1.6-1.26 4.17 2 4.1M7 2c-.75-.36-1.5.18-1.5.74c-.01.56.94.78 1.5.75c.6-.03.97-.7 1.5-.96C8.98 2.3 9.41 2 10 2c.56 0 1.52.25 1.5 1c-.01.61-1.12.8-1.5.49" })], -1)])]);
|
|
16
|
+
}
|
|
17
|
+
var coffeescript_default = markRaw({
|
|
18
|
+
name: "catppuccin-coffeescript",
|
|
19
|
+
render
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { coffeescript_default as default };
|