Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ad1992 committed Apr 23, 2024
1 parent 46a4af6 commit 3d2881a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/mermaid/src/diagrams/common/commonTypes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SVG } from '../../diagram-api/types';
import type { SVG } from '../../diagram-api/types';

Check failure on line 1 in packages/mermaid/src/diagrams/common/commonTypes.ts

View workflow job for this annotation

GitHub Actions / build-mermaid

Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '../../diagram-api/types.js'?

export interface RectData {
x: number;
Expand Down
12 changes: 7 additions & 5 deletions packages/mermaid/src/diagrams/sequence/svgDraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,13 @@ const drawActorTypeParticipant = async function (
);

let height = actor.height;
const rectNode = rectElem.node();
if (rectNode) {
const bounds = rectNode.getBBox();
actor.height = bounds.height;
height = bounds.height;
if (rectElem.node && typeof rectElem.node === 'function') {
const rectNode = rectElem.node();
if (rectNode) {
const bounds = rectNode.getBBox();
actor.height = bounds.height;
height = bounds.height;
}
}

return height;
Expand Down

0 comments on commit 3d2881a

Please sign in to comment.