vue-stream-markdown 0.2.2 → 0.3.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.
Files changed (69) hide show
  1. package/README.md +5 -1
  2. package/dist/{blockquote-CVFraiyL.js → blockquote-DTo6zg12.js} +6 -2
  3. package/dist/{break-CzrM3nW0.js → break-DoDPjOA0.js} +4 -0
  4. package/dist/button-1EHxh8s2.js +6 -0
  5. package/dist/{button-CWSGNZmd.js → button-B7H9jKmU.js} +2 -2
  6. package/dist/{code-DwwmPoup.js → code-DC7KVCvB.js} +14 -10
  7. package/dist/{code-block-XfHjZodV.js → code-block-DPC1FZT3.js} +26 -13
  8. package/dist/code-block-DYrPMONb.js +10 -0
  9. package/dist/{composables-BMXMKLLj.js → composables-BvaSMf02.js} +17 -2
  10. package/dist/{delete-BRwEUU72.js → delete-xkkM7TML.js} +6 -2
  11. package/dist/dropdown-Cv_yW4GS.js +6 -0
  12. package/dist/{emphasis-DblyP-Vp.js → emphasis-BmM30dZi.js} +6 -2
  13. package/dist/error-component-1U-JNS6o.js +5 -0
  14. package/dist/{error-component-CckClFee.js → error-component-DFBWdaYB.js} +2 -2
  15. package/dist/{footnote-definition-BvZNKSLa.js → footnote-definition-6cTbdg-J.js} +9 -5
  16. package/dist/{footnote-reference-DvAxMjRZ.js → footnote-reference-CxJUg8wT.js} +5 -1
  17. package/dist/{heading-g87txbB0.js → heading-DQ4lofbm.js} +6 -2
  18. package/dist/{html-BG83dEZJ.js → html-Be_6ezK6.js} +4 -0
  19. package/dist/{html-D7bGx0Cz.js → html-DfTs9nEm.js} +4 -0
  20. package/dist/{icon-CpKYt1dR.js → icon-BJa4ovUe.js} +1 -1
  21. package/dist/icon-CvIgAOPh.js +4 -0
  22. package/dist/{image-Dwe5A7RP.js → image-DXu2WF2r.js} +13 -10
  23. package/dist/image-Dm5xIWs7.js +9 -0
  24. package/dist/{image-CR28eDok.js → image-e0E51Nc3.js} +21 -12
  25. package/dist/index.css +130 -144
  26. package/dist/index.d.ts +211 -148
  27. package/dist/index.js +452 -247
  28. package/dist/{inline-code-E5uGvmnx.js → inline-code-B5lfHACE.js} +4 -0
  29. package/dist/{inline-math-BHDNxQ5R.js → inline-math-BuO_dWPX.js} +7 -3
  30. package/dist/{link-BiA46FMM.js → link-DyD59DzG.js} +8 -4
  31. package/dist/{list-D7QyoGUy.js → list-De0KPajx.js} +6 -2
  32. package/dist/{list-item-Cv8l3Ufd.js → list-item-CuUgvXRC.js} +6 -2
  33. package/dist/{math-BzuYH4PG.js → math-DnFOOLdz.js} +7 -3
  34. package/dist/{mermaid-BoiSJ4fF.js → mermaid-ZCQPlRUa.js} +22 -8
  35. package/dist/modal-B5jFKJL4.js +4 -0
  36. package/dist/{modal-DHGxvCt5.js → modal-Bhe0iSs6.js} +8 -5
  37. package/dist/{node-list-D6zJX92N.js → node-list-CWy--Gin.js} +7 -78
  38. package/dist/node-list-Doh9Z-4p.js +4 -0
  39. package/dist/{paragraph-YTqe84Bm.js → paragraph-D3H1qprZ.js} +6 -2
  40. package/dist/previewers-DB2HHDGb.js +10 -0
  41. package/dist/{segmented-DDQZGL7l.js → segmented-B-kjIOkd.js} +1 -1
  42. package/dist/segmented-fbmq_xK1.js +7 -0
  43. package/dist/{shiki-DDfRFzy0.js → shiki-DAu2_FTG.js} +7 -3
  44. package/dist/{strong-nPwCJEKq.js → strong-BlCQoXCR.js} +6 -2
  45. package/dist/{table-Dtpd-MnT.js → table-Co_MpK6m.js} +17 -8
  46. package/dist/{text-CfRWiRE0.js → text-DbHMEN3P.js} +4 -0
  47. package/dist/{thematic-break-DgOD2KmY.js → thematic-break-CdlhHAEZ.js} +4 -0
  48. package/dist/theme.css +2 -2
  49. package/dist/tooltip-70WIAMmC.js +4 -0
  50. package/dist/{tooltip-C4RiUZwy.js → tooltip-CWv9skVu.js} +3 -2
  51. package/dist/{vanilla-NR7MOE5P.js → vanilla-D30b-_ch.js} +1 -1
  52. package/dist/vanilla-DV7fYrnj.js +4 -0
  53. package/dist/{yaml-DP0yfJyS.js → yaml-DL5ozHZ_.js} +4 -0
  54. package/dist/{zoom-container-CqZQ4X6w.js → zoom-container-DbeN8U39.js} +33 -9
  55. package/dist/zoom-container-Dc8N-wuo.js +7 -0
  56. package/package.json +4 -5
  57. package/dist/button-BFS-gHGF.js +0 -6
  58. package/dist/code-block-CTM9VEwA.js +0 -10
  59. package/dist/dropdown-BQ3uynLf.js +0 -6
  60. package/dist/error-component-B_Vacrqa.js +0 -5
  61. package/dist/icon-BX3KKloR.js +0 -4
  62. package/dist/image-BtkXhzG1.js +0 -9
  63. package/dist/modal-CFOdkYNj.js +0 -4
  64. package/dist/node-list-BYDvt6bq.js +0 -4
  65. package/dist/previewers-Cpx1Wqu8.js +0 -10
  66. package/dist/segmented-CaVb5_Rp.js +0 -7
  67. package/dist/tooltip-BIvCaFUj.js +0 -4
  68. package/dist/vanilla-DfHiHWnr.js +0 -4
  69. package/dist/zoom-container-DtkZ07v1.js +0 -7
