Merge branch 'develop' into feature/2776_katex_math

This commit is contained in:
Sidharth Vinod
2024-01-31 15:21:13 +05:30
committed by GitHub
35 changed files with 468 additions and 520 deletions

View File

@@ -4,7 +4,7 @@ contact_links:
url: https://github.com/mermaid-js/mermaid/discussions url: https://github.com/mermaid-js/mermaid/discussions
about: Ask the Community questions or share your own graphs in our discussions. about: Ask the Community questions or share your own graphs in our discussions.
- name: Discord - name: Discord
url: https://discord.gg/wwtabKgp8y url: https://discord.gg/AgrbSrBer3
about: Join our Community on Discord for Help and a casual chat. about: Join our Community on Discord for Help and a casual chat.
- name: Documentation - name: Documentation
url: https://mermaid.js.org url: https://mermaid.js.org

View File

@@ -24,7 +24,7 @@ jobs:
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
cache: pnpm cache: pnpm
node-version: 18 node-version-file: '.node-version'
- name: Install Packages - name: Install Packages
run: pnpm install --frozen-lockfile run: pnpm install --frozen-lockfile

View File

@@ -12,9 +12,6 @@ on:
permissions: permissions:
contents: read contents: read
env:
node-version: 18.x
jobs: jobs:
build-mermaid: build-mermaid:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -24,11 +21,11 @@ jobs:
- uses: pnpm/action-setup@v2 - uses: pnpm/action-setup@v2
# uses version from "packageManager" field in package.json # uses version from "packageManager" field in package.json
- name: Setup Node.js ${{ env.node-version }} - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
cache: pnpm cache: pnpm
node-version: ${{ env.node-version }} node-version-file: '.node-version'
- name: Install Packages - name: Install Packages
run: | run: |

View File

@@ -21,9 +21,9 @@ env:
jobs: jobs:
e2e-applitools: e2e-applitools:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: container:
matrix: image: cypress/browsers:node-20.11.0-chrome-121.0.6167.85-1-ff-120.0-edge-121.0.2277.83-1
node-version: [18.x] options: --user 1001
steps: steps:
- if: ${{ ! env.USE_APPLI }} - if: ${{ ! env.USE_APPLI }}
name: Warn if not using Applitools name: Warn if not using Applitools
@@ -35,10 +35,10 @@ jobs:
- uses: pnpm/action-setup@v2 - uses: pnpm/action-setup@v2
# uses version from "packageManager" field in package.json # uses version from "packageManager" field in package.json
- name: Setup Node.js ${{ matrix.node-version }} - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: ${{ matrix.node-version }} node-version-file: '.node-version'
- if: ${{ env.USE_APPLI }} - if: ${{ env.USE_APPLI }}
name: Notify applitools of new batch name: Notify applitools of new batch

View File

@@ -17,20 +17,22 @@ permissions:
contents: read contents: read
env: env:
node-version: 18.x
# For PRs and MergeQueues, the target commit is used, and for push events, github.event.previous is used. # For PRs and MergeQueues, the target commit is used, and for push events, github.event.previous is used.
targetHash: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || (github.event.before == '0000000000000000000000000000000000000000' && 'develop' || github.event.before) }} targetHash: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || (github.event.before == '0000000000000000000000000000000000000000' && 'develop' || github.event.before) }}
jobs: jobs:
cache: cache:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: cypress/browsers:node-20.11.0-chrome-121.0.6167.85-1-ff-120.0-edge-121.0.2277.83-1
options: --user 1001
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: pnpm/action-setup@v2 - uses: pnpm/action-setup@v2
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 18.x node-version-file: '.node-version'
- name: Cache snapshots - name: Cache snapshots
id: cache-snapshot id: cache-snapshot
uses: actions/cache@v4 uses: actions/cache@v4
@@ -57,6 +59,9 @@ jobs:
e2e: e2e:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: cypress/browsers:node-20.11.0-chrome-121.0.6167.85-1-ff-120.0-edge-121.0.2277.83-1
options: --user 1001
needs: cache needs: cache
strategy: strategy:
fail-fast: false fail-fast: false
@@ -68,10 +73,10 @@ jobs:
- uses: pnpm/action-setup@v2 - uses: pnpm/action-setup@v2
# uses version from "packageManager" field in package.json # uses version from "packageManager" field in package.json
- name: Setup Node.js ${{ env.node-version }} - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: ${{ env.node-version }} node-version-file: '.node-version'
# These cached snapshots are downloaded, providing the reference snapshots. # These cached snapshots are downloaded, providing the reference snapshots.
- name: Cache snapshots - name: Cache snapshots

