@zombie-mermaid/mermaid-parser 3.2.0 → 4.0.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 +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +6 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/xychart-colors.test.ts +34 -0
- package/src/class/parser.ts +8 -13
- package/src/class/types.ts +13 -0
- package/src/sequence/types.ts +2 -0
- package/src/xychart/colors.ts +10 -4
package/dist/index.d.cts
CHANGED
|
@@ -13,6 +13,8 @@ export declare interface Activation {
|
|
|
13
13
|
topY: number;
|
|
14
14
|
bottomY: number;
|
|
15
15
|
width: number;
|
|
16
|
+
/** Nesting level on this actor's lifeline: 0 for the outermost bar, 1 for a bar opened while one is already active, and so on */
|
|
17
|
+
depth: number;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
export declare interface ActivationCheckResult {
|
|
@@ -471,7 +473,7 @@ export declare function formatClassMember(m: ClassMember): string;
|
|
|
471
473
|
* Get the hex color for a series index.
|
|
472
474
|
* Index 0 returns the accent color as-is.
|
|
473
475
|
* Index 1+ alternate between darker and lighter shades of the same hue
|
|
474
|
-
* with subtle hue drift (
|
|
476
|
+
* with subtle hue drift (-8° per tier for darker, -12° for lighter) to stay in the same family.
|
|
475
477
|
*
|
|
476
478
|
* When `bgColor` is provided, shade direction adapts to the background:
|
|
477
479
|
* - Light bg: odd = darker, even = lighter (default)
|
|
@@ -808,6 +810,19 @@ export declare interface PositionedClassDiagram {
|
|
|
808
810
|
classes: PositionedClassNode[];
|
|
809
811
|
relationships: PositionedClassRelationship[];
|
|
810
812
|
notes: PositionedClassNote[];
|
|
813
|
+
/** Namespace frames, drawn behind their member classes */
|
|
814
|
+
namespaces: PositionedClassNamespace[];
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
/** A `namespace Name { ... }` block's frame, in diagram coordinates */
|
|
818
|
+
export declare interface PositionedClassNamespace {
|
|
819
|
+
name: string;
|
|
820
|
+
/** Ids of the member classes the frame encloses */
|
|
821
|
+
classIds: string[];
|
|
822
|
+
x: number;
|
|
823
|
+
y: number;
|
|
824
|
+
width: number;
|
|
825
|
+
height: number;
|
|
811
826
|
}
|
|
812
827
|
|
|
813
828
|
export declare interface PositionedClassNode {
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ export declare interface Activation {
|
|
|
13
13
|
topY: number;
|
|
14
14
|
bottomY: number;
|
|
15
15
|
width: number;
|
|
16
|
+
/** Nesting level on this actor's lifeline: 0 for the outermost bar, 1 for a bar opened while one is already active, and so on */
|
|
17
|
+
depth: number;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
export declare interface ActivationCheckResult {
|
|
@@ -471,7 +473,7 @@ export declare function formatClassMember(m: ClassMember): string;
|
|
|
471
473
|
* Get the hex color for a series index.
|
|
472
474
|
* Index 0 returns the accent color as-is.
|
|
473
475
|
* Index 1+ alternate between darker and lighter shades of the same hue
|
|
474
|
-
* with subtle hue drift (
|
|
476
|
+
* with subtle hue drift (-8° per tier for darker, -12° for lighter) to stay in the same family.
|
|
475
477
|
*
|
|
476
478
|
* When `bgColor` is provided, shade direction adapts to the background:
|
|
477
479
|
* - Light bg: odd = darker, even = lighter (default)
|
|
@@ -808,6 +810,19 @@ export declare interface PositionedClassDiagram {
|
|
|
808
810
|
classes: PositionedClassNode[];
|
|
809
811
|
relationships: PositionedClassRelationship[];
|
|
810
812
|
notes: PositionedClassNote[];
|
|
813
|
+
/** Namespace frames, drawn behind their member classes */
|
|
814
|
+
namespaces: PositionedClassNamespace[];
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
/** A `namespace Name { ... }` block's frame, in diagram coordinates */
|
|
818
|
+
export declare interface PositionedClassNamespace {
|
|
819
|
+
name: string;
|
|
820
|
+
/** Ids of the member classes the frame encloses */
|
|
821
|
+
classIds: string[];
|
|
822
|
+
x: number;
|
|
823
|
+
y: number;
|
|
824
|
+
width: number;
|
|
825
|
+
height: number;
|
|
811
826
|
}
|
|
812
827
|
|
|
813
828
|
export declare interface PositionedClassNode {
|
package/dist/index.js
CHANGED
|
@@ -482,16 +482,14 @@ function ye(e, t) {
|
|
|
482
482
|
isMethod: !0
|
|
483
483
|
};
|
|
484
484
|
}
|
|
485
|
-
let s = A(i).
|
|
486
|
-
s.length >= 2 ? (l = s[0], c = s.slice(1).join(" ")) : c = s[0] ?? i;
|
|
487
|
-
let u = c.endsWith("$"), d = c.endsWith("*");
|
|
485
|
+
let s = A(i), c = s.endsWith("$"), l = s.endsWith("*");
|
|
488
486
|
return {
|
|
489
487
|
member: {
|
|
490
488
|
visibility: r,
|
|
491
|
-
name:
|
|
492
|
-
type:
|
|
493
|
-
isStatic:
|
|
494
|
-
isAbstract:
|
|
489
|
+
name: s.replace(/[$*]$/, ""),
|
|
490
|
+
type: void 0,
|
|
491
|
+
isStatic: c,
|
|
492
|
+
isAbstract: l,
|
|
495
493
|
isMethod: !1
|
|
496
494
|
},
|
|
497
495
|
isMethod: !1
|
|
@@ -1084,7 +1082,7 @@ function X(e) {
|
|
|
1084
1082
|
function Le(e, t, n) {
|
|
1085
1083
|
if (e === 0) return t;
|
|
1086
1084
|
let r = Y(t) ? t : q, i = n && Y(n) ? n : void 0, [a, o] = J(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);
|
|
1087
|
-
return Ie(((a + (u ? -8 : 12) * c) % 360 + 360) % 360, s, d);
|
|
1085
|
+
return Ie(((a + (u ? -8 : -12) * c) % 360 + 360) % 360, s, d);
|
|
1088
1086
|
}
|
|
1089
1087
|
//#endregion
|
|
1090
1088
|
//#region packages/mermaid-parser/src/expanded-shapes.ts
|