From f5555245f913acea115ec0b3a4cdc8d8d997fe64 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Fri, 2 Feb 2024 08:53:29 +0100 Subject: [PATCH 01/32] Mermaid version 10.8.0 --- .../{block.spec.ts => block.spec.js} | 0 packages/mermaid/package.json | 2 +- .../src/docs/community/contributing.md | 2 +- pnpm-lock.yaml | 96 +++++++++++++++---- 4 files changed, 79 insertions(+), 21 deletions(-) rename cypress/integration/rendering/{block.spec.ts => block.spec.js} (100%) diff --git a/cypress/integration/rendering/block.spec.ts b/cypress/integration/rendering/block.spec.js similarity index 100% rename from cypress/integration/rendering/block.spec.ts rename to cypress/integration/rendering/block.spec.js diff --git a/packages/mermaid/package.json b/packages/mermaid/package.json index 551e44ed9..6df479481 100644 --- a/packages/mermaid/package.json +++ b/packages/mermaid/package.json @@ -1,6 +1,6 @@ { "name": "mermaid", - "version": "10.7.0", + "version": "10.8.0", "description": "Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.", "type": "module", "module": "./dist/mermaid.core.mjs", diff --git a/packages/mermaid/src/docs/community/contributing.md b/packages/mermaid/src/docs/community/contributing.md index 9a83b5294..153fdc6af 100644 --- a/packages/mermaid/src/docs/community/contributing.md +++ b/packages/mermaid/src/docs/community/contributing.md @@ -371,7 +371,7 @@ If the users have no way to know that things have changed, then you haven't real Likewise, if users don't know that there is a new feature that you've implemented, it will forever remain unknown and unused. The documentation has to be updated for users to know that things have been changed and added! -If you are adding a new feature, add `(v+)` in the title or description. It will be replaced automatically with the current version number when the release happens. +If you are adding a new feature, add `(v10.8.0+)` in the title or description. It will be replaced automatically with the current version number when the release happens. eg: `# Feature Name (v+)` diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9b065ff49..c48a18b4c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -517,8 +517,8 @@ importers: specifier: ^0.17.0 version: 0.17.0(vite@4.5.0)(workbox-build@7.0.0)(workbox-window@7.0.0) vitepress: - specifier: 1.0.0-rc.40 - version: 1.0.0-rc.40(@algolia/client-search@4.19.1)(@types/node@20.11.10)(postcss@8.4.33)(search-insights@2.7.0)(typescript@5.1.6) + specifier: 1.0.0-rc.39 + version: 1.0.0-rc.39(@algolia/client-search@4.19.1)(@types/node@20.11.10)(postcss@8.4.33)(search-insights@2.7.0)(typescript@5.1.6) workbox-window: specifier: ^7.0.0 version: 7.0.0 @@ -5992,7 +5992,7 @@ packages: /@vueuse/shared@10.1.0(vue@3.3.4): resolution: {integrity: sha512-2X52ogu12i9DkKOQ01yeb/BKg9UO87RNnpm5sXkQvyORlbq8ONS5l39MYkjkeVWWjdT0teJru7a2S41dmHmqjQ==} dependencies: - vue-demi: 0.14.5(vue@3.3.4) + vue-demi: 0.14.6(vue@3.3.4) transitivePeerDependencies: - '@vue/composition-api' - vue @@ -12850,6 +12850,7 @@ packages: resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + dev: false /nanoid@3.3.7: resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} @@ -13659,7 +13660,7 @@ packages: resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} engines: {node: ^10 || ^12 || >=14} dependencies: - nanoid: 3.3.6 + nanoid: 3.3.7 picocolors: 1.0.0 source-map-js: 1.0.2 @@ -14571,18 +14572,34 @@ packages: resolution: {integrity: sha512-9Of8HMlF96usXJHmCL3Gd0Fcf0EcyJUF9m8EoAKKd98mHXi0La2AZl1h6PegSFGtiYcBDK/fLuKbDa1l16r1fA==} dev: true + /shikiji-core@0.9.19: + resolution: {integrity: sha512-AFJu/vcNT21t0e6YrfadZ+9q86gvPum6iywRyt1OtIPjPFe25RQnYJyxHQPMLKCCWA992TPxmEmbNcOZCAJclw==} + dev: true + /shikiji-transformers@0.10.2: resolution: {integrity: sha512-7IVTwl1af205ywYEq5bOAYOTOFW4V1dVX1EablP0nWKErqZeD1o93VMytxmtJomqS+YwbB8doY8SE3MFMn0aPQ==} dependencies: shikiji: 0.10.2 dev: true + /shikiji-transformers@0.9.19: + resolution: {integrity: sha512-lGLI7Z8frQrIBbhZ74/eiJtxMoCQRbpaHEB+gcfvdIy+ZFaAtXncJGnc52932/UET+Y4GyKtwwC/vjWUCp+c/Q==} + dependencies: + shikiji: 0.9.19 + dev: true + /shikiji@0.10.2: resolution: {integrity: sha512-wtZg3T0vtYV2PnqusWQs3mDaJBdCPWxFDrBM/SE5LfrX92gjUvfEMlc+vJnoKY6Z/S44OWaCRzNIsdBRWcTAiw==} dependencies: shikiji-core: 0.10.2 dev: true + /shikiji@0.9.19: + resolution: {integrity: sha512-Kw2NHWktdcdypCj1GkKpXH4o6Vxz8B8TykPlPuLHOGSV8VkhoCLcFOH4k19K4LXAQYRQmxg+0X/eM+m2sLhAkg==} + dependencies: + shikiji-core: 0.9.19 + dev: true + /side-channel@1.0.4: resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} dependencies: @@ -16205,6 +16222,62 @@ packages: vue: 3.4.15(typescript@5.0.4) dev: true + /vitepress@1.0.0-rc.39(@algolia/client-search@4.19.1)(@types/node@20.11.10)(postcss@8.4.33)(search-insights@2.7.0)(typescript@5.1.6): + resolution: {integrity: sha512-EcgoRlAAp37WOxUOYv45oxyhLrcy3Upey+mKpqW3ldsg6Ol4trPndRBk2GO0QiSvEKlb9BMerk49D/bFICN6kg==} + hasBin: true + peerDependencies: + markdown-it-mathjax3: ^4.3.2 + postcss: ^8.4.33 + peerDependenciesMeta: + markdown-it-mathjax3: + optional: true + postcss: + optional: true + dependencies: + '@docsearch/css': 3.5.2 + '@docsearch/js': 3.5.2(@algolia/client-search@4.19.1)(search-insights@2.7.0) + '@types/markdown-it': 13.0.7 + '@vitejs/plugin-vue': 5.0.3(vite@5.0.12)(vue@3.4.15) + '@vue/devtools-api': 6.5.1 + '@vueuse/core': 10.7.2(vue@3.4.15) + '@vueuse/integrations': 10.7.2(focus-trap@7.5.4)(vue@3.4.15) + focus-trap: 7.5.4 + mark.js: 8.11.1 + minisearch: 6.3.0 + postcss: 8.4.33 + shikiji: 0.9.19 + shikiji-core: 0.9.19 + shikiji-transformers: 0.9.19 + vite: 5.0.12(@types/node@20.11.10) + vue: 3.4.15(typescript@5.1.6) + transitivePeerDependencies: + - '@algolia/client-search' + - '@types/node' + - '@types/react' + - '@vue/composition-api' + - async-validator + - axios + - change-case + - drauu + - fuse.js + - idb-keyval + - jwt-decode + - less + - lightningcss + - nprogress + - qrcode + - react + - react-dom + - sass + - search-insights + - sortablejs + - stylus + - sugarss + - terser + - typescript + - universal-cookie + dev: true + /vitepress@1.0.0-rc.40(@algolia/client-search@4.19.1)(@types/node@20.11.10)(postcss@8.4.33)(search-insights@2.7.0)(typescript@5.1.6): resolution: {integrity: sha512-1x9PCrcsJwqhpccyTR93uD6jpiPDeRC98CBCAQLLBb44a3VSXYBPzhCahi+2kwAYylu49p0XhseMPVM4IVcWcw==} hasBin: true @@ -16417,21 +16490,6 @@ packages: resolution: {integrity: sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA==} dev: true - /vue-demi@0.14.5(vue@3.3.4): - resolution: {integrity: sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==} - engines: {node: '>=12'} - hasBin: true - requiresBuild: true - peerDependencies: - '@vue/composition-api': ^1.0.0-rc.1 - vue: ^3.0.0-0 || ^2.6.0 - peerDependenciesMeta: - '@vue/composition-api': - optional: true - dependencies: - vue: 3.3.4 - dev: false - /vue-demi@0.14.6(vue@3.3.4): resolution: {integrity: sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==} engines: {node: '>=12'} From 2fa921935326a78a093b028048428e304875ee46 Mon Sep 17 00:00:00 2001 From: knsv Date: Fri, 2 Feb 2024 07:56:48 +0000 Subject: [PATCH 02/32] Update docs --- docs/community/contributing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/community/contributing.md b/docs/community/contributing.md index d6afbd90d..badd821d0 100644 --- a/docs/community/contributing.md +++ b/docs/community/contributing.md @@ -370,7 +370,7 @@ If the users have no way to know that things have changed, then you haven't real Likewise, if users don't know that there is a new feature that you've implemented, it will forever remain unknown and unused. The documentation has to be updated for users to know that things have been changed and added! -If you are adding a new feature, add `(v+)` in the title or description. It will be replaced automatically with the current version number when the release happens. +If you are adding a new feature, add `(v10.8.0+)` in the title or description. It will be replaced automatically with the current version number when the release happens. eg: `# Feature Name (v+)` From 51e7444b94ab0b872eaabc3b138184b47442fab4 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Fri, 2 Feb 2024 11:10:42 +0100 Subject: [PATCH 03/32] #3358 Layoutfix for growing parent when children spans new rows due to updated columns widths --- packages/mermaid/src/diagrams/block/layout.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/mermaid/src/diagrams/block/layout.ts b/packages/mermaid/src/diagrams/block/layout.ts index a9d32d2d2..b16b9971e 100644 --- a/packages/mermaid/src/diagrams/block/layout.ts +++ b/packages/mermaid/src/diagrams/block/layout.ts @@ -122,7 +122,10 @@ function setBlockSizes(block: Block, db: BlockDB, siblingWidth = 0, siblingHeigh } const columns = block.columns || -1; - const numItems = block.children.length; + let numItems = 0; + for (const child of block.children) { + numItems += child.widthInColumns || 1; + } // The width and height in number blocks let xSize = block.children.length; From 3fe7e2dfe878ac4a84b4d8033c655022ef21c74b Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Fri, 2 Feb 2024 11:30:29 +0100 Subject: [PATCH 04/32] Updated contributions file --- docs/community/contributing.md | 2 +- packages/mermaid/src/docs/community/contributing.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/community/contributing.md b/docs/community/contributing.md index badd821d0..368ab6a6a 100644 --- a/docs/community/contributing.md +++ b/docs/community/contributing.md @@ -372,7 +372,7 @@ Likewise, if users don't know that there is a new feature that you've implemente The documentation has to be updated for users to know that things have been changed and added! If you are adding a new feature, add `(v10.8.0+)` in the title or description. It will be replaced automatically with the current version number when the release happens. -eg: `# Feature Name (v+)` +eg: `# Feature Name (v10.8.0+)` We know it can sometimes be hard to code _and_ write user documentation. diff --git a/packages/mermaid/src/docs/community/contributing.md b/packages/mermaid/src/docs/community/contributing.md index 153fdc6af..7d8aafa4c 100644 --- a/packages/mermaid/src/docs/community/contributing.md +++ b/packages/mermaid/src/docs/community/contributing.md @@ -373,7 +373,7 @@ Likewise, if users don't know that there is a new feature that you've implemente The documentation has to be updated for users to know that things have been changed and added! If you are adding a new feature, add `(v10.8.0+)` in the title or description. It will be replaced automatically with the current version number when the release happens. -eg: `# Feature Name (v+)` +eg: `# Feature Name (v10.8.0+)` We know it can sometimes be hard to code _and_ write user documentation. From 6682988403ad3612bd20446d48019c69165e0a51 Mon Sep 17 00:00:00 2001 From: futzmonitor Date: Sun, 4 Feb 2024 11:25:40 -0500 Subject: [PATCH 05/32] Changes to intro.md 1. Added a link to the Discord server --- docs/community/intro.md | 2 ++ packages/mermaid/src/docs/community/intro.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/community/intro.md b/docs/community/intro.md index 9f515f8c0..ceecab7bf 100644 --- a/docs/community/intro.md +++ b/docs/community/intro.md @@ -45,6 +45,8 @@ Where to start: [Join our slack community if you want closer contact!](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE) +[You can also join our Discord server!](https://discord.gg/vVDmXwhpaS) + ## A Question Or a Suggestion? > **💡 Tip** > **Have a look at** [**how to open an issue**](./questions-and-suggestions.md). diff --git a/packages/mermaid/src/docs/community/intro.md b/packages/mermaid/src/docs/community/intro.md index e700fde45..7e49f657a 100644 --- a/packages/mermaid/src/docs/community/intro.md +++ b/packages/mermaid/src/docs/community/intro.md @@ -41,6 +41,8 @@ Where to start: [Join our slack community if you want closer contact!](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE) +[You can also join our Discord server!](https://discord.gg/vVDmXwhpaS) + ## A Question Or a Suggestion? ```tip From c45f39e819229ce03cdbea33555d70cebc699e22 Mon Sep 17 00:00:00 2001 From: futzmonitor Date: Mon, 5 Feb 2024 09:19:31 -0500 Subject: [PATCH 06/32] Changes to intro.md 1. Removed the Slack invite and left only the Discord invite --- docs/community/intro.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/community/intro.md b/docs/community/intro.md index ceecab7bf..362ed8396 100644 --- a/docs/community/intro.md +++ b/docs/community/intro.md @@ -43,9 +43,7 @@ Where to start: - You could work on a new feature! [These](https://github.com/mermaid-js/mermaid/issues?q=is%3Aissue+is%3Aopen+label%3A%22Area%3A+Development%22+label%3A%22Type%3A+Enhancement%22+label%3A%22Status%3A+Approved%22+) are some ideas! - You could confirm the bugs in [these issues](https://github.com/mermaid-js/mermaid/issues?q=is%3Aissue+is%3Aopen+label%3A%22Status%3A+Triage%22++label%3A%22Type%3A+Bug+%2F+Error%22). -[Join our slack community if you want closer contact!](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE) - -[You can also join our Discord server!](https://discord.gg/vVDmXwhpaS) +[Join our Discord server for closer contact!](https://discord.gg/vVDmXwhpaS) ## A Question Or a Suggestion? From ec7591bfa8723265bf7f45517da116e3adc2eb15 Mon Sep 17 00:00:00 2001 From: futzmonitor Date: Tue, 6 Feb 2024 09:48:39 -0500 Subject: [PATCH 07/32] Changes to intro.md 1. Removed the Slack link 2. Updated the Discord invite link --- docs/community/intro.md | 4 ++-- packages/mermaid/src/docs/community/intro.md | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/community/intro.md b/docs/community/intro.md index 362ed8396..e14c84696 100644 --- a/docs/community/intro.md +++ b/docs/community/intro.md @@ -43,7 +43,7 @@ Where to start: - You could work on a new feature! [These](https://github.com/mermaid-js/mermaid/issues?q=is%3Aissue+is%3Aopen+label%3A%22Area%3A+Development%22+label%3A%22Type%3A+Enhancement%22+label%3A%22Status%3A+Approved%22+) are some ideas! - You could confirm the bugs in [these issues](https://github.com/mermaid-js/mermaid/issues?q=is%3Aissue+is%3Aopen+label%3A%22Status%3A+Triage%22++label%3A%22Type%3A+Bug+%2F+Error%22). -[Join our Discord server for closer contact!](https://discord.gg/vVDmXwhpaS) +[You can join our Discord server if you want closer contact!](https://discord.gg/AgrbSrBer3) ## A Question Or a Suggestion? @@ -55,6 +55,6 @@ If you have faced a vulnerability [report it to us](./security.md). Don't get daunted if it is hard in the beginning. We have a great community with only encouraging words. So, if you get stuck, ask for help and hints in the Slack forum. If you want to show off something good, show it off there. -[Join our Slack community if you want closer contact!](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE) +[You can join our Discord server if you want closer contact!](https://discord.gg/AgrbSrBer3) ![Image of superhero wishing you good luck](https://media.giphy.com/media/l49JHz7kJvl6MCj3G/giphy.gif) diff --git a/packages/mermaid/src/docs/community/intro.md b/packages/mermaid/src/docs/community/intro.md index 7e49f657a..a83b96380 100644 --- a/packages/mermaid/src/docs/community/intro.md +++ b/packages/mermaid/src/docs/community/intro.md @@ -39,9 +39,7 @@ Where to start: - You could work on a new feature! [These](https://github.com/mermaid-js/mermaid/issues?q=is%3Aissue+is%3Aopen+label%3A%22Area%3A+Development%22+label%3A%22Type%3A+Enhancement%22+label%3A%22Status%3A+Approved%22+) are some ideas! - You could confirm the bugs in [these issues](https://github.com/mermaid-js/mermaid/issues?q=is%3Aissue+is%3Aopen+label%3A%22Status%3A+Triage%22++label%3A%22Type%3A+Bug+%2F+Error%22). -[Join our slack community if you want closer contact!](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE) - -[You can also join our Discord server!](https://discord.gg/vVDmXwhpaS) +[You can join our Discord server if you want closer contact!](https://discord.gg/AgrbSrBer3) ## A Question Or a Suggestion? @@ -55,6 +53,6 @@ If you have faced a vulnerability [report it to us](./security.md). Don't get daunted if it is hard in the beginning. We have a great community with only encouraging words. So, if you get stuck, ask for help and hints in the Slack forum. If you want to show off something good, show it off there. -[Join our Slack community if you want closer contact!](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE) +[You can join our Discord server if you want closer contact!](https://discord.gg/AgrbSrBer3) ![Image of superhero wishing you good luck](https://media.giphy.com/media/l49JHz7kJvl6MCj3G/giphy.gif) From e21643229e4447699755b699e4d151471e549b2d Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Wed, 14 Feb 2024 12:12:49 +0530 Subject: [PATCH 08/32] feat: add name field to the actors --- demos/sequence.html | 7 +++++++ packages/mermaid/src/diagrams/common/commonTypes.ts | 1 + packages/mermaid/src/diagrams/common/svgDrawCommon.ts | 1 + packages/mermaid/src/diagrams/sequence/svgDraw.js | 2 ++ 4 files changed, 11 insertions(+) diff --git a/demos/sequence.html b/demos/sequence.html index 8eecae610..49d2d4285 100644 --- a/demos/sequence.html +++ b/demos/sequence.html @@ -187,6 +187,13 @@ Note left of Bob: Alice/Bob Note end +
+      sequenceDiagram
+        actor Alice
+        actor John
+        Alice-xJohn: Hello John, how are you?
+        John--xAlice: Great!
+