View File

@@ -13,9 +13,6 @@ on:
permissions: permissions:
contents: write contents: write
env:
node-version: 18.x
jobs: jobs:
lint: lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -25,11 +22,11 @@ jobs:
- uses: pnpm/action-setup@v2 - uses: pnpm/action-setup@v2
# uses version from "packageManager" field in package.json # uses version from "packageManager" field in package.json
- name: Setup Node.js ${{ env.node-version }} - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
cache: pnpm cache: pnpm
node-version: ${{ env.node-version }} node-version-file: '.node-version'
- name: Install Packages - name: Install Packages
run: | run: |

View File

@@ -31,7 +31,7 @@ jobs:
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
cache: pnpm cache: pnpm
node-version: 18 node-version-file: '.node-version'
- name: Install Packages - name: Install Packages
run: pnpm install --frozen-lockfile run: pnpm install --frozen-lockfile

View File

@@ -19,7 +19,7 @@ jobs:
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
cache: pnpm cache: pnpm
node-version: 18.x node-version-file: '.node-version'
- name: Install Packages - name: Install Packages
run: | run: |

View File

@@ -14,11 +14,11 @@ jobs:
- uses: pnpm/action-setup@v2 - uses: pnpm/action-setup@v2
# uses version from "packageManager" field in package.json # uses version from "packageManager" field in package.json
- name: Setup Node.js v18 - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
cache: pnpm cache: pnpm
node-version: 18.x node-version-file: '.node-version'
- name: Install Packages - name: Install Packages
run: | run: |

View File

@@ -5,9 +5,6 @@ on: [push, pull_request, merge_group]
permissions: permissions:
contents: read contents: read
env:
node-version: 18.x
jobs: jobs:
unit-test: unit-test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -17,11 +14,11 @@ jobs:
- uses: pnpm/action-setup@v2 - uses: pnpm/action-setup@v2
# uses version from "packageManager" field in package.json # uses version from "packageManager" field in package.json
- name: Setup Node.js ${{ env.node-version }} - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
cache: pnpm cache: pnpm
node-version: ${{ env.node-version }} node-version-file: '.node-version'
- name: Install Packages - name: Install Packages
run: | run: |

1
.node-version Normal file
View File

@@ -0,0 +1 @@
v20.11.0

View File

@@ -1,2 +1,2 @@
FROM node:18.19.0-alpine3.18 AS base FROM node:20.11.0-alpine3.19 AS base
RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.shrc" SHELL="$(which sh)" sh - RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.shrc" SHELL="$(which sh)" sh -

View File