@@ -1,5 +1,5 @@
1
- import { b as useI18n, t as useZoom } from "./composables-BMXMKLLj.js";
2
- import { t as button_default } from "./button-CWSGNZmd.js";
1
+ import { b as useI18n, t as useZoom } from "./composables-BvaSMf02.js";
2
+ import { t as button_default } from "./button-B7H9jKmU.js";
3
3
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, normalizeStyle, openBlock, ref, renderList, renderSlot, unref, withModifiers } from "vue";
4
4
 
5
5
  //#region src/components/zoom-container.vue?vue&type=script&setup=true&lang.ts
@@ -7,6 +7,11 @@ const _hoisted_1 = { "data-stream-markdown": "zoom-inner" };
7
7
  var zoom_container_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
8
8
  __name: "zoom-container",
9
9
  props: {
10
+ interactive: {
11
+ type: Boolean,
12
+ required: false,
13
+ default: true
14
+ },
10
15
  showControl: {
11
16
  type: Boolean,
12
17
  required: false,
@@ -99,13 +104,31 @@ var zoom_container_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
99
104
  function onWheel(event) {
100
105
  if (containerRef.value) handleWheel(event, containerRef.value);
101
106
  }
107
+ function onPointerDown(event) {
108
+ if (!props.interactive) return;
109
+ event.preventDefault();
110
+ startDrag(event);
111
+ }
112
+ function onPointerMove(event) {
113
+ if (!props.interactive) return;
114
+ event.preventDefault();
115
+ onDrag(event);
116
+ }
117
+ function onPointerUp(event) {
118
+ if (!props.interactive) return;
119
+ event.preventDefault();
120
+ stopDrag();
121
+ }
102
122
  function onTouchStart(event) {
123
+ if (!props.interactive) return;
103
124
  if (containerRef.value) handleTouchStart(event, containerRef.value);
104
125
  }
105
126
  function onTouchMove(event) {
127
+ if (!props.interactive) return;
106
128
  if (containerRef.value) handleTouchMove(event, containerRef.value);
107
129
  }
108
130
  function onTouchEnd(event) {
131
+ if (!props.interactive) return;
109
132
  handleTouchEnd(event);
110
133
  }
111
134
  return (_ctx, _cache) => {
@@ -113,16 +136,17 @@ var zoom_container_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
113
136
  ref_key: "containerRef",
114
137
  ref: containerRef,
115
138
  "data-stream-markdown": "zoom-container",
139
+ style: normalizeStyle({ touchAction: __props.interactive ? "none" : "auto" }),
116
140
  onWheel,
117
141
  onTouchstart: onTouchStart,
118
142
  onTouchmove: onTouchMove,
119
143
  onTouchend: onTouchEnd,
120
- onPointerdown: _cache[2] || (_cache[2] = withModifiers((...args) => unref(startDrag) && unref(startDrag)(...args), ["prevent"])),
121
- onPointermove: _cache[3] || (_cache[3] = withModifiers((...args) => unref(onDrag) && unref(onDrag)(...args), ["prevent"])),
122
- onPointerup: _cache[4] || (_cache[4] = withModifiers((...args) => unref(stopDrag) && unref(stopDrag)(...args), ["prevent"])),
123
- onPointercancel: _cache[5] || (_cache[5] = withModifiers((...args) => unref(stopDrag) && unref(stopDrag)(...args), ["prevent"])),
124
- onPointerleave: _cache[6] || (_cache[6] = withModifiers((...args) => unref(stopDrag) && unref(stopDrag)(...args), ["prevent"]))
125
- }, [__props.showControl ? (openBlock(), createElementBlock("div", {
144
+ onPointerdown: onPointerDown,
145
+ onPointermove: onPointerMove,
146
+ onPointerup: onPointerUp,
147
+ onPointercancel: onPointerUp,
148
+ onPointerleave: onPointerUp
149
+ }, [__props.showControl && __props.interactive ? (openBlock(), createElementBlock("div", {
126
150
  key: 0,
127
151
  "data-stream-markdown": "zoom-controls",
128
152
  style: normalizeStyle(controlsPosition.value),
@@ -140,7 +164,7 @@ var zoom_container_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
140
164
  cursor: unref(isDragging) ? "grabbing" : "grab"
141
165
  }),
142
166
  onClick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"]))
143
- }, [renderSlot(_ctx.$slots, "default")], 4)])], 544);
167
+ }, [renderSlot(_ctx.$slots, "default")], 4)])], 36);
144
168
  };
