Skip to content

Commit

Permalink
Merge branch 'bug/5487-add-support-for-nested-classes' of https://git…
Browse files Browse the repository at this point in the history
…hub.com/ReneLombard/mermaid into bug/5487-add-support-for-nested-classes
  • Loading branch information
ReneLombard committed Oct 2, 2024
2 parents c5bcd2f + 3e807e0 commit a4878d0
Show file tree
Hide file tree
Showing 17 changed files with 582 additions and 511 deletions.
2 changes: 1 addition & 1 deletion .changeset/dry-plums-glow.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'mermaid': minor
'mermaid': patch
---

Fix for issue with calculation of label width when using in firefox
5 changes: 0 additions & 5 deletions .changeset/slow-goats-act.md

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/release-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Preview release
on:
pull_request:
branches: [develop]
types: [opened, synchronize, labeled, ready_for_review]

concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}
Expand Down
6 changes: 3 additions & 3 deletions docs/config/setup/classes/mermaid.UnknownDiagramError.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Error.prepareStackTrace

#### Defined in

node_modules/@types/node/globals.d.ts:28
node_modules/.pnpm/@types+node\@20.16.2/node_modules/@types/node/globals.d.ts:28

---

Expand All @@ -141,7 +141,7 @@ Error.stackTraceLimit

#### Defined in

node_modules/@types/node/globals.d.ts:30
node_modules/.pnpm/@types+node\@20.16.2/node_modules/@types/node/globals.d.ts:30

## Methods

Expand All @@ -168,4 +168,4 @@ Error.captureStackTrace

#### Defined in

