Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mermaid-js/mermaid
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v10.2.2
Choose a base ref
...
head repository: mermaid-js/mermaid
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v10.2.3
Choose a head ref

Commits on Apr 22, 2023

  1. Add zenuml

    sidharthv96 committed Apr 22, 2023
    Copy the full SHA
    12ed818 View commit details

Commits on Apr 25, 2023

  1. Update ZenUML

    sidharthv96 committed Apr 25, 2023
    Copy the full SHA
    b9e7ba0 View commit details
  2. Merge branch 'develop' into sidv/zenuml

    * develop: (33 commits)
      Update version
      Fix classParser
      Check for conflict when linting jison
      Update class grammar test
      fix Class diagram grammar
      Skip sourcemap
      Bump version
      Update deps
      Fix unit tests
      Update vite
      Fix applitools cypress
      Update packages/mermaid/package.json
      chore(deps): update dependency typescript to v5
      fix typedoc
      fix(deps): update all minor dependencies
      chore(deps): update pnpm to v8
      chore(deps): update fregante/setup-git-user action to v2
      fix(deps): update all minor dependencies
      chore(deps): update dependency start-server-and-test to v2
      chore(deps): update dependency rimraf to v5
      ...
    sidharthv96 committed Apr 25, 2023
    Copy the full SHA
    ec62c2b View commit details
  3. Add test

    sidharthv96 committed Apr 25, 2023
    Copy the full SHA
    8b18fd9 View commit details
  4. Add docs

    sidharthv96 committed Apr 25, 2023
    Copy the full SHA
    8cd48bf View commit details

Commits on Apr 27, 2023

  1. Merge branch 'develop' into sidv/zenuml

    * develop:
      submit built docs
      update Font Awesome Version
      Clarify FontAwesome support
    sidharthv96 committed Apr 27, 2023
    Copy the full SHA
    88f9233 View commit details
  2. Fix lockfile

    sidharthv96 committed Apr 27, 2023
    Copy the full SHA
    a01343b View commit details

Commits on May 15, 2023

  1. Copy the full SHA
    d86d1e7 View commit details
  2. Copy the full SHA
    b925849 View commit details

Commits on May 16, 2023

  1. Address mermaid-zenuml PR comments

    Dong Cai committed May 16, 2023
    Copy the full SHA
    cce5505 View commit details
  2. update pnpm-lock.yaml

    Dong Cai committed May 16, 2023
    Copy the full SHA
    c889ef0 View commit details
  3. fixed typo and update peerDependencies version

    Dong Cai committed May 16, 2023
    Copy the full SHA
    82eccb7 View commit details
  4. Merge pull request #4405 from ZenUml/dongc/zenuml

    Address mermaid-zenuml PR comments
    sidharthv96 authored May 16, 2023
    Copy the full SHA
    c7affbe View commit details
  5. Merge branch 'develop' into sidv/zenuml

    * develop: (66 commits)
      Update docs
      Update docs
      Improve the wording of security level values
      Added quadrantChart to the side bar
      Added e2e test cases with some fixes
      Added documentation for the quadrantChart
      Restructured the build function and addressed more review comment
      Fixed some parser issue and added test cases for the parser
      Fixed review comment
      Update docs
      Converted files to typescript and added proper types
      Fix blog linting
      Debug fetch-contributors
      Fix lockfile
      Revert "Replace esno & ts-node with tsx"
      [draft] Added support for quadrant chart
      Fix lockfile
      Fix build
      Update pnpm-lock
      Replace esno & ts-node with tsx
      ...
    sidharthv96 committed May 16, 2023
    Copy the full SHA
    97be498 View commit details