145
169
  }
146
170
  });
@@ -0,0 +1,7 @@
1
+ import "./composables-BvaSMf02.js";
2
+ import "./tooltip-CWv9skVu.js";
3
+ import "./button-B7H9jKmU.js";
4
+ import "./icon-BJa4ovUe.js";
5
+ import { t as zoom_container_default } from "./zoom-container-DbeN8U39.js";
6
+
7
+ export { zoom_container_default as default };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vue-stream-markdown",
3
3
  "type": "module",
4
- "version": "0.2.2",
4
+ "version": "0.3.0",
5
5
  "description": "Streaming markdown output, Useful for text streams like LLM outputs.",
6
6
  "author": "jinghaihan",
7
7
  "license": "MIT",
@@ -18,8 +18,8 @@
18
18
  "markdown",
19
19
  "stream",
20
20
  "mermaid",
21
- "latex",
22
21
  "katex",
22
+ "latex",
23
23
  "customizable"
24
24
  ],
25
25
  "exports": {
@@ -53,9 +53,7 @@
53
53
  },
54
54
  "dependencies": {
55
55
  "@floating-ui/dom": "^1.7.4",
56
- "@vueuse/core": "^14.1.0",
57
- "markdown-it-async": "^2.2.0",
58
- "remend": "^1.0.1"
56
+ "@vueuse/core": "^14.1.0"
59
57
  },
