@zombie-mermaid/core 3.0.0 → 3.1.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 +20 -1
- package/dist/index.d.ts +20 -1
- package/dist/index.js +94 -74
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/render-utils.test.ts +59 -0
- package/src/diagram-type.ts +15 -1
- package/src/index.ts +1 -0
- package/src/multiline-utils.ts +6 -5
- package/src/render-utils.ts +54 -0
- 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"];
|
|
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
|
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"];
|
|
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
|
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,13 +180,20 @@ 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
|
-
|
|
188
|
+
var v = [
|
|
189
|
+
"flowchart",
|
|
190
|
+
"sequence",
|
|
191
|
+
"class",
|
|
192
|
+
"er",
|
|
193
|
+
"xychart"
|
|
194
|
+
];
|
|
195
|
+
function te(e) {
|
|
196
|
+
let t = _(e)[0]?.text.toLowerCase() ?? "";
|
|
190
197
|
return /^xychart(?:-beta)?(?:\s|$)/.test(t) ? "xychart" : /^sequencediagram\s*$/.test(t) ? "sequence" : /^classdiagram\s*$/.test(t) ? "class" : /^erdiagram\s*$/.test(t) ? "er" : "flowchart";
|
|
191
198
|
}
|
|
192
199
|
//#endregion
|
|
@@ -194,14 +201,14 @@ function ee(e) {
|
|
|
194
201
|
function y(e) {
|
|
195
202
|
return e === "TD" || e === "TB" || e === "LR" || e === "BT" || e === "RL";
|
|
196
203
|
}
|
|
197
|
-
function
|
|
204
|
+
function ne(e) {
|
|
198
205
|
let t = e?.toUpperCase();
|
|
199
206
|
if (t === void 0 || !y(t)) throw Error(`Invalid direction: "${e}"`);
|
|
200
207
|
return t;
|
|
201
208
|
}
|
|
202
209
|
//#endregion
|
|
203
210
|
//#region packages/core/src/direction-override.ts
|
|
204
|
-
function
|
|
211
|
+
function b(e, t) {
|
|
205
212
|
return t === void 0 || !y(t) ? e : {
|
|
206
213
|
...e,
|
|
207
214
|
direction: t
|
|
@@ -209,14 +216,14 @@ function ne(e, t) {
|
|
|
209
216
|
}
|
|
210
217
|
//#endregion
|
|
211
218
|
//#region packages/core/src/init-directive.ts
|
|
212
|
-
var
|
|
219
|
+
var x = /* @__PURE__ */ new Set([
|
|
213
220
|
"linear",
|
|
214
221
|
"basis",
|
|
215
222
|
"natural",
|
|
216
223
|
"step",
|
|
217
224
|
"stepBefore",
|
|
218
225
|
"stepAfter"
|
|
219
|
-
]),
|
|
226
|
+
]), S = {
|
|
220
227
|
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
228
|
securitylevel: "this renderer emits static SVG and never executes diagram-supplied script, so there is no sandbox to configure",
|
|
222
229
|
defaultrenderer: "ELK is the only layout engine; dagre/elk selection has no effect",
|
|
@@ -224,11 +231,11 @@ var b = /* @__PURE__ */ new Set([
|
|
|
224
231
|
htmllabels: "labels are always rendered as SVG text; there is no HTML label mode",
|
|
225
232
|
maxtextsize: "no text-size limit is enforced",
|
|
226
233
|
startonload: "not a browser auto-render integration"
|
|
227
|
-
},
|
|
228
|
-
function
|
|
229
|
-
return
|
|
234
|
+
}, C = /^\s*%%\{\s*(?:init|initialize)\s*:\s*([\s\S]*?)\}%%/i;
|
|
235
|
+
function w(e) {
|
|
236
|
+
return C.test(e);
|
|
230
237
|
}
|
|
231
|
-
function
|
|
238
|
+
function re(e) {
|
|
232
239
|
let t = "", n = null;
|
|
233
240
|
for (let r = 0; r < e.length; r++) {
|
|
234
241
|
let i = e[r];
|
|
@@ -259,12 +266,12 @@ function ie(e) {
|
|
|
259
266
|
}
|
|
260
267
|
return t;
|
|
261
268
|
}
|
|
262
|
-
function
|
|
263
|
-
let t = e.match(
|
|
269
|
+
function T(e) {
|
|
270
|
+
let t = e.match(C);
|
|
264
271
|
if (!t) return;
|
|
265
272
|
let n;
|
|
266
273
|
try {
|
|
267
|
-
n = JSON.parse(
|
|
274
|
+
n = JSON.parse(re(t[1]));
|
|
268
275
|
} catch {
|
|
269
276
|
return;
|
|
270
277
|
}
|
|
@@ -280,33 +287,33 @@ function C(e) {
|
|
|
280
287
|
let e = { ...t };
|
|
281
288
|
for (let [t, n] of Object.entries(e)) {
|
|
282
289
|
if (t.toLowerCase() === "curve" && typeof n == "string") {
|
|
283
|
-
|
|
290
|
+
x.has(n) && (r.curve = n);
|
|
284
291
|
continue;
|
|
285
292
|
}
|
|
286
|
-
t.toLowerCase() in
|
|
293
|
+
t.toLowerCase() in S && r.ignored.push(t);
|
|
287
294
|
}
|
|
288
295
|
continue;
|
|
289
296
|
}
|
|
290
|
-
n in
|
|
297
|
+
n in S && r.ignored.push(e);
|
|
291
298
|
}
|
|
292
299
|
return r;
|
|
293
300
|
}
|
|
294
|
-
function
|
|
301
|
+
function ie(e) {
|
|
295
302
|
let t = { ignored: [] };
|
|
296
303
|
for (let n of e) {
|
|
297
|
-
let e =
|
|
304
|
+
let e = T(n);
|
|
298
305
|
e && (e.theme !== void 0 && (t.theme = e.theme), e.curve !== void 0 && (t.curve = e.curve), t.ignored.push(...e.ignored));
|
|
299
306
|
}
|
|
300
307
|
return t;
|
|
301
308
|
}
|
|
302
|
-
function
|
|
309
|
+
function ae(e, t) {
|
|
303
310
|
return t.curve === void 0 || e.curve !== void 0 ? e : {
|
|
304
311
|
...e,
|
|
305
312
|
curve: t.curve
|
|
306
313
|
};
|
|
307
314
|
}
|
|
308
|
-
function
|
|
309
|
-
return [...new Set(e.ignored)].map((e) => `${e}: ${
|
|
315
|
+
function oe(e) {
|
|
316
|
+
return [...new Set(e.ignored)].map((e) => `${e}: ${S[e.toLowerCase()] ?? "not supported"}`);
|
|
310
317
|
}
|
|
311
318
|
//#endregion
|
|
312
319
|
//#region packages/core/src/text-metrics.ts
|
|
@@ -407,10 +414,10 @@ var E = {
|
|
|
407
414
|
"}": .789,
|
|
408
415
|
"~": 1.225
|
|
409
416
|
};
|
|
410
|
-
function
|
|
417
|
+
function se(e) {
|
|
411
418
|
return Object.hasOwn(E, e);
|
|
412
419
|
}
|
|
413
|
-
var
|
|
420
|
+
var ce = /* @__PURE__ */ new Set([
|
|
414
421
|
"i",
|
|
415
422
|
"l",
|
|
416
423
|
"t",
|
|
@@ -425,14 +432,14 @@ var se = /* @__PURE__ */ new Set([
|
|
|
425
432
|
":",
|
|
426
433
|
";",
|
|
427
434
|
"'"
|
|
428
|
-
]),
|
|
435
|
+
]), le = /* @__PURE__ */ new Set([
|
|
429
436
|
"W",
|
|
430
437
|
"M",
|
|
431
438
|
"w",
|
|
432
439
|
"m",
|
|
433
440
|
"@",
|
|
434
441
|
"%"
|
|
435
|
-
]),
|
|
442
|
+
]), ue = /* @__PURE__ */ new Set(["W", "M"]), de = /* @__PURE__ */ new Set([
|
|
436
443
|
"(",
|
|
437
444
|
")",
|
|
438
445
|
"[",
|
|
@@ -445,13 +452,13 @@ var se = /* @__PURE__ */ new Set([
|
|
|
445
452
|
"\"",
|
|
446
453
|
"`"
|
|
447
454
|
]);
|
|
448
|
-
function
|
|
455
|
+
function fe(e) {
|
|
449
456
|
return e >= 768 && e <= 879 || e >= 6832 && e <= 6911 || e >= 7616 && e <= 7679 || e >= 8400 && e <= 8447 || e >= 65056 && e <= 65071;
|
|
450
457
|
}
|
|
451
458
|
function D(e) {
|
|
452
459
|
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
460
|
}
|
|
454
|
-
var
|
|
461
|
+
var pe = /\p{Emoji_Presentation}/u, O = /\p{Extended_Pictographic}/u;
|
|
455
462
|
function k(e) {
|
|
456
463
|
return e >= 9632 && e <= 9727;
|
|
457
464
|
}
|
|
@@ -459,7 +466,7 @@ function A(e) {
|
|
|
459
466
|
return e >= 8596 && e <= 8601 || e === 8617 || e === 8618;
|
|
460
467
|
}
|
|
461
468
|
function j(e) {
|
|
462
|
-
if (
|
|
469
|
+
if (pe.test(e)) return !0;
|
|
463
470
|
let t = e.codePointAt(0);
|
|
464
471
|
return t !== void 0 && k(t) || t !== void 0 && A(t) ? !1 : O.test(e);
|
|
465
472
|
}
|
|
@@ -475,14 +482,14 @@ function N(e) {
|
|
|
475
482
|
/* v8 ignore else */
|
|
476
483
|
if (t !== void 0) return t;
|
|
477
484
|
}
|
|
478
|
-
if (
|
|
485
|
+
if (fe(t)) return 0;
|
|
479
486
|
if (D(t) || j(e)) return 2;
|
|
480
487
|
let n = e.normalize("NFD")[0];
|
|
481
488
|
if (n !== void 0 && n !== e) {
|
|
482
489
|
let e = E[n];
|
|
483
490
|
if (e !== void 0) return e;
|
|
484
491
|
}
|
|
485
|
-
return e === " " ? .3 :
|
|
492
|
+
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
493
|
}
|
|
487
494
|
var P = .6, F = !1;
|
|
488
495
|
function I(e) {
|
|
@@ -517,12 +524,25 @@ function B(e, t, n) {
|
|
|
517
524
|
};
|
|
518
525
|
}
|
|
519
526
|
//#endregion
|
|
527
|
+
//#region packages/core/src/render-utils.ts
|
|
528
|
+
function me(e) {
|
|
529
|
+
return Number.isFinite(e) ? Number(e.toFixed(2)) : 0;
|
|
530
|
+
}
|
|
531
|
+
function V(e, ...t) {
|
|
532
|
+
let n = e[0] ?? "";
|
|
533
|
+
for (let r = 0; r < t.length; r++) {
|
|
534
|
+
let i = t[r];
|
|
535
|
+
n += String(typeof i == "number" ? me(i) : i), n += e[r + 1] ?? "";
|
|
536
|
+
}
|
|
537
|
+
return n;
|
|
538
|
+
}
|
|
539
|
+
//#endregion
|
|
520
540
|
//#region packages/core/src/multiline-utils.ts
|
|
521
|
-
function
|
|
541
|
+
function he(e) {
|
|
522
542
|
let t = e.startsWith("\"") && e.endsWith("\"") ? e.slice(1, -1) : e;
|
|
523
543
|
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
544
|
}
|
|
525
|
-
function
|
|
545
|
+
function ge(e) {
|
|
526
546
|
return e.replace(/<\/?(?:b|strong|i|em|u|s|del)\s*>/gi, "");
|
|
527
547
|
}
|
|
528
548
|
function H(e) {
|
|
@@ -532,7 +552,7 @@ function U(e) {
|
|
|
532
552
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
533
553
|
}
|
|
534
554
|
var W = /<(\/)?(?:(b|strong)|(i|em)|(u)|(s|del))\s*>/gi;
|
|
535
|
-
function
|
|
555
|
+
function _e(e) {
|
|
536
556
|
let t = [], n = !1, r = !1, i = !1, a = !1, o = 0;
|
|
537
557
|
W.lastIndex = 0;
|
|
538
558
|
let s;
|
|
@@ -555,10 +575,10 @@ function me(e) {
|
|
|
555
575
|
strikethrough: a
|
|
556
576
|
}), t;
|
|
557
577
|
}
|
|
558
|
-
var
|
|
578
|
+
var ve = /<\/?(?:b|strong|i|em|u|s|del)\s*>/i;
|
|
559
579
|
function G(e) {
|
|
560
|
-
if (!
|
|
561
|
-
let t =
|
|
580
|
+
if (!ve.test(e)) return H(e);
|
|
581
|
+
let t = _e(e);
|
|
562
582
|
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
583
|
let t = H(e.text);
|
|
564
584
|
if (!e.bold && !e.italic && !e.underline && !e.strikethrough) return t;
|
|
@@ -570,13 +590,13 @@ function G(e) {
|
|
|
570
590
|
}
|
|
571
591
|
function K(e, t, n, r, i, a = .35) {
|
|
572
592
|
let o = e.split("\n");
|
|
573
|
-
if (o.length === 1) return `<text x="${t}" y="${n}" ${i} dy="${r * a}">${G(e)}</text>`;
|
|
593
|
+
if (o.length === 1) return V`<text x="${t}" y="${n}" ${i} dy="${r * a}">${G(e)}</text>`;
|
|
574
594
|
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>`;
|
|
595
|
+
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
596
|
}
|
|
577
|
-
function
|
|
597
|
+
function ye(e, t, n, r, i, a, o, s, c) {
|
|
578
598
|
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)}`;
|
|
599
|
+
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
600
|
}
|
|
581
601
|
//#endregion
|
|
582
602
|
//#region packages/core/src/style-directives.ts
|
|
@@ -591,7 +611,7 @@ function q(e) {
|
|
|
591
611
|
}
|
|
592
612
|
return n;
|
|
593
613
|
}
|
|
594
|
-
function
|
|
614
|
+
function be(e, t) {
|
|
595
615
|
let n = e.match(/^classDef\s+([\w,-]+)\s+(.+)$/);
|
|
596
616
|
if (!n) return !1;
|
|
597
617
|
let r = q(n[2]);
|
|
@@ -601,14 +621,14 @@ function _e(e, t) {
|
|
|
601
621
|
}
|
|
602
622
|
return !0;
|
|
603
623
|
}
|
|
604
|
-
function
|
|
624
|
+
function xe(e, t) {
|
|
605
625
|
let n = e.match(/^class\s+([\w,-]+)\s+([\w-]+)\s*;?\s*$/);
|
|
606
626
|
if (!n) return !1;
|
|
607
627
|
let r = n[2];
|
|
608
628
|
for (let e of n[1].split(",")) t.classAssignments.set(e.trim(), r);
|
|
609
629
|
return !0;
|
|
610
630
|
}
|
|
611
|
-
function
|
|
631
|
+
function Se(e, t) {
|
|
612
632
|
let n = e.match(/^cssClass\s+"([^"]*)"\s+([\w-]+)\s*;?\s*$/);
|
|
613
633
|
if (!n) return !1;
|
|
614
634
|
let r = n[2];
|
|
@@ -618,7 +638,7 @@ function ye(e, t) {
|
|
|
618
638
|
}
|
|
619
639
|
return !0;
|
|
620
640
|
}
|
|
621
|
-
function
|
|
641
|
+
function Ce(e, t) {
|
|
622
642
|
let n = e.match(/^style\s+([\w,-]+)\s+(.+)$/);
|
|
623
643
|
if (!n) return !1;
|
|
624
644
|
let r = q(n[2]);
|
|
@@ -628,14 +648,14 @@ function be(e, t) {
|
|
|
628
648
|
});
|
|
629
649
|
return !0;
|
|
630
650
|
}
|
|
631
|
-
function
|
|
651
|
+
function we(e) {
|
|
632
652
|
let t = e.match(/^(.+?):::([\w][\w-]*)$/);
|
|
633
653
|
return t ? {
|
|
634
654
|
id: t[1],
|
|
635
655
|
className: t[2]
|
|
636
656
|
} : { id: e };
|
|
637
657
|
}
|
|
638
|
-
function
|
|
658
|
+
function Te(e, t) {
|
|
639
659
|
let n, r = t.classDefs.get("default");
|
|
640
660
|
r && (n = { ...r });
|
|
641
661
|
let i = t.classAssignments.get(e);
|
|
@@ -652,12 +672,12 @@ function Se(e, t) {
|
|
|
652
672
|
...a
|
|
653
673
|
} : { ...a }), n;
|
|
654
674
|
}
|
|
655
|
-
function
|
|
675
|
+
function Ee(e) {
|
|
656
676
|
if (e) return /^-?[a-zA-Z_][a-zA-Z0-9_-]*$/.test(e) ? e : void 0;
|
|
657
677
|
}
|
|
658
678
|
//#endregion
|
|
659
679
|
//#region packages/core/src/generated/mono-font-subset.ts
|
|
660
|
-
var
|
|
680
|
+
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/yQfatPi2mSk5oo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T0iKU0xKWoJ+/TX4Wgm0aQd5/oyMuJAREoP/k7YyIT/LKJ5WEk20zy7GIRQ9qrAm7YWa3K7Jt6YmrPHcNFCBHAifTVS3pYbykNWHyxO69bhj8Ql/ILLsb4nYhF0o41JgJS/ZEQkc9ZPuegalpIlkRNaQt3MZLq5uCap+ZWlYq0h0VP24evYJ1/16E5rXbdc24AMC) format('woff2');\n unicode-range: U+0020-007E, U+00A0-00FF;\n}", ke = {
|
|
661
681
|
bg: "#FFFFFF",
|
|
662
682
|
fg: "#27272A"
|
|
663
683
|
}, J = {
|
|
@@ -672,7 +692,7 @@ var we = "JetBrains Mono NL", Te = "@font-face {\n font-family: 'JetBrains Mono
|
|
|
672
692
|
groupHeader: 5,
|
|
673
693
|
innerStroke: 12,
|
|
674
694
|
keyBadge: 10
|
|
675
|
-
},
|
|
695
|
+
}, Ae = {
|
|
676
696
|
"zinc-light": {
|
|
677
697
|
bg: "#FFFFFF",
|
|
678
698
|
fg: "#27272A"
|
|
@@ -773,7 +793,7 @@ var we = "JetBrains Mono NL", Te = "@font-face {\n font-family: 'JetBrains Mono
|
|
|
773
793
|
muted: "#5c6370"
|
|
774
794
|
}
|
|
775
795
|
};
|
|
776
|
-
function
|
|
796
|
+
function je(e) {
|
|
777
797
|
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
798
|
return {
|
|
779
799
|
bg: t["editor.background"] ?? (n ? "#1e1e1e" : "#ffffff"),
|
|
@@ -785,16 +805,16 @@ function Oe(e) {
|
|
|
785
805
|
border: t["editorWidget.border"] ?? void 0
|
|
786
806
|
};
|
|
787
807
|
}
|
|
788
|
-
var
|
|
789
|
-
function
|
|
808
|
+
var Y = /[<>{};]/;
|
|
809
|
+
function Me(e) {
|
|
790
810
|
let t = e.trim();
|
|
791
|
-
if (!t.startsWith("var(") || !t.endsWith(")") ||
|
|
811
|
+
if (!t.startsWith("var(") || !t.endsWith(")") || Y.test(t)) return !1;
|
|
792
812
|
let n = 0;
|
|
793
813
|
for (let e of t) if (e === "(") n++;
|
|
794
814
|
else if (e === ")" && (n--, n < 0)) return !1;
|
|
795
815
|
return n === 0;
|
|
796
816
|
}
|
|
797
|
-
var
|
|
817
|
+
var Ne = /* @__PURE__ */ new Set([
|
|
798
818
|
"sans-serif",
|
|
799
819
|
"serif",
|
|
800
820
|
"monospace",
|
|
@@ -809,15 +829,15 @@ var je = /* @__PURE__ */ new Set([
|
|
|
809
829
|
"emoji",
|
|
810
830
|
"fangsong"
|
|
811
831
|
]);
|
|
812
|
-
function
|
|
832
|
+
function Pe(e) {
|
|
813
833
|
let t = e.trim();
|
|
814
|
-
return t.includes(",") ? !0 :
|
|
834
|
+
return t.includes(",") ? !0 : Ne.has(t.toLowerCase());
|
|
815
835
|
}
|
|
816
836
|
function X(e) {
|
|
817
837
|
return e === void 0 || e.trim() === "" ? "<style>" : `<style nonce="${U(e)}">`;
|
|
818
838
|
}
|
|
819
|
-
function
|
|
820
|
-
let r =
|
|
839
|
+
function Fe(e, t, n) {
|
|
840
|
+
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
841
|
/* Derived from --bg and --fg (overridable via --line, --accent, etc.) */
|
|
822
842
|
--_text: var(--fg);
|
|
823
843
|
--_text-sec: var(--muted, color-mix(in srgb, var(--fg) ${J.textSec}%, var(--bg)));
|
|
@@ -834,27 +854,27 @@ function Me(e, t, n) {
|
|
|
834
854
|
return [
|
|
835
855
|
X(n),
|
|
836
856
|
...a.length > 0 ? [` ${a.join("\n ")}`] : [],
|
|
837
|
-
...t ? [` ${
|
|
857
|
+
...t ? [` ${Oe}`] : [],
|
|
838
858
|
` text { font-family: ${r ? i : `'${i}'`}, system-ui, sans-serif; }`,
|
|
839
|
-
...t ? [` .mono { font-family: '${
|
|
859
|
+
...t ? [` .mono { font-family: '${De}', 'SF Mono', 'Fira Code', ui-monospace, monospace; }`] : [],
|
|
840
860
|
` svg {${o}`,
|
|
841
861
|
" }",
|
|
842
862
|
"</style>"
|
|
843
863
|
].join("\n");
|
|
844
864
|
}
|
|
845
|
-
function
|
|
865
|
+
function Ie(e, t, n) {
|
|
846
866
|
return (.299 * e + .587 * t + .114 * n) / 255;
|
|
847
867
|
}
|
|
848
|
-
function
|
|
868
|
+
function Le(e, t) {
|
|
849
869
|
if (!e) return t;
|
|
850
870
|
let n = i(e);
|
|
851
|
-
return n ?
|
|
871
|
+
return n ? Ie(...n) > .5 ? "#000000" : "#FFFFFF" : t;
|
|
852
872
|
}
|
|
853
873
|
var Z = 0;
|
|
854
874
|
function Q() {
|
|
855
875
|
return Z += 1, `zm-title-${Z}`;
|
|
856
876
|
}
|
|
857
|
-
function
|
|
877
|
+
function Re() {
|
|
858
878
|
Z = 0;
|
|
859
879
|
}
|
|
860
880
|
function $(e, t) {
|
|
@@ -868,7 +888,7 @@ function $(e, t) {
|
|
|
868
888
|
e.border ? `--border:${e.border}` : ""
|
|
869
889
|
].filter(Boolean).join(";")}${t ? "" : ";background:var(--bg)"}`;
|
|
870
890
|
}
|
|
871
|
-
function
|
|
891
|
+
function ze(e, t, n, r, i, a, o, s = !0) {
|
|
872
892
|
let c = s ? ` style="${$(n, r)}"` : "", l = "", u = "";
|
|
873
893
|
if (o) {
|
|
874
894
|
if (i) {
|
|
@@ -880,9 +900,9 @@ function Ie(e, t, n, r, i, a, o, s = !0) {
|
|
|
880
900
|
let e = Q();
|
|
881
901
|
l += ` aria-labelledby="${e}"`, u = `\n <title id="${e}">${H(i)}</title>`;
|
|
882
902
|
}
|
|
883
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e} ${t}" width="${e}" height="${t}"${l}${c}>` + u;
|
|
903
|
+
return V`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${e} ${t}" ` + V`width="${e}" height="${t}"${l}${c}>` + u;
|
|
884
904
|
}
|
|
885
905
|
//#endregion
|
|
886
|
-
export {
|
|
906
|
+
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
907
|
|
|
888
908
|
//# sourceMappingURL=index.js.map
|