@oh-my-pi/pi-utils 16.0.6 → 16.0.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.
Files changed (87) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/types/mermaid-ascii.d.ts +1 -1
  3. package/dist/types/vendor/mermaid-ascii/ascii/ansi.d.ts +41 -0
  4. package/dist/types/vendor/mermaid-ascii/ascii/canvas.d.ts +89 -0
  5. package/dist/types/vendor/mermaid-ascii/ascii/class-diagram.d.ts +7 -0
  6. package/dist/types/vendor/mermaid-ascii/ascii/converter.d.ts +12 -0
  7. package/dist/types/vendor/mermaid-ascii/ascii/draw.d.ts +66 -0
  8. package/dist/types/vendor/mermaid-ascii/ascii/edge-bundling.d.ts +48 -0
  9. package/dist/types/vendor/mermaid-ascii/ascii/edge-routing.d.ts +43 -0
  10. package/dist/types/vendor/mermaid-ascii/ascii/er-diagram.d.ts +7 -0
  11. package/dist/types/vendor/mermaid-ascii/ascii/grid.d.ts +56 -0
  12. package/dist/types/vendor/mermaid-ascii/ascii/index.d.ts +65 -0
  13. package/dist/types/vendor/mermaid-ascii/ascii/multiline-utils.d.ts +27 -0
  14. package/dist/types/vendor/mermaid-ascii/ascii/pathfinder.d.ts +17 -0
  15. package/dist/types/vendor/mermaid-ascii/ascii/sequence.d.ts +7 -0
  16. package/dist/types/vendor/mermaid-ascii/ascii/shapes/circle.d.ts +11 -0
  17. package/dist/types/vendor/mermaid-ascii/ascii/shapes/corners.d.ts +34 -0
  18. package/dist/types/vendor/mermaid-ascii/ascii/shapes/diamond.d.ts +11 -0
  19. package/dist/types/vendor/mermaid-ascii/ascii/shapes/hexagon.d.ts +11 -0
  20. package/dist/types/vendor/mermaid-ascii/ascii/shapes/index.d.ts +26 -0
  21. package/dist/types/vendor/mermaid-ascii/ascii/shapes/rectangle.d.ts +31 -0
  22. package/dist/types/vendor/mermaid-ascii/ascii/shapes/rounded.d.ts +11 -0
  23. package/dist/types/vendor/mermaid-ascii/ascii/shapes/special.d.ts +59 -0
  24. package/dist/types/vendor/mermaid-ascii/ascii/shapes/stadium.d.ts +17 -0
  25. package/dist/types/vendor/mermaid-ascii/ascii/shapes/state.d.ts +30 -0
  26. package/dist/types/vendor/mermaid-ascii/ascii/shapes/types.d.ts +55 -0
  27. package/dist/types/vendor/mermaid-ascii/ascii/types.d.ts +206 -0
  28. package/dist/types/vendor/mermaid-ascii/ascii/validate.d.ts +51 -0
  29. package/dist/types/vendor/mermaid-ascii/ascii/xychart.d.ts +2 -0
  30. package/dist/types/vendor/mermaid-ascii/class/parser.d.ts +6 -0
  31. package/dist/types/vendor/mermaid-ascii/class/types.d.ts +102 -0
  32. package/dist/types/vendor/mermaid-ascii/er/parser.d.ts +6 -0
  33. package/dist/types/vendor/mermaid-ascii/er/types.d.ts +76 -0
  34. package/dist/types/vendor/mermaid-ascii/index.d.ts +1 -0
  35. package/dist/types/vendor/mermaid-ascii/multiline-utils.d.ts +9 -0
  36. package/dist/types/vendor/mermaid-ascii/parser.d.ts +7 -0
  37. package/dist/types/vendor/mermaid-ascii/sequence/parser.d.ts +6 -0
  38. package/dist/types/vendor/mermaid-ascii/sequence/types.d.ts +130 -0
  39. package/dist/types/vendor/mermaid-ascii/text-metrics.d.ts +21 -0
  40. package/dist/types/vendor/mermaid-ascii/types.d.ts +114 -0
  41. package/dist/types/vendor/mermaid-ascii/xychart/colors.d.ts +25 -0
  42. package/dist/types/vendor/mermaid-ascii/xychart/parser.d.ts +6 -0
  43. package/dist/types/vendor/mermaid-ascii/xychart/types.d.ts +145 -0
  44. package/package.json +2 -3
  45. package/src/mermaid-ascii.ts +1 -1
  46. package/src/vendor/mermaid-ascii/NOTICE +33 -0
  47. package/src/vendor/mermaid-ascii/ascii/ansi.ts +409 -0
  48. package/src/vendor/mermaid-ascii/ascii/canvas.ts +476 -0
  49. package/src/vendor/mermaid-ascii/ascii/class-diagram.ts +699 -0
  50. package/src/vendor/mermaid-ascii/ascii/converter.ts +271 -0
  51. package/src/vendor/mermaid-ascii/ascii/draw.ts +1382 -0
  52. package/src/vendor/mermaid-ascii/ascii/edge-bundling.ts +328 -0
  53. package/src/vendor/mermaid-ascii/ascii/edge-routing.ts +297 -0
  54. package/src/vendor/mermaid-ascii/ascii/er-diagram.ts +441 -0
  55. package/src/vendor/mermaid-ascii/ascii/grid.ts +578 -0
  56. package/src/vendor/mermaid-ascii/ascii/index.ts +187 -0
  57. package/src/vendor/mermaid-ascii/ascii/multiline-utils.ts +78 -0
  58. package/src/vendor/mermaid-ascii/ascii/pathfinder.ts +215 -0
  59. package/src/vendor/mermaid-ascii/ascii/sequence.ts +460 -0
  60. package/src/vendor/mermaid-ascii/ascii/shapes/circle.ts +27 -0
  61. package/src/vendor/mermaid-ascii/ascii/shapes/corners.ts +127 -0
  62. package/src/vendor/mermaid-ascii/ascii/shapes/diamond.ts +27 -0
  63. package/src/vendor/mermaid-ascii/ascii/shapes/hexagon.ts +27 -0
  64. package/src/vendor/mermaid-ascii/ascii/shapes/index.ts +101 -0
  65. package/src/vendor/mermaid-ascii/ascii/shapes/rectangle.ts +175 -0
  66. package/src/vendor/mermaid-ascii/ascii/shapes/rounded.ts +27 -0
  67. package/src/vendor/mermaid-ascii/ascii/shapes/special.ts +296 -0
  68. package/src/vendor/mermaid-ascii/ascii/shapes/stadium.ts +114 -0
  69. package/src/vendor/mermaid-ascii/ascii/shapes/state.ts +192 -0
  70. package/src/vendor/mermaid-ascii/ascii/shapes/types.ts +73 -0
  71. package/src/vendor/mermaid-ascii/ascii/types.ts +273 -0
  72. package/src/vendor/mermaid-ascii/ascii/validate.ts +120 -0
  73. package/src/vendor/mermaid-ascii/ascii/xychart.ts +875 -0
  74. package/src/vendor/mermaid-ascii/class/parser.ts +290 -0
  75. package/src/vendor/mermaid-ascii/class/types.ts +121 -0
  76. package/src/vendor/mermaid-ascii/er/parser.ts +181 -0
  77. package/src/vendor/mermaid-ascii/er/types.ts +91 -0
  78. package/src/vendor/mermaid-ascii/index.ts +14 -0
  79. package/src/vendor/mermaid-ascii/multiline-utils.ts +30 -0
  80. package/src/vendor/mermaid-ascii/parser.ts +645 -0
  81. package/src/vendor/mermaid-ascii/sequence/parser.ts +207 -0
  82. package/src/vendor/mermaid-ascii/sequence/types.ts +146 -0
  83. package/src/vendor/mermaid-ascii/text-metrics.ts +71 -0
  84. package/src/vendor/mermaid-ascii/types.ts +164 -0
  85. package/src/vendor/mermaid-ascii/xychart/colors.ts +140 -0
  86. package/src/vendor/mermaid-ascii/xychart/parser.ts +115 -0
  87. package/src/vendor/mermaid-ascii/xychart/types.ts +150 -0