@@ -15,7 +15,7 @@ Generate diagrams from markdown-like text.
<a href="https://mermaid.live/"><b>Live Editor!</b></a> <a href="https://mermaid.live/"><b>Live Editor!</b></a>
</p> </p>
<p align="center"> <p align="center">
<a href="https://mermaid.js.org">📖 Documentation</a> | <a href="https://mermaid.js.org/intro/">🚀 Getting Started</a> | <a href="https://www.jsdelivr.com/package/npm/mermaid">🌐 CDN</a> | <a href="https://discord.gg/wwtabKgp8y" title="Discord invite">🙌 Join Us</a> <a href="https://mermaid.js.org">📖 Documentation</a> | <a href="https://mermaid.js.org/intro/">🚀 Getting Started</a> | <a href="https://www.jsdelivr.com/package/npm/mermaid">🌐 CDN</a> | <a href="https://discord.gg/AgrbSrBer3" title="Discord invite">🙌 Join Us</a>
</p> </p>
<p align="center"> <p align="center">
<a href="./README.zh-CN.md">简体中文</a> <a href="./README.zh-CN.md">简体中文</a>
@@ -33,7 +33,7 @@ Try Live Editor previews of future releases: <a href="https://develop.git.mermai
[![Coverage Status](https://codecov.io/github/mermaid-js/mermaid/branch/develop/graph/badge.svg)](https://app.codecov.io/github/mermaid-js/mermaid/tree/develop) [![Coverage Status](https://codecov.io/github/mermaid-js/mermaid/branch/develop/graph/badge.svg)](https://app.codecov.io/github/mermaid-js/mermaid/tree/develop)
[![CDN Status](https://img.shields.io/jsdelivr/npm/hm/mermaid)](https://www.jsdelivr.com/package/npm/mermaid) [![CDN Status](https://img.shields.io/jsdelivr/npm/hm/mermaid)](https://www.jsdelivr.com/package/npm/mermaid)
[![NPM Downloads](https://img.shields.io/npm/dm/mermaid)](https://www.npmjs.com/package/mermaid) [![NPM Downloads](https://img.shields.io/npm/dm/mermaid)](https://www.npmjs.com/package/mermaid)
[![Join our Discord!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=discord&label=discord)](https://discord.gg/wwtabKgp8y) [![Join our Discord!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=discord&label=discord)](https://discord.gg/AgrbSrBer3)
[![Twitter Follow](https://img.shields.io/badge/Social-mermaidjs__-blue?style=social&logo=X)](https://twitter.com/mermaidjs_) [![Twitter Follow](https://img.shields.io/badge/Social-mermaidjs__-blue?style=social&logo=X)](https://twitter.com/mermaidjs_)
<img src="./img/header.png" alt="" /> <img src="./img/header.png" alt="" />

View File

@@ -15,7 +15,7 @@ Mermaid
<a href="https://mermaid.live/"><b>实时编辑器!</b></a> <a href="https://mermaid.live/"><b>实时编辑器!</b></a>
</p> </p>
<p align="center"> <p align="center">
<a href="https://mermaid.js.org">📖 文档</a> | <a href="https://mermaid.js.org/intro/">🚀 入门</a> | <a href="https://www.jsdelivr.com/package/npm/mermaid">🌐 CDN</a> | <a href="https://discord.gg/wwtabKgp8y" title="Discord invite">🙌 加入我们</a> <a href="https://mermaid.js.org">📖 文档</a> | <a href="https://mermaid.js.org/intro/">🚀 入门</a> | <a href="https://www.jsdelivr.com/package/npm/mermaid">🌐 CDN</a> | <a href="https://discord.gg/AgrbSrBer3" title="Discord invite">🙌 加入我们</a>
</p> </p>
<p align="center"> <p align="center">
<a href="./README.md">English</a> <a href="./README.md">English</a>
@@ -34,7 +34,7 @@ Mermaid
[![Coverage Status](https://codecov.io/github/mermaid-js/mermaid/branch/develop/graph/badge.svg)](https://app.codecov.io/github/mermaid-js/mermaid/tree/develop) [![Coverage Status](https://codecov.io/github/mermaid-js/mermaid/branch/develop/graph/badge.svg)](https://app.codecov.io/github/mermaid-js/mermaid/tree/develop)
[![CDN Status](https://img.shields.io/jsdelivr/npm/hm/mermaid)](https://www.jsdelivr.com/package/npm/mermaid) [![CDN Status](https://img.shields.io/jsdelivr/npm/hm/mermaid)](https://www.jsdelivr.com/package/npm/mermaid)
[![NPM Downloads](https://img.shields.io/npm/dm/mermaid)](https://www.npmjs.com/package/mermaid) [![NPM Downloads](https://img.shields.io/npm/dm/mermaid)](https://www.npmjs.com/package/mermaid)
[![Join our Discord!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=discord&label=discord)](https://discord.gg/wwtabKgp8y) [![Join our Discord!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=discord&label=discord)](https://discord.gg/AgrbSrBer3)
[![Twitter Follow](https://img.shields.io/badge/Social-mermaidjs__-blue?style=social&logo=X)](https://twitter.com/mermaidjs_) [![Twitter Follow](https://img.shields.io/badge/Social-mermaidjs__-blue?style=social&logo=X)](https://twitter.com/mermaidjs_)
<img src="./img/header.png" alt="" /> <img src="./img/header.png" alt="" />

View File

@@ -375,6 +375,26 @@ context('Sequence diagram', () => {
{} {}
); );
}); });
it('should have actor-top and actor-bottom classes on top and bottom actor box and symbol', () => {
imgSnapshotTest(
`
sequenceDiagram
actor Bob
Alice->>Bob: Hi Bob
Bob->>Alice: Hi Alice
`,
{}
);
cy.get('.actor').should('have.class', 'actor-top');
cy.get('.actor-man').should('have.class', 'actor-top');
cy.get('.actor.actor-top').should('not.have.class', 'actor-bottom');
cy.get('.actor-man.actor-top').should('not.have.class', 'actor-bottom');
cy.get('.actor').should('have.class', 'actor-bottom');
cy.get('.actor-man').should('have.class', 'actor-bottom');
cy.get('.actor.actor-bottom').should('not.have.class', 'actor-top');
cy.get('.actor-man.actor-bottom').should('not.have.class', 'actor-top');
});
it('should render long notes left of actor', () => { it('should render long notes left of actor', () => {
imgSnapshotTest( imgSnapshotTest(
` `

View File

@@ -24,7 +24,7 @@ Currently pending [IANA](https://www.iana.org/) recognition.
### Mermaid Discord workspace ### Mermaid Discord workspace
We would love to see what you create with Mermaid. Please share your creations with us in our [Discord](https://discord.gg/wwtabKgp8y) server [#showcase](https://discord.com/channels/1079455296289788015/1079502635054399649) channel. We would love to see what you create with Mermaid. Please share your creations with us in our [Discord](https://discord.gg/AgrbSrBer3) server [#showcase](https://discord.com/channels/1079455296289788015/1079502635054399649) channel.
### Add to Mermaid Ecosystem ### Add to Mermaid Ecosystem

View File

@@ -22,7 +22,7 @@ It is a JavaScript based diagramming and charting tool that renders Markdown-ins
[![Coverage Status](https://coveralls.io/repos/github/mermaid-js/mermaid/badge.svg?branch=master)](https://coveralls.io/github/mermaid-js/mermaid?branch=master) [![Coverage Status](https://coveralls.io/repos/github/mermaid-js/mermaid/badge.svg?branch=master)](https://coveralls.io/github/mermaid-js/mermaid?branch=master)
[![CDN Status](https://img.shields.io/jsdelivr/npm/hm/mermaid)](https://www.jsdelivr.com/package/npm/mermaid) [![CDN Status](https://img.shields.io/jsdelivr/npm/hm/mermaid)](https://www.jsdelivr.com/package/npm/mermaid)
[![NPM](https://img.shields.io/npm/dm/mermaid)](https://www.npmjs.com/package/mermaid) [![NPM](https://img.shields.io/npm/dm/mermaid)](https://www.npmjs.com/package/mermaid)
[![Join our Discord!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=discord&label=discord)](https://discord.gg/wwtabKgp8y) [![Join our Discord!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=discord&label=discord)](https://discord.gg/AgrbSrBer3)
[![Twitter Follow](https://img.shields.io/twitter/follow/mermaidjs_?style=social)](https://twitter.com/mermaidjs_) [![Twitter Follow](https://img.shields.io/twitter/follow/mermaidjs_?style=social)](https://twitter.com/mermaidjs_)
</div> </div>

View File

@@ -14,19 +14,6 @@ Create flowchart nodes, connect them with edges, update shapes, change colors, a
Read more about it in our latest [BLOG POST](https://www.mermaidchart.com/blog/posts/mermaid-chart-releases-new-visual-editor-for-flowcharts) and watch a [DEMO VIDEO](https://www.youtube.com/watch?v=5aja0gijoO0) on our YouTube page. Read more about it in our latest [BLOG POST](https://www.mermaidchart.com/blog/posts/mermaid-chart-releases-new-visual-editor-for-flowcharts) and watch a [DEMO VIDEO](https://www.youtube.com/watch?v=5aja0gijoO0) on our YouTube page.
## 🎉 Mermaid Chart is running a Holiday promotion
### Use <span class="text-[#FE3470]">HOLIDAYS2023</span> to get a 14-day free trial and 25% off a Pro subscription
With a Pro subscription, you get access to:
- AI functionality
- Team collaboration and multi-user editing
- Unlimited diagrams and presentations
- And more!
Redeem the promo code on the [Mermaid Chart website](https://www.mermaidchart.com/app/user/billing/checkout?coupon=HOLIDAYS2023).
## 📖 Blog posts ## 📖 Blog posts
Visit our [Blog](./blog.md) to see the latest blog posts. Visit our [Blog](./blog.md) to see the latest blog posts.

View File

@@ -6,6 +6,12 @@
# Blog # Blog
## [How one data scientist uses Mermaid Chart to quickly and easily build flowcharts](https://www.mermaidchart.com/blog/posts/customer-spotlight-ari-tal/)
23 January 2024 · 4 mins
Read about how Ari Tal, a data scientist and founder of Leveling Up with XAI, utilizes Mermaid Chart for its easy-to-use flowchart creation capabilities to enhance his work in explainable AI (XAI).
## [Introducing Mermaid Charts JetBrains IDE Extension](https://www.mermaidchart.com/blog/posts/introducing-mermaid-charts-jetbrains-ide-extension/) ## [Introducing Mermaid Charts JetBrains IDE Extension](https://www.mermaidchart.com/blog/posts/introducing-mermaid-charts-jetbrains-ide-extension/)
20 December 2023 · 5 mins 20 December 2023 · 5 mins

View File

@@ -741,9 +741,11 @@ Styling of a sequence diagram is done by defining a number of css classes. Durin
### Classes used ### Classes used
| Class | Description | | Class | Description |
| ------------ | ----------------------------------------------------------- | | ------------ | -------------------------------------------------------------- |
| actor | Style for the actor box at the top of the diagram. | | actor | Styles for the actor box. |
| text.actor | Styles for text in the actor box at the top of the diagram. | | actor-top | Styles for the actor figure/ box at the top of the diagram. |
| actor-bottom | Styles for the actor figure/ box at the bottom of the diagram. |
| text.actor | Styles for text in the actor box. |
| actor-line | The vertical line for an actor. | | actor-line | The vertical line for an actor. |
| messageLine0 | Styles for the solid message line. | | messageLine0 | Styles for the solid message line. |
| messageLine1 | Styles for the dotted message line. | | messageLine1 | Styles for the dotted message line. |

View File

@@ -74,7 +74,7 @@
"@types/jsdom": "^21.1.1", "@types/jsdom": "^21.1.1",
"@types/lodash": "^4.14.194", "@types/lodash": "^4.14.194",
"@types/mdast": "^3.0.11", "@types/mdast": "^3.0.11",
"@types/node": "^18.16.0", "@types/node": "^20.11.10",
"@types/prettier": "^2.7.2", "@types/prettier": "^2.7.2",
"@types/rollup-plugin-visualizer": "^4.2.1", "@types/rollup-plugin-visualizer": "^4.2.1",
"@typescript-eslint/eslint-plugin": "^6.7.2", "@typescript-eslint/eslint-plugin": "^6.7.2",
@@ -122,9 +122,6 @@
"vite-plugin-istanbul": "^4.1.0", "vite-plugin-istanbul": "^4.1.0",
"vitest": "^0.34.0" "vitest": "^0.34.0"
}, },
"volta": {
"node": "18.19.0"
},
"nyc": { "nyc": {
"report-dir": "coverage/cypress" "report-dir": "coverage/cypress"
} }

View File

@@ -124,8 +124,8 @@
"typescript": "^5.0.4", "typescript": "^5.0.4",
"unist-util-flatmap": "^1.0.0", "unist-util-flatmap": "^1.0.0",
"unist-util-visit": "^4.1.2", "unist-util-visit": "^4.1.2",
"vitepress": "^1.0.0-alpha.72", "vitepress": "^1.0.0-rc.40",
"vitepress-plugin-search": "^1.0.4-alpha.20" "vitepress-plugin-search": "^1.0.4-alpha.22"
}, },
"files": [ "files": [
"dist/", "dist/",

View File

@@ -6,6 +6,8 @@ import { sanitizeUrl } from '@braintree/sanitize-url';
import * as configApi from '../../config.js'; import * as configApi from '../../config.js';
export const ACTOR_TYPE_WIDTH = 18 * 2; export const ACTOR_TYPE_WIDTH = 18 * 2;
const TOP_ACTOR_CLASS = 'actor-top';
const BOTTOM_ACTOR_CLASS = 'actor-bottom';
export const drawRect = function (elem, rectData) { export const drawRect = function (elem, rectData) {
return svgDrawCommon.drawRect(elem, rectData); return svgDrawCommon.drawRect(elem, rectData);
@@ -361,6 +363,11 @@ const drawActorTypeParticipant = async function (elem, actor, conf, isFooter) {
} else { } else {
rect.fill = '#eaeaea'; rect.fill = '#eaeaea';
} }
if (isFooter) {
cssclass += ` ${BOTTOM_ACTOR_CLASS}`;
} else {
cssclass += ` ${TOP_ACTOR_CLASS}`;
}
rect.x = actor.x; rect.x = actor.x;
rect.y = actorY; rect.y = actorY;
rect.width = actor.width; rect.width = actor.width;
@@ -425,7 +432,13 @@ const drawActorTypeActor = async function (elem, actor, conf, isFooter) {
actor.actorCnt = actorCnt; actor.actorCnt = actorCnt;
} }
const actElem = elem.append('g'); const actElem = elem.append('g');
actElem.attr('class', 'actor-man'); let cssClass = 'actor-man';
if (isFooter) {
cssClass += ` ${BOTTOM_ACTOR_CLASS}`;
} else {
cssClass += ` ${TOP_ACTOR_CLASS}`;
}
actElem.attr('class', cssClass);
const rect = svgDrawCommon.getNoteRect(); const rect = svgDrawCommon.getNoteRect();
rect.x = actor.x; rect.x = actor.x;

View File

@@ -16,7 +16,7 @@ import { teamMembers } from '../contributors';
<p text-lg max-w-200 text-center leading-7> <p text-lg max-w-200 text-center leading-7>
<Contributors /> <Contributors />
<br /> <br />
<a href="https://discord.gg/wwtabKgp8y" rel="noopener noreferrer">Join the community</a> <a href="https://discord.gg/AgrbSrBer3" rel="noopener noreferrer">Join the community</a>
and get involved! and get involved!
</p> </p>
</div> </div>

View File

@@ -56,7 +56,7 @@ export default defineConfig({
{ icon: 'github', link: 'https://github.com/mermaid-js/mermaid' }, { icon: 'github', link: 'https://github.com/mermaid-js/mermaid' },
{ {
icon: 'discord', icon: 'discord',
link: 'https://discord.gg/wwtabKgp8y', link: 'https://discord.gg/AgrbSrBer3',
}, },
{ {
icon: { icon: {

View File

@@ -8,14 +8,12 @@ import Contributors from '../components/Contributors.vue';
import HomePage from '../components/HomePage.vue'; import HomePage from '../components/HomePage.vue';
// @ts-ignore // @ts-ignore
import TopBar from '../components/TopBar.vue'; import TopBar from '../components/TopBar.vue';
import { getRedirect } from './redirect.js'; import { getRedirect } from './redirect.js';
import { h } from 'vue'; import { h } from 'vue';
import Theme from 'vitepress/theme'; import Theme from 'vitepress/theme';
import '../style/main.css'; import '../style/main.css';
import 'uno.css'; import 'uno.css';
import type { EnhanceAppContext } from 'vitepress';
export default { export default {
...DefaultTheme, ...DefaultTheme,
@@ -26,19 +24,22 @@ export default {
'home-features-after': () => h(HomePage), 'home-features-after': () => h(HomePage),
}); });
}, },
enhanceApp({ app, router }) { enhanceApp({ app, router }: EnhanceAppContext) {
// register global components // register global components
app.component('Mermaid', Mermaid); app.component('Mermaid', Mermaid);
app.component('Contributors', Contributors); app.component('Contributors', Contributors);
router.onBeforeRouteChange = (to) => { router.onBeforeRouteChange = (to) => {
try { try {
const newPath = getRedirect(to); const url = new URL(window.location.origin + to);
const newPath = getRedirect(url);
if (newPath) { if (newPath) {
console.log(`Redirecting to ${newPath} from ${window.location}`); console.log(`Redirecting to ${newPath} from ${window.location}`);
// router.go isn't loading the ID properly. // router.go isn't loading the ID properly.
window.location.href = `/${newPath}`; window.location.href = `/${newPath}`;
} }
} catch (e) {} } catch (e) {
console.error(e);
}
}; };
}, },
}; };

View File

@@ -57,5 +57,5 @@ test.each([
'configure/faq.html#frequently-asked-questions', 'configure/faq.html#frequently-asked-questions',
], // with hash ], // with hash
])('should process url %s to %s', (link: string, path: string) => { ])('should process url %s to %s', (link: string, path: string) => {
expect(getRedirect(link)).toBe(path); expect(getRedirect(new URL(link))).toBe(path);
}); });

View File

@@ -104,8 +104,7 @@ const urlRedirectMap: Record<string, string> = {
* @param link - The old documentation URL. * @param link - The old documentation URL.
* @returns The new documentation path. * @returns The new documentation path.
*/ */
export const getRedirect = (link: string): string | undefined => { export const getRedirect = (url: URL): string | undefined => {
const url = new URL(link);
// Redirects for deprecated vitepress URLs // Redirects for deprecated vitepress URLs
if (url.pathname in urlRedirectMap) { if (url.pathname in urlRedirectMap) {
return `${urlRedirectMap[url.pathname]}${url.hash}`; return `${urlRedirectMap[url.pathname]}${url.hash}`;

View File

@@ -18,7 +18,7 @@ Currently pending [IANA](https://www.iana.org/) recognition.
### Mermaid Discord workspace ### Mermaid Discord workspace
We would love to see what you create with Mermaid. Please share your creations with us in our [Discord](https://discord.gg/wwtabKgp8y) server [#showcase](https://discord.com/channels/1079455296289788015/1079502635054399649) channel. We would love to see what you create with Mermaid. Please share your creations with us in our [Discord](https://discord.gg/AgrbSrBer3) server [#showcase](https://discord.com/channels/1079455296289788015/1079502635054399649) channel.
### Add to Mermaid Ecosystem ### Add to Mermaid Ecosystem

View File

@@ -16,7 +16,7 @@ It is a JavaScript based diagramming and charting tool that renders Markdown-ins
[![Coverage Status](https://coveralls.io/repos/github/mermaid-js/mermaid/badge.svg?branch=master)](https://coveralls.io/github/mermaid-js/mermaid?branch=master) [![Coverage Status](https://coveralls.io/repos/github/mermaid-js/mermaid/badge.svg?branch=master)](https://coveralls.io/github/mermaid-js/mermaid?branch=master)
[![CDN Status](https://img.shields.io/jsdelivr/npm/hm/mermaid)](https://www.jsdelivr.com/package/npm/mermaid) [![CDN Status](https://img.shields.io/jsdelivr/npm/hm/mermaid)](https://www.jsdelivr.com/package/npm/mermaid)
[![NPM](https://img.shields.io/npm/dm/mermaid)](https://www.npmjs.com/package/mermaid) [![NPM](https://img.shields.io/npm/dm/mermaid)](https://www.npmjs.com/package/mermaid)
[![Join our Discord!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=discord&label=discord)](https://discord.gg/wwtabKgp8y) [![Join our Discord!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=discord&label=discord)](https://discord.gg/AgrbSrBer3)
[![Twitter Follow](https://img.shields.io/twitter/follow/mermaidjs_?style=social)](https://twitter.com/mermaidjs_) [![Twitter Follow](https://img.shields.io/twitter/follow/mermaidjs_?style=social)](https://twitter.com/mermaidjs_)
</div> </div>

View File

@@ -12,19 +12,6 @@ Create flowchart nodes, connect them with edges, update shapes, change colors, a
Read more about it in our latest [BLOG POST](https://www.mermaidchart.com/blog/posts/mermaid-chart-releases-new-visual-editor-for-flowcharts) and watch a [DEMO VIDEO](https://www.youtube.com/watch?v=5aja0gijoO0) on our YouTube page. Read more about it in our latest [BLOG POST](https://www.mermaidchart.com/blog/posts/mermaid-chart-releases-new-visual-editor-for-flowcharts) and watch a [DEMO VIDEO](https://www.youtube.com/watch?v=5aja0gijoO0) on our YouTube page.
## 🎉 Mermaid Chart is running a Holiday promotion
### Use <span class="text-[#FE3470]">HOLIDAYS2023</span> to get a 14-day free trial and 25% off a Pro subscription
With a Pro subscription, you get access to:
- AI functionality
- Team collaboration and multi-user editing
- Unlimited diagrams and presentations
- And more!
Redeem the promo code on the [Mermaid Chart website](https://www.mermaidchart.com/app/user/billing/checkout?coupon=HOLIDAYS2023).
## 📖 Blog posts ## 📖 Blog posts
Visit our [Blog](./blog.md) to see the latest blog posts. Visit our [Blog](./blog.md) to see the latest blog posts.

View File

@@ -1,5 +1,11 @@
# Blog # Blog
## [How one data scientist uses Mermaid Chart to quickly and easily build flowcharts](https://www.mermaidchart.com/blog/posts/customer-spotlight-ari-tal/)
23 January 2024 · 4 mins
Read about how Ari Tal, a data scientist and founder of Leveling Up with XAI, utilizes Mermaid Chart for its easy-to-use flowchart creation capabilities to enhance his work in explainable AI (XAI).
## [Introducing Mermaid Charts JetBrains IDE Extension](https://www.mermaidchart.com/blog/posts/introducing-mermaid-charts-jetbrains-ide-extension/) ## [Introducing Mermaid Charts JetBrains IDE Extension](https://www.mermaidchart.com/blog/posts/introducing-mermaid-charts-jetbrains-ide-extension/)
20 December 2023 · 5 mins 20 December 2023 · 5 mins

View File

@@ -31,8 +31,8 @@
"unocss": "^0.58.0", "unocss": "^0.58.0",
"unplugin-vue-components": "^0.26.0", "unplugin-vue-components": "^0.26.0",
"vite": "^4.4.12", "vite": "^4.4.12",
"vite-plugin-pwa": "^0.17.0", "vite-plugin-pwa": "^0.17.5",
"vitepress": "1.0.0-rc.39", "vitepress": "1.0.0-rc.40",
"workbox-window": "^7.0.0" "workbox-window": "^7.0.0"
} }
} }

View File

@@ -519,9 +519,11 @@ Styling of a sequence diagram is done by defining a number of css classes. Durin
### Classes used ### Classes used
| Class | Description | | Class | Description |
| ------------ | ----------------------------------------------------------- | | ------------ | -------------------------------------------------------------- |
| actor | Style for the actor box at the top of the diagram. | | actor | Styles for the actor box. |
| text.actor | Styles for text in the actor box at the top of the diagram. | | actor-top | Styles for the actor figure/ box at the top of the diagram. |
| actor-bottom | Styles for the actor figure/ box at the bottom of the diagram. |
| text.actor | Styles for text in the actor box. |
| actor-line | The vertical line for an actor. | | actor-line | The vertical line for an actor. |
| messageLine0 | Styles for the solid message line. | | messageLine0 | Styles for the solid message line. |
| messageLine1 | Styles for the dotted message line. | | messageLine1 | Styles for the dotted message line. |

745
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff