@zombie-mermaid/mermaid-parser 2.2.6 → 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 +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -7
- package/dist/index.d.ts +0 -7
- package/dist/index.js +17 -33
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/xychart-colors.test.ts +0 -19
- package/src/xychart/colors.ts +0 -41
package/dist/index.d.cts
CHANGED
|
@@ -424,13 +424,6 @@ export declare interface Message {
|
|
|
424
424
|
seqNumber?: number;
|
|
425
425
|
}
|
|
426
426
|
|
|
427
|
-
/**
|
|
428
|
-
* Mix two hex colors in RGB space.
|
|
429
|
-
* `ratio` controls how much of `fgHex` shows: 0 = pure bg, 1 = pure fg.
|
|
430
|
-
* Equivalent to alpha-compositing fg over bg at the given opacity.
|
|
431
|
-
*/
|
|
432
|
-
export declare function mixHexColors(bgHex: string, fgHex: string, ratio: number): string;
|
|
433
|
-
|
|
434
427
|
export declare interface Note {
|
|
435
428
|
/** Which actor(s) the note is attached to */
|
|
436
429
|
actorIds: string[];
|
package/dist/index.d.ts
CHANGED
|
@@ -424,13 +424,6 @@ export declare interface Message {
|
|
|
424
424
|
seqNumber?: number;
|
|
425
425
|
}
|
|
426
426
|
|
|
427
|
-
/**
|
|
428
|
-
* Mix two hex colors in RGB space.
|
|
429
|
-
* `ratio` controls how much of `fgHex` shows: 0 = pure bg, 1 = pure fg.
|
|
430
|
-
* Equivalent to alpha-compositing fg over bg at the given opacity.
|
|
431
|
-
*/
|
|
432
|
-
export declare function mixHexColors(bgHex: string, fgHex: string, ratio: number): string;
|
|
433
|
-
|
|
434
427
|
export declare interface Note {
|
|
435
428
|
/** Which actor(s) the note is attached to */
|
|
436
429
|
actorIds: string[];
|
package/dist/index.js
CHANGED
|
@@ -338,9 +338,9 @@ function D(e) {
|
|
|
338
338
|
}
|
|
339
339
|
//#endregion
|
|
340
340
|
//#region packages/mermaid-parser/src/sequence/box-color.ts
|
|
341
|
-
var
|
|
341
|
+
var ee = new Set("aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray green greenyellow grey honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray slategrey snow springgreen steelblue tan teal thistle tomato turquoise violet wheat white whitesmoke yellow yellowgreen".split(" ")), O = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i, k = /^(?:rgba?|hsla?)\(\s*[\d.%]+(?:[\s,/]+[\d.%]+){2,3}\s*\)$/i;
|
|
342
342
|
function A(e) {
|
|
343
|
-
return
|
|
343
|
+
return ee.has(e.toLowerCase()) || O.test(e) || k.test(e);
|
|
344
344
|
}
|
|
345
345
|
function j(e) {
|
|
346
346
|
let t = e.trim(), n = t.match(/^((?:rgba?|hsla?)\s*\([^)]*\)|#[0-9a-fA-F]+|\S+)?(.*)$/), r = n?.[1] ?? "", i = n?.[2]?.trim() ?? "";
|
|
@@ -752,35 +752,19 @@ function J(e, t, n) {
|
|
|
752
752
|
return `#${d(c)}${d(l)}${d(u)}`;
|
|
753
753
|
}
|
|
754
754
|
function Y(e) {
|
|
755
|
-
let t = e.replace("#", "");
|
|
756
|
-
return [
|
|
757
|
-
parseInt(t.substring(0, 2), 16),
|
|
758
|
-
parseInt(t.substring(2, 4), 16),
|
|
759
|
-
parseInt(t.substring(4, 6), 16)
|
|
760
|
-
];
|
|
761
|
-
}
|
|
762
|
-
function ae(e, t, n) {
|
|
763
|
-
let r = (e) => Math.round(Math.max(0, Math.min(255, e))).toString(16).padStart(2, "0");
|
|
764
|
-
return `#${r(e)}${r(t)}${r(n)}`;
|
|
765
|
-
}
|
|
766
|
-
function X(e) {
|
|
767
755
|
return /^#[0-9a-fA-F]{6}$/.test(e);
|
|
768
756
|
}
|
|
769
|
-
function
|
|
757
|
+
function X(e) {
|
|
770
758
|
return q(e)[2] < 50;
|
|
771
759
|
}
|
|
772
|
-
function
|
|
773
|
-
let [r, i, a] = Y(e), [o, s, c] = Y(t), l = 1 - n;
|
|
774
|
-
return ae(r * l + o * n, i * l + s * n, a * l + c * n);
|
|
775
|
-
}
|
|
776
|
-
function se(e, t, n) {
|
|
760
|
+
function ae(e, t, n) {
|
|
777
761
|
if (e === 0) return t;
|
|
778
|
-
let r =
|
|
762
|
+
let r = Y(t) ? t : K, i = n && Y(n) ? n : void 0, [a, o] = q(r), s = Math.max(55, Math.min(85, o)), c = Math.ceil(e / 2), l = e % 2 == 1, u = i && X(i) ? !l : l, d = u ? Math.max(25, 48 - c * 13) : Math.min(78, 55 + c * 11);
|
|
779
763
|
return J(((a + (u ? -8 : 12) * c) % 360 + 360) % 360, s, d);
|
|
780
764
|
}
|
|
781
765
|
//#endregion
|
|
782
766
|
//#region packages/mermaid-parser/src/expanded-shapes.ts
|
|
783
|
-
var
|
|
767
|
+
var Z = {
|
|
784
768
|
rect: "rectangle",
|
|
785
769
|
rectangle: "rectangle",
|
|
786
770
|
proc: "rectangle",
|
|
@@ -906,18 +890,18 @@ var Q = {
|
|
|
906
890
|
text: "text",
|
|
907
891
|
anchor: "anchor"
|
|
908
892
|
};
|
|
909
|
-
function
|
|
910
|
-
return
|
|
893
|
+
function oe(e) {
|
|
894
|
+
return Z[e.trim().toLowerCase()];
|
|
911
895
|
}
|
|
912
|
-
function
|
|
913
|
-
return Object.keys(
|
|
896
|
+
function se() {
|
|
897
|
+
return Object.keys(Z).sort();
|
|
914
898
|
}
|
|
915
|
-
function
|
|
899
|
+
function Q(e) {
|
|
916
900
|
let t = {};
|
|
917
|
-
for (let n of
|
|
901
|
+
for (let n of ce(e, ",")) {
|
|
918
902
|
let e = n.trim();
|
|
919
903
|
if (e.length === 0) continue;
|
|
920
|
-
let r =
|
|
904
|
+
let r = le(e, ":");
|
|
921
905
|
if (r === -1) {
|
|
922
906
|
t.shape ??= $(e);
|
|
923
907
|
continue;
|
|
@@ -927,7 +911,7 @@ function ue(e) {
|
|
|
927
911
|
}
|
|
928
912
|
return t;
|
|
929
913
|
}
|
|
930
|
-
function
|
|
914
|
+
function ce(e, t) {
|
|
931
915
|
let n = [], r = "", i = null;
|
|
932
916
|
for (let a of e) {
|
|
933
917
|
if (i !== null) {
|
|
@@ -946,7 +930,7 @@ function de(e, t) {
|
|
|
946
930
|
}
|
|
947
931
|
return n.push(r), n;
|
|
948
932
|
}
|
|
949
|
-
function
|
|
933
|
+
function le(e, t) {
|
|
950
934
|
let n = null;
|
|
951
935
|
for (let r = 0; r < e.length; r++) {
|
|
952
936
|
let i = e[r];
|
|
@@ -965,7 +949,7 @@ function fe(e, t) {
|
|
|
965
949
|
function $(e) {
|
|
966
950
|
return e.length >= 2 && (e.startsWith("\"") && e.endsWith("\"") || e.startsWith("'") && e.endsWith("'")) ? e.slice(1, -1) : e;
|
|
967
951
|
}
|
|
968
|
-
function
|
|
952
|
+
function ue(e) {
|
|
969
953
|
if (!e.startsWith("@{")) return;
|
|
970
954
|
let t = 0, n = null;
|
|
971
955
|
for (let r = 1; r < e.length; r++) {
|
|
@@ -989,6 +973,6 @@ function pe(e) {
|
|
|
989
973
|
}
|
|
990
974
|
}
|
|
991
975
|
//#endregion
|
|
992
|
-
export { K as CHART_ACCENT_FALLBACK, B as checkActivationBalance, re as fixActivationBalance, x as formatClassMember,
|
|
976
|
+
export { K as CHART_ACCENT_FALLBACK, B as checkActivationBalance, re as fixActivationBalance, x as formatClassMember, ae as getSeriesColor, M as isBlockType, A as isCssColor, X as isDarkBackground, Y as isValidHex, se as knownShapeNames, ue as matchExpandedBlock, j as parseBoxHeader, f as parseClassDiagram, S as parseErDiagram, Q as parseExpandedMeta, _ as parseGenericTypes, P as parseSequenceDiagram, ie as parseXYChart, oe as resolveShapeName, N as toBlockType };
|
|
993
977
|
|
|
994
978
|
//# sourceMappingURL=index.js.map
|