vue-stream-markdown 0.0.0-alpha.0 → 0.1.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.
Files changed (35) hide show
  1. package/README.md +18 -19
  2. package/dist/button-Bz0s_F3s.js +5 -0
  3. package/dist/{button-D8xx1WIP.js → button-dU2iYZBS.js} +1 -1
  4. package/dist/{code-CP6mPwkq.js → code-BfJ58lYO.js} +7 -7
  5. package/dist/code-block-BFUXyGQH.js +9 -0
  6. package/dist/{code-block-D2zjJAww.css → code-block-Bv8s2E8I.css} +5 -0
  7. package/dist/{code-block-C4D_QNTq.js → code-block-CZHD64ft.js} +5 -5
  8. package/dist/{composables-qhB1h_ed.js → composables-BwAY_BDJ.js} +124 -31
  9. package/dist/dropdown-RWgcV-8w.js +5 -0
  10. package/dist/error-component-CR9t-T1D.js +4 -0
  11. package/dist/{error-component-CzarUjhh.js → error-component-CiIR_1Cg.js} +1 -1
  12. package/dist/{image-heJSlrNv.js → image-BporCeem.js} +53 -49
  13. package/dist/index.d.ts +47 -33
  14. package/dist/index.js +23 -323
  15. package/dist/{inline-math-B4XO1wMP.js → inline-math-BfG4600m.js} +2 -2
  16. package/dist/{link-DOtoFtxu.js → link-D-OnakwP.js} +2 -2
  17. package/dist/{math-Byka28HI.js → math-CvKkCYb9.js} +2 -2
  18. package/dist/{mermaid-X0AFRzfF.js → mermaid-FgnWaZtT.js} +16 -8
  19. package/dist/{previewers-Drlf7IQF.js → previewers-CoU4RlpQ.js} +1 -1
  20. package/dist/{segmented-BEtO1eyl.js → segmented-Baxxk3UJ.js} +1 -1
  21. package/dist/segmented-C0uEAYuJ.js +6 -0
  22. package/dist/{shiki-vToM7Pz1.js → shiki-BHOZKGKS.js} +1 -1
  23. package/dist/{table-DjkiVd9L.js → table-B__TdLr7.js} +9 -4
  24. package/dist/{tooltip-RiXixMIt.js → tooltip-CA6Kp7Ek.js} +1 -1
  25. package/dist/tooltip-DoIUaZgq.js +4 -0
  26. package/dist/zoom-container-BPbftW_I.js +6 -0
  27. package/dist/{zoom-container-BfUO3Ocp.js → zoom-container-Dlqv-z-t.js} +2 -2
  28. package/package.json +15 -11
  29. package/dist/button-BClRCjnc.js +0 -5
  30. package/dist/code-block-Dzw63Lki.js +0 -9
  31. package/dist/dropdown-Ca_PKF_d.js +0 -5
  32. package/dist/error-component-CLEJmPmM.js +0 -4
  33. package/dist/segmented-CWoQcX-H.js +0 -6
  34. package/dist/tooltip-Ac_2x9ps.js +0 -4
  35. package/dist/zoom-container-BDEP09K9.js +0 -6
@@ -1,5 +1,5 @@
1
- import { a as useMathRenderer } from "./composables-qhB1h_ed.js";
2
- import { t as error_component_default } from "./error-component-CzarUjhh.js";
1
+ import { o as useMathRenderer } from "./composables-BwAY_BDJ.js";
2
+ import { t as error_component_default } from "./error-component-CiIR_1Cg.js";
3
3
  import { Transition, computed, createBlock, createCommentVNode, createElementBlock, defineComponent, mergeProps, openBlock, resolveDynamicComponent, toRefs, unref, withCtx } 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 { R as useControls, i as useMermaid, o as throttle } from "./composables-qhB1h_ed.js";
2
- import "./tooltip-RiXixMIt.js";
3
- import "./button-D8xx1WIP.js";
4
- import { t as error_component_default } from "./error-component-CzarUjhh.js";
1
+ import { a as useMermaid, s as throttle, z as useControls } from "./composables-BwAY_BDJ.js";
2
+ import "./tooltip-CA6Kp7Ek.js";
3
+ import "./button-dU2iYZBS.js";
4
+ import { t as error_component_default } from "./error-component-CiIR_1Cg.js";
5
5
  import { t as spin_default } from "./spin-Ds5W7qC_.js";
