@tooee/renderers 0.3.0 → 0.3.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.
- package/dist/mermaid.d.ts +1 -1
- package/dist/mermaid.d.ts.map +1 -1
- package/dist/mermaid.js +23 -1
- package/dist/mermaid.js.map +1 -1
- package/package.json +5 -5
- package/src/mermaid.ts +31 -2
package/dist/mermaid.d.ts
CHANGED
package/dist/mermaid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mermaid.d.ts","sourceRoot":"","sources":["../src/mermaid.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,UAAU,EAAE,MAAM,eAAe,CAAC;AAGvD,UAAU,0BAA0B;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjD,MAAM,MAAM,mBAAmB,GAC3B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,UAAU,CAAA;CAAE,GAC/C;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,OAAO,GAAG,cAAc,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"mermaid.d.ts","sourceRoot":"","sources":["../src/mermaid.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,UAAU,EAAE,MAAM,eAAe,CAAC;AAGvD,UAAU,0BAA0B;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjD,MAAM,MAAM,mBAAmB,GAC3B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,UAAU,CAAA;CAAE,GAC/C;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,GAAG,cAAc,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1F,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,KAAK,CAAC,EAAE,0BAA0B,CAAC;CACpC;AAaD;;;GAGG;AACH,eAAO,MAAM,cAAc,GAA2B,OAAO,MAAM,KAAG,OAErE,CAAC;AA4EF,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,GAA6B,OAAO,MAAM,KAAG;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,UAAU,CAAC;CAsBrB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GACnC,QAAQ,MAAM,EACd,UAAS,oBAAyB,KACjC,mBAiCF,CAAC"}
|
package/dist/mermaid.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import { renderMermaidASCII } from "beautiful-mermaid";
|
|
1
|
+
import { parseMermaid, renderMermaidASCII } from "beautiful-mermaid";
|
|
2
2
|
import { parseColor, StyledText } from "@opentui/core";
|
|
3
|
+
// beautiful-mermaid's flowchart renderer uses unbounded synchronous A* pathfinding.
|
|
4
|
+
// Dense graphs can therefore block the UI thread and exhaust the process heap when
|
|
5
|
+
// an edge cannot be routed. Keep synchronous work within a conservative budget;
|
|
6
|
+
// MarkdownView will visibly fall back to the original Mermaid source instead.
|
|
7
|
+
const MAX_SOURCE_LENGTH = 20_000;
|
|
8
|
+
const MAX_SOURCE_LINES = 300;
|
|
9
|
+
const MAX_FLOWCHART_EDGES = 32;
|
|
3
10
|
// oxlint-disable-next-line no-control-regex -- ANSI SGR sequences start with the ESC control character
|
|
4
11
|
const SGR_SEQUENCE = /\u001B\[(?<params>[0-9;]*)m/gu;
|
|
5
12
|
/**
|
|
@@ -9,6 +16,14 @@ const SGR_SEQUENCE = /\u001B\[(?<params>[0-9;]*)m/gu;
|
|
|
9
16
|
export const isMermaidFence = function isMermaidFence(lang) {
|
|
10
17
|
return (lang ?? "").trim().split(/\s+/u)[0]?.toLowerCase() === "mermaid";
|
|
11
18
|
};
|
|
19
|
+
const exceedsSynchronousRenderBudget = function exceedsSynchronousRenderBudget(source) {
|
|
20
|
+
if (source.length > MAX_SOURCE_LENGTH || source.split("\n").length > MAX_SOURCE_LINES) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
const firstLine = source.trimStart().split(/[;\n]/u)[0]?.trim().toLowerCase() ?? "";
|
|
24
|
+
const isFlowchart = /^(?:flowchart|graph|statediagram(?:-v2)?)\b/u.test(firstLine);
|
|
25
|
+
return isFlowchart && parseMermaid(source).edges.length > MAX_FLOWCHART_EDGES;
|
|
26
|
+
};
|
|
12
27
|
const appendStyledChunk = function appendStyledChunk(chunks, text, fg) {
|
|
13
28
|
if (text.length === 0) {
|
|
14
29
|
return;
|
|
@@ -81,6 +96,13 @@ export const renderMermaidForTerminal = function renderMermaidForTerminal(source
|
|
|
81
96
|
return { message: "Mermaid block is empty", ok: false, reason: "empty" };
|
|
82
97
|
}
|
|
83
98
|
try {
|
|
99
|
+
if (exceedsSynchronousRenderBudget(source)) {
|
|
100
|
+
return {
|
|
101
|
+
message: "Mermaid diagram exceeds the synchronous rendering complexity limit",
|
|
102
|
+
ok: false,
|
|
103
|
+
reason: "complexity-limit",
|
|
104
|
+
};
|
|
105
|
+
}
|
|
84
106
|
const mode = options.mode ?? "plain";
|
|
85
107
|
const rendered = renderMermaidASCII(source, {
|
|
86
108
|
colorMode: mode === "ansi" ? "truecolor" : "none",
|
package/dist/mermaid.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mermaid.js","sourceRoot":"","sources":["../src/mermaid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"mermaid.js","sourceRoot":"","sources":["../src/mermaid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAyBvD,oFAAoF;AACpF,mFAAmF;AACnF,gFAAgF;AAChF,8EAA8E;AAC9E,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACjC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAE/B,uGAAuG;AACvG,MAAM,YAAY,GAAG,+BAA+B,CAAC;AAErD;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,cAAc,CAAC,IAAa;IACjE,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,SAAS,CAAC;AAC3E,CAAC,CAAC;AAEF,MAAM,8BAA8B,GAAG,SAAS,8BAA8B,CAC5E,MAAc;IAEd,IAAI,MAAM,CAAC,MAAM,GAAG,iBAAiB,IAAI,MAAM,CAAC,KAAK,CAAC,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AC;IAC3E,CAAC;IAED,IAAI,CAAC;QACH,IAAI,8BAA8B,CAAC,MAAM,CAAC,EAAE,CAAC;YAC3C,OAAO;gBACL,OAAO,EAAE,oEAAoE;gBAC7E,EAAE,EAAE,KAAK;gBACT,MAAM,EAAE,kBAAkB;aAC3B,CAAC;QACJ,CAAC;QAED,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC;QACrC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,MAAM,EAAE;YAC1C,SAAS,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM;YACjD,KAAK,EAAE,OAAO,CAAC,KAAK;SACrB,CAAC,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAErD,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC7B,OAAO,EAAE,OAAO,EAAE,qCAAqC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;QACxF,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACrC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;YAC/D,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,cAAc;SACvB,CAAC;IACJ,CAAC;AACH,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tooee/renderers",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Content renderers (markdown, code, text, table) for Tooee",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"typecheck": "tsc --noEmit"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@tooee/commands": "0.3.
|
|
46
|
-
"@tooee/fuzzy": "0.3.
|
|
47
|
-
"@tooee/marks": "0.3.
|
|
48
|
-
"@tooee/themes": "0.3.
|
|
45
|
+
"@tooee/commands": "0.3.1",
|
|
46
|
+
"@tooee/fuzzy": "0.3.1",
|
|
47
|
+
"@tooee/marks": "0.3.1",
|
|
48
|
+
"@tooee/themes": "0.3.1",
|
|
49
49
|
"beautiful-mermaid": "^1.1.3",
|
|
50
50
|
"marked": "^17.0.4"
|
|
51
51
|
},
|
package/src/mermaid.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { renderMermaidASCII } from "beautiful-mermaid";
|
|
1
|
+
import { parseMermaid, renderMermaidASCII } from "beautiful-mermaid";
|
|
2
2
|
import { parseColor, StyledText } from "@opentui/core";
|
|
3
3
|
import type { TextChunk } from "@opentui/core";
|
|
4
4
|
|
|
@@ -17,13 +17,21 @@ export type MermaidRenderMode = "plain" | "ansi";
|
|
|
17
17
|
|
|
18
18
|
export type MermaidRenderResult =
|
|
19
19
|
| { ok: true; text: string; content: StyledText }
|
|
20
|
-
| { ok: false; reason: "empty" | "render-error"; message: string };
|
|
20
|
+
| { ok: false; reason: "complexity-limit" | "empty" | "render-error"; message: string };
|
|
21
21
|
|
|
22
22
|
export interface MermaidRenderOptions {
|
|
23
23
|
mode?: MermaidRenderMode;
|
|
24
24
|
theme?: BeautifulMermaidAsciiTheme;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
// beautiful-mermaid's flowchart renderer uses unbounded synchronous A* pathfinding.
|
|
28
|
+
// Dense graphs can therefore block the UI thread and exhaust the process heap when
|
|
29
|
+
// an edge cannot be routed. Keep synchronous work within a conservative budget;
|
|
30
|
+
// MarkdownView will visibly fall back to the original Mermaid source instead.
|
|
31
|
+
const MAX_SOURCE_LENGTH = 20_000;
|
|
32
|
+
const MAX_SOURCE_LINES = 300;
|
|
33
|
+
const MAX_FLOWCHART_EDGES = 32;
|
|
34
|
+
|
|
27
35
|
// oxlint-disable-next-line no-control-regex -- ANSI SGR sequences start with the ESC control character
|
|
28
36
|
const SGR_SEQUENCE = /\u001B\[(?<params>[0-9;]*)m/gu;
|
|
29
37
|
|
|
@@ -35,6 +43,19 @@ export const isMermaidFence = function isMermaidFence(lang?: string): boolean {
|
|
|
35
43
|
return (lang ?? "").trim().split(/\s+/u)[0]?.toLowerCase() === "mermaid";
|
|
36
44
|
};
|
|
37
45
|
|
|
46
|
+
const exceedsSynchronousRenderBudget = function exceedsSynchronousRenderBudget(
|
|
47
|
+
source: string,
|
|
48
|
+
): boolean {
|
|
49
|
+
if (source.length > MAX_SOURCE_LENGTH || source.split("\n").length > MAX_SOURCE_LINES) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const firstLine = source.trimStart().split(/[;\n]/u)[0]?.trim().toLowerCase() ?? "";
|
|
54
|
+
const isFlowchart = /^(?:flowchart|graph|statediagram(?:-v2)?)\b/u.test(firstLine);
|
|
55
|
+
|
|
56
|
+
return isFlowchart && parseMermaid(source).edges.length > MAX_FLOWCHART_EDGES;
|
|
57
|
+
};
|
|
58
|
+
|
|
38
59
|
const appendStyledChunk = function appendStyledChunk(
|
|
39
60
|
chunks: TextChunk[],
|
|
40
61
|
text: string,
|
|
@@ -137,6 +158,14 @@ export const renderMermaidForTerminal = function renderMermaidForTerminal(
|
|
|
137
158
|
}
|
|
138
159
|
|
|
139
160
|
try {
|
|
161
|
+
if (exceedsSynchronousRenderBudget(source)) {
|
|
162
|
+
return {
|
|
163
|
+
message: "Mermaid diagram exceeds the synchronous rendering complexity limit",
|
|
164
|
+
ok: false,
|
|
165
|
+
reason: "complexity-limit",
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
140
169
|
const mode = options.mode ?? "plain";
|
|
141
170
|
const rendered = renderMermaidASCII(source, {
|
|
142
171
|
colorMode: mode === "ansi" ? "truecolor" : "none",
|