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 +5 -7
- package/README.zh-CN.md +8 -8
- package/dist/diagramHeight.js +1 -1
- package/dist/exports.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.px.css +1 -1
- package/dist/index.tailwind.css +1 -1
- package/dist/index2.js +1 -1
- package/dist/index7.js +1 -1
- package/dist/index9.js +1 -1
- package/dist/tailwind.js +0 -0
- package/dist/workers/katexCdnWorker.js +1 -1
- package/dist/workers/mermaidCdnWorker.js +1 -1
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -32,16 +32,14 @@ Other packages:
|
|
|
32
32
|
|
|
33
33
|
## Install markstream-vue
|
|
34
34
|
|
|
35
|
-
Markstream 2.
|
|
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
|
|
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`
|
|
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`
|
|
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
|
-
|
|
188
|
+
2.x 稳定版已发布在 npm `latest`。基础 Markdown 只需要安装主包:
|
|
189
189
|
|
|
190
190
|
```bash
|
|
191
|
-
pnpm add markstream-vue
|
|
191
|
+
pnpm add markstream-vue
|
|
192
192
|
```
|
|
193
193
|
|
|
194
|
-
|
|
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
|
-
-
|
|
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`:`
|
|
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.
|
|
628
|
-
-
|
|
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
|
|
package/dist/diagramHeight.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
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};
|