6
- import { t as zoom_container_default } from "./zoom-container-BfUO3Ocp.js";
6
+ import { t as zoom_container_default } from "./zoom-container-Dlqv-z-t.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
 
@@ -90,8 +90,13 @@ var mermaid_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
90
90
  setup(__props) {
91
91
  const props = __props;
92
92
  const { controls, mermaidOptions, isDark } = toRefs(props);
93
- const { isControlEnabled } = useControls({ controls });
93
+ const { isControlEnabled, getControlValue } = useControls({ controls });
94
94
  const showControl = computed(() => isControlEnabled("mermaid.position"));
95
+ const controlPosition = computed(() => {
96
+ const position = getControlValue("mermaid.position");
97
+ if (typeof position === "string") return position;
98
+ return "bottom-right";
99
+ });
95
100
  const renderFlag = ref(false);
96
101
  const svg = ref();
97
102
  const containerRef = ref();
@@ -184,13 +189,16 @@ var mermaid_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
184
189
  })) : (openBlock(), createBlock(resolveDynamicComponent(Error.value), mergeProps({
185
190
  key: 1,
186
191
  variant: "mermaid"
187
- }, props), null, 16))], 64)) : createCommentVNode("v-if", true), createVNode(zoom_container_default, { "show-control": showControl.value }, {
192
+ }, props), null, 16))], 64)) : createCommentVNode("v-if", true), createVNode(zoom_container_default, {
193
+ "show-control": showControl.value,
194
+ position: controlPosition.value
195
+ }, {
188
196
  default: withCtx(() => [createElementVNode("div", {
189
197
  "data-stream-markdown": "mermaid",
190
198
  innerHTML: svg.value
191
199
  }, null, 8, _hoisted_1)]),
192
200
  _: 1
193
- }, 8, ["show-control"])], 4);
201
+ }, 8, ["show-control", "position"])], 4);
194
202
  };
195
203
  }
196
204
  });
@@ -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-X0AFRzfF.js"))
6
+ mermaid: defineAsyncComponent(() => import("./mermaid-FgnWaZtT.js"))
7
7
  };
8
8
 
9
9
  //#endregion
@@ -1,4 +1,4 @@
1
- import { t as button_default } from "./button-D8xx1WIP.js";
1
+ import { t as button_default } from "./button-dU2iYZBS.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
@@ -0,0 +1,6 @@
1
+ import "./composables-BwAY_BDJ.js";
2
+ import "./tooltip-CA6Kp7Ek.js";
3
+ import "./button-dU2iYZBS.js";
4
+ import { t as segmented_default } from "./segmented-Baxxk3UJ.js";
5
+
6
+ export { segmented_default as default };
@@ -1,4 +1,4 @@
1
- import { r as useShiki } from "./composables-qhB1h_ed.js";
1
+ import { i as useShiki } from "./composables-BwAY_BDJ.js";
2
2
  import { t as vanilla_default } from "./vanilla-DkX6g0dm.js";
3
3
  import { computed, createBlock, createCommentVNode, defineAsyncComponent, defineComponent, mergeProps, normalizeProps, openBlock, ref, toRefs, unref, watch } from "vue";
4
4
 
@@ -1,7 +1,7 @@
1
- import { O as save, b as tableDataToMarkdown, j as ICONS, l as useI18n, v as extractTableDataFromElement, x as tableDataToTSV, y as tableDataToCSV, z as useContext } from "./composables-qhB1h_ed.js";
1
+ import { B as useContext, M as ICONS, O as save, b as tableDataToMarkdown, u as useI18n, v as extractTableDataFromElement, x as tableDataToTSV, y as tableDataToCSV, z as useControls } from "./composables-BwAY_BDJ.js";
2
2
  import { t as node_list_default } from "./node-list-CGr_EVtn.js";
