agentic-mermaid 0.4.1 → 0.5.3

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 (253) hide show
  1. package/AGENT_NATIVE.md +94 -627
  2. package/CHANGELOG.md +651 -0
  3. package/Instructions_for_agents.md +44 -23
  4. package/LICENSES/Khroma-MIT.txt +21 -0
  5. package/LICENSES/Mermaid-MIT.txt +21 -0
  6. package/LICENSES/es-toolkit-MIT.txt +21 -0
  7. package/LICENSES/pele-MIT.txt +40 -0
  8. package/LICENSES/zenuml-core-MIT.txt +21 -0
  9. package/README.md +93 -50
  10. package/SECURITY.md +28 -12
  11. package/THIRD_PARTY_NOTICES.md +60 -0
  12. package/assets/hero.png +0 -0
  13. package/dist/agent-core.d.ts +478 -210
  14. package/dist/agent-core.js +1 -396
  15. package/dist/agent.d.ts +17 -8
  16. package/dist/agent.js +1 -408
  17. package/dist/agentic-mermaid-mcp.js +1 -11
  18. package/dist/am.js +1 -34562
  19. package/dist/browser-lazy/chunks/agentic-producer-core-CC6OOLDW.js +1 -0
  20. package/dist/browser-lazy/chunks/architecture-QUFVKYJR.js +13 -0
  21. package/dist/browser-lazy/chunks/block-6J3Q63BO.js +11 -0
  22. package/dist/browser-lazy/chunks/builtin-backends-7SOZZHPF.js +12 -0
  23. package/dist/browser-lazy/chunks/c4-SQVBZAKJ.js +10 -0
  24. package/dist/browser-lazy/chunks/chunk-2GPK4VFF.js +5 -0
  25. package/dist/browser-lazy/chunks/chunk-2I4UPL7Q.js +3 -0
  26. package/dist/browser-lazy/chunks/chunk-2SH76OTH.js +1 -0
  27. package/dist/browser-lazy/chunks/chunk-2UIA2IME.js +3 -0
  28. package/dist/browser-lazy/chunks/chunk-4LHYF3BS.js +1 -0
  29. package/dist/browser-lazy/chunks/chunk-5B2Z7575.js +1 -0
  30. package/dist/browser-lazy/chunks/chunk-5FQ534HP.js +1 -0
  31. package/dist/browser-lazy/chunks/chunk-5UVGUSD6.js +1 -0
  32. package/dist/browser-lazy/chunks/chunk-5X6MJX3H.js +1 -0
  33. package/dist/browser-lazy/chunks/chunk-AMJLVPUB.js +4 -0
  34. package/dist/browser-lazy/chunks/chunk-BU5LHXNJ.js +3 -0
  35. package/dist/browser-lazy/chunks/chunk-BY2CPG6B.js +1 -0
  36. package/dist/browser-lazy/chunks/chunk-CN7WTBWB.js +1 -0
  37. package/dist/browser-lazy/chunks/chunk-CQE4HQEW.js +1 -0
  38. package/dist/browser-lazy/chunks/chunk-CSFUKSU6.js +1 -0
  39. package/dist/browser-lazy/chunks/chunk-DF6765YX.js +17 -0
  40. package/dist/browser-lazy/chunks/chunk-E2WMJZNM.js +1 -0
  41. package/dist/browser-lazy/chunks/chunk-FAIMVOX5.js +6 -0
  42. package/dist/browser-lazy/chunks/chunk-GVOEAY52.js +1 -0
  43. package/dist/browser-lazy/chunks/chunk-HLWUNUCM.js +1 -0
  44. package/dist/browser-lazy/chunks/chunk-ICC7HBJX.js +1 -0
  45. package/dist/browser-lazy/chunks/chunk-J35HAQQF.js +20 -0
  46. package/dist/browser-lazy/chunks/chunk-J7FFAFQF.js +1 -0
  47. package/dist/browser-lazy/chunks/chunk-LH7HUDKW.js +1 -0
  48. package/dist/browser-lazy/chunks/chunk-N5ELX7LR.js +2 -0
  49. package/dist/browser-lazy/chunks/chunk-NMQQMRIR.js +1 -0
  50. package/dist/browser-lazy/chunks/chunk-NO7ZIVRU.js +1 -0
  51. package/dist/browser-lazy/chunks/chunk-OZ443IVJ.js +16 -0
  52. package/dist/browser-lazy/chunks/chunk-PQGPS2YV.js +7 -0
  53. package/dist/browser-lazy/chunks/chunk-QA6GJQ4X.js +1 -0
  54. package/dist/browser-lazy/chunks/chunk-RIVTHZAQ.js +1 -0
  55. package/dist/browser-lazy/chunks/chunk-SZELX2EJ.js +1 -0
  56. package/dist/browser-lazy/chunks/chunk-TYZOZXUJ.js +22 -0
  57. package/dist/browser-lazy/chunks/chunk-UL6NDWLL.js +1 -0
  58. package/dist/browser-lazy/chunks/chunk-VQYYGAXP.js +1 -0
  59. package/dist/browser-lazy/chunks/chunk-VWVZGQE2.js +1 -0
  60. package/dist/browser-lazy/chunks/chunk-X2UYKWKM.js +4 -0
  61. package/dist/browser-lazy/chunks/chunk-YCEICNM6.js +1 -0
  62. package/dist/browser-lazy/chunks/chunk-Z3FDIVLN.js +20 -0
  63. package/dist/browser-lazy/chunks/class-5QA4SCTS.js +13 -0
  64. package/dist/browser-lazy/chunks/decode-63UIZGD2.js +1 -0
  65. package/dist/browser-lazy/chunks/elk.bundled-L4CADV5W.js +24 -0
  66. package/dist/browser-lazy/chunks/er-7ZSKGN7Y.js +11 -0
  67. package/dist/browser-lazy/chunks/eventmodeling-2BPLHWRN.js +19 -0
  68. package/dist/browser-lazy/chunks/flowchart-NEIMZTB5.js +4 -0
  69. package/dist/browser-lazy/chunks/forest-implementation-AEP24AIP.js +1 -0
  70. package/dist/browser-lazy/chunks/gantt-RDPIFYAF.js +11 -0
  71. package/dist/browser-lazy/chunks/gitgraph-N4Y5RYB7.js +9 -0
  72. package/dist/browser-lazy/chunks/ishikawa-LD3YBDJN.js +6 -0
  73. package/dist/browser-lazy/chunks/journey-6YQR5DJX.js +16 -0
  74. package/dist/browser-lazy/chunks/kanban-PLMJ7NBW.js +20 -0
  75. package/dist/browser-lazy/chunks/mermaid-yaml-runtime-QVYX4EWK.js +136 -0
  76. package/dist/browser-lazy/chunks/mindmap-K2UBFO3Y.js +12 -0
  77. package/dist/browser-lazy/chunks/packet-CUW4QY6Y.js +7 -0
  78. package/dist/browser-lazy/chunks/pie-7F7UUCG3.js +15 -0
  79. package/dist/browser-lazy/chunks/quadrant-TOONO2WC.js +10 -0
  80. package/dist/browser-lazy/chunks/radar-J6JVWVAX.js +16 -0
  81. package/dist/browser-lazy/chunks/render-core-BZOM3K7D.js +3 -0
  82. package/dist/browser-lazy/chunks/requirement-CMAKDJPO.js +19 -0
  83. package/dist/browser-lazy/chunks/sankey-AWXQEP3F.js +13 -0
  84. package/dist/browser-lazy/chunks/sequence-Q2RJRB4L.js +5 -0
  85. package/dist/browser-lazy/chunks/state-WRBFQEDX.js +4 -0
  86. package/dist/browser-lazy/chunks/timeline-D2KILFXM.js +6 -0
  87. package/dist/browser-lazy/chunks/treemap-N3VYX5D4.js +6 -0
  88. package/dist/browser-lazy/chunks/xychart-G73OGK66.js +16 -0
  89. package/dist/browser-lazy/chunks/zenuml-H4BXNYXR.js +16 -0
  90. package/dist/browser-lazy/index.d.ts +544 -275
  91. package/dist/browser-lazy/index.js +1 -1
  92. package/dist/browser.global.js +802 -565
  93. package/dist/chunk-3LGLPG33.js +2 -0
  94. package/dist/chunk-7CRDX2QR.js +2 -0
  95. package/dist/chunk-7PPW2BMO.js +2 -0
  96. package/dist/chunk-DQDKA5ND.js +2 -0
  97. package/dist/chunk-EHCMJUMD.js +52 -0
  98. package/dist/chunk-GVCHLSHH.js +4 -0
  99. package/dist/chunk-H3NCS2XZ.js +19 -0
  100. package/dist/chunk-JZOJ4YGS.js +201 -0
  101. package/dist/chunk-MKE7GNYU.js +146 -0
  102. package/dist/chunk-NKNFOREZ.js +2 -0
  103. package/dist/chunk-O7H2UX5K.js +2 -0
  104. package/dist/chunk-OMY6NRQD.js +58 -0
  105. package/dist/chunk-UA234O4M.js +4 -0
  106. package/dist/chunk-VUFVLGTH.js +2 -0
  107. package/dist/chunk-XU5LPD2D.js +2 -0
  108. package/dist/cli-YGGTJZH7.js +226 -0
  109. package/dist/elk-constructor.js +2 -0
  110. package/dist/elk-constructor.node.js +11 -0
  111. package/dist/index-EeXqJXr5.d.ts +1223 -0
  112. package/dist/index.d.ts +4 -1
  113. package/dist/index.js +1 -334
  114. package/dist/jsonl-RPJY6YWO.js +2 -0
  115. package/dist/mcp-cli-63DYXTVD.js +2 -0
  116. package/dist/{index-BGA_-6LV.d.ts → paint-certification-6rwQjIv_.d.ts} +5283 -6173
  117. package/dist/server-5NEOHOFS.js +524 -0
  118. package/dist/svg-styles-BdnoM7AT.d.ts +724 -0
  119. package/dist/svg-styles.d.ts +1 -0
  120. package/dist/svg-styles.js +2 -0
  121. package/dist/svg.d.ts +13 -0
  122. package/dist/svg.js +2 -0
  123. package/dist/types-BcS52Mjt.d.ts +1360 -0
  124. package/dist/zenuml/chunks/appearance-UOQ5KA6O.js +1 -0
  125. package/dist/zenuml/chunks/builtin-backends-KDKE7YHO.js +12 -0
  126. package/dist/zenuml/chunks/chunk-42DXZ5C6.js +4 -0
  127. package/dist/zenuml/chunks/chunk-7TVYPTDW.js +1 -0
  128. package/dist/zenuml/chunks/chunk-EVPSMEKN.js +1 -0
  129. package/dist/zenuml/chunks/chunk-OXQWRSBM.js +20 -0
  130. package/dist/zenuml/chunks/chunk-QWX77U7G.js +2 -0
  131. package/dist/zenuml/chunks/chunk-RLJEI7YN.js +29 -0
  132. package/dist/zenuml/chunks/chunk-RZ6XK5CD.js +29 -0
  133. package/dist/zenuml/chunks/decode-BWERFDGK.js +1 -0
  134. package/dist/zenuml/chunks/mermaid-yaml-runtime-KZVU74WU.js +136 -0
  135. package/dist/zenuml/chunks/render-core-V5RQ737O.js +3 -0
  136. package/dist/zenuml/chunks/zenuml-EA2ZFRUX.js +20 -0
  137. package/dist/zenuml-frame.global.js +3626 -0
  138. package/dist/zenuml.d.ts +83 -0
  139. package/dist/zenuml.js +1 -0
  140. package/docs/MCP-DIRECTORY-LISTINGS.md +5 -1
  141. package/docs/README.md +59 -103
  142. package/docs/agent-api-cookbook.md +26 -16
  143. package/docs/agent-mutation-policy.md +86 -15
  144. package/docs/agent-workflow-examples.md +1 -1
  145. package/docs/api-advanced.md +385 -0
  146. package/docs/api.md +320 -366
  147. package/docs/ascii.md +40 -4
  148. package/docs/browser.md +46 -7
  149. package/docs/choosing-a-diagram.md +148 -0
  150. package/docs/code-mode-impact.md +1 -0
  151. package/docs/comparison.md +244 -28
  152. package/docs/computational-aesthetics-prototype-plan.md +10 -10
  153. package/docs/config.md +60 -2
  154. package/docs/custom-fonts.md +78 -21
  155. package/docs/diagram-families.md +160 -10
  156. package/docs/eventmodeling-and-zenuml.md +165 -0
  157. package/docs/features.md +21 -19
  158. package/docs/fork-differences.md +105 -32
  159. package/docs/getting-started.md +56 -51
  160. package/docs/layout-certification.md +126 -0
  161. package/docs/mcp-code-mode-rationale.md +20 -12
  162. package/docs/mcp-http-transport.md +14 -8
  163. package/docs/quality.md +145 -15
  164. package/docs/react.md +76 -31
  165. package/docs/style-authoring.md +23 -11
  166. package/docs/svg-semantic-contract.md +104 -4
  167. package/docs/testing-strategy.md +684 -126
  168. package/docs/theming.md +27 -8
  169. package/examples/styles/readme-hero.md +25 -0
  170. package/examples/styles/readme-hero.mmd +13 -0
  171. package/examples/styles/readme-hero.style.json +7 -0
  172. package/package.json +114 -57
  173. package/server.json +2 -2
  174. package/skills/agentic-mermaid-diagram-workflow/SKILL.md +26 -8
  175. package/skills/agentic-mermaid-diagram-workflow/references/cli.md +13 -3
  176. package/skills/agentic-mermaid-diagram-workflow/references/code-mode.md +2 -1
  177. package/skills/agentic-mermaid-diagram-workflow/references/flowchart.md +9 -6
  178. package/skills/agentic-mermaid-diagram-workflow/references/hosted-mcp.md +1 -0
  179. package/skills/agentic-mermaid-diagram-workflow/references/sequence.md +4 -3
  180. package/skills/agentic-mermaid-diagram-workflow/references/timeline.md +7 -6
  181. package/skills/agentic-mermaid-diagram-workflow/references/upstream/agentflow.md +574 -0
  182. package/skills/agentic-mermaid-diagram-workflow/references/upstream/architecture.md +10 -2
  183. package/skills/agentic-mermaid-diagram-workflow/references/upstream/c4.md +18 -0
  184. package/skills/agentic-mermaid-diagram-workflow/references/upstream/classDiagram.md +123 -0
  185. package/skills/agentic-mermaid-diagram-workflow/references/upstream/cynefin.md +6 -1
  186. package/skills/agentic-mermaid-diagram-workflow/references/upstream/entityRelationshipDiagram.md +129 -9
  187. package/skills/agentic-mermaid-diagram-workflow/references/upstream/eventmodeling.md +22 -0
  188. package/skills/agentic-mermaid-diagram-workflow/references/upstream/flowchart.md +188 -60
  189. package/skills/agentic-mermaid-diagram-workflow/references/upstream/gitgraph.md +13 -7
  190. package/skills/agentic-mermaid-diagram-workflow/references/upstream/mindmap.md +110 -1
  191. package/skills/agentic-mermaid-diagram-workflow/references/upstream/packet.md +38 -0
  192. package/skills/agentic-mermaid-diagram-workflow/references/upstream/requirementDiagram.md +115 -0
  193. package/skills/agentic-mermaid-diagram-workflow/references/upstream/sequenceDiagram.md +101 -0
  194. package/skills/agentic-mermaid-diagram-workflow/references/upstream/stateDiagram.md +87 -0
  195. package/skills/agentic-mermaid-diagram-workflow/references/upstream/swimlanes.md +105 -2
  196. package/skills/agentic-mermaid-diagram-workflow/references/upstream/timeline.md +12 -6
  197. package/skills/agentic-mermaid-diagram-workflow/references/upstream/usecase.md +953 -0
  198. package/skills/agentic-mermaid-diagram-workflow/references/upstream/venn.md +77 -0
  199. package/skills/agentic-mermaid-diagram-workflow/references/upstream/xyChart.md +1 -1
  200. package/dist/browser-lazy/chunks/architecture-KTHE2HX3.js +0 -31
  201. package/dist/browser-lazy/chunks/chunk-2XCPFAD5.js +0 -46
  202. package/dist/browser-lazy/chunks/chunk-3H4F7RBT.js +0 -1
  203. package/dist/browser-lazy/chunks/chunk-4EVLW2NJ.js +0 -1
  204. package/dist/browser-lazy/chunks/chunk-5Q4S74UO.js +0 -1
  205. package/dist/browser-lazy/chunks/chunk-6OAPWSDO.js +0 -1
  206. package/dist/browser-lazy/chunks/chunk-A7L4WWVW.js +0 -143
  207. package/dist/browser-lazy/chunks/chunk-C7FJO2I3.js +0 -4
  208. package/dist/browser-lazy/chunks/chunk-D3XXDKIO.js +0 -1
  209. package/dist/browser-lazy/chunks/chunk-DXA5WL7H.js +0 -4
  210. package/dist/browser-lazy/chunks/chunk-EPFMQPXX.js +0 -1
  211. package/dist/browser-lazy/chunks/chunk-FFOHLPDA.js +0 -2
  212. package/dist/browser-lazy/chunks/chunk-FLD63DXE.js +0 -2
  213. package/dist/browser-lazy/chunks/chunk-G6OLSHRG.js +0 -7
  214. package/dist/browser-lazy/chunks/chunk-GRXCKTHX.js +0 -0
  215. package/dist/browser-lazy/chunks/chunk-I6VE56S7.js +0 -1
  216. package/dist/browser-lazy/chunks/chunk-KJVNXJ5Y.js +0 -1
  217. package/dist/browser-lazy/chunks/chunk-L227EPFP.js +0 -11
  218. package/dist/browser-lazy/chunks/chunk-LNIHDJSF.js +0 -1
  219. package/dist/browser-lazy/chunks/chunk-M6BT2HIP.js +0 -1
  220. package/dist/browser-lazy/chunks/chunk-NZRUMODH.js +0 -1
  221. package/dist/browser-lazy/chunks/chunk-OFRMKQA6.js +0 -1
  222. package/dist/browser-lazy/chunks/chunk-P7HMSKHJ.js +0 -1
  223. package/dist/browser-lazy/chunks/chunk-PXKL3O6H.js +0 -1
  224. package/dist/browser-lazy/chunks/chunk-PZEWZT35.js +0 -1
  225. package/dist/browser-lazy/chunks/chunk-STQRDZ67.js +0 -1
  226. package/dist/browser-lazy/chunks/chunk-SUFMSWTX.js +0 -1
  227. package/dist/browser-lazy/chunks/chunk-T7IJ6V4B.js +0 -3
  228. package/dist/browser-lazy/chunks/chunk-UAEZO5VL.js +0 -1
  229. package/dist/browser-lazy/chunks/chunk-WEUWIFG3.js +0 -1
  230. package/dist/browser-lazy/chunks/chunk-X64T74C5.js +0 -24
  231. package/dist/browser-lazy/chunks/class-F7R6TJ73.js +0 -9
  232. package/dist/browser-lazy/chunks/er-BDK7CM5L.js +0 -9
  233. package/dist/browser-lazy/chunks/flowchart-KFU6XV7S.js +0 -4
  234. package/dist/browser-lazy/chunks/gantt-I64VVDSP.js +0 -28
  235. package/dist/browser-lazy/chunks/gitgraph-EDUVJ5IJ.js +0 -8
  236. package/dist/browser-lazy/chunks/journey-TLO2RNM3.js +0 -40
  237. package/dist/browser-lazy/chunks/mindmap-OJCNDYPM.js +0 -9
  238. package/dist/browser-lazy/chunks/pie-HVG6XO7K.js +0 -19
  239. package/dist/browser-lazy/chunks/quadrant-U6S2L4MJ.js +0 -24
  240. package/dist/browser-lazy/chunks/radar-ZDLOBTVG.js +0 -32
  241. package/dist/browser-lazy/chunks/render-core-Y2DFNMQG.js +0 -12
  242. package/dist/browser-lazy/chunks/sequence-Z4WFS3VB.js +0 -12
  243. package/dist/browser-lazy/chunks/state-2HV2YGN3.js +0 -4
  244. package/dist/browser-lazy/chunks/timeline-XM4UFPOC.js +0 -20
  245. package/dist/browser-lazy/chunks/xychart-7JDHWTQY.js +0 -36
  246. package/dist/chunk-GGXCNCNA.js +0 -4118
  247. package/dist/chunk-IVD4NXNE.js +0 -615
  248. package/dist/chunk-JDMRPUAG.js +0 -37
  249. package/dist/chunk-JWAAW3FH.js +0 -149
  250. package/dist/chunk-LCGBT32P.js +0 -62036
  251. package/dist/chunk-RWMZRUIC.js +0 -4715
  252. package/dist/mcp-cli-4MLKC3ZH.js +0 -17
  253. package/docs/mutation-testing.md +0 -285