node_modules/@types/node/globals.d.ts:21
node_modules/.pnpm/@types+node\@20.16.2/node_modules/@types/node/globals.d.ts:21
6 changes: 6 additions & 0 deletions packages/mermaid-layout-elk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/mermaid-layout-elk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mermaid-js/layout-elk",
"version": "0.1.3",
"version": "0.1.4",
"description": "ELK layout engine for mermaid",
"module": "dist/mermaid-layout-elk.core.mjs",
"types": "dist/layouts.d.ts",
Expand Down
2 changes: 0 additions & 2 deletions packages/mermaid/src/diagrams/class/classDb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ const setupToolTips = function (element: Element) {
// @ts-ignore - getBoundingClientRect is not part of the d3 type definition
const rect = this.getBoundingClientRect();

// @ts-expect-error - Incorrect types
tooltipElem.transition().duration(200).style('opacity', '.9');
tooltipElem
.text(el.attr('title'))
Expand All @@ -399,7 +398,6 @@ const setupToolTips = function (element: Element) {
el.classed('hover', true);
})
.on('mouseout', function () {
// @ts-expect-error - Incorrect types
tooltipElem.transition().duration(500).style('opacity', 0);
const el = select(this);
el.classed('hover', false);
Expand Down
2 changes: 0 additions & 2 deletions packages/mermaid/src/diagrams/flowchart/flowDb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,6 @@ const setupToolTips = function (element: Element) {
}
const rect = (this as Element)?.getBoundingClientRect();

// @ts-ignore TODO: fix this
tooltipElem.transition().duration(200).style('opacity', '.9');
tooltipElem
.text(el.attr('title'))
Expand All @@ -435,7 +434,6 @@ const setupToolTips = function (element: Element) {
el.classed('hover', true);
})
.on('mouseout', function () {
// @ts-ignore TODO: fix this
tooltipElem.transition().duration(500).style('opacity', 0);
const el = select(this);
el.classed('hover', false);
Expand Down
7 changes: 3 additions & 4 deletions packages/mermaid/src/diagrams/gantt/parser/gantt.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { parser } from './gantt.jison';
import ganttDb from '../ganttDb.js';
import { convert } from '../../../tests/util.js';
import { vi } from 'vitest';
import { vi, it } from 'vitest';
const spyOn = vi.spyOn;
const parserFnConstructor = (str) => {
return () => {
Expand Down Expand Up @@ -150,14 +149,14 @@ describe('when parsing a gantt diagram it', function () {
expect(tasks[3].id).toEqual('d');
expect(tasks[3].task).toEqual('task D');
});
it.each(convert`
it.each`
tags | milestone | done | crit | active
${'milestone'} | ${true} | ${false} | ${false} | ${false}
${'done'} | ${false} | ${true} | ${false} | ${false}
${'crit'} | ${false} | ${false} | ${true} | ${false}
${'active'} | ${false} | ${false} | ${false} | ${true}
${'crit,milestone,done'} | ${true} | ${true} | ${true} | ${false}
`)('should handle a task with tags $tags', ({ tags, milestone, done, crit, active }) => {
`('should handle a task with tags $tags', ({ tags, milestone, done, crit, active }) => {
const str =
'gantt\n' +
'dateFormat YYYY-MM-DD\n' +
Expand Down
4 changes: 2 additions & 2 deletions packages/mermaid/src/diagrams/pie/pie.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ describe('pie', () => {
expect(sections.get('bat')).toBe(40);
});

it('should handle simple pie with negative decimal', () => {
expect(async () => {
it('should handle simple pie with negative decimal', async () => {
await expect(async () => {
await parser.parse(`pie
"ash" : -60.67
"bat" : 40.12
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2063,8 +2063,8 @@ participant Alice`;
});
});

it.each(['__proto__', 'constructor'])('should allow %s as an actor name', function (prop) {
expect(
it.each(['__proto__', 'constructor'])('should allow %s as an actor name', async function (prop) {
await expect(
mermaidAPI.parse(`
sequenceDiagram
${prop}-->>A: Hello, how are you?`)
Expand Down
2 changes: 1 addition & 1 deletion packages/mermaid/src/diagrams/sequence/svgDraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +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 + 5;
const centerY = actorY + actor.height;

const boxplusLineGroup = elem.append('g').lower();
var g = boxplusLineGroup;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<template>
<div class="-mt-6 mb-8">
<a
href="https://www.producthunt.com/posts/mermaid-ai-2?embed=true&utm_source=badge-featured&utm_medium=badge&utm_souce=badge-mermaid&#0045;ai&#0045;2"
href="https://www.producthunt.com/products/mermaid-chart?utm_source=badge-follow&utm_medium=badge&utm_souce=badge-mermaid&#0045;chart"
target="_blank"
><img
src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=465568&theme=light"
alt="Mermaid&#0032;AI - Maximize&#0032;your&#0032;diagramming&#0032;efficiency&#0032;with&#0032;Mermaid&#0032;AI | Product Hunt"
src="https://api.producthunt.com/widgets/embed-image/v1/follow.svg?product_id=552855&theme=light"
alt="Mermaid&#0032;Chart - A&#0032;smarter&#0032;way&#0032;to&#0032;create&#0032;diagrams | Product Hunt"
style="width: 250px; height: 54px"
width="250"
height="54"
Expand Down
3 changes: 3 additions & 0 deletions packages/mermaid/src/docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import Contributors from '../components/Contributors.vue';
import HomePage from '../components/HomePage.vue';
// @ts-ignore Type not available
import TopBar from '../components/TopBar.vue';
// @ts-ignore Type not available
import ProductHuntBadge from '../components/ProductHuntBadge.vue';
import { getRedirect } from './redirect.js';
// @ts-ignore Type not available
import 'uno.css';
Expand All @@ -23,6 +25,7 @@ export default {
return h(Theme.Layout, null, {
// Keeping this as comment as it took a lot of time to figure out how to add a component to the top bar.
'home-hero-before': () => h(TopBar),
'home-hero-info-before': () => h(ProductHuntBadge),
'home-features-after': () => h(HomePage),
'doc-before': () => h(TopBar),
});
Expand Down
1 change: 0 additions & 1 deletion packages/parser/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"rootDir": ".",
"outDir": "./dist",
"allowJs": false,
"preserveSymlinks": false,
"strictPropertyInitialization": false
},
"include": ["./src/**/*.ts", "./tests/**/*.ts"],
Expand Down
Loading

0 comments on commit a4878d0

Please sign in to comment.