markstream-vue 0.0.4-beta.2 → 0.0.4-beta.3

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 CHANGED
@@ -242,6 +242,8 @@ function addChunk(chunk: string) {
242
242
 
243
243
  This avoids re-parsing SSR content while letting later SSE/WebSocket chunks continue the stream.
244
244
 
245
+ > 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.
246
+
245
247
  ## ⚙️ Performance presets
246
248
 
247
249
  - **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 +260,7 @@ Pick one mode per surface: virtualization for best scrollback and steady memory
258
260
  - `batchRendering`: fine-tune batches with `initialRenderBatchSize`, `renderBatchSize`, `renderBatchDelay`, `renderBatchBudgetMs`.
259
261
  - `enableMermaid` / `enableKatex` / `enableMonaco`: opt-in heavy deps when needed.
260
262
  - `parse-options`: reuse parser hooks (e.g., `preTransformTokens`, `requireClosingStrong`) on the component.
263
+ - `final`: marks end-of-stream; disables mid-state loading parsing and forces unfinished constructs to settle.
261
264
  - `custom-html-tags`: extend streaming HTML allowlist for custom tags and emit them as custom nodes for `setCustomComponents` (e.g., `['thinking']`).
262
265
  - `custom-components`: register inline Vue components for custom tags/markers.
263
266
 
package/README.zh-CN.md CHANGED
@@ -241,6 +241,8 @@ function addChunk(chunk: string) {
241
241
 
242
242
  这样无需重新解析 SSR 内容,同时还能通过 SSE/WebSocket 持续追加后续片段。
243
243
 
244
+ > 提示:当你明确知道流已结束(消息已完整)时,建议用 `parseMarkdownToStructure(buffer.value, md, { final: true })` 或在组件上设置 `:final="true"`,以关闭解析器的中间态(loading)策略,避免末尾残留分隔符(如 `$$`、未闭合 code fence)导致永久 loading。
245
+
244
246
  ## ⚙️ 性能模式
245
247
 
246
248
  - **默认虚拟化窗口**:保持 `max-live-nodes` 默认值(`320`),渲染器会立即渲染当前窗口的节点,同时只保留有限数量的 DOM 节点,实现平滑滚动与可控内存,占位骨架极少。
@@ -257,6 +259,7 @@ function addChunk(chunk: string) {
257
259
  - `batchRendering`:用 `initialRenderBatchSize`、`renderBatchSize`、`renderBatchDelay`、`renderBatchBudgetMs` 微调批次。
258
260
  - `enableMermaid` / `enableKatex` / `enableMonaco`:按需启用重型依赖。
259
261
  - `parse-options`:在组件上复用解析钩子(如 `preTransformTokens`、`requireClosingStrong`)。
262
+ - `final`:标记“最终态/流结束”,关闭中间态 loading 解析并强制收敛未闭合结构。
260
263
  - `custom-html-tags`:扩展流式 HTML 白名单并将这些标签输出为自定义节点,便于 `setCustomComponents` 直接映射(如 `['thinking']`)。
261
264
  - `custom-components`:为自定义标签/标记注册内嵌 Vue 组件。
262
265