@@ -29,6 +29,107 @@ sequenceDiagram
29
29
  >
30
30
  > If unavoidable, one must use parentheses(), quotation marks "", or brackets {},\[], to enclose the word "end". i.e : (end), \[end], {end}.
31
31
 
32
+ ## Default theme and look (v12.0.0+)
33
+
34
+ Sequence diagrams use the `redux-color` theme and the `neo` look by default. Not every diagram type
35
+ does — see [Per-diagram defaults](../config/theming.md#per-diagram-defaults) for the list and
36
+ for the order in which Mermaid decides.
37
+
38
+ The same diagram, drawn both ways:
39
+
40
+ ### With the defaults
41
+
42
+ ```mermaid-example
43
+ sequenceDiagram
44
+ autonumber
45
+ actor Customer
46
+ participant Web as Web app
47
+ participant API as API gateway
48
+ participant Bank
49
+ Customer->>Web: Place order
50
+ Web->>API: POST /orders
51
+ activate API
52
+ API->>Bank: Authorise payment
53
+ Bank-->>API: Approved
54
+ API-->>Web: 201 Created
55
+ deactivate API
56
+ Web-->>Customer: Order confirmed
57
+ Note over Customer,Bank: One order, one transaction
58
+ ```
59
+
60
+ ```mermaid
61
+ sequenceDiagram
62
+ autonumber
63
+ actor Customer
64
+ participant Web as Web app
65
+ participant API as API gateway
66
+ participant Bank
67
+ Customer->>Web: Place order
68
+ Web->>API: POST /orders
69
+ activate API
70
+ API->>Bank: Authorise payment
71
+ Bank-->>API: Approved
72
+ API-->>Web: 201 Created
73
+ deactivate API
74
+ Web-->>Customer: Order confirmed
75
+ Note over Customer,Bank: One order, one transaction
76
+ ```
77
+
78
+ ### The previous appearance
79
+
80
+ Both are only defaults, so anything you set yourself wins. Naming the previous theme and look
81
+ in a diagram's front matter draws it the way Mermaid did before:
82
+
83
+ ```mermaid-example
84
+ ---
85
+ config:
86
+ theme: default
87
+ look: classic
88
+ ---
89
+ sequenceDiagram
90
+ autonumber
91
+ actor Customer
92
+ participant Web as Web app
93
+ participant API as API gateway
94
+ participant Bank
95
+ Customer->>Web: Place order
96
+ Web->>API: POST /orders
97
+ activate API
98
+ API->>Bank: Authorise payment
99
+ Bank-->>API: Approved
100
+ API-->>Web: 201 Created
101
+ deactivate API
102
+ Web-->>Customer: Order confirmed
103
+ Note over Customer,Bank: One order, one transaction
104
+ ```
105
+
106
+ ```mermaid
107
+ ---
108
+ config:
109
+ theme: default
110
+ look: classic
111
+ ---
112
+ sequenceDiagram
113
+ autonumber
114
+ actor Customer
115
+ participant Web as Web app
116
+ participant API as API gateway
117
+ participant Bank
118
+ Customer->>Web: Place order
119
+ Web->>API: POST /orders
120
+ activate API
121
+ API->>Bank: Authorise payment
122
+ Bank-->>API: Approved
123
+ API-->>Web: 201 Created
124
+ deactivate API
125
+ Web-->>Customer: Order confirmed
126
+ Note over Customer,Bank: One order, one transaction
127
+ ```
128
+
129
+ Passing the same two keys to `mermaid.initialize()` does it for every diagram on the page,
130
+ and scoping them to one diagram type — `mermaid.initialize({ sequence: { theme: 'default', look: 'classic' } })` —
131
+ does it for that type alone.
132
+
32
133
  ## Syntax
33
134
 
34
135
  ### Participants
@@ -70,6 +70,93 @@ a _transition._ The example diagram above shows three states: **Still**, **Movin
70
70
  **Still** state. From **Still** you can change to the **Moving** state. From **Moving** you can change either back to the **Still** state or to
71
71
  the **Crash** state. There is no transition from **Still** to **Crash**. (You can't crash if you're still.)
72
72
 
73
+ ## Default theme, look and layout (v12.0.0+)
74
+
75
+ State diagrams use the `redux-color` theme and the `neo` look by default, and are laid out by [ELK](https://www.eclipse.org/elk/) rather than Dagre. Not every diagram type
76
+ does — see [Per-diagram defaults](../config/theming.md#per-diagram-defaults) for the list and
77
+ for the order in which Mermaid decides.
78
+
79
+ The same diagram, drawn both ways:
80
+
81
+ ### With the defaults
82
+
83
+ ```mermaid-example
84
+ stateDiagram-v2
85
+ [*] --> Draft
86
+ Draft --> Submitted : submit
87
+ state Review {
88
+ [*] --> Screening
89
+ Screening --> Decision
90
+ }
91
+ Submitted --> Review
92
+ Review --> Published : approved
93
+ Review --> Draft : rejected
94
+ Published --> [*]
95
+ ```
96
+
97
+ ```mermaid
98
+ stateDiagram-v2
99
+ [*] --> Draft
100
+ Draft --> Submitted : submit
101
+ state Review {
102
+ [*] --> Screening
103
+ Screening --> Decision
104
+ }
105
+ Submitted --> Review
106
+ Review --> Published : approved
107
+ Review --> Draft : rejected
108
+ Published --> [*]
109
+ ```
110
+
111
+ ### The previous appearance
112
+
113
+ Both are only defaults, so anything you set yourself wins. Naming the previous theme and look
114
+ in a diagram's front matter draws it the way Mermaid did before:
115
+
116
+ ```mermaid-example
117
+ ---
118
+ config:
119
+ theme: default
120
+ look: classic
121
+ layout: dagre
122
+ ---
123
+ stateDiagram-v2
124
+ [*] --> Draft
125
+ Draft --> Submitted : submit
126
+ state Review {
127
+ [*] --> Screening
128
+ Screening --> Decision
129
+ }
130
+ Submitted --> Review
131
+ Review --> Published : approved
132
+ Review --> Draft : rejected
133
+ Published --> [*]
134
+ ```
135
+
136
+ ```mermaid
137
+ ---
138
+ config:
139
+ theme: default
140
+ look: classic
141
+ layout: dagre
142
+ ---
143
+ stateDiagram-v2
144
+ [*] --> Draft
145
+ Draft --> Submitted : submit
146
+ state Review {
147
+ [*] --> Screening
148
+ Screening --> Decision
149
+ }
150
+ Submitted --> Review
151
+ Review --> Published : approved
152
+ Review --> Draft : rejected
153
+ Published --> [*]
154
+ ```
155
+
156
+ Passing the same three keys to `mermaid.initialize()` does it for every diagram on the page,
157
+ and scoping the theme and look to one diagram type — `mermaid.initialize({ layout: 'dagre', state: { theme: 'default', look: 'classic' } })` —
158
+ does it for that type alone. `layout` is a top-level option, so it applies to every diagram.
159
+
73
160
  ## States
74
161
 
75
162
  A state can be declared in multiple ways. The simplest way is to define a state with just an id:
@@ -13,9 +13,112 @@ A swimlane diagram shows a process divided by responsibility. Each lane represen
13
13
 
14
14
  Use swimlane diagrams when the most important question is not only "what happens next?" but also "who owns this step?" They are useful for approval flows, support processes, delivery workflows, and any process where work crosses teams or systems.
15
15
 
16
- ## Basic Example
16
+ ## Default theme and look (v12.0.0+)
17
+
18
+ Swimlane diagrams use the `redux-color` theme and the `neo` look by default. Not every diagram type
19
+ does — see [Per-diagram defaults](../config/theming.md#per-diagram-defaults) for the list and
20
+ for the order in which Mermaid decides.
21
+
22
+ The same diagram, drawn both ways:
23
+
24
+ ### With the defaults
25
+
26
+ ```mermaid-example
27
+ swimlane-beta LR
28
+ subgraph Customer
29
+ Browse[Browse catalogue]
30
+ Pay[Pay]
31
+ end
32
+ subgraph Warehouse
33
+ Pick[Pick items]
34
+ Ship[Ship order]
35
+ end
36
+ subgraph Finance
37
+ Invoice[Raise invoice]
38
+ end
39
+ Browse --> Pay
40
+ Pay --> Pick
41
+ Pick --> Ship
42
+ Pay --> Invoice
43
+ ```
44
+
45
+ ```mermaid
46
+ swimlane-beta LR
47
+ subgraph Customer
48
+ Browse[Browse catalogue]
49
+ Pay[Pay]
50
+ end
51
+ subgraph Warehouse
52
+ Pick[Pick items]
53
+ Ship[Ship order]
54
+ end
55
+ subgraph Finance
56
+ Invoice[Raise invoice]
57
+ end
58
+ Browse --> Pay
59
+ Pay --> Pick
60
+ Pick --> Ship
61
+ Pay --> Invoice
62
+ ```
17
63
 
18
- > The rendered examples on this page use the **Neo** look and the **Redux** theme. Out of the box, swimlanes use your configured default look and theme.
64
+ ### The previous appearance
65
+
66
+ Both are only defaults, so anything you set yourself wins. Naming the previous theme and look
67
+ in a diagram's front matter draws it the way Mermaid did before:
68
+
69
+ ```mermaid-example
70
+ ---
71
+ config:
72
+ theme: default
73
+ look: classic
74
+ ---
75
+ swimlane-beta LR
76
+ subgraph Customer
77
+ Browse[Browse catalogue]
78
+ Pay[Pay]
79
+ end
80
+ subgraph Warehouse
81
+ Pick[Pick items]
82
+ Ship[Ship order]
83
+ end
84
+ subgraph Finance
85
+ Invoice[Raise invoice]
86
+ end
87
+ Browse --> Pay
88
+ Pay --> Pick
89
+ Pick --> Ship
90
+ Pay --> Invoice
91
+ ```
92
+
93
+ ```mermaid
94
+ ---
95
+ config:
96
+ theme: default
97
+ look: classic
98
+ ---
99
+ swimlane-beta LR
100
+ subgraph Customer
101
+ Browse[Browse catalogue]
102
+ Pay[Pay]
103
+ end
104
+ subgraph Warehouse
105
+ Pick[Pick items]
106
+ Ship[Ship order]
107
+ end
108
+ subgraph Finance
109
+ Invoice[Raise invoice]
110
+ end
111
+ Browse --> Pay
112
+ Pay --> Pick
113
+ Pick --> Ship
114
+ Pay --> Invoice
115
+ ```
116
+
117
+ Passing the same two keys to `mermaid.initialize()` does it for every diagram on the page,
118
+ and scoping them to one diagram type — `mermaid.initialize({ swimlane: { theme: 'default', look: 'classic' } })` —
119
+ does it for that type alone.
120
+
121
+ ## Basic Example
19
122
 
20
123
  ```mermaid-example
21
124
  swimlane-beta LR
@@ -367,14 +367,20 @@ Mermaid supports a bunch of pre-defined themes which you can use to find the rig
367
367
 
368
368
  The following are the different pre-defined theme options:
369
369
 
370
- - `base`
371
- - `forest`
372
- - `dark`
370
+ - `redux-color` (the default)
371
+ - `redux-dark-color`
372
+ - `redux`
373
+ - `redux-dark`
373
374
  - `default`
374
375
  - `neutral`
376
+ - `dark`
377
+ - `forest`
378
+ - `neo`
379
+ - `neo-dark`
380
+ - `base`
375
381
 
376
382
  **NOTE**: To change theme you can either use the `initialize` call or _directives_. Learn more about [directives](../config/directives.md)
377
- Let's put them to use, and see how our sample diagram looks in different themes:
383
+ Let's put a few of them to use, and see how our sample diagram looks in different themes:
378
384
 
379
385
  ### Base Theme
380
386
 
@@ -484,7 +490,7 @@ config:
484
490
  2010 : Pinterest
485
491
  ```
486
492
 
487
- ### Default Theme
493
+ ### The `default` Theme
488
494
 
489
495
  ```mermaid-example
490
496
  ---
@@ -564,7 +570,7 @@ You can use this method to add mermaid including the timeline diagram to a web p
564
570
 
565
571
  ```html
566
572
  <script type="module">
567
- import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
573
+ import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@12/dist/mermaid.esm.min.mjs';
568
574
  </script>
569
575
  ```
570
576