schematex 0.6.6 → 0.6.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 +115 -3
- package/README.zh-CN.md +783 -0
- package/dist/ai/ai-sdk.cjs +11 -11
- package/dist/ai/ai-sdk.d.cts +4 -4
- package/dist/ai/ai-sdk.d.ts +4 -4
- package/dist/ai/ai-sdk.js +6 -6
- package/dist/ai/index.cjs +17 -17
- package/dist/ai/index.d.cts +3 -3
- package/dist/ai/index.d.ts +3 -3
- package/dist/ai/index.js +6 -6
- package/dist/{api-QFMTlIi7.d.ts → api-DIJM_mqp.d.ts} +1 -1
- package/dist/{api-DA4-U-jn.d.cts → api-JaBtsUT8.d.cts} +1 -1
- package/dist/browser.cjs +12 -12
- package/dist/browser.d.cts +3 -3
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +6 -6
- package/dist/{chunk-KJZCRHNR.js → chunk-2TUZ3QJA.js} +623 -9
- package/dist/chunk-2TUZ3QJA.js.map +1 -0
- package/dist/{chunk-EUVUO3CL.cjs → chunk-34O3C6OC.cjs} +2 -2
- package/dist/{chunk-EUVUO3CL.cjs.map → chunk-34O3C6OC.cjs.map} +1 -1
- package/dist/{chunk-MLLARXOI.cjs → chunk-AGBY7KLL.cjs} +131 -27
- package/dist/chunk-AGBY7KLL.cjs.map +1 -0
- package/dist/{chunk-EPKIJEH7.js → chunk-C7V57V6O.js} +54 -8
- package/dist/chunk-C7V57V6O.js.map +1 -0
- package/dist/{chunk-CMZKAASF.cjs → chunk-EDXDFKYO.cjs} +16 -8
- package/dist/chunk-EDXDFKYO.cjs.map +1 -0
- package/dist/{chunk-FOPOOV2P.js → chunk-J2TT7PGI.js} +127 -23
- package/dist/chunk-J2TT7PGI.js.map +1 -0
- package/dist/{chunk-DO2DDHTQ.cjs → chunk-J3EPFZPX.cjs} +623 -8
- package/dist/chunk-J3EPFZPX.cjs.map +1 -0
- package/dist/{chunk-KCHUQXS3.js → chunk-JTGTWBAD.js} +2 -2
- package/dist/{chunk-KCHUQXS3.js.map → chunk-JTGTWBAD.js.map} +1 -1
- package/dist/{chunk-7DAIEDQP.js → chunk-MPCSWRZC.js} +75 -13
- package/dist/chunk-MPCSWRZC.js.map +1 -0
- package/dist/{chunk-3HZW6K5I.js → chunk-QZ2OBNAS.js} +14 -6
- package/dist/chunk-QZ2OBNAS.js.map +1 -0
- package/dist/{chunk-SUIDD2C5.cjs → chunk-SHMG7BVF.cjs} +54 -8
- package/dist/chunk-SHMG7BVF.cjs.map +1 -0
- package/dist/{chunk-XYHCAJMI.cjs → chunk-UHPGWO77.cjs} +75 -12
- package/dist/chunk-UHPGWO77.cjs.map +1 -0
- package/dist/{diagnostics-CSznf_sl.d.cts → diagnostics-BKRow1ur.d.cts} +14 -0
- package/dist/{diagnostics-CSznf_sl.d.ts → diagnostics-BKRow1ur.d.ts} +14 -0
- package/dist/diagrams/blockdiagram/index.cjs +5 -5
- package/dist/diagrams/blockdiagram/index.d.cts +1 -1
- package/dist/diagrams/blockdiagram/index.d.ts +1 -1
- package/dist/diagrams/blockdiagram/index.js +1 -1
- package/dist/diagrams/circuit/index.cjs +11 -7
- package/dist/diagrams/circuit/index.d.cts +4 -2
- package/dist/diagrams/circuit/index.d.ts +4 -2
- package/dist/diagrams/circuit/index.js +1 -1
- package/dist/diagrams/ecomap/index.d.cts +1 -1
- package/dist/diagrams/ecomap/index.d.ts +1 -1
- package/dist/diagrams/entity/index.d.cts +1 -1
- package/dist/diagrams/entity/index.d.ts +1 -1
- package/dist/diagrams/fishbone/index.d.cts +1 -1
- package/dist/diagrams/fishbone/index.d.ts +1 -1
- package/dist/diagrams/flowchart/index.d.cts +2 -2
- package/dist/diagrams/flowchart/index.d.ts +2 -2
- package/dist/diagrams/genogram/index.d.cts +1 -1
- package/dist/diagrams/genogram/index.d.ts +1 -1
- package/dist/diagrams/ladder/index.d.cts +1 -1
- package/dist/diagrams/ladder/index.d.ts +1 -1
- package/dist/diagrams/logic/index.d.cts +1 -1
- package/dist/diagrams/logic/index.d.ts +1 -1
- package/dist/diagrams/orgchart/index.cjs +10 -6
- package/dist/diagrams/orgchart/index.d.cts +27 -2
- package/dist/diagrams/orgchart/index.d.ts +27 -2
- package/dist/diagrams/orgchart/index.js +1 -1
- package/dist/diagrams/pedigree/index.d.cts +1 -1
- package/dist/diagrams/pedigree/index.d.ts +1 -1
- package/dist/diagrams/phylo/index.d.cts +1 -1
- package/dist/diagrams/phylo/index.d.ts +1 -1
- package/dist/diagrams/sld/index.cjs +7 -7
- package/dist/diagrams/sld/index.d.cts +1 -1
- package/dist/diagrams/sld/index.d.ts +1 -1
- package/dist/diagrams/sld/index.js +1 -1
- package/dist/diagrams/sociogram/index.d.cts +1 -1
- package/dist/diagrams/sociogram/index.d.ts +1 -1
- package/dist/diagrams/timing/index.d.cts +1 -1
- package/dist/diagrams/timing/index.d.ts +1 -1
- package/dist/diagrams/venn/index.d.cts +1 -1
- package/dist/diagrams/venn/index.d.ts +1 -1
- package/dist/{index-CDpYuU7l.d.cts → index-DU2h1Y-a.d.cts} +1 -1
- package/dist/{index-jTwjudTW.d.ts → index-Dq3Mfxay.d.ts} +1 -1
- package/dist/index.cjs +35 -35
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +8 -8
- package/dist/react.cjs +6 -6
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +5 -5
- package/dist/{tools-CbuSbW6B.d.cts → tools-A0HRZ8jj.d.ts} +11 -2
- package/dist/{tools-D344vOzR.d.ts → tools-OzOQnlnV.d.cts} +11 -2
- package/package.json +2 -2
- package/dist/chunk-3HZW6K5I.js.map +0 -1
- package/dist/chunk-7DAIEDQP.js.map +0 -1
- package/dist/chunk-CMZKAASF.cjs.map +0 -1
- package/dist/chunk-DO2DDHTQ.cjs.map +0 -1
- package/dist/chunk-EPKIJEH7.js.map +0 -1
- package/dist/chunk-FOPOOV2P.js.map +0 -1
- package/dist/chunk-KJZCRHNR.js.map +0 -1
- package/dist/chunk-MLLARXOI.cjs.map +0 -1
- package/dist/chunk-SUIDD2C5.cjs.map +0 -1
- package/dist/chunk-XYHCAJMI.cjs.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkUHPGWO77_cjs = require('./chunk-UHPGWO77.cjs');
|
|
4
|
+
var chunkJ3EPFZPX_cjs = require('./chunk-J3EPFZPX.cjs');
|
|
5
|
+
var chunkSHMG7BVF_cjs = require('./chunk-SHMG7BVF.cjs');
|
|
6
6
|
var chunkTACTEF2N_cjs = require('./chunk-TACTEF2N.cjs');
|
|
7
|
-
var
|
|
7
|
+
var chunk34O3C6OC_cjs = require('./chunk-34O3C6OC.cjs');
|
|
8
8
|
var chunk77GPD4YQ_cjs = require('./chunk-77GPD4YQ.cjs');
|
|
9
9
|
var chunkT5KHNJ67_cjs = require('./chunk-T5KHNJ67.cjs');
|
|
10
10
|
var chunkLPAWZYDU_cjs = require('./chunk-LPAWZYDU.cjs');
|
|
@@ -14907,6 +14907,7 @@ function layoutUmlClass(ast) {
|
|
|
14907
14907
|
n.box.layer = n.rank;
|
|
14908
14908
|
}
|
|
14909
14909
|
}
|
|
14910
|
+
applyDirectionTransform(direction, nodes, boxes);
|
|
14910
14911
|
normaliseCoords(nodes, boxes);
|
|
14911
14912
|
const packages = layoutPackages(ast, boxByID);
|
|
14912
14913
|
shiftForPackages(nodes, boxes, packages);
|
|
@@ -14914,6 +14915,29 @@ function layoutUmlClass(ast) {
|
|
|
14914
14915
|
const { edges, trees } = routeEdges(chains, nodes, boxByID, vertical);
|
|
14915
14916
|
return { ast, boxes, packages, edges, trees, width, height };
|
|
14916
14917
|
}
|
|
14918
|
+
function applyDirectionTransform(direction, nodes, boxes) {
|
|
14919
|
+
if (direction === "tb") return;
|
|
14920
|
+
const transform = (p) => {
|
|
14921
|
+
switch (direction) {
|
|
14922
|
+
case "bt":
|
|
14923
|
+
return { x: p.x, y: -p.y };
|
|
14924
|
+
case "lr":
|
|
14925
|
+
return { x: p.y, y: p.x };
|
|
14926
|
+
case "rl":
|
|
14927
|
+
return { x: -p.y, y: p.x };
|
|
14928
|
+
}
|
|
14929
|
+
};
|
|
14930
|
+
for (const n of nodes) {
|
|
14931
|
+
const p = transform({ x: n.cx, y: n.cy });
|
|
14932
|
+
n.cx = p.x;
|
|
14933
|
+
n.cy = p.y;
|
|
14934
|
+
}
|
|
14935
|
+
for (const b of boxes) {
|
|
14936
|
+
const c = transform({ x: b.x + b.width / 2, y: b.y + b.height / 2 });
|
|
14937
|
+
b.x = c.x - b.width / 2;
|
|
14938
|
+
b.y = c.y - b.height / 2;
|
|
14939
|
+
}
|
|
14940
|
+
}
|
|
14917
14941
|
function topLevelPackageMap(ast) {
|
|
14918
14942
|
const parentOf = /* @__PURE__ */ new Map();
|
|
14919
14943
|
for (const p of ast.packages) parentOf.set(p.id, p.parentId);
|
|
@@ -16189,12 +16213,14 @@ function parseFaultTree(text2) {
|
|
|
16189
16213
|
}
|
|
16190
16214
|
if (/^layout\s*:/i.test(t)) {
|
|
16191
16215
|
const v = afterColon2(t).toLowerCase();
|
|
16192
|
-
if (v === "tb"
|
|
16216
|
+
if (v === "tb") ast.direction = v;
|
|
16217
|
+
else if (v === "bt") ast.warnings.push(`Line ${lineNo}: layout: bt is reserved but not implemented yet; using layout: tb.`);
|
|
16193
16218
|
continue;
|
|
16194
16219
|
}
|
|
16195
16220
|
if (/^style\s*:/i.test(t)) {
|
|
16196
16221
|
const v = afterColon2(t).toLowerCase();
|
|
16197
|
-
if (v === "ansi"
|
|
16222
|
+
if (v === "ansi") ast.gateStyle = v;
|
|
16223
|
+
else if (v === "iec") ast.warnings.push(`Line ${lineNo}: style: iec is reserved but not implemented yet; using style: ansi.`);
|
|
16198
16224
|
continue;
|
|
16199
16225
|
}
|
|
16200
16226
|
if (/^transfer\b/i.test(t)) {
|
|
@@ -17228,6 +17254,7 @@ function summarise(layout) {
|
|
|
17228
17254
|
if (analysis.topProb !== void 0) parts.push(`P(top) = ${fmtProb(analysis.topProb)} (${analysis.method}).`);
|
|
17229
17255
|
else if (analysis.missingProb.length > 0) parts.push(`P(top) = n/a \u2014 missing p on ${analysis.missingProb.join(", ")}.`);
|
|
17230
17256
|
}
|
|
17257
|
+
for (const w of ast.warnings) parts.push(w);
|
|
17231
17258
|
for (const n of analysis.notes) parts.push(n);
|
|
17232
17259
|
for (const w of analysis.warnings) parts.push(w);
|
|
17233
17260
|
return parts.join(" ");
|
|
@@ -17324,7 +17351,8 @@ function parseBowtie(text2) {
|
|
|
17324
17351
|
const lineNo = i + 1;
|
|
17325
17352
|
if (/^layout\s*:/i.test(t)) {
|
|
17326
17353
|
const v = afterColon3(t).toLowerCase();
|
|
17327
|
-
if (v === "symmetric"
|
|
17354
|
+
if (v === "symmetric") ast.layout = v;
|
|
17355
|
+
else if (v === "compact") ast.warnings.push(`Line ${lineNo}: layout: compact is reserved but not implemented yet; using layout: symmetric.`);
|
|
17328
17356
|
continue;
|
|
17329
17357
|
}
|
|
17330
17358
|
if (/^legend\s*:/i.test(t)) {
|
|
@@ -18249,14 +18277,23 @@ function parseMindmap(text2) {
|
|
|
18249
18277
|
const lines = allLines;
|
|
18250
18278
|
const directives = { style: "map", maxLabelWidth: DEFAULT_MAX_LABEL_WIDTH };
|
|
18251
18279
|
let root = null;
|
|
18280
|
+
let rootInferred;
|
|
18252
18281
|
let idCounter2 = 0;
|
|
18253
18282
|
const nextId2 = () => `n${idCounter2++}`;
|
|
18254
18283
|
const stack = [];
|
|
18255
18284
|
let lastHeadingDepth = 0;
|
|
18256
|
-
const
|
|
18285
|
+
const ensurePlaceholderRoot = () => {
|
|
18286
|
+
if (root) return root;
|
|
18287
|
+
root = makeNode(nextId2(), "Mindmap", 0);
|
|
18288
|
+
rootInferred = "placeholder";
|
|
18289
|
+
stack.length = 0;
|
|
18290
|
+
stack.push({ node: root, depth: 0 });
|
|
18291
|
+
lastHeadingDepth = 0;
|
|
18292
|
+
return root;
|
|
18293
|
+
};
|
|
18294
|
+
const attach = (node, depth, _lineNo, _source) => {
|
|
18257
18295
|
while (stack.length && stack[stack.length - 1].depth >= depth) stack.pop();
|
|
18258
|
-
const parent = stack[stack.length - 1]?.node;
|
|
18259
|
-
if (!parent) throw new MindmapParseError("orphan node \u2014 expected root # heading first", lineNo, void 0, source);
|
|
18296
|
+
const parent = stack[stack.length - 1]?.node ?? ensurePlaceholderRoot();
|
|
18260
18297
|
node.depth = parent.depth + 1;
|
|
18261
18298
|
parent.children.push(node);
|
|
18262
18299
|
stack.push({ node, depth });
|
|
@@ -18282,7 +18319,7 @@ function parseMindmap(text2) {
|
|
|
18282
18319
|
stack.length = 0;
|
|
18283
18320
|
stack.push({ node, depth: 0 });
|
|
18284
18321
|
} else {
|
|
18285
|
-
attach(node, depth
|
|
18322
|
+
attach(node, depth);
|
|
18286
18323
|
}
|
|
18287
18324
|
lastHeadingDepth = depth;
|
|
18288
18325
|
continue;
|
|
@@ -18293,7 +18330,14 @@ function parseMindmap(text2) {
|
|
|
18293
18330
|
const depth = lastHeadingDepth + 1 + Math.floor(indent / 2);
|
|
18294
18331
|
const label = bullet[2].trim();
|
|
18295
18332
|
const node = makeNode(nextId2(), label, depth);
|
|
18296
|
-
attach(node, depth
|
|
18333
|
+
attach(node, depth);
|
|
18334
|
+
continue;
|
|
18335
|
+
}
|
|
18336
|
+
if (!root && stack.length === 0) {
|
|
18337
|
+
root = makeNode(nextId2(), trimmed, 0);
|
|
18338
|
+
rootInferred = "line";
|
|
18339
|
+
stack.push({ node: root, depth: 0 });
|
|
18340
|
+
lastHeadingDepth = 0;
|
|
18297
18341
|
continue;
|
|
18298
18342
|
}
|
|
18299
18343
|
}
|
|
@@ -18304,10 +18348,40 @@ function parseMindmap(text2) {
|
|
|
18304
18348
|
root,
|
|
18305
18349
|
maxLabelWidth: directives.maxLabelWidth
|
|
18306
18350
|
};
|
|
18351
|
+
if (rootInferred) ast.rootInferred = rootInferred;
|
|
18307
18352
|
if (directives.themeOverride) ast.themeOverride = directives.themeOverride;
|
|
18308
18353
|
return ast;
|
|
18309
18354
|
}
|
|
18310
18355
|
|
|
18356
|
+
// src/diagrams/mindmap/lint.ts
|
|
18357
|
+
function lintMindmap(text2) {
|
|
18358
|
+
let ast;
|
|
18359
|
+
try {
|
|
18360
|
+
ast = parseMindmap(text2);
|
|
18361
|
+
} catch {
|
|
18362
|
+
return [];
|
|
18363
|
+
}
|
|
18364
|
+
const out = [];
|
|
18365
|
+
if (ast.rootInferred === "line") {
|
|
18366
|
+
out.push({
|
|
18367
|
+
severity: "warning",
|
|
18368
|
+
code: "MINDMAP_SYNTHESIZED_ROOT",
|
|
18369
|
+
message: `no \`# Title\` heading found; adopted the first line "${ast.root.label}" as the central topic`,
|
|
18370
|
+
hint: "Mark the central topic explicitly with a single leading `# Title` line, e.g. `# My Topic`.",
|
|
18371
|
+
fatal: false
|
|
18372
|
+
});
|
|
18373
|
+
} else if (ast.rootInferred === "placeholder") {
|
|
18374
|
+
out.push({
|
|
18375
|
+
severity: "warning",
|
|
18376
|
+
code: "MINDMAP_SYNTHESIZED_ROOT",
|
|
18377
|
+
message: "no central topic found; inserted a placeholder root over the top-level branches",
|
|
18378
|
+
hint: "Start the mindmap with a single `# Title` line to name the center, e.g. `# My Topic`, with branches as `- item` bullets below it.",
|
|
18379
|
+
fatal: false
|
|
18380
|
+
});
|
|
18381
|
+
}
|
|
18382
|
+
return out;
|
|
18383
|
+
}
|
|
18384
|
+
|
|
18311
18385
|
// src/diagrams/mindmap/layout.ts
|
|
18312
18386
|
var PADDING2 = 40;
|
|
18313
18387
|
var SIBLING_GAP = 18;
|
|
@@ -18812,6 +18886,7 @@ var mindmap = {
|
|
|
18812
18886
|
return false;
|
|
18813
18887
|
},
|
|
18814
18888
|
parse: parseMindmap,
|
|
18889
|
+
lint: lintMindmap,
|
|
18815
18890
|
render(text2, config) {
|
|
18816
18891
|
return renderMindmap(text2, {
|
|
18817
18892
|
theme: config?.theme,
|
|
@@ -26490,17 +26565,17 @@ var plugins = [
|
|
|
26490
26565
|
chunk5FYPSIGD_cjs.sociogram,
|
|
26491
26566
|
chunk2F45Y2ON_cjs.timing,
|
|
26492
26567
|
chunkZ3A2UNK2_cjs.logic,
|
|
26493
|
-
|
|
26494
|
-
|
|
26568
|
+
chunkJ3EPFZPX_cjs.circuit,
|
|
26569
|
+
chunkSHMG7BVF_cjs.blockdiagram,
|
|
26495
26570
|
chunkTACTEF2N_cjs.ladder,
|
|
26496
|
-
|
|
26571
|
+
chunk34O3C6OC_cjs.sld,
|
|
26497
26572
|
chunk77GPD4YQ_cjs.entity,
|
|
26498
26573
|
chunkT5KHNJ67_cjs.fishbone,
|
|
26499
26574
|
chunkLPAWZYDU_cjs.venn,
|
|
26500
26575
|
chunkDR3DDDQY_cjs.flowchart,
|
|
26501
26576
|
mindmap,
|
|
26502
26577
|
matrix,
|
|
26503
|
-
|
|
26578
|
+
chunkUHPGWO77_cjs.orgchart,
|
|
26504
26579
|
decisiontree,
|
|
26505
26580
|
timeline,
|
|
26506
26581
|
state,
|
|
@@ -26532,8 +26607,33 @@ function detectPlugin(text2, config) {
|
|
|
26532
26607
|
"Cannot detect diagram type. Start your text with 'genogram', 'ecomap', 'pedigree', 'phylo', 'sociogram', 'timing', 'logic', 'circuit', 'blockdiagram', 'ladder', 'sld', 'entity-structure', 'fishbone', 'venn', 'flowchart', 'mindmap', 'matrix', 'orgchart', 'state', 'pid', 'erd', 'breadboard', 'bpmn', 'fbd', 'sfc', 'prisma', 'usecase', 'pert', 'sequence', 'petri', 'network', 'umlclass', 'faulttree', or 'bowtie'."
|
|
26533
26608
|
);
|
|
26534
26609
|
}
|
|
26610
|
+
function stripCodeFences(text2) {
|
|
26611
|
+
let t = text2;
|
|
26612
|
+
t = t.replace(/^\uFEFF?[ \t]*```[A-Za-z0-9_-]*[ \t]*\r?\n/, "");
|
|
26613
|
+
t = t.replace(/\r?\n[ \t]*```[ \t]*$/, "");
|
|
26614
|
+
return t;
|
|
26615
|
+
}
|
|
26616
|
+
function normalizeHeader(text2, type) {
|
|
26617
|
+
const lines = text2.split("\n");
|
|
26618
|
+
for (let i = 0; i < lines.length; i++) {
|
|
26619
|
+
const trimmed = lines[i].trim();
|
|
26620
|
+
if (!trimmed) continue;
|
|
26621
|
+
const m = trimmed.match(/^([A-Za-z][A-Za-z0-9_-]*)/);
|
|
26622
|
+
if (!m) return text2;
|
|
26623
|
+
const tok = m[1];
|
|
26624
|
+
const lower = tok.toLowerCase();
|
|
26625
|
+
if (lower === type) return text2;
|
|
26626
|
+
if (lower.length >= 3 && type.startsWith(lower)) {
|
|
26627
|
+
const idx = lines[i].indexOf(tok);
|
|
26628
|
+
lines[i] = lines[i].slice(0, idx) + type + lines[i].slice(idx + tok.length);
|
|
26629
|
+
return lines.join("\n");
|
|
26630
|
+
}
|
|
26631
|
+
return text2;
|
|
26632
|
+
}
|
|
26633
|
+
return text2;
|
|
26634
|
+
}
|
|
26535
26635
|
function preprocess8(text2) {
|
|
26536
|
-
const { data, body } = chunk3KRL2EGN_cjs.parseFrontmatter(text2);
|
|
26636
|
+
const { data, body } = chunk3KRL2EGN_cjs.parseFrontmatter(stripCodeFences(text2));
|
|
26537
26637
|
if (!data.title) return body;
|
|
26538
26638
|
const safeTitle = data.title.replace(/"/g, '\\"');
|
|
26539
26639
|
const lines = body.split("\n");
|
|
@@ -26547,8 +26647,9 @@ function preprocess8(text2) {
|
|
|
26547
26647
|
return body;
|
|
26548
26648
|
}
|
|
26549
26649
|
function parse(text2, config) {
|
|
26550
|
-
const
|
|
26551
|
-
const plugin = detectPlugin(
|
|
26650
|
+
const prepared0 = preprocess8(text2);
|
|
26651
|
+
const plugin = detectPlugin(prepared0, config);
|
|
26652
|
+
const prepared = normalizeHeader(prepared0, plugin.type);
|
|
26552
26653
|
if (plugin.parse) return plugin.parse(prepared);
|
|
26553
26654
|
throw new Error(
|
|
26554
26655
|
`Diagram type '${plugin.type}' does not yet expose a parse() method.`
|
|
@@ -26557,13 +26658,14 @@ function parse(text2, config) {
|
|
|
26557
26658
|
function parseResult(text2, config) {
|
|
26558
26659
|
let plugin;
|
|
26559
26660
|
try {
|
|
26560
|
-
const
|
|
26561
|
-
plugin = detectPlugin(
|
|
26661
|
+
const prepared0 = preprocess8(text2);
|
|
26662
|
+
plugin = detectPlugin(prepared0, config);
|
|
26562
26663
|
if (!plugin.parse) {
|
|
26563
26664
|
throw new Error(
|
|
26564
26665
|
`Diagram type '${plugin.type}' does not yet expose a parse() method.`
|
|
26565
26666
|
);
|
|
26566
26667
|
}
|
|
26668
|
+
const prepared = normalizeHeader(prepared0, plugin.type);
|
|
26567
26669
|
const ast = plugin.parse(prepared);
|
|
26568
26670
|
const diagnostics = runLint(plugin, prepared);
|
|
26569
26671
|
return {
|
|
@@ -26592,15 +26694,17 @@ function runLint(plugin, prepared) {
|
|
|
26592
26694
|
}
|
|
26593
26695
|
function render(text2, config) {
|
|
26594
26696
|
if (config?.mode === "preview") return renderResult(text2, config).svg;
|
|
26595
|
-
const
|
|
26596
|
-
const plugin = detectPlugin(
|
|
26697
|
+
const prepared0 = preprocess8(text2);
|
|
26698
|
+
const plugin = detectPlugin(prepared0, config);
|
|
26699
|
+
const prepared = normalizeHeader(prepared0, plugin.type);
|
|
26597
26700
|
return renderWithPlugin(prepared, plugin, config);
|
|
26598
26701
|
}
|
|
26599
26702
|
function renderResult(text2, config) {
|
|
26600
26703
|
let plugin;
|
|
26601
26704
|
try {
|
|
26602
|
-
const
|
|
26603
|
-
plugin = detectPlugin(
|
|
26705
|
+
const prepared0 = preprocess8(text2);
|
|
26706
|
+
plugin = detectPlugin(prepared0, config);
|
|
26707
|
+
const prepared = normalizeHeader(prepared0, plugin.type);
|
|
26604
26708
|
const svg = renderWithPlugin(prepared, plugin, config);
|
|
26605
26709
|
const diagnostics = runLint(plugin, prepared);
|
|
26606
26710
|
return {
|
|
@@ -26659,5 +26763,5 @@ exports.state = state;
|
|
|
26659
26763
|
exports.timeline = timeline;
|
|
26660
26764
|
exports.umlclass = umlclass;
|
|
26661
26765
|
exports.usecase = usecase;
|
|
26662
|
-
//# sourceMappingURL=chunk-
|
|
26663
|
-
//# sourceMappingURL=chunk-
|
|
26766
|
+
//# sourceMappingURL=chunk-AGBY7KLL.cjs.map
|
|
26767
|
+
//# sourceMappingURL=chunk-AGBY7KLL.cjs.map
|