60
58
  "devDependencies": {
61
59
  "@antfu/eslint-config": "^6.7.1",
@@ -69,6 +67,7 @@
69
67
  "@unocss/eslint-plugin": "66.5.9",
70
68
  "@unocss/nuxt": "^66.5.10",
71
69
  "@vitejs/plugin-vue": "^6.0.3",
70
+ "@vitest/coverage-v8": "^4.0.15",
72
71
  "@vue/test-utils": "^2.4.6",
73
72
  "@vueuse/nuxt": "^14.1.0",
74
73
  "bumpp": "^10.3.2",
@@ -1,6 +0,0 @@
1
- import "./composables-BMXMKLLj.js";
2
- import "./tooltip-C4RiUZwy.js";
3
- import { t as button_default } from "./button-CWSGNZmd.js";
4
- import "./icon-CpKYt1dR.js";
5
-
6
- export { button_default as default };
@@ -1,10 +0,0 @@
1
- import "./previewers-Cpx1Wqu8.js";
2
- import "./composables-BMXMKLLj.js";
3
- import "./tooltip-C4RiUZwy.js";
4
- import "./button-CWSGNZmd.js";
5
- import "./icon-CpKYt1dR.js";
6
- import "./modal-DHGxvCt5.js";
7
- import { t as code_block_default } from "./code-block-XfHjZodV.js";
8
- import "./segmented-DDQZGL7l.js";
9
-
10
- export { code_block_default as default };
@@ -1,6 +0,0 @@
1
- import "./composables-BMXMKLLj.js";
2
- import "./tooltip-C4RiUZwy.js";
3
- import { n as dropdown_default } from "./button-CWSGNZmd.js";
4
- import "./icon-CpKYt1dR.js";
5
-
6
- export { dropdown_default as default };
@@ -1,5 +0,0 @@
1
- import "./composables-BMXMKLLj.js";
2
- import "./icon-CpKYt1dR.js";
3
- import { t as error_component_default } from "./error-component-CckClFee.js";
4
-
5
- export { error_component_default as default };
@@ -1,4 +0,0 @@
1
- import "./composables-BMXMKLLj.js";
2
- import { t as icon_default } from "./icon-CpKYt1dR.js";
3
-
4
- export { icon_default as default };
@@ -1,9 +0,0 @@
1
- import "./composables-BMXMKLLj.js";
2
- import "./tooltip-C4RiUZwy.js";
3
- import "./button-CWSGNZmd.js";
4
- import "./icon-CpKYt1dR.js";
5
- import "./modal-DHGxvCt5.js";
6
- import "./zoom-container-CqZQ4X6w.js";
7
- import { t as image_default } from "./image-Dwe5A7RP.js";
8
-
9
- export { image_default as default };
@@ -1,4 +0,0 @@
1
- import "./composables-BMXMKLLj.js";
2
- import { t as modal_default } from "./modal-DHGxvCt5.js";
3
-
4
- export { modal_default as default };
@@ -1,4 +0,0 @@
1
- import "./composables-BMXMKLLj.js";
2
- import { t as node_list_default } from "./node-list-D6zJX92N.js";
3
-
4
- export { node_list_default as default };
@@ -1,10 +0,0 @@
1
- import { defineAsyncComponent } from "vue";
2
-
3
- //#region src/components/previewers/index.ts
4
- const CODE_PREVIEWERS = {
5
- html: defineAsyncComponent(() => import("./html-D7bGx0Cz.js")),
6
- mermaid: defineAsyncComponent(() => import("./mermaid-BoiSJ4fF.js"))
7
- };
8
-
9
- //#endregion
10
- export { CODE_PREVIEWERS as t };
@@ -1,7 +0,0 @@
1
- import "./composables-BMXMKLLj.js";
2
- import "./tooltip-C4RiUZwy.js";
3
- import "./button-CWSGNZmd.js";
4
- import "./icon-CpKYt1dR.js";
5
- import { t as segmented_default } from "./segmented-DDQZGL7l.js";
6
-
7
- export { segmented_default as default };
@@ -1,4 +0,0 @@
1
- import "./composables-BMXMKLLj.js";
2
- import { t as tooltip_default } from "./tooltip-C4RiUZwy.js";
3
-
4
- export { tooltip_default as default };
@@ -1,4 +0,0 @@
1
- import "./composables-BMXMKLLj.js";
2
- import { t as vanilla_default } from "./vanilla-NR7MOE5P.js";
3
-
4
- export { vanilla_default as default };
@@ -1,7 +0,0 @@
1
- import "./composables-BMXMKLLj.js";
2
- import "./tooltip-C4RiUZwy.js";
3
- import "./button-CWSGNZmd.js";
4
- import "./icon-CpKYt1dR.js";
5
- import { t as zoom_container_default } from "./zoom-container-CqZQ4X6w.js";
6
-
7
- export { zoom_container_default as default };