vue-stream-markdown 0.2.3 → 0.3.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 -1
- package/dist/{blockquote-Crr-D7fY.js → blockquote-ClgbyGJ2.js} +2 -2
- package/dist/button-BKN2jNlv.js +6 -0
- package/dist/{button-DVWlhfQ9.js → button-BVOWJPmC.js} +2 -2
- package/dist/{code-Bz8LM16H.js → code-DG1O8Nim.js} +10 -10
- package/dist/code-block-C3VwzdZn.js +10 -0
- package/dist/{code-block-CmUZxKNr.js → code-block-wjjUUcJZ.js} +22 -11
- package/dist/composables-CcP6Ysj8.js +10954 -0
- package/dist/{delete-DFoiOzHW.js → delete-C9W-KhtX.js} +2 -2
- package/dist/dropdown-ByLAwToD.js +6 -0
- package/dist/{emphasis-DvaBuxeK.js → emphasis-DiWz4428.js} +2 -2
- package/dist/error-component-Bhq210EM.js +5 -0
- package/dist/{error-component-BTe-SuY7.js → error-component-BrESW9p1.js} +2 -2
- package/dist/{footnote-definition-ByWh1N3S.js → footnote-definition-lObKczNc.js} +5 -5
- package/dist/{footnote-reference-BJ4J7BFo.js → footnote-reference-D4hG5a5R.js} +1 -1
- package/dist/{heading-1fssqGGO.js → heading-CV3_yOWw.js} +2 -2
- package/dist/{icon-DcLTFhFW.js → icon-CRNiOEiK.js} +1 -1
- package/dist/icon-CVg4xQw0.js +4 -0
- package/dist/image-C9bwOpvz.js +9 -0
- package/dist/{image-xPrAKT9D.js → image-CRAZ3iRD.js} +17 -12
- package/dist/{image-DXnmoID_.js → image-CS78DShm.js} +13 -10
- package/dist/index.d.ts +294 -182
- package/dist/index.js +10387 -18754
- package/dist/{inline-math-CPkpjl8t.js → inline-math-BE7gPPl0.js} +3 -3
- package/dist/{link-BACrkxRW.js → link-EaqqdLrN.js} +4 -4
- package/dist/{list-Cu8G46hK.js → list-EaQaXX4p.js} +2 -2
- package/dist/{list-item-BMgDS1tS.js → list-item-KAU_GIzi.js} +2 -2
- package/dist/{math-XsZX0VMw.js → math-CsyxsUp9.js} +3 -3
- package/dist/{mermaid-CQdSlhqn.js → mermaid-CA30wprV.js} +25 -11
- package/dist/modal-C0X_IXfp.js +4 -0
- package/dist/{modal-C1riNMrs.js → modal-D8sOifLe.js} +1 -1
- package/dist/node-list--ReOjYkK.js +4 -0
- package/dist/{node-list-7H-lIfUX.js → node-list-VskJkISk.js} +2 -81
- package/dist/{paragraph-Cfd37HUK.js → paragraph-D6OuJvHb.js} +2 -2
- package/dist/{previewers-C7PKsIbc.js → previewers-CwjTiQh8.js} +1 -1
- package/dist/segmented-D-zfh_BF.js +7 -0
- package/dist/{segmented-C9j-IIDc.js → segmented-DafF5jPA.js} +1 -1
- package/dist/{shiki-BoBbCakv.js → shiki-C1omjtbf.js} +2 -2
- package/dist/{strong-BzOBAWrG.js → strong-Clqsbyuc.js} +2 -2
- package/dist/{table-YY5M01Jm.js → table-DQZFzn1X.js} +13 -8
- package/dist/{tooltip-DarhJuZR.js → tooltip-BfznjscC.js} +1 -1
- package/dist/tooltip-Yf5TSh_Q.js +4 -0
- package/dist/vanilla-C7Ds8DWX.js +4 -0
- package/dist/{vanilla-Z6d1vQmX.js → vanilla-CfMvJwq0.js} +1 -1
- package/dist/{zoom-container-DQMpHHGQ.js → zoom-container-Ci1d-2Rg.js} +2 -2
- package/dist/zoom-container-Dd5Vtieh.js +7 -0
- package/package.json +3 -5
- package/dist/button-Dw4uJRaD.js +0 -6
- package/dist/code-block-Bitp8x1w.js +0 -10
- package/dist/composables-CzUVrTt_.js +0 -2151
- package/dist/dropdown-CSRjqK0u.js +0 -6
- package/dist/error-component-DDnC0bqw.js +0 -5
- package/dist/icon-DE3AzDqz.js +0 -4
- package/dist/image-Dl-r78_E.js +0 -9
- package/dist/modal-C7O4jt5-.js +0 -4
- package/dist/node-list-DMwAmH_n.js +0 -4
- package/dist/segmented-BRTZXoDN.js +0 -7
- package/dist/tooltip-vDDEbLwf.js +0 -4
- package/dist/vanilla-CzQw2_b4.js +0 -4
- package/dist/zoom-container-JLbwB4gy.js +0 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./composables-
|
|
2
|
-
import { t as node_list_default } from "./node-list-
|
|
1
|
+
import "./composables-CcP6Ysj8.js";
|
|
2
|
+
import { t as node_list_default } from "./node-list-VskJkISk.js";
|
|
3
3
|
import { createElementBlock, createVNode, defineComponent, mergeProps, openBlock } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/components/renderers/delete.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./composables-
|
|
2
|
-
import { t as node_list_default } from "./node-list-
|
|
1
|
+
import "./composables-CcP6Ysj8.js";
|
|
2
|
+
import { t as node_list_default } from "./node-list-VskJkISk.js";
|
|
3
3
|
import { createElementBlock, createVNode, defineComponent, mergeProps, openBlock } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/components/renderers/emphasis.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as icon_default } from "./icon-
|
|
1
|
+
import { Ct as useContext, q as useI18n } from "./composables-CcP6Ysj8.js";
|
|
2
|
+
import { t as icon_default } from "./icon-CRNiOEiK.js";
|
|
3
3
|
import { computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, defineComponent, openBlock, renderSlot, resolveDynamicComponent, toDisplayString } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/components/error-component.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as node_list_default } from "./node-list-
|
|
3
|
-
import "./tooltip-
|
|
4
|
-
import { t as button_default } from "./button-
|
|
5
|
-
import "./icon-
|
|
1
|
+
import { Ct as useContext, q as useI18n } from "./composables-CcP6Ysj8.js";
|
|
2
|
+
import { t as node_list_default } from "./node-list-VskJkISk.js";
|
|
3
|
+
import "./tooltip-BfznjscC.js";
|
|
4
|
+
import { t as button_default } from "./button-BVOWJPmC.js";
|
|
5
|
+
import "./icon-CRNiOEiK.js";
|
|
6
6
|
import { computed, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, openBlock, toDisplayString, unref } from "vue";
|
|
7
7
|
|
|
8
8
|
//#region src/components/renderers/footnote-definition.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ct as useContext } from "./composables-CcP6Ysj8.js";
|
|
2
2
|
import { computed, createElementBlock, createElementVNode, defineComponent, openBlock, toDisplayString } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/renderers/footnote-reference.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./composables-
|
|
2
|
-
import { t as node_list_default } from "./node-list-
|
|
1
|
+
import "./composables-CcP6Ysj8.js";
|
|
2
|
+
import { t as node_list_default } from "./node-list-VskJkISk.js";
|
|
3
3
|
import { computed, createBlock, createVNode, defineComponent, mergeProps, openBlock, resolveDynamicComponent, withCtx } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/components/renderers/heading.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ct as useContext } from "./composables-CcP6Ysj8.js";
|
|
2
2
|
import { computed, createElementBlock, createVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, unref } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/icon.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./composables-CcP6Ysj8.js";
|
|
2
|
+
import "./tooltip-BfznjscC.js";
|
|
3
|
+
import "./button-BVOWJPmC.js";
|
|
4
|
+
import "./icon-CRNiOEiK.js";
|
|
5
|
+
import "./modal-D8sOifLe.js";
|
|
6
|
+
import "./zoom-container-Ci1d-2Rg.js";
|
|
7
|
+
import { t as image_default } from "./image-CS78DShm.js";
|
|
8
|
+
|
|
9
|
+
export { image_default as default };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./tooltip-
|
|
3
|
-
import { t as button_default } from "./button-
|
|
4
|
-
import "./icon-
|
|
5
|
-
import "./modal-
|
|
6
|
-
import { t as error_component_default } from "./error-component-
|
|
7
|
-
import "./zoom-container-
|
|
8
|
-
import { t as image_default$1 } from "./image-
|
|
1
|
+
import { Ct as useContext, St as useControls, i as useSanitizers, q as useI18n, yt as saveImage } from "./composables-CcP6Ysj8.js";
|
|
2
|
+
import "./tooltip-BfznjscC.js";
|
|
3
|
+
import { t as button_default } from "./button-BVOWJPmC.js";
|
|
4
|
+
import "./icon-CRNiOEiK.js";
|
|
5
|
+
import "./modal-D8sOifLe.js";
|
|
6
|
+
import { t as error_component_default } from "./error-component-BrESW9p1.js";
|
|
7
|
+
import "./zoom-container-Ci1d-2Rg.js";
|
|
8
|
+
import { t as image_default$1 } from "./image-CS78DShm.js";
|
|
9
9
|
import { t as spin_default } from "./spin-DzERwGWy.js";
|
|
10
10
|
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, mergeProps, normalizeStyle, openBlock, ref, resolveDynamicComponent, toDisplayString, toRefs, unref, withCtx } from "vue";
|
|
11
11
|
|
|
@@ -79,6 +79,7 @@ var image_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
79
79
|
const props = __props;
|
|
80
80
|
const { t } = useI18n();
|
|
81
81
|
const { controls, hardenOptions } = toRefs(props);
|
|
82
|
+
const { beforeDownload } = useContext();
|
|
82
83
|
const { isControlEnabled } = useControls({ controls });
|
|
83
84
|
const maskRef = ref();
|
|
84
85
|
const loadError = ref(false);
|
|
@@ -118,9 +119,12 @@ var image_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
118
119
|
}
|
|
119
120
|
loadError.value = true;
|
|
120
121
|
}
|
|
121
|
-
async function handleDownload() {
|
|
122
|
-
if (!
|
|
123
|
-
|
|
122
|
+
async function handleDownload(url = imageSrc.value) {
|
|
123
|
+
if (!url) return;
|
|
124
|
+
if (await beforeDownload({
|
|
125
|
+
type: "image",
|
|
126
|
+
url
|
|
127
|
+
})) saveImage(url, alt.value);
|
|
124
128
|
}
|
|
125
129
|
function handleMouseEnter() {
|
|
126
130
|
if (maskRef.value) maskRef.value.style.opacity = 1;
|
|
@@ -149,7 +153,7 @@ var image_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
149
153
|
"icon-width": 16,
|
|
150
154
|
"icon-height": 16,
|
|
151
155
|
"button-style": { backgroundColor: "color-mix(in oklab, var(--background) 90%, transparent)" },
|
|
152
|
-
onClick: handleDownload
|
|
156
|
+
onClick: _cache[0] || (_cache[0] = () => handleDownload(imageSrc.value))
|
|
153
157
|
}, null, 8, ["name"])) : createCommentVNode("v-if", true)], 512)) : createCommentVNode("v-if", true),
|
|
154
158
|
(isLoading.value || !imageLoaded.value) && !unref(isHardenUrl) ? (openBlock(), createBlock(spin_default, { key: 1 })) : createCommentVNode("v-if", true),
|
|
155
159
|
!isLoading.value && !unref(isHardenUrl) && typeof unref(transformedUrl) === "string" ? (openBlock(), createBlock(image_default$1, {
|
|
@@ -161,6 +165,7 @@ var image_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
161
165
|
controls: unref(controls),
|
|
162
166
|
"transform-harden-url": unref(transformHardenUrl),
|
|
163
167
|
"node-props": props,
|
|
168
|
+
"handle-download": handleDownload,
|
|
164
169
|
onLoad: handleLoaded,
|
|
165
170
|
onError: handleError
|
|
166
171
|
}, null, 8, [
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ct as useContext, H as useMediumZoom, St as useControls, q as useI18n } from "./composables-CcP6Ysj8.js";
|
|
2
2
|
import { n as treeFlatFilter } from "./dist-CYkm26BF.js";
|
|
3
|
-
import { t as button_default } from "./button-
|
|
4
|
-
import { t as modal_default } from "./modal-
|
|
5
|
-
import { t as zoom_container_default } from "./zoom-container-
|
|
3
|
+
import { t as button_default } from "./button-BVOWJPmC.js";
|
|
4
|
+
import { t as modal_default } from "./modal-D8sOifLe.js";
|
|
5
|
+
import { t as zoom_container_default } from "./zoom-container-Ci1d-2Rg.js";
|
|
6
6
|
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, normalizeStyle, openBlock, ref, renderList, toRefs, unref, watch, withCtx } from "vue";
|
|
7
7
|
import { useCycleList } from "@vueuse/core";
|
|
8
8
|
|
|
@@ -54,6 +54,10 @@ var image_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
54
54
|
nodeProps: {
|
|
55
55
|
type: Object,
|
|
56
56
|
required: true
|
|
57
|
+
},
|
|
58
|
+
handleDownload: {
|
|
59
|
+
type: Function,
|
|
60
|
+
required: false
|
|
57
61
|
}
|
|
58
62
|
},
|
|
59
63
|
emits: ["load", "error"],
|
|
@@ -72,7 +76,7 @@ var image_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
72
76
|
initialValue: props.src,
|
|
73
77
|
fallbackIndex: 0
|
|
74
78
|
});
|
|
75
|
-
const enableDownload = computed(() => isControlEnabled("image.download"));
|
|
79
|
+
const enableDownload = computed(() => isControlEnabled("image.download") && !!props.handleDownload);
|
|
76
80
|
const enableCarousel = computed(() => isControlEnabled("image.carousel"));
|
|
77
81
|
const enableFlip = computed(() => isControlEnabled("image.flip"));
|
|
78
82
|
const enableRotate = computed(() => isControlEnabled("image.rotate"));
|
|
@@ -105,7 +109,10 @@ var image_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
105
109
|
key: "download",
|
|
106
110
|
icon: "download",
|
|
107
111
|
name: t("button.download"),
|
|
108
|
-
onClick:
|
|
112
|
+
onClick: () => {
|
|
113
|
+
var _props$handleDownload;
|
|
114
|
+
return (_props$handleDownload = props.handleDownload) === null || _props$handleDownload === void 0 ? void 0 : _props$handleDownload.call(props, imageSrc.value);
|
|
115
|
+
},
|
|
109
116
|
visible: () => !!imageSrc.value && enableDownload.value
|
|
110
117
|
},
|
|
111
118
|
{
|
|
@@ -170,10 +177,6 @@ var image_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
170
177
|
if (isAnimating.value) return;
|
|
171
178
|
zoomOut();
|
|
172
179
|
}
|
|
173
|
-
function download() {
|
|
174
|
-
if (!imageSrc.value) return;
|
|
175
|
-
saveImage(imageSrc.value, props.alt);
|
|
176
|
-
}
|
|
177
180
|
function flipHorizontal() {
|
|
178
181
|
scaleX.value *= -1;
|
|
179
182
|
}
|