3
- import "./tooltip-RiXixMIt.js";
4
- import { t as button_default } from "./button-D8xx1WIP.js";
3
+ import "./tooltip-CA6Kp7Ek.js";
4
+ import { t as button_default } from "./button-dU2iYZBS.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";
@@ -80,6 +80,9 @@ var table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
80
80
  const { t } = useI18n();
81
81
  const { onCopied } = useContext();
82
82
  const { copy, copied } = useClipboard({ legacy: true });
83
+ const { isControlEnabled } = useControls({ controls: props.controls });
84
+ const showCopy = computed(() => isControlEnabled("table.copy"));
85
+ const showDownload = computed(() => isControlEnabled("table.download"));
83
86
  const tableRef = ref();
84
87
  const align = computed(() => props.node.align || []);
85
88
  const headerCells = computed(() => props.node.children[0].children ?? []);
@@ -129,6 +132,7 @@ var table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
129
132
  key: "copy",
130
133
  icon: copied.value ? ICONS.check : ICONS.copy,
131
134
  options,
135
+ visible: () => showCopy.value,
132
136
  onClick: (_event, item) => {
133
137
  const data = getTableContent((item === null || item === void 0 ? void 0 : item.value) || "csv");
134
138
  if (!data) return;
@@ -140,12 +144,13 @@ var table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
140
144
  key: "download",
141
145
  icon: ICONS.download,
142
146
  options,
147
+ visible: () => showDownload.value,
143
148
  onClick: (_event, item) => {
144
149
  const data = getTableContent((item === null || item === void 0 ? void 0 : item.value) || "csv");
145
150
  if (!data) return;
146
151
  save(`table.${data.extension}`, data.content, data.mimeType);
147
152
  }
148
- }]);
153
+ }].filter((item) => item.visible()));
149
154
  function getNodes(cell) {
150
155
  return [cell];
151
156
  }
@@ -1,4 +1,4 @@
1
- import { z as useContext } from "./composables-qhB1h_ed.js";
1
+ import { B as useContext } from "./composables-BwAY_BDJ.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
 
@@ -0,0 +1,4 @@
1
+ import "./composables-BwAY_BDJ.js";
2
+ import { t as tooltip_default } from "./tooltip-CA6Kp7Ek.js";
3
+
4
+ export { tooltip_default as default };
@@ -0,0 +1,6 @@
1
+ import "./composables-BwAY_BDJ.js";
2
+ import "./tooltip-CA6Kp7Ek.js";
3
+ import "./button-dU2iYZBS.js";
4
+ import { t as zoom_container_default } from "./zoom-container-Dlqv-z-t.js";
5
+
6
+ export { zoom_container_default as default };
@@ -1,5 +1,5 @@
1
- import { j as ICONS, l as useI18n, t as useZoom } from "./composables-qhB1h_ed.js";
2
- import { t as button_default } from "./button-D8xx1WIP.js";
1
+ import { M as ICONS, t as useZoom, u as useI18n } from "./composables-BwAY_BDJ.js";
2
+ import { t as button_default } from "./button-dU2iYZBS.js";
3
3
  import { computed, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeStyle, openBlock, ref, renderSlot, unref } from "vue";
4
4
 
5
5
  //#region src/components/zoom-container.vue?vue&type=script&setup=true&lang.ts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vue-stream-markdown",
3
3
  "type": "module",
4
- "version": "0.0.0-alpha.0",
4
+ "version": "0.1.1",
5
5
  "description": "Streaming markdown output, Useful for text streams like LLM outputs.",
6
6
  "author": "jinghaihan",
7
7
  "license": "MIT",
@@ -54,21 +54,22 @@
54
54
  "@vueuse/core": "^14.1.0",
55
55
  "markdown-it-async": "^2.2.0",
56
56
  "medium-zoom": "^1.1.0",
57
+ "remend": "^1.0.1",
57
58
  "tippy.js": "^6.3.7",
58
59
  "vue-tippy": "^6.7.1"
59
60
  },
