markstream-vue 0.0.4-beta.2 → 0.0.4-beta.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/README.md +5 -0
- package/README.zh-CN.md +5 -0
- package/dist/exports.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.tailwind.css +1 -1
- package/dist/index2.js +1 -1
- package/dist/index3.js +1 -1
- package/dist/tailwind.ts +0 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -50,6 +50,8 @@
|
|
|
50
50
|
- Playground (interactive demo): https://markstream-vue.simonhe.me/
|
|
51
51
|
- Interactive test page (shareable links, easy reproduction): https://markstream-vue.simonhe.me/test
|
|
52
52
|
- Docs: https://markstream-vue-docs.simonhe.me/guide/
|
|
53
|
+
- AI/LLM context (project map): https://markstream-vue-docs.simonhe.me/llms.md
|
|
54
|
+
- AI/LLM context (中文): https://markstream-vue-docs.simonhe.me/llms.zh-CN.md
|
|
53
55
|
- One-click StackBlitz demo: https://stackblitz.com/github/Simon-He95/markstream-vue?file=playground/src/App.vue
|
|
54
56
|
- Changelog: [CHANGELOG.md](./CHANGELOG.md)
|
|
55
57
|
- Nuxt playground: `pnpm play:nuxt`
|
|
@@ -242,6 +244,8 @@ function addChunk(chunk: string) {
|
|
|
242
244
|
|
|
243
245
|
This avoids re-parsing SSR content while letting later SSE/WebSocket chunks continue the stream.
|
|
244
246
|
|
|
247
|
+
> Tip: when you know the stream has ended (the message is complete), use `parseMarkdownToStructure(buffer.value, md, { final: true })` or pass `:final="true"` to the component. This disables mid-state (`loading`) parsing so trailing delimiters (like `$$` or an unclosed code fence) won’t get stuck showing perpetual loading.
|
|
248
|
+
|
|
245
249
|
## ⚙️ Performance presets
|
|
246
250
|
|
|
247
251
|
- **Virtual window (default)** – keep `max-live-nodes` at its default `320` to enable virtualization. Nodes render immediately and the renderer keeps a sliding window of elements mounted so long docs remain responsive without showing skeleton placeholders.
|
|
@@ -258,6 +262,7 @@ Pick one mode per surface: virtualization for best scrollback and steady memory
|
|
|
258
262
|
- `batchRendering`: fine-tune batches with `initialRenderBatchSize`, `renderBatchSize`, `renderBatchDelay`, `renderBatchBudgetMs`.
|
|
259
263
|
- `enableMermaid` / `enableKatex` / `enableMonaco`: opt-in heavy deps when needed.
|
|
260
264
|
- `parse-options`: reuse parser hooks (e.g., `preTransformTokens`, `requireClosingStrong`) on the component.
|
|
265
|
+
- `final`: marks end-of-stream; disables mid-state loading parsing and forces unfinished constructs to settle.
|
|
261
266
|
- `custom-html-tags`: extend streaming HTML allowlist for custom tags and emit them as custom nodes for `setCustomComponents` (e.g., `['thinking']`).
|
|
262
267
|
- `custom-components`: register inline Vue components for custom tags/markers.
|
|
263
268
|
|
package/README.zh-CN.md
CHANGED
|
@@ -49,6 +49,8 @@
|
|
|
49
49
|
- Playground(交互演示): https://markstream-vue.simonhe.me/
|
|
50
50
|
- 交互测试页(可分享链接,便于复现): https://markstream-vue.simonhe.me/test
|
|
51
51
|
- 文档: https://markstream-vue-docs.simonhe.me/zh/guide/
|
|
52
|
+
- AI/LLM 项目索引(中文): https://markstream-vue-docs.simonhe.me/llms.zh-CN.md
|
|
53
|
+
- AI/LLM 项目索引(英文): https://markstream-vue-docs.simonhe.me/llms.md
|
|
52
54
|
- 一键 StackBlitz 体验: https://stackblitz.com/github/Simon-He95/markstream-vue?file=playground/src/App.vue
|
|
53
55
|
- 更新日志: [CHANGELOG.md](./CHANGELOG.md)
|
|
54
56
|
- Nuxt playground:`pnpm play:nuxt`
|
|
@@ -241,6 +243,8 @@ function addChunk(chunk: string) {
|
|
|
241
243
|
|
|
242
244
|
这样无需重新解析 SSR 内容,同时还能通过 SSE/WebSocket 持续追加后续片段。
|
|
243
245
|
|
|
246
|
+
> 提示:当你明确知道流已结束(消息已完整)时,建议用 `parseMarkdownToStructure(buffer.value, md, { final: true })` 或在组件上设置 `:final="true"`,以关闭解析器的中间态(loading)策略,避免末尾残留分隔符(如 `$$`、未闭合 code fence)导致永久 loading。
|
|
247
|
+
|
|
244
248
|
## ⚙️ 性能模式
|
|
245
249
|
|
|
246
250
|
- **默认虚拟化窗口**:保持 `max-live-nodes` 默认值(`320`),渲染器会立即渲染当前窗口的节点,同时只保留有限数量的 DOM 节点,实现平滑滚动与可控内存,占位骨架极少。
|
|
@@ -257,6 +261,7 @@ function addChunk(chunk: string) {
|
|
|
257
261
|
- `batchRendering`:用 `initialRenderBatchSize`、`renderBatchSize`、`renderBatchDelay`、`renderBatchBudgetMs` 微调批次。
|
|
258
262
|
- `enableMermaid` / `enableKatex` / `enableMonaco`:按需启用重型依赖。
|
|
259
263
|
- `parse-options`:在组件上复用解析钩子(如 `preTransformTokens`、`requireClosingStrong`)。
|
|
264
|
+
- `final`:标记“最终态/流结束”,关闭中间态 loading 解析并强制收敛未闭合结构。
|
|
260
265
|
- `custom-html-tags`:扩展流式 HTML 白名单并将这些标签输出为自定义节点,便于 `setCustomComponents` 直接映射(如 `['thinking']`)。
|
|
261
266
|
- `custom-components`:为自定义标签/标记注册内嵌 Vue 组件。
|
|
262
267
|
|