@chengchenccc/tui 0.1.1-rc.1

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 (226) hide show
  1. package/dist/autocomplete.d.ts +56 -0
  2. package/dist/autocomplete.d.ts.map +1 -0
  3. package/dist/autocomplete.js +647 -0
  4. package/dist/components/box.d.ts +22 -0
  5. package/dist/components/box.d.ts.map +1 -0
  6. package/dist/components/box.js +103 -0
  7. package/dist/components/card.d.ts +33 -0
  8. package/dist/components/card.d.ts.map +1 -0
  9. package/dist/components/card.js +49 -0
  10. package/dist/components/editor.d.ts +257 -0
  11. package/dist/components/editor.d.ts.map +1 -0
  12. package/dist/components/editor.js +1980 -0
  13. package/dist/components/input.d.ts +37 -0
  14. package/dist/components/input.d.ts.map +1 -0
  15. package/dist/components/input.js +389 -0
  16. package/dist/components/loader.d.ts +33 -0
  17. package/dist/components/loader.d.ts.map +1 -0
  18. package/dist/components/loader.js +100 -0
  19. package/dist/components/markdown.d.ts +108 -0
  20. package/dist/components/markdown.d.ts.map +1 -0
  21. package/dist/components/markdown.js +847 -0
  22. package/dist/components/markdown.test.d.ts +2 -0
  23. package/dist/components/markdown.test.d.ts.map +1 -0
  24. package/dist/components/markdown.test.js +81 -0
  25. package/dist/components/output-block.d.ts +44 -0
  26. package/dist/components/output-block.d.ts.map +1 -0
  27. package/dist/components/output-block.js +131 -0
  28. package/dist/components/select-list.d.ts +50 -0
  29. package/dist/components/select-list.d.ts.map +1 -0
  30. package/dist/components/select-list.js +166 -0
  31. package/dist/components/spacer.d.ts +12 -0
  32. package/dist/components/spacer.d.ts.map +1 -0
  33. package/dist/components/spacer.js +22 -0
  34. package/dist/components/statusline.d.ts +30 -0
  35. package/dist/components/statusline.d.ts.map +1 -0
  36. package/dist/components/statusline.js +46 -0
  37. package/dist/components/text.d.ts +19 -0
  38. package/dist/components/text.d.ts.map +1 -0
  39. package/dist/components/text.js +90 -0
  40. package/dist/components/truncated-text.d.ts +13 -0
  41. package/dist/components/truncated-text.d.ts.map +1 -0
  42. package/dist/components/truncated-text.js +50 -0
  43. package/dist/editor-component.d.ts +39 -0
  44. package/dist/editor-component.d.ts.map +1 -0
  45. package/dist/editor-component.js +1 -0
  46. package/dist/fuzzy.d.ts +16 -0
  47. package/dist/fuzzy.d.ts.map +1 -0
  48. package/dist/fuzzy.js +109 -0
  49. package/dist/index.d.ts +25 -0
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.js +36 -0
  52. package/dist/keybindings.d.ts +193 -0
  53. package/dist/keybindings.d.ts.map +1 -0
  54. package/dist/keybindings.js +191 -0
  55. package/dist/keys.d.ts +184 -0
  56. package/dist/keys.d.ts.map +1 -0
  57. package/dist/keys.js +1191 -0
  58. package/dist/kill-ring.d.ts +28 -0
  59. package/dist/kill-ring.d.ts.map +1 -0
  60. package/dist/kill-ring.js +43 -0
  61. package/dist/mermaid.d.ts +23 -0
  62. package/dist/mermaid.d.ts.map +1 -0
  63. package/dist/mermaid.js +77 -0
  64. package/dist/mouse.d.ts +40 -0
  65. package/dist/mouse.d.ts.map +1 -0
  66. package/dist/mouse.js +39 -0
  67. package/dist/mouse.test.d.ts +2 -0
  68. package/dist/mouse.test.d.ts.map +1 -0
  69. package/dist/mouse.test.js +36 -0
  70. package/dist/native-modifiers.d.ts +3 -0
  71. package/dist/native-modifiers.d.ts.map +1 -0
  72. package/dist/native-modifiers.js +52 -0
  73. package/dist/stdin-buffer.d.ts +50 -0
  74. package/dist/stdin-buffer.d.ts.map +1 -0
  75. package/dist/stdin-buffer.js +360 -0
  76. package/dist/terminal-colors.d.ts +10 -0
  77. package/dist/terminal-colors.d.ts.map +1 -0
  78. package/dist/terminal-colors.js +58 -0
  79. package/dist/terminal-image.d.ts +90 -0
  80. package/dist/terminal-image.d.ts.map +1 -0
  81. package/dist/terminal-image.js +375 -0
  82. package/dist/terminal.d.ts +110 -0
  83. package/dist/terminal.d.ts.map +1 -0
  84. package/dist/terminal.js +432 -0
  85. package/dist/tui-scrollback.test.d.ts +2 -0
  86. package/dist/tui-scrollback.test.d.ts.map +1 -0
  87. package/dist/tui-scrollback.test.js +51 -0
  88. package/dist/tui.d.ts +330 -0
  89. package/dist/tui.d.ts.map +1 -0
  90. package/dist/tui.js +1568 -0
  91. package/dist/undo-stack.d.ts +17 -0
  92. package/dist/undo-stack.d.ts.map +1 -0
  93. package/dist/undo-stack.js +24 -0
  94. package/dist/utils.d.ts +85 -0
  95. package/dist/utils.d.ts.map +1 -0
  96. package/dist/utils.js +1066 -0
  97. package/dist/vendor/mermaid-ascii/ascii/ansi.d.ts +42 -0
  98. package/dist/vendor/mermaid-ascii/ascii/ansi.d.ts.map +1 -0
  99. package/dist/vendor/mermaid-ascii/ascii/ansi.js +361 -0
  100. package/dist/vendor/mermaid-ascii/ascii/canvas.d.ts +90 -0
  101. package/dist/vendor/mermaid-ascii/ascii/canvas.d.ts.map +1 -0
  102. package/dist/vendor/mermaid-ascii/ascii/canvas.js +414 -0
  103. package/dist/vendor/mermaid-ascii/ascii/class-diagram.d.ts +8 -0
  104. package/dist/vendor/mermaid-ascii/ascii/class-diagram.d.ts.map +1 -0
  105. package/dist/vendor/mermaid-ascii/ascii/class-diagram.js +623 -0
  106. package/dist/vendor/mermaid-ascii/ascii/converter.d.ts +13 -0
  107. package/dist/vendor/mermaid-ascii/ascii/converter.d.ts.map +1 -0
  108. package/dist/vendor/mermaid-ascii/ascii/converter.js +233 -0
  109. package/dist/vendor/mermaid-ascii/ascii/draw.d.ts +67 -0
  110. package/dist/vendor/mermaid-ascii/ascii/draw.d.ts.map +1 -0
  111. package/dist/vendor/mermaid-ascii/ascii/draw.js +1313 -0
  112. package/dist/vendor/mermaid-ascii/ascii/edge-bundling.d.ts +49 -0
  113. package/dist/vendor/mermaid-ascii/ascii/edge-bundling.d.ts.map +1 -0
  114. package/dist/vendor/mermaid-ascii/ascii/edge-bundling.js +289 -0
  115. package/dist/vendor/mermaid-ascii/ascii/edge-routing.d.ts +44 -0
  116. package/dist/vendor/mermaid-ascii/ascii/edge-routing.d.ts.map +1 -0
  117. package/dist/vendor/mermaid-ascii/ascii/edge-routing.js +302 -0
  118. package/dist/vendor/mermaid-ascii/ascii/er-diagram.d.ts +8 -0
  119. package/dist/vendor/mermaid-ascii/ascii/er-diagram.d.ts.map +1 -0
  120. package/dist/vendor/mermaid-ascii/ascii/er-diagram.js +380 -0
  121. package/dist/vendor/mermaid-ascii/ascii/grid.d.ts +57 -0
  122. package/dist/vendor/mermaid-ascii/ascii/grid.d.ts.map +1 -0
  123. package/dist/vendor/mermaid-ascii/ascii/grid.js +516 -0
  124. package/dist/vendor/mermaid-ascii/ascii/index.d.ts +66 -0
  125. package/dist/vendor/mermaid-ascii/ascii/index.d.ts.map +1 -0
  126. package/dist/vendor/mermaid-ascii/ascii/index.js +133 -0
  127. package/dist/vendor/mermaid-ascii/ascii/multiline-utils.d.ts +28 -0
  128. package/dist/vendor/mermaid-ascii/ascii/multiline-utils.d.ts.map +1 -0
  129. package/dist/vendor/mermaid-ascii/ascii/multiline-utils.js +60 -0
  130. package/dist/vendor/mermaid-ascii/ascii/pathfinder.d.ts +18 -0
  131. package/dist/vendor/mermaid-ascii/ascii/pathfinder.d.ts.map +1 -0
  132. package/dist/vendor/mermaid-ascii/ascii/pathfinder.js +224 -0
  133. package/dist/vendor/mermaid-ascii/ascii/sequence.d.ts +8 -0
  134. package/dist/vendor/mermaid-ascii/ascii/sequence.d.ts.map +1 -0
  135. package/dist/vendor/mermaid-ascii/ascii/sequence.js +416 -0
  136. package/dist/vendor/mermaid-ascii/ascii/shapes/circle.d.ts +12 -0
  137. package/dist/vendor/mermaid-ascii/ascii/shapes/circle.d.ts.map +1 -0
  138. package/dist/vendor/mermaid-ascii/ascii/shapes/circle.js +22 -0
  139. package/dist/vendor/mermaid-ascii/ascii/shapes/corners.d.ts +35 -0
  140. package/dist/vendor/mermaid-ascii/ascii/shapes/corners.d.ts.map +1 -0
  141. package/dist/vendor/mermaid-ascii/ascii/shapes/corners.js +91 -0
  142. package/dist/vendor/mermaid-ascii/ascii/shapes/diamond.d.ts +12 -0
  143. package/dist/vendor/mermaid-ascii/ascii/shapes/diamond.d.ts.map +1 -0
  144. package/dist/vendor/mermaid-ascii/ascii/shapes/diamond.js +22 -0
  145. package/dist/vendor/mermaid-ascii/ascii/shapes/hexagon.d.ts +12 -0
  146. package/dist/vendor/mermaid-ascii/ascii/shapes/hexagon.d.ts.map +1 -0
  147. package/dist/vendor/mermaid-ascii/ascii/shapes/hexagon.js +22 -0
  148. package/dist/vendor/mermaid-ascii/ascii/shapes/index.d.ts +27 -0
  149. package/dist/vendor/mermaid-ascii/ascii/shapes/index.d.ts.map +1 -0
  150. package/dist/vendor/mermaid-ascii/ascii/shapes/index.js +66 -0
  151. package/dist/vendor/mermaid-ascii/ascii/shapes/rectangle.d.ts +32 -0
  152. package/dist/vendor/mermaid-ascii/ascii/shapes/rectangle.d.ts.map +1 -0
  153. package/dist/vendor/mermaid-ascii/ascii/shapes/rectangle.js +149 -0
  154. package/dist/vendor/mermaid-ascii/ascii/shapes/rounded.d.ts +12 -0
  155. package/dist/vendor/mermaid-ascii/ascii/shapes/rounded.d.ts.map +1 -0
  156. package/dist/vendor/mermaid-ascii/ascii/shapes/rounded.js +22 -0
  157. package/dist/vendor/mermaid-ascii/ascii/shapes/special.d.ts +60 -0
  158. package/dist/vendor/mermaid-ascii/ascii/shapes/special.d.ts.map +1 -0
  159. package/dist/vendor/mermaid-ascii/ascii/shapes/special.js +253 -0
  160. package/dist/vendor/mermaid-ascii/ascii/shapes/stadium.d.ts +18 -0
  161. package/dist/vendor/mermaid-ascii/ascii/shapes/stadium.d.ts.map +1 -0
  162. package/dist/vendor/mermaid-ascii/ascii/shapes/stadium.js +103 -0
  163. package/dist/vendor/mermaid-ascii/ascii/shapes/state.d.ts +31 -0
  164. package/dist/vendor/mermaid-ascii/ascii/shapes/state.d.ts.map +1 -0
  165. package/dist/vendor/mermaid-ascii/ascii/shapes/state.js +167 -0
  166. package/dist/vendor/mermaid-ascii/ascii/shapes/types.d.ts +56 -0
  167. package/dist/vendor/mermaid-ascii/ascii/shapes/types.d.ts.map +1 -0
  168. package/dist/vendor/mermaid-ascii/ascii/shapes/types.js +4 -0
  169. package/dist/vendor/mermaid-ascii/ascii/types.d.ts +207 -0
  170. package/dist/vendor/mermaid-ascii/ascii/types.d.ts.map +1 -0
  171. package/dist/vendor/mermaid-ascii/ascii/types.js +39 -0
  172. package/dist/vendor/mermaid-ascii/ascii/validate.d.ts +52 -0
  173. package/dist/vendor/mermaid-ascii/ascii/validate.d.ts.map +1 -0
  174. package/dist/vendor/mermaid-ascii/ascii/validate.js +97 -0
  175. package/dist/vendor/mermaid-ascii/ascii/xychart.d.ts +3 -0
  176. package/dist/vendor/mermaid-ascii/ascii/xychart.d.ts.map +1 -0
  177. package/dist/vendor/mermaid-ascii/ascii/xychart.js +719 -0
  178. package/dist/vendor/mermaid-ascii/class/parser.d.ts +7 -0
  179. package/dist/vendor/mermaid-ascii/class/parser.d.ts.map +1 -0
  180. package/dist/vendor/mermaid-ascii/class/parser.js +265 -0
  181. package/dist/vendor/mermaid-ascii/class/types.d.ts +103 -0
  182. package/dist/vendor/mermaid-ascii/class/types.d.ts.map +1 -0
  183. package/dist/vendor/mermaid-ascii/class/types.js +7 -0
  184. package/dist/vendor/mermaid-ascii/er/parser.d.ts +7 -0
  185. package/dist/vendor/mermaid-ascii/er/parser.d.ts.map +1 -0
  186. package/dist/vendor/mermaid-ascii/er/parser.js +162 -0
  187. package/dist/vendor/mermaid-ascii/er/types.d.ts +77 -0
  188. package/dist/vendor/mermaid-ascii/er/types.d.ts.map +1 -0
  189. package/dist/vendor/mermaid-ascii/er/types.js +7 -0
  190. package/dist/vendor/mermaid-ascii/index.d.ts +2 -0
  191. package/dist/vendor/mermaid-ascii/index.d.ts.map +1 -0
  192. package/dist/vendor/mermaid-ascii/index.js +13 -0
  193. package/dist/vendor/mermaid-ascii/multiline-utils.d.ts +10 -0
  194. package/dist/vendor/mermaid-ascii/multiline-utils.d.ts.map +1 -0
  195. package/dist/vendor/mermaid-ascii/multiline-utils.js +29 -0
  196. package/dist/vendor/mermaid-ascii/parser.d.ts +8 -0
  197. package/dist/vendor/mermaid-ascii/parser.d.ts.map +1 -0
  198. package/dist/vendor/mermaid-ascii/parser.js +558 -0
  199. package/dist/vendor/mermaid-ascii/sequence/parser.d.ts +7 -0
  200. package/dist/vendor/mermaid-ascii/sequence/parser.d.ts.map +1 -0
  201. package/dist/vendor/mermaid-ascii/sequence/parser.js +182 -0
  202. package/dist/vendor/mermaid-ascii/sequence/types.d.ts +131 -0
  203. package/dist/vendor/mermaid-ascii/sequence/types.d.ts.map +1 -0
  204. package/dist/vendor/mermaid-ascii/sequence/types.js +7 -0
  205. package/dist/vendor/mermaid-ascii/text-metrics.d.ts +24 -0
  206. package/dist/vendor/mermaid-ascii/text-metrics.d.ts.map +1 -0
  207. package/dist/vendor/mermaid-ascii/text-metrics.js +69 -0
  208. package/dist/vendor/mermaid-ascii/types.d.ts +115 -0
  209. package/dist/vendor/mermaid-ascii/types.d.ts.map +1 -0
  210. package/dist/vendor/mermaid-ascii/types.js +4 -0
  211. package/dist/vendor/mermaid-ascii/xychart/colors.d.ts +26 -0
  212. package/dist/vendor/mermaid-ascii/xychart/colors.d.ts.map +1 -0
  213. package/dist/vendor/mermaid-ascii/xychart/colors.js +145 -0
  214. package/dist/vendor/mermaid-ascii/xychart/parser.d.ts +7 -0
  215. package/dist/vendor/mermaid-ascii/xychart/parser.d.ts.map +1 -0
  216. package/dist/vendor/mermaid-ascii/xychart/parser.js +105 -0
  217. package/dist/vendor/mermaid-ascii/xychart/types.d.ts +146 -0
  218. package/dist/vendor/mermaid-ascii/xychart/types.d.ts.map +1 -0
  219. package/dist/vendor/mermaid-ascii/xychart/types.js +8 -0
  220. package/dist/virtual-terminal.d.ts +80 -0
  221. package/dist/virtual-terminal.d.ts.map +1 -0
  222. package/dist/virtual-terminal.js +284 -0
  223. package/dist/word-navigation.d.ts +25 -0
  224. package/dist/word-navigation.d.ts.map +1 -0
  225. package/dist/word-navigation.js +97 -0
  226. package/package.json +38 -0