60
61
  "devDependencies": {
61
- "@antfu/eslint-config": "^6.2.0",
62
+ "@antfu/eslint-config": "^6.4.2",
62
63
  "@antfu/utils": "^9.3.0",
63
64
  "@iconify-json/catppuccin": "^1.2.17",
64
- "@iconify-json/lucide": "^1.2.76",
65
+ "@iconify-json/lucide": "^1.2.79",
65
66
  "@types/node": "^24.10.1",
66
67
  "@unocss/eslint-plugin": "66.5.9",
67
68
  "@vitejs/plugin-vue": "^6.0.2",
68
69
  "@vue/test-utils": "^2.4.6",
69
70
  "bumpp": "^10.3.2",
70
71
  "eslint": "^9.39.1",
71
- "eslint-plugin-format": "^1.0.2",
72
+ "eslint-plugin-format": "^1.1.0",
72
73
  "happy-dom": "^20.0.11",
73
74
  "lint-staged": "^16.2.7",
74
75
  "mdast-util-from-markdown": "^2.0.2",
@@ -85,15 +86,16 @@
85
86
  "pncat": "^0.7.7",
86
87
  "simple-git-hooks": "^2.13.1",
87
88
  "taze": "^19.9.2",
88
- "tsdown": "^0.16.8",
89
- "tsx": "^4.20.6",
89
+ "tsdown": "^0.17.0",
90
+ "tsx": "^4.21.0",
90
91
  "typescript": "^5.9.3",
91
- "unocss": "^66.5.9",
92
+ "unocss": "^66.5.10",
92
93
  "unplugin-icons": "^22.5.0",
93
94
  "unplugin-lightningcss": "^0.4.3",
94
- "vite": "^7.2.4",
95
- "vitest": "^4.0.14",
96
- "vue-tsc": "^3.1.5"
95
+ "vite": "^7.2.6",
96
+ "vitepress": "^1.6.4",
97
+ "vitest": "^4.0.15",
98
+ "vue-tsc": "^3.1.6"
97
99
  },
98
100
  "simple-git-hooks": {
99
101
  "pre-commit": "pnpm lint-staged"
@@ -103,8 +105,10 @@
103
105
  },
104
106
  "scripts": {
105
107
  "dev": "vite",
108
+ "dev:docs": "pnpm --filter documentation dev",
106
109
  "build": "tsdown",
107
- "build:playground": "vite build --config vite.config.ts",
110
+ "build:play": "vite build",
111
+ "build:docs": "pnpm --filter documentation build",
108
112
  "deps": "taze major -I",
109
113
  "lint": "eslint",
110
114
  "typecheck": "vue-tsc --noEmit",
@@ -1,5 +0,0 @@
1
- import "./composables-qhB1h_ed.js";
2
- import "./tooltip-RiXixMIt.js";
3
- import { t as button_default } from "./button-D8xx1WIP.js";
4
-
5
- export { button_default as default };
@@ -1,9 +0,0 @@
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 };
@@ -1,5 +0,0 @@
1
- import "./composables-qhB1h_ed.js";
2
- import "./tooltip-RiXixMIt.js";
3
- import { n as dropdown_default } from "./button-D8xx1WIP.js";
4
-
5
- export { dropdown_default as default };
@@ -1,4 +0,0 @@
1
- import "./composables-qhB1h_ed.js";
2
- import { t as error_component_default } from "./error-component-CzarUjhh.js";
3
-
4
- export { error_component_default as default };
@@ -1,6 +0,0 @@
1
- import "./composables-qhB1h_ed.js";
2
- import "./tooltip-RiXixMIt.js";
3
- import "./button-D8xx1WIP.js";
4
- import { t as segmented_default } from "./segmented-BEtO1eyl.js";
5
-
6
- export { segmented_default as default };
@@ -1,4 +0,0 @@
1
- import "./composables-qhB1h_ed.js";
2
- import { t as tooltip_default } from "./tooltip-RiXixMIt.js";
3
-
4
- export { tooltip_default as default };
@@ -1,6 +0,0 @@
1
- import "./composables-qhB1h_ed.js";
2
- import "./tooltip-RiXixMIt.js";
3
- import "./button-D8xx1WIP.js";
4
- import { t as zoom_container_default } from "./zoom-container-BfUO3Ocp.js";
5
-
6
- export { zoom_container_default as default };