@zombie-mermaid/core 3.0.0 → 3.2.0
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/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +98 -76
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/diagram-type.test.ts +38 -0
- package/src/__tests__/render-utils.test.ts +59 -0
- package/src/diagram-type.ts +24 -1
- package/src/index.ts +1 -0
- package/src/multiline-utils.ts +6 -5
- package/src/render-utils.ts +54 -0
- package/src/style-directives.ts +6 -1
- package/src/theme.ts +3 -2
package/dist/index.d.cts
CHANGED
|
@@ -119,6 +119,14 @@ export declare function describeIgnored(config: InitConfig): string[];
|
|
|
119
119
|
*/
|
|
120
120
|
export declare function detectDiagramType(text: string): DiagramType;
|
|
121
121
|
|
|
122
|
+
/**
|
|
123
|
+
* Every diagram type this library can detect and route to a renderer — the
|
|
124
|
+
* runtime source of truth `DiagramType` is derived from, so consumers that
|
|
125
|
+
* need to enumerate the types (e.g. the MCP `list_diagram_types` tool) never
|
|
126
|
+
* keep a duplicate list that could drift.
|
|
127
|
+
*/
|
|
128
|
+
export declare const DIAGRAM_TYPES: readonly ["flowchart", "sequence", "class", "er", "xychart", "architecture", "c4"];
|
|
129
|
+
|
|
122
130
|
/**
|
|
123
131
|
* Diagram color configuration.
|
|
124
132
|
*
|
|
@@ -145,7 +153,7 @@ export declare interface DiagramColors {
|
|
|
145
153
|
}
|
|
146
154
|
|
|
147
155
|
/** The diagram types this library can detect and route to a renderer. */
|
|
148
|
-
export declare type DiagramType =
|
|
156
|
+
export declare type DiagramType = (typeof DIAGRAM_TYPES)[number];
|
|
149
157
|
|
|
150
158
|
export declare type Direction = 'TD' | 'TB' | 'LR' | 'BT' | 'RL';
|
|
151
159
|
|
|
@@ -185,6 +193,17 @@ export declare function escapeXml(text: string): string;
|
|
|
185
193
|
*/
|
|
186
194
|
export declare function extractInitConfig(lines: string[]): InitConfig;
|
|
187
195
|
|
|
196
|
+
/**
|
|
197
|
+
* Tagged template literal: stringifies interpolated values, rounding any
|
|
198
|
+
* `number` to at most 2 decimal places first. Non-number values (strings,
|
|
199
|
+
* booleans, etc.) pass through `String()` unchanged, same as an untagged
|
|
200
|
+
* template literal would.
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* f`<rect x="${3.14159}" y="${-0.001}" />` // '<rect x="3.14" y="0" />'
|
|
204
|
+
*/
|
|
205
|
+
export declare function f(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
206
|
+
|
|
188
207
|
/**
|
|
189
208
|
* Options applicable to flowchart (`graph` / `flowchart`) and state
|
|
190
209
|
* (`stateDiagram-v2`) diagrams — both share `DiagramType: 'flowchart'` and
|
|
@@ -1164,6 +1183,9 @@ export declare function toDirection(raw: string | undefined): Direction;
|
|
|
1164
1183
|
/**
|
|
1165
1184
|
* `class A,B className` — attach a style class to one or more nodes.
|
|
1166
1185
|
*
|
|
1186
|
+
* Whitespace around commas is allowed (`class A, B foo`) — the state-diagram
|
|
1187
|
+
* docs show that form (`class Moving, Crash movement`).
|
|
1188
|
+
*
|
|
1167
1189
|
* Allows an optional trailing semicolon (`class A,B foo;`) — Mermaid treats
|
|
1168
1190
|
* it as valid/optional, and `classDef`/`style` already tolerate it via their
|
|
1169
1191
|
* `(.+)$` capture. Without this, the semicolon form fails to match here and
|
package/dist/index.d.ts
CHANGED
|
@@ -119,6 +119,14 @@ export declare function describeIgnored(config: InitConfig): string[];
|
|
|
119
119
|
*/
|
|
120
120
|
export declare function detectDiagramType(text: string): DiagramType;
|
|
121
121
|
|
|
122
|
+
/**
|
|
123
|
+
* Every diagram type this library can detect and route to a renderer — the
|
|
124
|
+
* runtime source of truth `DiagramType` is derived from, so consumers that
|
|
125
|
+
* need to enumerate the types (e.g. the MCP `list_diagram_types` tool) never
|
|
126
|
+
* keep a duplicate list that could drift.
|
|
127
|
+
*/
|
|
128
|
+
export declare const DIAGRAM_TYPES: readonly ["flowchart", "sequence", "class", "er", "xychart", "architecture", "c4"];
|
|
129
|
+
|
|
122
130
|
/**
|
|
123
131
|
* Diagram color configuration.
|
|
124
132
|
*
|
|
@@ -145,7 +153,7 @@ export declare interface DiagramColors {
|
|
|
145
153
|
}
|
|
146
154
|
|
|
147
155
|
/** The diagram types this library can detect and route to a renderer. */
|
|
148
|
-
export declare type DiagramType =
|
|
156
|
+
export declare type DiagramType = (typeof DIAGRAM_TYPES)[number];
|
|
149
157
|
|
|
150
158
|
export declare type Direction = 'TD' | 'TB' | 'LR' | 'BT' | 'RL';
|
|
151
159
|
|
|
@@ -185,6 +193,17 @@ export declare function escapeXml(text: string): string;
|
|
|
185
193
|
*/
|
|
186
194
|
export declare function extractInitConfig(lines: string[]): InitConfig;
|
|
187
195
|
|
|
196
|
+
/**
|
|
197
|
+
* Tagged template literal: stringifies interpolated values, rounding any
|
|
198
|
+
* `number` to at most 2 decimal places first. Non-number values (strings,
|
|
199
|
+
* booleans, etc.) pass through `String()` unchanged, same as an untagged
|
|
200
|
+
* template literal would.
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* f`<rect x="${3.14159}" y="${-0.001}" />` // '<rect x="3.14" y="0" />'
|
|
204
|
+
*/
|
|
205
|
+
export declare function f(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
206
|
+
|
|
188
207
|
/**
|
|
189
208
|
* Options applicable to flowchart (`graph` / `flowchart`) and state
|
|
190
209
|
* (`stateDiagram-v2`) diagrams — both share `DiagramType: 'flowchart'` and
|
|
@@ -1164,6 +1183,9 @@ export declare function toDirection(raw: string | undefined): Direction;
|
|
|
1164
1183
|
/**
|
|
1165
1184
|
* `class A,B className` — attach a style class to one or more nodes.
|
|
1166
1185
|
*
|
|
1186
|
+
* Whitespace around commas is allowed (`class A, B foo`) — the state-diagram
|
|
1187
|
+
* docs show that form (`class Moving, Crash movement`).
|
|
1188
|
+
*
|
|
1167
1189
|
* Allows an optional trailing semicolon (`class A,B foo;`) — Mermaid treats
|
|
1168
1190
|
* it as valid/optional, and `classDef`/`style` already tolerate it via their
|
|
1169
1191
|
* `(.+)$` capture. Without this, the semicolon form fails to match here and
|
package/dist/index.js
CHANGED
|
@@ -113,7 +113,7 @@ function f(e) {
|
|
|
113
113
|
//#endregion
|
|
114
114
|
//#region packages/core/src/statements.ts
|
|
115
115
|
var p = /^[&#](?:#?[0-9]+|#?[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/, m = /* @__PURE__ */ new Set(["&", "#"]);
|
|
116
|
-
function
|
|
116
|
+
function ee(e) {
|
|
117
117
|
let t = null;
|
|
118
118
|
for (let n = 0; n < e.length; n++) {
|
|
119
119
|
let r = e[n];
|
|
@@ -136,7 +136,7 @@ function h(e) {
|
|
|
136
136
|
}
|
|
137
137
|
return -1;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function h(e) {
|
|
140
140
|
let t = [], n = "", r = null;
|
|
141
141
|
for (let i = 0; i < e.length; i++) {
|
|
142
142
|
let a = e[i];
|
|
@@ -163,13 +163,13 @@ function g(e) {
|
|
|
163
163
|
}
|
|
164
164
|
return t.push(n), t;
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function g(e) {
|
|
167
167
|
let t = [], n = e.split("\n");
|
|
168
168
|
for (let e = 0; e < n.length; e++) {
|
|
169
|
-
let r = n[e].trim(), i = e + 1, a =
|
|
169
|
+
let r = n[e].trim(), i = e + 1, a = ee(r);
|
|
170
170
|
if (a !== -1 && (r = r.slice(0, a).trim()), r.length === 0) continue;
|
|
171
171
|
let o = [];
|
|
172
|
-
for (let e of
|
|
172
|
+
for (let e of h(r)) {
|
|
173
173
|
let t = e.trim();
|
|
174
174
|
t.length !== 0 && o.push({
|
|
175
175
|
text: t,
|
|
@@ -180,28 +180,37 @@ function _(e) {
|
|
|
180
180
|
}
|
|
181
181
|
return t;
|
|
182
182
|
}
|
|
183
|
-
function
|
|
184
|
-
return
|
|
183
|
+
function _(e) {
|
|
184
|
+
return g(e).flat();
|
|
185
185
|
}
|
|
186
186
|
//#endregion
|
|
187
187
|
//#region packages/core/src/diagram-type.ts
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
var v = [
|
|
189
|
+
"flowchart",
|
|
190
|
+
"sequence",
|
|
191
|
+
"class",
|
|
192
|
+
"er",
|
|
193
|
+
"xychart",
|
|
194
|
+
"architecture",
|
|
195
|
+
"c4"
|
|
196
|
+
];
|
|
197
|
+
function te(e) {
|
|
198
|
+
let t = _(e)[0]?.text.toLowerCase() ?? "";
|
|
199
|
+
return /^xychart(?:-beta)?(?:\s|$)/.test(t) ? "xychart" : /^architecture(?:-beta)?\s*$/.test(t) ? "architecture" : /^c4(?:context|container|component|dynamic|deployment)\s*$/.test(t) ? "c4" : /^sequencediagram\s*$/.test(t) ? "sequence" : /^classdiagram\s*$/.test(t) ? "class" : /^erdiagram\s*$/.test(t) ? "er" : "flowchart";
|
|
191
200
|
}
|
|
192
201
|
//#endregion
|
|
193
202
|
//#region packages/core/src/direction.ts
|
|
194
203
|
function y(e) {
|
|
195
204
|
return e === "TD" || e === "TB" || e === "LR" || e === "BT" || e === "RL";
|
|
196
205
|
}
|
|
197
|
-
function
|
|
206
|
+
function ne(e) {
|
|
198
207
|
let t = e?.toUpperCase();
|
|
199
208
|
if (t === void 0 || !y(t)) throw Error(`Invalid direction: "${e}"`);
|
|
200
209
|
return t;
|
|
201
210
|
}
|
|
202
211
|
//#endregion
|
|
203
212
|
//#region packages/core/src/direction-override.ts
|
|
204
|
-
function
|
|
213
|
+
function b(e, t) {
|
|
205
214
|
return t === void 0 || !y(t) ? e : {
|
|
206
215
|
...e,
|
|
207
216
|
direction: t
|
|
@@ -209,14 +218,14 @@ function ne(e, t) {
|
|
|
209
218
|
}
|
|
210
219
|
//#endregion
|
|
211
220
|
//#region packages/core/src/init-directive.ts
|
|
212
|
-
var
|
|
221
|
+
var x = /* @__PURE__ */ new Set([
|
|
213
222
|
"linear",
|
|
214
223
|
"basis",
|
|
215
224
|
"natural",
|
|
216
225
|
"step",
|
|
217
226
|
"stepBefore",
|
|
218
227
|
"stepAfter"
|
|
219
|
-
]),
|
|
228
|
+
]), S = {
|
|
220
229
|
theme: "colors come from the caller's bg/fg render options, which are usually CSS variables so a diagram inherits the host page's light/dark. A diagram-supplied theme would hard-code colors that fight it. Mermaid's theme names (default/dark/forest/neutral) also have no equivalent in this renderer's palettes — pass `bg`/`fg`, or a THEMES entry, instead",
|
|
221
230
|
securitylevel: "this renderer emits static SVG and never executes diagram-supplied script, so there is no sandbox to configure",
|
|
222
231
|
defaultrenderer: "ELK is the only layout engine; dagre/elk selection has no effect",
|
|
@@ -224,11 +233,11 @@ var b = /* @__PURE__ */ new Set([
|
|
|
224
233
|
htmllabels: "labels are always rendered as SVG text; there is no HTML label mode",
|
|
225
234
|
maxtextsize: "no text-size limit is enforced",
|
|
226
235
|
startonload: "not a browser auto-render integration"
|
|
227
|
-
},
|
|
228
|
-
function
|
|
229
|
-
return
|
|
236
|
+
}, C = /^\s*%%\{\s*(?:init|initialize)\s*:\s*([\s\S]*?)\}%%/i;
|
|
237
|
+
function w(e) {
|
|
238
|
+
return C.test(e);
|
|
230
239
|
}
|
|
231
|
-
function
|
|
240
|
+
function re(e) {
|
|
232
241
|
let t = "", n = null;
|
|
233
242
|
for (let r = 0; r < e.length; r++) {
|
|
234
243
|
let i = e[r];
|
|
@@ -259,12 +268,12 @@ function ie(e) {
|
|
|
259
268
|
}
|
|
260
269
|
return t;
|
|
261
270
|
}
|
|
262
|
-
function
|
|
263
|
-
let t = e.match(
|
|
271
|
+
function T(e) {
|
|
272
|
+
let t = e.match(C);
|
|
264
273
|
if (!t) return;
|
|
265
274
|
let n;
|
|
266
275
|
try {
|
|
267
|
-
n = JSON.parse(
|
|
276
|
+
n = JSON.parse(re(t[1]));
|
|
268
277
|
} catch {
|
|
269
278
|
return;
|
|
270
279
|
}
|
|
@@ -280,33 +289,33 @@ function C(e) {
|
|
|
280
289
|
let e = { ...t };
|
|
281
290
|
for (let [t, n] of Object.entries(e)) {
|
|
282
291
|
if (t.toLowerCase() === "curve" && typeof n == "string") {
|
|
283
|
-
|
|
292
|
+
x.has(n) && (r.curve = n);
|
|
284
293
|
continue;
|
|
285
294
|
}
|
|
286
|
-
t.toLowerCase() in
|
|
295
|
+
t.toLowerCase() in S && r.ignored.push(t);
|
|
287
296
|
}
|
|
288
297
|
continue;
|
|
289
298
|
}
|
|
290
|
-
n in
|
|
299
|
+
n in S && r.ignored.push(e);
|
|
291
300
|
}
|
|
292
301
|
return r;
|
|
293
302
|
}
|
|
294
|
-
function
|
|
303
|
+
function ie(e) {
|
|
295
304
|
let t = { ignored: [] };
|
|
296
305
|
for (let n of e) {
|
|
297
|
-
let e =
|
|
306
|
+
let e = T(n);
|
|
298
307
|
e && (e.theme !== void 0 && (t.theme = e.theme), e.curve !== void 0 && (t.curve = e.curve), t.ignored.push(...e.ignored));
|
|
299
308
|
}
|
|
300
309
|
return t;
|
|
301
310
|
}
|
|
302
|
-
function
|
|
311
|
+
function ae(e, t) {
|
|
303
312
|
return t.curve === void 0 || e.curve !== void 0 ? e : {
|
|
304
313
|
...e,
|
|
305
314
|
curve: t.curve
|
|
306
315
|
};
|
|
307
316
|
}
|
|
308
|
-
function
|
|
309
|
-
return [...new Set(e.ignored)].map((e) => `${e}: ${
|
|
317
|
+
function oe(e) {
|
|
318
|
+
return [...new Set(e.ignored)].map((e) => `${e}: ${S[e.toLowerCase()] ?? "not supported"}`);
|
|
310
319
|
}
|
|
311
320
|
//#endregion
|
|
312
321
|
//#region packages/core/src/text-metrics.ts
|
|
@@ -407,10 +416,10 @@ var E = {
|
|
|
407
416
|
"}": .789,
|
|
408
417
|
"~": 1.225
|
|
409
418
|
};
|
|
410
|
-
function
|
|
419
|
+
function se(e) {
|
|
411
420
|
return Object.hasOwn(E, e);
|
|
412
421
|
}
|
|
413
|
-
var
|
|
422
|
+
var ce = /* @__PURE__ */ new Set([
|
|
414
423
|
"i",
|
|
415
424
|
"l",
|
|
416
425
|
"t",
|
|
@@ -425,14 +434,14 @@ var se = /* @__PURE__ */ new Set([
|
|
|
425
434
|
":",
|
|
426
435
|
";",
|
|
427
436
|
"'"
|
|
428
|
-
]),
|
|
437
|
+
]), le = /* @__PURE__ */ new Set([
|
|
429
438
|
"W",
|
|
430
439
|
"M",
|
|
431
440
|
"w",
|
|
432
441
|
"m",
|
|
433
442
|
"@",
|
|
434
443
|
"%"
|
|
435
|
-
]),
|
|
444
|
+
]), ue = /* @__PURE__ */ new Set(["W", "M"]), de = /* @__PURE__ */ new Set([
|
|
436
445
|
"(",
|
|
437
446
|
")",
|
|
438
447
|
"[",
|
|
@@ -445,13 +454,13 @@ var se = /* @__PURE__ */ new Set([
|
|
|
445
454
|
"\"",
|
|
446
455
|
"`"
|
|
447
456
|
]);
|
|
448
|
-
function
|
|
457
|
+
function fe(e) {
|
|
449
458
|
return e >= 768 && e <= 879 || e >= 6832 && e <= 6911 || e >= 7616 && e <= 7679 || e >= 8400 && e <= 8447 || e >= 65056 && e <= 65071;
|
|
450
459
|
}
|
|
451
460
|
function D(e) {
|
|
452
461
|
return e >= 4352 && e <= 4447 || e >= 11904 && e <= 12031 || e >= 12032 && e <= 12255 || e >= 12288 && e <= 12351 || e >= 12352 && e <= 12447 || e >= 12448 && e <= 12543 || e >= 12544 && e <= 12591 || e >= 12592 && e <= 12687 || e >= 12688 && e <= 12799 || e >= 12800 && e <= 13311 || e >= 13312 && e <= 19903 || e >= 19968 && e <= 40959 || e >= 44032 && e <= 55215 || e >= 63744 && e <= 64255 || e >= 65280 && e <= 65376 || e >= 65504 && e <= 65510 || e >= 131072;
|
|
453
462
|
}
|
|
454
|
-
var
|
|
463
|
+
var pe = /\p{Emoji_Presentation}/u, O = /\p{Extended_Pictographic}/u;
|
|
455
464
|
function k(e) {
|
|
456
465
|
return e >= 9632 && e <= 9727;
|
|
457
466
|
}
|
|
@@ -459,7 +468,7 @@ function A(e) {
|
|
|
459
468
|
return e >= 8596 && e <= 8601 || e === 8617 || e === 8618;
|
|
460
469
|
}
|
|
461
470
|
function j(e) {
|
|
462
|
-
if (
|
|
471
|
+
if (pe.test(e)) return !0;
|
|
463
472
|
let t = e.codePointAt(0);
|
|
464
473
|
return t !== void 0 && k(t) || t !== void 0 && A(t) ? !1 : O.test(e);
|
|
465
474
|
}
|
|
@@ -475,14 +484,14 @@ function N(e) {
|
|
|
475
484
|
/* v8 ignore else */
|
|
476
485
|
if (t !== void 0) return t;
|
|
477
486
|
}
|
|
478
|
-
if (
|
|
487
|
+
if (fe(t)) return 0;
|
|
479
488
|
if (D(t) || j(e)) return 2;
|
|
480
489
|
let n = e.normalize("NFD")[0];
|
|
481
490
|
if (n !== void 0 && n !== e) {
|
|
482
491
|
let e = E[n];
|
|
483
492
|
if (e !== void 0) return e;
|
|
484
493
|
}
|
|
485
|
-
return e === " " ? .3 :
|
|
494
|
+
return e === " " ? .3 : ue.has(e) ? 1.5 : le.has(e) ? 1.2 : ce.has(e) ? .4 : de.has(e) ? .5 : e === "r" ? .8 : t >= 65 && t <= 90 ? 1.2 : 1;
|
|
486
495
|
}
|
|
487
496
|
var P = .6, F = !1;
|
|
488
497
|
function I(e) {
|
|
@@ -517,12 +526,25 @@ function B(e, t, n) {
|
|
|
517
526
|
};
|
|
518
527
|
}
|
|
519
528
|
//#endregion
|
|
529
|
+
//#region packages/core/src/render-utils.ts
|
|
530
|
+
function me(e) {
|
|
531
|
+
return Number.isFinite(e) ? Number(e.toFixed(2)) : 0;
|
|
532
|
+
}
|
|
533
|
+
function V(e, ...t) {
|
|
534
|
+
let n = e[0] ?? "";
|
|
535
|
+
for (let r = 0; r < t.length; r++) {
|
|
536
|
+
let i = t[r];
|
|
537
|
+
n += String(typeof i == "number" ? me(i) : i), n += e[r + 1] ?? "";
|
|
538
|
+
}
|
|
539
|
+
return n;
|
|
540
|
+
}
|
|
541
|
+
//#endregion
|
|
520
542
|
//#region packages/core/src/multiline-utils.ts
|
|
521
|
-
function
|
|
543
|
+
function he(e) {
|
|
522
544
|
let t = e.startsWith("\"") && e.endsWith("\"") ? e.slice(1, -1) : e;
|
|
523
545
|
return (t.length >= 2 && t.startsWith("`") && t.endsWith("`") ? t.slice(1, -1) : t).replace(/<br\s*\/?>/gi, "\n").replace(/\\n/g, "\n").replace(/<\/?(?:sub|sup|small|mark)\s*>/gi, "").replace(/\*\*(.+?)\*\*/g, "<b>$1</b>").replace(/(?<!\*)\*([^\s*](?:[^*]*[^\s*])?)\*(?!\*)/g, "<i>$1</i>").replace(/~~(.+?)~~/g, "<s>$1</s>");
|
|
524
546
|
}
|
|
525
|
-
function
|
|
547
|
+
function ge(e) {
|
|
526
548
|
return e.replace(/<\/?(?:b|strong|i|em|u|s|del)\s*>/gi, "");
|
|
527
549
|
}
|
|
528
550
|
function H(e) {
|
|
@@ -532,7 +554,7 @@ function U(e) {
|
|
|
532
554
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
533
555
|
}
|
|
534
556
|
var W = /<(\/)?(?:(b|strong)|(i|em)|(u)|(s|del))\s*>/gi;
|
|
535
|
-
function
|
|
557
|
+
function _e(e) {
|
|
536
558
|
let t = [], n = !1, r = !1, i = !1, a = !1, o = 0;
|
|
537
559
|
W.lastIndex = 0;
|
|
538
560
|
let s;
|
|
@@ -555,10 +577,10 @@ function me(e) {
|
|
|
555
577
|
strikethrough: a
|
|
556
578
|
}), t;
|
|
557
579
|
}
|
|
558
|
-
var
|
|
580
|
+
var ve = /<\/?(?:b|strong|i|em|u|s|del)\s*>/i;
|
|
559
581
|
function G(e) {
|
|
560
|
-
if (!
|
|
561
|
-
let t =
|
|
582
|
+
if (!ve.test(e)) return H(e);
|
|
583
|
+
let t = _e(e);
|
|
562
584
|
return t.length === 0 ? "" : t.every((e) => !e.bold && !e.italic && !e.underline && !e.strikethrough) ? t.map((e) => H(e.text)).join("") : t.map((e) => {
|
|
563
585
|
let t = H(e.text);
|
|
564
586
|
if (!e.bold && !e.italic && !e.underline && !e.strikethrough) return t;
|
|
@@ -570,13 +592,13 @@ function G(e) {
|
|
|
570
592
|
}
|
|
571
593
|
function K(e, t, n, r, i, a = .35) {
|
|
572
594
|
let o = e.split("\n");
|
|
573
|
-
if (o.length === 1) return `<text x="${t}" y="${n}" ${i} dy="${r * a}">${G(e)}</text>`;
|
|
595
|
+
if (o.length === 1) return V`<text x="${t}" y="${n}" ${i} dy="${r * a}">${G(e)}</text>`;
|
|
574
596
|
let s = r * z, c = -((o.length - 1) / 2) * s + r * a;
|
|
575
|
-
return `<text x="${t}" y="${n}" ${i}>${o.map((e, n) => `<tspan x="${t}" dy="${n === 0 ? c : s}">${G(e)}</tspan>`).join("")}</text>`;
|
|
597
|
+
return V`<text x="${t}" y="${n}" ${i}>${o.map((e, n) => V`<tspan x="${t}" dy="${n === 0 ? c : s}">${G(e)}</tspan>`).join("")}</text>`;
|
|
576
598
|
}
|
|
577
|
-
function
|
|
599
|
+
function ye(e, t, n, r, i, a, o, s, c) {
|
|
578
600
|
let l = r + o * 2, u = i + o * 2;
|
|
579
|
-
return `${`<rect x="${t - l / 2}" y="${n - u / 2}" width="${l}" height="${u}" ${c} />`}\n${K(e, t, n, a, s)}`;
|
|
601
|
+
return `${V`<rect x="${t - l / 2}" y="${n - u / 2}" ` + V`width="${l}" height="${u}" ${c} />`}\n${K(e, t, n, a, s)}`;
|
|
580
602
|
}
|
|
581
603
|
//#endregion
|
|
582
604
|
//#region packages/core/src/style-directives.ts
|
|
@@ -591,7 +613,7 @@ function q(e) {
|
|
|
591
613
|
}
|
|
592
614
|
return n;
|
|
593
615
|
}
|
|
594
|
-
function
|
|
616
|
+
function be(e, t) {
|
|
595
617
|
let n = e.match(/^classDef\s+([\w,-]+)\s+(.+)$/);
|
|
596
618
|
if (!n) return !1;
|
|
597
619
|
let r = q(n[2]);
|
|
@@ -601,14 +623,14 @@ function _e(e, t) {
|
|
|
601
623
|
}
|
|
602
624
|
return !0;
|
|
603
625
|
}
|
|
604
|
-
function
|
|
605
|
-
let n = e.match(/^class\s+([\w
|
|
626
|
+
function xe(e, t) {
|
|
627
|
+
let n = e.match(/^class\s+([\w-]+(?:\s*,\s*[\w-]+)*)\s+([\w-]+)\s*;?\s*$/);
|
|
606
628
|
if (!n) return !1;
|
|
607
629
|
let r = n[2];
|
|
608
630
|
for (let e of n[1].split(",")) t.classAssignments.set(e.trim(), r);
|
|
609
631
|
return !0;
|
|
610
632
|
}
|
|
611
|
-
function
|
|
633
|
+
function Se(e, t) {
|
|
612
634
|
let n = e.match(/^cssClass\s+"([^"]*)"\s+([\w-]+)\s*;?\s*$/);
|
|
613
635
|
if (!n) return !1;
|
|
614
636
|
let r = n[2];
|
|
@@ -618,7 +640,7 @@ function ye(e, t) {
|
|
|
618
640
|
}
|
|
619
641
|
return !0;
|
|
620
642
|
}
|
|
621
|
-
function
|
|
643
|
+
function Ce(e, t) {
|
|
622
644
|
let n = e.match(/^style\s+([\w,-]+)\s+(.+)$/);
|
|
623
645
|
if (!n) return !1;
|
|
624
646
|
let r = q(n[2]);
|
|
@@ -628,14 +650,14 @@ function be(e, t) {
|
|
|
628
650
|
});
|
|
629
651
|
return !0;
|
|
630
652
|
}
|
|
631
|
-
function
|
|
653
|
+
function we(e) {
|
|
632
654
|
let t = e.match(/^(.+?):::([\w][\w-]*)$/);
|
|
633
655
|
return t ? {
|
|
634
656
|
id: t[1],
|
|
635
657
|
className: t[2]
|
|
636
658
|
} : { id: e };
|
|
637
659
|
}
|
|
638
|
-
function
|
|
660
|
+
function Te(e, t) {
|
|
639
661
|
let n, r = t.classDefs.get("default");
|
|
640
662
|
r && (n = { ...r });
|
|
641
663
|
let i = t.classAssignments.get(e);
|
|
@@ -652,12 +674,12 @@ function Se(e, t) {
|
|
|
652
674
|
...a
|
|
653
675
|
} : { ...a }), n;
|
|
654
676
|
}
|
|
655
|
-
function
|
|
677
|
+
function Ee(e) {
|
|
656
678
|
if (e) return /^-?[a-zA-Z_][a-zA-Z0-9_-]*$/.test(e) ? e : void 0;
|
|
657
679
|
}
|
|
658
680
|
//#endregion
|
|
659
681
|
//#region packages/core/src/generated/mono-font-subset.ts
|
|
660
|
-
var
|
|
682
|
+
var De = "JetBrains Mono NL", Oe = "@font-face {\n font-family: 'JetBrains Mono NL';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(data:font/woff2;base64,d09GMgABAAAAABvAAAwAAAAAPWAAABtwAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGkAGYACDNhEICuRsz2ELgyYAATYCJAOGPgQgBYREByAbWjAjEcHGARCEduZRlMfRhcj+eWAbMx8MXsFY1AMYgxQLh2GYMVuWSbQZOjzvQhHrXnbH28KzVPg3QpJZomrI6lliLI+KSSeVPYryGIWmPDYrgaI8OLLE8fIV9/c6y/e+ZNB7khbIPiKu+INtefkIygBJXcZuFw+Bd3fmquSqTJ+0GZ7fZg+wWJs7K0AUEQHJD5//iQ+S309/SlLBBtTtTnc7t3bhLlxduEx3nbtd9Lz0omqTc5mf7DQLP00WgKwmeiAKtX1uOXD1m1fn56okB8lB6wJO7Z8Opg7bqe/enmXs3EmWrFiWq4A+OTnKTz74OFCwi3by/3t2iVFFoK29qd2IthumsRuv5Xn6e1P/ycxLsdVgFa8K29qdH9DYWoB6t0RxwVKIsolbF+tMMrFCOoWXa82cBTkvrXqlGUCkBSmWlle2L8Cg7fNXktAIFKNoUCxjQbGaHYUWR7FZBsVRWY/ipJrCrkymZYO6nIcBR5tZcoafBSsL9MHZOmiHe0D1qMY169//GZD7sGUAoFx/yQfatPi2mSk5ooSsSbQx17Jy+Db1SxKE8aTWuFYD7VPayMwe5T74XysImHYWcGebWTc76pJ7HHCbGbucsMV+m91iqylnnXbGDnejcBCXr0KRYiXKVahUpVotlmZsLThaCbQTEpHY61b7XHSH50ihVDQwRiZmFnZOLm4eXmFRMXE9EgYMGjIsY7eH7HHBIds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ZWlYq0h0VP24evYJ1/16E5rXbdc24AMC) format('woff2');\n unicode-range: U+0020-007E, U+00A0-00FF;\n}", ke = {
|
|
661
683
|
bg: "#FFFFFF",
|
|
662
684
|
fg: "#27272A"
|
|
663
685
|
}, J = {
|
|
@@ -672,7 +694,7 @@ var we = "JetBrains Mono NL", Te = "@font-face {\n font-family: 'JetBrains Mono
|
|
|
672
694
|
groupHeader: 5,
|
|
673
695
|
innerStroke: 12,
|
|
674
696
|
keyBadge: 10
|
|
675
|
-
},
|
|
697
|
+
}, Ae = {
|
|
676
698
|
"zinc-light": {
|
|
677
699
|
bg: "#FFFFFF",
|
|
678
700
|
fg: "#27272A"
|
|
@@ -773,7 +795,7 @@ var we = "JetBrains Mono NL", Te = "@font-face {\n font-family: 'JetBrains Mono
|
|
|
773
795
|
muted: "#5c6370"
|
|
774
796
|
}
|
|
775
797
|
};
|
|
776
|
-
function
|
|
798
|
+
function je(e) {
|
|
777
799
|
let t = e.colors ?? {}, n = e.type === "dark", r = (t) => e.tokenColors?.find((e) => Array.isArray(e.scope) ? e.scope.includes(t) : e.scope === t)?.settings?.foreground;
|
|
778
800
|
return {
|
|
779
801
|
bg: t["editor.background"] ?? (n ? "#1e1e1e" : "#ffffff"),
|
|
@@ -785,16 +807,16 @@ function Oe(e) {
|
|
|
785
807
|
border: t["editorWidget.border"] ?? void 0
|
|
786
808
|
};
|
|
787
809
|
}
|
|
788
|
-
var
|
|
789
|
-
function
|
|
810
|
+
var Y = /[<>{};]/;
|
|
811
|
+
function Me(e) {
|
|
790
812
|
let t = e.trim();
|
|
791
|
-
if (!t.startsWith("var(") || !t.endsWith(")") ||
|
|
813
|
+
if (!t.startsWith("var(") || !t.endsWith(")") || Y.test(t)) return !1;
|
|
792
814
|
let n = 0;
|
|
793
815
|
for (let e of t) if (e === "(") n++;
|
|
794
816
|
else if (e === ")" && (n--, n < 0)) return !1;
|
|
795
817
|
return n === 0;
|
|
796
818
|
}
|
|
797
|
-
var
|
|
819
|
+
var Ne = /* @__PURE__ */ new Set([
|
|
798
820
|
"sans-serif",
|
|
799
821
|
"serif",
|
|
800
822
|
"monospace",
|
|
@@ -809,15 +831,15 @@ var je = /* @__PURE__ */ new Set([
|
|
|
809
831
|
"emoji",
|
|
810
832
|
"fangsong"
|
|
811
833
|
]);
|
|
812
|
-
function
|
|
834
|
+
function Pe(e) {
|
|
813
835
|
let t = e.trim();
|
|
814
|
-
return t.includes(",") ? !0 :
|
|
836
|
+
return t.includes(",") ? !0 : Ne.has(t.toLowerCase());
|
|
815
837
|
}
|
|
816
838
|
function X(e) {
|
|
817
839
|
return e === void 0 || e.trim() === "" ? "<style>" : `<style nonce="${U(e)}">`;
|
|
818
840
|
}
|
|
819
|
-
function
|
|
820
|
-
let r =
|
|
841
|
+
function Fe(e, t, n) {
|
|
842
|
+
let r = Me(e), i = r ? e.trim() : e.replace(/[<>{};'"]/g, ""), a = r || Pe(e) ? [] : [`@import url('https://fonts.googleapis.com/css2?family=${encodeURIComponent(i)}:wght@400;500;600;700&display=swap');`], o = `
|
|
821
843
|
/* Derived from --bg and --fg (overridable via --line, --accent, etc.) */
|
|
822
844
|
--_text: var(--fg);
|
|
823
845
|
--_text-sec: var(--muted, color-mix(in srgb, var(--fg) ${J.textSec}%, var(--bg)));
|
|
@@ -834,27 +856,27 @@ function Me(e, t, n) {
|
|
|
834
856
|
return [
|
|
835
857
|
X(n),
|
|
836
858
|
...a.length > 0 ? [` ${a.join("\n ")}`] : [],
|
|
837
|
-
...t ? [` ${
|
|
859
|
+
...t ? [` ${Oe}`] : [],
|
|
838
860
|
` text { font-family: ${r ? i : `'${i}'`}, system-ui, sans-serif; }`,
|
|
839
|
-
...t ? [` .mono { font-family: '${
|
|
861
|
+
...t ? [` .mono { font-family: '${De}', 'SF Mono', 'Fira Code', ui-monospace, monospace; }`] : [],
|
|
840
862
|
` svg {${o}`,
|
|
841
863
|
" }",
|
|
842
864
|
"</style>"
|
|
843
865
|
].join("\n");
|
|
844
866
|
}
|
|
845
|
-
function
|
|
867
|
+
function Ie(e, t, n) {
|
|
846
868
|
return (.299 * e + .587 * t + .114 * n) / 255;
|
|
847
869
|
}
|
|
848
|
-
function
|
|
870
|
+
function Le(e, t) {
|
|
849
871
|
if (!e) return t;
|
|
850
872
|
let n = i(e);
|
|
851
|
-
return n ?
|
|
873
|
+
return n ? Ie(...n) > .5 ? "#000000" : "#FFFFFF" : t;
|
|
852
874
|
}
|
|
853
875
|
var Z = 0;
|
|
854
876
|
function Q() {
|
|
855
877
|
return Z += 1, `zm-title-${Z}`;
|
|
856
878
|
}
|
|
857
|
-
function
|
|
879
|
+
function Re() {
|
|
858
880
|
Z = 0;
|
|
859
881
|
}
|
|
860
882
|
function $(e, t) {
|
|
@@ -868,7 +890,7 @@ function $(e, t) {
|
|
|
868
890
|
e.border ? `--border:${e.border}` : ""
|
|
869
891
|
].filter(Boolean).join(";")}${t ? "" : ";background:var(--bg)"}`;
|
|
870
892
|
}
|
|
871
|
-
function
|
|
893
|
+
function ze(e, t, n, r, i, a, o, s = !0) {
|
|
872
894
|
let c = s ? ` style="${$(n, r)}"` : "", l = "", u = "";
|
|
873
895
|
if (o) {
|
|
874
896
|
if (i) {
|
|
@@ -880,9 +902,9 @@ function Ie(e, t, n, r, i, a, o, s = !0) {
|
|
|
880
902
|
let e = Q();
|
|
881
903
|
l += ` aria-labelledby="${e}"`, u = `\n <title id="${e}">${H(i)}</title>`;
|
|
882
904
|
}
|
|
883
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e} ${t}" width="${e}" height="${t}"${l}${c}>` + u;
|
|
905
|
+
return V`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e} ${t}" ` + V`width="${e}" height="${t}"${l}${c}>` + u;
|
|
884
906
|
}
|
|
885
907
|
//#endregion
|
|
886
|
-
export {
|
|
908
|
+
export { ke as DEFAULTS, v as DIAGRAM_TYPES, z as LINE_HEIGHT_RATIO, J as MIX, Ae as THEMES, Re as __resetSvgTitleIdCounterForTests, e as applyClickStatement, ae as applyInitConfig, Fe as buildStyleBlock, oe as describeIgnored, te as detectDiagramType, U as escapeAttr, H as escapeXml, ie as extractInitConfig, V as f, f as formatCssColor, je as fromShikiTheme, N as getCharWidth, Le as getReadableTextColor, se as hasMeasuredAdvance, y as isDirection, w as isInitDirective, I as isMonospaceFont, M as isWideChar, B as measureMultilineText, R as measureTextWidth, u as mixHexColors, l as mixSrgb, he as normalizeBrTags, c as parseCssColor, i as parseHexColor, a as parseHexRgba, T as parseInitDirective, q as parseStyleProps, K as renderMultilineText, ye as renderMultilineTextWithBackground, Te as resolveNodeStyle, t as safeHref, Ee as sanitizeClassName, L as setMonospaceMetrics, we as splitClassShorthand, _ as splitStatements, g as splitStatementsByLine, ge as stripFormattingTags, X as styleOpenTag, ze as svgOpenTag, $ as themeStyleDeclarations, ne as toDirection, xe as tryApplyClassAssignment, be as tryApplyClassDef, Se as tryApplyCssClass, Ce as tryApplyStyleStatement, b as withDirectionOverride };
|
|
887
909
|
|
|
888
910
|
//# sourceMappingURL=index.js.map
|