mermaid 13.0.0-alpha.0 → 13.0.0-alpha.2

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 (236) hide show
  1. package/README.md +6 -4
  2. package/THIRD_PARTY_NOTICES +225 -0
  3. package/dist/api.d.ts +19 -4
  4. package/dist/api.js +232 -73
  5. package/dist/bundled.d.ts +2 -0
  6. package/dist/bundled.js +8 -0
  7. package/dist/cdn-base.d.ts +19 -0
  8. package/dist/cdn-base.js +52 -0
  9. package/dist/chunks/chunk-2CLGP4R7.mjs +2 -0
  10. package/dist/chunks/chunk-2CLGP4R7.mjs.map +1 -0
  11. package/dist/chunks/chunk-2SBABYQO.mjs +6 -0
  12. package/dist/chunks/chunk-2SBABYQO.mjs.map +1 -0
  13. package/dist/chunks/chunk-3QHCWLG2.mjs +12 -0
  14. package/dist/chunks/chunk-3QHCWLG2.mjs.map +1 -0
  15. package/dist/chunks/chunk-3SMLKEUJ.mjs +6 -0
  16. package/dist/chunks/chunk-3SMLKEUJ.mjs.map +1 -0
  17. package/dist/chunks/chunk-7PKX7UKH.mjs +2 -0
  18. package/dist/chunks/chunk-7PKX7UKH.mjs.map +1 -0
  19. package/dist/chunks/chunk-B24N3EFY.mjs +2 -0
  20. package/dist/chunks/chunk-B24N3EFY.mjs.map +1 -0
  21. package/dist/chunks/chunk-BBQQRPRV.mjs +3 -0
  22. package/dist/chunks/chunk-BBQQRPRV.mjs.map +1 -0
  23. package/dist/chunks/chunk-BFIZPEAM.mjs +6 -0
  24. package/dist/chunks/chunk-BFIZPEAM.mjs.map +1 -0
  25. package/dist/chunks/chunk-DTOBFHMA.mjs +10 -0
  26. package/dist/chunks/chunk-DTOBFHMA.mjs.map +1 -0
  27. package/dist/chunks/chunk-DUKAL7EW.mjs +7 -0
  28. package/dist/chunks/chunk-DUKAL7EW.mjs.map +1 -0
  29. package/dist/chunks/chunk-FSN3B5SH.mjs +4 -0
  30. package/dist/chunks/chunk-FSN3B5SH.mjs.map +1 -0
  31. package/dist/chunks/chunk-FYF7T3FM.mjs +7 -0
  32. package/dist/chunks/chunk-FYF7T3FM.mjs.map +1 -0
  33. package/dist/chunks/chunk-G5JCFFZO.mjs +10 -0
  34. package/dist/chunks/chunk-G5JCFFZO.mjs.map +1 -0
  35. package/dist/chunks/chunk-HVRHH7BT.mjs +6 -0
  36. package/dist/chunks/chunk-HVRHH7BT.mjs.map +1 -0
  37. package/dist/chunks/chunk-ICB73T2E.mjs +25 -0
  38. package/dist/chunks/chunk-ICB73T2E.mjs.map +1 -0
  39. package/dist/chunks/chunk-IOHHGREU.mjs +3 -0
  40. package/dist/chunks/chunk-IOHHGREU.mjs.map +1 -0
  41. package/dist/chunks/chunk-IY435URU.mjs +2 -0
  42. package/dist/chunks/chunk-IY435URU.mjs.map +1 -0
  43. package/dist/chunks/chunk-J2CYG3BU.mjs +2 -0
  44. package/dist/chunks/chunk-J2CYG3BU.mjs.map +1 -0
  45. package/dist/chunks/chunk-JL46TWOM.mjs +13 -0
  46. package/dist/chunks/chunk-JL46TWOM.mjs.map +1 -0
  47. package/dist/chunks/chunk-JN7HU5Z4.mjs +6 -0
  48. package/dist/chunks/chunk-JN7HU5Z4.mjs.map +1 -0
  49. package/dist/chunks/chunk-KHWLAZE2.mjs +6 -0
  50. package/dist/chunks/chunk-KHWLAZE2.mjs.map +1 -0
  51. package/dist/chunks/chunk-MTHJHLUH.mjs +2 -0
  52. package/dist/chunks/chunk-MTHJHLUH.mjs.map +1 -0
  53. package/dist/chunks/chunk-NGL2KHQW.mjs +2 -0
  54. package/dist/chunks/chunk-NGL2KHQW.mjs.map +1 -0
  55. package/dist/chunks/chunk-NM2RNLMZ.mjs +5 -0
  56. package/dist/chunks/chunk-NM2RNLMZ.mjs.map +1 -0
  57. package/dist/chunks/chunk-RUW4Q76Y.mjs +7 -0
  58. package/dist/chunks/chunk-RUW4Q76Y.mjs.map +1 -0
  59. package/dist/chunks/chunk-SNYNP3PS.mjs +5 -0
  60. package/dist/chunks/chunk-SNYNP3PS.mjs.map +1 -0
  61. package/dist/chunks/chunk-TJOE3FON.mjs +8 -0
  62. package/dist/chunks/chunk-TJOE3FON.mjs.map +1 -0
  63. package/dist/chunks/chunk-VRD5GZ6G.mjs +9 -0
  64. package/dist/chunks/chunk-VRD5GZ6G.mjs.map +1 -0
  65. package/dist/chunks/chunk-WBKKKHXZ.mjs +8 -0
  66. package/dist/chunks/chunk-WBKKKHXZ.mjs.map +1 -0
  67. package/dist/chunks/chunk-WINJRA54.mjs +7 -0
  68. package/dist/chunks/chunk-WINJRA54.mjs.map +1 -0
  69. package/dist/chunks/chunk-WJD3LR33.mjs +5 -0
  70. package/dist/chunks/chunk-WJD3LR33.mjs.map +1 -0
  71. package/dist/chunks/chunk-X3UAU7VF.mjs +8 -0
  72. package/dist/chunks/chunk-X3UAU7VF.mjs.map +1 -0
  73. package/dist/chunks/chunk-X3VGHK3G.mjs +6 -0
  74. package/dist/chunks/chunk-X3VGHK3G.mjs.map +1 -0
  75. package/dist/chunks/chunk-ZOQOZJZV.mjs +2 -0
  76. package/dist/chunks/chunk-ZOQOZJZV.mjs.map +1 -0
  77. package/dist/chunks/chunk-ZVYEDT2M.mjs +3 -0
  78. package/dist/chunks/chunk-ZVYEDT2M.mjs.map +1 -0
  79. package/dist/chunks/core-layout-tree-index.mjs +2 -0
  80. package/dist/chunks/core-layout-tree-index.mjs.map +1 -0
  81. package/dist/chunks/core-theme-specs-base.mjs +2 -0
  82. package/dist/chunks/core-theme-specs-base.mjs.map +1 -0
  83. package/dist/chunks/core-theme-specs-dark.mjs +2 -0
  84. package/dist/chunks/core-theme-specs-dark.mjs.map +1 -0
  85. package/dist/chunks/core-theme-specs-default.mjs +2 -0
  86. package/dist/chunks/core-theme-specs-default.mjs.map +1 -0
  87. package/dist/chunks/core-theme-specs-forest.mjs +2 -0
  88. package/dist/chunks/core-theme-specs-forest.mjs.map +1 -0
  89. package/dist/chunks/core-theme-specs-neo-dark.mjs +2 -0
  90. package/dist/chunks/core-theme-specs-neo-dark.mjs.map +1 -0
  91. package/dist/chunks/core-theme-specs-neo.mjs +2 -0
  92. package/dist/chunks/core-theme-specs-neo.mjs.map +1 -0
  93. package/dist/chunks/core-theme-specs-neutral.mjs +2 -0
  94. package/dist/chunks/core-theme-specs-neutral.mjs.map +1 -0
  95. package/dist/chunks/core-theme-specs-redux-dark-color.mjs +2 -0
  96. package/dist/chunks/core-theme-specs-redux-dark-color.mjs.map +1 -0
  97. package/dist/chunks/core-theme-specs-redux-dark.mjs +2 -0
  98. package/dist/chunks/core-theme-specs-redux-dark.mjs.map +1 -0
  99. package/dist/chunks/diagram-class-language.mjs +30 -0
  100. package/dist/chunks/diagram-class-language.mjs.map +1 -0
  101. package/dist/chunks/diagram-class.mjs +2 -0
  102. package/dist/chunks/diagram-class.mjs.map +1 -0
  103. package/dist/chunks/diagram-cynefin-language.mjs +6 -0
  104. package/dist/chunks/diagram-cynefin-language.mjs.map +1 -0
  105. package/dist/chunks/diagram-cynefin.mjs +2 -0
  106. package/dist/chunks/diagram-cynefin.mjs.map +1 -0
  107. package/dist/chunks/diagram-er-ascii.mjs +5 -0
  108. package/dist/chunks/diagram-er-ascii.mjs.map +1 -0
  109. package/dist/chunks/diagram-er-language.mjs +23 -0
  110. package/dist/chunks/diagram-er-language.mjs.map +1 -0
  111. package/dist/chunks/diagram-er.mjs +2 -0
  112. package/dist/chunks/diagram-er.mjs.map +1 -0
  113. package/dist/chunks/diagram-flowchart-ascii.mjs +5 -0
  114. package/dist/chunks/diagram-flowchart-ascii.mjs.map +1 -0
  115. package/dist/chunks/diagram-flowchart-language.mjs +28 -0
  116. package/dist/chunks/diagram-flowchart-language.mjs.map +1 -0
  117. package/dist/chunks/diagram-flowchart.mjs +2 -0
  118. package/dist/chunks/diagram-flowchart.mjs.map +1 -0
  119. package/dist/chunks/diagram-gantt-language.mjs +12 -0
  120. package/dist/chunks/diagram-gantt-language.mjs.map +1 -0
  121. package/dist/chunks/diagram-gantt.mjs +2 -0
  122. package/dist/chunks/diagram-gantt.mjs.map +1 -0
  123. package/dist/chunks/diagram-gitgraph-language.mjs +22 -0
  124. package/dist/chunks/diagram-gitgraph-language.mjs.map +1 -0
  125. package/dist/chunks/diagram-gitgraph.mjs +3 -0
  126. package/dist/chunks/diagram-gitgraph.mjs.map +1 -0
  127. package/dist/chunks/diagram-info-ascii.mjs +2 -0
  128. package/dist/chunks/diagram-info-ascii.mjs.map +1 -0
  129. package/dist/chunks/diagram-info-language.mjs +4 -0
  130. package/dist/chunks/diagram-info-language.mjs.map +1 -0
  131. package/dist/chunks/diagram-info.mjs +2 -0
  132. package/dist/chunks/diagram-info.mjs.map +1 -0
  133. package/dist/chunks/diagram-journey-language.mjs +24 -0
  134. package/dist/chunks/diagram-journey-language.mjs.map +1 -0
  135. package/dist/chunks/diagram-journey.mjs +2 -0
  136. package/dist/chunks/diagram-journey.mjs.map +1 -0
  137. package/dist/chunks/diagram-kanban-ascii.mjs +4 -0
  138. package/dist/chunks/diagram-kanban-ascii.mjs.map +1 -0
  139. package/dist/chunks/diagram-kanban-language.mjs +20 -0
  140. package/dist/chunks/diagram-kanban-language.mjs.map +1 -0
  141. package/dist/chunks/diagram-kanban.mjs +2 -0
  142. package/dist/chunks/diagram-kanban.mjs.map +1 -0
  143. package/dist/chunks/diagram-mindmap-language.mjs +20 -0
  144. package/dist/chunks/diagram-mindmap-language.mjs.map +1 -0
  145. package/dist/chunks/diagram-mindmap.mjs +2 -0
  146. package/dist/chunks/diagram-mindmap.mjs.map +1 -0
  147. package/dist/chunks/diagram-packet-ascii.mjs +6 -0
  148. package/dist/chunks/diagram-packet-ascii.mjs.map +1 -0
  149. package/dist/chunks/diagram-packet-language.mjs +9 -0
  150. package/dist/chunks/diagram-packet-language.mjs.map +1 -0
  151. package/dist/chunks/diagram-packet.mjs +2 -0
  152. package/dist/chunks/diagram-packet.mjs.map +1 -0
  153. package/dist/chunks/diagram-pie-language.mjs +12 -0
  154. package/dist/chunks/diagram-pie-language.mjs.map +1 -0
  155. package/dist/chunks/diagram-pie.mjs +2 -0
  156. package/dist/chunks/diagram-pie.mjs.map +1 -0
  157. package/dist/chunks/diagram-quadrant-language.mjs +14 -0
  158. package/dist/chunks/diagram-quadrant-language.mjs.map +1 -0
  159. package/dist/chunks/diagram-quadrant.mjs +2 -0
  160. package/dist/chunks/diagram-quadrant.mjs.map +1 -0
  161. package/dist/chunks/diagram-radar-language.mjs +15 -0
  162. package/dist/chunks/diagram-radar-language.mjs.map +1 -0
  163. package/dist/chunks/diagram-radar.mjs +2 -0
  164. package/dist/chunks/diagram-radar.mjs.map +1 -0
  165. package/dist/chunks/diagram-sankey-language.mjs +14 -0
  166. package/dist/chunks/diagram-sankey-language.mjs.map +1 -0
  167. package/dist/chunks/diagram-sankey.mjs +2 -0
  168. package/dist/chunks/diagram-sankey.mjs.map +1 -0
  169. package/dist/chunks/diagram-sequence-ascii.mjs +4 -0
  170. package/dist/chunks/diagram-sequence-ascii.mjs.map +1 -0
  171. package/dist/chunks/diagram-sequence-language.mjs +15 -0
  172. package/dist/chunks/diagram-sequence-language.mjs.map +1 -0
  173. package/dist/chunks/diagram-sequence.mjs +2 -0
  174. package/dist/chunks/diagram-sequence.mjs.map +1 -0
  175. package/dist/chunks/diagram-state-language.mjs +23 -0
  176. package/dist/chunks/diagram-state-language.mjs.map +1 -0
  177. package/dist/chunks/diagram-state.mjs +4 -0
  178. package/dist/chunks/diagram-state.mjs.map +1 -0
  179. package/dist/chunks/diagram-timeline-language.mjs +4 -0
  180. package/dist/chunks/diagram-timeline-language.mjs.map +1 -0
  181. package/dist/chunks/diagram-timeline.mjs +2 -0
  182. package/dist/chunks/diagram-timeline.mjs.map +1 -0
  183. package/dist/chunks/diagram-treemap-language.mjs +23 -0
  184. package/dist/chunks/diagram-treemap-language.mjs.map +1 -0
  185. package/dist/chunks/diagram-treemap.mjs +2 -0
  186. package/dist/chunks/diagram-treemap.mjs.map +1 -0
  187. package/dist/chunks/diagram-venn-language.mjs +10 -0
  188. package/dist/chunks/diagram-venn-language.mjs.map +1 -0
  189. package/dist/chunks/diagram-venn.mjs +2 -0
  190. package/dist/chunks/diagram-venn.mjs.map +1 -0
  191. package/dist/chunks/diagram-wardley-language.mjs +17 -0
  192. package/dist/chunks/diagram-wardley-language.mjs.map +1 -0
  193. package/dist/chunks/diagram-wardley.mjs +2 -0
  194. package/dist/chunks/diagram-wardley.mjs.map +1 -0
  195. package/dist/chunks/diagram-xychart-language.mjs +13 -0
  196. package/dist/chunks/diagram-xychart-language.mjs.map +1 -0
  197. package/dist/chunks/diagram-xychart.mjs +2 -0
  198. package/dist/chunks/diagram-xychart.mjs.map +1 -0
  199. package/dist/chunks/mermaid-ascii.mjs +2 -0
  200. package/dist/chunks/mermaid-ascii.mjs.map +1 -0
  201. package/dist/config-snapshot.d.ts +11 -4
  202. package/dist/config-snapshot.js +23 -5
  203. package/dist/discovered.d.ts +11 -0
  204. package/dist/discovered.js +3 -0
  205. package/dist/discovery.d.ts +31 -0
  206. package/dist/discovery.js +24 -0
  207. package/dist/dom.js +4 -1
  208. package/dist/errors.d.ts +8 -1
  209. package/dist/errors.js +20 -0
  210. package/dist/exports.d.ts +2 -1
  211. package/dist/generated/detectors.gen.js +21 -21
  212. package/dist/generated/registry.gen.js +152 -21
  213. package/dist/icon-packs.d.ts +31 -0
  214. package/dist/icon-packs.js +64 -0
  215. package/dist/index.d.ts +11 -5
  216. package/dist/index.js +11 -2
  217. package/dist/measurer.d.ts +1 -1
  218. package/dist/measurer.js +4 -7
  219. package/dist/mermaid.esm.min.mjs +4 -0
  220. package/dist/mermaid.esm.min.mjs.map +1 -0
  221. package/dist/mermaid.min.js +2 -0
  222. package/dist/mermaid.min.js.map +1 -0
  223. package/dist/node-scan.d.ts +63 -0
  224. package/dist/node-scan.js +215 -0
  225. package/dist/node.d.ts +24 -0
  226. package/dist/node.js +166 -0
  227. package/dist/plugin-queue.d.ts +31 -0
  228. package/dist/plugin-queue.js +111 -0
  229. package/dist/registry.d.ts +170 -13
  230. package/dist/registry.js +585 -111
  231. package/dist/seam.d.ts +52 -0
  232. package/dist/seam.js +108 -0
  233. package/dist/slim.js +2 -1
  234. package/dist/version.d.ts +1 -1
  235. package/dist/version.js +1 -1
  236. package/package.json +41 -5