Commits on May 17, 2023

  1. Cleanup

    sidharthv96 committed May 17, 2023
    Copy the full SHA
    6a89ef9 View commit details
  2. Address mermaid-zenuml PR comments

    dontry authored and aloisklink committed May 17, 2023
    Copy the full SHA
    bb400d5 View commit details
  3. update pnpm-lock.yaml

    dontry authored and aloisklink committed May 17, 2023
    Copy the full SHA
    507e24c View commit details
  4. Copy the full SHA
    27e59e5 View commit details
  5. Merge pull request #4405 from ZenUml/dongc/zenuml

    Address mermaid-zenuml PR comments
    sidharthv96 authored and aloisklink committed May 17, 2023
    Copy the full SHA
    c255d95 View commit details
  6. Merge branch 'develop' into sidv/zenuml

    * develop: (66 commits)
      Update docs
      Update docs
      Improve the wording of security level values
      Added quadrantChart to the side bar
      Added e2e test cases with some fixes
      Added documentation for the quadrantChart
      Restructured the build function and addressed more review comment
      Fixed some parser issue and added test cases for the parser
      Fixed review comment
      Update docs
      Converted files to typescript and added proper types
      Fix blog linting
      Debug fetch-contributors
      Fix lockfile
      Revert "Replace esno & ts-node with tsx"
      [draft] Added support for quadrant chart
      Fix lockfile
      Fix build
      Update pnpm-lock
      Replace esno & ts-node with tsx
      ...
    
    Merge conflicts:
      - pnpm-lock.yaml
    aloisklink committed May 17, 2023
    Copy the full SHA
    e984b34 View commit details
  7. ignore ZenUML types

    dontry authored and aloisklink committed May 17, 2023
    Copy the full SHA
    49c97da View commit details
  8. Add contributors profile url

    dontry authored and aloisklink committed May 17, 2023
    Copy the full SHA
    a006168 View commit details
  9. Update docs

    aloisklink committed May 17, 2023
    Copy the full SHA
    6cce1b2 View commit details
  10. Merge branch 'develop' into sidv/zenuml

    Conflicts:
    	pnpm-lock.yaml
    aloisklink committed May 17, 2023
    Copy the full SHA
    acc19db View commit details

Commits on May 20, 2023

  1. Copy the full SHA
    f535640 View commit details
  2. add e2e test

    MikeJeffers committed May 20, 2023
    Copy the full SHA
    9e61681 View commit details
  3. Copy the full SHA
    496585b View commit details

Commits on May 23, 2023

  1. Merge branch 'sidv/zenuml' of https://github.com/mermaid-js/mermaid i…

    …nto sidv/zenuml
    
    * 'sidv/zenuml' of https://github.com/mermaid-js/mermaid:
      Update docs
      Add contributors profile url
      ignore ZenUML types
      fixed typo and update peerDependencies version
      update pnpm-lock.yaml
      Address mermaid-zenuml PR comments
      Update all minor dependencies
      Update all patch dependencies
      Fix vitepress build
    sidharthv96 committed May 23, 2023
    Copy the full SHA
    9cec5ae View commit details
  2. Merge branch 'develop' into sidv/zenuml

    * develop:
      Update all minor dependencies
      Update all patch dependencies
    sidharthv96 committed May 23, 2023
    Copy the full SHA
    102b9bc View commit details

Commits on May 24, 2023

  1. Merge pull request #4425 from aloisklink/chore/fix-broken-lockfile

    Fix broken `pnpm-lock.yaml` file to fix CI
    aloisklink authored May 24, 2023
    Copy the full SHA
    cb2bc2a View commit details

Commits on May 26, 2023

  1. Merge pull request #4400 from mermaid-js/sidv/quadrantArrows

    Quadrant chart unicode arrows
    sidharthv96 authored May 26, 2023
    Copy the full SHA
    5fd5de1 View commit details

Commits on May 29, 2023

  1. Copy the full SHA
    38d9ebc View commit details
  2. Fix exceptions for empty lines

    luin committed May 29, 2023
    Copy the full SHA
    ce9bdcc View commit details

Commits on May 31, 2023

  1. Copy the full SHA
    180c695 View commit details
  2. Merge pull request #4440 from AnnaTomanek/patch-1

    Add CKEditor and GitHub Writer to available integrations
    sidharthv96 authored May 31, 2023
    Copy the full SHA
    5338d90 View commit details
  3. Update docs

    sidharthv96 committed May 31, 2023
    Copy the full SHA
    c2c8024 View commit details

Commits on Jun 2, 2023

  1. Update diagram proposal

    sidharthv96 committed Jun 2, 2023
    Copy the full SHA
    74ccf64 View commit details
  2. Merge branch 'develop' into sidv/zenuml

    * develop: (22 commits)
      Update docs
      Added CKEditor and GitHub Writer to available integrations.
      chore(deps): update all patch dependencies
      build(deps): fix broken pnpm-lock.yaml file
      Mermaid version 10.2.0
      Mermaid Version 10.2.0-rc.4
      Label background fix
      Test commit
      Fix for regression error in sequenceDiagrams
      Fix visibility issue for fields
      fix parsing issue with class diagrams
      fix: Use unicode arrows in quadrant chart axis
      fix: Use unicode arrows in quadrant chart axis
      fix lint command
      Bump version
      Back to JS with jsdoc types
      Add unsupported text
      Reduce changes in test
      Fix deps
      Fix lockfile
      ...
    sidharthv96 committed Jun 2, 2023
    Copy the full SHA
    d148a65 View commit details
  3. Merge pull request #4448 from mermaid-js/sidv/diagramProposal

    Update diagram proposal
    knsv authored Jun 2, 2023
    Copy the full SHA
    5b696a7 View commit details
  4. Merge pull request #4334 from mermaid-js/sidv/zenuml

    Add `@mermaid-js/mermaid-zenuml` package for zenuml Integration
    knsv authored Jun 2, 2023
    Copy the full SHA
    1b40f55 View commit details
  5. Copy the full SHA
    da1beb3 View commit details

