MC-1278 Removing tagging of footer participants

This commit is contained in:
Knut Sveidqvist
2024-02-28 15:06:53 +01:00
parent 8f7fd8329d
commit 26c7ee15e9
3 changed files with 22 additions and 19 deletions

View File

@@ -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
}

View File

@@ -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;

View File

@@ -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<boolean | void | Diagram> => {
): Promise<boolean | void | (Diagram & ConfigTuple)> => {
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);