package/README.md CHANGED
@@ -8,7 +8,7 @@ Mermaid v13 renders without a browser DOM: in Node, Deno, web workers and browse
8
8
  ## Everything
9
9
 
10
10
  ```bash
11
- npm install mermaid@alpha --save-exact
11
+ npm install mermaid@v13-alpha --save-exact
12
12
  ```
13
13
 
14
14
  ```js
@@ -20,12 +20,14 @@ const { text } = await mermaid.render('id', 'flowchart LR\n A --> B', { format:
20
20
 
21
21
  Every first-party diagram type is included. Bundlers split each type into its own chunk, so a page downloads only the types it renders.
22
22
 
23
+ The size budget is in [`size-budget.json`](./size-budget.json): core, everything the `mermaid` entry loads before any diagram chunk, is at most 96 KB gzip, and core plus flowchart, as loaded for one flowchart render, at most 128 KB gzip.
24
+
23
25
  ## Pick your diagrams
24
26
 
25
- `mermaid/slim` is the same API without the first-party diagrams. Only the diagrams you pass in are bundled. Each package has its own version. The newest `mermaid@alpha` depends on the newest `@alpha` of each diagram package, so install them together:
27
+ `mermaid/slim` is the same API without the first-party diagrams. Only the diagrams you pass in are bundled. Each package has its own version. The newest `mermaid@v13-alpha` depends on the newest `@v13-alpha` of each diagram package, so install them together:
26
28
 
27
29
  ```bash