@@ -0,0 +1,130 @@
1
+ /** Parsed sequence diagram — logical structure from mermaid text */
2
+ export interface SequenceDiagram {
3
+ /** Ordered list of actors/participants */
4
+ actors: Actor[];
5
+ /** Messages between actors in chronological order */
6
+ messages: Message[];
7
+ /** Structural blocks (loop, alt, opt, par, critical) */
8
+ blocks: Block[];
9
+ /** Notes attached to actors */
10
+ notes: Note[];
11
+ }
12
+ export interface Actor {
13
+ id: string;
14
+ label: string;
15
+ /** 'participant' renders as a box, 'actor' renders as a stick figure */
16
+ type: 'participant' | 'actor';
17
+ }
18
+ export interface Message {
19
+ from: string;
20
+ to: string;
21
+ label: string;
22
+ /** Arrow style: solid line or dashed line */
23
+ lineStyle: 'solid' | 'dashed';
24
+ /** Arrow head: filled (closed) or open */
25
+ arrowHead: 'filled' | 'open';
26
+ /** Activate the target lifeline (+) */
27
+ activate?: boolean;
28
+ /** Deactivate the source lifeline (-) */
29
+ deactivate?: boolean;
30
+ }
31
+ export interface Block {
32
+ /** Block type keyword */
33
+ type: 'loop' | 'alt' | 'opt' | 'par' | 'critical' | 'break' | 'rect';
34
+ /** Label for the block header */
35
+ label: string;
36
+ /** Index of the first message inside this block */
37
+ startIndex: number;
38
+ /** Index of the last message inside this block (inclusive) */
39
+ endIndex: number;
40
+ /** For alt/par blocks: indices where "else"/"and" dividers appear (message indices) */
41
+ dividers: Array<{
42
+ index: number;
43
+ label: string;
44
+ }>;
45
+ }
46
+ export interface Note {
47
+ /** Which actor(s) the note is attached to */
48
+ actorIds: string[];
49
+ /** Note text content */
50
+ text: string;
51
+ /** Position relative to the actor(s) */
52
+ position: 'left' | 'right' | 'over';
53
+ /** Message index after which this note appears */
54
+ afterIndex: number;
55
+ }
56
+ export interface PositionedSequenceDiagram {
57
+ width: number;
58
+ height: number;
59
+ actors: PositionedActor[];
60
+ lifelines: Lifeline[];
61
+ messages: PositionedMessage[];
62
+ activations: Activation[];
63
+ blocks: PositionedBlock[];
64
+ notes: PositionedNote[];
65
+ }
66
+ export interface PositionedActor {
67
+ id: string;
68
+ label: string;
69
+ type: 'participant' | 'actor';
70
+ /** Center x of the actor box */
71
+ x: number;
72
+ /** Top y of the actor box */
73
+ y: number;
74
+ width: number;
75
+ height: number;
76
+ }
77
+ /** Vertical dashed line from actor to bottom of diagram */
78
+ export interface Lifeline {
79
+ actorId: string;
80
+ x: number;
81
+ topY: number;
82
+ bottomY: number;
83
+ }
84
+ export interface PositionedMessage {
85
+ from: string;
86
+ to: string;
87
+ label: string;
88
+ lineStyle: 'solid' | 'dashed';
89
+ arrowHead: 'filled' | 'open';
90
+ /** Start point (from actor's lifeline) */
91
+ x1: number;
92
+ /** End point (to actor's lifeline) */
93
+ x2: number;
94
+ /** Vertical position */
95
+ y: number;
96
+ /** Whether this is a self-message (same actor) */
97
+ isSelf: boolean;
98
+ }
99
+ /** Narrow rectangle on a lifeline showing active processing */
100
+ export interface Activation {
101
+ actorId: string;
102
+ x: number;
103
+ topY: number;
104
+ bottomY: number;
105
+ width: number;
106
+ }
107
+ export interface PositionedBlock {
108
+ type: Block['type'];
109
+ label: string;
110
+ x: number;
111
+ y: number;
112
+ width: number;
113
+ height: number;
114
+ /** Divider lines within the block (for alt/par) */
115
+ dividers: Array<{
116
+ y: number;
117
+ label: string;
118
+ }>;
119
+ }
120
+ export interface PositionedNote {
121
+ text: string;
122
+ x: number;
123
+ y: number;
124
+ width: number;
125
+ height: number;
126
+ /** Actor IDs this note is attached to (for SVG attribution) */
127
+ actors?: string[];
128
+ /** Note position relative to actors (for SVG attribution) */
129
+ position?: 'left' | 'right' | 'over';
130
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Placeholder occupying the second cell of a fullwidth glyph on the ASCII
3
+ * canvas. U+0000 cannot appear in parsed Mermaid labels, is treated as
4
+ * occupied label content by canvas merging, and is stripped at
5
+ * serialization time. Invariant: a WIDE_PAD cell always sits immediately
6
+ * right of its lead cell; canvas writes keep the pair atomic.
7
+ */
8
+ export declare const WIDE_PAD = "\0";
9
+ /**
10
+ * Display width of a string in terminal columns, summed over grapheme
11
+ * clusters so it always equals `toCells(text).length`. ASCII-only strings
12
+ * take a fast path.
13
+ */
14
+ export declare function displayWidth(text: string): number;
15
+ /**
16
+ * Expand a string into ASCII-canvas cells: each 2-column grapheme cluster
17
+ * is stored whole in one cell and followed by WIDE_PAD, so that
18
+ * `cells.length === displayWidth(text)`. Per-character placement loops can
19
+ * iterate the result with plain cell offsets.
20
+ */
21
+ export declare function toCells(text: string): string[];
@@ -0,0 +1,114 @@
1
+ export interface MermaidGraph {
2
+ direction: Direction;
3
+ nodes: Map<string, MermaidNode>;
4
+ edges: MermaidEdge[];
5
+ subgraphs: MermaidSubgraph[];
6
+ classDefs: Map<string, Record<string, string>>;
7
+ /** Maps node IDs to their class names (from `class X className` or `:::className` shorthand) */
8
+ classAssignments: Map<string, string>;
9
+ /** Maps node IDs to inline styles (from `style X fill:#f00,stroke:#333`) */
10
+ nodeStyles: Map<string, Record<string, string>>;
11
+ /** Maps edge indices (or 'default') to inline styles from `linkStyle` directives */
12
+ linkStyles: Map<number | 'default', Record<string, string>>;
13
+ }
14
+ export type Direction = 'TD' | 'TB' | 'LR' | 'BT' | 'RL';
15
+ export interface MermaidNode {
16
+ id: string;
17
+ label: string;
18
+ shape: NodeShape;
19
+ }
20
+ export type NodeShape = 'rectangle' | 'rounded' | 'diamond' | 'stadium' | 'circle' | 'subroutine' | 'doublecircle' | 'hexagon' | 'cylinder' | 'asymmetric' | 'trapezoid' | 'trapezoid-alt' | 'state-start' | 'state-end';
21
+ export interface MermaidEdge {
22
+ source: string;
23
+ target: string;
24
+ label?: string;
25
+ style: EdgeStyle;
26
+ /** Whether to render an arrowhead at the start (source end) of the edge */
27
+ hasArrowStart: boolean;
28
+ /** Whether to render an arrowhead at the end (target end) of the edge */
29
+ hasArrowEnd: boolean;
30
+ }
31
+ export type EdgeStyle = 'solid' | 'dotted' | 'thick';
32
+ export interface MermaidSubgraph {
33
+ id: string;
34
+ label: string;
35
+ nodeIds: string[];
36
+ children: MermaidSubgraph[];
37
+ /** Optional direction override for this subgraph's internal layout */
38
+ direction?: Direction;
39
+ }
40
+ export interface PositionedGraph {
41
+ width: number;
42
+ height: number;
43
+ nodes: PositionedNode[];
44
+ edges: PositionedEdge[];
45
+ groups: PositionedGroup[];
46
+ }
47
+ export interface PositionedNode {
48
+ id: string;
49
+ label: string;
50
+ shape: NodeShape;
51
+ x: number;
52
+ y: number;
53
+ width: number;
54
+ height: number;
55
+ /** Inline styles resolved from classDef + explicit `style` statements — override theme defaults */
56
+ inlineStyle?: Record<string, string>;
57
+ }
58
+ export interface PositionedEdge {
59
+ source: string;
60
+ target: string;
61
+ label?: string;
62
+ style: EdgeStyle;
63
+ hasArrowStart: boolean;
64
+ hasArrowEnd: boolean;
65
+ /** Full path including bends — array of {x, y} points */
66
+ points: Point[];
67
+ /** Layout-computed label center position (avoids label-label collisions) */
68
+ labelPosition?: Point;
69
+ /** Inline styles resolved from `linkStyle` directives — override theme defaults */
70
+ inlineStyle?: Record<string, string>;
71
+ }
72
+ export interface Point {
73
+ x: number;
74
+ y: number;
75
+ }
76
+ export interface PositionedGroup {
77
+ id: string;
78
+ label: string;
79
+ x: number;
80
+ y: number;
81
+ width: number;
82
+ height: number;
83
+ children: PositionedGroup[];
84
+ }
85
+ export interface RenderOptions {
86
+ /** Background color → CSS variable --bg. Default: '#FFFFFF' */
87
+ bg?: string;
88
+ /** Foreground / primary text color → CSS variable --fg. Default: '#27272A' */
89
+ fg?: string;
90
+ /** Edge/connector color → CSS variable --line */
91
+ line?: string;
92
+ /** Arrow heads, highlights → CSS variable --accent */
93
+ accent?: string;
94
+ /** Secondary text, edge labels → CSS variable --muted */
95
+ muted?: string;
96
+ /** Node/box fill tint → CSS variable --surface */
97
+ surface?: string;
98
+ /** Node/group stroke color → CSS variable --border */
99
+ border?: string;
100
+ /** Font family for all text. Default: 'Inter' */
101
+ font?: string;
102
+ /** Canvas padding in px. Default: 40 */
103
+ padding?: number;
104
+ /** Horizontal spacing between sibling nodes. Default: 24 */
105
+ nodeSpacing?: number;
106
+ /** Vertical spacing between layers. Default: 40 */
107
+ layerSpacing?: number;
108
+ /** Spacing between disconnected components. Default: nodeSpacing (24) */
109
+ componentSpacing?: number;
110
+ /** Render with transparent background (no background style on SVG). Default: false */
111
+ transparent?: boolean;
112
+ /** Enable hover tooltips on chart data points (xychart only). Default: false */
113
+ interactive?: boolean;
114
+ }
@@ -0,0 +1,25 @@
1
+ /** Default accent for charts when the theme doesn't provide one. */
2
+ export declare const CHART_ACCENT_FALLBACK = "#3b82f6";
3
+ /** Check whether a string is a valid 6-digit hex color (e.g. "#3b82f6"). */
4
+ export declare function isValidHex(color: string): boolean;
5
+ /**
6
+ * Detect whether a background color is dark (lightness < 50%).
7
+ */
8
+ export declare function isDarkBackground(bgHex: string): boolean;
9
+ /**
10
+ * Mix two hex colors in RGB space.
11
+ * `ratio` controls how much of `fgHex` shows: 0 = pure bg, 1 = pure fg.
12
+ * Equivalent to alpha-compositing fg over bg at the given opacity.
13
+ */
14
+ export declare function mixHexColors(bgHex: string, fgHex: string, ratio: number): string;
15
+ /**
16
+ * Get the hex color for a series index.
17
+ * Index 0 returns the accent color as-is.
18
+ * Index 1+ alternate between darker and lighter shades of the same hue
19
+ * with subtle hue drift (±8-12° per tier) to stay in the same family.
20
+ *
21
+ * When `bgColor` is provided, shade direction adapts to the background:
22
+ * - Light bg: odd = darker, even = lighter (default)
23
+ * - Dark bg: odd = lighter, even = darker (so shades stay visible)
24
+ */
25
+ export declare function getSeriesColor(index: number, accentColor: string, bgColor?: string): string;
@@ -0,0 +1,6 @@
1
+ import type { XYChart } from './types';
2
+ /**
3
+ * Parse a Mermaid xychart-beta diagram from preprocessed lines.
4
+ * Lines should already be trimmed and comment-stripped.
5
+ */
6
+ export declare function parseXYChart(lines: string[]): XYChart;
@@ -0,0 +1,145 @@
1
+ /** Parsed XY chart — logical structure from mermaid text */
2
+ export interface XYChart {
3
+ /** Optional chart title */
4
+ title?: string;
5
+ /** Chart orientation: vertical (default) or horizontal */
6
+ horizontal: boolean;
7
+ /** X-axis configuration */
8
+ xAxis: XYAxis;
9
+ /** Y-axis configuration */
10
+ yAxis: XYAxis;
11
+ /** Data series (bar and/or line) */
12
+ series: XYChartSeries[];
13
+ }
14
+ /** Axis configuration — categorical (labels) or numeric (range) */
15
+ export interface XYAxis {
16
+ /** Optional axis title/label */
17
+ title?: string;
18
+ /** Categorical labels (e.g., ["jan", "feb", "mar"]) — mutually exclusive with range */
19
+ categories?: string[];
20
+ /** Numeric range — mutually exclusive with categories */
21
+ range?: {
22
+ min: number;
23
+ max: number;
24
+ };
25
+ }
26
+ /** A single data series (bar or line) */
27
+ export interface XYChartSeries {
28
+ /** Series type */
29
+ type: 'bar' | 'line';
30
+ /** Data values — one per category, or evenly spaced across numeric range */
31
+ data: number[];
32
+ }
33
+ export interface PositionedXYChart {
34
+ width: number;
35
+ height: number;
36
+ /** Whether this is a horizontal (rotated) chart */
37
+ horizontal?: boolean;
38
+ /** Title text and position (if present) */
39
+ title?: PositionedTitle;
40
+ /** Positioned x-axis with tick marks and labels */
41
+ xAxis: PositionedAxis;
42
+ /** Positioned y-axis with tick marks and labels */
43
+ yAxis: PositionedAxis;
44
+ /** The plot area bounds (inside axes) */
45
+ plotArea: PlotArea;
46
+ /** Positioned bar groups */
47
+ bars: PositionedBar[];
48
+ /** Positioned line polylines */
49
+ lines: PositionedLine[];
50
+ /** Horizontal grid lines for readability */
51
+ gridLines: GridLine[];
52
+ /** Legend items (shown when multiple series) */
53
+ legend: LegendItem[];
54
+ }
55
+ export interface LegendItem {
56
+ /** Display label */
57
+ label: string;
58
+ /** Position of the swatch/icon */
59
+ x: number;
60
+ y: number;
61
+ /** Series type determines swatch shape (rect for bar, line+dot for line) */
62
+ type: 'bar' | 'line';
63
+ /** Series index within its type (for layout grouping) */
64
+ seriesIndex: number;
65
+ /** Global color index across all series (for unified color assignment) */
66
+ colorIndex: number;
67
+ }
68
+ export interface PositionedTitle {
69
+ text: string;
70
+ x: number;
71
+ y: number;
72
+ }
73
+ export interface PositionedAxis {
74
+ /** Optional axis title text and position */
75
+ title?: {
76
+ text: string;
77
+ x: number;
78
+ y: number;
79
+ rotate?: number;
80
+ };
81
+ /** Tick positions along the axis */
82
+ ticks: AxisTick[];
83
+ /** Axis line: start and end coordinates */
84
+ line: {
85
+ x1: number;
86
+ y1: number;
87
+ x2: number;
88
+ y2: number;
89
+ };
90
+ }
91
+ export interface AxisTick {
92
+ /** Label text for this tick */
93
+ label: string;
94
+ /** Position of the tick mark on the axis */
95
+ x: number;
96
+ y: number;
97
+ /** End of the tick mark (short perpendicular line) */
98
+ tx: number;
99
+ ty: number;
100
+ /** Label anchor position */
101
+ labelX: number;
102
+ labelY: number;
103
+ /** Text anchor for label */
104
+ textAnchor: 'start' | 'middle' | 'end';
105
+ }
106
+ export interface PlotArea {
107
+ x: number;
108
+ y: number;
109
+ width: number;
110
+ height: number;
111
+ }
112
+ export interface PositionedBar {
113
+ /** Bar rectangle in SVG coordinates */
114
+ x: number;
115
+ y: number;
116
+ width: number;
117
+ height: number;
118
+ /** Original data value */
119
+ value: number;
120
+ /** Category label for this bar (e.g. "Jan") */
121
+ label?: string;
122
+ /** Series index within bar type (for layout grouping) */
123
+ seriesIndex: number;
124
+ /** Global color index across all series */
125
+ colorIndex: number;
126
+ }
127
+ export interface PositionedLine {
128
+ /** Polyline points */
129
+ points: Array<{
130
+ x: number;
131
+ y: number;
132
+ value: number;
133
+ label?: string;
134
+ }>;
135
+ /** Series index within line type (for layout grouping) */
136
+ seriesIndex: number;
137
+ /** Global color index across all series */
138
+ colorIndex: number;
139
+ }
140
+ export interface GridLine {
141
+ x1: number;
142
+ y1: number;
143
+ x2: number;
144
+ y2: number;
145
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-utils",
4
- "version": "16.0.6",
4
+ "version": "16.0.8",
5
5
  "description": "Shared utilities for pi packages",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": "Can Boluk",
@@ -31,8 +31,7 @@
31
31
  "fmt": "biome format --write ."
32
32
  },
33
33
  "dependencies": {
34
- "@oh-my-pi/pi-natives": "16.0.6",
35
- "beautiful-mermaid": "^1.1.3",
34
+ "@oh-my-pi/pi-natives": "16.0.8",
36
35
  "handlebars": "^4.7.9",
37
36
  "winston": "^3.19.0",
38
37
  "winston-daily-rotate-file": "^5.0.0"
@@ -1,4 +1,4 @@
1
- import { type AsciiRenderOptions, renderMermaidASCII } from "beautiful-mermaid";
1
+ import { type AsciiRenderOptions, renderMermaidASCII } from "./vendor/mermaid-ascii";
2
2
 
3
3
  export type { AsciiRenderOptions as MermaidAsciiRenderOptions };
4
4
 
@@ -0,0 +1,33 @@
1
+ This directory contains an in-house Mermaid-diagram-to-ASCII renderer adapted
2
+ from beautiful-mermaid (https://github.com/lukilabs/beautiful-mermaid), used
3
+ under the MIT License.
4
+
5
+ Copyright (c) 2026 Craft Docs
6
+
7
+ Only the ASCII rendering pipeline is ported (flowchart/state, sequence, class,
8
+ ER, and xychart diagrams); the SVG renderer and its `elkjs` graph-layout
9
+ dependency, the browser entry point, and the SVG theme/style modules were
10
+ dropped. Terminal display width is reimplemented on `Bun.stringWidth`, and
11
+ inline label formatting (HTML tags, markdown emphasis) is reduced to plain text
12
+ for ASCII output. Layout and edge-routing logic is preserved faithfully so
13
+ ASCII output matches the upstream package.
14
+
15
+ MIT License
16
+
17
+ Permission is hereby granted, free of charge, to any person obtaining a copy
18
+ of this software and associated documentation files (the "Software"), to deal
19
+ in the Software without restriction, including without limitation the rights
20
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21
+ copies of the Software, and to permit persons to whom the Software is
22
+ furnished to do so, subject to the following conditions:
23
+
24
+ The above copyright notice and this permission notice shall be included in all
25
+ copies or substantial portions of the Software.
26
+
27
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33
+ SOFTWARE.