Commits on Jun 4, 2023

  1. Merge pull request #4452 from yoavst/feature/restore-classes-on-edges…

    …-for-elk
    
    Restore classes on edges for elk
    sidharthv96 authored Jun 4, 2023
    Copy the full SHA
    6115f69 View commit details
  2. Render empty lines correctly

    luin committed Jun 4, 2023
    Copy the full SHA
    2a6603b View commit details

Commits on Jun 5, 2023

  1. Merge pull request #4436 from slab/zh-mermaid-empty-text

    Fix exceptions for empty lines
    sidharthv96 authored Jun 5, 2023
    Copy the full SHA
    f20ff4d View commit details

Commits on Jun 7, 2023

  1. Copy the full SHA
    0cb6df1 View commit details
  2. Copy the full SHA
    eef6745 View commit details
  3. Merge pull request #4463 from try-to-fly/add-nextra-to-blogs-integrat…

    …ions
    
    Update docs: Added Nextra to Blogs category on integrations page
    sidharthv96 authored Jun 7, 2023
    Copy the full SHA
    af7531d View commit details
  4. Copy the full SHA
    ad09d63 View commit details
  5. Add nextra to cSpell

    sidharthv96 committed Jun 7, 2023
    Copy the full SHA
    e9b76bb View commit details
  6. Merge branch 'develop' of https://github.com/mermaid-js/mermaid into …

    …develop
    
    * 'develop' of https://github.com/mermaid-js/mermaid:
      Update docs: Added Nextra to Blogs category on integrations page
    sidharthv96 committed Jun 7, 2023
    Copy the full SHA
    9896402 View commit details
Showing with 1,646 additions and 2,273 deletions.
  1. +2 −1 .eslintignore
  2. +22 −4 .github/ISSUE_TEMPLATE/diagram_proposal.yml
  3. +6 −0 .vite/build.ts
  4. +1 −0 .vite/server.ts
  5. +4 −1 cSpell.json
  6. +14 −0 cypress/integration/rendering/flowchart-elk.spec.js
  7. +11 −0 cypress/integration/rendering/mindmap.spec.ts
  8. +10 −0 cypress/integration/rendering/sequencediagram.spec.js
  9. +19 −0 cypress/integration/rendering/zenuml.spec.js
  10. +2 −1 cypress/platform/viewer.js
  11. +3 −0 demos/index.html
  12. +53 −0 demos/zenuml.html
  13. +0 −1,054 docs/CHANGELOG.md
  14. +5 −0 docs/ecosystem/integrations.md
  15. BIN docs/syntax/img/zenuml-participant-annotators.png
  16. +472 −0 docs/syntax/zenuml.md
  17. +2 −2 package.json
  18. +1 −0 packages/mermaid-zenuml/README.md
  19. +47 −0 packages/mermaid-zenuml/package.json
  20. +21 −0 packages/mermaid-zenuml/src/detector.ts
  21. +58 −0 packages/mermaid-zenuml/src/mermaidUtils.ts
  22. +12 −0 packages/mermaid-zenuml/src/parser.ts
  23. +17 −0 packages/mermaid-zenuml/src/zenuml-definition.ts
  24. +68 −0 packages/mermaid-zenuml/src/zenumlRenderer.ts
  25. +9 −0 packages/mermaid-zenuml/tsconfig.json
  26. +1 −1 packages/mermaid/package.json
  27. +1 −1 packages/mermaid/src/diagrams/flowchart/elk/flowRenderer-elk.js
  28. +2 −2 packages/mermaid/src/diagrams/quadrant-chart/parser/quadrant.jison
  29. +2 −2 packages/mermaid/src/diagrams/quadrant-chart/parser/quadrant.jison.spec.ts
  30. +4 −3 packages/mermaid/src/diagrams/sequence/svgDraw.js
  31. +1 −0 packages/mermaid/src/docs/.vitepress/config.ts
  32. +4 −0 packages/mermaid/src/docs/.vitepress/theme/mermaid.ts
  33. +0 −1,024 packages/mermaid/src/docs/CHANGELOG.md
  34. +5 −0 packages/mermaid/src/docs/ecosystem/integrations.md
  35. +1 −1 packages/mermaid/src/docs/package.json
  36. BIN packages/mermaid/src/docs/syntax/img/zenuml-participant-annotators.png
  37. +314 −0 packages/mermaid/src/docs/syntax/zenuml.md
  38. +52 −23 packages/mermaid/src/rendering-util/createText.js
  39. +0 −1 packages/mermaid/src/setupGraphViewbox.js
  40. +3 −1 packages/mermaid/src/utils.ts
  41. +397 −151 pnpm-lock.yaml
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -4,4 +4,5 @@ docs/Setup.md
cypress.config.js
cypress/plugins/index.js
coverage
*.json
*.json
node_modules
26 changes: 22 additions & 4 deletions .github/ISSUE_TEMPLATE/diagram_proposal.yml
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ description: Suggest a new Diagram Type to add to Mermaid.
labels:
- 'Status: Triage'
- 'Type: Enhancement'
- 'Type: New Diagram'