28
- npm install mermaid@alpha @mermaid-js/diagram-flowchart@alpha --save-exact
30
+ npm install mermaid@v13-alpha @mermaid-js/diagram-flowchart@v13-alpha --save-exact
29
31
  ```
30
32
 
31
33
  ```js
@@ -43,7 +45,7 @@ Other diagram types are still detected, and reject with an `UNSUPPORTED_DIAGRAM`
43
45
  ## Command line
44
46
 
45
47
  ```bash
46
- npx mermaid@alpha render diagram.mmd --format ascii
48
+ npx mermaid@v13-alpha render diagram.mmd --format ascii
47
49
  ```
48
50
 
49
51
  ## Feedback
@@ -31,3 +31,228 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31
31
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32
32
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33
33
  SOFTWARE.
34
+
35
+ d3-sankey
36
+ ---------
37
+
38
+ The CDN build (dist/mermaid.min.js, dist/mermaid.esm.min.mjs and its chunks) bundles
39
+ @mermaid-js/diagram-sankey without its legal comments. That package's layout/d3-sankey.ts
40
+ re-implements, step for step, d3-sankey's `sankey` layout and its four node aligns
41
+ (https://github.com/d3/d3-sankey, release 0.12.3). d3-sankey is used under the
42
+ BSD 3-Clause License:
43
+
44
+ Copyright 2015, Mike Bostock
45
+ All rights reserved.
46
+
47
+ Redistribution and use in source and binary forms, with or without modification,
48
+ are permitted provided that the following conditions are met:
49
+
50
+ * Redistributions of source code must retain the above copyright notice, this
51
+ list of conditions and the following disclaimer.
52
+
53
+ * Redistributions in binary form must reproduce the above copyright notice,
54
+ this list of conditions and the following disclaimer in the documentation
55
+ and/or other materials provided with the distribution.
56
+
57
+ * Neither the name of the author nor the names of contributors may be used to
58
+ endorse or promote products derived from this software without specific prior
59
+ written permission.
60
+
61
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
62
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
63
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
64
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
65
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
66
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
67
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
68
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
69
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
70
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
71
+
72
+ d3-array
73
+ --------
74
+
75
+ The same bundled file copies d3-array's `sum`, `min` and `max` with their semantics
76
+ (https://github.com/d3/d3-array, release 2.12.1). d3-array is used under the
77
+ BSD 3-Clause License:
78
+
79
+ Copyright 2010-2020 Mike Bostock
80
+ All rights reserved.
81
+
82
+ Redistribution and use in source and binary forms, with or without modification,
83
+ are permitted provided that the following conditions are met:
84
+
85
+ * Redistributions of source code must retain the above copyright notice, this
86
+ list of conditions and the following disclaimer.
87
+
88
+ * Redistributions in binary form must reproduce the above copyright notice,
89
+ this list of conditions and the following disclaimer in the documentation
90
+ and/or other materials provided with the distribution.
91
+
92
+ * Neither the name of the author nor the names of contributors may be used to
93
+ endorse or promote products derived from this software without specific prior
94
+ written permission.
95
+
96
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
97
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
98
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
99
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
100
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
101
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
102
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
103
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
104
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
105
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
106
+
107
+ d3-shape
108
+ --------
109
+
110
+ The bundled @mermaid-js/diagram-sankey's layout/layout.ts re-implements d3-shape's
111
+ `linkHorizontal` (https://github.com/d3/d3-shape, release 1.3.7). d3-shape is used under the
112
+ BSD 3-Clause License:
113
+
114
+ Copyright 2010-2015 Mike Bostock
115
+ All rights reserved.
116
+
117
+ Redistribution and use in source and binary forms, with or without modification,
118
+ are permitted provided that the following conditions are met:
119
+
120
+ * Redistributions of source code must retain the above copyright notice, this
121
+ list of conditions and the following disclaimer.
122
+
123
+ * Redistributions in binary form must reproduce the above copyright notice,
124
+ this list of conditions and the following disclaimer in the documentation
125
+ and/or other materials provided with the distribution.
126
+
127
+ * Neither the name of the author nor the names of contributors may be used to
128
+ endorse or promote products derived from this software without specific prior
129
+ written permission.
130
+
131
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
132
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
133
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
134
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
135
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
136
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
137
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
138
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
139
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
140
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
141
+
142
+ d3-hierarchy
143
+ ------------
144
+
145
+ The CDN build also bundles @mermaid-js/diagram-treemap without its legal comments. That
146
+ package's layout/tiles.ts and sum.ts re-implement, step for step, d3-hierarchy's `hierarchy`,
147
+ `sum`, `sort` and `treemap` with `treemapSquarify`, `treemapDice`, `treemapSlice` and
148
+ `treemapRound` (https://github.com/d3/d3-hierarchy, release 3.1.2). d3-hierarchy is used under
149
+ the ISC License:
150
+
151
+ ISC License
152
+
153
+ Copyright 2010-2021 Mike Bostock
154
+
155
+ Permission to use, copy, modify, and/or distribute this software for any purpose
156
+ with or without fee is hereby granted, provided that the above copyright notice
157
+ and this permission notice appear in all copies.
158
+
159
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
160
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
161
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
162
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
163
+ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
164
+ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
165
+ THIS SOFTWARE.
166
+
167
+ d3-format
168
+ ---------
169
+
170
+ The same package's format/d3-format.ts re-implements d3-format's `format` in its default
171
+ locale (https://github.com/d3/d3-format, release 3.1.2). d3-format is used under the ISC
172
+ License:
173
+
174
+ ISC License
175
+
176
+ Copyright 2010-2026 Mike Bostock
177
+
178
+ Permission to use, copy, modify, and/or distribute this software for any purpose
179
+ with or without fee is hereby granted, provided that the above copyright notice
180
+ and this permission notice appear in all copies.
181
+
182
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
183
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
184
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
185
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
186
+ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
187
+ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
188
+ THIS SOFTWARE.
189
+
190
+ venn.js
191
+ -------
192
+
193
+ The CDN build also bundles @mermaid-js/diagram-venn without its legal comments. That
194
+ package's solver (solver/circles.ts, fmin.ts, index.ts, normalize.ts, regions.ts and solve.ts)
195
+ is ported from venn.js's area-proportional circle layout, circle intersection areas, solution
196
+ normalising and scaling, text centres and region paths (https://github.com/upsetjs/venn.js,
197
+ release 2.0.0). venn.js is used under the MIT License:
198
+
199
+ MIT License
200
+
201
+ Copyright (c) 2013 Ben Frederickson
202
+ Copyright (c) 2021 Samuel Gratzl
203
+
204
+ Permission is hereby granted, free of charge, to any person obtaining a copy
205
+ of this software and associated documentation files (the "Software"), to deal
206
+ in the Software without restriction, including without limitation the rights
207
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
208
+ copies of the Software, and to permit persons to whom the Software is
209
+ furnished to do so, subject to the following conditions:
210
+
211
+ The above copyright notice and this permission notice shall be included in all
212
+ copies or substantial portions of the Software.
213
+
214
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
215
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
216
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
217
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
218
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
219
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
220
+ SOFTWARE.
221
+
222
+ fmin
223
+ ----
224
+
225
+ The same package's solver/fmin.ts is ported from fmin's `bisect`, `nelderMead` and
226
+ `conjugateGradient` with its Wolfe line search, as venn.js 2.0.0 bundles them
227
+ (https://github.com/benfred/fmin, release 0.0.4). fmin is used under the
228
+ BSD 3-Clause License:
229
+
230
+ BSD 3-Clause License
231
+
232
+ Copyright 2016, Ben Frederickson
233
+ All rights reserved.
234
+
235
+ Redistribution and use in source and binary forms, with or without modification,
236
+ are permitted provided that the following conditions are met:
237
+
238
+ * Redistributions of source code must retain the above copyright notice, this
239
+ list of conditions and the following disclaimer.
240
+
241
+ * Redistributions in binary form must reproduce the above copyright notice,
242
+ this list of conditions and the following disclaimer in the documentation
243
+ and/or other materials provided with the distribution.
244
+
245
+ * Neither the name of the author nor the names of contributors may be used to
246
+ endorse or promote products derived from this software without specific prior
247
+ written permission.
248
+
249
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
250
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
251
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
252
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
253
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
254
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
255
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
256
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
257
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
258
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/dist/api.d.ts CHANGED
@@ -8,6 +8,7 @@ import { MermaidError, type ExtensionPlugin as CoreExtensionPlugin, type Warning
8
8
  import { type MermaidConfig, type ResolvedConfig } from '@mermaid-js/core/config';
9
9
  import type { ParseResult } from '@mermaid-js/core/parser-kit';
10
10
  import { type InitializeConfig } from './config-snapshot.ts';
11
+ import { type IconLoader } from './icon-packs.ts';
11
12
  import { type ExternalDiagram, type FirstPartyEntry, type LayoutLoader } from './registry.ts';
12
13
  export type { InitializeConfig, IntegratorOptions } from './config-snapshot.ts';
13
14
  export { defaultIdPrefix } from './config-snapshot.ts';
@@ -34,6 +35,12 @@ export interface RenderOptions {
34
35
  * element's width. SVG only: text output fits `ascii.maxWidth` columns instead (D84).
35
36
  */
36
37
  availableWidth?: number;
38
+ /**
39
+ * The instant the diagram treats as now (D270): gantt's `today` line and `today`-relative
40
+ * dates. Defaults to `Date.now()` at each call (D275). Not a config key: diagram text
41
+ * cannot set it.
42
+ */
43
+ now?: number | Date;
37
44
  }
38
45
  /** Options of an SVG render (`format` absent or `svg`). */
39
46
  export interface SvgRenderOptions extends RenderOptions {
@@ -121,8 +128,12 @@ export interface PreloadRequest {
121
128
  themes?: readonly string[];
122
129
  /** `'ascii'` also loads each type's text entry, for `renderSync(…, { format: 'ascii' })`. */
123
130
  formats?: readonly ('svg' | 'ascii')[];
124
- /** Accepted and ignored until the icons plugin exists. */
131
+ /**
132
+ * Runs these packs' loaders (`registerIconPacks`), for `renderSync` with their icons (D294).
133
+ * An unregistered name is ignored; a rejecting loader does not reject (D299).
134
+ */
125
135
  iconPacks?: readonly string[];
136
+ /** Loads what a registered math extension provides, for `renderSync` with `$$…$$` (D178). */
126
137
  math?: boolean;
127
138
  }
128
139
  /** @deprecated v12 compatibility: receives the `MermaidError` of a failed `parse`. */
@@ -132,7 +143,10 @@ export type ParseErrorHandler = (error: MermaidError) => void;
132
143
  * `firstParty` in its order. `mermaid` passes the generated table with loaders, `mermaid/slim`
133
144
  * the detectors with only the integrator's diagrams loadable.
134
145
  */
135
- export declare function createMermaid(firstParty: readonly FirstPartyEntry[]): {
146
+ export declare function createMermaid(firstParty: readonly FirstPartyEntry[], firstPartyNames?: readonly {
147
+ readonly type: string;
148
+ readonly id?: string;
149
+ }[]): {
136
150
  render: {
137
151
  (id: string, text: string, options: TextRenderOptions): Promise<TextRenderResult>;
138
152
  (id: string, text: string, containerOrOptions?: Element | SvgRenderOptions): Promise<RenderResult>;
@@ -155,11 +169,12 @@ export declare function createMermaid(firstParty: readonly FirstPartyEntry[]): {
155
169
  contentLoaded: () => void;
156
170
  detectType: (text: string, config?: MermaidConfig) => string;
157
171
  supportsFormat: (type: string, format: "svg" | "ascii") => boolean;
158
- registerExternalDiagrams: (diagrams: readonly ExternalDiagram[], { lazyLoad }?: {
172
+ registerExternalDiagrams: (diagrams: readonly ExternalDiagram[], { lazyLoad, replace }?: {
159
173
  lazyLoad?: boolean;
174
+ replace?: boolean;
160
175
  }) => Promise<void>;
161
176
  registerLayoutLoaders: (loaders: readonly LayoutLoader[]) => void;
162
- registerIconPacks: (...packs: unknown[]) => void;
177
+ registerIconPacks: (packs: readonly IconLoader[]) => void;
163
178
  setParseErrorHandler: (handler: ParseErrorHandler) => void;
164
179
  };
165
180
  export type Mermaid = ReturnType<typeof createMermaid>;