From d1b386b5c93d47b913d45f3172e2f46629fb3cbe Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 11 Oct 2023 11:32:24 +0530 Subject: [PATCH 1/4] Revert PH changes (#4903) --- packages/mermaid/src/docs/.vitepress/theme/index.ts | 7 ++++--- packages/mermaid/src/docs/index.md | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/mermaid/src/docs/.vitepress/theme/index.ts b/packages/mermaid/src/docs/.vitepress/theme/index.ts index ae626558db..6561578106 100644 --- a/packages/mermaid/src/docs/.vitepress/theme/index.ts +++ b/packages/mermaid/src/docs/.vitepress/theme/index.ts @@ -6,8 +6,8 @@ import Mermaid from './Mermaid.vue'; import Contributors from '../components/Contributors.vue'; // @ts-ignore import HomePage from '../components/HomePage.vue'; -// @ts-ignore -import TopBar from '../components/TopBar.vue'; +// // @ts-ignore +// import TopBar from '../components/TopBar.vue'; import { getRedirect } from './redirect.js'; @@ -21,7 +21,8 @@ export default { ...DefaultTheme, Layout() { return h(Theme.Layout, null, { - 'home-hero-before': () => h(TopBar), + // Keeping this as comment as it took a lot of time to figure out how to add a component to the top bar. + // 'home-hero-before': () => h(TopBar), 'home-features-after': () => h(HomePage), }); }, diff --git a/packages/mermaid/src/docs/index.md b/packages/mermaid/src/docs/index.md index 378e9dfaba..218757b104 100644 --- a/packages/mermaid/src/docs/index.md +++ b/packages/mermaid/src/docs/index.md @@ -31,7 +31,7 @@ features: - title: 🏆 Award winning! details: 2019 JavaScript Open Source Award winner for "The Most Exciting Use of Technology". link: https://osawards.com/javascript/2019 - - title: 🎉 We are on Product Hunt! - details: We would love any and all support from the Mermaid community! - link: https://www.producthunt.com/posts/mermaid-chart + - title: 🥰 Mermaid + Mermaid Chart + details: Mermaid Chart is a major supporter of the Mermaid project. + link: https://www.mermaidchart.com/ --- From 61bc293a950d8bf9f5ff1208a94a4800cd46d332 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Fri, 20 Oct 2023 11:12:56 +0200 Subject: [PATCH 2/4] #4967 Reverting optimimization that breaks subgraphs --- cypress/platform/knsv2.html | 6 ++++-- .../mermaid/src/diagrams/flowchart/elk/flowRenderer-elk.js | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cypress/platform/knsv2.html b/cypress/platform/knsv2.html index 6ade6a2e5c..13094644bd 100644 --- a/cypress/platform/knsv2.html +++ b/cypress/platform/knsv2.html @@ -58,8 +58,10 @@
-      classDiagram
-  `Class` <|-- `Class2`
+flowchart-elk LR
+   subgraph example
+     node
+   end
     
 flowchart
diff --git a/packages/mermaid/src/diagrams/flowchart/elk/flowRenderer-elk.js b/packages/mermaid/src/diagrams/flowchart/elk/flowRenderer-elk.js
index 737b492fb3..ce2bbc002b 100644
--- a/packages/mermaid/src/diagrams/flowchart/elk/flowRenderer-elk.js
+++ b/packages/mermaid/src/diagrams/flowchart/elk/flowRenderer-elk.js
@@ -803,8 +803,14 @@ const insertChildren = (nodeArray, parentLookupDb) => {
  */
 
 export const draw = async function (text, id, _version, diagObj) {
+  // Add temporary render element
+  diagObj.db.clear();
   nodeDb = {};
   portPos = {};
+  diagObj.db.setGen('gen-2');
+  // Parse the graph definition
+  diagObj.parser.parse(text);
+
   const renderEl = select('body').append('div').attr('style', 'height:400px').attr('id', 'cy');
   let graph = {
     id: 'root',

From aaf0b474d498239bd430be0438523699237fd516 Mon Sep 17 00:00:00 2001
From: Per Brolin 
Date: Fri, 20 Oct 2023 14:18:07 +0200
Subject: [PATCH 3/4] Increased version to 10.5.1

---
 packages/mermaid/package.json | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/packages/mermaid/package.json b/packages/mermaid/package.json
index 10bb672706..608d19dbf1 100644
--- a/packages/mermaid/package.json
+++ b/packages/mermaid/package.json
@@ -1,6 +1,6 @@
 {
   "name": "mermaid",
-  "version": "10.5.0",
+  "version": "10.5.1",
   "description": "Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
   "type": "module",
   "module": "./dist/mermaid.core.mjs",
@@ -133,4 +133,4 @@
   "publishConfig": {
     "access": "public"
   }
-}
+}
\ No newline at end of file

From b70959daa7666d25416ab3c4b89ffbc328927d20 Mon Sep 17 00:00:00 2001
From: Knut Sveidqvist 
Date: Fri, 20 Oct 2023 14:30:52 +0200
Subject: [PATCH 4/4] Version 10.5.1

---
 packages/mermaid/package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/packages/mermaid/package.json b/packages/mermaid/package.json
index 608d19dbf1..cf2bacf3a3 100644
--- a/packages/mermaid/package.json
+++ b/packages/mermaid/package.json
@@ -133,4 +133,4 @@
   "publishConfig": {
     "access": "public"
   }
-}
\ No newline at end of file
+}