body:
- type: markdown
@@ -17,6 +18,14 @@ body:
- Use a clear and concise title
- Fill out the text fields with as much detail as possible.
- Never be shy to give us screenshots and/or code samples. It will help!
## Example issues
Refer to the discussions here to get an idea of how the diagram syntax is created.
- https://github.com/mermaid-js/mermaid/issues/4269
- https://github.com/mermaid-js/mermaid/issues/4282
- type: textarea
attributes:
label: Proposal
@@ -35,8 +44,17 @@ body:
description: If applicable, add screenshots to show possible examples of how the diagram may look like.
- type: textarea
attributes:
label: Code Sample
label: Syntax
description: |-
If possible, include a syntax which could be used to write the diagram.
Try to add one or two examples of valid use-cases here.
- type: dropdown
id: implementation
attributes:
label: Implementation
description: |-
If applicable, add a code sample for how to implement this new diagram.
The text will automatically be rendered as JavaScript code.
render: javascript
Would you like to implement this yourself, or is it a proposal for the community?
If there is no corresponding PR from your side after 30 days, the diagram will be open for everyone to implement.
options:
- I will try and implement it myself.
- This is a proposal which I'd love to see built into mermaid by the wonderful community.
6 changes: 6 additions & 0 deletions .vite/build.ts
Original file line number Diff line number Diff line change
@@ -44,6 +44,11 @@ const packageOptions = {
packageName: 'mermaid-example-diagram',
file: 'detector.ts',
},
'mermaid-zenuml': {
name: 'mermaid-zenuml',
packageName: 'mermaid-zenuml',
file: 'detector.ts',
},
};