@@ -0,0 +1,7 @@
1
+ import type { ClassDiagram } from './types.ts';
2
+ /**
3
+ * Parse a Mermaid class diagram.
4
+ * Expects the first line to be "classDiagram".
5
+ */
6
+ export declare function parseClassDiagram(lines: string[]): ClassDiagram;
7
+ //# sourceMappingURL=parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/vendor/mermaid-ascii/class/parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAA+E,MAAM,YAAY,CAAA;AAsB3H;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,CAwI/D"}
@@ -0,0 +1,265 @@
1
+ import { normalizeBrTags } from "../multiline-utils.js";
2
+ // ============================================================================
3
+ // Class diagram parser
4
+ //
5
+ // Parses Mermaid classDiagram syntax into a ClassDiagram structure.
6
+ //
7
+ // Supported syntax:
8
+ // class Animal { +String name; +eat() void }
9
+ // class Shape { <<abstract>> }
10
+ // Animal <|-- Dog (inheritance)
11
+ // Car *-- Engine (composition)
12
+ // Car o-- Wheel (aggregation)
13
+ // A --> B (association)
14
+ // A ..> B (dependency)
15
+ // A ..|> B (realization)
16
+ // A "1" --> "*" B : label (with cardinality + label)
17
+ // Animal : +String name (inline attribute)
18
+ // namespace MyNamespace { class A { } }
19
+ // ============================================================================
20
+ /**
21
+ * Parse a Mermaid class diagram.
22
+ * Expects the first line to be "classDiagram".
23
+ */
24
+ export function parseClassDiagram(lines) {
25
+ const diagram = {
26
+ classes: [],
27
+ relationships: [],
28
+ namespaces: [],
29
+ };
30
+ // Track classes by ID for deduplication
31
+ const classMap = new Map();
32
+ // Track namespace nesting
33
+ let currentNamespace = null;
34
+ // Track class body parsing
35
+ let currentClass = null;
36
+ let braceDepth = 0;
37
+ for (let i = 1; i < lines.length; i++) {
38
+ const line = lines[i];
39
+ // --- Inside a class body block ---
40
+ if (currentClass && braceDepth > 0) {
41
+ if (line === '}') {
42
+ braceDepth--;
43
+ if (braceDepth === 0) {
44
+ currentClass = null;
45
+ }
46
+ continue;
47
+ }
48
+ // Check for annotation like <<interface>>
49
+ const annotMatch = line.match(/^<<(\w+)>>$/);
50
+ if (annotMatch) {
51
+ currentClass.annotation = annotMatch[1];
52
+ continue;
53
+ }
54
+ // Parse member: visibility, name, type, optional parens for method
55
+ const member = parseMember(line);
56
+ if (member) {
57
+ if (member.isMethod) {
58
+ currentClass.methods.push(member.member);
59
+ }
60
+ else {
61
+ currentClass.attributes.push(member.member);
62
+ }
63
+ }
64
+ continue;
65
+ }
66
+ // --- Namespace block start ---
67
+ const nsMatch = line.match(/^namespace\s+(\S+)\s*\{$/);
68
+ if (nsMatch) {
69
+ currentNamespace = { name: nsMatch[1], classIds: [] };
70
+ continue;
71
+ }
72
+ // --- Namespace end ---
73
+ if (line === '}' && currentNamespace) {
74
+ diagram.namespaces.push(currentNamespace);
75
+ currentNamespace = null;
76
+ continue;
77
+ }
78
+ // --- Class block start: `class ClassName {` or `class ClassName` ---
79
+ const classBlockMatch = line.match(/^class\s+(\S+?)(?:\s*~(\w+)~)?\s*\{$/);
80
+ if (classBlockMatch) {
81
+ const id = classBlockMatch[1];
82
+ const generic = classBlockMatch[2];
83
+ const cls = ensureClass(classMap, id);
84
+ if (generic) {
85
+ cls.label = `${id}<${generic}>`;
86
+ }
87
+ currentClass = cls;
88
+ braceDepth = 1;
89
+ if (currentNamespace) {
90
+ currentNamespace.classIds.push(id);
91
+ }
92
+ continue;
93
+ }
94
+ // --- Standalone class declaration (no body): `class ClassName` ---
95
+ const classOnlyMatch = line.match(/^class\s+(\S+?)(?:\s*~(\w+)~)?\s*$/);
96
+ if (classOnlyMatch) {
97
+ const id = classOnlyMatch[1];
98
+ const generic = classOnlyMatch[2];
99
+ const cls = ensureClass(classMap, id);
100
+ if (generic) {
101
+ cls.label = `${id}<${generic}>`;
102
+ }
103
+ if (currentNamespace) {
104
+ currentNamespace.classIds.push(id);
105
+ }
106
+ continue;
107
+ }
108
+ // --- Inline annotation: `class ClassName { <<interface>> }` (single line) ---
109
+ const inlineAnnotMatch = line.match(/^class\s+(\S+?)\s*\{\s*<<(\w+)>>\s*\}$/);
110
+ if (inlineAnnotMatch) {
111
+ const cls = ensureClass(classMap, inlineAnnotMatch[1]);
112
+ cls.annotation = inlineAnnotMatch[2];
113
+ continue;
114
+ }
115
+ // --- Inline attribute: `ClassName : +String name` ---
116
+ const inlineAttrMatch = line.match(/^(\S+?)\s*:\s*(.+)$/);
117
+ if (inlineAttrMatch) {
118
+ // Make sure this isn't a relationship line (those have arrows)
119
+ const rest = inlineAttrMatch[2];
120
+ if (!rest.match(/<\|--|--|\*--|o--|-->|\.\.>|\.\.\|>/)) {
121
+ const cls = ensureClass(classMap, inlineAttrMatch[1]);
122
+ const member = parseMember(rest);
123
+ if (member) {
124
+ if (member.isMethod) {
125
+ cls.methods.push(member.member);
126
+ }
127
+ else {
128
+ cls.attributes.push(member.member);
129
+ }
130
+ }
131
+ continue;
132
+ }
133
+ }
134
+ // --- Relationship ---
135
+ // Pattern: [FROM] ["card"] ARROW ["card"] [TO] [: label]
136
+ // Arrows: <|--, *--, o--, -->, ..|>, ..>
137
+ // Can also be reversed: --o, --*, --|>
138
+ const rel = parseRelationship(line);
139
+ if (rel) {
140
+ // Ensure both classes exist
141
+ ensureClass(classMap, rel.from);
142
+ ensureClass(classMap, rel.to);
143
+ diagram.relationships.push(rel);
144
+ continue;
145
+ }
146
+ }
147
+ diagram.classes = [...classMap.values()];
148
+ return diagram;
149
+ }
150
+ /** Ensure a class exists in the map, creating a default if needed */
151
+ function ensureClass(classMap, id) {
152
+ let cls = classMap.get(id);
153
+ if (!cls) {
154
+ cls = { id, label: id, attributes: [], methods: [] };
155
+ classMap.set(id, cls);
156
+ }
157
+ return cls;
158
+ }
159
+ /** Parse a class member line (attribute or method) */
160
+ function parseMember(line) {
161
+ const trimmed = line.trim().replace(/;$/, '');
162
+ if (!trimmed)
163
+ return null;
164
+ // Extract visibility prefix
165
+ let visibility = '';
166
+ let rest = trimmed;
167
+ if (/^[+\-#~]/.test(rest)) {
168
+ visibility = rest[0];
169
+ rest = rest.slice(1).trim();
170
+ }
171
+ // Check if it's a method (has parentheses)
172
+ const methodMatch = rest.match(/^(.+?)\(([^)]*)\)(?:\s*(.+))?$/);
173
+ if (methodMatch) {
174
+ const name = methodMatch[1].trim();
175
+ const params = methodMatch[2]?.trim() || undefined; // Store the parameter string
176
+ const type = methodMatch[3]?.trim();
177
+ // Check for static ($) or abstract (*) markers
178
+ const isStatic = name.endsWith('$') || rest.includes('$');
179
+ const isAbstract = name.endsWith('*') || rest.includes('*');
180
+ return {
181
+ member: {
182
+ visibility,
183
+ name: name.replace(/[$*]$/, ''),
184
+ type: type || undefined,
185
+ isStatic,
186
+ isAbstract,
187
+ isMethod: true,
188
+ params,
189
+ },
190
+ isMethod: true,
191
+ };
192
+ }
193
+ // It's an attribute: [Type] name or name Type
194
+ // Common patterns: "String name", "+int age", "name"
195
+ const parts = rest.split(/\s+/);
196
+ let name;
197
+ let type;
198
+ if (parts.length >= 2) {
199
+ // "Type name" pattern
200
+ type = parts[0];
201
+ name = parts.slice(1).join(' ');
202
+ }
203
+ else {
204
+ name = parts[0] ?? rest;
205
+ }
206
+ const isStatic = name.endsWith('$');
207
+ const isAbstract = name.endsWith('*');
208
+ return {
209
+ member: {
210
+ visibility,
211
+ name: name.replace(/[$*]$/, ''),
212
+ type: type || undefined,
213
+ isStatic,
214
+ isAbstract,
215
+ isMethod: false,
216
+ },
217
+ isMethod: false,
218
+ };
219
+ }
220
+ /** Parse a relationship line into a ClassRelationship */
221
+ function parseRelationship(line) {
222
+ // Relationship regex — handles all arrow types with optional cardinality and labels
223
+ // Pattern: FROM ["card"] ARROW ["card"] TO [: label]
224
+ const match = line.match(/^(\S+?)\s+(?:"([^"]*?)"\s+)?(<\|--|<\|\.\.|\*--|o--|-->|--\*|--o|--\|>|\.\.>|\.\.\|>|<--|<\.\.?|--)\s+(?:"([^"]*?)"\s+)?(\S+?)(?:\s*:\s*(.+))?$/);
225
+ if (!match)
226
+ return null;
227
+ const from = match[1];
228
+ const rawFromCardinality = match[2];
229
+ const fromCardinality = rawFromCardinality ? normalizeBrTags(rawFromCardinality) : undefined;
230
+ const arrow = match[3].trim();
231
+ const rawToCardinality = match[4];
232
+ const toCardinality = rawToCardinality ? normalizeBrTags(rawToCardinality) : undefined;
233
+ const to = match[5];
234
+ const rawLabel = match[6]?.trim();
235
+ const label = rawLabel ? normalizeBrTags(rawLabel) : undefined;
236
+ const parsed = parseArrow(arrow);
237
+ if (!parsed)
238
+ return null;
239
+ return { from, to, type: parsed.type, markerAt: parsed.markerAt, label, fromCardinality, toCardinality };
240
+ }
241
+ /**
242
+ * Map arrow syntax to relationship type and marker placement side.
243
+ * Prefix markers (`<|--`, `*--`, `o--`) place the UML shape at the 'from' end.
244
+ * Suffix markers (`..|>`, `-->`, `..>`, `--*`, `--o`) place it at the 'to' end.
245
+ */
246
+ function parseArrow(arrow) {
247
+ // Trim whitespace that might be captured by the regex
248
+ const a = arrow.trim();
249
+ switch (a) {
250
+ case '<|--': return { type: 'inheritance', markerAt: 'from' };
251
+ case '--|>': return { type: 'inheritance', markerAt: 'to' };
252
+ case '<|..': return { type: 'realization', markerAt: 'from' };
253
+ case '..|>': return { type: 'realization', markerAt: 'to' };
254
+ case '*--': return { type: 'composition', markerAt: 'from' };
255
+ case '--*': return { type: 'composition', markerAt: 'to' };
256
+ case 'o--': return { type: 'aggregation', markerAt: 'from' };
257
+ case '--o': return { type: 'aggregation', markerAt: 'to' };
258
+ case '-->': return { type: 'association', markerAt: 'to' };
259
+ case '<--': return { type: 'association', markerAt: 'from' };
260
+ case '..>': return { type: 'dependency', markerAt: 'to' };
261
+ case '<..': return { type: 'dependency', markerAt: 'from' };
262
+ case '--': return { type: 'association', markerAt: 'to' };
263
+ default: return null;
264
+ }
265
+ }
@@ -0,0 +1,103 @@
1
+ /** Parsed class diagram — logical structure from mermaid text */
2
+ export interface ClassDiagram {
3
+ /** All class definitions */
4
+ classes: ClassNode[];
5
+ /** Relationships between classes */
6
+ relationships: ClassRelationship[];
7
+ /** Optional namespace groupings */
8
+ namespaces: ClassNamespace[];
9
+ }
10
+ export interface ClassNode {
11
+ id: string;
12
+ label: string;
13
+ /** Annotation like <<interface>>, <<abstract>>, <<service>>, <<enumeration>> */
14
+ annotation?: string;
15
+ /** Class attributes (fields/properties) */
16
+ attributes: ClassMember[];
17
+ /** Class methods (functions) */
18
+ methods: ClassMember[];
19
+ }
20
+ export interface ClassMember {
21
+ /** Visibility: + public, - private, # protected, ~ package */
22
+ visibility: '+' | '-' | '#' | '~' | '';
23
+ /** Member name */
24
+ name: string;
25
+ /** Type annotation (e.g., "String", "int", "void") */
26
+ type?: string;
27
+ /** Whether the member is static (underlined in UML) */
28
+ isStatic?: boolean;
29
+ /** Whether the member is abstract (italic in UML) */
30
+ isAbstract?: boolean;
31
+ /** Whether the member is a method (renders with parentheses) */
32
+ isMethod?: boolean;
33
+ /** Method parameters (e.g., "data", "key, val") — only for methods */
34
+ params?: string;
35
+ }
36
+ /** Relationship types following UML conventions */
37
+ export type RelationshipType = 'inheritance' | 'composition' | 'aggregation' | 'association' | 'dependency' | 'realization';
38
+ export interface ClassRelationship {
39
+ from: string;
40
+ to: string;
41
+ type: RelationshipType;
42
+ /**
43
+ * Which end of the relationship line has the UML marker (triangle, diamond, arrow).
44
+ * Determined by the arrow syntax direction:
45
+ * - Prefix markers like `<|--`, `*--`, `o--` → 'from' (marker on left/from side)
46
+ * - Suffix markers like `..|>`, `-->`, `..>`, `--*`, `--o` → 'to' (marker on right/to side)
47
+ */
48
+ markerAt: 'from' | 'to';
49
+ /** Label on the relationship line */
50
+ label?: string;
51
+ /** Cardinality at the "from" end (e.g., "1", "*", "0..1") */
52
+ fromCardinality?: string;
53
+ /** Cardinality at the "to" end */
54
+ toCardinality?: string;
55
+ }
56
+ export interface ClassNamespace {
57
+ name: string;
58
+ classIds: string[];
59
+ }
60
+ export interface PositionedClassDiagram {
61
+ width: number;
62
+ height: number;
63
+ classes: PositionedClassNode[];
64
+ relationships: PositionedClassRelationship[];
65
+ }
66
+ export interface PositionedClassNode {
67
+ id: string;
68
+ label: string;
69
+ annotation?: string;
70
+ attributes: ClassMember[];
71
+ methods: ClassMember[];
72
+ x: number;
73
+ y: number;
74
+ width: number;
75
+ height: number;
76
+ /** Height of the header section (name + annotation) */
77
+ headerHeight: number;
78
+ /** Height of the attributes section */
79
+ attrHeight: number;
80
+ /** Height of the methods section */
81
+ methodHeight: number;
82
+ }
83
+ export interface PositionedClassRelationship {
84
+ from: string;
85
+ to: string;
86
+ type: RelationshipType;
87
+ /** Which end of the line has the UML marker — propagated from ClassRelationship */
88
+ markerAt: 'from' | 'to';
89
+ label?: string;
90
+ fromCardinality?: string;
91
+ toCardinality?: string;
92
+ /** Path points from source to target */
93
+ points: Array<{
94
+ x: number;
95
+ y: number;
96
+ }>;
97
+ /** Dagre-computed label center position (avoids overlaps between nearby edges) */
98
+ labelPosition?: {
99
+ x: number;
100
+ y: number;
101
+ };
102
+ }
103
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/vendor/mermaid-ascii/class/types.ts"],"names":[],"mappings":"AAOA,iEAAiE;AACjE,MAAM,WAAW,YAAY;IAC3B,4BAA4B;IAC5B,OAAO,EAAE,SAAS,EAAE,CAAA;IACpB,oCAAoC;IACpC,aAAa,EAAE,iBAAiB,EAAE,CAAA;IAClC,mCAAmC;IACnC,UAAU,EAAE,cAAc,EAAE,CAAA;CAC7B;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,gFAAgF;IAChF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,2CAA2C;IAC3C,UAAU,EAAE,WAAW,EAAE,CAAA;IACzB,gCAAgC;IAChC,OAAO,EAAE,WAAW,EAAE,CAAA;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,8DAA8D;IAC9D,UAAU,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,EAAE,CAAA;IACtC,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,uDAAuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qDAAqD;IACrD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,mDAAmD;AACnD,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,aAAa,GACb,aAAa,GACb,aAAa,GACb,YAAY,GACZ,aAAa,CAAA;AAEjB,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,gBAAgB,CAAA;IACtB;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6DAA6D;IAC7D,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,kCAAkC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAMD,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,mBAAmB,EAAE,CAAA;IAC9B,aAAa,EAAE,2BAA2B,EAAE,CAAA;CAC7C;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,WAAW,EAAE,CAAA;IACzB,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAA;IACpB,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAA;IAClB,oCAAoC;IACpC,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,gBAAgB,CAAA;IACtB,mFAAmF;IACnF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,wCAAwC;IACxC,MAAM,EAAE,KAAK,CAAC;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACvC,kFAAkF;IAClF,aAAa,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CACzC"}
@@ -0,0 +1,7 @@
1
+ // ============================================================================
2
+ // Class diagram types
3
+ //
4
+ // Models the parsed and positioned representations of a Mermaid class diagram.
5
+ // Class diagrams show UML class relationships, inheritance, composition, etc.
6
+ // ============================================================================
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { ErDiagram } from './types.ts';
2
+ /**
3
+ * Parse a Mermaid ER diagram.
4
+ * Expects the first line to be "erDiagram".
5
+ */
6
+ export declare function parseErDiagram(lines: string[]): ErDiagram;
7
+ //# sourceMappingURL=parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/vendor/mermaid-ascii/er/parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAsD,MAAM,YAAY,CAAA;AA2B/F;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,CAmDzD"}
@@ -0,0 +1,162 @@
1
+ import { normalizeBrTags } from "../multiline-utils.js";
2
+ // ============================================================================
3
+ // ER diagram parser
4
+ //
5
+ // Parses Mermaid erDiagram syntax into an ErDiagram structure.
6
+ //
7
+ // Supported syntax:
8
+ // CUSTOMER ||--o{ ORDER : places
9
+ // CUSTOMER {
10
+ // string name PK
11
+ // int age
12
+ // string email UK "user email"
13
+ // }
14
+ //
15
+ // Cardinality notation:
16
+ // || exactly one
17
+ // o| zero or one (also |o)
18
+ // }| one or more (also |{)
19
+ // o{ zero or more (also {o)
20
+ //
21
+ // Line style:
22
+ // -- identifying (solid line)
23
+ // .. non-identifying (dashed line)
24
+ // ============================================================================
25
+ /**
26
+ * Parse a Mermaid ER diagram.
27
+ * Expects the first line to be "erDiagram".
28
+ */
29
+ export function parseErDiagram(lines) {
30
+ const diagram = {
31
+ entities: [],
32
+ relationships: [],
33
+ };
34
+ // Track entities by ID for deduplication
35
+ const entityMap = new Map();
36
+ // Track entity body parsing
37
+ let currentEntity = null;
38
+ for (let i = 1; i < lines.length; i++) {
39
+ const line = lines[i];
40
+ // --- Inside entity body ---
41
+ if (currentEntity) {
42
+ if (line === '}') {
43
+ currentEntity = null;
44
+ continue;
45
+ }
46
+ // Attribute line: type name [PK|FK|UK] ["comment"]
47
+ const attr = parseAttribute(line);
48
+ if (attr) {
49
+ currentEntity.attributes.push(attr);
50
+ }
51
+ continue;
52
+ }
53
+ // --- Entity block start: `ENTITY_NAME {` ---
54
+ const entityBlockMatch = line.match(/^(\S+)\s*\{$/);
55
+ if (entityBlockMatch) {
56
+ const id = entityBlockMatch[1];
57
+ const entity = ensureEntity(entityMap, id);
58
+ currentEntity = entity;
59
+ continue;
60
+ }
61
+ // --- Relationship: `ENTITY1 cardinality1--cardinality2 ENTITY2 : label` ---
62
+ const rel = parseRelationshipLine(line);
63
+ if (rel) {
64
+ // Ensure both entities exist
65
+ ensureEntity(entityMap, rel.entity1);
66
+ ensureEntity(entityMap, rel.entity2);
67
+ diagram.relationships.push(rel);
68
+ continue;
69
+ }
70
+ }
71
+ diagram.entities = [...entityMap.values()];
72
+ return diagram;
73
+ }
74
+ /** Ensure an entity exists in the map */
75
+ function ensureEntity(entityMap, id) {
76
+ let entity = entityMap.get(id);
77
+ if (!entity) {
78
+ entity = { id, label: id, attributes: [] };
79
+ entityMap.set(id, entity);
80
+ }
81
+ return entity;
82
+ }
83
+ /** Parse an attribute line inside an entity block */
84
+ function parseAttribute(line) {
85
+ // Format: type name [PK|FK|UK [...]] ["comment"]
86
+ const match = line.match(/^(\S+)\s+(\S+)(?:\s+(.+))?$/);
87
+ if (!match)
88
+ return null;
89
+ const type = match[1];
90
+ const name = match[2];
91
+ const rest = match[3]?.trim() ?? '';
92
+ // Extract key constraints (PK, FK, UK) and optional comment
93
+ const keys = [];
94
+ let comment;
95
+ // Extract quoted comment first (supports <br> tags)
96
+ const commentMatch = rest.match(/"([^"]*)"/);
97
+ if (commentMatch) {
98
+ comment = normalizeBrTags(commentMatch[1]);
99
+ }
100
+ // Extract key constraints
101
+ const restWithoutComment = rest.replace(/"[^"]*"/, '').trim();
102
+ for (const part of restWithoutComment.split(/\s+/)) {
103
+ const upper = part.toUpperCase();
104
+ if (upper === 'PK' || upper === 'FK' || upper === 'UK') {
105
+ keys.push(upper);
106
+ }
107
+ }
108
+ return { type, name, keys, comment };
109
+ }
110
+ /**
111
+ * Parse a relationship line.
112
+ *
113
+ * Cardinality symbols on each side of the line style:
114
+ * Left side (entity1): || |o o| }| |{ o{ {o
115
+ * Line: -- (identifying) or .. (non-identifying)
116
+ * Right side (entity2): || o| |o |{ }| {o o{
117
+ *
118
+ * Full pattern example: CUSTOMER ||--o{ ORDER : places
119
+ */
120
+ function parseRelationshipLine(line) {
121
+ // Match: ENTITY1 <cardinality_and_line> ENTITY2 : label
122
+ const match = line.match(/^(\S+)\s+([|o}{]+(?:--|\.\.)[|o}{]+)\s+(\S+)\s*:\s*(.+)$/);
123
+ if (!match)
124
+ return null;
125
+ const entity1 = match[1];
126
+ const cardinalityStr = match[2];
127
+ const entity2 = match[3];
128
+ // Strip surrounding quotes if present, then normalize br tags
129
+ const rawLabel = match[4].trim().replace(/^["']|["']$/g, '');
130
+ const label = normalizeBrTags(rawLabel);
131
+ // Split the cardinality string into left side, line style, right side
132
+ const lineMatch = cardinalityStr.match(/^([|o}{]+)(--|\.\.?)([|o}{]+)$/);
133
+ if (!lineMatch)
134
+ return null;
135
+ const leftStr = lineMatch[1];
136
+ const lineStyle = lineMatch[2];
137
+ const rightStr = lineMatch[3];
138
+ const cardinality1 = parseCardinality(leftStr);
139
+ const cardinality2 = parseCardinality(rightStr);
140
+ const identifying = lineStyle === '--';
141
+ if (!cardinality1 || !cardinality2)
142
+ return null;
143
+ return { entity1, entity2, cardinality1, cardinality2, label, identifying };
144
+ }
145
+ /** Parse a cardinality notation string into a Cardinality type */
146
+ function parseCardinality(str) {
147
+ // Normalize: sort the characters to handle both orders (e.g., |o and o|)
148
+ const sorted = str.split('').sort().join('');
149
+ // Exact one: || → sorted "||"
150
+ if (sorted === '||')
151
+ return 'one';
152
+ // Zero or one: o| or |o → sorted "o|" (o=111 < |=124 in char codes)
153
+ if (sorted === 'o|')
154
+ return 'zero-one';
155
+ // One or more: }| or |{ → sorted "|}" or "{|"
156
+ if (sorted === '|}' || sorted === '{|')
157
+ return 'many';
158
+ // Zero or more: o{ or {o → sorted "{o" or "o{"
159
+ if (sorted === '{o' || sorted === 'o{')
160
+ return 'zero-many';
161
+ return null;
162
+ }
@@ -0,0 +1,77 @@
1
+ /** Parsed ER diagram — logical structure from mermaid text */
2
+ export interface ErDiagram {
3
+ /** All entity definitions */
4
+ entities: ErEntity[];
5
+ /** Relationships between entities */
6
+ relationships: ErRelationship[];
7
+ }
8
+ export interface ErEntity {
9
+ id: string;
10
+ /** Display name (same as id unless aliased) */
11
+ label: string;
12
+ /** Entity attributes (columns) */
13
+ attributes: ErAttribute[];
14
+ }
15
+ export interface ErAttribute {
16
+ /** Data type (string, int, varchar, etc.) */
17
+ type: string;
18
+ /** Attribute name */
19
+ name: string;
20
+ /** Key constraints: PK, FK, UK */
21
+ keys: Array<'PK' | 'FK' | 'UK'>;
22
+ /** Optional comment */
23
+ comment?: string;
24
+ }
25
+ /**
26
+ * Cardinality notation (crow's foot):
27
+ * 'one' || exactly one
28
+ * 'zero-one' |o zero or one
29
+ * 'many' }| one or more
30
+ * 'zero-many' o{ zero or more
31
+ */
32
+ export type Cardinality = 'one' | 'zero-one' | 'many' | 'zero-many';
33
+ export interface ErRelationship {
34
+ entity1: string;
35
+ entity2: string;
36
+ /** Cardinality at entity1's end */
37
+ cardinality1: Cardinality;
38
+ /** Cardinality at entity2's end */
39
+ cardinality2: Cardinality;
40
+ /** Relationship verb/label (e.g., "places", "contains") */
41
+ label: string;
42
+ /** Whether the relationship is identifying (solid line) or non-identifying (dashed) */
43
+ identifying: boolean;
44
+ }
45
+ export interface PositionedErDiagram {
46
+ width: number;
47
+ height: number;
48
+ entities: PositionedErEntity[];
49
+ relationships: PositionedErRelationship[];
50
+ }
51
+ export interface PositionedErEntity {
52
+ id: string;
53
+ label: string;
54
+ attributes: ErAttribute[];
55
+ x: number;
56
+ y: number;
57
+ width: number;
58
+ height: number;
59
+ /** Height of the header row */
60
+ headerHeight: number;
61
+ /** Height per attribute row */
62
+ rowHeight: number;
63
+ }
64
+ export interface PositionedErRelationship {
65
+ entity1: string;
66
+ entity2: string;
67
+ cardinality1: Cardinality;
68
+ cardinality2: Cardinality;
69
+ label: string;
70
+ identifying: boolean;
71
+ /** Path points from entity1 to entity2 */
72
+ points: Array<{
73
+ x: number;
74
+ y: number;
75
+ }>;
76
+ }
77
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/vendor/mermaid-ascii/er/types.ts"],"names":[],"mappings":"AAOA,8DAA8D;AAC9D,MAAM,WAAW,SAAS;IACxB,6BAA6B;IAC7B,QAAQ,EAAE,QAAQ,EAAE,CAAA;IACpB,qCAAqC;IACrC,aAAa,EAAE,cAAc,EAAE,CAAA;CAChC;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAA;IACb,kCAAkC;IAClC,UAAU,EAAE,WAAW,EAAE,CAAA;CAC1B;AAED,MAAM,WAAW,WAAW;IAC1B,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,kCAAkC;IAClC,IAAI,EAAE,KAAK,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAA;IAC/B,uBAAuB;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,GAAG,WAAW,CAAA;AAEnE,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,mCAAmC;IACnC,YAAY,EAAE,WAAW,CAAA;IACzB,mCAAmC;IACnC,YAAY,EAAE,WAAW,CAAA;IACzB,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAA;IACb,uFAAuF;IACvF,WAAW,EAAE,OAAO,CAAA;CACrB;AAMD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,kBAAkB,EAAE,CAAA;IAC9B,aAAa,EAAE,wBAAwB,EAAE,CAAA;CAC1C;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,WAAW,EAAE,CAAA;IACzB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,+BAA+B;IAC/B,YAAY,EAAE,MAAM,CAAA;IACpB,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,WAAW,CAAA;IACzB,YAAY,EAAE,WAAW,CAAA;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,OAAO,CAAA;IACpB,0CAA0C;IAC1C,MAAM,EAAE,KAAK,CAAC;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACxC"}
@@ -0,0 +1,7 @@
1
+ // ============================================================================
2
+ // ER diagram types
3
+ //
4
+ // Models the parsed and positioned representations of a Mermaid ER diagram.
5
+ // ER diagrams show database entities, their attributes, and relationships.
6
+ // ============================================================================
7
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './ascii/index.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vendor/mermaid-ascii/index.ts"],"names":[],"mappings":"AAaA,cAAc,kBAAkB,CAAA"}