vue-stream-markdown 0.1.3 → 0.1.4
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/dist/button-D6ccVxGm.js +5 -0
- package/dist/{button-CJyeXWq2.js → button-jFTF378X.js} +1 -1
- package/dist/{code-CJ4tMt6L.js → code-BxWvKFxG.js} +8 -8
- package/dist/code-block-B72JfFy-.js +9 -0
- package/dist/{code-block-CQ4lgva1.js → code-block-uZcUI59D.js} +32 -17
- package/dist/{composables-Cj6_jbwr.js → composables-Cx0nvyHl.js} +76 -8
- package/dist/dropdown-oiCw8QVq.js +5 -0
- package/dist/error-component-8y13-fYG.js +4 -0
- package/dist/{error-component-ClGLfmwy.js → error-component-Bhl770lu.js} +4 -3
- package/dist/{image-xeiC5YFM.js → image-BDtPwitR.js} +6 -5
- package/dist/index.d.ts +87 -58
- package/dist/index.js +29 -18
- package/dist/{inline-math-C2NUSasr.js → inline-math-CAqboT7h.js} +2 -2
- package/dist/{link-BceXudNH.js → link-C8BSlPhZ.js} +2 -2
- package/dist/{math-DXOLG3Xg.js → math-CT1TB2pK.js} +2 -2
- package/dist/{mermaid-CU4hpB6S.js → mermaid-CYrA8rCl.js} +5 -5
- package/dist/{previewers-qHMi6xZ3.js → previewers-ByaS2Ksa.js} +1 -1
- package/dist/segmented-B4IEw3wg.js +6 -0
- package/dist/{segmented-CF6exjdD.js → segmented-DBW9ignu.js} +1 -1
- package/dist/{shiki-BlfngIRi.js → shiki-bQYWLdW3.js} +2 -2
- package/dist/{table-C5VHgkTQ.js → table-l_3z210v.js} +6 -5
- package/dist/{tooltip-gxsqaBNg.js → tooltip-3UDC9mw-.js} +1 -1
- package/dist/tooltip-CAoc_U1X.js +4 -0
- package/dist/{vanilla-D5DzB31q.js → vanilla-CFWVwBvD.js} +1 -1
- package/dist/vanilla-De7W3PpS.js +4 -0
- package/dist/zoom-container-DBgGdbJS.js +6 -0
- package/dist/{zoom-container-D_fBClW2.js → zoom-container-gjQ0EMyk.js} +18 -5
- package/package.json +1 -1
- package/dist/button-2wMU7qkH.js +0 -5
- package/dist/code-block-BucFZooo.js +0 -9
- package/dist/dropdown-dsCfq0Hl.js +0 -5
- package/dist/error-component-B0mmLhh6.js +0 -4
- package/dist/segmented-BeHqXuFx.js +0 -6
- package/dist/tooltip-BzVZqo7w.js +0 -4
- package/dist/vanilla-CKj7EQLx.js +0 -4
- package/dist/zoom-container-CwEDlKRx.js +0 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as tooltip_default } from "./tooltip-
|
|
1
|
+
import { t as tooltip_default } from "./tooltip-3UDC9mw-.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
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./previewers-
|
|
2
|
-
import { i as useShiki } from "./composables-
|
|
3
|
-
import "./tooltip-
|
|
4
|
-
import "./button-
|
|
1
|
+
import "./previewers-ByaS2Ksa.js";
|
|
2
|
+
import { i as useShiki } from "./composables-Cx0nvyHl.js";
|
|
3
|
+
import "./tooltip-3UDC9mw-.js";
|
|
4
|
+
import "./button-jFTF378X.js";
|
|
5
5
|
import "./modal-CuQR21UD.js";
|
|
6
|
-
import { t as code_block_default } from "./code-block-
|
|
7
|
-
import "./segmented-
|
|
6
|
+
import { t as code_block_default } from "./code-block-uZcUI59D.js";
|
|
7
|
+
import "./segmented-DBW9ignu.js";
|
|
8
8
|
import { computed, createBlock, createCommentVNode, defineAsyncComponent, defineComponent, 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
|
|
@@ -82,8 +82,8 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
82
82
|
const languageClass = computed(() => `language-${props.node.lang}`);
|
|
83
83
|
const { installed: hasShiki } = useShiki();
|
|
84
84
|
const components = {
|
|
85
|
-
vanilla: defineAsyncComponent(() => import("./vanilla-
|
|
86
|
-
shiki: defineAsyncComponent(() => import("./shiki-
|
|
85
|
+
vanilla: defineAsyncComponent(() => import("./vanilla-De7W3PpS.js")),
|
|
86
|
+
shiki: defineAsyncComponent(() => import("./shiki-bQYWLdW3.js"))
|
|
87
87
|
};
|
|
88
88
|
const component = computed(() => {
|
|
89
89
|
if (hasShiki.value) return components.shiki;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./previewers-ByaS2Ksa.js";
|
|
2
|
+
import "./composables-Cx0nvyHl.js";
|
|
3
|
+
import "./tooltip-3UDC9mw-.js";
|
|
4
|
+
import "./button-jFTF378X.js";
|
|
5
|
+
import "./modal-CuQR21UD.js";
|
|
6
|
+
import { t as code_block_default } from "./code-block-uZcUI59D.js";
|
|
7
|
+
import "./segmented-DBW9ignu.js";
|
|
8
|
+
|
|
9
|
+
export { code_block_default as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as CODE_PREVIEWERS } from "./previewers-
|
|
2
|
-
import { B as useContext, I as LANGUAGE_ALIAS, L as LANGUAGE_EXTENSIONS,
|
|
3
|
-
import { t as button_default } from "./button-
|
|
1
|
+
import { t as CODE_PREVIEWERS } from "./previewers-ByaS2Ksa.js";
|
|
2
|
+
import { B as useContext, I as LANGUAGE_ALIAS, L as LANGUAGE_EXTENSIONS, O as save, R as LANGUAGE_ICONS, V as useCodeOptions, a as useMermaid, u as useI18n, z as useControls } from "./composables-Cx0nvyHl.js";
|
|
3
|
+
import { t as button_default } from "./button-jFTF378X.js";
|
|
4
4
|
import { t as modal_default } from "./modal-CuQR21UD.js";
|
|
5
|
-
import { t as segmented_default } from "./segmented-
|
|
5
|
+
import { t as segmented_default } from "./segmented-DBW9ignu.js";
|
|
6
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
7
|
import { useClipboard } from "@vueuse/core";
|
|
8
8
|
|
|
@@ -104,14 +104,15 @@ var preview_segmented_vue_vue_type_script_setup_true_lang_default = /* @__PURE__
|
|
|
104
104
|
const mode = useModel(__props, "mode");
|
|
105
105
|
const collapsed = useModel(__props, "collapsed");
|
|
106
106
|
const { t } = useI18n();
|
|
107
|
+
const { icons } = useContext();
|
|
107
108
|
const SEGMENTED_OPTIONS = computed(() => [{
|
|
108
109
|
label: t("button.preview"),
|
|
109
110
|
value: "preview",
|
|
110
|
-
icon:
|
|
111
|
+
icon: icons.value.preview
|
|
111
112
|
}, {
|
|
112
113
|
label: t("button.source"),
|
|
113
114
|
value: "source",
|
|
114
|
-
icon:
|
|
115
|
+
icon: icons.value.code
|
|
115
116
|
}]);
|
|
116
117
|
return (_ctx, _cache) => {
|
|
117
118
|
return openBlock(), createBlock(segmented_default, {
|
|
@@ -206,9 +207,10 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
206
207
|
const props = __props;
|
|
207
208
|
const { controls, previewers, codeOptions } = toRefs(props);
|
|
208
209
|
const { t } = useI18n();
|
|
210
|
+
const { icons } = useContext();
|
|
209
211
|
const { isControlEnabled } = useControls({ controls });
|
|
210
212
|
const { installed: hasMermaid } = useMermaid();
|
|
211
|
-
const CodeNode = defineAsyncComponent(() => import("./code-
|
|
213
|
+
const CodeNode = defineAsyncComponent(() => import("./code-BxWvKFxG.js"));
|
|
212
214
|
const { onCopied } = useContext();
|
|
213
215
|
const { copy, copied } = useClipboard({ legacy: true });
|
|
214
216
|
const { saveMermaid } = useMermaid();
|
|
@@ -230,17 +232,30 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
230
232
|
const showCopy = computed(() => isControlEnabled("code.copy"));
|
|
231
233
|
const showDownload = computed(() => isControlEnabled("code.download"));
|
|
232
234
|
const showFullscreen = computed(() => isControlEnabled("code.fullscreen"));
|
|
233
|
-
const icon = computed(() =>
|
|
235
|
+
const icon = computed(() => {
|
|
236
|
+
var _codeOptions$value;
|
|
237
|
+
const custom = (_codeOptions$value = codeOptions.value) === null || _codeOptions$value === void 0 || (_codeOptions$value = _codeOptions$value.language) === null || _codeOptions$value === void 0 || (_codeOptions$value = _codeOptions$value[language.value]) === null || _codeOptions$value === void 0 ? void 0 : _codeOptions$value.languageIcon;
|
|
238
|
+
if (typeof custom === "object") return custom;
|
|
239
|
+
return LANGUAGE_ICONS[language.value] || LANGUAGE_ICONS.text;
|
|
240
|
+
});
|
|
234
241
|
const previewable = computed(() => {
|
|
235
242
|
if (previewers.value === false) return false;
|
|
236
|
-
const mermaid = language.value === "mermaid" && hasMermaid.value;
|
|
237
243
|
const html = language.value === "html" && !props.node.loading;
|
|
244
|
+
const mermaid = language.value === "mermaid" && hasMermaid.value;
|
|
245
|
+
if (previewers.value === true) {
|
|
246
|
+
if (language.value === "html" && html) return true;
|
|
247
|
+
if (language.value === "mermaid" && mermaid) return true;
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
238
250
|
if (typeof previewers.value === "object") {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
251
|
+
if (previewers.value[language.value] === false) return false;
|
|
252
|
+
if (language.value === "html" && html) return true;
|
|
253
|
+
if (language.value === "mermaid" && mermaid) return true;
|
|
254
|
+
const component = previewers.value[language.value];
|
|
255
|
+
if (typeof component === "object" && !props.node.loading) return !!component;
|
|
256
|
+
return false;
|
|
242
257
|
}
|
|
243
|
-
return
|
|
258
|
+
return false;
|
|
244
259
|
});
|
|
245
260
|
const PreviewComponent = computed(() => {
|
|
246
261
|
if (!previewers.value || typeof previewers.value === "boolean") return CODE_PREVIEWERS[language.value];
|
|
@@ -271,7 +286,7 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
271
286
|
{
|
|
272
287
|
name: t("button.collapse"),
|
|
273
288
|
key: "collapse",
|
|
274
|
-
icon:
|
|
289
|
+
icon: icons.value.collapse,
|
|
275
290
|
iconStyle: {
|
|
276
291
|
transform: collapsed.value ? "rotate(180deg)" : void 0,
|
|
277
292
|
transition: "transform var(--default-transition-duration)"
|
|
@@ -282,7 +297,7 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
282
297
|
{
|
|
283
298
|
name: t("button.copy"),
|
|
284
299
|
key: "copy",
|
|
285
|
-
icon: copied.value ?
|
|
300
|
+
icon: copied.value ? icons.value.check : icons.value.copy,
|
|
286
301
|
visible: () => showCopy.value,
|
|
287
302
|
onClick: () => {
|
|
288
303
|
if (!props.node.value) return;
|
|
@@ -293,7 +308,7 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
293
308
|
{
|
|
294
309
|
name: t("button.download"),
|
|
295
310
|
key: "download",
|
|
296
|
-
icon:
|
|
311
|
+
icon: icons.value.download,
|
|
297
312
|
options: downloadOptions.value.length > 0 ? downloadOptions.value : void 0,
|
|
298
313
|
visible: () => showDownload.value && !!LANGUAGE_EXTENSIONS[language.value],
|
|
299
314
|
onClick: (_event, item) => {
|
|
@@ -309,7 +324,7 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
309
324
|
{
|
|
310
325
|
name: fullscreen.value ? t("button.minimize") : t("button.maximize"),
|
|
311
326
|
key: "fullscreen",
|
|
312
|
-
icon: fullscreen.value ?
|
|
327
|
+
icon: fullscreen.value ? icons.value.minimize : icons.value.maximize,
|
|
313
328
|
visible: () => showFullscreen.value,
|
|
314
329
|
onClick: () => fullscreen.value = !fullscreen.value
|
|
315
330
|
}
|
|
@@ -36,6 +36,7 @@ function useCodeOptions(options) {
|
|
|
36
36
|
const CONTEXT_KEY = Symbol("stream-markdown-context");
|
|
37
37
|
function useContext() {
|
|
38
38
|
const context = injectContext();
|
|
39
|
+
const icons = computed(() => unref(context.icons) ?? {});
|
|
39
40
|
const isDark = computed(() => unref(context.isDark) ?? false);
|
|
40
41
|
function provideContext(ctx) {
|
|
41
42
|
provide(CONTEXT_KEY, {
|
|
@@ -50,6 +51,7 @@ function useContext() {
|
|
|
50
51
|
context,
|
|
51
52
|
provideContext,
|
|
52
53
|
injectContext,
|
|
54
|
+
icons,
|
|
53
55
|
isDark,
|
|
54
56
|
get getContainer() {
|
|
55
57
|
return context.getContainer || (() => void 0);
|
|
@@ -1428,7 +1430,11 @@ function useShiki(options) {
|
|
|
1428
1430
|
const darkTheme = computed(() => shikiTheme.value[1] ?? DEFAULT_DARK_THEME);
|
|
1429
1431
|
const langAlias = computed(() => {
|
|
1430
1432
|
var _unref2;
|
|
1431
|
-
|
|
1433
|
+
const data = ((_unref2 = unref(options === null || options === void 0 ? void 0 : options.shikiOptions)) === null || _unref2 === void 0 ? void 0 : _unref2.langAlias) ?? {};
|
|
1434
|
+
return {
|
|
1435
|
+
...LANGUAGE_ALIAS,
|
|
1436
|
+
...data
|
|
1437
|
+
};
|
|
1432
1438
|
});
|
|
1433
1439
|
const codeToTokenOptions = computed(() => {
|
|
1434
1440
|
var _unref3;
|
|
@@ -1446,7 +1452,7 @@ function useShiki(options) {
|
|
|
1446
1452
|
return theme.id;
|
|
1447
1453
|
}
|
|
1448
1454
|
async function getLanguage() {
|
|
1449
|
-
if (
|
|
1455
|
+
if (langAlias.value[lang.value]) return langAlias.value[lang.value];
|
|
1450
1456
|
const { bundledLanguagesInfo } = await import("shiki");
|
|
1451
1457
|
const language = bundledLanguagesInfo.find((l) => {
|
|
1452
1458
|
var _l$aliases;
|
|
@@ -1474,10 +1480,7 @@ function useShiki(options) {
|
|
|
1474
1480
|
return createHighlighter({
|
|
1475
1481
|
themes: [await getTheme()],
|
|
1476
1482
|
langs: [await getLanguage()],
|
|
1477
|
-
langAlias:
|
|
1478
|
-
...LANGUAGE_ALIAS,
|
|
1479
|
-
...langAlias.value
|
|
1480
|
-
}
|
|
1483
|
+
langAlias: langAlias.value
|
|
1481
1484
|
});
|
|
1482
1485
|
})();
|
|
1483
1486
|
highlighter = await createHighlighterPromise;
|
|
@@ -1592,6 +1595,8 @@ function useZoom(options = {}) {
|
|
|
1592
1595
|
x: 0,
|
|
1593
1596
|
y: 0
|
|
1594
1597
|
});
|
|
1598
|
+
const isPinching = ref(false);
|
|
1599
|
+
const touchZoomState = ref(null);
|
|
1595
1600
|
const transformStyle = computed(() => ({ transform: `translate(${translateX.value}px, ${translateY.value}px) scale(${zoom.value})` }));
|
|
1596
1601
|
function zoomIn() {
|
|
1597
1602
|
if (zoom.value < maxZoom) zoom.value = Math.min(zoom.value + zoomStep, maxZoom);
|
|
@@ -1608,6 +1613,7 @@ function useZoom(options = {}) {
|
|
|
1608
1613
|
zoom.value = Math.min(Math.max(value, minZoom), maxZoom);
|
|
1609
1614
|
}
|
|
1610
1615
|
function startDrag(e) {
|
|
1616
|
+
if (isPinching.value) return;
|
|
1611
1617
|
isDragging.value = true;
|
|
1612
1618
|
dragStart.value = {
|
|
1613
1619
|
x: e.clientX - translateX.value,
|
|
@@ -1618,7 +1624,7 @@ function useZoom(options = {}) {
|
|
|
1618
1624
|
}
|
|
1619
1625
|
}
|
|
1620
1626
|
function onDrag(e) {
|
|
1621
|
-
if (!isDragging.value) return;
|
|
1627
|
+
if (!isDragging.value || isPinching.value) return;
|
|
1622
1628
|
translateX.value = e.clientX - dragStart.value.x;
|
|
1623
1629
|
translateY.value = e.clientY - dragStart.value.y;
|
|
1624
1630
|
}
|
|
@@ -1646,6 +1652,65 @@ function useZoom(options = {}) {
|
|
|
1646
1652
|
}
|
|
1647
1653
|
}
|
|
1648
1654
|
}
|
|
1655
|
+
function getTouchDistance(touch1, touch2) {
|
|
1656
|
+
const dx = touch1.clientX - touch2.clientX;
|
|
1657
|
+
const dy = touch1.clientY - touch2.clientY;
|
|
1658
|
+
return Math.sqrt(dx * dx + dy * dy);
|
|
1659
|
+
}
|
|
1660
|
+
function handleTouchStart(event, containerElement) {
|
|
1661
|
+
if (event.touches.length === 2) {
|
|
1662
|
+
event.preventDefault();
|
|
1663
|
+
isPinching.value = true;
|
|
1664
|
+
const touch1 = event.touches[0];
|
|
1665
|
+
const touch2 = event.touches[1];
|
|
1666
|
+
const distance = getTouchDistance(touch1, touch2);
|
|
1667
|
+
const centerX = (touch1.clientX + touch2.clientX) / 2;
|
|
1668
|
+
const centerY = (touch1.clientY + touch2.clientY) / 2;
|
|
1669
|
+
const rect = containerElement.getBoundingClientRect();
|
|
1670
|
+
const containerCenterX = rect.width / 2;
|
|
1671
|
+
const containerCenterY = rect.height / 2;
|
|
1672
|
+
const offsetX = centerX - rect.left - containerCenterX;
|
|
1673
|
+
const offsetY = centerY - rect.top - containerCenterY;
|
|
1674
|
+
touchZoomState.value = {
|
|
1675
|
+
initialDistance: distance,
|
|
1676
|
+
initialZoom: zoom.value,
|
|
1677
|
+
initialTranslateX: translateX.value,
|
|
1678
|
+
initialTranslateY: translateY.value,
|
|
1679
|
+
centerX: offsetX,
|
|
1680
|
+
centerY: offsetY
|
|
1681
|
+
};
|
|
1682
|
+
}
|
|
1683
|
+
}
|
|
1684
|
+
function handleTouchMove(event, containerElement) {
|
|
1685
|
+
if (event.touches.length === 2 && touchZoomState.value) {
|
|
1686
|
+
event.preventDefault();
|
|
1687
|
+
const touch1 = event.touches[0];
|
|
1688
|
+
const touch2 = event.touches[1];
|
|
1689
|
+
const scale = getTouchDistance(touch1, touch2) / touchZoomState.value.initialDistance;
|
|
1690
|
+
const newZoom = touchZoomState.value.initialZoom * scale;
|
|
1691
|
+
const clampedZoom = Math.min(Math.max(newZoom, minZoom), maxZoom);
|
|
1692
|
+
if (clampedZoom !== zoom.value) {
|
|
1693
|
+
const centerX = (touch1.clientX + touch2.clientX) / 2;
|
|
1694
|
+
const centerY = (touch1.clientY + touch2.clientY) / 2;
|
|
1695
|
+
const rect = containerElement.getBoundingClientRect();
|
|
1696
|
+
const containerCenterX = rect.width / 2;
|
|
1697
|
+
const containerCenterY = rect.height / 2;
|
|
1698
|
+
const offsetX = centerX - rect.left - containerCenterX;
|
|
1699
|
+
const offsetY = centerY - rect.top - containerCenterY;
|
|
1700
|
+
const contentFocalX = (touchZoomState.value.centerX - touchZoomState.value.initialTranslateX) / touchZoomState.value.initialZoom;
|
|
1701
|
+
const contentFocalY = (touchZoomState.value.centerY - touchZoomState.value.initialTranslateY) / touchZoomState.value.initialZoom;
|
|
1702
|
+
zoom.value = clampedZoom;
|
|
1703
|
+
translateX.value = offsetX - contentFocalX * clampedZoom;
|
|
1704
|
+
translateY.value = offsetY - contentFocalY * clampedZoom;
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
function handleTouchEnd(event) {
|
|
1709
|
+
if (event.touches.length < 2) {
|
|
1710
|
+
touchZoomState.value = null;
|
|
1711
|
+
isPinching.value = false;
|
|
1712
|
+
}
|
|
1713
|
+
}
|
|
1649
1714
|
function getState() {
|
|
1650
1715
|
return {
|
|
1651
1716
|
zoom: zoom.value,
|
|
@@ -1673,7 +1738,10 @@ function useZoom(options = {}) {
|
|
|
1673
1738
|
stopDrag,
|
|
1674
1739
|
handleWheel,
|
|
1675
1740
|
getState,
|
|
1676
|
-
setState
|
|
1741
|
+
setState,
|
|
1742
|
+
handleTouchStart,
|
|
1743
|
+
handleTouchMove,
|
|
1744
|
+
handleTouchEnd
|
|
1677
1745
|
};
|
|
1678
1746
|
}
|
|
1679
1747
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as useContext, u as useI18n } from "./composables-Cx0nvyHl.js";
|
|
2
2
|
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, openBlock, renderSlot, resolveDynamicComponent, toDisplayString } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/error-component.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -25,6 +25,7 @@ var error_component_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
|
|
|
25
25
|
setup(__props) {
|
|
26
26
|
const props = __props;
|
|
27
27
|
const { t } = useI18n();
|
|
28
|
+
const { icons } = useContext();
|
|
28
29
|
const messages = computed(() => ({
|
|
29
30
|
"vanilla": t("error.vanilla"),
|
|
30
31
|
"image": t("error.image"),
|
|
@@ -35,8 +36,8 @@ var error_component_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
|
|
|
35
36
|
}));
|
|
36
37
|
const icon = computed(() => {
|
|
37
38
|
if (props.icon) return props.icon;
|
|
38
|
-
if (
|
|
39
|
-
return
|
|
39
|
+
if (icons.value[props.variant]) return icons.value[props.variant];
|
|
40
|
+
return icons.value[props.variant.replace("harden-", "")] || icons.value.error;
|
|
40
41
|
});
|
|
41
42
|
const message = computed(() => props.message ? props.message : messages.value[props.variant] || messages.value.vanilla);
|
|
42
43
|
const isHarden = computed(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./tooltip-
|
|
3
|
-
import { t as button_default } from "./button-
|
|
4
|
-
import { t as error_component_default } from "./error-component-
|
|
1
|
+
import { B as useContext, O as save, g as useHardenSanitizers, u as useI18n, z as useControls } from "./composables-Cx0nvyHl.js";
|
|
2
|
+
import "./tooltip-3UDC9mw-.js";
|
|
3
|
+
import { t as button_default } from "./button-jFTF378X.js";
|
|
4
|
+
import { t as error_component_default } from "./error-component-Bhl770lu.js";
|
|
5
5
|
import { t as spin_default } from "./spin-Ds5W7qC_.js";
|
|
6
6
|
import { Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, normalizeStyle, openBlock, ref, resolveDynamicComponent, toDisplayString, toRefs, unref, withCtx } from "vue";
|
|
7
7
|
|
|
@@ -84,6 +84,7 @@ var image_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
84
84
|
const props = __props;
|
|
85
85
|
const fileExtensionPattern = /\.[^/.]+$/;
|
|
86
86
|
const { t } = useI18n();
|
|
87
|
+
const { icons } = useContext();
|
|
87
88
|
const { controls, hardenOptions } = toRefs(props);
|
|
88
89
|
const { isControlEnabled } = useControls({ controls });
|
|
89
90
|
const imgRef = ref();
|
|
@@ -167,7 +168,7 @@ var image_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
167
168
|
}, [!isLoading.value && showDownload.value ? (openBlock(), createBlock(button_default, {
|
|
168
169
|
key: 0,
|
|
169
170
|
"data-stream-markdown": "image-download-button",
|
|
170
|
-
icon: unref(
|
|
171
|
+
icon: unref(icons).download,
|
|
171
172
|
name: unref(t)("button.download"),
|
|
172
173
|
"icon-class": "test",
|
|
173
174
|
"icon-width": 16,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vue29 from "vue";
|
|
2
2
|
import { Component, MaybeRef, MaybeRefOrGetter } from "vue";
|
|
3
3
|
import "tippy.js/dist/tippy.css";
|
|
4
4
|
import "tippy.js/themes/light.css";
|
|
@@ -8,6 +8,7 @@ import { Zoom } from "medium-zoom";
|
|
|
8
8
|
import { MarkdownItAsync } from "markdown-it-async";
|
|
9
9
|
import { KatexOptions as KatexOptions$1 } from "katex";
|
|
10
10
|
import remend from "remend";
|
|
11
|
+
import "medium-zoom/dist/style.css";
|
|
11
12
|
import { BuiltinLanguage, BuiltinTheme, BundledLanguage, BundledTheme, CodeToTokensOptions, Highlighter, SpecialLanguage, TokensResult } from "shiki";
|
|
12
13
|
import { Mermaid, MermaidConfig } from "mermaid";
|
|
13
14
|
import { Extension, fromMarkdown } from "mdast-util-from-markdown";
|
|
@@ -130,11 +131,51 @@ interface LocaleConfig {
|
|
|
130
131
|
};
|
|
131
132
|
}
|
|
132
133
|
//#endregion
|
|
134
|
+
//#region src/constants/code.d.ts
|
|
135
|
+
declare const DEFAULT_LIGHT_THEME = "github-light";
|
|
136
|
+
declare const DEFAULT_DARK_THEME = "github-dark";
|
|
137
|
+
declare const LANGUAGE_ALIAS: Record<string, BuiltinLanguage>;
|
|
138
|
+
declare const LANGUAGE_EXTENSIONS: Partial<Record<BuiltinLanguage, string>>;
|
|
139
|
+
declare const LANGUAGE_ICONS: Partial<Record<BuiltinLanguage | SpecialLanguage, Component>>;
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/constants/harden.d.ts
|
|
142
|
+
declare const DEFAULT_HARDEN_OPTIONS: HardenOptions;
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/constants/icons.d.ts
|
|
145
|
+
declare const ICONS: {
|
|
146
|
+
readonly check: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
147
|
+
readonly code: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
148
|
+
readonly collapse: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
149
|
+
readonly copy: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
150
|
+
readonly download: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
151
|
+
readonly error: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
152
|
+
readonly image: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
153
|
+
readonly link: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
154
|
+
readonly maximize: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
155
|
+
readonly mermaid: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
156
|
+
readonly minimize: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
157
|
+
readonly preview: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
158
|
+
readonly zoomIn: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
159
|
+
readonly zoomOut: vue29.FunctionalComponent<vue29.SVGAttributes, {}, any, {}>;
|
|
160
|
+
};
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region src/constants/theme.d.ts
|
|
163
|
+
declare const SHADCN_SCHEMAS: readonly ["background", "foreground", "card", "card-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "border", "input", "ring", "chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "sidebar", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring"];
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/types/shared.d.ts
|
|
166
|
+
type IconName = keyof typeof ICONS;
|
|
167
|
+
interface SelectItem {
|
|
168
|
+
label: string;
|
|
169
|
+
value: string;
|
|
170
|
+
icon?: Component;
|
|
171
|
+
}
|
|
172
|
+
//#endregion
|
|
133
173
|
//#region src/types/context.d.ts
|
|
134
174
|
interface StreamMarkdownProps extends StreamMarkdownContext, MarkdownParserOptions {
|
|
135
175
|
mode?: 'static' | 'streaming';
|
|
136
176
|
content?: string;
|
|
137
177
|
nodeRenderers?: NodeRenderers;
|
|
178
|
+
icons?: Partial<Record<IconName, Component>>;
|
|
138
179
|
locale?: string | LocaleConfig;
|
|
139
180
|
}
|
|
140
181
|
interface MarkdownParserOptions {
|
|
@@ -183,10 +224,12 @@ type ControlsConfig = boolean | {
|
|
|
183
224
|
image?: boolean | ImageControlsConfig;
|
|
184
225
|
mermaid?: boolean | ZoomControlsConfig;
|
|
185
226
|
};
|
|
186
|
-
type PreviewerConfig = boolean | {
|
|
187
|
-
html?: boolean | Component;
|
|
227
|
+
type PreviewerConfig = boolean | ({
|
|
188
228
|
mermaid?: boolean | Component;
|
|
189
|
-
|
|
229
|
+
html?: boolean | Component;
|
|
230
|
+
} & {
|
|
231
|
+
[key: string]: Component;
|
|
232
|
+
});
|
|
190
233
|
interface ShikiOptions {
|
|
191
234
|
theme?: [BuiltinTheme, BuiltinTheme];
|
|
192
235
|
langAlias?: Record<string, string>;
|
|
@@ -221,7 +264,10 @@ interface CodeOptions {
|
|
|
221
264
|
* },
|
|
222
265
|
* }
|
|
223
266
|
*/
|
|
224
|
-
language?: Record<string,
|
|
267
|
+
language?: Record<string, CodeOptionsLanguage>;
|
|
268
|
+
}
|
|
269
|
+
interface CodeOptionsLanguage extends Omit<CodeOptions, 'languageIcon'> {
|
|
270
|
+
languageIcon?: boolean | Component;
|
|
225
271
|
}
|
|
226
272
|
interface HardenOptions {
|
|
227
273
|
defaultOrigin?: string;
|
|
@@ -347,13 +393,6 @@ interface InlineMathNodeRendererProps extends NodeRendererProps {
|
|
|
347
393
|
node: InlineMathNode;
|
|
348
394
|
}
|
|
349
395
|
//#endregion
|
|
350
|
-
//#region src/types/shared.d.ts
|
|
351
|
-
interface SelectItem {
|
|
352
|
-
label: string;
|
|
353
|
-
value: string;
|
|
354
|
-
icon?: Component;
|
|
355
|
-
}
|
|
356
|
-
//#endregion
|
|
357
396
|
//#region src/components/renderers/index.d.ts
|
|
358
397
|
declare const NODE_RENDERERS: NodeRenderers;
|
|
359
398
|
//#endregion
|
|
@@ -366,15 +405,16 @@ interface UseCodeOptionsOptions {
|
|
|
366
405
|
language?: MaybeRef<string>;
|
|
367
406
|
}
|
|
368
407
|
declare function useCodeOptions(options: UseCodeOptionsOptions): {
|
|
369
|
-
languageCodeOptions:
|
|
370
|
-
showLanguageIcon:
|
|
371
|
-
showLanguageName:
|
|
372
|
-
showLineNumbers:
|
|
408
|
+
languageCodeOptions: vue29.ComputedRef<CodeOptionsLanguage | undefined>;
|
|
409
|
+
showLanguageIcon: vue29.ComputedRef<boolean>;
|
|
410
|
+
showLanguageName: vue29.ComputedRef<boolean>;
|
|
411
|
+
showLineNumbers: vue29.ComputedRef<boolean>;
|
|
373
412
|
};
|
|
374
413
|
//#endregion
|
|
375
414
|
//#region src/composables/use-context.d.ts
|
|
376
415
|
interface Context {
|
|
377
416
|
isDark?: MaybeRef<boolean>;
|
|
417
|
+
icons?: MaybeRef<Record<IconName, Component>>;
|
|
378
418
|
getContainer?: () => HTMLElement | undefined;
|
|
379
419
|
onCopied?: (content: string) => void;
|
|
380
420
|
}
|
|
@@ -382,7 +422,8 @@ declare function useContext(): {
|
|
|
382
422
|
context: Context;
|
|
383
423
|
provideContext: (ctx: Partial<Context>) => void;
|
|
384
424
|
injectContext: () => Context;
|
|
385
|
-
|
|
425
|
+
icons: vue29.ComputedRef<Record<string, Component>>;
|
|
426
|
+
isDark: vue29.ComputedRef<boolean>;
|
|
386
427
|
readonly getContainer: () => HTMLElement | undefined;
|
|
387
428
|
readonly onCopied: (content: string) => void;
|
|
388
429
|
};
|
|
@@ -404,10 +445,10 @@ interface UseHardenSanitizersOptions {
|
|
|
404
445
|
isImage?: MaybeRef<boolean | undefined>;
|
|
405
446
|
}
|
|
406
447
|
declare function useHardenSanitizers(options: UseHardenSanitizersOptions): {
|
|
407
|
-
hardenOptions:
|
|
448
|
+
hardenOptions: vue29.ComputedRef<HardenOptions>;
|
|
408
449
|
transformHardenUrl: (url: string) => string | null;
|
|
409
|
-
transformedUrl:
|
|
410
|
-
isHardenUrl:
|
|
450
|
+
transformedUrl: vue29.ComputedRef<string | null>;
|
|
451
|
+
isHardenUrl: vue29.ComputedRef<boolean>;
|
|
411
452
|
};
|
|
412
453
|
//#endregion
|
|
413
454
|
//#region src/composables/use-i18n.d.ts
|
|
@@ -417,7 +458,7 @@ declare function useI18n(): {
|
|
|
417
458
|
//#endregion
|
|
418
459
|
//#region src/composables/use-katex.d.ts
|
|
419
460
|
declare function useKatex(): {
|
|
420
|
-
installed:
|
|
461
|
+
installed: vue29.Ref<boolean, boolean>;
|
|
421
462
|
render: (code: string, options?: KatexOptions$1) => Promise<{
|
|
422
463
|
html?: string;
|
|
423
464
|
error?: string;
|
|
@@ -433,9 +474,9 @@ interface UseMathRendererOptions {
|
|
|
433
474
|
throttle?: MaybeRef<number>;
|
|
434
475
|
}
|
|
435
476
|
declare function useMathRenderer(options: UseMathRendererOptions): {
|
|
436
|
-
html:
|
|
437
|
-
error:
|
|
438
|
-
errorMessage:
|
|
477
|
+
html: vue29.Ref<string, string>;
|
|
478
|
+
error: vue29.ComputedRef<boolean>;
|
|
479
|
+
errorMessage: vue29.Ref<string, string>;
|
|
439
480
|
};
|
|
440
481
|
//#endregion
|
|
441
482
|
//#region src/composables/use-mermaid.d.ts
|
|
@@ -444,7 +485,7 @@ interface UseMermaidOptions {
|
|
|
444
485
|
isDark?: MaybeRef<boolean>;
|
|
445
486
|
}
|
|
446
487
|
declare function useMermaid(options?: UseMermaidOptions): {
|
|
447
|
-
installed:
|
|
488
|
+
installed: vue29.Ref<boolean, boolean>;
|
|
448
489
|
getMermaid: () => Promise<Mermaid>;
|
|
449
490
|
parseMermaid: (code: string) => Promise<boolean>;
|
|
450
491
|
renderMermaid: (code: string) => Promise<string | null>;
|
|
@@ -460,7 +501,7 @@ interface UseShikiOptions {
|
|
|
460
501
|
isDark?: MaybeRef<boolean>;
|
|
461
502
|
}
|
|
462
503
|
declare function useShiki(options?: UseShikiOptions): {
|
|
463
|
-
installed:
|
|
504
|
+
installed: vue29.Ref<boolean, boolean>;
|
|
464
505
|
getHighlighter: () => Promise<Highlighter>;
|
|
465
506
|
codeToTokens: (code: string) => Promise<TokensResult>;
|
|
466
507
|
preload: () => Promise<void>;
|
|
@@ -473,12 +514,12 @@ interface UseTailwindV3ThemeOptions {
|
|
|
473
514
|
styleScope?: MaybeRef<string>;
|
|
474
515
|
}
|
|
475
516
|
declare function useTailwindV3Theme(options: UseTailwindV3ThemeOptions): {
|
|
476
|
-
element:
|
|
517
|
+
element: vue29.ComputedRef<Element | undefined>;
|
|
477
518
|
id: string;
|
|
478
|
-
css:
|
|
519
|
+
css: vue29.ShallowRef<string>;
|
|
479
520
|
load: () => void;
|
|
480
521
|
unload: () => void;
|
|
481
|
-
isLoaded: Readonly<
|
|
522
|
+
isLoaded: Readonly<vue29.ShallowRef<boolean>>;
|
|
482
523
|
generateCSS: () => void;
|
|
483
524
|
};
|
|
484
525
|
//#endregion
|
|
@@ -507,11 +548,11 @@ interface ZoomPanState {
|
|
|
507
548
|
translateY: number;
|
|
508
549
|
}
|
|
509
550
|
declare function useZoom(options?: UseZoomOptions): {
|
|
510
|
-
zoom:
|
|
511
|
-
translateX:
|
|
512
|
-
translateY:
|
|
513
|
-
isDragging:
|
|
514
|
-
transformStyle:
|
|
551
|
+
zoom: vue29.Ref<number, number>;
|
|
552
|
+
translateX: vue29.Ref<number, number>;
|
|
553
|
+
translateY: vue29.Ref<number, number>;
|
|
554
|
+
isDragging: vue29.Ref<boolean, boolean>;
|
|
555
|
+
transformStyle: vue29.ComputedRef<{
|
|
515
556
|
transform: string;
|
|
516
557
|
}>;
|
|
517
558
|
zoomIn: () => void;
|
|
@@ -524,48 +565,36 @@ declare function useZoom(options?: UseZoomOptions): {
|
|
|
524
565
|
handleWheel: (event: WheelEvent, containerElement: HTMLElement) => void;
|
|
525
566
|
getState: () => ZoomPanState;
|
|
526
567
|
setState: (state: Partial<ZoomPanState>) => void;
|
|
568
|
+
handleTouchStart: (event: TouchEvent, containerElement: HTMLElement) => void;
|
|
569
|
+
handleTouchMove: (event: TouchEvent, containerElement: HTMLElement) => void;
|
|
570
|
+
handleTouchEnd: (event: TouchEvent) => void;
|
|
527
571
|
};
|
|
528
572
|
//#endregion
|
|
529
|
-
//#region src/constants/code.d.ts
|
|
530
|
-
declare const DEFAULT_LIGHT_THEME = "github-light";
|
|
531
|
-
declare const DEFAULT_DARK_THEME = "github-dark";
|
|
532
|
-
declare const LANGUAGE_ALIAS: Record<string, BuiltinLanguage>;
|
|
533
|
-
declare const LANGUAGE_EXTENSIONS: Partial<Record<BuiltinLanguage, string>>;
|
|
534
|
-
declare const LANGUAGE_ICONS: Partial<Record<BuiltinLanguage | SpecialLanguage, Component>>;
|
|
535
|
-
//#endregion
|
|
536
|
-
//#region src/constants/harden.d.ts
|
|
537
|
-
declare const DEFAULT_HARDEN_OPTIONS: HardenOptions;
|
|
538
|
-
//#endregion
|
|
539
|
-
//#region src/constants/icons.d.ts
|
|
540
|
-
declare const ICONS: Record<string, Component>;
|
|
541
|
-
//#endregion
|
|
542
|
-
//#region src/constants/theme.d.ts
|
|
543
|
-
declare const SHADCN_SCHEMAS: readonly ["background", "foreground", "card", "card-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "border", "input", "ring", "chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "sidebar", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring"];
|
|
544
|
-
//#endregion
|
|
545
573
|
//#region src/index.vue.d.ts
|
|
546
|
-
declare const __VLS_export:
|
|
574
|
+
declare const __VLS_export: vue29.DefineComponent<StreamMarkdownProps, {
|
|
547
575
|
getMarkdownParser: () => MarkdownParser;
|
|
548
576
|
getParsedNodes: () => ParsedNode[];
|
|
549
|
-
}, {}, {}, {},
|
|
577
|
+
}, {}, {}, {}, vue29.ComponentOptionsMixin, vue29.ComponentOptionsMixin, {} & {
|
|
550
578
|
copied: (content: string) => any;
|
|
551
|
-
}, string,
|
|
579
|
+
}, string, vue29.PublicProps, Readonly<StreamMarkdownProps> & Readonly<{
|
|
552
580
|
onCopied?: ((content: string) => any) | undefined;
|
|
553
581
|
}>, {
|
|
554
582
|
mode: "static" | "streaming";
|
|
555
583
|
content: string;
|
|
556
|
-
nodeRenderers: Partial<Record<"blockquote" | "break" | "code" | "definition" | "delete" | "emphasis" | "footnoteDefinition" | "footnoteReference" | "heading" | "html" | "image" | "imageReference" | "inlineCode" | "link" | "linkReference" | "list" | "listItem" | "paragraph" | "strong" | "table" | "tableCell" | "tableRow" | "text" | "thematicBreak" | "yaml" | "inlineMath" | "math",
|
|
584
|
+
nodeRenderers: Partial<Record<"blockquote" | "break" | "code" | "definition" | "delete" | "emphasis" | "footnoteDefinition" | "footnoteReference" | "heading" | "html" | "image" | "imageReference" | "inlineCode" | "link" | "linkReference" | "list" | "listItem" | "paragraph" | "strong" | "table" | "tableCell" | "tableRow" | "text" | "thematicBreak" | "yaml" | "inlineMath" | "math", Component>>;
|
|
585
|
+
icons: Partial<Record<IconName, Component>>;
|
|
557
586
|
locale: string | LocaleConfig;
|
|
558
587
|
controls: ControlsConfig;
|
|
559
588
|
previewers: PreviewerConfig;
|
|
560
589
|
isDark: boolean;
|
|
561
|
-
}, {}, {}, {}, string,
|
|
590
|
+
}, {}, {}, {}, string, vue29.ComponentProvideOptions, false, {}, any>;
|
|
562
591
|
declare const _default: typeof __VLS_export;
|
|
563
592
|
//#endregion
|
|
564
593
|
//#region src/locales/index.d.ts
|
|
565
594
|
declare const SUPPORT_LANGUAGES: string[];
|
|
566
595
|
declare const localesGlob: Record<string, () => Promise<unknown>>;
|
|
567
|
-
declare const localeMessages:
|
|
568
|
-
declare const currentLocale:
|
|
596
|
+
declare const localeMessages: vue29.Ref<LocaleConfig | undefined, LocaleConfig | undefined>;
|
|
597
|
+
declare const currentLocale: vue29.Ref<string, string>;
|
|
569
598
|
declare function loadLocaleMessages(language: string | LocaleConfig): Promise<void>;
|
|
570
599
|
//#endregion
|
|
571
600
|
//#region src/postprocess/text.d.ts
|
|
@@ -803,4 +832,4 @@ declare function tableDataToTSV(data: TableData): string;
|
|
|
803
832
|
declare function escapeMarkdownTableCell(cell: string): string;
|
|
804
833
|
declare function tableDataToMarkdown(data: TableData): string;
|
|
805
834
|
//#endregion
|
|
806
|
-
export { BlockquoteNode, BlockquoteNodeRendererProps, BreakNode, BreakNodeRendererProps, CODE_PREVIEWERS, COMMON_COMPONENTS, CodeControlsConfig, CodeNode, CodeNodeRendererProps, CodeOptions, ControlsConfig, DEFAULT_DARK_THEME, DEFAULT_HARDEN_OPTIONS, DEFAULT_LIGHT_THEME, DefinitionNode, DefinitionNodeRendererProps, DeleteNode, DeleteNodeRendererProps, EmphasisNode, EmphasisNodeRendererProps, FootnoteDefinitionNode, FootnoteDefinitionNodeRendererProps, FootnoteReferenceNode, FootnoteReferenceNodeRendererProps, HardenOptions, HeadingNode, HeadingNodeRendererProps, HtmlNode, HtmlNodeRendererProps, ICONS, ImageControlsConfig, ImageNode, ImageNodeRendererProps, ImageOptions, ImageReferenceNode, ImageReferenceNodeRendererProps, InlineCodeNode, InlineCodeNodeRendererProps, InlineMathNode, InlineMathNodeRendererProps, KatexOptions, LANGUAGE_ALIAS, LANGUAGE_EXTENSIONS, LANGUAGE_ICONS, LinkNode, LinkNodeRendererProps, LinkReferenceNode, LinkReferenceNodeRendererProps, ListItemNode, ListItemNodeRendererProps, ListNode, ListNodeRendererProps, LocaleConfig, _default as Markdown, MarkdownParser, MarkdownParserOptions, MathNode, MathNodeRendererProps, MdastOptions, MermaidOptions, NODE_RENDERERS, NodeRendererListProps, NodeRendererProps, NodeRenderers, NodeType, Options, ParagraphNode, ParagraphNodeRendererProps, ParsedNode, PreviewerConfig, SHADCN_SCHEMAS, SUPPORT_LANGUAGES, SelectItem, ShikiOptions, StreamMarkdownContext, StreamMarkdownProps, StrongNode, StrongNodeRendererProps, SyntaxTree, TableCellNode, TableCellNodeRendererProps, TableControlsConfig, TableData, TableNode, TableNodeRendererProps, TableRowNode, TableRowNodeRendererProps, TextNode, TextNodeRendererProps, ThematicBreakNode, ThematicBreakNodeRendererProps, UseMathRendererOptions, UseZoomOptions, YamlNode, YamlNodeRendererProps, ZoomControlPosition, ZoomControlsConfig, ZoomPanState, codeBlockPattern, crlfPattern, currentLocale, doubleAsteriskPattern, doubleDollarPattern, doubleTildePattern, doubleUnderscorePattern, escapeMarkdownTableCell, extractTableDataFromElement, findLastLeafNode, findNodeParent, fixCode, fixDelete, fixEmphasis, fixLink, fixStrong, fixTable, fixTaskList, flow, hasKatex, hasMermaid, hasShiki, incompleteBracketPattern, incompleteLinkTextPattern, incompleteUrlPattern, loadLocaleMessages, localeMessages, localesGlob, normalize, postFixText, postprocess, preprocess, preprocessLaTeX, preprocessThinkTag, proprocessContent, quoteStandaloneDashPattern, quoteTaskListPattern, remend, save, separatorPattern, singleAsteriskPattern, singleBacktickPattern, singleUnderscorePattern, standaloneDashPattern, svgToPngBlob, tableDataToCSV, tableDataToMarkdown, tableDataToTSV, tableRowPattern, taskListPattern, trailingBackticksPattern, trailingWhitespacePattern, transformUrl, tripleBacktickPattern, useCodeOptions, useContext, useControls, useHardenSanitizers, useI18n, useKatex, useMathRenderer, useMermaid, useShiki, useTailwindV3Theme, useTippy, useZoom };
|
|
835
|
+
export { BlockquoteNode, BlockquoteNodeRendererProps, BreakNode, BreakNodeRendererProps, CODE_PREVIEWERS, COMMON_COMPONENTS, CodeControlsConfig, CodeNode, CodeNodeRendererProps, CodeOptions, CodeOptionsLanguage, ControlsConfig, DEFAULT_DARK_THEME, DEFAULT_HARDEN_OPTIONS, DEFAULT_LIGHT_THEME, DefinitionNode, DefinitionNodeRendererProps, DeleteNode, DeleteNodeRendererProps, EmphasisNode, EmphasisNodeRendererProps, FootnoteDefinitionNode, FootnoteDefinitionNodeRendererProps, FootnoteReferenceNode, FootnoteReferenceNodeRendererProps, HardenOptions, HeadingNode, HeadingNodeRendererProps, HtmlNode, HtmlNodeRendererProps, ICONS, IconName, ImageControlsConfig, ImageNode, ImageNodeRendererProps, ImageOptions, ImageReferenceNode, ImageReferenceNodeRendererProps, InlineCodeNode, InlineCodeNodeRendererProps, InlineMathNode, InlineMathNodeRendererProps, KatexOptions, LANGUAGE_ALIAS, LANGUAGE_EXTENSIONS, LANGUAGE_ICONS, LinkNode, LinkNodeRendererProps, LinkReferenceNode, LinkReferenceNodeRendererProps, ListItemNode, ListItemNodeRendererProps, ListNode, ListNodeRendererProps, LocaleConfig, _default as Markdown, MarkdownParser, MarkdownParserOptions, MathNode, MathNodeRendererProps, MdastOptions, MermaidOptions, NODE_RENDERERS, NodeRendererListProps, NodeRendererProps, NodeRenderers, NodeType, Options, ParagraphNode, ParagraphNodeRendererProps, ParsedNode, PreviewerConfig, SHADCN_SCHEMAS, SUPPORT_LANGUAGES, SelectItem, ShikiOptions, StreamMarkdownContext, StreamMarkdownProps, StrongNode, StrongNodeRendererProps, SyntaxTree, TableCellNode, TableCellNodeRendererProps, TableControlsConfig, TableData, TableNode, TableNodeRendererProps, TableRowNode, TableRowNodeRendererProps, TextNode, TextNodeRendererProps, ThematicBreakNode, ThematicBreakNodeRendererProps, UseMathRendererOptions, UseZoomOptions, YamlNode, YamlNodeRendererProps, ZoomControlPosition, ZoomControlsConfig, ZoomPanState, codeBlockPattern, crlfPattern, currentLocale, doubleAsteriskPattern, doubleDollarPattern, doubleTildePattern, doubleUnderscorePattern, escapeMarkdownTableCell, extractTableDataFromElement, findLastLeafNode, findNodeParent, fixCode, fixDelete, fixEmphasis, fixLink, fixStrong, fixTable, fixTaskList, flow, hasKatex, hasMermaid, hasShiki, incompleteBracketPattern, incompleteLinkTextPattern, incompleteUrlPattern, loadLocaleMessages, localeMessages, localesGlob, normalize, postFixText, postprocess, preprocess, preprocessLaTeX, preprocessThinkTag, proprocessContent, quoteStandaloneDashPattern, quoteTaskListPattern, remend, save, separatorPattern, singleAsteriskPattern, singleBacktickPattern, singleUnderscorePattern, standaloneDashPattern, svgToPngBlob, tableDataToCSV, tableDataToMarkdown, tableDataToTSV, tableRowPattern, taskListPattern, trailingBackticksPattern, trailingWhitespacePattern, transformUrl, tripleBacktickPattern, useCodeOptions, useContext, useControls, useHardenSanitizers, useI18n, useKatex, useMathRenderer, useMermaid, useShiki, useTailwindV3Theme, useTippy, useZoom };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { t as CODE_PREVIEWERS } from "./previewers-
|
|
2
|
-
import { A as transformUrl, B as useContext, C as findNodeParent, D as flow, E as hasShiki, F as DEFAULT_LIGHT_THEME, I as LANGUAGE_ALIAS, L as LANGUAGE_EXTENSIONS, M as ICONS, N as DEFAULT_HARDEN_OPTIONS, O as save, P as DEFAULT_DARK_THEME, R as LANGUAGE_ICONS, S as findLastLeafNode, T as hasMermaid, V as useCodeOptions, _ as escapeMarkdownTableCell, a as useMermaid, b as tableDataToMarkdown, c as _defineProperty, d as SUPPORT_LANGUAGES, f as currentLocale, g as useHardenSanitizers, h as localesGlob, i as useShiki, j as SHADCN_SCHEMAS, k as svgToPngBlob, l as useKatex, m as localeMessages, n as useTippy, o as useMathRenderer, p as loadLocaleMessages, r as useTailwindV3Theme, t as useZoom, u as useI18n, v as extractTableDataFromElement, w as hasKatex, x as tableDataToTSV, y as tableDataToCSV, z as useControls } from "./composables-
|
|
1
|
+
import { t as CODE_PREVIEWERS } from "./previewers-ByaS2Ksa.js";
|
|
2
|
+
import { A as transformUrl, B as useContext, C as findNodeParent, D as flow, E as hasShiki, F as DEFAULT_LIGHT_THEME, I as LANGUAGE_ALIAS, L as LANGUAGE_EXTENSIONS, M as ICONS, N as DEFAULT_HARDEN_OPTIONS, O as save, P as DEFAULT_DARK_THEME, R as LANGUAGE_ICONS, S as findLastLeafNode, T as hasMermaid, V as useCodeOptions, _ as escapeMarkdownTableCell, a as useMermaid, b as tableDataToMarkdown, c as _defineProperty, d as SUPPORT_LANGUAGES, f as currentLocale, g as useHardenSanitizers, h as localesGlob, i as useShiki, j as SHADCN_SCHEMAS, k as svgToPngBlob, l as useKatex, m as localeMessages, n as useTippy, o as useMathRenderer, p as loadLocaleMessages, r as useTailwindV3Theme, t as useZoom, u as useI18n, v as extractTableDataFromElement, w as hasKatex, x as tableDataToTSV, y as tableDataToCSV, z as useControls } from "./composables-Cx0nvyHl.js";
|
|
3
3
|
import { t as node_list_default } from "./node-list-CGr_EVtn.js";
|
|
4
4
|
import { computed, createElementBlock, createVNode, defineAsyncComponent, defineComponent, mergeProps, normalizeClass, onBeforeUnmount, openBlock, ref, toRefs, unref, watch } from "vue";
|
|
5
5
|
import mediumZoom from "medium-zoom";
|
|
6
6
|
import { MarkdownItAsync } from "markdown-it-async";
|
|
7
7
|
import remend from "remend";
|
|
8
|
+
import "medium-zoom/dist/style.css";
|
|
8
9
|
|
|
9
10
|
//#region rolldown:runtime
|
|
10
11
|
var __create = Object.create;
|
|
@@ -50,20 +51,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
50
51
|
//#region src/components/renderers/index.ts
|
|
51
52
|
const NODE_RENDERERS = {
|
|
52
53
|
blockquote: defineAsyncComponent(() => import("./blockquote-DdEg2gww.js")),
|
|
53
|
-
code: defineAsyncComponent(() => import("./code-
|
|
54
|
+
code: defineAsyncComponent(() => import("./code-BxWvKFxG.js")),
|
|
54
55
|
delete: defineAsyncComponent(() => import("./delete-BdWzKJCy.js")),
|
|
55
56
|
emphasis: defineAsyncComponent(() => import("./emphasis-CTuGt1Ok.js")),
|
|
56
57
|
heading: defineAsyncComponent(() => import("./heading-2vpQQtTH.js")),
|
|
57
|
-
image: defineAsyncComponent(() => import("./image-
|
|
58
|
+
image: defineAsyncComponent(() => import("./image-BDtPwitR.js")),
|
|
58
59
|
inlineCode: defineAsyncComponent(() => import("./inline-code-CBoqhfz7.js")),
|
|
59
|
-
inlineMath: defineAsyncComponent(() => import("./inline-math-
|
|
60
|
-
link: defineAsyncComponent(() => import("./link-
|
|
60
|
+
inlineMath: defineAsyncComponent(() => import("./inline-math-CAqboT7h.js")),
|
|
61
|
+
link: defineAsyncComponent(() => import("./link-C8BSlPhZ.js")),
|
|
61
62
|
list: defineAsyncComponent(() => import("./list-BCiFKGaz.js")),
|
|
62
63
|
listItem: defineAsyncComponent(() => import("./list-item-p-OLUR_9.js")),
|
|
63
|
-
math: defineAsyncComponent(() => import("./math-
|
|
64
|
+
math: defineAsyncComponent(() => import("./math-CT1TB2pK.js")),
|
|
64
65
|
paragraph: defineAsyncComponent(() => import("./paragraph-DYjqr_Sa.js")),
|
|
65
66
|
strong: defineAsyncComponent(() => import("./strong-CvOjLZiq.js")),
|
|
66
|
-
table: defineAsyncComponent(() => import("./table-
|
|
67
|
+
table: defineAsyncComponent(() => import("./table-l_3z210v.js")),
|
|
67
68
|
text: defineAsyncComponent(() => import("./text-DuONUqRA.js")),
|
|
68
69
|
thematicBreak: defineAsyncComponent(() => import("./thematic-break-CcNPEI9Y.js")),
|
|
69
70
|
yaml: defineAsyncComponent(() => import("./yaml-DJHrmzSe.js"))
|
|
@@ -72,17 +73,17 @@ const NODE_RENDERERS = {
|
|
|
72
73
|
//#endregion
|
|
73
74
|
//#region src/components/index.ts
|
|
74
75
|
const COMMON_COMPONENTS = {
|
|
75
|
-
Button: defineAsyncComponent(() => import("./button-
|
|
76
|
-
CodeBlock: defineAsyncComponent(() => import("./code-block-
|
|
77
|
-
Dropdown: defineAsyncComponent(() => import("./dropdown-
|
|
78
|
-
ErrorComponent: defineAsyncComponent(() => import("./error-component-
|
|
76
|
+
Button: defineAsyncComponent(() => import("./button-D6ccVxGm.js")),
|
|
77
|
+
CodeBlock: defineAsyncComponent(() => import("./code-block-B72JfFy-.js")),
|
|
78
|
+
Dropdown: defineAsyncComponent(() => import("./dropdown-oiCw8QVq.js")),
|
|
79
|
+
ErrorComponent: defineAsyncComponent(() => import("./error-component-8y13-fYG.js")),
|
|
79
80
|
Modal: defineAsyncComponent(() => import("./modal-DcpxxDDX.js")),
|
|
80
81
|
NodeList: defineAsyncComponent(() => import("./node-list-lgY1wbfQ.js")),
|
|
81
|
-
Segmented: defineAsyncComponent(() => import("./segmented-
|
|
82
|
+
Segmented: defineAsyncComponent(() => import("./segmented-B4IEw3wg.js")),
|
|
82
83
|
Spin: defineAsyncComponent(() => import("./spin-Bz4zGBEo.js")),
|
|
83
84
|
Table: defineAsyncComponent(() => import("./table-CZLbUHiJ.js")),
|
|
84
|
-
Tooltip: defineAsyncComponent(() => import("./tooltip-
|
|
85
|
-
ZoomContainer: defineAsyncComponent(() => import("./zoom-container-
|
|
85
|
+
Tooltip: defineAsyncComponent(() => import("./tooltip-CAoc_U1X.js")),
|
|
86
|
+
ZoomContainer: defineAsyncComponent(() => import("./zoom-container-DBgGdbJS.js"))
|
|
86
87
|
};
|
|
87
88
|
|
|
88
89
|
//#endregion
|
|
@@ -18270,6 +18271,11 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
18270
18271
|
required: false,
|
|
18271
18272
|
default: () => ({})
|
|
18272
18273
|
},
|
|
18274
|
+
icons: {
|
|
18275
|
+
type: Object,
|
|
18276
|
+
required: false,
|
|
18277
|
+
default: () => ({})
|
|
18278
|
+
},
|
|
18273
18279
|
locale: {
|
|
18274
18280
|
type: [String, Object],
|
|
18275
18281
|
required: false,
|
|
@@ -18339,7 +18345,7 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
18339
18345
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
18340
18346
|
const props = __props;
|
|
18341
18347
|
const emits = __emit;
|
|
18342
|
-
const { isDark } = toRefs(props);
|
|
18348
|
+
const { shikiOptions, mermaidOptions, isDark } = toRefs(props);
|
|
18343
18349
|
const containerRef = ref();
|
|
18344
18350
|
const { provideContext } = useContext();
|
|
18345
18351
|
const { initTippy } = useTippy({ isDark });
|
|
@@ -18355,11 +18361,15 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
18355
18361
|
...NODE_RENDERERS,
|
|
18356
18362
|
...props.nodeRenderers
|
|
18357
18363
|
}));
|
|
18364
|
+
const icons = computed(() => ({
|
|
18365
|
+
...ICONS,
|
|
18366
|
+
...props.icons
|
|
18367
|
+
}));
|
|
18358
18368
|
function getContainer() {
|
|
18359
18369
|
return containerRef.value;
|
|
18360
18370
|
}
|
|
18361
|
-
const { preload: preloadShiki, dispose: disposeShiki } = useShiki();
|
|
18362
|
-
const { preload: preloadMermaid, dispose: disposeMermaid } = useMermaid();
|
|
18371
|
+
const { preload: preloadShiki, dispose: disposeShiki } = useShiki({ shikiOptions });
|
|
18372
|
+
const { preload: preloadMermaid, dispose: disposeMermaid } = useMermaid({ mermaidOptions });
|
|
18363
18373
|
const { preload: preloadKatex, dispose: disposeKatex } = useKatex();
|
|
18364
18374
|
async function bootstrap() {
|
|
18365
18375
|
initTippy();
|
|
@@ -18376,6 +18386,7 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
18376
18386
|
watch(() => props.mode, () => markdownParser.updateMode(props.mode));
|
|
18377
18387
|
watch(() => props.locale, () => loadLocaleMessages(props.locale));
|
|
18378
18388
|
provideContext({
|
|
18389
|
+
icons,
|
|
18379
18390
|
isDark,
|
|
18380
18391
|
getContainer,
|
|
18381
18392
|
onCopied: (content$2) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as useMathRenderer } from "./composables-
|
|
2
|
-
import { t as error_component_default } from "./error-component-
|
|
1
|
+
import { o as useMathRenderer } from "./composables-Cx0nvyHl.js";
|
|
2
|
+
import { t as error_component_default } from "./error-component-Bhl770lu.js";
|
|
3
3
|
import { computed, createBlock, createCommentVNode, createElementBlock, defineComponent, mergeProps, openBlock, resolveDynamicComponent, toRefs, unref } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/components/renderers/inline-math.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as useHardenSanitizers } from "./composables-
|
|
1
|
+
import { g as useHardenSanitizers } from "./composables-Cx0nvyHl.js";
|
|
2
2
|
import { t as node_list_default } from "./node-list-CGr_EVtn.js";
|
|
3
|
-
import { t as error_component_default } from "./error-component-
|
|
3
|
+
import { t as error_component_default } from "./error-component-Bhl770lu.js";
|
|
4
4
|
import { computed, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, mergeProps, openBlock, resolveDynamicComponent, toRefs, unref, withCtx } from "vue";
|
|
5
5
|
|
|
6
6
|
//#region src/components/renderers/link.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as useMathRenderer } from "./composables-
|
|
2
|
-
import { t as error_component_default } from "./error-component-
|
|
1
|
+
import { o as useMathRenderer } from "./composables-Cx0nvyHl.js";
|
|
2
|
+
import { t as error_component_default } from "./error-component-Bhl770lu.js";
|
|
3
3
|
import { computed, createBlock, createCommentVNode, createElementBlock, defineComponent, mergeProps, openBlock, resolveDynamicComponent, toRefs, unref } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/components/renderers/math.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as useMermaid, s as throttle, z as useControls } from "./composables-
|
|
2
|
-
import "./tooltip-
|
|
3
|
-
import "./button-
|
|
4
|
-
import { t as error_component_default } from "./error-component-
|
|
1
|
+
import { a as useMermaid, s as throttle, z as useControls } from "./composables-Cx0nvyHl.js";
|
|
2
|
+
import "./tooltip-3UDC9mw-.js";
|
|
3
|
+
import "./button-jFTF378X.js";
|
|
4
|
+
import { t as error_component_default } from "./error-component-Bhl770lu.js";
|
|
5
5
|
import { t as spin_default } from "./spin-Ds5W7qC_.js";
|
|
6
|
-
import { t as zoom_container_default } from "./zoom-container-
|
|
6
|
+
import { t as zoom_container_default } from "./zoom-container-gjQ0EMyk.js";
|
|
7
7
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, normalizeStyle, openBlock, ref, resolveDynamicComponent, toRefs, watch, withCtx } from "vue";
|
|
8
8
|
import { useResizeObserver } from "@vueuse/core";
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import { defineAsyncComponent } from "vue";
|
|
|
3
3
|
//#region src/components/previewers/index.ts
|
|
4
4
|
const CODE_PREVIEWERS = {
|
|
5
5
|
html: defineAsyncComponent(() => import("./html-DL0PcUXX.js")),
|
|
6
|
-
mermaid: defineAsyncComponent(() => import("./mermaid-
|
|
6
|
+
mermaid: defineAsyncComponent(() => import("./mermaid-CYrA8rCl.js"))
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as button_default } from "./button-
|
|
1
|
+
import { t as button_default } from "./button-jFTF378X.js";
|
|
2
2
|
import { Fragment, createBlock, createElementBlock, defineComponent, mergeModels, openBlock, renderList, useModel } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/components/segmented.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as useCodeOptions, i as useShiki } from "./composables-
|
|
2
|
-
import { t as vanilla_default } from "./vanilla-
|
|
1
|
+
import { V as useCodeOptions, i as useShiki } from "./composables-Cx0nvyHl.js";
|
|
2
|
+
import { t as vanilla_default } from "./vanilla-CFWVwBvD.js";
|
|
3
3
|
import { computed, createBlock, createCommentVNode, defineAsyncComponent, defineComponent, mergeProps, normalizeProps, openBlock, ref, toRefs, unref, watch } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/components/renderers/code/shiki.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as useContext,
|
|
1
|
+
import { B as useContext, O as save, b as tableDataToMarkdown, u as useI18n, v as extractTableDataFromElement, x as tableDataToTSV, y as tableDataToCSV, z as useControls } from "./composables-Cx0nvyHl.js";
|
|
2
2
|
import { t as node_list_default } from "./node-list-CGr_EVtn.js";
|
|
3
|
-
import "./tooltip-
|
|
4
|
-
import { t as button_default } from "./button-
|
|
3
|
+
import "./tooltip-3UDC9mw-.js";
|
|
4
|
+
import { t as button_default } from "./button-jFTF378X.js";
|
|
5
5
|
import { t as spin_default } from "./spin-Ds5W7qC_.js";
|
|
6
6
|
import { t as table_default$1 } from "./table-4ec9FVB_.js";
|
|
7
7
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, openBlock, ref, renderList, withCtx } from "vue";
|
|
@@ -78,6 +78,7 @@ var table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
78
78
|
setup(__props) {
|
|
79
79
|
const props = __props;
|
|
80
80
|
const { t } = useI18n();
|
|
81
|
+
const { icons } = useContext();
|
|
81
82
|
const { onCopied } = useContext();
|
|
82
83
|
const { copy, copied } = useClipboard({ legacy: true });
|
|
83
84
|
const { isControlEnabled } = useControls({ controls: props.controls });
|
|
@@ -130,7 +131,7 @@ var table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
130
131
|
const controls = computed(() => [{
|
|
131
132
|
name: t("button.copy"),
|
|
132
133
|
key: "copy",
|
|
133
|
-
icon: copied.value ?
|
|
134
|
+
icon: copied.value ? icons.value.check : icons.value.copy,
|
|
134
135
|
options,
|
|
135
136
|
visible: () => showCopy.value,
|
|
136
137
|
onClick: (_event, item) => {
|
|
@@ -142,7 +143,7 @@ var table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
142
143
|
}, {
|
|
143
144
|
name: t("button.download"),
|
|
144
145
|
key: "download",
|
|
145
|
-
icon:
|
|
146
|
+
icon: icons.value.download,
|
|
146
147
|
options,
|
|
147
148
|
visible: () => showDownload.value,
|
|
148
149
|
onClick: (_event, item) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as useContext } from "./composables-
|
|
1
|
+
import { B as useContext } from "./composables-Cx0nvyHl.js";
|
|
2
2
|
import { computed, createBlock, createElementVNode, defineComponent, openBlock, ref, renderSlot, toDisplayString, unref, withCtx } from "vue";
|
|
3
3
|
import { Tippy } from "vue-tippy";
|
|
4
4
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as button_default } from "./button-
|
|
1
|
+
import { B as useContext, t as useZoom, u as useI18n } from "./composables-Cx0nvyHl.js";
|
|
2
|
+
import { t as button_default } from "./button-jFTF378X.js";
|
|
3
3
|
import { computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeStyle, openBlock, ref, renderSlot, unref, withModifiers } from "vue";
|
|
4
4
|
|
|
5
5
|
//#region src/components/zoom-container.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -22,7 +22,8 @@ var zoom_container_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
22
22
|
const props = __props;
|
|
23
23
|
const containerRef = ref();
|
|
24
24
|
const { t } = useI18n();
|
|
25
|
-
const {
|
|
25
|
+
const { icons } = useContext();
|
|
26
|
+
const { zoom, isDragging, transformStyle, zoomIn, zoomOut, resetZoom, startDrag, onDrag, stopDrag, handleWheel, handleTouchStart, handleTouchMove, handleTouchEnd } = useZoom();
|
|
26
27
|
const zoomPercent = computed(() => `${Math.round(zoom.value * 100)}%`);
|
|
27
28
|
const controlsStyle = computed(() => {
|
|
28
29
|
switch (props.position) {
|
|
@@ -48,12 +49,24 @@ var zoom_container_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
48
49
|
function onWheel(event) {
|
|
49
50
|
if (containerRef.value) handleWheel(event, containerRef.value);
|
|
50
51
|
}
|
|
52
|
+
function onTouchStart(event) {
|
|
53
|
+
if (containerRef.value) handleTouchStart(event, containerRef.value);
|
|
54
|
+
}
|
|
55
|
+
function onTouchMove(event) {
|
|
56
|
+
if (containerRef.value) handleTouchMove(event, containerRef.value);
|
|
57
|
+
}
|
|
58
|
+
function onTouchEnd(event) {
|
|
59
|
+
handleTouchEnd(event);
|
|
60
|
+
}
|
|
51
61
|
return (_ctx, _cache) => {
|
|
52
62
|
return openBlock(), createElementBlock("div", {
|
|
53
63
|
ref_key: "containerRef",
|
|
54
64
|
ref: containerRef,
|
|
55
65
|
"data-stream-markdown": "zoom-container",
|
|
56
66
|
onWheel,
|
|
67
|
+
onTouchstart: onTouchStart,
|
|
68
|
+
onTouchmove: onTouchMove,
|
|
69
|
+
onTouchend: onTouchEnd,
|
|
57
70
|
onPointerdown: _cache[0] || (_cache[0] = withModifiers((...args) => unref(startDrag) && unref(startDrag)(...args), ["prevent"])),
|
|
58
71
|
onPointermove: _cache[1] || (_cache[1] = withModifiers((...args) => unref(onDrag) && unref(onDrag)(...args), ["prevent"])),
|
|
59
72
|
onPointerup: _cache[2] || (_cache[2] = withModifiers((...args) => unref(stopDrag) && unref(stopDrag)(...args), ["prevent"])),
|
|
@@ -65,7 +78,7 @@ var zoom_container_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
65
78
|
style: normalizeStyle(controlsStyle.value)
|
|
66
79
|
}, [
|
|
67
80
|
createVNode(button_default, {
|
|
68
|
-
icon: unref(
|
|
81
|
+
icon: unref(icons).zoomIn,
|
|
69
82
|
name: unref(t)("button.zoomIn"),
|
|
70
83
|
onClick: unref(zoomIn)
|
|
71
84
|
}, null, 8, [
|
|
@@ -74,7 +87,7 @@ var zoom_container_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
74
87
|
"onClick"
|
|
75
88
|
]),
|
|
76
89
|
createVNode(button_default, {
|
|
77
|
-
icon: unref(
|
|
90
|
+
icon: unref(icons).zoomOut,
|
|
78
91
|
name: unref(t)("button.zoomOut"),
|
|
79
92
|
onClick: unref(zoomOut)
|
|
80
93
|
}, null, 8, [
|
package/package.json
CHANGED
package/dist/button-2wMU7qkH.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import "./previewers-qHMi6xZ3.js";
|
|
2
|
-
import "./composables-Cj6_jbwr.js";
|
|
3
|
-
import "./tooltip-gxsqaBNg.js";
|
|
4
|
-
import "./button-CJyeXWq2.js";
|
|
5
|
-
import "./modal-CuQR21UD.js";
|
|
6
|
-
import { t as code_block_default } from "./code-block-CQ4lgva1.js";
|
|
7
|
-
import "./segmented-CF6exjdD.js";
|
|
8
|
-
|
|
9
|
-
export { code_block_default as default };
|
package/dist/tooltip-BzVZqo7w.js
DELETED
package/dist/vanilla-CKj7EQLx.js
DELETED