diff --git a/.changeset/four-eyes-wish.md b/.changeset/four-eyes-wish.md new file mode 100644 index 000000000..3bbbc1e47 --- /dev/null +++ b/.changeset/four-eyes-wish.md @@ -0,0 +1,5 @@ +--- +'mermaid': patch +--- + +fix: Ensure edge label color is applied when using classDef with edge IDs diff --git a/.changeset/moody-fans-try.md b/.changeset/moody-fans-try.md new file mode 100644 index 000000000..f6920a629 --- /dev/null +++ b/.changeset/moody-fans-try.md @@ -0,0 +1,5 @@ +--- +'mermaid': patch +--- + +fix: Resolve gantt chart crash due to invalid array length diff --git a/.changeset/proud-colts-smell.md b/.changeset/proud-colts-smell.md new file mode 100644 index 000000000..610d69253 --- /dev/null +++ b/.changeset/proud-colts-smell.md @@ -0,0 +1,5 @@ +--- +'mermaid': minor +--- + +feat: Add IDs in architecture diagrams diff --git a/.changeset/revert-marked-dependency.md b/.changeset/revert-marked-dependency.md new file mode 100644 index 000000000..aded58871 --- /dev/null +++ b/.changeset/revert-marked-dependency.md @@ -0,0 +1,9 @@ +--- +'mermaid': patch +--- + +chore: revert marked dependency from ^15.0.7 to ^16.0.0 + +- Reverted marked package version to ^16.0.0 for better compatibility +- This is a dependency update that maintains API compatibility +- All tests pass with the updated version diff --git a/.cspell/mermaid-terms.txt b/.cspell/mermaid-terms.txt index 6900c15b0..45152a0ce 100644 --- a/.cspell/mermaid-terms.txt +++ b/.cspell/mermaid-terms.txt @@ -8,6 +8,7 @@ compositTitleSize cose curv doublecircle +elem elems gantt gitgraph diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a6400a86a..a76408dfa 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -36,7 +36,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10 + uses: github/codeql-action/init@5378192d256ef1302a6980fffe5ca04426d43091 # v3.28.21 with: config-file: ./.github/codeql/codeql-config.yml languages: ${{ matrix.language }} @@ -48,7 +48,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10 + uses: github/codeql-action/autobuild@5378192d256ef1302a6980fffe5ca04426d43091 # v3.28.21 # ℹ️ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -62,4 +62,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10 + uses: github/codeql-action/analyze@5378192d256ef1302a6980fffe5ca04426d43091 # v3.28.21 diff --git a/.github/workflows/e2e-applitools.yml b/.github/workflows/e2e-applitools.yml index 6aaa91eb8..853818425 100644 --- a/.github/workflows/e2e-applitools.yml +++ b/.github/workflows/e2e-applitools.yml @@ -53,7 +53,7 @@ jobs: args: -X POST "$APPLITOOLS_SERVER_URL/api/externals/github/push?apiKey=$APPLITOOLS_API_KEY&CommitSha=$GITHUB_SHA&BranchName=${APPLITOOLS_BRANCH}$&ParentBranchName=$APPLITOOLS_PARENT_BRANCH" - name: Cypress run - uses: cypress-io/github-action@18a6541367f4580a515371905f499a27a44e8dbe # v6.7.12 + uses: cypress-io/github-action@108b8684ae52e735ff7891524cbffbcd4be5b19f # v6.7.16 id: cypress with: start: pnpm run dev diff --git a/.github/workflows/e2e-timings.yml b/.github/workflows/e2e-timings.yml index 21dbda293..e59903df6 100644 --- a/.github/workflows/e2e-timings.yml +++ b/.github/workflows/e2e-timings.yml @@ -27,12 +27,12 @@ jobs: with: node-version-file: '.node-version' - name: Install dependencies - uses: cypress-io/github-action@18a6541367f4580a515371905f499a27a44e8dbe # v6.7.12 + uses: cypress-io/github-action@108b8684ae52e735ff7891524cbffbcd4be5b19f # v6.7.16 with: runTests: false - name: Cypress run - uses: cypress-io/github-action@18a6541367f4580a515371905f499a27a44e8dbe # v6.7.12 + uses: cypress-io/github-action@108b8684ae52e735ff7891524cbffbcd4be5b19f # v6.7.16 id: cypress with: install: false @@ -58,7 +58,7 @@ jobs: echo "EOF" >> $GITHUB_OUTPUT - name: Commit and create pull request - uses: peter-evans/create-pull-request@18e469570b1cf0dfc11d60ec121099f8ff3e617a + uses: peter-evans/create-pull-request@915d841dae6a4f191bb78faf61a257411d7be4d2 with: add-paths: | cypress/timings.json diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 56883b987..8fbf6d6f6 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -45,7 +45,7 @@ jobs: node-version-file: '.node-version' - name: Cache snapshots id: cache-snapshot - uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1 + uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: path: ./cypress/snapshots key: ${{ runner.os }}-snapshots-${{ env.targetHash }} @@ -59,7 +59,7 @@ jobs: - name: Install dependencies if: ${{ steps.cache-snapshot.outputs.cache-hit != 'true' }} - uses: cypress-io/github-action@18a6541367f4580a515371905f499a27a44e8dbe # v6.7.12 + uses: cypress-io/github-action@108b8684ae52e735ff7891524cbffbcd4be5b19f # v6.7.16 with: # just perform install runTests: false @@ -95,13 +95,13 @@ jobs: # These cached snapshots are downloaded, providing the reference snapshots. - name: Cache snapshots id: cache-snapshot - uses: actions/cache/restore@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1 + uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: path: ./cypress/snapshots key: ${{ runner.os }}-snapshots-${{ env.targetHash }} - name: Install dependencies - uses: cypress-io/github-action@18a6541367f4580a515371905f499a27a44e8dbe # v6.7.12 + uses: cypress-io/github-action@108b8684ae52e735ff7891524cbffbcd4be5b19f # v6.7.16 with: runTests: false @@ -117,7 +117,7 @@ jobs: # Install NPM dependencies, cache them correctly # and run all Cypress tests - name: Cypress run - uses: cypress-io/github-action@18a6541367f4580a515371905f499a27a44e8dbe # v6.7.12 + uses: cypress-io/github-action@108b8684ae52e735ff7891524cbffbcd4be5b19f # v6.7.16 id: cypress with: install: false diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index f855ed23b..ce43c2ed7 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -32,7 +32,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Restore lychee cache - uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1 + uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: path: .lycheecache key: cache-lychee-${{ github.sha }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 649c40034..7dbf85d94 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,7 +36,7 @@ jobs: - name: Create Release Pull Request or Publish to npm id: changesets - uses: changesets/action@c8bada60c408975afd1a20b3db81d6eee6789308 # v1.4.9 + uses: changesets/action@06245a4e0a36c064a573d4150030f5ec548e4fcc # v1.4.10 with: version: pnpm changeset:version publish: pnpm changeset:publish diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 4901b3781..539f6ee2f 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -20,18 +20,18 @@ jobs: with: persist-credentials: false - name: Run analysis - uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1 + uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2 with: results_file: results.sarif results_format: sarif publish_results: true - name: Upload artifact - uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: SARIF file path: results.sarif retention-days: 5 - name: Upload to code-scanning - uses: github/codeql-action/upload-sarif@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10 + uses: github/codeql-action/upload-sarif@5378192d256ef1302a6980fffe5ca04426d43091 # v3.28.21 with: sarif_file: results.sarif diff --git a/.github/workflows/update-browserlist.yml b/.github/workflows/update-browserlist.yml index 94de12ad3..54ef39b11 100644 --- a/.github/workflows/update-browserlist.yml +++ b/.github/workflows/update-browserlist.yml @@ -19,7 +19,7 @@ jobs: message: 'chore: update browsers list' push: false - name: Create Pull Request - uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6 + uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 with: branch: update-browserslist title: Update Browserslist diff --git a/cypress/integration/other/configuration.spec.js b/cypress/integration/other/configuration.spec.js index b48a197a4..a699e03a7 100644 --- a/cypress/integration/other/configuration.spec.js +++ b/cypress/integration/other/configuration.spec.js @@ -98,12 +98,12 @@ describe('Configuration', () => { it('should handle arrowMarkerAbsolute set to true', () => { renderGraph( `flowchart TD - A[Christmas] -->|Get money| B(Go shopping) - B --> C{Let me think} - C -->|One| D[Laptop] - C -->|Two| E[iPhone] - C -->|Three| F[fa:fa-car Car] - `, + A[Christmas] -->|Get money| B(Go shopping) + B --> C{Let me think} + C -->|One| D[Laptop] + C -->|Two| E[iPhone] + C -->|Three| F[fa:fa-car Car] + `, { arrowMarkerAbsolute: true, } @@ -113,8 +113,7 @@ describe('Configuration', () => { cy.get('path') .first() .should('have.attr', 'marker-end') - .should('exist') - .and('include', 'url(http\\:\\/\\/localhost'); + .and('include', 'url(http://localhost'); }); }); it('should not taint the initial configuration when using multiple directives', () => { diff --git a/cypress/integration/rendering/flowchart-elk.spec.js b/cypress/integration/rendering/flowchart-elk.spec.js index 312e1d5b4..fac4f3b4b 100644 --- a/cypress/integration/rendering/flowchart-elk.spec.js +++ b/cypress/integration/rendering/flowchart-elk.spec.js @@ -109,7 +109,7 @@ describe('Flowchart ELK', () => { const style = svg.attr('style'); expect(style).to.match(/^max-width: [\d.]+px;$/); const maxWidthValue = parseFloat(style.match(/[\d.]+/g).join('')); - verifyNumber(maxWidthValue, 380); + verifyNumber(maxWidthValue, 380, 15); }); }); it('8-elk: should render a flowchart when useMaxWidth is false', () => { @@ -128,7 +128,7 @@ describe('Flowchart ELK', () => { const width = parseFloat(svg.attr('width')); // use within because the absolute value can be slightly different depending on the environment ±5% // expect(height).to.be.within(446 * 0.95, 446 * 1.05); - verifyNumber(width, 380); + verifyNumber(width, 380, 15); expect(svg).to.not.have.attr('style'); }); }); diff --git a/cypress/integration/rendering/flowchart-v2.spec.js b/cypress/integration/rendering/flowchart-v2.spec.js index 8c6cde57a..5ef32c269 100644 --- a/cypress/integration/rendering/flowchart-v2.spec.js +++ b/cypress/integration/rendering/flowchart-v2.spec.js @@ -1186,4 +1186,17 @@ end imgSnapshotTest(graph, { htmlLabels: false }); }); }); + + it('V2 - 17: should apply class def colour to edge label', () => { + imgSnapshotTest( + ` graph LR + id1(Start) link@-- "Label" -->id2(Stop) + style id1 fill:#f9f,stroke:#333,stroke-width:4px + +class id2 myClass +classDef myClass fill:#bbf,stroke:#f66,stroke-width:2px,color:white,stroke-dasharray: 5 5 +class link myClass +` + ); + }); }); diff --git a/cypress/integration/rendering/gantt.spec.js b/cypress/integration/rendering/gantt.spec.js index 32dbcb4d9..72cb6ea29 100644 --- a/cypress/integration/rendering/gantt.spec.js +++ b/cypress/integration/rendering/gantt.spec.js @@ -803,4 +803,34 @@ describe('Gantt diagram', () => { {} ); }); + it('should handle numeric timestamps with dateFormat x', () => { + imgSnapshotTest( + ` + gantt + title Process time profile (ms) + dateFormat x + axisFormat %L + tickInterval 250millisecond + + section Pipeline + Parse JSON p1: 000, 120 + `, + {} + ); + }); + it('should handle numeric timestamps with dateFormat X', () => { + imgSnapshotTest( + ` + gantt + title Process time profile (ms) + dateFormat X + axisFormat %L + tickInterval 250millisecond + + section Pipeline + Parse JSON p1: 000, 120 + `, + {} + ); + }); }); diff --git a/cypress/platform/knsv2.html b/cypress/platform/knsv2.html index fc33a58b4..7ac7aeac8 100644 --- a/cypress/platform/knsv2.html +++ b/cypress/platform/knsv2.html @@ -32,26 +32,8 @@ href="https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&family=Rubik+Mono+One&display=swap" rel="stylesheet" /> - - -