diff --git a/.changeset/dry-plums-glow.md b/.changeset/dry-plums-glow.md index 810c6c5c8..e5b95dc3c 100644 --- a/.changeset/dry-plums-glow.md +++ b/.changeset/dry-plums-glow.md @@ -1,5 +1,5 @@ --- -'mermaid': minor +'mermaid': patch --- Fix for issue with calculation of label width when using in firefox diff --git a/.changeset/slow-goats-act.md b/.changeset/slow-goats-act.md deleted file mode 100644 index a21565ec3..000000000 --- a/.changeset/slow-goats-act.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@mermaid-js/layout-elk': patch ---- - -chore: fix render types diff --git a/docs/adding_new_shape/Readme.md b/docs/adding-new-shape/Readme.md similarity index 95% rename from docs/adding_new_shape/Readme.md rename to docs/adding-new-shape/Readme.md index 74e0f45ba..7d2c6eb81 100644 --- a/docs/adding_new_shape/Readme.md +++ b/docs/adding-new-shape/Readme.md @@ -2,7 +2,7 @@ > > ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT. > -> ## Please edit the corresponding file in [/packages/mermaid/src/docs/adding_new_shape/Readme.md](../../packages/mermaid/src/docs/adding_new_shape/Readme.md). +> ## Please edit the corresponding file in [/packages/mermaid/src/docs/adding-new-shape/Readme.md](../../packages/mermaid/src/docs/adding-new-shape/Readme.md). # Custom SVG Shapes Library @@ -101,9 +101,13 @@ To add a new shape: - **Example**: ```typescript - import { Node } from '../../types.d.ts'; + import { Node, RenderOptions } from '../../types.d.ts'; - export const myNewShape = async (parent: SVGAElement, node: Node) => { + export const myNewShape = async ( + parent: SVGAElement, + node: Node, + renderOptions: RenderOptions + ) => { // Create your shape here const shape = parent.insert('g').attr('class', 'my-new-shape'); // Add other elements or styles as needed @@ -209,7 +213,7 @@ To run the Cypress tests, follow these steps: 1. Ensure you have all dependencies installed by running: ```bash - npm install + pnpm install ``` 2. Start the Cypress test runner: diff --git a/packages/mermaid-layout-elk/CHANGELOG.md b/packages/mermaid-layout-elk/CHANGELOG.md index 9588e7885..f1a025d7d 100644 --- a/packages/mermaid-layout-elk/CHANGELOG.md +++ b/packages/mermaid-layout-elk/CHANGELOG.md @@ -1,5 +1,11 @@ # @mermaid-js/layout-elk +## 0.1.4 + +### Patch Changes + +- [#5847](https://github.com/mermaid-js/mermaid/pull/5847) [`dd03043`](https://github.com/mermaid-js/mermaid/commit/dd0304387e85fc57a9ebb666f89ef788c012c2c5) Thanks [@sidharthv96](https://github.com/sidharthv96)! - chore: fix render types + ## 0.1.3 ### Patch Changes diff --git a/packages/mermaid-layout-elk/package.json b/packages/mermaid-layout-elk/package.json index f229349e2..16c201ab3 100644 --- a/packages/mermaid-layout-elk/package.json +++ b/packages/mermaid-layout-elk/package.json @@ -1,6 +1,6 @@ { "name": "@mermaid-chart/layout-elk", - "version": "0.1.3-b.1", + "version": "0.1.4-b.1", "description": "ELK layout engine for mermaid", "module": "dist/mermaid-layout-elk.core.mjs", "types": "dist/layouts.d.ts", diff --git a/packages/mermaid/src/diagrams/sequence/svgDraw.js b/packages/mermaid/src/diagrams/sequence/svgDraw.js index 9e0ca9c8a..c681c9491 100644 --- a/packages/mermaid/src/diagrams/sequence/svgDraw.js +++ b/packages/mermaid/src/diagrams/sequence/svgDraw.js @@ -329,6 +329,7 @@ export const fixLifeLineHeights = (diagram, actors, actorKeys, conf) => { const drawActorTypeParticipant = function (elem, actor, conf, isFooter) { const actorY = isFooter ? actor.stopy : actor.starty; const center = actor.x + actor.width / 2; + const centerY = actorY + actor.height; const boxplusLineGroup = elem.append('g').lower(); var g = boxplusLineGroup; @@ -340,10 +341,8 @@ const drawActorTypeParticipant = function (elem, actor, conf, isFooter) { } g.append('line') .attr('id', 'actor' + actorCnt) - .attr('data-et', 'life-line') - .attr('data-id', actor.name) .attr('x1', center) - .attr('y1', actor.starty || 0 + actor.height) + .attr('y1', centerY) .attr('x2', center) .attr('y2', 2000) .attr('class', 'actor-line 200') @@ -391,11 +390,6 @@ const drawActorTypeParticipant = function (elem, actor, conf, isFooter) { } } - if (!isFooter) { - g.attr('data-et', 'participant'); - g.attr('data-id', actor.name); - } - _drawTextCandidateFunc(conf, hasKatex(actor.description))( actor.description, g, @@ -433,8 +427,6 @@ const drawActorTypeActor = function (elem, actor, conf, isFooter) { .attr('y1', centerY) .attr('x2', center) .attr('y2', 2000) - .attr('data-et', 'life-line') - .attr('data-id', actor.name) .attr('class', 'actor-line 200') .attr('stroke-width', '0.5px') .attr('stroke', '#999') @@ -452,10 +444,6 @@ const drawActorTypeActor = function (elem, actor, conf, isFooter) { actElem.attr('class', cssClass); actElem.attr('name', actor.name); - if (!isFooter) { - actElem.attr('data-et', 'participant').attr('data-id', actor.name); - } - const rect = svgDrawCommon.getNoteRect(); rect.x = actor.x; rect.y = actorY; @@ -577,10 +565,9 @@ export const drawActivation = function (elem, bounds, verticalPos, conf, actorAc * @param {any} loopModel - LoopModel of the given loop. * @param {any} labelText - Text within the loop. * @param {any} conf - Diagram configuration - * @param msg * @returns {any} */ -export const drawLoop = async function (elem, loopModel, labelText, conf, msg) { +export const drawLoop = async function (elem, loopModel, labelText, conf) { const { boxMargin, boxTextMargin, @@ -590,11 +577,7 @@ export const drawLoop = async function (elem, loopModel, labelText, conf, msg) { messageFontSize: fontSize, messageFontWeight: fontWeight, } = conf; - const g = elem - .append('g') - .attr('data-et', 'control-structure') - .attr('data-id', 'i' + msg.id); - + const g = elem.append('g'); const drawLoopLine = function (startx, starty, stopx, stopy) { return g .append('line') diff --git a/packages/mermaid/src/docs/.vitepress/components/ProductHuntBadge.vue b/packages/mermaid/src/docs/.vitepress/components/ProductHuntBadge.vue index 17f0767d7..b283c644c 100644 --- a/packages/mermaid/src/docs/.vitepress/components/ProductHuntBadge.vue +++ b/packages/mermaid/src/docs/.vitepress/components/ProductHuntBadge.vue @@ -1,11 +1,11 @@