diff --git a/packages/mermaid/package.json b/packages/mermaid/package.json index 4724df33c..8da8f5daa 100644 --- a/packages/mermaid/package.json +++ b/packages/mermaid/package.json @@ -1,6 +1,6 @@ { "name": "@mermaid-chart/mermaid", - "version": "10.8.0-b.4", + "version": "10.8.0-b.6", "description": "Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.", "type": "module", "module": "./dist/mermaid.core.mjs", @@ -49,14 +49,8 @@ "author": "Knut Sveidqvist", "license": "MIT", "standard": { - "ignore": [ - "**/parser/*.js", - "dist/**/*.js", - "cypress/**/*.js" - ], - "globals": [ - "page" - ] + "ignore": ["**/parser/*.js", "dist/**/*.js", "cypress/**/*.js"], + "globals": ["page"] }, "dependencies": { "@braintree/sanitize-url": "^6.0.1", @@ -124,9 +118,6 @@ "vitepress": "^1.0.0-rc.40", "vitepress-plugin-search": "^1.0.4-alpha.22" }, - "files": [ - "dist/", - "README.md" - ], + "files": ["dist/", "README.md"], "sideEffects": false } diff --git a/packages/mermaid/src/diagrams/sequence/svgDraw.js b/packages/mermaid/src/diagrams/sequence/svgDraw.js index e56f7471e..8b3891fcc 100644 --- a/packages/mermaid/src/diagrams/sequence/svgDraw.js +++ b/packages/mermaid/src/diagrams/sequence/svgDraw.js @@ -347,8 +347,10 @@ const drawActorTypeParticipant = function (elem, actor, conf, isFooter) { } } - g.attr('data-et', 'participant'); - g.attr('data-id', actor.name); + if (!isFooter) { + g.attr('data-et', 'participant'); + g.attr('data-id', actor.name); + } _drawTextCandidateFunc(conf)( actor.description, @@ -405,7 +407,9 @@ const drawActorTypeActor = function (elem, actor, conf, isFooter) { } actElem.attr('class', cssClass); - actElem.attr('data-et', 'participant').attr('data-id', actor.name); + if (isFooter) { + actElem.attr('data-et', 'participant').attr('data-id', actor.name); + } const rect = svgDrawCommon.getNoteRect(); rect.x = actor.x; diff --git a/packages/mermaid/src/mermaid.ts b/packages/mermaid/src/mermaid.ts index 933730551..63a88ea81 100644 --- a/packages/mermaid/src/mermaid.ts +++ b/packages/mermaid/src/mermaid.ts @@ -16,6 +16,7 @@ import { isDetailedError } from './utils.js'; import type { DetailedError } from './utils.js'; import type { ExternalDiagramDefinition } from './diagram-api/types.js'; import type { UnknownDiagramError } from './errors.js'; +// import { defaultConfig } from './config'; export type { MermaidConfig, @@ -309,6 +310,10 @@ const executeQueue = async () => { executionQueueRunning = false; }; +interface ConfigTuple { + defaultConfig: MermaidConfig; + config: MermaidConfig; +} /** * Parse the text and validate the syntax. * @param text - The mermaid diagram definition. @@ -319,7 +324,7 @@ const executeQueue = async () => { const parse = async ( text: string, parseOptions?: ParseOptions -): Promise => { +): Promise => { return new Promise((resolve, reject) => { // This promise will resolve when the render call is done. // It will be queued first and will be executed when it is first in line @@ -327,10 +332,13 @@ const parse = async ( new Promise((res, rej) => { mermaidAPI.parse(text, parseOptions).then( (r) => { + const result = r as Diagram & ConfigTuple; + result.defaultConfig = mermaidAPI.defaultConfig; + result.config = mermaidAPI.getConfig(); // This resolves for the promise for the queue handling - res(r); + res(result); // This fulfills the promise sent to the value back to the original caller - resolve(r); + resolve(result); }, (e) => { log.error('Error parsing', e);