markstream-vue 2.0.7 → 2.0.8

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
@@ -32,16 +32,14 @@ Other packages:
32
32
 
33
33
  ## Install markstream-vue
34
34
 
35
- Markstream 2.0 is stable: `pnpm add markstream-vue stream-diffs` installs the current
36
- 2.x line; `markstream-vue@1` pins the maintained 1.x line. The 1.x stable line is
37
- preserved on the `legacy` npm tag, 1.x prereleases on `legacy-next`. See the
38
- [1.x to 2.0 migration guide](https://markstream.simonhe.me/guide/migration-2-0) for
39
- the stream-diffs code-block migration:
35
+ Markstream 2.x is stable on npm's `latest` tag:
40
36
 
41
37
  ```bash
42
- pnpm add markstream-vue stream-diffs
38
+ pnpm add markstream-vue
43
39
  ```
44
40
 
41
+ Add the optional `stream-diffs` peer only when you need enhanced code and diff blocks. `markstream-vue@1` pins the maintained 1.x line; it is also preserved on the `legacy` npm tag, with 1.x prereleases on `legacy-next`. See the [1.x to 2.0 migration guide](https://markstream.simonhe.me/guide/migration-2-0) for the code-block runtime changes.
42
+
45
43
  For applications that must stay on the 1.x line across the 2.x cutover:
46
44
 
47
45
  ```bash
@@ -100,7 +98,7 @@ Start with the [framework overview](https://markstream.simonhe.me/frameworks) if
100
98
 
101
99
  ## Stability
102
100
 
103
- `markstream-vue` has a stable 1.x API contract. The breaking 2.0 line will be released through the npm `next` tag for validation before it can replace `latest`. It removes the Monaco and `stream-markdown` code-block runtimes and uses `stream-diffs` as the only enhanced code-block surface. See [Migrating from 1.x to 2.0](https://markstream.simonhe.me/guide/migration-2-0) before upgrading.
101
+ `markstream-vue` 2.x is stable and published on npm's `latest` tag. The maintained 1.x line remains available through `markstream-vue@1` and the `legacy` tag. Version 2 removes the Monaco and `stream-markdown` code-block runtimes; install the optional `stream-diffs` peer when you need the enhanced code-block surface. See [Migrating from 1.x to 2.0](https://markstream.simonhe.me/guide/migration-2-0) before upgrading.
104
102
 
105
103
  The stable surface includes `MarkdownRender`, streaming content rendering, pre-parsed node rendering, the safe HTML policy, optional Mermaid / KaTeX / D2 / Infographic integrations, enhanced code blocks, virtual-scroll coordination, CSS exports, worker client subpaths, and SSR imports for Vite / Nuxt / VitePress.
106
104
 
package/README.zh-CN.md CHANGED
@@ -60,7 +60,7 @@ Vue 包:
60
60
 
61
61
  ## 稳定性
62
62
 
63
- `markstream-vue` 继续维护稳定的 1.x API 契约。破坏性的 2.0 版本线先通过 npm `next` 标签进行验证,不会在 beta 阶段替换 `latest`。2.0 移除 Monaco 和 `stream-markdown` 代码块 runtime,并将 `stream-diffs` 作为唯一的增强代码块表面。升级前请阅读 [从 1.x 迁移到 2.0](https://markstream.simonhe.me/zh/guide/migration-2-0)。
63
+ `markstream-vue` 2.x 已稳定并发布在 npm `latest` 标签。维护中的 1.x 仍可通过 `markstream-vue@1` 或 `legacy` 标签安装。2.0 移除了 Monaco 和 `stream-markdown` 代码块 runtime;需要增强代码块时再安装可选 peer `stream-diffs`。升级前请阅读 [从 1.x 迁移到 2.0](https://markstream.simonhe.me/zh/guide/migration-2-0)。
64
64
 
65
65
  稳定面包括:`MarkdownRender`、流式内容渲染、预解析节点渲染、安全 HTML 策略、可选 Mermaid / KaTeX / D2 / Infographic 集成、增强代码块、虚拟滚动协调、CSS 导出、worker client 子路径以及 Vite / Nuxt / VitePress 的 SSR 导入。
66
66
 
@@ -185,13 +185,13 @@ npx skills add git@github.com:Simon-He95/markstream-vue.git
185
185
 
186
186
  ### Vue / Nuxt
187
187
 
188
- 协调发布的 2.0 beta 将使用 `next`。请先确认 `npm view markstream-vue@next version` 返回 `2.0.0-beta.1`,再执行:
188
+ 2.x 稳定版已发布在 npm `latest`。基础 Markdown 只需要安装主包:
189
189
 
190
190
  ```bash
191
- pnpm add markstream-vue@next stream-diffs
191
+ pnpm add markstream-vue
192
192
  ```
193
193
 
194
- 从 1.x 升级前请阅读 [2.0 迁移指南](https://markstream.simonhe.me/zh/guide/migration-2-0)。beta 阶段无 tag 安装仍然保持在 1.x;如需在 2.0 stable 切换后仍锁定维护中的 1.x,请显式使用 `markstream-vue@1`。
194
+ 需要增强代码块和 diff 时再安装 `stream-diffs`。从 1.x 升级前请阅读 [2.0 迁移指南](https://markstream.simonhe.me/zh/guide/migration-2-0);如需继续锁定维护中的 1.x,请显式使用 `markstream-vue@1`。
195
195
 
196
196
  ```bash
197
197
  pnpm add markstream-vue@1
@@ -536,7 +536,7 @@ function addChunk(chunk: string) {
536
536
 
537
537
  ## ⚙️ 性能模式
538
538
 
539
- - **默认虚拟化窗口**:保持 `max-live-nodes` 默认值(`320`),渲染器会立即渲染当前窗口的节点,同时只保留有限数量的 DOM 节点,实现平滑滚动与可控内存,占位骨架极少。
539
+ - **默认虚拟化窗口**:`docs` 模式的 `max-live-nodes` 默认值为 `220`,渲染器会立即渲染当前窗口的节点,同时只保留有限数量的 DOM 节点,实现平滑滚动与可控内存,占位骨架极少。
540
540
  - **增量流式模式**:当需要更明显的“打字机”体验时,将 `:max-live-nodes="0"`。这会关闭虚拟化并启用 `batchRendering` 系列参数控制的增量渲染,新的节点会以小批次加上占位骨架的形式进入视图。
541
541
 
542
542
  可根据页面类型选择最合适的模式:虚拟化适合长文档/回溯需求,增量流式适合聊天或 AI 输出面板。
@@ -546,7 +546,7 @@ function addChunk(chunk: string) {
546
546
  ## 🧰 关键属性速览
547
547
 
548
548
  - `content` 与 `nodes`:传原始 Markdown 或预解析节点(来自 `parseMarkdownToStructure`)。
549
- - `max-live-nodes`:`320`(默认虚拟化)或 `0`(增量批次)。
549
+ - `max-live-nodes`:`docs` 模式默认为 `220`;`chat` / `minimal` 模式默认为 `0`。
550
550
  - `batchRendering`:用 `initialRenderBatchSize`、`renderBatchSize`、`renderBatchDelay`、`renderBatchBudgetMs` 微调批次。
551
551
  - `enableMermaid` / `enableKatex`:用于(重新)启用重型依赖或自定义 loader(可与 `disableMermaid` / `disableKatex` 配合)。
552
552
  - `parse-options`:在组件上复用解析钩子(如 `preTransformTokens`、`requireClosingStrong`)。
@@ -624,8 +624,8 @@ setCustomComponents('docs', {
624
624
 
625
625
  - 最新版本与升级提示:[Releases](https://github.com/Simon-He95/markstream-vue/releases)
626
626
  - 完整历史:[CHANGELOG.md](./CHANGELOG.md)
627
- - 2.0 beta 候选版:
628
- - `npm view markstream-vue@next version` 返回 `2.0.0-beta.1` 后,通过 `markstream-vue@next` 安装;稳定 1.x 继续通过 `@1` 获取。
627
+ - 2.x 稳定版:
628
+ - 通过无 tag 的 `markstream-vue` 安装;维护中的 1.x 继续通过 `@1` 或 `legacy` 获取。
629
629
  - Monaco、`stream-markdown` runtime 与 Monaco 命名 API 已移除;受支持的代码块配置迁移到 `codeBlockOptions`。
630
630
  - 升级前阅读 [从 1.x 迁移到 2.0](https://markstream.simonhe.me/zh/guide/migration-2-0)。
631
631
 
@@ -1 +1 @@
1
- function t(t){const n="number"==typeof t?t:Number.parseFloat(String(null!=t?t:""));return Number.isFinite(n)&&n>0?n:null}function n(t){var n;for(const r of t.split(/\r?\n/)){const t=r.trim();if(!t||t.startsWith("%%"))continue;const a=t.match(/^([A-Z][\w-]*)\b/i);return(null==(n=null==a?void 0:a[1])?void 0:n.toLowerCase())||""}return""}function r(t){const r=t.split(/\r?\n/).map(t=>t.trim()).filter(t=>t&&!t.startsWith("%%")),a=Math.max(1,r.length),i=n(t);return"gantt"===i?220+28*a:"sequencediagram"===i?180+26*a:"classdiagram"===i||"statediagram"===i||"erdiagram"===i?180+24*a:"flowchart"===i||"graph"===i?170+28*a:200+22*a}function a(t){const n=t.split(/\r?\n/).filter(t=>/^\s*-\s+/.test(t)).length;return n>=3?500:n>0?280+60*n:360}function i(t,n=360,r=500){return null==r?Math.max(n,t):Math.min(Math.max(n,t),r)}function e(t,n=360,r=500){return i(t,n,r)}function s(t,n=360,r=500){return i(t,n,r)}export{e as a,r as b,s as c,a as e,n as g,t as p};
1
+ const t=360;function n(t){const n="number"==typeof t?t:Number.parseFloat(String(null!=t?t:""));return Number.isFinite(n)&&n>0?n:null}function r(t){var n;for(const r of t.split(/\r?\n/)){const t=r.trim();if(!t||t.startsWith("%%"))continue;const a=t.match(/^([A-Z][\w-]*)\b/i);return(null==(n=null==a?void 0:a[1])?void 0:n.toLowerCase())||""}return""}function a(t){const n=t.split(/\r?\n/).map(t=>t.trim()).filter(t=>t&&!t.startsWith("%%")),a=Math.max(1,n.length),s=r(t);return"gantt"===s?220+28*a:"sequencediagram"===s?180+26*a:"classdiagram"===s||"statediagram"===s||"erdiagram"===s?180+24*a:"flowchart"===s||"graph"===s?170+28*a:200+22*a}function s(t){const n=t.split(/\r?\n/).filter(t=>/^\s*-\s+/.test(t)).length;return n>=3?500:n>0?280+60*n:360}function i(t,n=360,r=500){return null==r?Math.max(n,t):Math.min(Math.max(n,t),r)}function e(t,n=360,r=500){return i(t,n,r)}function o(t,n=360,r=500){return i(t,n,r)}export{t as I,e as a,a as b,o as c,s as e,r as g,n as p};