@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,27 @@
1
+ import type { AsciiNodeShape, Canvas, DrawingCoord, Direction } from '../types.ts';
2
+ import type { ShapeRenderer, ShapeDimensions, ShapeRenderOptions, ShapeRegistry } from './types.ts';
3
+ export type { ShapeRenderer, ShapeDimensions, ShapeRenderOptions, ShapeRegistry };
4
+ /**
5
+ * Global shape registry — maps shape types to their renderers.
6
+ * Rectangle is the default fallback for unregistered shapes.
7
+ */
8
+ export declare const shapeRegistry: ShapeRegistry;
9
+ /**
10
+ * Get the renderer for a shape type, falling back to rectangle.
11
+ */
12
+ export declare function getShapeRenderer(shape: AsciiNodeShape): ShapeRenderer;
13
+ /**
14
+ * Render a node shape to a canvas.
15
+ * This is the main entry point for shape rendering.
16
+ */
17
+ export declare function renderShape(shape: AsciiNodeShape, label: string, options: ShapeRenderOptions): Canvas;
18
+ /**
19
+ * Get dimensions for a shape given a label.
20
+ * Used during layout to determine node size.
21
+ */
22
+ export declare function getShapeDimensions(shape: AsciiNodeShape, label: string, options: ShapeRenderOptions): ShapeDimensions;
23
+ /**
24
+ * Get edge attachment point for a shape.
25
+ */
26
+ export declare function getShapeAttachmentPoint(shape: AsciiNodeShape, dir: Direction, dimensions: ShapeDimensions, baseCoord: DrawingCoord): DrawingCoord;
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/vendor/mermaid-ascii/ascii/shapes/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAClF,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAoBnG,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,aAAa,EAAE,CAAA;AAEjF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,aAsB1B,CAAA;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,GAAG,aAAa,CAErE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,cAAc,EACrB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,kBAAkB,GAC1B,MAAM,CAIR;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,cAAc,EACrB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,kBAAkB,GAC1B,eAAe,CAGjB;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,cAAc,EACrB,GAAG,EAAE,SAAS,EACd,UAAU,EAAE,eAAe,EAC3B,SAAS,EAAE,YAAY,GACtB,YAAY,CAGd"}
@@ -0,0 +1,66 @@
1
+ // ============================================================================
2
+ // Shape registry — pluggable ASCII shape renderers
3
+ // ============================================================================
4
+ // Import all shape renderers
5
+ import { rectangleRenderer } from "./rectangle.js";
6
+ import { diamondRenderer } from "./diamond.js";
7
+ import { circleRenderer } from "./circle.js";
8
+ import { stateStartRenderer, stateEndRenderer } from "./state.js";
9
+ import { roundedRenderer } from "./rounded.js";
10
+ import { stadiumRenderer } from "./stadium.js";
11
+ import { hexagonRenderer } from "./hexagon.js";
12
+ import { subroutineRenderer, doublecircleRenderer, cylinderRenderer, asymmetricRenderer, trapezoidRenderer, trapezoidAltRenderer, } from "./special.js";
13
+ /**
14
+ * Global shape registry — maps shape types to their renderers.
15
+ * Rectangle is the default fallback for unregistered shapes.
16
+ */
17
+ export const shapeRegistry = new Map([
18
+ // Core shapes
19
+ ['rectangle', rectangleRenderer],
20
+ ['rounded', roundedRenderer],
21
+ ['diamond', diamondRenderer],
22
+ ['stadium', stadiumRenderer],
23
+ ['circle', circleRenderer],
24
+ // Batch 1 additions
25
+ ['subroutine', subroutineRenderer],
26
+ ['doublecircle', doublecircleRenderer],
27
+ ['hexagon', hexagonRenderer],
28
+ // Batch 2 additions
29
+ ['cylinder', cylinderRenderer],
30
+ ['asymmetric', asymmetricRenderer],
31
+ ['trapezoid', trapezoidRenderer],
32
+ ['trapezoid-alt', trapezoidAltRenderer],
33
+ // State diagram pseudo-states
34
+ ['state-start', stateStartRenderer],
35
+ ['state-end', stateEndRenderer],
36
+ ]);
37
+ /**
38
+ * Get the renderer for a shape type, falling back to rectangle.
39
+ */
40
+ export function getShapeRenderer(shape) {
41
+ return shapeRegistry.get(shape) ?? rectangleRenderer;
42
+ }
43
+ /**
44
+ * Render a node shape to a canvas.
45
+ * This is the main entry point for shape rendering.
46
+ */
47
+ export function renderShape(shape, label, options) {
48
+ const renderer = getShapeRenderer(shape);
49
+ const dimensions = renderer.getDimensions(label, options);
50
+ return renderer.render(label, dimensions, options);
51
+ }
52
+ /**
53
+ * Get dimensions for a shape given a label.
54
+ * Used during layout to determine node size.
55
+ */
56
+ export function getShapeDimensions(shape, label, options) {
57
+ const renderer = getShapeRenderer(shape);
58
+ return renderer.getDimensions(label, options);
59
+ }
60
+ /**
61
+ * Get edge attachment point for a shape.
62
+ */
63
+ export function getShapeAttachmentPoint(shape, dir, dimensions, baseCoord) {
64
+ const renderer = getShapeRenderer(shape);
65
+ return renderer.getAttachmentPoint(dir, dimensions, baseCoord);
66
+ }
@@ -0,0 +1,32 @@
1
+ import type { Canvas, DrawingCoord, Direction } from '../types.ts';
2
+ import type { ShapeRenderer, ShapeDimensions, ShapeRenderOptions } from './types.ts';
3
+ import { type CornerChars } from './corners.ts';
4
+ /**
5
+ * Calculate standard box dimensions for any rectangular shape.
6
+ * Used by rectangle, circle, diamond, hexagon, etc.
7
+ */
8
+ export declare function getBoxDimensions(label: string, options: ShapeRenderOptions): ShapeDimensions;
9
+ /**
10
+ * Render a box with custom corner characters.
11
+ * This is the core rendering function used by all rectangular shapes.
12
+ *
13
+ * @param label - Text to display in the box
14
+ * @param dimensions - Pre-calculated dimensions
15
+ * @param corners - Corner characters (tl, tr, bl, br)
16
+ * @param useAscii - Whether to use ASCII or Unicode for lines
17
+ */
18
+ export declare function renderBox(label: string, dimensions: ShapeDimensions, corners: CornerChars, useAscii: boolean): Canvas;
19
+ /**
20
+ * Calculate edge attachment point for rectangular shapes.
21
+ * All box-based shapes use the same attachment logic.
22
+ */
23
+ export declare function getBoxAttachmentPoint(dir: Direction, dimensions: ShapeDimensions, baseCoord: DrawingCoord): DrawingCoord;
24
+ /**
25
+ * Rectangle shape renderer — the default box shape.
26
+ * Renders as:
27
+ * ┌─────────┐
28
+ * │ Label │
29
+ * └─────────┘
30
+ */
31
+ export declare const rectangleRenderer: ShapeRenderer;
32
+ //# sourceMappingURL=rectangle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rectangle.d.ts","sourceRoot":"","sources":["../../../../../src/vendor/mermaid-ascii/ascii/shapes/rectangle.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAIlE,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEpF,OAAO,EAAE,KAAK,WAAW,EAAc,MAAM,cAAc,CAAA;AAO3D;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,eAAe,CA4B5F;AAMD;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,eAAe,EAC3B,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,OAAO,GAChB,MAAM,CAkDR;AAMD;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,SAAS,EACd,UAAU,EAAE,eAAe,EAC3B,SAAS,EAAE,YAAY,GACtB,YAAY,CAed;AAMD;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,aAS/B,CAAA"}
@@ -0,0 +1,149 @@
1
+ // ============================================================================
2
+ // Rectangle shape renderer — standard box with corners
3
+ // ============================================================================
4
+ //
5
+ // This module provides the base box rendering used by all rectangular shapes.
6
+ // The renderBox() function accepts custom corner characters, allowing different
7
+ // shapes to reuse the same rendering logic with different visual markers.
8
+ import { Up, Down, Left, Right, UpperLeft, UpperRight, LowerLeft, LowerRight } from "../types.js";
9
+ import { mkCanvas } from "../canvas.js";
10
+ import { splitLines } from "../multiline-utils.js";
11
+ import { dirEquals } from "../edge-routing.js";
12
+ import { getCorners } from "./corners.js";
13
+ import { displayWidth, toCells } from "../../text-metrics.js";
14
+ // ============================================================================
15
+ // Shared dimension calculation
16
+ // ============================================================================
17
+ /**
18
+ * Calculate standard box dimensions for any rectangular shape.
19
+ * Used by rectangle, circle, diamond, hexagon, etc.
20
+ */
21
+ export function getBoxDimensions(label, options) {
22
+ const lines = splitLines(label);
23
+ const maxLineWidth = Math.max(...lines.map(l => displayWidth(l)), 0);
24
+ const lineCount = lines.length;
25
+ // Width: 2*padding + maxLineWidth + 2 border chars
26
+ const innerWidth = 2 * options.padding + maxLineWidth;
27
+ const width = innerWidth + 2;
28
+ // Height: lineCount + 2*padding + 2 border chars
29
+ // Ensure innerHeight is odd for symmetric vertical centering
30
+ const rawInnerHeight = lineCount + 2 * options.padding;
31
+ const innerHeight = rawInnerHeight % 2 === 0 ? rawInnerHeight + 1 : rawInnerHeight;
32
+ const height = innerHeight + 2;
33
+ return {
34
+ width,
35
+ height,
36
+ labelArea: {
37
+ x: 1 + options.padding,
38
+ y: 1 + options.padding,
39
+ width: maxLineWidth,
40
+ height: lineCount,
41
+ },
42
+ // Grid layout: [border=1, content, border=1]
43
+ gridColumns: [1, innerWidth, 1],
44
+ gridRows: [1, innerHeight, 1],
45
+ };
46
+ }
47
+ // ============================================================================
48
+ // Shared box rendering
49
+ // ============================================================================
50
+ /**
51
+ * Render a box with custom corner characters.
52
+ * This is the core rendering function used by all rectangular shapes.
53
+ *
54
+ * @param label - Text to display in the box
55
+ * @param dimensions - Pre-calculated dimensions
56
+ * @param corners - Corner characters (tl, tr, bl, br)
57
+ * @param useAscii - Whether to use ASCII or Unicode for lines
58
+ */
59
+ export function renderBox(label, dimensions, corners, useAscii) {
60
+ const { width, height } = dimensions;
61
+ const canvas = mkCanvas(width - 1, height - 1);
62
+ const from = { x: 0, y: 0 };
63
+ const to = { x: width - 1, y: height - 1 };
64
+ // Line characters
65
+ const hLine = useAscii ? '-' : '─';
66
+ const vLine = useAscii ? '|' : '│';
67
+ // Draw horizontal lines (top and bottom)
68
+ for (let x = from.x + 1; x < to.x; x++) {
69
+ canvas[x][from.y] = hLine;
70
+ canvas[x][to.y] = hLine;
71
+ }
72
+ // Draw vertical lines (left and right)
73
+ for (let y = from.y + 1; y < to.y; y++) {
74
+ canvas[from.x][y] = vLine;
75
+ canvas[to.x][y] = vLine;
76
+ }
77
+ // Draw corners
78
+ canvas[from.x][from.y] = corners.tl;
79
+ canvas[to.x][from.y] = corners.tr;
80
+ canvas[from.x][to.y] = corners.bl;
81
+ canvas[to.x][to.y] = corners.br;
82
+ // Center the multi-line label
83
+ const lines = splitLines(label);
84
+ const w = width - 1; // Match original grid-based width calculation
85
+ const h = height - 1;
86
+ const centerY = Math.floor(h / 2);
87
+ const startY = centerY - Math.floor((lines.length - 1) / 2);
88
+ for (let i = 0; i < lines.length; i++) {
89
+ const line = lines[i];
90
+ const cells = toCells(line);
91
+ const textX = Math.floor(w / 2) - Math.ceil(cells.length / 2) + 1;
92
+ for (let j = 0; j < cells.length; j++) {
93
+ const x = textX + j;
94
+ const y = startY + i;
95
+ if (x >= 0 && x < canvas.length && y >= 0 && y < canvas[0].length) {
96
+ canvas[x][y] = cells[j];
97
+ }
98
+ }
99
+ }
100
+ return canvas;
101
+ }
102
+ // ============================================================================
103
+ // Shared attachment point calculation
104
+ // ============================================================================
105
+ /**
106
+ * Calculate edge attachment point for rectangular shapes.
107
+ * All box-based shapes use the same attachment logic.
108
+ */
109
+ export function getBoxAttachmentPoint(dir, dimensions, baseCoord) {
110
+ const { width, height } = dimensions;
111
+ const centerX = baseCoord.x + Math.floor(width / 2);
112
+ const centerY = baseCoord.y + Math.floor(height / 2);
113
+ if (dirEquals(dir, Up))
114
+ return { x: centerX, y: baseCoord.y };
115
+ if (dirEquals(dir, Down))
116
+ return { x: centerX, y: baseCoord.y + height - 1 };
117
+ if (dirEquals(dir, Left))
118
+ return { x: baseCoord.x, y: centerY };
119
+ if (dirEquals(dir, Right))
120
+ return { x: baseCoord.x + width - 1, y: centerY };
121
+ if (dirEquals(dir, UpperLeft))
122
+ return { x: baseCoord.x, y: baseCoord.y };
123
+ if (dirEquals(dir, UpperRight))
124
+ return { x: baseCoord.x + width - 1, y: baseCoord.y };
125
+ if (dirEquals(dir, LowerLeft))
126
+ return { x: baseCoord.x, y: baseCoord.y + height - 1 };
127
+ if (dirEquals(dir, LowerRight))
128
+ return { x: baseCoord.x + width - 1, y: baseCoord.y + height - 1 };
129
+ // Middle
130
+ return { x: centerX, y: centerY };
131
+ }
132
+ // ============================================================================
133
+ // Rectangle renderer
134
+ // ============================================================================
135
+ /**
136
+ * Rectangle shape renderer — the default box shape.
137
+ * Renders as:
138
+ * ┌─────────┐
139
+ * │ Label │
140
+ * └─────────┘
141
+ */
142
+ export const rectangleRenderer = {
143
+ getDimensions: getBoxDimensions,
144
+ render(label, dimensions, options) {
145
+ const corners = getCorners('rectangle', options.useAscii);
146
+ return renderBox(label, dimensions, corners, options.useAscii);
147
+ },
148
+ getAttachmentPoint: getBoxAttachmentPoint,
149
+ };
@@ -0,0 +1,12 @@
1
+ import type { ShapeRenderer } from './types.ts';
2
+ /**
3
+ * Rounded rectangle shape renderer.
4
+ * Uses rounded corner markers (╭╮╰╯) to indicate soft edges.
5
+ *
6
+ * Renders as:
7
+ * ╭─────────╮
8
+ * │ Label │
9
+ * ╰─────────╯
10
+ */
11
+ export declare const roundedRenderer: ShapeRenderer;
12
+ //# sourceMappingURL=rounded.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rounded.d.ts","sourceRoot":"","sources":["../../../../../src/vendor/mermaid-ascii/ascii/shapes/rounded.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAI/C;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,EAAE,aAS7B,CAAA"}
@@ -0,0 +1,22 @@
1
+ // ============================================================================
2
+ // Rounded rectangle shape renderer — uses rounded corner decorators
3
+ // ============================================================================
4
+ import { getBoxDimensions, renderBox, getBoxAttachmentPoint } from "./rectangle.js";
5
+ import { getCorners } from "./corners.js";
6
+ /**
7
+ * Rounded rectangle shape renderer.
8
+ * Uses rounded corner markers (╭╮╰╯) to indicate soft edges.
9
+ *
10
+ * Renders as:
11
+ * ╭─────────╮
12
+ * │ Label │
13
+ * ╰─────────╯
14
+ */
15
+ export const roundedRenderer = {
16
+ getDimensions: getBoxDimensions,
17
+ render(label, dimensions, options) {
18
+ const corners = getCorners('rounded', options.useAscii);
19
+ return renderBox(label, dimensions, corners, options.useAscii);
20
+ },
21
+ getAttachmentPoint: getBoxAttachmentPoint,
22
+ };
@@ -0,0 +1,60 @@
1
+ import type { ShapeRenderer } from './types.ts';
2
+ /**
3
+ * Subroutine shape renderer — double-bordered rectangle.
4
+ * Renders as:
5
+ * ┌┬─────────┬┐
6
+ * ││ Label ││
7
+ * └┴─────────┴┘
8
+ */
9
+ export declare const subroutineRenderer: ShapeRenderer;
10
+ /**
11
+ * Double circle shape renderer.
12
+ * Uses double circle markers (◎) at corners.
13
+ *
14
+ * Renders as:
15
+ * ◎─────────◎
16
+ * │ Label │
17
+ * ◎─────────◎
18
+ */
19
+ export declare const doublecircleRenderer: ShapeRenderer;
20
+ /**
21
+ * Cylinder shape renderer — database symbol.
22
+ * Renders as:
23
+ * ╭─────╮
24
+ * │─────│
25
+ * │ DB │
26
+ * │─────│
27
+ * ╰─────╯
28
+ */
29
+ export declare const cylinderRenderer: ShapeRenderer;
30
+ /**
31
+ * Asymmetric (flag/banner) shape renderer.
32
+ * Uses arrow markers (▷) on left corners.
33
+ *
34
+ * Renders as:
35
+ * ▷─────────┐
36
+ * │ Label │
37
+ * ▷─────────┘
38
+ */
39
+ export declare const asymmetricRenderer: ShapeRenderer;
40
+ /**
41
+ * Trapezoid shape renderer — wider at bottom.
42
+ * Uses slope markers (◸◹) on top corners.
43
+ *
44
+ * Renders as:
45
+ * ◸─────────◹
46
+ * │ Label │
47
+ * └─────────┘
48
+ */
49
+ export declare const trapezoidRenderer: ShapeRenderer;
50
+ /**
51
+ * Trapezoid-alt shape renderer — wider at top.
52
+ * Uses slope markers (◺◿) on bottom corners.
53
+ *
54
+ * Renders as:
55
+ * ┌─────────┐
56
+ * │ Label │
57
+ * ◺─────────◿
58
+ */
59
+ export declare const trapezoidAltRenderer: ShapeRenderer;
60
+ //# sourceMappingURL=special.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"special.d.ts","sourceRoot":"","sources":["../../../../../src/vendor/mermaid-ascii/ascii/shapes/special.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAuC,MAAM,YAAY,CAAA;AAUpF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,aA4EhC,CAAA;AAMD;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,EAAE,aASlC,CAAA;AAMD;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,EAAE,aAgF9B,CAAA;AAMD;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,EAAE,aAShC,CAAA;AAMD;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,EAAE,aAS/B,CAAA;AAMD;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,EAAE,aASlC,CAAA"}
@@ -0,0 +1,253 @@
1
+ // ============================================================================
2
+ // Special shape renderers — subroutine, doublecircle, cylinder, etc.
3
+ // ============================================================================
4
+ //
5
+ // Some shapes have unique internal structure (subroutine, cylinder) and keep
6
+ // custom rendering. Others use the corner decorator pattern for simplicity.
7
+ import { mkCanvas } from "../canvas.js";
8
+ import { splitLines } from "../multiline-utils.js";
9
+ import { getBoxDimensions, renderBox, getBoxAttachmentPoint } from "./rectangle.js";
10
+ import { getCorners } from "./corners.js";
11
+ import { displayWidth, toCells } from "../../text-metrics.js";
12
+ // ============================================================================
13
+ // Subroutine — keeps custom double-border rendering
14
+ // ============================================================================
15
+ /**
16
+ * Subroutine shape renderer — double-bordered rectangle.
17
+ * Renders as:
18
+ * ┌┬─────────┬┐
19
+ * ││ Label ││
20
+ * └┴─────────┴┘
21
+ */
22
+ export const subroutineRenderer = {
23
+ getDimensions(label, options) {
24
+ const lines = splitLines(label);
25
+ const maxLineWidth = Math.max(...lines.map(l => displayWidth(l)), 0);
26
+ const lineCount = lines.length;
27
+ const innerWidth = 2 * options.padding + maxLineWidth;
28
+ const width = innerWidth + 4; // Double borders on each side
29
+ const innerHeight = lineCount + 2 * options.padding;
30
+ const height = innerHeight + 2;
31
+ return {
32
+ width,
33
+ height,
34
+ labelArea: {
35
+ x: 2 + options.padding,
36
+ y: 1 + options.padding,
37
+ width: maxLineWidth,
38
+ height: lineCount,
39
+ },
40
+ gridColumns: [2, innerWidth, 2],
41
+ gridRows: [1, innerHeight, 1],
42
+ };
43
+ },
44
+ render(label, dimensions, options) {
45
+ const { width, height } = dimensions;
46
+ const canvas = mkCanvas(width - 1, height - 1);
47
+ const hChar = options.useAscii ? '-' : '─';
48
+ const vChar = options.useAscii ? '|' : '│';
49
+ // Top border
50
+ canvas[0][0] = options.useAscii ? '+' : '┌';
51
+ canvas[1][0] = options.useAscii ? '+' : '┬';
52
+ for (let x = 2; x < width - 2; x++)
53
+ canvas[x][0] = hChar;
54
+ canvas[width - 2][0] = options.useAscii ? '+' : '┬';
55
+ canvas[width - 1][0] = options.useAscii ? '+' : '┐';
56
+ // Sides with double border
57
+ for (let y = 1; y < height - 1; y++) {
58
+ canvas[0][y] = vChar;
59
+ canvas[1][y] = vChar;
60
+ canvas[width - 2][y] = vChar;
61
+ canvas[width - 1][y] = vChar;
62
+ }
63
+ // Bottom border
64
+ canvas[0][height - 1] = options.useAscii ? '+' : '└';
65
+ canvas[1][height - 1] = options.useAscii ? '+' : '┴';
66
+ for (let x = 2; x < width - 2; x++)
67
+ canvas[x][height - 1] = hChar;
68
+ canvas[width - 2][height - 1] = options.useAscii ? '+' : '┴';
69
+ canvas[width - 1][height - 1] = options.useAscii ? '+' : '┘';
70
+ // Center the label
71
+ const lines = splitLines(label);
72
+ const centerY = Math.floor(height / 2);
73
+ const startY = centerY - Math.floor((lines.length - 1) / 2);
74
+ for (let i = 0; i < lines.length; i++) {
75
+ const line = lines[i];
76
+ const cells = toCells(line);
77
+ const textX = Math.floor(width / 2) - Math.floor(cells.length / 2);
78
+ for (let j = 0; j < cells.length; j++) {
79
+ const x = textX + j;
80
+ const y = startY + i;
81
+ if (x > 1 && x < width - 2 && y > 0 && y < height - 1) {
82
+ canvas[x][y] = cells[j];
83
+ }
84
+ }
85
+ }
86
+ return canvas;
87
+ },
88
+ getAttachmentPoint: getBoxAttachmentPoint,
89
+ };
90
+ // ============================================================================
91
+ // Double circle — uses corner decorators
92
+ // ============================================================================
93
+ /**
94
+ * Double circle shape renderer.
95
+ * Uses double circle markers (◎) at corners.
96
+ *
97
+ * Renders as:
98
+ * ◎─────────◎
99
+ * │ Label │
100
+ * ◎─────────◎
101
+ */
102
+ export const doublecircleRenderer = {
103
+ getDimensions: getBoxDimensions,
104
+ render(label, dimensions, options) {
105
+ const corners = getCorners('doublecircle', options.useAscii);
106
+ return renderBox(label, dimensions, corners, options.useAscii);
107
+ },
108
+ getAttachmentPoint: getBoxAttachmentPoint,
109
+ };
110
+ // ============================================================================
111
+ // Cylinder — keeps custom rendering for database appearance
112
+ // ============================================================================
113
+ /**
114
+ * Cylinder shape renderer — database symbol.
115
+ * Renders as:
116
+ * ╭─────╮
117
+ * │─────│
118
+ * │ DB │
119
+ * │─────│
120
+ * ╰─────╯
121
+ */
122
+ export const cylinderRenderer = {
123
+ getDimensions(label, options) {
124
+ const lines = splitLines(label);
125
+ const maxLineWidth = Math.max(...lines.map(l => displayWidth(l)), 0);
126
+ const lineCount = lines.length;
127
+ const innerWidth = 2 * options.padding + maxLineWidth;
128
+ const width = innerWidth + 2;
129
+ const innerHeight = lineCount + 2 * options.padding + 2; // Extra for curved top/bottom
130
+ const height = innerHeight + 2;
131
+ return {
132
+ width,
133
+ height,
134
+ labelArea: {
135
+ x: 1 + options.padding,
136
+ y: 2 + options.padding,
137
+ width: maxLineWidth,
138
+ height: lineCount,
139
+ },
140
+ gridColumns: [1, innerWidth, 1],
141
+ gridRows: [2, innerHeight - 2, 2],
142
+ };
143
+ },
144
+ render(label, dimensions, options) {
145
+ const { width, height } = dimensions;
146
+ const canvas = mkCanvas(width - 1, height - 1);
147
+ const hChar = options.useAscii ? '-' : '─';
148
+ const vChar = options.useAscii ? '|' : '│';
149
+ // Top ellipse
150
+ canvas[0][0] = options.useAscii ? '.' : '╭';
151
+ for (let x = 1; x < width - 1; x++)
152
+ canvas[x][0] = hChar;
153
+ canvas[width - 1][0] = options.useAscii ? '.' : '╮';
154
+ // Second row - bottom of top ellipse
155
+ canvas[0][1] = vChar;
156
+ for (let x = 1; x < width - 1; x++)
157
+ canvas[x][1] = hChar;
158
+ canvas[width - 1][1] = vChar;
159
+ // Middle section
160
+ for (let y = 2; y < height - 2; y++) {
161
+ canvas[0][y] = vChar;
162
+ canvas[width - 1][y] = vChar;
163
+ }
164
+ // Second to last row - top of bottom ellipse
165
+ canvas[0][height - 2] = vChar;
166
+ for (let x = 1; x < width - 1; x++)
167
+ canvas[x][height - 2] = hChar;
168
+ canvas[width - 1][height - 2] = vChar;
169
+ // Bottom ellipse
170
+ canvas[0][height - 1] = options.useAscii ? '\'' : '╰';
171
+ for (let x = 1; x < width - 1; x++)
172
+ canvas[x][height - 1] = hChar;
173
+ canvas[width - 1][height - 1] = options.useAscii ? '\'' : '╯';
174
+ // Center the label
175
+ const lines = splitLines(label);
176
+ const centerY = Math.floor(height / 2);
177
+ const startY = centerY - Math.floor((lines.length - 1) / 2);
178
+ for (let i = 0; i < lines.length; i++) {
179
+ const line = lines[i];
180
+ const cells = toCells(line);
181
+ const textX = Math.floor(width / 2) - Math.floor(cells.length / 2);
182
+ for (let j = 0; j < cells.length; j++) {
183
+ const x = textX + j;
184
+ const y = startY + i;
185
+ if (x > 0 && x < width - 1 && y > 1 && y < height - 2) {
186
+ canvas[x][y] = cells[j];
187
+ }
188
+ }
189
+ }
190
+ return canvas;
191
+ },
192
+ getAttachmentPoint: getBoxAttachmentPoint,
193
+ };
194
+ // ============================================================================
195
+ // Asymmetric (flag) — uses corner decorators
196
+ // ============================================================================
197
+ /**
198
+ * Asymmetric (flag/banner) shape renderer.
199
+ * Uses arrow markers (▷) on left corners.
200
+ *
201
+ * Renders as:
202
+ * ▷─────────┐
203
+ * │ Label │
204
+ * ▷─────────┘
205
+ */
206
+ export const asymmetricRenderer = {
207
+ getDimensions: getBoxDimensions,
208
+ render(label, dimensions, options) {
209
+ const corners = getCorners('asymmetric', options.useAscii);
210
+ return renderBox(label, dimensions, corners, options.useAscii);
211
+ },
212
+ getAttachmentPoint: getBoxAttachmentPoint,
213
+ };
214
+ // ============================================================================
215
+ // Trapezoid — uses corner decorators instead of diagonal sides
216
+ // ============================================================================
217
+ /**
218
+ * Trapezoid shape renderer — wider at bottom.
219
+ * Uses slope markers (◸◹) on top corners.
220
+ *
221
+ * Renders as:
222
+ * ◸─────────◹
223
+ * │ Label │
224
+ * └─────────┘
225
+ */
226
+ export const trapezoidRenderer = {
227
+ getDimensions: getBoxDimensions,
228
+ render(label, dimensions, options) {
229
+ const corners = getCorners('trapezoid', options.useAscii);
230
+ return renderBox(label, dimensions, corners, options.useAscii);
231
+ },
232
+ getAttachmentPoint: getBoxAttachmentPoint,
233
+ };
234
+ // ============================================================================
235
+ // Trapezoid-alt — uses corner decorators instead of diagonal sides
236
+ // ============================================================================
237
+ /**
238
+ * Trapezoid-alt shape renderer — wider at top.
239
+ * Uses slope markers (◺◿) on bottom corners.
240
+ *
241
+ * Renders as:
242
+ * ┌─────────┐
243
+ * │ Label │
244
+ * ◺─────────◿
245
+ */
246
+ export const trapezoidAltRenderer = {
247
+ getDimensions: getBoxDimensions,
248
+ render(label, dimensions, options) {
249
+ const corners = getCorners('trapezoid-alt', options.useAscii);
250
+ return renderBox(label, dimensions, corners, options.useAscii);
251
+ },
252
+ getAttachmentPoint: getBoxAttachmentPoint,
253
+ };
@@ -0,0 +1,18 @@
1
+ import type { ShapeRenderer } from './types.ts';
2
+ /**
3
+ * Stadium (pill) shape renderer.
4
+ *
5
+ * Single-line: ( Label )
6
+ *
7
+ * Multi-line unicode:
8
+ * ╭──────────╮
9
+ * │ Label │
10
+ * ╰──────────╯
11
+ *
12
+ * Multi-line ASCII:
13
+ * (----------)
14
+ * ( Label )
15
+ * (----------)
16
+ */
17
+ export declare const stadiumRenderer: ShapeRenderer;
18
+ //# sourceMappingURL=stadium.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stadium.d.ts","sourceRoot":"","sources":["../../../../../src/vendor/mermaid-ascii/ascii/shapes/stadium.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAuC,MAAM,YAAY,CAAA;AAIpF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,EAAE,aAmF7B,CAAA"}