diff --git a/.changeset/add-vert-tag-bar-chart.md b/.changeset/add-vert-tag-bar-chart.md deleted file mode 100644 index 4ab74059c..000000000 --- a/.changeset/add-vert-tag-bar-chart.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'mermaid': minor ---- - -feat: Add Vertical Line To Gantt Plot At Specified Time diff --git a/.changeset/bitter-colts-remain.md b/.changeset/bitter-colts-remain.md deleted file mode 100644 index 9952779c9..000000000 --- a/.changeset/bitter-colts-remain.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mermaid-js/mermaid-zenuml': major ---- - -Upgraded the dependency @zenuml/core diff --git a/.changeset/curly-coats-tell.md b/.changeset/curly-coats-tell.md deleted file mode 100644 index 65672267c..000000000 --- a/.changeset/curly-coats-tell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'mermaid': patch ---- - -Fix stroke styles for ER diagram to correctly apply path and row-specific styles diff --git a/.changeset/eleven-wolves-deny.md b/.changeset/eleven-wolves-deny.md deleted file mode 100644 index 76bb69ec5..000000000 --- a/.changeset/eleven-wolves-deny.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'mermaid': patch ---- - -chore: Convert StateDB into TypeScript diff --git a/.changeset/gold-shoes-camp.md b/.changeset/gold-shoes-camp.md deleted file mode 100644 index 3018e7381..000000000 --- a/.changeset/gold-shoes-camp.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'mermaid': patch ---- - -fix: Remove incorrect `style="undefined;"` attributes in some Mermaid diagrams diff --git a/.changeset/honest-trees-dress.md b/.changeset/honest-trees-dress.md deleted file mode 100644 index 054f1bedb..000000000 --- a/.changeset/honest-trees-dress.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@mermaid-js/mermaid-zenuml': patch ---- - -chore: bump minimum ZenUML version to 3.23.28 - -commit: 9d06d8f31e7f12af9e9e092214f907f2dc93ad75 diff --git a/.changeset/neat-moose-compare.md b/.changeset/neat-moose-compare.md deleted file mode 100644 index 98a064789..000000000 --- a/.changeset/neat-moose-compare.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'mermaid': minor ---- - -feat: Add support for styling Journey Diagram title (color, font-family, and font-size) diff --git a/.changeset/proud-seahorses-wash.md b/.changeset/proud-seahorses-wash.md deleted file mode 100644 index 8b844b679..000000000 --- a/.changeset/proud-seahorses-wash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'mermaid': patch ---- - -FontAwesome icons can now be embedded as SVGs in flowcharts if they are registered via `mermaid.registerIconPacks`. diff --git a/.changeset/public-things-stare.md b/.changeset/public-things-stare.md deleted file mode 100644 index f6dc515ee..000000000 --- a/.changeset/public-things-stare.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'mermaid': minor ---- - -Added support for the click directive in stateDiagram syntax diff --git a/.changeset/quiet-hotels-shine.md b/.changeset/quiet-hotels-shine.md deleted file mode 100644 index d9b6cb39e..000000000 --- a/.changeset/quiet-hotels-shine.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'mermaid': minor -'@mermaid-js/parser': minor ---- - -feat: Add shorter `+: Label` syntax in packet diagram diff --git a/.changeset/sad-mails-accept.md b/.changeset/sad-mails-accept.md deleted file mode 100644 index 11dd69d8d..000000000 --- a/.changeset/sad-mails-accept.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'mermaid': patch -'@mermaid-js/parser': patch ---- - -Refactor grammar so that title don't break Architecture Diagrams diff --git a/.changeset/sixty-deer-tell.md b/.changeset/sixty-deer-tell.md deleted file mode 100644 index fd48d2aea..000000000 --- a/.changeset/sixty-deer-tell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'mermaid': major ---- - -fix: allow sequence diagram arrows with a trailing colon but no message diff --git a/.changeset/soft-readers-tan.md b/.changeset/soft-readers-tan.md deleted file mode 100644 index ec3fa97af..000000000 --- a/.changeset/soft-readers-tan.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'mermaid': minor ---- - -feat: Dynamically Render Data Labels Within Bar Charts diff --git a/.changeset/ten-lamps-trade.md b/.changeset/ten-lamps-trade.md deleted file mode 100644 index 991a70daf..000000000 --- a/.changeset/ten-lamps-trade.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'mermaid': patch ---- - -fix: allow colons in events diff --git a/.changeset/yellow-mirrors-change.md b/.changeset/yellow-mirrors-change.md deleted file mode 100644 index 09a766104..000000000 --- a/.changeset/yellow-mirrors-change.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@mermaid-js/mermaid-zenuml': patch ---- - -fix(zenuml): limit `peerDependencies` to Mermaid v10 and v11 - -commit: 0ad44c12feead9d20c6a870a49327ada58d6e657 diff --git a/.changeset/yellow-walls-fry.md b/.changeset/yellow-walls-fry.md deleted file mode 100644 index 75349fd19..000000000 --- a/.changeset/yellow-walls-fry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'mermaid': patch ---- - -fix: Fix incomplete string escaping in URL manipulation logic when `arrowMarkerAbsolute: true` by ensuring all unsafe characters are escaped. diff --git a/.cspell/code-terms.txt b/.cspell/code-terms.txt index 285b66365..e28e9d735 100644 --- a/.cspell/code-terms.txt +++ b/.cspell/code-terms.txt @@ -47,6 +47,7 @@ edgesep EMPTYSTR enddate ERDIAGRAM +eslint flatmap forwardable frontmatter diff --git a/.cspell/contributors.txt b/.cspell/contributors.txt index b7f52f8d0..80f4df22a 100644 --- a/.cspell/contributors.txt +++ b/.cspell/contributors.txt @@ -2,8 +2,10 @@ Ashish Jain cpettitt Dong Cai +knsv +Knut Sveidqvist Nikolay Rozhkov Peng Xiao Per Brolin +Sidharth Vinod subhash-halder -Vinod Sidharth diff --git a/.cspell/mermaid-terms.txt b/.cspell/mermaid-terms.txt index 0fa82b303..c96b3bc8d 100644 --- a/.cspell/mermaid-terms.txt +++ b/.cspell/mermaid-terms.txt @@ -14,11 +14,10 @@ gzipped handDrawn ipsepcola kanban -knsv -Knut marginx marginy Markdownish +mermaidchart mermaidjs mindmap mindmaps @@ -36,7 +35,6 @@ sandboxed siebling statediagram substate -Sveidqvist unfixable Viewbox viewports diff --git a/.esbuild/build.ts b/.esbuild/build.ts index 6bf5f6017..72c0af869 100644 --- a/.esbuild/build.ts +++ b/.esbuild/build.ts @@ -1,5 +1,5 @@ import { build } from 'esbuild'; -import { mkdir, readFile, rename, writeFile } from 'node:fs/promises'; +import { cp, mkdir, readFile, rename, writeFile } from 'node:fs/promises'; import { packageOptions } from '../.build/common.js'; import { generateLangium } from '../.build/generateLangium.js'; import type { MermaidBuildOptions } from './util.js'; @@ -90,6 +90,7 @@ const buildTinyMermaid = async () => { tinyPkg.version = mermaidPkg.version; await writeFile('./packages/tiny/package.json', JSON.stringify(tinyPkg, null, 2) + '\n'); + await cp('./packages/mermaid/CHANGELOG.md', './packages/tiny/CHANGELOG.md'); }; const main = async () => { diff --git a/.github/lychee.toml b/.github/lychee.toml index b4e8ba0fb..7e23b2351 100644 --- a/.github/lychee.toml +++ b/.github/lychee.toml @@ -53,6 +53,7 @@ exclude = [ "https://huehive.co", "https://foswiki.org", "https://www.gnu.org", +"https://mermaid-preview.com" ] # Exclude all private IPs from checking. diff --git a/.github/workflows/validate-lockfile.yml b/.github/workflows/validate-lockfile.yml new file mode 100644 index 000000000..38c71adaa --- /dev/null +++ b/.github/workflows/validate-lockfile.yml @@ -0,0 +1,68 @@ +name: Validate pnpm-lock.yaml + +on: + pull_request: + paths: + - 'pnpm-lock.yaml' + - '**/package.json' + - '.github/workflows/validate-lockfile.yml' + +jobs: + validate-lockfile: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Validate pnpm-lock.yaml entries + id: validate # give this step an ID so we can reference its outputs + run: | + issues=() + + # 1) No tarball references + if grep -qF 'tarball:' pnpm-lock.yaml; then + issues+=("• Tarball references found (forbidden)") + fi + + # 2) No unwanted vitepress paths + if grep -qF 'packages/mermaid/src/vitepress' pnpm-lock.yaml; then + issues+=("• Disallowed path 'packages/mermaid/src/vitepress' present. Run `rm -rf packages/mermaid/src/vitepress && pnpm install` to regenerate.") + fi + + # 3) Lockfile only changes when package.json changes + git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} > changed.txt + if grep -q '^pnpm-lock.yaml$' changed.txt && ! grep -q 'package.json' changed.txt; then + issues+=("• pnpm-lock.yaml changed without any package.json modification") + fi + + # If any issues, output them and fail + if [ ${#issues[@]} -gt 0 ]; then + # Use the new GITHUB_OUTPUT approach to set a multiline output + { + echo "errors<> $GITHUB_OUTPUT + exit 1 + fi + + - name: Comment on PR if validation failed + if: failure() + uses: peter-evans/create-or-update-comment@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.pull_request.number }} + body: | + The following issue(s) were detected: + ${{ steps.validate.outputs.errors }} + + Please address these and push an update. + + _Posted automatically by GitHub Actions_ diff --git a/README.md b/README.md index 760ce0f25..3f26a75f2 100644 --- a/README.md +++ b/README.md @@ -95,10 +95,6 @@ In our release process we rely heavily on visual regression tests using [applito -## Mermaid AI Bot - -[Mermaid](https://codeparrot.ai/oracle?owner=mermaid-js&repo=mermaid) Bot will help you understand this repository better. You can ask for code examples, installation guide, debugging help and much more. - ## Examples **The following are some examples of the diagrams, charts and graphs that can be made using Mermaid. Click here to jump into the [text syntax](https://mermaid.js.org/intro/syntax-reference.html).** diff --git a/cypress/integration/rendering/timeline.spec.ts b/cypress/integration/rendering/timeline.spec.ts index dc6fab364..3785f5fcc 100644 --- a/cypress/integration/rendering/timeline.spec.ts +++ b/cypress/integration/rendering/timeline.spec.ts @@ -161,4 +161,68 @@ describe('Timeline diagram', () => { {} ); }); + + it('11: should render timeline with many stacked events and proper timeline line length', () => { + imgSnapshotTest( + `timeline + title Medical Device Lifecycle + section Pre-Development + Quality Management System : Regulatory Compliance : Risk Management + section Development + Management Responsibility : Planning Activities : Human Resources + Resource Management : Management Reviews : Infrastructure + section Post-Development + Product Realization Activities : Planning Activities : Customer-related Processes + Post-Production Activities : Feedback : Complaints : Adverse Events + : Research and Development : Purchasing Activities + : Production Activities : Installation Activities + : Servicing Activities : Post-Market Surveillance + `, + {} + ); + }); + + it('12: should render timeline with proper vertical line lengths for all columns', () => { + imgSnapshotTest( + `--- +config: + theme: base + themeVariables: + fontFamily: Fira Sans + fontSize: 17px + cScale0: '#b3cde0' + cScale1: '#f49090' + cScale2: '#85d5b8' +--- + +timeline + title Medical Device Lifecycle + section Planning + Quality Management System (4): Regulatory Compliance (4.1.1) + : Risk Management (4.1.2) + Management Resposibility (5): Planning Activities (5.4) + : Management Reviews (5.6) + Resource Management (6): Human Resources (6.2) + : Infrastructure (6.3) + section Realization + Research and Development (7.3): RnD Planning (7.3.2) + : Inputs (7.3.3) + : Outputs (7.3.4) + : Review (7.3.5) + : Verification (7.3.6) + : Validation (7.3.7) + Purchasing (7.4): Purchasing Process (7.4.1) + : Purchasing Information (7.4.2) + Production (7.5): Production Activities (7.5.1) + : Production Feedback (8.2.1) + Installation (7.5.3): Installation Activities (7.5.3) + Servicing (7.5.4): Servicing Activities (7.5.4) + section Post-Production + Post-Market Activities (8): Feedback (8.2.1) + : Complaints (8.2.2) + : Adverse Events (8.2.3) + `, + {} + ); + }); }); diff --git a/demos/timeline.html b/demos/timeline.html index 22ffecd97..b3b99a6dd 100644 --- a/demos/timeline.html +++ b/demos/timeline.html @@ -23,6 +23,23 @@ 1940 : fourth step : fifth step +

Medical Device Lifecycle Timeline

+
+        timeline
+        title Medical Device Lifecycle
+        section Planning
+          Quality Management System (4) : Regulatory Compliance (4.1) : Risk Management (4.1.3) : Management Review (5.6) : Infrastructure (6.3)
+          Management Responsibility (5) : Planning Activities (5.2) : Human Resources (6.2) : RnD Planning (7.3.2) : Purchasing Process (7.4.1) : Production Activities (7.5.1) : Installation Activities (7.5.3) : Servicing Activities (7.5.4)
+        section Realization
+          Research and Development (7.3) : Inputs (7.3.3) : Outputs (7.3.4) : Review (7.3.5) : Verification (7.3.6) : Validation (7.3.7)
+          Purchasing (7.4) : Purchasing Information (7.4.2) : Production Feedback (8.2.1)
+          Production (7.5) : Production Feedback (8.2.1)
+          Installation (7.5.3) : Installation Activities (7.5.3)
+          Servicing (7.5.4) : Servicing Activities (7.5.4)
+        section Post-Production
+          Post-Market Activities (8) : Feedback (8.2.1) : Complaints (8.2.2) : Adverse Events (8.2.3)
+    
+ + + diff --git a/packages/mermaid/src/docs/.vitepress/components/TopBar.vue b/packages/mermaid/src/docs/.vitepress/components/TopBar.vue index 0914d808e..c5b464bb6 100644 --- a/packages/mermaid/src/docs/.vitepress/components/TopBar.vue +++ b/packages/mermaid/src/docs/.vitepress/components/TopBar.vue @@ -1,134 +1,65 @@