interface BuildOptions {
@@ -146,6 +151,7 @@ if (watch) {
build(getBuildConfig({ minify: false, watch, core: false, entryName: 'mermaid' }));
if (!mermaidOnly) {
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-example-diagram' }));
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-zenuml' }));
}
} else if (visualize) {
await build(getBuildConfig({ minify: false, core: true, entryName: 'mermaid' }));
1 change: 1 addition & 0 deletions .vite/server.ts
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ async function createServer() {

app.use(cors());
app.use(express.static('./packages/mermaid/dist'));
app.use(express.static('./packages/mermaid-zenuml/dist'));
app.use(express.static('./packages/mermaid-example-diagram/dist'));
app.use(vite.middlewares);
app.use(express.static('demos'));
5 changes: 4 additions & 1 deletion cSpell.json
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
"alois",
"aloisklink",
"antiscript",
"antlr",
"appli",
"applitools",
"asciidoctor",
@@ -83,6 +84,7 @@
"mkdocs",
"mmorel",
"mult",
"nextra",
"orlandoni",
"pathe",
"pbrolin",
@@ -134,7 +136,8 @@
"vitepress",
"vueuse",
"xlink",
"yash"
"yash",
"zenuml"
],
"patterns": [
{ "name": "Markdown links", "pattern": "\\((.*)\\)", "description": "" },
14 changes: 14 additions & 0 deletions cypress/integration/rendering/flowchart-elk.spec.js
Original file line number Diff line number Diff line change
@@ -684,6 +684,20 @@ A --> B
{ titleTopMargin: 0 }
);
});
it('elk: should include classes on the edges', () => {
renderGraph(
`flowchart-elk TD
A --> B --> C --> D
`,
{}
);
cy.get('svg').should((svg) => {
const edges = svg.querySelectorAll('.edges > path');
edges.forEach((edge) => {
expect(edge).to.have.class('flowchart-link');
});
});
});
describe('Markdown strings flowchart-elk (#4220)', () => {
describe('html labels', () => {
it('With styling and classes', () => {
11 changes: 11 additions & 0 deletions cypress/integration/rendering/mindmap.spec.ts
Original file line number Diff line number Diff line change
@@ -52,6 +52,17 @@ root[A root with a long text that wraps to keep the node size in check]
);
});

it('a root with wrapping text and long words that exceed width', () => {
imgSnapshotTest(
`mindmap
root[A few smaller words but then averylongsetofcharacterswithoutwhitespacetoseparate that we expect to wrapontonextlinesandnotexceedwidthparameters]
`,
{},
undefined,
shouldHaveRoot
);
});

it('a root with an icon', () => {
imgSnapshotTest(
`mindmap
10 changes: 10 additions & 0 deletions cypress/integration/rendering/sequencediagram.spec.js
Original file line number Diff line number Diff line change
@@ -88,6 +88,16 @@ context('Sequence diagram', () => {
{}
);
});
it('should handle empty lines', () => {
imgSnapshotTest(
`
sequenceDiagram
Alice->>John: Hello John<br/>
John-->>Alice: Great<br/><br/>day!
`,
{}
);
});
it('should handle line breaks and wrap annotations', () => {
imgSnapshotTest(
`
19 changes: 19 additions & 0 deletions cypress/integration/rendering/zenuml.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { imgSnapshotTest } from '../../helpers/util.js';

describe('Zen UML', () => {
it('Basic Zen UML diagram', () => {
imgSnapshotTest(
`
zenuml
A.method() {
if(x) {
B.method() {
selfCall() { return X }
}
}
}
`,
{}
);
});
});
3 changes: 2 additions & 1 deletion cypress/platform/viewer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import mermaid2 from './mermaid.esm.mjs';
import externalExample from '../../packages/mermaid-example-diagram/dist/mermaid-example-diagram.core.mjs';
import zenUml from '../../packages/mermaid-zenuml/dist/mermaid-zenuml.core.mjs';

function b64ToUtf8(str) {
return decodeURIComponent(escape(window.atob(str)));
@@ -44,7 +45,7 @@ const contentLoaded = async function () {
document.getElementsByTagName('body')[0].appendChild(div);
}

await mermaid2.registerExternalDiagrams([externalExample]);
await mermaid2.registerExternalDiagrams([externalExample, zenUml]);
mermaid2.initialize(graphObj.mermaid);
await mermaid2.run();
}
3 changes: 3 additions & 0 deletions demos/index.html
Original file line number Diff line number Diff line change
@@ -66,6 +66,9 @@ <h2><a href="./sequence.html">Sequence</a></h2>
<li>
<h2><a href="./state.html">State</a></h2>
</li>
<li>
<h2><a href="./zenuml.html">ZenUML</a></h2>
</li>
</ul>
</body>
</html>
53 changes: 53 additions & 0 deletions demos/zenuml.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Mermaid Zenuml Test Page</title>
</head>

<body>
<h1>Zenuml demos</h1>
<pre class="mermaid">
zenuml
title Sync Messages (Design Pattern: Adapter)
@Starter(Client)
Adapter.interfaceMethod() {
translateParameter(parameter)

result = Implementation.implementationMethod()

translateResult()
return translatedResult
}
</pre>
<pre class="mermaid">
zenuml
title Async Messages (SPA Authentication)
// ```
// GET https://${account.namespace}/authorize/?
// response_type=token
// &client_id=${account.clientId}
// &redirect_url=YOUR_CALLBACK_URL
// &state=VALUE_THAT_SURVIVES_REDIRECTS
// &scope=openid
// ```
Browser->Auth0: 1. initiate the authentication
Auth0->"Identity Provider": 2. OAuth2 / SAML, etc
"Identity Provider"->"Identity Provider": 3. user gets authenticated
Auth0->Browser: 4. redirect to ${YOUR_CALLBACK_URL}/#id_token=e68...
Browser->Auth0: 5. validate id_token and get user profile
Browser->"Your API": 6. call API sending JWT in Authorization header
"Your API"->"Your API": 7. validate token
</pre>

<script type="module">
import mermaid from './mermaid.esm.mjs';
import zenuml from './mermaid-zenuml.esm.mjs';
await mermaid.registerExternalDiagrams([zenuml]);
mermaid.initialize({
logLevel: 3,
});
</script>
</body>
</html>
Loading