From 053c966d5ff1bab35c76211e7063bac93b86008b Mon Sep 17 00:00:00 2001 From: jasmaa Date: Sat, 8 Oct 2022 16:51:11 -0400 Subject: [PATCH 01/42] Order pie chart slices clockwise by order of entries --- .../mermaid/src/diagrams/pie/pieRenderer.js | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/packages/mermaid/src/diagrams/pie/pieRenderer.js b/packages/mermaid/src/diagrams/pie/pieRenderer.js index f8e21bc9d..42b45162c 100644 --- a/packages/mermaid/src/diagrams/pie/pieRenderer.js +++ b/packages/mermaid/src/diagrams/pie/pieRenderer.js @@ -94,10 +94,22 @@ export const draw = (txt, id, _version, diagObj) => { var color = scaleOrdinal().range(myGeneratedColors); // Compute the position of each group on the pie: - var pie = d3pie().value(function (d) { - return d[1]; + var pieData = Object.entries(data).map(function (el, idx) { + return { + order: idx, + name: el[0], + value: el[1], + }; }); - var dataReady = pie(Object.entries(data)); + var pie = d3pie() + .value(function (d) { + return d.value; + }) + .sort(function (a, b) { + // Sort slices in clockwise direction + return a.order - b.order; + }); + var dataReady = pie(pieData); // Shape helper to build arcs: var arcGenerator = arc().innerRadius(0).outerRadius(radius); @@ -110,7 +122,7 @@ export const draw = (txt, id, _version, diagObj) => { .append('path') .attr('d', arcGenerator) .attr('fill', function (d) { - return color(d.data[0]); + return color(d.data.name); }) .attr('class', 'pieCircle'); @@ -122,7 +134,7 @@ export const draw = (txt, id, _version, diagObj) => { .enter() .append('text') .text(function (d) { - return ((d.data[1] / sum) * 100).toFixed(0) + '%'; + return ((d.data.value / sum) * 100).toFixed(0) + '%'; }) .attr('transform', function (d) { return 'translate(' + arcGenerator.centroid(d) + ')'; @@ -166,9 +178,9 @@ export const draw = (txt, id, _version, diagObj) => { .attr('y', legendRectSize - legendSpacing) .text(function (d) { if (diagObj.db.getShowData() || conf.showData || conf.pie.showData) { - return d.data[0] + ' [' + d.data[1] + ']'; + return d.data.name + ' [' + d.data.value + ']'; } else { - return d.data[0]; + return d.data.name; } }); } catch (e) { From 98f4c2d3ae5dcc3c5415a432df0011f3e34d08a1 Mon Sep 17 00:00:00 2001 From: jasmaa Date: Sun, 9 Oct 2022 20:56:31 -0400 Subject: [PATCH 02/42] Update pie docs to reflect label order change --- docs/pie.md | 2 +- packages/mermaid/src/docs/pie.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/pie.md b/docs/pie.md index f59efd93a..1b70fdb86 100644 --- a/docs/pie.md +++ b/docs/pie.md @@ -28,7 +28,7 @@ Drawing a pie chart is really simple in mermaid. - Start with `pie` keyword to begin the diagram - `showData` to render the actual data values after the legend text. This is **_OPTIONAL_** - Followed by `title` keyword and its value in string to give a title to the pie-chart. This is **_OPTIONAL_** -- Followed by dataSet +- Followed by dataSet. Pie slices will be ordered clockwise in the same order as the labels. - `label` for a section in the pie diagram within `" "` quotes. - Followed by `:` colon as separator - Followed by `positive numeric value` (supported upto two decimal places) diff --git a/packages/mermaid/src/docs/pie.md b/packages/mermaid/src/docs/pie.md index b7dcd7aa5..4e14efce1 100644 --- a/packages/mermaid/src/docs/pie.md +++ b/packages/mermaid/src/docs/pie.md @@ -19,7 +19,7 @@ Drawing a pie chart is really simple in mermaid. - Start with `pie` keyword to begin the diagram - `showData` to render the actual data values after the legend text. This is **_OPTIONAL_** - Followed by `title` keyword and its value in string to give a title to the pie-chart. This is **_OPTIONAL_** -- Followed by dataSet +- Followed by dataSet. Pie slices will be ordered clockwise in the same order as the labels. - `label` for a section in the pie diagram within `" "` quotes. - Followed by `:` colon as separator - Followed by `positive numeric value` (supported upto two decimal places) From 7e8631dd196e9bca7d1fdbc9346d9037e783102d Mon Sep 17 00:00:00 2001 From: Michael Maier Date: Mon, 10 Oct 2022 17:59:29 +0200 Subject: [PATCH 03/42] fix: vertex property `props` is overwritten instead of being merged with new value Fixes #3263 --- packages/mermaid/src/diagrams/flowchart/flowDb.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/mermaid/src/diagrams/flowchart/flowDb.js b/packages/mermaid/src/diagrams/flowchart/flowDb.js index 5aa203225..34efa86d8 100644 --- a/packages/mermaid/src/diagrams/flowchart/flowDb.js +++ b/packages/mermaid/src/diagrams/flowchart/flowDb.js @@ -119,7 +119,11 @@ export const addVertex = function (_id, text, type, style, classes, dir, props = if (typeof dir !== 'undefined') { vertices[id].dir = dir; } - vertices[id].props = props; + if (typeof vertices[id].props === 'undefined') { + vertices[id].props = props; + } else if (typeof props !== 'undefined') { + Object.assign(vertices[id].props, props); + } }; /** From f05f07e44f722222615e878d759b74c18af65ac7 Mon Sep 17 00:00:00 2001 From: Dima Kurilo Date: Mon, 10 Oct 2022 20:53:09 -0400 Subject: [PATCH 04/42] add the way to add notes to class diagram --- README.md | 2 + .../mermaid/src/diagrams/class/classDb.js | 17 ++++ .../src/diagrams/class/classDiagram.spec.js | 10 ++ .../src/diagrams/class/classRenderer-v2.js | 95 +++++++++++++++++++ .../src/diagrams/class/classRenderer.js | 32 ++++++- .../diagrams/class/parser/classDiagram.jison | 10 ++ packages/mermaid/src/diagrams/class/styles.js | 4 + .../mermaid/src/diagrams/class/svgDraw.js | 75 ++++++++++++++- packages/mermaid/src/utils.ts | 7 +- 9 files changed, 241 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index b30d8d438..e363c7447 100644 --- a/README.md +++ b/README.md @@ -162,6 +162,7 @@ Class01 <|-- AveryLongClass : Cool Class09 --> C2 : Where am I? Class09 --* C3 Class09 --|> Class07 +note "I love this diagram!\nDo you love it?" Class07 : equals() Class07 : Object[] elementData Class01 : size() @@ -172,6 +173,7 @@ class Class10 { int id size() } +note for Class10 "Cool class\nI said it's very cool class!" ``` ### State diagram [docs - live editor] diff --git a/packages/mermaid/src/diagrams/class/classDb.js b/packages/mermaid/src/diagrams/class/classDb.js index 223bfe067..fd970b902 100644 --- a/packages/mermaid/src/diagrams/class/classDb.js +++ b/packages/mermaid/src/diagrams/class/classDb.js @@ -16,6 +16,7 @@ const MERMAID_DOM_ID_PREFIX = 'classid-'; let relations = []; let classes = {}; +let notes = []; let classCounter = 0; let funs = []; @@ -82,6 +83,7 @@ export const lookUpDomId = function (id) { export const clear = function () { relations = []; classes = {}; + notes = []; funs = []; funs.push(setupToolTips); commonClear(); @@ -98,6 +100,10 @@ export const getRelations = function () { return relations; }; +export const getNotes = function () { + return notes; +}; + export const addRelation = function (relation) { log.debug('Adding relation: ' + JSON.stringify(relation)); addClass(relation.id1); @@ -168,6 +174,15 @@ export const addMembers = function (className, members) { } }; +export const addNote = function (text, className) { + const note = { + id: `note${notes.length}`, + class: className, + text: text, + }; + notes.push(note); +}; + export const cleanupLabel = function (label) { if (label.substring(0, 1) === ':') { return common.sanitizeText(label.substr(1).trim(), configApi.getConfig()); @@ -369,7 +384,9 @@ export default { clear, getClass, getClasses, + getNotes, addAnnotation, + addNote, getRelations, addRelation, getDirection, diff --git a/packages/mermaid/src/diagrams/class/classDiagram.spec.js b/packages/mermaid/src/diagrams/class/classDiagram.spec.js index 3f47701e6..04a8e9bf3 100644 --- a/packages/mermaid/src/diagrams/class/classDiagram.spec.js +++ b/packages/mermaid/src/diagrams/class/classDiagram.spec.js @@ -529,6 +529,16 @@ foo() parser.parse(str); }); + + it('should handle "note for"', function () { + const str = 'classDiagram\n' + 'Class11 <|.. Class12\n' + 'note for Class11 "test"\n'; + parser.parse(str); + }); + + it('should handle "note"', function () { + const str = 'classDiagram\n' + 'note "test"\n'; + parser.parse(str); + }); }); describe('when fetching data from a classDiagram graph it', function () { diff --git a/packages/mermaid/src/diagrams/class/classRenderer-v2.js b/packages/mermaid/src/diagrams/class/classRenderer-v2.js index 20722e6d0..ab556c4ae 100644 --- a/packages/mermaid/src/diagrams/class/classRenderer-v2.js +++ b/packages/mermaid/src/diagrams/class/classRenderer-v2.js @@ -133,6 +133,99 @@ export const addClasses = function (classes, g, _id, diagObj) { }); }; +/** + * Function that adds the additional vertices (notes) found during parsing to the graph to be rendered. + * + * @param {{text: string; class: string; placement: number}[]} notes + * Object containing the additional vertices (notes). + * @param {SVGGElement} g The graph that is to be drawn. + * @param {number} startEdgeId starting index for note edge + * @param classes + */ +export const addNotes = function (notes, g, startEdgeId, classes) { + log.info(notes); + + // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition + notes.forEach(function (note, i) { + const vertex = note; + + /** + * Variable for storing the classes for the vertex + * + * @type {string} + */ + let cssNoteStr = ''; + + const styles = { labelStyle: '', style: '' }; + + // Use vertex id as text in the box if no text is provided by the graph definition + let vertexText = vertex.text; + + let radious = 0; + let _shape = 'note'; + // Add the node + g.setNode(vertex.id, { + labelStyle: styles.labelStyle, + shape: _shape, + labelText: sanitizeText(vertexText), + noteData: vertex, + rx: radious, + ry: radious, + class: cssNoteStr, + style: styles.style, + id: vertex.id, + domId: vertex.id, + tooltip: '', + type: 'note', + padding: getConfig().flowchart.padding, + }); + + log.info('setNode', { + labelStyle: styles.labelStyle, + shape: _shape, + labelText: vertexText, + rx: radious, + ry: radious, + style: styles.style, + id: vertex.id, + type: 'note', + padding: getConfig().flowchart.padding, + }); + + if (!vertex.class || !(vertex.class in classes)) { + return; + } + const edgeId = startEdgeId + i; + const edgeData = {}; + //Set relationship style and line type + edgeData.classes = 'relation'; + edgeData.pattern = 'dotted'; + + edgeData.id = `edgeNote${edgeId}`; + // Set link type for rendering + edgeData.arrowhead = 'none'; + + log.info(`Note edge: ${JSON.stringify(edgeData)}, ${JSON.stringify(vertex)}`); + //Set edge extra labels + edgeData.startLabelRight = ''; + edgeData.endLabelLeft = ''; + + //Set relation arrow types + edgeData.arrowTypeStart = 'none'; + edgeData.arrowTypeEnd = 'none'; + let style = 'fill:none'; + let labelStyle = ''; + + edgeData.style = style; + edgeData.labelStyle = labelStyle; + + edgeData.curve = interpolateToCurve(conf.curve, curveLinear); + + // Add the edge to the graph + g.setEdge(vertex.id, vertex.class, edgeData, edgeId); + }); +}; + /** * Add edges to graph based on parsed graph definition * @@ -304,10 +397,12 @@ export const draw = function (text, id, _version, diagObj) { // Fetch the vertices/nodes and edges/links from the parsed graph definition const classes = diagObj.db.getClasses(); const relations = diagObj.db.getRelations(); + const notes = diagObj.db.getNotes(); log.info(relations); addClasses(classes, g, id, diagObj); addRelations(relations, g); + addNotes(notes, g, relations.length + 1, classes); // Add custom shapes // flowChartShapes.addToRenderV2(addShape); diff --git a/packages/mermaid/src/diagrams/class/classRenderer.js b/packages/mermaid/src/diagrams/class/classRenderer.js index c1236afea..14fdc5efe 100644 --- a/packages/mermaid/src/diagrams/class/classRenderer.js +++ b/packages/mermaid/src/diagrams/class/classRenderer.js @@ -208,12 +208,42 @@ export const draw = function (text, id, _version, diagObj) { ); }); + const notes = diagObj.db.getNotes(); + notes.forEach(function (note) { + log.debug(`Adding note: ${JSON.stringify(note)}`); + const node = svgDraw.drawNote(diagram, note, conf, diagObj); + idCache[node.id] = node; + + // Add nodes to the graph. The first argument is the node id. The second is + // metadata about the node. In this case we're going to add labels to each of + // our nodes. + g.setNode(node.id, node); + if (note.class && note.class in classes) { + g.setEdge( + note.id, + getGraphId(note.class), + { + relation: { + id1: note.id, + id2: note.class, + relation: { + type1: 'none', + type2: 'none', + lineType: 10, + }, + }, + }, + 'DEFAULT' + ); + } + }); + dagre.layout(g); g.nodes().forEach(function (v) { if (typeof v !== 'undefined' && typeof g.node(v) !== 'undefined') { log.debug('Node ' + v + ': ' + JSON.stringify(g.node(v))); root - .select('#' + diagObj.db.lookUpDomId(v)) + .select('#' + (diagObj.db.lookUpDomId(v) || v)) .attr( 'transform', 'translate(' + diff --git a/packages/mermaid/src/diagrams/class/parser/classDiagram.jison b/packages/mermaid/src/diagrams/class/parser/classDiagram.jison index ba0e69fba..157e3d7d8 100644 --- a/packages/mermaid/src/diagrams/class/parser/classDiagram.jison +++ b/packages/mermaid/src/diagrams/class/parser/classDiagram.jison @@ -56,6 +56,8 @@ accDescr\s*"{"\s* { this.begin("acc_descr_multili "callback" return 'CALLBACK'; "link" return 'LINK'; "click" return 'CLICK'; +"note for" return 'NOTE_FOR'; +"note" return 'NOTE'; "<<" return 'ANNOTATION_START'; ">>" return 'ANNOTATION_END'; [~] this.begin("generic"); @@ -263,6 +265,7 @@ statement | annotationStatement | clickStatement | cssClassStatement + | noteStatement | directive | direction | acc_title acc_title_value { $$=$2.trim();yy.setAccTitle($$); } @@ -300,6 +303,11 @@ relationStatement | className STR relation STR className { $$ = {id1:$1, id2:$5, relation:$3, relationTitle1:$2, relationTitle2:$4} } ; +noteStatement + : NOTE_FOR className noteText { yy.addNote($3, $2); } + | NOTE noteText { yy.addNote($2); } + ; + relation : relationType lineType relationType { $$={type1:$1,type2:$3,lineType:$2}; } | lineType relationType { $$={type1:'none',type2:$2,lineType:$1}; } @@ -351,4 +359,6 @@ alphaNumToken : UNICODE_TEXT | NUM | ALPHA; classLiteralName : BQUOTE_STR; +noteText : STR; + %% diff --git a/packages/mermaid/src/diagrams/class/styles.js b/packages/mermaid/src/diagrams/class/styles.js index 9e7665c58..bb5580492 100644 --- a/packages/mermaid/src/diagrams/class/styles.js +++ b/packages/mermaid/src/diagrams/class/styles.js @@ -80,6 +80,10 @@ g.classGroup line { stroke-dasharray: 3; } +.dotted-line{ + stroke-dasharray: 1 2; +} + #compositionStart, .composition { fill: ${options.lineColor} !important; stroke: ${options.lineColor} !important; diff --git a/packages/mermaid/src/diagrams/class/svgDraw.js b/packages/mermaid/src/diagrams/class/svgDraw.js index 9a4dc761e..bcb0d2c3d 100644 --- a/packages/mermaid/src/diagrams/class/svgDraw.js +++ b/packages/mermaid/src/diagrams/class/svgDraw.js @@ -9,13 +9,13 @@ export const drawEdge = function (elem, path, relation, conf, diagObj) { switch (type) { case diagObj.db.relationType.AGGREGATION: return 'aggregation'; - case diagObj.db.EXTENSION: + case diagObj.db.relationType.EXTENSION: return 'extension'; - case diagObj.db.COMPOSITION: + case diagObj.db.relationType.COMPOSITION: return 'composition'; - case diagObj.db.DEPENDENCY: + case diagObj.db.relationType.DEPENDENCY: return 'dependency'; - case diagObj.db.LOLLIPOP: + case diagObj.db.relationType.LOLLIPOP: return 'lollipop'; } }; @@ -55,6 +55,9 @@ export const drawEdge = function (elem, path, relation, conf, diagObj) { if (relation.relation.lineType == 1) { svgPath.attr('class', 'relation dashed-line'); } + if (relation.relation.lineType == 10) { + svgPath.attr('class', 'relation dotted-line'); + } if (relation.relation.type1 !== 'none') { svgPath.attr( 'marker-start', @@ -284,6 +287,69 @@ export const drawClass = function (elem, classDef, conf, diagObj) { return classInfo; }; +/** + * Renders a note diagram + * + * @param {SVGSVGElement} elem The element to draw it into + * @param {{id: string; text: string; class: string;}} note + * @param conf + * @param diagObj + * @todo Add more information in the JSDOC here + */ +export const drawNote = function (elem, note, conf, diagObj) { + log.debug('Rendering note ', note, conf); + + const id = note.id; + const noteInfo = { + id: id, + text: note.text, + width: 0, + height: 0, + }; + + // add class group + const g = elem.append('g').attr('id', id).attr('class', 'classGroup'); + + // add text + let text = g + .append('text') + .attr('y', conf.textHeight + conf.padding) + .attr('x', 0); + + const lines = JSON.parse(`"${note.text}"`).split('\n'); + + lines.forEach(function (line) { + log.debug(`Adding line: ${line}`); + text.append('tspan').text(line).attr('class', 'title').attr('dy', conf.textHeight); + }); + + const noteBox = g.node().getBBox(); + + const rect = g + .insert('rect', ':first-child') + .attr('x', 0) + .attr('y', 0) + .attr('width', noteBox.width + 2 * conf.padding) + .attr( + 'height', + noteBox.height + lines.length * conf.textHeight + conf.padding + 0.5 * conf.dividerMargin + ); + + const rectWidth = rect.node().getBBox().width; + + // Center title + // We subtract the width of each text element from the class box width and divide it by 2 + text.node().childNodes.forEach(function (x) { + x.setAttribute('x', (rectWidth - x.getBBox().width) / 2); + }); + + noteInfo.width = rectWidth; + noteInfo.height = + noteBox.height + lines.length * conf.textHeight + conf.padding + 0.5 * conf.dividerMargin; + + return noteInfo; +}; + export const parseMember = function (text) { const fieldRegEx = /^(\+|-|~|#)?(\w+)(~\w+~|\[\])?\s+(\w+) *(\*|\$)?$/; const methodRegEx = /^([+|\-|~|#])?(\w+) *\( *(.*)\) *(\*|\$)? *(\w*[~|[\]]*\s*\w*~?)$/; @@ -435,5 +501,6 @@ const parseClassifier = function (classifier) { export default { drawClass, drawEdge, + drawNote, parseMember, }; diff --git a/packages/mermaid/src/utils.ts b/packages/mermaid/src/utils.ts index 395e6fe2a..a62c4d3ad 100644 --- a/packages/mermaid/src/utils.ts +++ b/packages/mermaid/src/utils.ts @@ -306,15 +306,10 @@ const calcLabelPosition = (points) => { const calcCardinalityPosition = (isRelationTypePresent, points, initialPosition) => { let prevPoint; - log.info('our points', points); + log.info(`our points ${JSON.stringify(points)}`); if (points[0] !== initialPosition) { points = points.reverse(); } - points.forEach((point) => { - totalDistance += distance(point, prevPoint); - prevPoint = point; - }); - // Traverse only 25 total distance along points to find cardinality point const distanceToCardinalityPoint = 25; From 551b37f969a3de62725e40289159852f99400ff8 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Tue, 11 Oct 2022 12:29:39 +0200 Subject: [PATCH 05/42] #3252 Handling for trailing whitespaces in subgraph titles --- packages/mermaid/src/diagrams/flowchart/flowDb.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mermaid/src/diagrams/flowchart/flowDb.js b/packages/mermaid/src/diagrams/flowchart/flowDb.js index 5aa203225..4a3fd5e9c 100644 --- a/packages/mermaid/src/diagrams/flowchart/flowDb.js +++ b/packages/mermaid/src/diagrams/flowchart/flowDb.js @@ -456,8 +456,8 @@ export const defaultStyle = function () { export const addSubGraph = function (_id, list, _title) { // console.log('addSubGraph', _id, list, _title); let id = _id.trim(); - let title = _title; - if (_id === _title && _title.match(/\s/)) { + let title = _title.trim(); + if (id === title && title.match(/\s/)) { id = undefined; } /** @param a */ From 44706bc32ecb0cda6a9596bad69fc95e32bd153e Mon Sep 17 00:00:00 2001 From: Dima Kurilo Date: Tue, 11 Oct 2022 19:02:43 -0400 Subject: [PATCH 06/42] add statement aliases for ER diagram --- .../mermaid/src/diagrams/er/parser/erDiagram.jison | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/mermaid/src/diagrams/er/parser/erDiagram.jison b/packages/mermaid/src/diagrams/er/parser/erDiagram.jison index 6294599b5..3af56221c 100644 --- a/packages/mermaid/src/diagrams/er/parser/erDiagram.jison +++ b/packages/mermaid/src/diagrams/er/parser/erDiagram.jison @@ -36,15 +36,29 @@ accDescr\s*"{"\s* { this.begin("acc_descr_multili [\n]+ /* nothing */ "}" { this.popState(); return 'BLOCK_STOP'; } . return yytext[0]; + +"one or zero" return 'ZERO_OR_ONE'; +"one or more" return 'ONE_OR_MORE'; +"one or many" return 'ONE_OR_MORE'; \|o return 'ZERO_OR_ONE'; +"zero or one" return 'ZERO_OR_ONE'; +"zero or more" return 'ZERO_OR_MORE'; +"zero or many" return 'ZERO_OR_MORE'; \}o return 'ZERO_OR_MORE'; +"many(0)" return 'ZERO_OR_MORE'; +"many(1)" return 'ONE_OR_MORE'; +"many" return 'ZERO_OR_MORE'; \}\| return 'ONE_OR_MORE'; +"one" return 'ONLY_ONE'; +"only one" return 'ONLY_ONE'; \|\| return 'ONLY_ONE'; o\| return 'ZERO_OR_ONE'; o\{ return 'ZERO_OR_MORE'; \|\{ return 'ONE_OR_MORE'; \.\. return 'NON_IDENTIFYING'; \-\- return 'IDENTIFYING'; +"to" return 'IDENTIFYING'; +"optionally to" return 'NON_IDENTIFYING'; \.\- return 'NON_IDENTIFYING'; \-\. return 'NON_IDENTIFYING'; [A-Za-z][A-Za-z0-9\-_]* return 'ALPHANUM'; From 3e1b23505544b30110646ceb390810f859758ece Mon Sep 17 00:00:00 2001 From: Dima Kurilo Date: Tue, 11 Oct 2022 19:37:05 -0400 Subject: [PATCH 07/42] add tests --- .../src/diagrams/er/parser/erDiagram.spec.js | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/packages/mermaid/src/diagrams/er/parser/erDiagram.spec.js b/packages/mermaid/src/diagrams/er/parser/erDiagram.spec.js index 1d891ffea..e7540fcec 100644 --- a/packages/mermaid/src/diagrams/er/parser/erDiagram.spec.js +++ b/packages/mermaid/src/diagrams/er/parser/erDiagram.spec.js @@ -532,18 +532,90 @@ describe('when parsing ER diagram it...', function () { expect(rels[0].relSpec.cardB).toBe(erDb.Cardinality.ONE_OR_MORE); }); + it('should handle zero-or-one-to-zero-or-more relationships (aliases "one or zero" and "zero or many")', function () { + erDiagram.parser.parse('erDiagram\nA one or zero to many B : has'); + const rels = erDb.getRelationships(); + + expect(Object.keys(erDb.getEntities()).length).toBe(2); + expect(rels.length).toBe(1); + expect(rels[0].relSpec.cardA).toBe(erDb.Cardinality.ZERO_OR_MORE); + expect(rels[0].relSpec.cardB).toBe(erDb.Cardinality.ZERO_OR_ONE); + }); + + it('should handle one-or-more-to-zero-or-one relationships (aliases "one or many" and "zero or one")', function () { + erDiagram.parser.parse('erDiagram\nA one or many optionally to zero or one B : has'); + const rels = erDb.getRelationships(); + + expect(Object.keys(erDb.getEntities()).length).toBe(2); + expect(rels.length).toBe(1); + expect(rels[0].relSpec.cardA).toBe(erDb.Cardinality.ZERO_OR_ONE); + expect(rels[0].relSpec.cardB).toBe(erDb.Cardinality.ONE_OR_MORE); + }); + + it('should handle zero-or-more-to-zero-or-more relationships (aliases "zero or more" and "zero or many")', function () { + erDiagram.parser.parse('erDiagram\nA zero or more to zero or many B : has'); + const rels = erDb.getRelationships(); + + expect(Object.keys(erDb.getEntities()).length).toBe(2); + expect(rels.length).toBe(1); + expect(rels[0].relSpec.cardA).toBe(erDb.Cardinality.ZERO_OR_MORE); + expect(rels[0].relSpec.cardB).toBe(erDb.Cardinality.ZERO_OR_MORE); + }); + + it('should handle zero-or-more-to-one-or-more relationships (aliases "many(0)" and "many(1)")', function () { + erDiagram.parser.parse('erDiagram\nA many(0) to many(1) B : has'); + const rels = erDb.getRelationships(); + + expect(Object.keys(erDb.getEntities()).length).toBe(2); + expect(rels.length).toBe(1); + expect(rels[0].relSpec.cardA).toBe(erDb.Cardinality.ONE_OR_MORE); + expect(rels[0].relSpec.cardB).toBe(erDb.Cardinality.ZERO_OR_MORE); + }); + + it('should handle zero-or-more-to-only-one relationships (aliases "many(0)" and "many(1)")', function () { + erDiagram.parser.parse('erDiagram\nA many optionally to one B : has'); + const rels = erDb.getRelationships(); + + expect(Object.keys(erDb.getEntities()).length).toBe(2); + expect(rels.length).toBe(1); + expect(rels[0].relSpec.cardA).toBe(erDb.Cardinality.ONLY_ONE); + expect(rels[0].relSpec.cardB).toBe(erDb.Cardinality.ZERO_OR_MORE); + }); + + it('should handle only-one-to-only-one relationships (aliases "only one")', function () { + erDiagram.parser.parse('erDiagram\nA only one optionally to only one B : has'); + const rels = erDb.getRelationships(); + + expect(Object.keys(erDb.getEntities()).length).toBe(2); + expect(rels.length).toBe(1); + expect(rels[0].relSpec.cardA).toBe(erDb.Cardinality.ONLY_ONE); + expect(rels[0].relSpec.cardB).toBe(erDb.Cardinality.ONLY_ONE); + }); + it('should represent identifying relationships properly', function () { erDiagram.parser.parse('erDiagram\nHOUSE ||--|{ ROOM : contains'); const rels = erDb.getRelationships(); expect(rels[0].relSpec.relType).toBe(erDb.Identification.IDENTIFYING); }); + it('should represent identifying relationships properly (alias "to")', function () { + erDiagram.parser.parse('erDiagram\nHOUSE one to one ROOM : contains'); + const rels = erDb.getRelationships(); + expect(rels[0].relSpec.relType).toBe(erDb.Identification.IDENTIFYING); + }); + it('should represent non-identifying relationships properly', function () { erDiagram.parser.parse('erDiagram\n PERSON ||..o{ POSSESSION : owns'); const rels = erDb.getRelationships(); expect(rels[0].relSpec.relType).toBe(erDb.Identification.NON_IDENTIFYING); }); + it('should represent non-identifying relationships properly (alias "optionally to")', function () { + erDiagram.parser.parse('erDiagram\n PERSON many optionally to many POSSESSION : owns'); + const rels = erDb.getRelationships(); + expect(rels[0].relSpec.relType).toBe(erDb.Identification.NON_IDENTIFYING); + }); + it('should not accept a syntax error', function () { const doc = 'erDiagram\nA xxx B : has'; expect(() => { From 4fc3cc7aff7317929a610e0856101ac729056485 Mon Sep 17 00:00:00 2001 From: Dima Kurilo Date: Tue, 11 Oct 2022 21:57:00 -0400 Subject: [PATCH 08/42] add aliases '0+', '1+' and '1' --- .../src/diagrams/er/parser/erDiagram.jison | 3 +++ .../src/diagrams/er/parser/erDiagram.spec.js | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/packages/mermaid/src/diagrams/er/parser/erDiagram.jison b/packages/mermaid/src/diagrams/er/parser/erDiagram.jison index 3af56221c..f0411fd72 100644 --- a/packages/mermaid/src/diagrams/er/parser/erDiagram.jison +++ b/packages/mermaid/src/diagrams/er/parser/erDiagram.jison @@ -40,10 +40,12 @@ accDescr\s*"{"\s* { this.begin("acc_descr_multili "one or zero" return 'ZERO_OR_ONE'; "one or more" return 'ONE_OR_MORE'; "one or many" return 'ONE_OR_MORE'; +"1+" return 'ONE_OR_MORE'; \|o return 'ZERO_OR_ONE'; "zero or one" return 'ZERO_OR_ONE'; "zero or more" return 'ZERO_OR_MORE'; "zero or many" return 'ZERO_OR_MORE'; +"0+" return 'ZERO_OR_MORE'; \}o return 'ZERO_OR_MORE'; "many(0)" return 'ZERO_OR_MORE'; "many(1)" return 'ONE_OR_MORE'; @@ -51,6 +53,7 @@ accDescr\s*"{"\s* { this.begin("acc_descr_multili \}\| return 'ONE_OR_MORE'; "one" return 'ONLY_ONE'; "only one" return 'ONLY_ONE'; +"1" return 'ONLY_ONE'; \|\| return 'ONLY_ONE'; o\| return 'ZERO_OR_ONE'; o\{ return 'ZERO_OR_MORE'; diff --git a/packages/mermaid/src/diagrams/er/parser/erDiagram.spec.js b/packages/mermaid/src/diagrams/er/parser/erDiagram.spec.js index e7540fcec..eb738fe4b 100644 --- a/packages/mermaid/src/diagrams/er/parser/erDiagram.spec.js +++ b/packages/mermaid/src/diagrams/er/parser/erDiagram.spec.js @@ -582,14 +582,24 @@ describe('when parsing ER diagram it...', function () { expect(rels[0].relSpec.cardB).toBe(erDb.Cardinality.ZERO_OR_MORE); }); - it('should handle only-one-to-only-one relationships (aliases "only one")', function () { - erDiagram.parser.parse('erDiagram\nA only one optionally to only one B : has'); + it('should handle only-one-to-only-one relationships (aliases "only one" and "1+")', function () { + erDiagram.parser.parse('erDiagram\nA only one optionally to 1+ B : has'); + const rels = erDb.getRelationships(); + + expect(Object.keys(erDb.getEntities()).length).toBe(2); + expect(rels.length).toBe(1); + expect(rels[0].relSpec.cardA).toBe(erDb.Cardinality.ONE_OR_MORE); + expect(rels[0].relSpec.cardB).toBe(erDb.Cardinality.ONLY_ONE); + }); + + it('should handle zero-or-more-to-only-one relationships (aliases "0+" and "1")', function () { + erDiagram.parser.parse('erDiagram\nA 0+ optionally to 1 B : has'); const rels = erDb.getRelationships(); expect(Object.keys(erDb.getEntities()).length).toBe(2); expect(rels.length).toBe(1); expect(rels[0].relSpec.cardA).toBe(erDb.Cardinality.ONLY_ONE); - expect(rels[0].relSpec.cardB).toBe(erDb.Cardinality.ONLY_ONE); + expect(rels[0].relSpec.cardB).toBe(erDb.Cardinality.ZERO_OR_MORE); }); it('should represent identifying relationships properly', function () { From 627ddc07740ca2bcc5fa1045762ae0d8df93c841 Mon Sep 17 00:00:00 2001 From: uttk <46495635+uttk@users.noreply.github.com> Date: Wed, 12 Oct 2022 02:14:56 +0000 Subject: [PATCH 09/42] fix: Fix useMaxWidth option for git graph --- packages/mermaid/src/diagrams/git/gitGraphRenderer.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/mermaid/src/diagrams/git/gitGraphRenderer.js b/packages/mermaid/src/diagrams/git/gitGraphRenderer.js index e15e43ac3..0b52b0360 100644 --- a/packages/mermaid/src/diagrams/git/gitGraphRenderer.js +++ b/packages/mermaid/src/diagrams/git/gitGraphRenderer.js @@ -495,7 +495,6 @@ const drawBranches = (svg, branches) => { */ export const draw = function (txt, id, ver, diagObj) { clear(); - const conf = getConfig(); const gitGraphConfig = getConfig().gitGraph; // try { log.debug('in gitgraph renderer', txt + '\n', 'id:', id, ver); @@ -523,7 +522,7 @@ export const draw = function (txt, id, ver, diagObj) { drawCommits(diagram, allCommitsDict, true); // Setup the view box and size of the svg element - setupGraphViewbox(undefined, diagram, gitGraphConfig.diagramPadding, conf.useMaxWidth); + setupGraphViewbox(undefined, diagram, gitGraphConfig.diagramPadding, gitGraphConfig.useMaxWidth); }; export default { From eec97d10af2ba016f26fe0e772d2405689441e58 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Wed, 12 Oct 2022 11:48:51 +0200 Subject: [PATCH 10/42] #3192 Adding the ability to create invisible links in flowcharts(v2) --- packages/mermaid/src/dagre-wrapper/edges.js | 3 +++ packages/mermaid/src/diagrams/flowchart/flowDb.js | 4 ++++ packages/mermaid/src/diagrams/flowchart/flowRenderer-v2.js | 5 +++++ packages/mermaid/src/diagrams/flowchart/parser/flow.jison | 1 + 4 files changed, 13 insertions(+) diff --git a/packages/mermaid/src/dagre-wrapper/edges.js b/packages/mermaid/src/dagre-wrapper/edges.js index 6ed08e924..6a75b8b28 100644 --- a/packages/mermaid/src/dagre-wrapper/edges.js +++ b/packages/mermaid/src/dagre-wrapper/edges.js @@ -438,6 +438,9 @@ export const insertEdge = function (elem, e, edge, clusterDb, diagramType, graph case 'thick': strokeClasses = 'edge-thickness-thick'; break; + case 'invisible': + strokeClasses = 'edge-thickness-thick'; + break; default: strokeClasses = ''; } diff --git a/packages/mermaid/src/diagrams/flowchart/flowDb.js b/packages/mermaid/src/diagrams/flowchart/flowDb.js index 4a3fd5e9c..4712994d5 100644 --- a/packages/mermaid/src/diagrams/flowchart/flowDb.js +++ b/packages/mermaid/src/diagrams/flowchart/flowDb.js @@ -674,6 +674,10 @@ const destructEndLink = (_str) => { stroke = 'thick'; } + if (line[0] === '~') { + stroke = 'invisible'; + } + let dots = countChar('.', line); if (dots) { diff --git a/packages/mermaid/src/diagrams/flowchart/flowRenderer-v2.js b/packages/mermaid/src/diagrams/flowchart/flowRenderer-v2.js index 6b7c4c1bf..ce206ce02 100644 --- a/packages/mermaid/src/diagrams/flowchart/flowRenderer-v2.js +++ b/packages/mermaid/src/diagrams/flowchart/flowRenderer-v2.js @@ -280,6 +280,11 @@ export const addEdges = function (edges, g, diagObj) { edgeData.pattern = 'solid'; edgeData.style = 'stroke-width: 3.5px;fill:none;'; break; + case 'invisible': + edgeData.thickness = 'invisible'; + edgeData.pattern = 'solid'; + edgeData.style = 'stroke-width: 0;fill:none;'; + break; } if (typeof edge.style !== 'undefined') { const styles = getStylesFromArray(edge.style); diff --git a/packages/mermaid/src/diagrams/flowchart/parser/flow.jison b/packages/mermaid/src/diagrams/flowchart/parser/flow.jison index fae7c6cf2..e461165c4 100644 --- a/packages/mermaid/src/diagrams/flowchart/parser/flow.jison +++ b/packages/mermaid/src/diagrams/flowchart/parser/flow.jison @@ -120,6 +120,7 @@ that id. \s*[xo<]?\-\-+[-xo>]\s* return 'LINK'; \s*[xo<]?\=\=+[=xo>]\s* return 'LINK'; \s*[xo<]?\-?\.+\-[xo>]?\s* return 'LINK'; +\s*\~\~[\~]+\s* return 'LINK'; \s*[xo<]?\-\-\s* return 'START_LINK'; \s*[xo<]?\=\=\s* return 'START_LINK'; \s*[xo<]?\-\.\s* return 'START_LINK'; From 4d46ea9801ad1d6e8eddf6e97f2e89e8fc993c26 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Wed, 12 Oct 2022 11:53:02 +0200 Subject: [PATCH 11/42] #3192 Adding link type of the std docs --- docs/flowchart.md | 14 ++++++++++++++ packages/mermaid/src/docs/flowchart.md | 9 +++++++++ 2 files changed, 23 insertions(+) diff --git a/docs/flowchart.md b/docs/flowchart.md index 0ca87d975..fe4231ede 100644 --- a/docs/flowchart.md +++ b/docs/flowchart.md @@ -264,6 +264,20 @@ flowchart LR A --- B ``` +### An invisisble link + +This can be a usefull tool in some instances where you want to alter the default positining of a node. + +```mermaid-example +flowchart LR + A ~~~ B +``` + +```mermaid +flowchart LR + A ~~~ B +``` + ### Text on links ```mermaid-example diff --git a/packages/mermaid/src/docs/flowchart.md b/packages/mermaid/src/docs/flowchart.md index 3560334af..edeabb651 100644 --- a/packages/mermaid/src/docs/flowchart.md +++ b/packages/mermaid/src/docs/flowchart.md @@ -167,6 +167,15 @@ flowchart LR A --- B ``` +### An invisisble link + +This can be a usefull tool in some instances where you want to alter the default positining of a node. + +```mermaid-example +flowchart LR + A ~~~ B +``` + ### Text on links ```mermaid-example From 4be66554b3feebdb3c7882ff97419fd0674dd895 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Thu, 13 Oct 2022 14:26:05 +0200 Subject: [PATCH 12/42] #3659 Adding height when not using maxWidth --- cypress/platform/knsv2.html | 40 +++++++++++------------ packages/mermaid/src/setupGraphViewbox.js | 1 + 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/cypress/platform/knsv2.html b/cypress/platform/knsv2.html index 506ac51ae..c521ea5c5 100644 --- a/cypress/platform/knsv2.html +++ b/cypress/platform/knsv2.html @@ -56,21 +56,10 @@
Security check
-classDiagram
-        direction LR
-        class Student {
-          -idCard : IdCard
-        }
-        class IdCard{
-          -id : int
-          -name : string
-        }
-        class Bike{
-          -id : int
-          -name : string
-        }
-        Student "1" --o "1" IdCard : carries
-        Student "1" --o "1" Bike : rides
+flowchart TD
+    A --> B
+    B --> C
+    A --> C
     
 mindmap
@@ -98,8 +87,14 @@ mindmap
         ::icon(mdi mdi-fire)
           gc7((grand
grand
child 8))
-
-      example-diagram
+    
+      gantt
+        title Style today marker (vertical line should be 5px wide and half-transparent blue)
+        dateFormat YYYY-MM-DD
+        axisFormat %d
+        todayMarker stroke-width:5px,stroke:#00f,opacity:0.5
+        section Section1
+        Today: 1, -1h
     
@@ -116,13 +111,18 @@ mindmap theme: 'forest', startOnLoad: true, logLevel: 0, - // basePath: './packages/', - // themeVariables: { darkMode: true }, + flowchart: { + useMaxWidth: false, + htmlLabels: true, + }, + gantt: { + useMaxWidth: false, + }, + useMaxWidth: false, lazyLoadedDiagrams: [ './mermaid-mindmap-detector.esm.mjs', './mermaid-example-diagram-detector.esm.mjs', ], - // lazyLoadedDiagrams: ['../../mermaid-mindmap/registry.ts'], }); function callback() { alert('It worked'); diff --git a/packages/mermaid/src/setupGraphViewbox.js b/packages/mermaid/src/setupGraphViewbox.js index 8ffdab5e7..dad451df6 100644 --- a/packages/mermaid/src/setupGraphViewbox.js +++ b/packages/mermaid/src/setupGraphViewbox.js @@ -26,6 +26,7 @@ export const calculateSvgSizeAttrs = function (height, width, useMaxWidth) { attrs.set('width', '100%'); attrs.set('style', `max-width: ${width}px;`); } else { + attrs.set('height', height); attrs.set('width', width); } return attrs; From bed95c77a982a247bee7a4e38c43cfd480e14f5b Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Fri, 14 Oct 2022 10:01:32 +0200 Subject: [PATCH 13/42] Some changes in the docs for mindmap --- .gitignore | 2 ++ docs/mindmap.md | 8 +++----- packages/mermaid/src/docs/mindmap.md | 7 +++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 6e4fe723a..33718aaf7 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,5 @@ cypress/snapshots/ .eslintcache .tsbuildinfo tsconfig.tsbuildinfo + +local*.html diff --git a/docs/mindmap.md b/docs/mindmap.md index 94baf43e0..32f1e099d 100644 --- a/docs/mindmap.md +++ b/docs/mindmap.md @@ -26,7 +26,6 @@ mindmap Tools Pen and paper Mermaid - ``` ```mermaid @@ -47,14 +46,13 @@ mindmap Tools Pen and paper Mermaid - ``` ## Syntax The syntax for creating Mindmaps is simple and relies on indentation for setting the levels in the hierarchy. -In the following example you can see how there are 3 different levels. One with starting at the left of the text and another level with two rows starting at the same column, defining the node A. At the end there is one more level where the text is indented further then the previous lines defining the nodes B and C. +In the following example you can see how there are 3 different levels of indentation. The leftmost indentation is the root of the mindmap. There can only be one root and if you by misstake add two of them on the same level there will be a syntax error. Rows with larger indentation will be connected as children to the previous row with lower indentation. Based on that you can see in the example how the nodes B and C both are children to node A whci in turn is a child of the node Root. mindmap Root @@ -62,7 +60,7 @@ In the following example you can see how there are 3 different levels. One with B C -In summary is a simple text outline where there are one node at the root level called `Root` which has one child `A`. `A` in turn has two children `B`and `C`. In the diagram below we can see this rendered as a mindmap. +In the diagram below you can see the example rendered as a mindmap. ```mermaid-example mindmap @@ -220,7 +218,7 @@ The actual indentation does not really matter only compared with the previous ro B C -This outline is unclear as `B` clearly is a child of `A` but when we move on to `C` the clarity is lost. `C` is not a child of `B` with a higher indentation nor does it have the same indentation as `B`. The only thing that is clear is that the first node with smaller indentation, indicating a parent, is A. Then Mermaid relies on this known truth and compensates for the unclear indentation and selects `A` as a parent of `C` leading till the same diagram with `B` and `C` as siblings. +This outline is unclear as `B` clearly is a child of `A` but when we move on to `C` the clarity is lost. `C` is not a child of `B` with a higher indentation nor does it have the same indentation as `B`. The only thing that is clear is that the first node with smaller indentation, indicating a parent, is A. Mermaid will rely on this known truth and compensates for the unclear indentation and selects `A` as a parent of `C` leading till the same diagram with `B` and `C` as siblings. ```mermaid-example mindmap diff --git a/packages/mermaid/src/docs/mindmap.md b/packages/mermaid/src/docs/mindmap.md index af7a3df85..5aa6f4953 100644 --- a/packages/mermaid/src/docs/mindmap.md +++ b/packages/mermaid/src/docs/mindmap.md @@ -24,14 +24,13 @@ mindmap Tools Pen and paper Mermaid - ``` ## Syntax The syntax for creating Mindmaps is simple and relies on indentation for setting the levels in the hierarchy. -In the following example you can see how there are 3 different levels. One with starting at the left of the text and another level with two rows starting at the same column, defining the node A. At the end there is one more level where the text is indented further then the previous lines defining the nodes B and C. +In the following example you can see how there are 3 different levels of indentation. The leftmost indentation is the root of the mindmap. There can only be one root and if you by misstake add two of them on the same level there will be a syntax error. Rows with larger indentation will be connected as children to the previous row with lower indentation. Based on that you can see in the example how the nodes B and C both are children to node A whci in turn is a child of the node Root. ``` mindmap @@ -41,7 +40,7 @@ mindmap C ``` -In summary is a simple text outline where there are one node at the root level called `Root` which has one child `A`. `A` in turn has two children `B`and `C`. In the diagram below we can see this rendered as a mindmap. +In the diagram below you can see the example rendered as a mindmap. ```mermaid mindmap @@ -145,7 +144,7 @@ mindmap C ``` -This outline is unclear as `B` clearly is a child of `A` but when we move on to `C` the clarity is lost. `C` is not a child of `B` with a higher indentation nor does it have the same indentation as `B`. The only thing that is clear is that the first node with smaller indentation, indicating a parent, is A. Then Mermaid relies on this known truth and compensates for the unclear indentation and selects `A` as a parent of `C` leading till the same diagram with `B` and `C` as siblings. +This outline is unclear as `B` clearly is a child of `A` but when we move on to `C` the clarity is lost. `C` is not a child of `B` with a higher indentation nor does it have the same indentation as `B`. The only thing that is clear is that the first node with smaller indentation, indicating a parent, is A. Mermaid will rely on this known truth and compensates for the unclear indentation and selects `A` as a parent of `C` leading till the same diagram with `B` and `C` as siblings. ```mermaid mindmap From 59cf085af51c248ec9489207175170a21b1c4285 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Fri, 14 Oct 2022 15:11:29 +0200 Subject: [PATCH 14/42] #448 Fix for root nodes without children --- packages/mermaid-mindmap/package.json | 2 +- packages/mermaid-mindmap/src/mindmapRenderer.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/mermaid-mindmap/package.json b/packages/mermaid-mindmap/package.json index befe56016..847eeffef 100644 --- a/packages/mermaid-mindmap/package.json +++ b/packages/mermaid-mindmap/package.json @@ -1,6 +1,6 @@ { "name": "@mermaid-js/mermaid-mindmap", - "version": "9.2.0-rc2", + "version": "9.2.0-rc3", "description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.", "main": "dist/mermaid-mindmap.core.mjs", "module": "dist/mermaid-mindmap.core.mjs", diff --git a/packages/mermaid-mindmap/src/mindmapRenderer.js b/packages/mermaid-mindmap/src/mindmapRenderer.js index acbb35048..f69b0b381 100644 --- a/packages/mermaid-mindmap/src/mindmapRenderer.js +++ b/packages/mermaid-mindmap/src/mindmapRenderer.js @@ -34,7 +34,7 @@ function drawNodes(svg, mindmap, section, conf) { * @param cy */ function drawEdges(edgesEl, cy) { - cy.edges().map((edge, id) => { + cy?.edges().map((edge, id) => { const data = edge.data(); if (edge[0]._private.bodyBounds) { const bounds = edge[0]._private.rscratch; @@ -100,9 +100,10 @@ function addNodes(mindmap, cy, conf, level) { */ function layoutMindmap(node, conf) { return new Promise((resolve) => { - if (node.children.length === 0) { - return node; - } + // if (node.children.length === 0) { + // resolve(node); + // return; + // } // Add temporary render element const renderEl = select('body').append('div').attr('id', 'cy').attr('style', 'display:none'); From 16be835c9b8e583b022d342ccfdaba8e0549cd66 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Fri, 14 Oct 2022 15:12:22 +0200 Subject: [PATCH 15/42] Removing error thrown disrupting rendering --- packages/mermaid/src/diagram-api/diagramAPI.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/mermaid/src/diagram-api/diagramAPI.ts b/packages/mermaid/src/diagram-api/diagramAPI.ts index 2bc8091ec..91c5ffe71 100644 --- a/packages/mermaid/src/diagram-api/diagramAPI.ts +++ b/packages/mermaid/src/diagram-api/diagramAPI.ts @@ -35,7 +35,12 @@ export const registerDiagram = ( ) => void ) => { if (diagrams[id]) { - throw new Error(`Diagram ${id} already registered.`); + log.warn(`Diagram ${id} already registered.`); + // The error throw is commented out to as it breaks pages where you have multiple diagrams, + // it can happen that rendering of the same type of diagram is initiated while the previous + // one is still being imported. import deals with this and only one diagram is imported in + // the end. + // throw new Error(`Diagram ${id} already registered.`); } diagrams[id] = diagram; if (detector) { From 58a53c0fa8999276360239754803a7a5c9007042 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sat, 15 Oct 2022 00:28:21 +0530 Subject: [PATCH 16/42] fix: Diagram load issue --- .vite/build.ts | 12 +++++++++--- package.json | 1 + packages/mermaid/src/Diagram.ts | 8 ++++++-- packages/mermaid/src/diagram-api/diagramAPI.ts | 11 ++++++++++- packages/mermaid/src/logger.ts | 3 +++ 5 files changed, 29 insertions(+), 6 deletions(-) diff --git a/.vite/build.ts b/.vite/build.ts index 7398d30d5..360f878ba 100644 --- a/.vite/build.ts +++ b/.vite/build.ts @@ -6,6 +6,7 @@ import pkg from '../package.json' assert { type: 'json' }; const { dependencies } = pkg; const watch = process.argv.includes('--watch'); +const mermaidOnly = process.argv.includes('--mermaid'); const __dirname = fileURLToPath(new URL('.', import.meta.url)); type OutputOptions = Exclude< @@ -129,14 +130,19 @@ const buildPackage = async (entryName: keyof typeof packageOptions) => { const main = async () => { const packageNames = Object.keys(packageOptions) as (keyof typeof packageOptions)[]; for (const pkg of packageNames) { + if (mermaidOnly && pkg !== 'mermaid') { + continue; + } await buildPackage(pkg); } }; if (watch) { - build(getBuildConfig({ minify: false, watch, entryName: 'mermaid' })); - build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-mindmap' })); - build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-example-diagram' })); + build(getBuildConfig({ minify: false, watch, core: true, entryName: 'mermaid' })); + if (!mermaidOnly) { + build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-mindmap' })); + build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-example-diagram' })); + } } else { void main(); } diff --git a/package.json b/package.json index 25d614f95..dd436e615 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "git graph" ], "scripts": { + "build:mermaid": "ts-node-esm --transpileOnly --project=.vite/tsconfig.json .vite/build.ts --mermaid", "build:vite": "ts-node-esm --transpileOnly --project=.vite/tsconfig.json .vite/build.ts", "build:types": "concurrently \"tsc -p ./packages/mermaid/tsconfig.json --emitDeclarationOnly\" \"tsc -p ./packages/mermaid-mindmap/tsconfig.json --emitDeclarationOnly\"", "build:watch": "pnpm build:vite --watch", diff --git a/packages/mermaid/src/Diagram.ts b/packages/mermaid/src/Diagram.ts index 0aa741994..c471e0f5f 100644 --- a/packages/mermaid/src/Diagram.ts +++ b/packages/mermaid/src/Diagram.ts @@ -1,6 +1,6 @@ import * as configApi from './config'; import { log } from './logger'; -import { getDiagram, registerDiagram } from './diagram-api/diagramAPI'; +import { DiagramNotFoundError, getDiagram, registerDiagram } from './diagram-api/diagramAPI'; import { detectType, getDiagramLoader } from './diagram-api/detectType'; import { isDetailedError } from './utils'; export class Diagram { @@ -88,9 +88,13 @@ export const getDiagramFromText = async (txt: string, parseError?: Function): Pr // Trying to find the diagram getDiagram(type); } catch (error) { + if (!(error instanceof DiagramNotFoundError)) { + log.error(error); + throw error; + } const loader = getDiagramLoader(type); if (!loader) { - throw new Error(`Diagram ${type} not found.`); + throw new Error(`Loader for ${type} not found.`); } // Diagram not available, loading it const { diagram } = await loader(); diff --git a/packages/mermaid/src/diagram-api/diagramAPI.ts b/packages/mermaid/src/diagram-api/diagramAPI.ts index 91c5ffe71..6eeff6df1 100644 --- a/packages/mermaid/src/diagram-api/diagramAPI.ts +++ b/packages/mermaid/src/diagram-api/diagramAPI.ts @@ -34,6 +34,7 @@ export const registerDiagram = ( _setupGraphViewbox: any ) => void ) => { + log.debug(`Registering diagram ${id}`); if (diagrams[id]) { log.warn(`Diagram ${id} already registered.`); // The error throw is commented out to as it breaks pages where you have multiple diagrams, @@ -50,11 +51,19 @@ export const registerDiagram = ( if (typeof callback !== 'undefined') { callback(log, setLogLevel, getConfig, sanitizeText, setupGraphViewbox); } + log.debug(`Registered diagram ${id}. ${Object.keys(diagrams).join(', ')} diagrams registered.`); }; export const getDiagram = (name: string): DiagramDefinition => { + log.debug(`Getting diagram ${name}. ${Object.keys(diagrams).join(', ')} diagrams registered.`); if (name in diagrams) { return diagrams[name]; } - throw new Error(`Diagram ${name} not found.`); + throw new DiagramNotFoundError(name); }; + +export class DiagramNotFoundError extends Error { + constructor(message: string) { + super(`Diagram ${message} not found.`); + } +} diff --git a/packages/mermaid/src/logger.ts b/packages/mermaid/src/logger.ts index b01934e88..3eae56d8a 100644 --- a/packages/mermaid/src/logger.ts +++ b/packages/mermaid/src/logger.ts @@ -30,6 +30,8 @@ export const log: Record = { * @param {LogLevel} [level="fatal"] The level to set the logging to. Default is `"fatal"` */ export const setLogLevel = function (level: keyof typeof LEVELS | number | string = 'fatal') { + // TODO: Even if we call initialize with loglevel 0, many initial logs are skipped as LL is set to 5 initially. + let numericLevel: number = LEVELS.fatal; if (typeof level === 'string') { level = level.toLowerCase(); @@ -39,6 +41,7 @@ export const setLogLevel = function (level: keyof typeof LEVELS | number | strin } else if (typeof level === 'number') { numericLevel = level; } + numericLevel = 0; log.trace = () => {}; log.debug = () => {}; log.info = () => {}; From aec1d809665b4b64d9b79e98c0284895fc744c9f Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sat, 15 Oct 2022 21:33:09 +0530 Subject: [PATCH 17/42] fix: Remove hardcoded numericLevel --- packages/mermaid/src/logger.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mermaid/src/logger.ts b/packages/mermaid/src/logger.ts index 3eae56d8a..a03d56914 100644 --- a/packages/mermaid/src/logger.ts +++ b/packages/mermaid/src/logger.ts @@ -41,7 +41,7 @@ export const setLogLevel = function (level: keyof typeof LEVELS | number | strin } else if (typeof level === 'number') { numericLevel = level; } - numericLevel = 0; + log.trace = () => {}; log.debug = () => {}; log.info = () => {}; From a4af3704ba27e484dc07453146bac52a9d44cdca Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sun, 16 Oct 2022 10:05:11 +0530 Subject: [PATCH 18/42] fix: getElementById type issue. Converts mindmapDB to TS --- packages/mermaid-mindmap/package.json | 1 + packages/mermaid-mindmap/src/mermaidUtils.ts | 4 +- .../src/{mindmapDb.js => mindmapDb.ts} | 60 +++++++++++-------- pnpm-lock.yaml | 2 + 4 files changed, 41 insertions(+), 26 deletions(-) rename packages/mermaid-mindmap/src/{mindmapDb.js => mindmapDb.ts} (64%) diff --git a/packages/mermaid-mindmap/package.json b/packages/mermaid-mindmap/package.json index 847eeffef..dfbe5b88e 100644 --- a/packages/mermaid-mindmap/package.json +++ b/packages/mermaid-mindmap/package.json @@ -58,6 +58,7 @@ }, "devDependencies": { "concurrently": "^7.4.0", + "mermaid": "workspace:*", "rimraf": "^3.0.2" }, "resolutions": { diff --git a/packages/mermaid-mindmap/src/mermaidUtils.ts b/packages/mermaid-mindmap/src/mermaidUtils.ts index 7d8ac38bf..c3d70be13 100644 --- a/packages/mermaid-mindmap/src/mermaidUtils.ts +++ b/packages/mermaid-mindmap/src/mermaidUtils.ts @@ -1,3 +1,5 @@ +import type { MermaidConfig } from 'mermaid/dist/config.type'; + const warning = (s: string) => { // Todo remove debug code console.error('Log function was called before initialization', s); // eslint-disable-line @@ -24,7 +26,7 @@ export const log: Record = { }; export let setLogLevel: (level: keyof typeof LEVELS | number | string) => void; -export let getConfig: () => object; +export let getConfig: () => MermaidConfig; export let sanitizeText: (str: string) => string; // eslint-disable @typescript-eslint/no-explicit-any export let setupGraphViewbox: ( diff --git a/packages/mermaid-mindmap/src/mindmapDb.js b/packages/mermaid-mindmap/src/mindmapDb.ts similarity index 64% rename from packages/mermaid-mindmap/src/mindmapDb.js rename to packages/mermaid-mindmap/src/mindmapDb.ts index 2ae98c223..3f35d9209 100644 --- a/packages/mermaid-mindmap/src/mindmapDb.js +++ b/packages/mermaid-mindmap/src/mindmapDb.ts @@ -1,16 +1,30 @@ /** Created by knut on 15-01-14. */ import { sanitizeText, getConfig, log } from './mermaidUtils'; +import type { DetailedError } from 'mermaid/dist/utils'; -let nodes = []; +interface Node { + id: number; + nodeId: string; + level: number; + descr: string; + type: number; + children: Node[]; + width: number; + padding: number; + icon?: string; + class?: string; +} + +let nodes: Node[] = []; let cnt = 0; -let elements = {}; +let elements: Record = {}; export const clear = () => { nodes = []; cnt = 0; elements = {}; }; -const getParent = function (level) { +const getParent = function (level: number) { for (let i = nodes.length - 1; i >= 0; i--) { if (nodes[i].level < level) { return nodes[i]; @@ -23,28 +37,21 @@ const getParent = function (level) { export const getMindmap = () => { return nodes.length > 0 ? nodes[0] : null; }; -export const addNode = (level, id, descr, type) => { + +export const addNode = (level: number, id: string, descr: string, type: number) => { log.info('addNode', level, id, descr, type); const conf = getConfig(); - const node = { + const padding = conf.mindmap?.padding ?? 15; + const node: Node = { id: cnt++, nodeId: sanitizeText(id), level, descr: sanitizeText(descr), type, children: [], - width: getConfig().mindmap.maxNodeWidth, + width: getConfig().mindmap?.maxNodeWidth ?? 200, + padding: type === nodeType.ROUNDED_RECT || type === nodeType.RECT ? 2 * padding : padding, }; - switch (node.type) { - case nodeType.ROUNDED_RECT: - node.padding = 2 * conf.mindmap.padding; - break; - case nodeType.RECT: - node.padding = 2 * conf.mindmap.padding; - break; - default: - node.padding = conf.mindmap.padding; - } const parent = getParent(level); if (parent) { parent.children.push(node); @@ -56,9 +63,10 @@ export const addNode = (level, id, descr, type) => { nodes.push(node); } else { // Syntax error ... there can only bee one root - let error = new Error( + const error = new Error( 'There can be only one root. No parent could be found for ("' + node.descr + '")' ); + // @ts-ignore TODO: Add mermaid error error.hash = { text: 'branch ' + name, token: 'branch ' + name, @@ -81,7 +89,7 @@ export const nodeType = { BANG: 5, }; -export const getType = (startStr, endStr) => { +export const getType = (startStr: string, endStr: string): number => { log.debug('In get type', startStr, endStr); switch (startStr) { case '[': @@ -99,11 +107,11 @@ export const getType = (startStr, endStr) => { } }; -export const setElementForId = (id, element) => { +export const setElementForId = (id: number, element: HTMLElement) => { elements[id] = element; }; -export const decorateNode = (decoration) => { +export const decorateNode = (decoration: { icon: string; class: string }) => { const node = nodes[nodes.length - 1]; if (decoration && decoration.icon) { node.icon = sanitizeText(decoration.icon); @@ -113,7 +121,7 @@ export const decorateNode = (decoration) => { } }; -export const type2Str = (type) => { +export const type2Str = (type: number) => { switch (type) { case nodeType.DEFAULT: return 'no-border'; @@ -132,13 +140,15 @@ export const type2Str = (type) => { } }; -export let parseError; -export const setErrorHandler = (handler) => { +export type ParseErrorFunction = (err: string | DetailedError, hash?: any) => void; +export let parseError: ParseErrorFunction; +export const setErrorHandler = (handler: ParseErrorFunction) => { parseError = handler; }; // Expose logger to grammar export const getLogger = () => log; -export const getNodeById = (id) => nodes[id]; -export const getElementById = (id) => elements[id]; +export const getNodeById = (id: number): Node => nodes[id]; +export const getElementById = (id: number | string): HTMLElement => + elements[typeof id === 'string' ? parseInt(id) : id]; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b2f88060c..8e3d73948 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -285,6 +285,7 @@ importers: cytoscape-cose-bilkent: ^4.1.0 cytoscape-fcose: ^2.1.0 d3: ^7.0.0 + mermaid: workspace:* non-layered-tidy-tree-layout: ^2.0.2 rimraf: ^3.0.2 dependencies: @@ -296,6 +297,7 @@ importers: non-layered-tidy-tree-layout: 2.0.2 devDependencies: concurrently: 7.4.0 + mermaid: link:../mermaid rimraf: 3.0.2 packages: From c83e29c6e3f552f625c36a9e08876ffb3385615b Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sun, 16 Oct 2022 10:11:19 +0530 Subject: [PATCH 19/42] chore: Update creation date --- packages/mermaid-mindmap/src/mindmapDb.ts | 2 +- packages/mermaid-mindmap/src/mindmapRenderer.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mermaid-mindmap/src/mindmapDb.ts b/packages/mermaid-mindmap/src/mindmapDb.ts index 3f35d9209..3b07bd882 100644 --- a/packages/mermaid-mindmap/src/mindmapDb.ts +++ b/packages/mermaid-mindmap/src/mindmapDb.ts @@ -1,4 +1,4 @@ -/** Created by knut on 15-01-14. */ +/** Created by knut on 23-07-2022. */ import { sanitizeText, getConfig, log } from './mermaidUtils'; import type { DetailedError } from 'mermaid/dist/utils'; diff --git a/packages/mermaid-mindmap/src/mindmapRenderer.js b/packages/mermaid-mindmap/src/mindmapRenderer.js index f69b0b381..c4f71588f 100644 --- a/packages/mermaid-mindmap/src/mindmapRenderer.js +++ b/packages/mermaid-mindmap/src/mindmapRenderer.js @@ -1,4 +1,4 @@ -/** Created by knut on 14-12-11. */ +/** Created by knut on 23-07-2022. */ import { select } from 'd3'; import { log, getConfig, setupGraphViewbox } from './mermaidUtils'; import svgDraw from './svgDraw'; From 319f925bdd3a69a033947b90f79b98f67f7b23b7 Mon Sep 17 00:00:00 2001 From: uttk <46495635+uttk@users.noreply.github.com> Date: Mon, 17 Oct 2022 03:07:10 +0000 Subject: [PATCH 20/42] fix: Fixed git graph to use global setting if `useMaxWidth` option is not set --- packages/mermaid/src/diagrams/git/gitGraphRenderer.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/mermaid/src/diagrams/git/gitGraphRenderer.js b/packages/mermaid/src/diagrams/git/gitGraphRenderer.js index 0b52b0360..71698a500 100644 --- a/packages/mermaid/src/diagrams/git/gitGraphRenderer.js +++ b/packages/mermaid/src/diagrams/git/gitGraphRenderer.js @@ -495,7 +495,8 @@ const drawBranches = (svg, branches) => { */ export const draw = function (txt, id, ver, diagObj) { clear(); - const gitGraphConfig = getConfig().gitGraph; + const conf = getConfig(); + const gitGraphConfig = conf.gitGraph; // try { log.debug('in gitgraph renderer', txt + '\n', 'id:', id, ver); @@ -522,7 +523,12 @@ export const draw = function (txt, id, ver, diagObj) { drawCommits(diagram, allCommitsDict, true); // Setup the view box and size of the svg element - setupGraphViewbox(undefined, diagram, gitGraphConfig.diagramPadding, gitGraphConfig.useMaxWidth); + setupGraphViewbox( + undefined, + diagram, + gitGraphConfig.diagramPadding, + gitGraphConfig.useMaxWidth ?? conf.useMaxWidth + ); }; export default { From 97a842e651b3569322f837b85aaf98da77bc69d4 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Mon, 17 Oct 2022 11:45:19 +0530 Subject: [PATCH 21/42] fix: Build types --- package.json | 2 +- packages/mermaid-mindmap/src/mermaidUtils.ts | 2 +- packages/mermaid-mindmap/src/mindmapDb.ts | 2 +- packages/mermaid/src/mermaid.ts | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index dd436e615..c0c908e8a 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "scripts": { "build:mermaid": "ts-node-esm --transpileOnly --project=.vite/tsconfig.json .vite/build.ts --mermaid", "build:vite": "ts-node-esm --transpileOnly --project=.vite/tsconfig.json .vite/build.ts", - "build:types": "concurrently \"tsc -p ./packages/mermaid/tsconfig.json --emitDeclarationOnly\" \"tsc -p ./packages/mermaid-mindmap/tsconfig.json --emitDeclarationOnly\"", + "build:types": "tsc -p ./packages/mermaid/tsconfig.json --emitDeclarationOnly && tsc -p ./packages/mermaid-mindmap/tsconfig.json --emitDeclarationOnly", "build:watch": "pnpm build:vite --watch", "build": "pnpm run -r clean && concurrently \"pnpm build:vite\" \"pnpm build:types\"", "dev": "concurrently \"pnpm build:vite --watch\" \"ts-node-esm .vite/server.ts\"", diff --git a/packages/mermaid-mindmap/src/mermaidUtils.ts b/packages/mermaid-mindmap/src/mermaidUtils.ts index c3d70be13..51f545c75 100644 --- a/packages/mermaid-mindmap/src/mermaidUtils.ts +++ b/packages/mermaid-mindmap/src/mermaidUtils.ts @@ -1,4 +1,4 @@ -import type { MermaidConfig } from 'mermaid/dist/config.type'; +import type { MermaidConfig } from 'mermaid'; const warning = (s: string) => { // Todo remove debug code diff --git a/packages/mermaid-mindmap/src/mindmapDb.ts b/packages/mermaid-mindmap/src/mindmapDb.ts index 3b07bd882..890a76b7e 100644 --- a/packages/mermaid-mindmap/src/mindmapDb.ts +++ b/packages/mermaid-mindmap/src/mindmapDb.ts @@ -1,6 +1,6 @@ /** Created by knut on 23-07-2022. */ import { sanitizeText, getConfig, log } from './mermaidUtils'; -import type { DetailedError } from 'mermaid/dist/utils'; +import type { DetailedError } from 'mermaid'; interface Node { id: number; diff --git a/packages/mermaid/src/mermaid.ts b/packages/mermaid/src/mermaid.ts index ae6c62547..925e1e2db 100644 --- a/packages/mermaid/src/mermaid.ts +++ b/packages/mermaid/src/mermaid.ts @@ -2,13 +2,14 @@ * Web page integration module for the mermaid framework. It uses the mermaidAPI for mermaid * functionality and to render the diagrams to svg code! */ -import { MermaidConfig } from './config.type'; +import type { MermaidConfig } from './config.type'; import { log } from './logger'; import utils from './utils'; import { mermaidAPI } from './mermaidAPI'; import { addDetector } from './diagram-api/detectType'; -import { isDetailedError } from './utils'; +import { isDetailedError, DetailedError } from './utils'; +export type { MermaidConfig, DetailedError }; /** * ## init * From 752a6b2cb0950baa4636a3e7f4fa7f7e486934f0 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Mon, 17 Oct 2022 10:46:46 +0200 Subject: [PATCH 22/42] #3687 Separating the render specific data from the data related to parsing --- packages/mermaid-mindmap/package.json | 2 +- packages/mermaid-mindmap/src/mindmapDb.js | 10 ++-------- .../mermaid-mindmap/src/mindmapRenderer.js | 5 +++-- packages/mermaid-mindmap/src/svgDraw.js | 18 ++++++++++++++++-- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/packages/mermaid-mindmap/package.json b/packages/mermaid-mindmap/package.json index 847eeffef..f13ed0cbc 100644 --- a/packages/mermaid-mindmap/package.json +++ b/packages/mermaid-mindmap/package.json @@ -1,6 +1,6 @@ { "name": "@mermaid-js/mermaid-mindmap", - "version": "9.2.0-rc3", + "version": "9.2.0-rc4", "description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.", "main": "dist/mermaid-mindmap.core.mjs", "module": "dist/mermaid-mindmap.core.mjs", diff --git a/packages/mermaid-mindmap/src/mindmapDb.js b/packages/mermaid-mindmap/src/mindmapDb.js index 2ae98c223..4785051a4 100644 --- a/packages/mermaid-mindmap/src/mindmapDb.js +++ b/packages/mermaid-mindmap/src/mindmapDb.js @@ -3,11 +3,10 @@ import { sanitizeText, getConfig, log } from './mermaidUtils'; let nodes = []; let cnt = 0; -let elements = {}; + export const clear = () => { nodes = []; cnt = 0; - elements = {}; }; const getParent = function (level) { @@ -27,7 +26,7 @@ export const addNode = (level, id, descr, type) => { log.info('addNode', level, id, descr, type); const conf = getConfig(); const node = { - id: cnt++, + id: `id-${cnt++}`, nodeId: sanitizeText(id), level, descr: sanitizeText(descr), @@ -99,10 +98,6 @@ export const getType = (startStr, endStr) => { } }; -export const setElementForId = (id, element) => { - elements[id] = element; -}; - export const decorateNode = (decoration) => { const node = nodes[nodes.length - 1]; if (decoration && decoration.icon) { @@ -141,4 +136,3 @@ export const setErrorHandler = (handler) => { export const getLogger = () => log; export const getNodeById = (id) => nodes[id]; -export const getElementById = (id) => elements[id]; diff --git a/packages/mermaid-mindmap/src/mindmapRenderer.js b/packages/mermaid-mindmap/src/mindmapRenderer.js index f69b0b381..c2ac07574 100644 --- a/packages/mermaid-mindmap/src/mindmapRenderer.js +++ b/packages/mermaid-mindmap/src/mindmapRenderer.js @@ -1,7 +1,7 @@ /** Created by knut on 14-12-11. */ import { select } from 'd3'; import { log, getConfig, setupGraphViewbox } from './mermaidUtils'; -import svgDraw from './svgDraw'; +import svgDraw, { getElementById, clearElementRefs } from './svgDraw'; import cytoscape from 'cytoscape'; import coseBilkent from 'cytoscape-cose-bilkent'; import * as db from './mindmapDb'; @@ -155,7 +155,7 @@ function positionNodes(cy) { data.x = node.position().x; data.y = node.position().y; svgDraw.positionNode(data); - const el = db.getElementById(data.nodeId); + const el = getElementById(data.nodeId); log.info('Id:', id, 'Position: (', node.position().x, ', ', node.position().y, ')', data); el.attr( 'transform', @@ -179,6 +179,7 @@ export const draw = async (text, id, version, diagObj) => { // This is done only for throwing the error if the text is not valid. diagObj.db.clear(); + clearElementRefs(); // Parse the graph definition diagObj.parser.parse(text); diff --git a/packages/mermaid-mindmap/src/svgDraw.js b/packages/mermaid-mindmap/src/svgDraw.js index 1246b1cb9..782875a6b 100644 --- a/packages/mermaid-mindmap/src/svgDraw.js +++ b/packages/mermaid-mindmap/src/svgDraw.js @@ -259,7 +259,7 @@ export const drawNode = function (elem, node, fullSection, conf) { // if (typeof node.x !== 'undefined' && typeof node.y !== 'undefined') { // nodeElem.attr('transform', 'translate(' + node.x + ',' + node.y + ')'); // } - db.setElementForId(node.id, nodeElem); + setElementById(node.id, nodeElem); return node.height; }; @@ -286,7 +286,7 @@ export const drawEdge = function drawEdge(edgesElem, mindmap, parent, depth, ful }; export const positionNode = function (node) { - const nodeElem = db.getElementById(node.id); + const nodeElem = getElementById(node.id); const x = node.x || 0; const y = node.y || 0; @@ -295,3 +295,17 @@ export const positionNode = function (node) { }; export default { drawNode, positionNode, drawEdge }; + +let elements = {}; + +export const setElementById = (id, element) => { + elements[id] = element; +}; + +export const getElementById = (id) => { + return elements[id]; +}; + +export const clearElementRefs = () => { + elements = {}; +}; From e86d7894f525bc4c3989dec8b8a84ec589078120 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Mon, 17 Oct 2022 10:51:41 +0200 Subject: [PATCH 23/42] #3680 Add font familiy in a way that does remove other configuration --- packages/mermaid/src/mermaidAPI.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/mermaid/src/mermaidAPI.ts b/packages/mermaid/src/mermaidAPI.ts index 7c967e5fd..df6ab1a2b 100644 --- a/packages/mermaid/src/mermaidAPI.ts +++ b/packages/mermaid/src/mermaidAPI.ts @@ -455,10 +455,11 @@ const handleDirective = function (p: any, directive: any, type: string): void { /** @param {MermaidConfig} options */ async function initialize(options: MermaidConfig) { // Handle legacy location of font-family configuration - if (options?.fontFamily) { - if (!options.themeVariables?.fontFamily) { - options.themeVariables = { fontFamily: options.fontFamily }; + if (options.fontFamily) { + if (!options.themeVariables) { + options.themeVariables = {}; } + options.themeVariables.fontFamily = options.fontFamily; } // Set default options From 53bc747e9d6284e4982a19b369443939e873070c Mon Sep 17 00:00:00 2001 From: Ivan Sinek Date: Mon, 17 Oct 2022 14:29:58 +0200 Subject: [PATCH 24/42] fix: gantt demo diagrams (#3655) --- demos/gantt.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/demos/gantt.html b/demos/gantt.html index 749208f99..227fdb1d2 100644 --- a/demos/gantt.html +++ b/demos/gantt.html @@ -74,22 +74,22 @@
     gantt
     title Hide today marker (vertical line should not be visible)
-    dateFormat YYYY-MM-DD
-    axisFormat %d
+    dateFormat Z
+    axisFormat %d/%m
     todayMarker off
     section Section1
-    Today: 1, -1h
+    Today: 1, -01:00, 5min
     

     gantt
     title Style today marker (vertical line should be 5px wide and half-transparent blue)
-    dateFormat YYYY-MM-DD
-    axisFormat %d
+    dateFormat Z
+    axisFormat %d/%m
     todayMarker stroke-width:5px,stroke:#00f,opacity:0.5
     section Section1
-    Today: 1, -1h
+    Today: 1, -01:00, 5min
     

From 5803d0abaff73fe8ed50ced1c05c96d0a42b6bbb Mon Sep 17 00:00:00 2001 From: Dima Kurilo Date: Mon, 17 Oct 2022 09:46:10 -0400 Subject: [PATCH 25/42] update docs --- docs/entityRelationshipDiagram.md | 26 +++++++++++++++++++ .../src/docs/entityRelationshipDiagram.md | 25 ++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/docs/entityRelationshipDiagram.md b/docs/entityRelationshipDiagram.md index 78d058e78..97a0a1da3 100644 --- a/docs/entityRelationshipDiagram.md +++ b/docs/entityRelationshipDiagram.md @@ -110,10 +110,34 @@ Cardinality is a property that describes how many elements of another entity can | `}o` | `o{` | Zero or more (no upper limit) | | `}\|` | `\|{` | One or more (no upper limit) | +**Aliases** + +| Value (left) | Value (right) | Alias for | +| :----------: | :-----------: | ------------ | +| one or zero | one or zero | Zero or one | +| zero or one | zero or one | Zero or one | +| one or more | one or more | One or more | +| one or many | one or many | One or more | +| many(1) | many(1) | One or more | +| 1+ | 1+ | One or more | +| zero or more | zero or more | Zero or more | +| zero or many | zero or many | Zero or more | +| many(0) | many(1) | Zero or more | +| 0+ | 0+ | Zero or more | +| only one | only one | Exactly one | +| 1 | 1 | Exactly one | + ### Identification Relationships may be classified as either _identifying_ or _non-identifying_ and these are rendered with either solid or dashed lines respectively. This is relevant when one of the entities in question can not have independent existence without the other. For example a firm that insures people to drive cars might need to store data on `NAMED-DRIVER`s. In modelling this we might start out by observing that a `CAR` can be driven by many `PERSON` instances, and a `PERSON` can drive many `CAR`s - both entities can exist without the other, so this is a non-identifying relationship that we might specify in Mermaid as: `PERSON }|..|{ CAR : "driver"`. Note the two dots in the middle of the relationship that will result in a dashed line being drawn between the two entities. But when this many-to-many relationship is resolved into two one-to-many relationships, we observe that a `NAMED-DRIVER` cannot exist without both a `PERSON` and a `CAR` - the relationships become identifying and would be specified using hyphens, which translate to a solid line: +**Aliases** + +| Value | Alias for | +| :-----------: | :---------------: | +| to | _identifying_ | +| optionally to | _non-identifying_ | + ```mermaid-example erDiagram CAR ||--o{ NAMED-DRIVER : allows @@ -218,6 +242,7 @@ erDiagram string lastName int age } + MANUFACTURER only one to zero or more CAR ``` ```mermaid @@ -236,6 +261,7 @@ erDiagram string lastName int age } + MANUFACTURER only one to zero or more CAR ``` ### Other Things diff --git a/packages/mermaid/src/docs/entityRelationshipDiagram.md b/packages/mermaid/src/docs/entityRelationshipDiagram.md index 341c9147c..e52b0df4c 100644 --- a/packages/mermaid/src/docs/entityRelationshipDiagram.md +++ b/packages/mermaid/src/docs/entityRelationshipDiagram.md @@ -85,10 +85,34 @@ Cardinality is a property that describes how many elements of another entity can | `}o` | `o{` | Zero or more (no upper limit) | | `}\|` | `\|{` | One or more (no upper limit) | +**Aliases** + +| Value (left) | Value (right) | Alias for | +| :----------: | :-----------: | ------------ | +| one or zero | one or zero | Zero or one | +| zero or one | zero or one | Zero or one | +| one or more | one or more | One or more | +| one or many | one or many | One or more | +| many(1) | many(1) | One or more | +| 1+ | 1+ | One or more | +| zero or more | zero or more | Zero or more | +| zero or many | zero or many | Zero or more | +| many(0) | many(1) | Zero or more | +| 0+ | 0+ | Zero or more | +| only one | only one | Exactly one | +| 1 | 1 | Exactly one | + ### Identification Relationships may be classified as either _identifying_ or _non-identifying_ and these are rendered with either solid or dashed lines respectively. This is relevant when one of the entities in question can not have independent existence without the other. For example a firm that insures people to drive cars might need to store data on `NAMED-DRIVER`s. In modelling this we might start out by observing that a `CAR` can be driven by many `PERSON` instances, and a `PERSON` can drive many `CAR`s - both entities can exist without the other, so this is a non-identifying relationship that we might specify in Mermaid as: `PERSON }|..|{ CAR : "driver"`. Note the two dots in the middle of the relationship that will result in a dashed line being drawn between the two entities. But when this many-to-many relationship is resolved into two one-to-many relationships, we observe that a `NAMED-DRIVER` cannot exist without both a `PERSON` and a `CAR` - the relationships become identifying and would be specified using hyphens, which translate to a solid line: +**Aliases** + +| Value | Alias for | +| :-----------: | :---------------: | +| to | _identifying_ | +| optionally to | _non-identifying_ | + ```mmd erDiagram CAR ||--o{ NAMED-DRIVER : allows @@ -155,6 +179,7 @@ erDiagram string lastName int age } + MANUFACTURER only one to zero or more CAR ``` ### Other Things From d41efa413c65e0db3d9b39d37ec5157dd7f83565 Mon Sep 17 00:00:00 2001 From: Dima Kurilo Date: Mon, 17 Oct 2022 09:58:04 -0400 Subject: [PATCH 26/42] add more docs --- docs/classDiagram.md | 8 ++++++++ packages/mermaid/src/docs/classDiagram.md | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/docs/classDiagram.md b/docs/classDiagram.md index 60dc6c390..f89b4b002 100644 --- a/docs/classDiagram.md +++ b/docs/classDiagram.md @@ -11,7 +11,9 @@ Mermaid can render class diagrams. ```mermaid-example classDiagram + note "From Duck till Zebra" Animal <|-- Duck + note for Duck "can fly\ncan swim\ncan dive\ncan help in debugging" Animal <|-- Fish Animal <|-- Zebra Animal : +int age @@ -35,7 +37,9 @@ classDiagram ```mermaid classDiagram + note "From Duck till Zebra" Animal <|-- Duck + note for Duck "can fly\ncan swim\ncan dive\ncan help in debugging" Animal <|-- Fish Animal <|-- Zebra Animal : +int age @@ -549,6 +553,10 @@ You would define these actions on a separate line after all classes have been de - (_optional_) tooltip is a string to be displayed when hovering over element (note: The styles of the tooltip are set by the class .mermaidTooltip.) - note: callback function will be called with the nodeId as parameter. +## Notes + +It is possible to add notes on digram using `note "line1\nline2"` or note for class using `note for class "line1\nline2"` + ### Examples _URL Link:_ diff --git a/packages/mermaid/src/docs/classDiagram.md b/packages/mermaid/src/docs/classDiagram.md index 362e90bc6..3ca564e55 100644 --- a/packages/mermaid/src/docs/classDiagram.md +++ b/packages/mermaid/src/docs/classDiagram.md @@ -9,7 +9,9 @@ Mermaid can render class diagrams. ```mermaid-example classDiagram + note "From Duck till Zebra" Animal <|-- Duck + note for Duck "can fly\ncan swim\ncan dive\ncan help in debugging" Animal <|-- Fish Animal <|-- Zebra Animal : +int age @@ -375,6 +377,10 @@ click className href "url" "tooltip" - (_optional_) tooltip is a string to be displayed when hovering over element (note: The styles of the tooltip are set by the class .mermaidTooltip.) - note: callback function will be called with the nodeId as parameter. +## Notes + +It is possible to add notes on digram using `note "line1\nline2"` or note for class using `note for class "line1\nline2"` + ### Examples _URL Link:_ From 3108e896b6f17854da7e36584469ce066d1338f5 Mon Sep 17 00:00:00 2001 From: Dima Kurilo Date: Mon, 17 Oct 2022 12:03:51 -0400 Subject: [PATCH 27/42] add renedering (cypress) tests --- .../integration/rendering/erDiagram.spec.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cypress/integration/rendering/erDiagram.spec.js b/cypress/integration/rendering/erDiagram.spec.js index 0f9084e7c..d2daa2cfa 100644 --- a/cypress/integration/rendering/erDiagram.spec.js +++ b/cypress/integration/rendering/erDiagram.spec.js @@ -255,4 +255,22 @@ describe('Entity Relationship Diagram', () => { ); cy.get('svg'); }); + + it('should render entities with aliases', () => { + renderGraph( + ` + erDiagram + T1 one or zero to one or more T2 : test + T2 one or many optionally to zero or one T3 : test + T3 zero or more to zero or many T4 : test + T4 many(0) to many(1) T5 : test + T5 many optionally to one T6 : test + T6 only one optionally to only one T1 : test + T4 0+ to 1+ T6 : test + T1 1 to 1 T3 : test + `, + { logLevel: 1 } + ); + cy.get('svg'); + }); }); From cead1f36f477aef9a2f003e3671e90b2d11df199 Mon Sep 17 00:00:00 2001 From: Dima Kurilo Date: Mon, 17 Oct 2022 12:13:22 -0400 Subject: [PATCH 28/42] add basic render (cypress test for notes --- .../integration/rendering/classDiagram.spec.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cypress/integration/rendering/classDiagram.spec.js b/cypress/integration/rendering/classDiagram.spec.js index 8cf410d05..16601652d 100644 --- a/cypress/integration/rendering/classDiagram.spec.js +++ b/cypress/integration/rendering/classDiagram.spec.js @@ -407,4 +407,21 @@ describe('Class diagram', () => { // // expect(svg).to.not.have.attr('style'); // }); // }); + + it('19: should render a simple class diagram with notes', () => { + imgSnapshotTest( + ` + classDiagram + note "I love this diagram!\nDo you love it?" + class Class10 { + <> + int id + size() + } + note for Class10 "Cool class\nI said it's very cool class!" + `, + { logLevel: 1 } + ); + cy.get('svg'); + }); }); From 75e11b1fdeae1e4aa62fdcd4a6ebc752c3418e73 Mon Sep 17 00:00:00 2001 From: Dima Kurilo Date: Mon, 17 Oct 2022 12:33:23 -0400 Subject: [PATCH 29/42] add basic render (cypress) test for classDiagram-v2 too --- .../rendering/classDiagram-v2.spec.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cypress/integration/rendering/classDiagram-v2.spec.js b/cypress/integration/rendering/classDiagram-v2.spec.js index d285a9237..e36693a65 100644 --- a/cypress/integration/rendering/classDiagram-v2.spec.js +++ b/cypress/integration/rendering/classDiagram-v2.spec.js @@ -478,4 +478,22 @@ describe('Class diagram V2', () => { ); cy.get('svg'); }); + + it('18: should render a simple class diagram with notes', () => { + imgSnapshotTest( + ` + classDiagram-v2 + note "I love this diagram!\nDo you love it?" + class Class10 { + <> + int id + size() + } + note for Class10 "Cool class\nI said it's very cool class!" + + `, + { logLevel: 1, flowchart: { htmlLabels: false } } + ); + cy.get('svg'); + }); }); From 2ae8bf29877a447aa0e62c845446681369525391 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Tue, 18 Oct 2022 16:04:14 +0200 Subject: [PATCH 30/42] Color fix for default nodes in mindmap, line uses inv color --- packages/mermaid-mindmap/src/styles.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/mermaid-mindmap/src/styles.js b/packages/mermaid-mindmap/src/styles.js index 95674e8f8..241938b62 100644 --- a/packages/mermaid-mindmap/src/styles.js +++ b/packages/mermaid-mindmap/src/styles.js @@ -27,6 +27,7 @@ const genSections = (options) => { .node-icon-${i - 1} { font-size: 40px; color: ${options['cScaleLabel' + i]}; + // fill: ${options['cScaleLabel' + i]}; // color: ${options['gitInv' + i]}; } .section-edge-${i - 1}{ @@ -36,7 +37,7 @@ const genSections = (options) => { stroke-width: ${sw}; } .section-${i - 1} line { - stroke: ${options['lineColor' + i]} ; + stroke: ${options['cScaleInv' + i]} ; stroke-width: 3; } From 77f5e0d5f3fa50f71dd79eadda2068ca4720a6e6 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Wed, 19 Oct 2022 19:13:05 +0530 Subject: [PATCH 31/42] fix: Add default arg to options --- packages/mermaid/src/mermaidAPI.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mermaid/src/mermaidAPI.ts b/packages/mermaid/src/mermaidAPI.ts index df6ab1a2b..13366f41d 100644 --- a/packages/mermaid/src/mermaidAPI.ts +++ b/packages/mermaid/src/mermaidAPI.ts @@ -453,7 +453,7 @@ const handleDirective = function (p: any, directive: any, type: string): void { }; /** @param {MermaidConfig} options */ -async function initialize(options: MermaidConfig) { +async function initialize(options: MermaidConfig = {}) { // Handle legacy location of font-family configuration if (options.fontFamily) { if (!options.themeVariables) { From 3d140a7411fb290951ac4ea9cd7d610e5c418ff6 Mon Sep 17 00:00:00 2001 From: Jeroen Ekkelkamp Date: Wed, 19 Oct 2022 20:04:45 +0200 Subject: [PATCH 32/42] added curly rule to eslintrc --- .eslintrc.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.json b/.eslintrc.json index 7b95ac6da..133ab42cd 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -24,6 +24,7 @@ ], "plugins": ["@typescript-eslint", "no-only-tests", "html", "jest", "jsdoc", "json", "@cspell"], "rules": { + "curly": "error", "no-console": "error", "no-prototype-builtins": "off", "no-unused-vars": "off", From 0c4edd332cd3f88ce3f2e66bd0c9879508419117 Mon Sep 17 00:00:00 2001 From: Jeroen Ekkelkamp Date: Wed, 19 Oct 2022 20:06:54 +0200 Subject: [PATCH 33/42] Ran linter (npm run lint:fix) --- cypress/helpers/util.js | 8 +++- cypress/platform/viewer.js | 4 +- .../mermaid/src/dagre-wrapper/createLabel.js | 4 +- packages/mermaid/src/dagre-wrapper/edges.js | 4 +- .../src/dagre-wrapper/mermaid-graphlib.js | 40 ++++++++++++---- packages/mermaid/src/dagre-wrapper/nodes.js | 8 +++- packages/mermaid/src/defaultConfig.ts | 8 +++- packages/mermaid/src/diagrams/c4/c4Db.js | 48 ++++++++++++++----- .../mermaid/src/diagrams/c4/c4Renderer.js | 8 +++- packages/mermaid/src/diagrams/c4/svgDraw.js | 22 ++++++--- .../mermaid/src/diagrams/class/classDb.js | 12 +++-- .../src/diagrams/class/classDetector-V2.ts | 6 ++- .../src/diagrams/class/classDetector.ts | 4 +- .../mermaid/src/diagrams/class/svgDraw.js | 8 +++- .../mermaid/src/diagrams/common/common.ts | 12 +++-- .../src/diagrams/flowchart/flowChartShapes.js | 8 +++- .../mermaid/src/diagrams/flowchart/flowDb.js | 4 +- .../src/diagrams/flowchart/flowDetector-v2.ts | 3 +- .../src/diagrams/flowchart/flowDetector.ts | 4 +- .../mermaid/src/diagrams/gantt/ganttDb.js | 4 +- .../src/diagrams/gantt/ganttRenderer.js | 8 +++- .../mermaid/src/diagrams/git/gitGraphAst.js | 12 +++-- .../src/diagrams/git/gitGraphRenderer-old.js | 4 +- .../src/diagrams/sequence/sequenceDb.js | 4 +- .../src/diagrams/sequence/sequenceRenderer.ts | 7 ++- .../mermaid/src/diagrams/sequence/svgDraw.js | 8 +++- packages/mermaid/src/diagrams/state/shapes.js | 31 ++++++++---- .../mermaid/src/diagrams/state/stateDb.js | 4 +- .../src/diagrams/state/stateDetector-V2.ts | 7 ++- .../src/diagrams/state/stateDetector.ts | 4 +- .../src/diagrams/state/stateRenderer.js | 8 ++-- .../diagrams/user-journey/journeyRenderer.ts | 4 +- packages/mermaid/src/mermaid.ts | 4 +- packages/mermaid/src/mermaidAPI.ts | 8 +++- packages/mermaid/src/utils.ts | 40 ++++++++++++---- 35 files changed, 276 insertions(+), 96 deletions(-) diff --git a/cypress/helpers/util.js b/cypress/helpers/util.js index 33632b28a..bc5282e11 100644 --- a/cypress/helpers/util.js +++ b/cypress/helpers/util.js @@ -58,7 +58,9 @@ export const imgSnapshotTest = (graphStr, _options, api = false, validation) => const url = mermaidUrl(graphStr, options, api); cy.visit(url); - if (validation) cy.get('svg').should(validation); + if (validation) { + cy.get('svg').should(validation); + } cy.get('svg'); // Default name to test title @@ -106,7 +108,9 @@ export const urlSnapshotTest = (url, _options, api = false, validation) => { } cy.visit(url); - if (validation) cy.get('svg').should(validation); + if (validation) { + cy.get('svg').should(validation); + } cy.get('body'); // Default name to test title diff --git a/cypress/platform/viewer.js b/cypress/platform/viewer.js index f0426dc09..1333d7ec0 100644 --- a/cypress/platform/viewer.js +++ b/cypress/platform/viewer.js @@ -120,7 +120,9 @@ const contentLoadedApi = function () { (svgCode, bindFunctions) => { div.innerHTML = svgCode; - if (bindFunctions) bindFunctions(div); + if (bindFunctions) { + bindFunctions(div); + } }, div ); diff --git a/packages/mermaid/src/dagre-wrapper/createLabel.js b/packages/mermaid/src/dagre-wrapper/createLabel.js index ba0ce4a5d..9d7951798 100644 --- a/packages/mermaid/src/dagre-wrapper/createLabel.js +++ b/packages/mermaid/src/dagre-wrapper/createLabel.js @@ -44,7 +44,9 @@ function addHtmlLabel(node) { const createLabel = (_vertexText, style, isTitle, isNode) => { let vertexText = _vertexText || ''; - if (typeof vertexText === 'object') vertexText = vertexText[0]; + if (typeof vertexText === 'object') { + vertexText = vertexText[0]; + } if (evaluate(getConfig().flowchart.htmlLabels)) { // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that? vertexText = vertexText.replace(/\\n|\n/g, '
'); diff --git a/packages/mermaid/src/dagre-wrapper/edges.js b/packages/mermaid/src/dagre-wrapper/edges.js index 606c0ca8a..4d23ca3ea 100644 --- a/packages/mermaid/src/dagre-wrapper/edges.js +++ b/packages/mermaid/src/dagre-wrapper/edges.js @@ -336,7 +336,9 @@ const cutPathAtIntersect = (_points, boundryNode) => { log.warn('abc88 outside', point, lastPointOutside); lastPointOutside = point; // points.push(point); - if (!isInside) points.push(point); + if (!isInside) { + points.push(point); + } } }); log.warn('abc88 returning points', points); diff --git a/packages/mermaid/src/dagre-wrapper/mermaid-graphlib.js b/packages/mermaid/src/dagre-wrapper/mermaid-graphlib.js index 950a8b02b..502c039ff 100644 --- a/packages/mermaid/src/dagre-wrapper/mermaid-graphlib.js +++ b/packages/mermaid/src/dagre-wrapper/mermaid-graphlib.js @@ -23,7 +23,9 @@ const isDecendant = (id, ancenstorId) => { ' = ', decendants[ancenstorId].indexOf(id) >= 0 ); - if (decendants[ancenstorId].indexOf(id) >= 0) return true; + if (decendants[ancenstorId].indexOf(id) >= 0) { + return true; + } return false; }; @@ -32,17 +34,29 @@ const edgeInCluster = (edge, clusterId) => { log.info('Decendants of ', clusterId, ' is ', decendants[clusterId]); log.info('Edge is ', edge); // Edges to/from the cluster is not in the cluster, they are in the parent - if (edge.v === clusterId) return false; - if (edge.w === clusterId) return false; + if (edge.v === clusterId) { + return false; + } + if (edge.w === clusterId) { + return false; + } if (!decendants[clusterId]) { log.debug('Tilt, ', clusterId, ',not in decendants'); return false; } - if (decendants[clusterId].indexOf(edge.v) >= 0) return true; - if (isDecendant(edge.v, clusterId)) return true; - if (isDecendant(edge.w, clusterId)) return true; - if (decendants[clusterId].indexOf(edge.w) >= 0) return true; + if (decendants[clusterId].indexOf(edge.v) >= 0) { + return true; + } + if (isDecendant(edge.v, clusterId)) { + return true; + } + if (isDecendant(edge.w, clusterId)) { + return true; + } + if (decendants[clusterId].indexOf(edge.w) >= 0) { + return true; + } return false; }; @@ -306,8 +320,12 @@ export const adjustClustersAndEdges = (graph, depth) => { v = getAnchorId(e.v); w = getAnchorId(e.w); graph.removeEdge(e.v, e.w, e.name); - if (v !== e.v) edge.fromCluster = e.v; - if (w !== e.w) edge.toCluster = e.w; + if (v !== e.v) { + edge.fromCluster = e.v; + } + if (w !== e.w) { + edge.toCluster = e.w; + } log.warn('Fix Replacing with XXX', v, w, e.name); graph.setEdge(v, w, edge, e.name); } @@ -446,7 +464,9 @@ export const extractor = (graph, depth) => { }; const sorter = (graph, nodes) => { - if (nodes.length === 0) return []; + if (nodes.length === 0) { + return []; + } let result = Object.assign(nodes); nodes.forEach((node) => { const children = graph.children(node); diff --git a/packages/mermaid/src/dagre-wrapper/nodes.js b/packages/mermaid/src/dagre-wrapper/nodes.js index 5d5bd2f2c..316432b95 100644 --- a/packages/mermaid/src/dagre-wrapper/nodes.js +++ b/packages/mermaid/src/dagre-wrapper/nodes.js @@ -293,9 +293,13 @@ const cylinder = (parent, node) => { // ellipsis equation: x*x / a*a + y*y / b*b = 1 // solve for y to get adjusted value for pos.y let y = ry * ry * (1 - (x * x) / (rx * rx)); - if (y != 0) y = Math.sqrt(y); + if (y != 0) { + y = Math.sqrt(y); + } y = ry - y; - if (point.y - node.y > 0) y = -y; + if (point.y - node.y > 0) { + y = -y; + } pos.y += y; } diff --git a/packages/mermaid/src/defaultConfig.ts b/packages/mermaid/src/defaultConfig.ts index 38b910ffb..3a9bd1841 100644 --- a/packages/mermaid/src/defaultConfig.ts +++ b/packages/mermaid/src/defaultConfig.ts @@ -1833,8 +1833,12 @@ const config: Partial = { fontSize: 16, }; -if (config.class) config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute; -if (config.gitGraph) config.gitGraph.arrowMarkerAbsolute = config.arrowMarkerAbsolute; +if (config.class) { + config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute; +} +if (config.gitGraph) { + config.gitGraph.arrowMarkerAbsolute = config.arrowMarkerAbsolute; +} const keyify = (obj: any, prefix = ''): string[] => Object.keys(obj).reduce((res: string[], el): string[] => { diff --git a/packages/mermaid/src/diagrams/c4/c4Db.js b/packages/mermaid/src/diagrams/c4/c4Db.js index 79028a0c5..d337b15c0 100644 --- a/packages/mermaid/src/diagrams/c4/c4Db.js +++ b/packages/mermaid/src/diagrams/c4/c4Db.js @@ -49,8 +49,9 @@ export const addRel = function (type, from, to, label, techn, descr, sprite, tag to === null || label === undefined || label === null - ) + ) { return; + } let rel = {}; const old = rels.find((rel) => rel.from === from && rel.to === to); @@ -111,7 +112,9 @@ export const addRel = function (type, from, to, label, techn, descr, sprite, tag //type, alias, label, ?descr, ?sprite, ?tags, $link export const addPersonOrSystem = function (typeC4Shape, alias, label, descr, sprite, tags, link) { // Don't allow label nulling - if (alias === null || label === null) return; + if (alias === null || label === null) { + return; + } let personOrSystem = {}; const old = c4ShapeArray.find((personOrSystem) => personOrSystem.alias === alias); @@ -166,7 +169,9 @@ export const addPersonOrSystem = function (typeC4Shape, alias, label, descr, spr //type, alias, label, ?techn, ?descr ?sprite, ?tags, $link export const addContainer = function (typeC4Shape, alias, label, techn, descr, sprite, tags, link) { // Don't allow label nulling - if (alias === null || label === null) return; + if (alias === null || label === null) { + return; + } let container = {}; const old = c4ShapeArray.find((container) => container.alias === alias); @@ -232,7 +237,9 @@ export const addContainer = function (typeC4Shape, alias, label, techn, descr, s //type, alias, label, ?techn, ?descr ?sprite, ?tags, $link export const addComponent = function (typeC4Shape, alias, label, techn, descr, sprite, tags, link) { // Don't allow label nulling - if (alias === null || label === null) return; + if (alias === null || label === null) { + return; + } let component = {}; const old = c4ShapeArray.find((component) => component.alias === alias); @@ -300,7 +307,9 @@ export const addPersonOrSystemBoundary = function (alias, label, type, tags, lin // if (parentBoundary === null) return; // Don't allow label nulling - if (alias === null || label === null) return; + if (alias === null || label === null) { + return; + } let boundary = {}; const old = boundarys.find((boundary) => boundary.alias === alias); @@ -354,7 +363,9 @@ export const addContainerBoundary = function (alias, label, type, tags, link) { // if (parentBoundary === null) return; // Don't allow label nulling - if (alias === null || label === null) return; + if (alias === null || label === null) { + return; + } let boundary = {}; const old = boundarys.find((boundary) => boundary.alias === alias); @@ -417,7 +428,9 @@ export const addDeploymentNode = function ( // if (parentBoundary === null) return; // Don't allow label nulling - if (alias === null || label === null) return; + if (alias === null || label === null) { + return; + } let boundary = {}; const old = boundarys.find((boundary) => boundary.alias === alias); @@ -646,8 +659,12 @@ export const updateLayoutConfig = function (typeC4Shape, c4ShapeInRowParam, c4Bo c4BoundaryInRowValue = parseInt(c4BoundaryInRowParam); } - if (c4ShapeInRowValue >= 1) c4ShapeInRow = c4ShapeInRowValue; - if (c4BoundaryInRowValue >= 1) c4BoundaryInRow = c4BoundaryInRowValue; + if (c4ShapeInRowValue >= 1) { + c4ShapeInRow = c4ShapeInRowValue; + } + if (c4BoundaryInRowValue >= 1) { + c4BoundaryInRow = c4BoundaryInRowValue; + } }; export const getC4ShapeInRow = function () { @@ -665,11 +682,13 @@ export const getParentBoundaryParse = function () { }; export const getC4ShapeArray = function (parentBoundary) { - if (parentBoundary === undefined || parentBoundary === null) return c4ShapeArray; - else + if (parentBoundary === undefined || parentBoundary === null) { + return c4ShapeArray; + } else { return c4ShapeArray.filter((personOrSystem) => { return personOrSystem.parentBoundary === parentBoundary; }); + } }; export const getC4Shape = function (alias) { return c4ShapeArray.find((personOrSystem) => personOrSystem.alias === alias); @@ -679,8 +698,11 @@ export const getC4ShapeKeys = function (parentBoundary) { }; export const getBoundarys = function (parentBoundary) { - if (parentBoundary === undefined || parentBoundary === null) return boundarys; - else return boundarys.filter((boundary) => boundary.parentBoundary === parentBoundary); + if (parentBoundary === undefined || parentBoundary === null) { + return boundarys; + } else { + return boundarys.filter((boundary) => boundary.parentBoundary === parentBoundary); + } }; export const getRels = function () { diff --git a/packages/mermaid/src/diagrams/c4/c4Renderer.js b/packages/mermaid/src/diagrams/c4/c4Renderer.js index c4f40b0bc..a9072346a 100644 --- a/packages/mermaid/src/diagrams/c4/c4Renderer.js +++ b/packages/mermaid/src/diagrams/c4/c4Renderer.js @@ -414,7 +414,9 @@ export const drawRels = function (diagram, rels, getC4ShapeObj, diagObj) { let relTextWrap = rel.wrap && conf.wrap; let relConf = messageFont(conf); let diagramType = diagObj.db.getC4Type(); - if (diagramType === 'C4Dynamic') rel.label.text = i + ': ' + rel.label.text; + if (diagramType === 'C4Dynamic') { + rel.label.text = i + ': ' + rel.label.text; + } let textLimitWidth = calculateTextWidth(rel.label.text, relConf); calcC4ShapeTextWH('label', rel, relTextWrap, relConf, textLimitWidth); @@ -555,7 +557,9 @@ function drawInsideBoundary( ); } // draw boundary - if (currentBoundary.alias !== 'global') drawBoundary(diagram, currentBoundary, currentBounds); + if (currentBoundary.alias !== 'global') { + drawBoundary(diagram, currentBoundary, currentBounds); + } parentBounds.data.stopy = Math.max( currentBounds.data.stopy + conf.c4ShapeMargin, parentBounds.data.stopy diff --git a/packages/mermaid/src/diagrams/c4/svgDraw.js b/packages/mermaid/src/diagrams/c4/svgDraw.js index 5666d9f84..437a24bcb 100644 --- a/packages/mermaid/src/diagrams/c4/svgDraw.js +++ b/packages/mermaid/src/diagrams/c4/svgDraw.js @@ -13,7 +13,9 @@ export const drawRect = function (elem, rectData) { rectElem.attr('ry', rectData.ry); if (rectData.attrs !== 'undefined' && rectData.attrs !== null) { - for (let attrKey in rectData.attrs) rectElem.attr(attrKey, rectData.attrs[attrKey]); + for (let attrKey in rectData.attrs) { + rectElem.attr(attrKey, rectData.attrs[attrKey]); + } } if (rectData.class !== 'undefined') { @@ -231,9 +233,12 @@ export const drawRels = (elem, rels, conf) => { line.attr('stroke-width', '1'); line.attr('stroke', strokeColor); line.style('fill', 'none'); - if (rel.type !== 'rel_b') line.attr('marker-end', 'url(' + url + '#arrowhead)'); - if (rel.type === 'birel' || rel.type === 'rel_b') + if (rel.type !== 'rel_b') { + line.attr('marker-end', 'url(' + url + '#arrowhead)'); + } + if (rel.type === 'birel' || rel.type === 'rel_b') { line.attr('marker-start', 'url(' + url + '#arrowend)'); + } i = -1; } else { let line = relsElem.append('path'); @@ -256,9 +261,12 @@ export const drawRels = (elem, rels, conf) => { .replaceAll('stopx', rel.endPoint.x) .replaceAll('stopy', rel.endPoint.y) ); - if (rel.type !== 'rel_b') line.attr('marker-end', 'url(' + url + '#arrowhead)'); - if (rel.type === 'birel' || rel.type === 'rel_b') + if (rel.type !== 'rel_b') { + line.attr('marker-end', 'url(' + url + '#arrowhead)'); + } + if (rel.type === 'birel' || rel.type === 'rel_b') { line.attr('marker-start', 'url(' + url + '#arrowend)'); + } } let messageConf = conf.messageFont(); @@ -314,7 +322,9 @@ const drawBoundary = function (elem, boundary, conf) { let fontColor = boundary.fontColor ? boundary.fontColor : 'black'; let attrsValue = { 'stroke-width': 1.0, 'stroke-dasharray': '7.0,7.0' }; - if (boundary.nodeType) attrsValue = { 'stroke-width': 1.0 }; + if (boundary.nodeType) { + attrsValue = { 'stroke-width': 1.0 }; + } let rectData = { x: boundary.x, y: boundary.y, diff --git a/packages/mermaid/src/diagrams/class/classDb.js b/packages/mermaid/src/diagrams/class/classDb.js index 223bfe067..6c49381c4 100644 --- a/packages/mermaid/src/diagrams/class/classDb.js +++ b/packages/mermaid/src/diagrams/class/classDb.js @@ -49,7 +49,9 @@ const splitClassNameAndType = function (id) { export const addClass = function (id) { let classId = splitClassNameAndType(id); // Only add class if not exists - if (typeof classes[classId.className] !== 'undefined') return; + if (typeof classes[classId.className] !== 'undefined') { + return; + } classes[classId.className] = { id: classId.className, @@ -185,7 +187,9 @@ export const cleanupLabel = function (label) { export const setCssClass = function (ids, className) { ids.split(',').forEach(function (_id) { let id = _id; - if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id; + if (_id[0].match(/\d/)) { + id = MERMAID_DOM_ID_PREFIX + id; + } if (typeof classes[id] !== 'undefined') { classes[id].cssClasses.push(className); } @@ -220,7 +224,9 @@ export const setLink = function (ids, linkStr, target) { const config = configApi.getConfig(); ids.split(',').forEach(function (_id) { let id = _id; - if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id; + if (_id[0].match(/\d/)) { + id = MERMAID_DOM_ID_PREFIX + id; + } if (typeof classes[id] !== 'undefined') { classes[id].link = utils.formatUrl(linkStr, config); if (config.securityLevel === 'sandbox') { diff --git a/packages/mermaid/src/diagrams/class/classDetector-V2.ts b/packages/mermaid/src/diagrams/class/classDetector-V2.ts index 35614b64f..7100f6c66 100644 --- a/packages/mermaid/src/diagrams/class/classDetector-V2.ts +++ b/packages/mermaid/src/diagrams/class/classDetector-V2.ts @@ -2,8 +2,12 @@ import type { DiagramDetector } from '../../diagram-api/types'; export const classDetectorV2: DiagramDetector = (txt, config) => { // If we have configured to use dagre-wrapper then we should return true in this function for classDiagram code thus making it use the new class diagram - if (txt.match(/^\s*classDiagram/) !== null && config?.class?.defaultRenderer === 'dagre-wrapper') + if ( + txt.match(/^\s*classDiagram/) !== null && + config?.class?.defaultRenderer === 'dagre-wrapper' + ) { return true; + } // We have not opted to use the new renderer so we should return true if we detect a class diagram return txt.match(/^\s*classDiagram-v2/) !== null; }; diff --git a/packages/mermaid/src/diagrams/class/classDetector.ts b/packages/mermaid/src/diagrams/class/classDetector.ts index 93c6a863b..c3833ed28 100644 --- a/packages/mermaid/src/diagrams/class/classDetector.ts +++ b/packages/mermaid/src/diagrams/class/classDetector.ts @@ -2,7 +2,9 @@ import type { DiagramDetector } from '../../diagram-api/types'; export const classDetector: DiagramDetector = (txt, config) => { // If we have configured to use dagre-wrapper then we should never return true in this function - if (config?.class?.defaultRenderer === 'dagre-wrapper') return false; + if (config?.class?.defaultRenderer === 'dagre-wrapper') { + return false; + } // We have not opted to use the new renderer so we should return true if we detect a class diagram return txt.match(/^\s*classDiagram/) !== null; }; diff --git a/packages/mermaid/src/diagrams/class/svgDraw.js b/packages/mermaid/src/diagrams/class/svgDraw.js index 443765b48..4be4ff2e5 100644 --- a/packages/mermaid/src/diagrams/class/svgDraw.js +++ b/packages/mermaid/src/diagrams/class/svgDraw.js @@ -190,7 +190,9 @@ export const drawClass = function (elem, classDef, conf, diagObj) { let isFirst = true; classDef.annotations.forEach(function (member) { const titleText2 = title.append('tspan').text('«' + member + '»'); - if (!isFirst) titleText2.attr('dy', conf.textHeight); + if (!isFirst) { + titleText2.attr('dy', conf.textHeight); + } isFirst = false; }); @@ -203,7 +205,9 @@ export const drawClass = function (elem, classDef, conf, diagObj) { const classTitle = title.append('tspan').text(classTitleString).attr('class', 'title'); // If class has annotations the title needs to have an offset of the text height - if (!isFirst) classTitle.attr('dy', conf.textHeight); + if (!isFirst) { + classTitle.attr('dy', conf.textHeight); + } const titleHeight = title.node().getBBox().height; diff --git a/packages/mermaid/src/diagrams/common/common.ts b/packages/mermaid/src/diagrams/common/common.ts index 8caa4c7a6..e7fb395de 100644 --- a/packages/mermaid/src/diagrams/common/common.ts +++ b/packages/mermaid/src/diagrams/common/common.ts @@ -8,7 +8,9 @@ import { MermaidConfig } from '../../config.type'; * @returns {string[]} The rows in that string */ export const getRows = (s?: string): string[] => { - if (!s) return ['']; + if (!s) { + return ['']; + } const str = breakToPlaceholder(s).replace(/\\n/g, '#br#'); return str.split('#br#'); }; @@ -39,7 +41,9 @@ const sanitizeMore = (text: string, config: MermaidConfig) => { }; export const sanitizeText = (text: string, config: MermaidConfig): string => { - if (!text) return text; + if (!text) { + return text; + } if (config.dompurifyConfig) { text = DOMPurify.sanitize(sanitizeMore(text, config), config.dompurifyConfig).toString(); } else { @@ -52,7 +56,9 @@ export const sanitizeTextOrArray = ( a: string | string[] | string[][], config: MermaidConfig ): string | string[] => { - if (typeof a === 'string') return sanitizeText(a, config); + if (typeof a === 'string') { + return sanitizeText(a, config); + } // TODO: Refactor to avoid flat. return a.flat().map((x: string) => sanitizeText(x, config)); }; diff --git a/packages/mermaid/src/diagrams/flowchart/flowChartShapes.js b/packages/mermaid/src/diagrams/flowchart/flowChartShapes.js index 32a26720f..b66bfe730 100644 --- a/packages/mermaid/src/diagrams/flowchart/flowChartShapes.js +++ b/packages/mermaid/src/diagrams/flowchart/flowChartShapes.js @@ -281,9 +281,13 @@ function cylinder(parent, bbox, node) { // ellipsis equation: x*x / a*a + y*y / b*b = 1 // solve for y to get adjusted value for pos.y let y = ry * ry * (1 - (x * x) / (rx * rx)); - if (y != 0) y = Math.sqrt(y); + if (y != 0) { + y = Math.sqrt(y); + } y = ry - y; - if (point.y - node.y > 0) y = -y; + if (point.y - node.y > 0) { + y = -y; + } pos.y += y; } diff --git a/packages/mermaid/src/diagrams/flowchart/flowDb.js b/packages/mermaid/src/diagrams/flowchart/flowDb.js index 5aa203225..225aee180 100644 --- a/packages/mermaid/src/diagrams/flowchart/flowDb.js +++ b/packages/mermaid/src/diagrams/flowchart/flowDb.js @@ -699,7 +699,9 @@ const destructLink = (_str, _startStr) => { startInfo.type = info.type; } else { // x-- xyz --> - not supported - if (startInfo.type !== info.type) return { type: 'INVALID', stroke: 'INVALID' }; + if (startInfo.type !== info.type) { + return { type: 'INVALID', stroke: 'INVALID' }; + } startInfo.type = 'double_' + startInfo.type; } diff --git a/packages/mermaid/src/diagrams/flowchart/flowDetector-v2.ts b/packages/mermaid/src/diagrams/flowchart/flowDetector-v2.ts index 7ef39e421..c88a63fa6 100644 --- a/packages/mermaid/src/diagrams/flowchart/flowDetector-v2.ts +++ b/packages/mermaid/src/diagrams/flowchart/flowDetector-v2.ts @@ -2,7 +2,8 @@ import type { DiagramDetector } from '../../diagram-api/types'; export const flowDetectorV2: DiagramDetector = (txt, config) => { // If we have configured to use dagre-wrapper then we should return true in this function for graph code thus making it use the new flowchart diagram - if (config?.flowchart?.defaultRenderer === 'dagre-wrapper' && txt.match(/^\s*graph/) !== null) + if (config?.flowchart?.defaultRenderer === 'dagre-wrapper' && txt.match(/^\s*graph/) !== null) { return true; + } return txt.match(/^\s*flowchart/) !== null; }; diff --git a/packages/mermaid/src/diagrams/flowchart/flowDetector.ts b/packages/mermaid/src/diagrams/flowchart/flowDetector.ts index 0cf54c7d5..02ef63f99 100644 --- a/packages/mermaid/src/diagrams/flowchart/flowDetector.ts +++ b/packages/mermaid/src/diagrams/flowchart/flowDetector.ts @@ -3,6 +3,8 @@ import type { DiagramDetector } from '../../diagram-api/types'; export const flowDetector: DiagramDetector = (txt, config) => { // If we have conferred to only use new flow charts this function should always return false // as in not signalling true for a legacy flowchart - if (config?.flowchart?.defaultRenderer === 'dagre-wrapper') return false; + if (config?.flowchart?.defaultRenderer === 'dagre-wrapper') { + return false; + } return txt.match(/^\s*graph/) !== null; }; diff --git a/packages/mermaid/src/diagrams/gantt/ganttDb.js b/packages/mermaid/src/diagrams/gantt/ganttDb.js index 096b5a410..99c93ea04 100644 --- a/packages/mermaid/src/diagrams/gantt/ganttDb.js +++ b/packages/mermaid/src/diagrams/gantt/ganttDb.js @@ -153,7 +153,9 @@ export const isInvalidDate = function (date, dateFormat, excludes, includes) { }; const checkTaskDates = function (task, dateFormat, excludes, includes) { - if (!excludes.length || task.manualEndTime) return; + if (!excludes.length || task.manualEndTime) { + return; + } let startTime = moment(task.startTime, dateFormat, true); startTime.add(1, 'd'); let endTime = moment(task.endTime, dateFormat, true); diff --git a/packages/mermaid/src/diagrams/gantt/ganttRenderer.js b/packages/mermaid/src/diagrams/gantt/ganttRenderer.js index 8ad9ca037..c9f6836a5 100644 --- a/packages/mermaid/src/diagrams/gantt/ganttRenderer.js +++ b/packages/mermaid/src/diagrams/gantt/ganttRenderer.js @@ -427,7 +427,9 @@ export const draw = function (text, id, version, diagObj) { ); const maxTime = tasks.reduce((max, { endTime }) => (max ? Math.max(max, endTime) : endTime), 0); const dateFormat = diagObj.db.getDateFormat(); - if (!minTime || !maxTime) return; + if (!minTime || !maxTime) { + return; + } const excludeRanges = []; let range = null; @@ -552,7 +554,9 @@ export const draw = function (text, id, version, diagObj) { const tspan = doc.createElementNS('http://www.w3.org/2000/svg', 'tspan'); tspan.setAttribute('alignment-baseline', 'central'); tspan.setAttribute('x', '10'); - if (j > 0) tspan.setAttribute('dy', '1em'); + if (j > 0) { + tspan.setAttribute('dy', '1em'); + } tspan.textContent = rows[j]; svgLabel.appendChild(tspan); } diff --git a/packages/mermaid/src/diagrams/git/gitGraphAst.js b/packages/mermaid/src/diagrams/git/gitGraphAst.js index c5674f39d..496e578b7 100644 --- a/packages/mermaid/src/diagrams/git/gitGraphAst.js +++ b/packages/mermaid/src/diagrams/git/gitGraphAst.js @@ -399,7 +399,9 @@ function upsert(arr, key, newVal) { /** @param commitArr */ function prettyPrintCommitHistory(commitArr) { const commit = commitArr.reduce((out, commit) => { - if (out.seq > commit.seq) return out; + if (out.seq > commit.seq) { + return out; + } return commit; }, commitArr[0]); let line = ''; @@ -412,7 +414,9 @@ function prettyPrintCommitHistory(commitArr) { }); const label = [line, commit.id, commit.seq]; for (let branch in branches) { - if (branches[branch] === commit.id) label.push(branch); + if (branches[branch] === commit.id) { + label.push(branch); + } } log.debug(label.join(' ')); if (commit.parents && commit.parents.length == 2) { @@ -452,7 +456,9 @@ export const clear = function () { export const getBranchesAsObjArray = function () { const branchesArray = Object.values(branchesConfig) .map((branchConfig, i) => { - if (branchConfig.order !== null) return branchConfig; + if (branchConfig.order !== null) { + return branchConfig; + } return { ...branchConfig, order: parseFloat(`0.${i}`, 10), diff --git a/packages/mermaid/src/diagrams/git/gitGraphRenderer-old.js b/packages/mermaid/src/diagrams/git/gitGraphRenderer-old.js index fa46dfde9..bfb0ea71c 100644 --- a/packages/mermaid/src/diagrams/git/gitGraphRenderer-old.js +++ b/packages/mermaid/src/diagrams/git/gitGraphRenderer-old.js @@ -357,7 +357,9 @@ export const draw = function (txt, id, ver) { branchNum++; } svg.attr('height', function () { - if (direction === 'BT') return Object.keys(allCommitsDict).length * config.nodeSpacing; + if (direction === 'BT') { + return Object.keys(allCommitsDict).length * config.nodeSpacing; + } return (branches.length + 1) * config.branchOffset; }); } catch (e) { diff --git a/packages/mermaid/src/diagrams/sequence/sequenceDb.js b/packages/mermaid/src/diagrams/sequence/sequenceDb.js index 6c863e204..ba9d0549b 100644 --- a/packages/mermaid/src/diagrams/sequence/sequenceDb.js +++ b/packages/mermaid/src/diagrams/sequence/sequenceDb.js @@ -26,7 +26,9 @@ export const parseDirective = function (statement, context, type) { export const addActor = function (id, name, description, type) { // Don't allow description nulling const old = actors[id]; - if (old && name === old.name && description == null) return; + if (old && name === old.name && description == null) { + return; + } // Don't allow null descriptions, either if (description == null || description.text == null) { diff --git a/packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts b/packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts index 054de3d9a..22fa5da8c 100644 --- a/packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts +++ b/packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts @@ -762,8 +762,11 @@ export const draw = function (_text, id, _version, diagObj) { case diagObj.db.LINETYPE.AUTONUMBER: sequenceIndex = msg.message.start || sequenceIndex; sequenceIndexStep = msg.message.step || sequenceIndexStep; - if (msg.message.visible) diagObj.db.enableSequenceNumbers(); - else diagObj.db.disableSequenceNumbers(); + if (msg.message.visible) { + diagObj.db.enableSequenceNumbers(); + } else { + diagObj.db.disableSequenceNumbers(); + } break; case diagObj.db.LINETYPE.CRITICAL_START: adjustLoopHeightForWrap( diff --git a/packages/mermaid/src/diagrams/sequence/svgDraw.js b/packages/mermaid/src/diagrams/sequence/svgDraw.js index c2a007edc..0dc437721 100644 --- a/packages/mermaid/src/diagrams/sequence/svgDraw.js +++ b/packages/mermaid/src/diagrams/sequence/svgDraw.js @@ -31,7 +31,9 @@ const addPopupInteraction = (id, actorCnt) => { addFunction(() => { const arr = document.querySelectorAll(id); // This will be the case when running in sandboxed mode - if (arr.length === 0) return; + if (arr.length === 0) { + return; + } arr[0].addEventListener('mouseover', function () { popupMenuUpFunc('actor' + actorCnt + '_popup'); }); @@ -322,7 +324,9 @@ export const drawLabel = function (elem, txtObject) { let actorCnt = -1; export const fixLifeLineHeights = (diagram, bounds) => { - if (!diagram.selectAll) return; + if (!diagram.selectAll) { + return; + } diagram .selectAll('.actor-line') .attr('class', '200') diff --git a/packages/mermaid/src/diagrams/state/shapes.js b/packages/mermaid/src/diagrams/state/shapes.js index cb73b63d2..aa99ff862 100644 --- a/packages/mermaid/src/diagrams/state/shapes.js +++ b/packages/mermaid/src/diagrams/state/shapes.js @@ -217,7 +217,9 @@ export const addTitleAndBox = (g, stateDef, altBkg) => { .attr('rx', '0'); title.attr('x', startX + pad); - if (titleWidth <= orgWidth) title.attr('x', orgX + (width - dblPad) / 2 - titleWidth / 2 + pad); + if (titleWidth <= orgWidth) { + title.attr('x', orgX + (width - dblPad) / 2 - titleWidth / 2 + pad); + } // Title background g.insert('rect', ':first-child') @@ -379,14 +381,27 @@ export const drawState = function (elem, stateDef) { const g = elem.append('g').attr('id', id).attr('class', 'stateGroup'); - if (stateDef.type === 'start') drawStartState(g); - if (stateDef.type === 'end') drawEndState(g); - if (stateDef.type === 'fork' || stateDef.type === 'join') drawForkJoinState(g, stateDef); - if (stateDef.type === 'note') drawNote(stateDef.note.text, g); - if (stateDef.type === 'divider') drawDivider(g); - if (stateDef.type === 'default' && stateDef.descriptions.length === 0) + if (stateDef.type === 'start') { + drawStartState(g); + } + if (stateDef.type === 'end') { + drawEndState(g); + } + if (stateDef.type === 'fork' || stateDef.type === 'join') { + drawForkJoinState(g, stateDef); + } + if (stateDef.type === 'note') { + drawNote(stateDef.note.text, g); + } + if (stateDef.type === 'divider') { + drawDivider(g); + } + if (stateDef.type === 'default' && stateDef.descriptions.length === 0) { drawSimpleState(g, stateDef); - if (stateDef.type === 'default' && stateDef.descriptions.length > 0) drawDescrState(g, stateDef); + } + if (stateDef.type === 'default' && stateDef.descriptions.length > 0) { + drawDescrState(g, stateDef); + } const stateBox = g.node().getBBox(); stateInfo.width = stateBox.width + 2 * getConfig().state.padding; diff --git a/packages/mermaid/src/diagrams/state/stateDb.js b/packages/mermaid/src/diagrams/state/stateDb.js index 96f92af8a..ace6decb4 100644 --- a/packages/mermaid/src/diagrams/state/stateDb.js +++ b/packages/mermaid/src/diagrams/state/stateDb.js @@ -148,7 +148,9 @@ export const addState = function (id, type, doc, descr, note) { } if (descr) { log.info('Adding state ', id, descr); - if (typeof descr === 'string') addDescription(id, descr.trim()); + if (typeof descr === 'string') { + addDescription(id, descr.trim()); + } if (typeof descr === 'object') { descr.forEach((des) => addDescription(id, des.trim())); diff --git a/packages/mermaid/src/diagrams/state/stateDetector-V2.ts b/packages/mermaid/src/diagrams/state/stateDetector-V2.ts index 7fd9633c6..9e59c4a04 100644 --- a/packages/mermaid/src/diagrams/state/stateDetector-V2.ts +++ b/packages/mermaid/src/diagrams/state/stateDetector-V2.ts @@ -1,8 +1,11 @@ import type { DiagramDetector } from '../../diagram-api/types'; export const stateDetectorV2: DiagramDetector = (text, config) => { - if (text.match(/^\s*stateDiagram-v2/) !== null) return true; - if (text.match(/^\s*stateDiagram/) && config?.state?.defaultRenderer === 'dagre-wrapper') + if (text.match(/^\s*stateDiagram-v2/) !== null) { return true; + } + if (text.match(/^\s*stateDiagram/) && config?.state?.defaultRenderer === 'dagre-wrapper') { + return true; + } return false; }; diff --git a/packages/mermaid/src/diagrams/state/stateDetector.ts b/packages/mermaid/src/diagrams/state/stateDetector.ts index ca07eccd5..85338c6df 100644 --- a/packages/mermaid/src/diagrams/state/stateDetector.ts +++ b/packages/mermaid/src/diagrams/state/stateDetector.ts @@ -3,6 +3,8 @@ import type { DiagramDetector } from '../../diagram-api/types'; export const stateDetector: DiagramDetector = (txt, config) => { // If we have confirmed to only use new state diagrams this function should always return false // as in not signalling true for a legacy state diagram - if (config?.state?.defaultRenderer === 'dagre-wrapper') return false; + if (config?.state?.defaultRenderer === 'dagre-wrapper') { + return false; + } return txt.match(/^\s*stateDiagram/) !== null; }; diff --git a/packages/mermaid/src/diagrams/state/stateRenderer.js b/packages/mermaid/src/diagrams/state/stateRenderer.js index 1c218a870..73717a645 100644 --- a/packages/mermaid/src/diagrams/state/stateRenderer.js +++ b/packages/mermaid/src/diagrams/state/stateRenderer.js @@ -120,7 +120,7 @@ const renderDoc = (doc, diagram, parentId, altBkg, root, domDocument, diagObj) = } // Set an object for the graph label - if (parentId) + if (parentId) { graph.setGraph({ rankdir: 'LR', multigraph: true, @@ -133,7 +133,7 @@ const renderDoc = (doc, diagram, parentId, altBkg, root, domDocument, diagObj) = // ranksep: 5, // nodesep: 1 }); - else { + } else { graph.setGraph({ rankdir: 'TB', multigraph: true, @@ -268,7 +268,9 @@ const renderDoc = (doc, diagram, parentId, altBkg, root, domDocument, diagObj) = let pWidth = 0; let pShift = 0; if (parent) { - if (parent.parentElement) pWidth = parent.parentElement.getBBox().width; + if (parent.parentElement) { + pWidth = parent.parentElement.getBBox().width; + } pShift = parseInt(parent.getAttribute('data-x-shift'), 10); if (Number.isNaN(pShift)) { pShift = 0; diff --git a/packages/mermaid/src/diagrams/user-journey/journeyRenderer.ts b/packages/mermaid/src/diagrams/user-journey/journeyRenderer.ts index 290b19e30..208391ab3 100644 --- a/packages/mermaid/src/diagrams/user-journey/journeyRenderer.ts +++ b/packages/mermaid/src/diagrams/user-journey/journeyRenderer.ts @@ -74,7 +74,9 @@ export const draw = function (text, id, version, diagObj) { const title = diagObj.db.getDiagramTitle(); const actorNames = diagObj.db.getActors(); - for (const member in actors) delete actors[member]; + for (const member in actors) { + delete actors[member]; + } let actorPos = 0; actorNames.forEach((actorName) => { actors[actorName] = { diff --git a/packages/mermaid/src/mermaid.ts b/packages/mermaid/src/mermaid.ts index 09842c426..399691083 100644 --- a/packages/mermaid/src/mermaid.ts +++ b/packages/mermaid/src/mermaid.ts @@ -143,7 +143,9 @@ const initThrowsErrors = async function ( if (typeof callback !== 'undefined') { callback(id); } - if (bindFunctions) bindFunctions(element); + if (bindFunctions) { + bindFunctions(element); + } }, element ); diff --git a/packages/mermaid/src/mermaidAPI.ts b/packages/mermaid/src/mermaidAPI.ts index a5605150a..d2c48361a 100644 --- a/packages/mermaid/src/mermaidAPI.ts +++ b/packages/mermaid/src/mermaidAPI.ts @@ -389,11 +389,15 @@ const parseDirective = function (p: any, statement: string, context: string, typ currentDirective = {}; break; case 'type_directive': - if (!currentDirective) throw new Error('currentDirective is undefined'); + if (!currentDirective) { + throw new Error('currentDirective is undefined'); + } currentDirective.type = statement.toLowerCase(); break; case 'arg_directive': - if (!currentDirective) throw new Error('currentDirective is undefined'); + if (!currentDirective) { + throw new Error('currentDirective is undefined'); + } currentDirective.args = JSON.parse(statement); break; case 'close_directive': diff --git a/packages/mermaid/src/utils.ts b/packages/mermaid/src/utils.ts index eecda41e9..ba46011dd 100644 --- a/packages/mermaid/src/utils.ts +++ b/packages/mermaid/src/utils.ts @@ -173,7 +173,9 @@ export const detectDirective = function (text, type = null) { */ export const isSubstringInArray = function (str, arr) { for (let i = 0; i < arr.length; i++) { - if (arr[i].match(str)) return i; + if (arr[i].match(str)) { + return i; + } } return -1; }; @@ -227,7 +229,9 @@ export const runFunc = (functionName, ...params) => { let obj = window; for (let i = 0; i < len; i++) { obj = obj[arrPaths[i]]; - if (!obj) return; + if (!obj) { + return; + } } obj[fnName](...params); @@ -276,8 +280,12 @@ const traverseEdge = (points) => { // The point is remainingDistance from prevPoint in the vector between prevPoint and point // Calculate the coordinates const distanceRatio = remainingDistance / vectorDistance; - if (distanceRatio <= 0) center = prevPoint; - if (distanceRatio >= 1) center = { x: point.x, y: point.y }; + if (distanceRatio <= 0) { + center = prevPoint; + } + if (distanceRatio >= 1) { + center = { x: point.x, y: point.y }; + } if (distanceRatio > 0 && distanceRatio < 1) { center = { x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x, @@ -330,8 +338,12 @@ const calcCardinalityPosition = (isRelationTypePresent, points, initialPosition) // The point is remainingDistance from prevPoint in the vector between prevPoint and point // Calculate the coordinates const distanceRatio = remainingDistance / vectorDistance; - if (distanceRatio <= 0) center = prevPoint; - if (distanceRatio >= 1) center = { x: point.x, y: point.y }; + if (distanceRatio <= 0) { + center = prevPoint; + } + if (distanceRatio >= 1) { + center = { x: point.x, y: point.y }; + } if (distanceRatio > 0 && distanceRatio < 1) { center = { x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x, @@ -389,8 +401,12 @@ const calcTerminalLabelPosition = (terminalMarkerSize, position, _points) => { // The point is remainingDistance from prevPoint in the vector between prevPoint and point // Calculate the coordinates const distanceRatio = remainingDistance / vectorDistance; - if (distanceRatio <= 0) center = prevPoint; - if (distanceRatio >= 1) center = { x: point.x, y: point.y }; + if (distanceRatio <= 0) { + center = prevPoint; + } + if (distanceRatio >= 1) { + center = { x: point.x, y: point.y }; + } if (distanceRatio > 0 && distanceRatio < 1) { center = { x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x, @@ -712,7 +728,9 @@ export const initIdGenerator = class iterator { } next() { - if (!this.deterministic) return Date.now(); + if (!this.deterministic) { + return Date.now(); + } return this.count++; } @@ -834,7 +852,9 @@ export function isDetailedError(error: unknown): error is DetailedError { /** @param error */ export function getErrorMessage(error: unknown): string { - if (error instanceof Error) return error.message; + if (error instanceof Error) { + return error.message; + } return String(error); } From 55d2c928ee7ab774a391383f270e6843a9db41c5 Mon Sep 17 00:00:00 2001 From: Jeroen Ekkelkamp <58693851+jeroenekkelkamp@users.noreply.github.com> Date: Wed, 19 Oct 2022 21:00:40 +0200 Subject: [PATCH 34/42] Update packages/mermaid/src/dagre-wrapper/mermaid-graphlib.js Co-authored-by: Sidharth Vinod --- .../mermaid/src/dagre-wrapper/mermaid-graphlib.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/packages/mermaid/src/dagre-wrapper/mermaid-graphlib.js b/packages/mermaid/src/dagre-wrapper/mermaid-graphlib.js index 502c039ff..6a70264d8 100644 --- a/packages/mermaid/src/dagre-wrapper/mermaid-graphlib.js +++ b/packages/mermaid/src/dagre-wrapper/mermaid-graphlib.js @@ -45,20 +45,7 @@ const edgeInCluster = (edge, clusterId) => { log.debug('Tilt, ', clusterId, ',not in decendants'); return false; } - if (decendants[clusterId].indexOf(edge.v) >= 0) { - return true; - } - if (isDecendant(edge.v, clusterId)) { - return true; - } - if (isDecendant(edge.w, clusterId)) { - return true; - } - if (decendants[clusterId].indexOf(edge.w) >= 0) { - return true; - } - - return false; +return decendants[clusterId].indexOf(edge.v) >= 0 || isDecendant(edge.v, clusterId) || isDecendant(edge.w, clusterId) || decendants[clusterId].indexOf(edge.w) >= 0; }; const copy = (clusterId, graph, newGraph, rootId) => { From 52c5ae6d8e1142ef18db18014e5f09a17b0782a7 Mon Sep 17 00:00:00 2001 From: Jeroen Ekkelkamp Date: Thu, 20 Oct 2022 09:14:38 +0200 Subject: [PATCH 35/42] ran linter --- packages/mermaid/src/dagre-wrapper/mermaid-graphlib.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/mermaid/src/dagre-wrapper/mermaid-graphlib.js b/packages/mermaid/src/dagre-wrapper/mermaid-graphlib.js index 6a70264d8..56f656430 100644 --- a/packages/mermaid/src/dagre-wrapper/mermaid-graphlib.js +++ b/packages/mermaid/src/dagre-wrapper/mermaid-graphlib.js @@ -45,7 +45,12 @@ const edgeInCluster = (edge, clusterId) => { log.debug('Tilt, ', clusterId, ',not in decendants'); return false; } -return decendants[clusterId].indexOf(edge.v) >= 0 || isDecendant(edge.v, clusterId) || isDecendant(edge.w, clusterId) || decendants[clusterId].indexOf(edge.w) >= 0; + return ( + decendants[clusterId].indexOf(edge.v) >= 0 || + isDecendant(edge.v, clusterId) || + isDecendant(edge.w, clusterId) || + decendants[clusterId].indexOf(edge.w) >= 0 + ); }; const copy = (clusterId, graph, newGraph, rootId) => { From e6f19ff46149695bb4720319abb158103e696454 Mon Sep 17 00:00:00 2001 From: Alois Klink Date: Thu, 20 Oct 2022 20:23:28 +0100 Subject: [PATCH 36/42] style: lint typescript with eslint-plugin-tsdoc --- .eslintrc.json | 34 +++++++++++++++++++++++----------- package.json | 1 + pnpm-lock.yaml | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 11 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 133ab42cd..d83222f3a 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -16,7 +16,6 @@ "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended", - "plugin:jsdoc/recommended", "plugin:json/recommended", "plugin:markdown/recommended", "plugin:@cspell/recommended", @@ -28,16 +27,6 @@ "no-console": "error", "no-prototype-builtins": "off", "no-unused-vars": "off", - "jsdoc/check-indentation": "off", - "jsdoc/check-alignment": "off", - "jsdoc/check-line-alignment": "off", - "jsdoc/multiline-blocks": "off", - "jsdoc/newline-after-description": "off", - "jsdoc/tag-lines": "off", - "jsdoc/require-param-description": "off", - "jsdoc/require-param-type": "off", - "jsdoc/require-returns": "off", - "jsdoc/require-returns-description": "off", "cypress/no-async-tests": "off", "@typescript-eslint/ban-ts-comment": [ "error", @@ -73,6 +62,29 @@ "no-console": "off" } }, + { + "files": ["*.{js,jsx,mjs,cjs}"], + "extends": ["plugin:jsdoc/recommended"], + "rules": { + "jsdoc/check-indentation": "off", + "jsdoc/check-alignment": "off", + "jsdoc/check-line-alignment": "off", + "jsdoc/multiline-blocks": "off", + "jsdoc/newline-after-description": "off", + "jsdoc/tag-lines": "off", + "jsdoc/require-param-description": "off", + "jsdoc/require-param-type": "off", + "jsdoc/require-returns": "off", + "jsdoc/require-returns-description": "off" + } + }, + { + "files": ["*.{ts,tsx}"], + "plugins": ["tsdoc"], + "rules": { + "tsdoc/syntax": "error" + } + }, { "files": ["*.spec.{ts,js}", "cypress/**", "demos/**", "**/docs/**"], "rules": { diff --git a/package.json b/package.json index 609799855..ad80859b1 100644 --- a/package.json +++ b/package.json @@ -120,6 +120,7 @@ "eslint-plugin-json": "3.1.0", "eslint-plugin-markdown": "3.0.0", "eslint-plugin-no-only-tests": "^3.0.0", + "eslint-plugin-tsdoc": "^0.2.17", "express": "4.18.2", "globby": "13.1.2", "husky": "8.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ed0da3b69..db4590ed3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -46,6 +46,7 @@ importers: eslint-plugin-json: 3.1.0 eslint-plugin-markdown: 3.0.0 eslint-plugin-no-only-tests: ^3.0.0 + eslint-plugin-tsdoc: ^0.2.17 express: 4.18.2 fast-clone: 1.5.13 globby: 13.1.2 @@ -129,6 +130,7 @@ importers: eslint-plugin-json: 3.1.0 eslint-plugin-markdown: 3.0.0_eslint@8.25.0 eslint-plugin-no-only-tests: 3.0.0 + eslint-plugin-tsdoc: 0.2.17 express: 4.18.2 globby: 13.1.2 husky: 8.0.1 @@ -2261,6 +2263,19 @@ packages: '@jridgewell/sourcemap-codec': 1.4.14 dev: true + /@microsoft/tsdoc-config/0.16.2: + resolution: {integrity: sha512-OGiIzzoBLgWWR0UdRJX98oYO+XKGf7tiK4Zk6tQ/E4IJqGCe7dvkTvgDZV5cFJUzLGDOjeAXrnZoA6QkVySuxw==} + dependencies: + '@microsoft/tsdoc': 0.14.2 + ajv: 6.12.6 + jju: 1.4.0 + resolve: 1.19.0 + dev: true + + /@microsoft/tsdoc/0.14.2: + resolution: {integrity: sha512-9b8mPpKrfeGRuhFH5iO1iwCLeIIsV6+H1sRfxbkoGXIyQE2BTsPd9zqSqQJ+pv5sJ/hT5M1zvOFL02MnEezFug==} + dev: true + /@nodelib/fs.scandir/2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -6080,6 +6095,13 @@ packages: engines: {node: '>=5.0.0'} dev: true + /eslint-plugin-tsdoc/0.2.17: + resolution: {integrity: sha512-xRmVi7Zx44lOBuYqG8vzTXuL6IdGOeF9nHX17bjJ8+VE6fsxpdGem0/SBTmAwgYMKYB1WBkqRJVQ+n8GK041pA==} + dependencies: + '@microsoft/tsdoc': 0.14.2 + '@microsoft/tsdoc-config': 0.16.2 + dev: true + /eslint-scope/5.1.1: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} engines: {node: '>=8.0.0'} @@ -8807,6 +8829,10 @@ packages: nomnom: 1.5.2 dev: true + /jju/1.4.0: + resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==} + dev: true + /joi/17.6.0: resolution: {integrity: sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw==} dependencies: @@ -11321,6 +11347,13 @@ packages: resolution: {integrity: sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg==} dev: true + /resolve/1.19.0: + resolution: {integrity: sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==} + dependencies: + is-core-module: 2.10.0 + path-parse: 1.0.7 + dev: true + /resolve/1.22.1: resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} hasBin: true From 7e5689d0b9521ea4500be9284a16c3563039e5ba Mon Sep 17 00:00:00 2001 From: Alois Klink Date: Sat, 22 Oct 2022 13:30:50 +0100 Subject: [PATCH 37/42] style: fix eslint-plugin-tsdoc linting issues Mostly, fixing these eslint-plugin-tsdoc style issues involved: - Moving types from JSDoc to TypeScript types - Making sure that all `@param paramName - description` had both a `-` and a description. Occasionally, for some functions, if the JSDoc was completely empty, I just deleted it, since there was no point in keeping it. --- .../mermaid-example-diagram/src/detector.ts | 2 +- .../src/mermaidUtils.ts | 19 +- packages/mermaid/src/__mocks__/mermaidAPI.ts | 5 +- packages/mermaid/src/config.ts | 17 +- packages/mermaid/src/defaultConfig.ts | 34 ++- .../mermaid/src/diagram-api/detectType.ts | 19 +- .../mermaid/src/diagrams/common/common.ts | 45 ++-- .../src/diagrams/error/errorRenderer.ts | 10 +- .../src/diagrams/sequence/sequenceRenderer.ts | 98 ++++--- .../diagrams/user-journey/journeyRenderer.ts | 6 +- packages/mermaid/src/logger.ts | 8 +- packages/mermaid/src/mermaid.ts | 17 +- packages/mermaid/src/mermaidAPI.ts | 19 +- .../themes/erDiagram-oldHardcodedValues.ts | 2 +- packages/mermaid/src/utils.ts | 252 ++++++++++-------- 15 files changed, 303 insertions(+), 250 deletions(-) diff --git a/packages/mermaid-example-diagram/src/detector.ts b/packages/mermaid-example-diagram/src/detector.ts index 29f6d2a6d..d30b99fba 100644 --- a/packages/mermaid-example-diagram/src/detector.ts +++ b/packages/mermaid-example-diagram/src/detector.ts @@ -4,7 +4,7 @@ export const id = 'example-diagram'; /** * Detector function that will be called by mermaid to determine if the diagram is this type of diagram. * - * @param txt The diagram text will be passed to the detector + * @param txt - The diagram text will be passed to the detector * @returns True if the diagram text matches a diagram of this type */ diff --git a/packages/mermaid-example-diagram/src/mermaidUtils.ts b/packages/mermaid-example-diagram/src/mermaidUtils.ts index 03de59ef9..8894abdff 100644 --- a/packages/mermaid-example-diagram/src/mermaidUtils.ts +++ b/packages/mermaid-example-diagram/src/mermaidUtils.ts @@ -35,18 +35,19 @@ export let setupGraphViewbox: ( /** * Function called by mermaid that injects utility functions that help the diagram to be a good citizen. - * @param _log - * @param _setLogLevel - * @param _getConfig - * @param _sanitizeText - * @param _setupGraphViewbox + * + * @param _log - log from mermaid/src/diagramAPI.ts + * @param _setLogLevel - setLogLevel from mermaid/src/diagramAPI.ts + * @param _getConfig - getConfig from mermaid/src/diagramAPI.ts + * @param _sanitizeText - sanitizeText from mermaid/src/diagramAPI.ts + * @param _setupGraphViewbox - setupGraphViewbox from mermaid/src/diagramAPI.ts */ export const injectUtils = ( _log: Record, - _setLogLevel: any, - _getConfig: any, - _sanitizeText: any, - _setupGraphViewbox: any + _setLogLevel: typeof setLogLevel, + _getConfig: typeof getConfig, + _sanitizeText: typeof sanitizeText, + _setupGraphViewbox: typeof setupGraphViewbox ) => { _log.debug('Mermaid utils injected into example-diagram'); log.trace = _log.trace; diff --git a/packages/mermaid/src/__mocks__/mermaidAPI.ts b/packages/mermaid/src/__mocks__/mermaidAPI.ts index 3102095b9..50018bcad 100644 --- a/packages/mermaid/src/__mocks__/mermaidAPI.ts +++ b/packages/mermaid/src/__mocks__/mermaidAPI.ts @@ -11,10 +11,7 @@ import Diagram, { type ParseErrorFunction } from '../Diagram'; // Normally, we could just do the following to get the original `parse()` // implementation, however, requireActual returns a promise and it's not documented how to use withing mock file. -/** - * @param text - * @param parseError - */ +/** {@inheritDoc mermaidAPI.parse} */ function parse(text: string, parseError?: ParseErrorFunction): boolean { addDiagrams(); const diagram = new Diagram(text, parseError); diff --git a/packages/mermaid/src/config.ts b/packages/mermaid/src/config.ts index 8dfeeafca..884a9931b 100644 --- a/packages/mermaid/src/config.ts +++ b/packages/mermaid/src/config.ts @@ -56,7 +56,7 @@ export const updateCurrentConfig = (siteCfg: MermaidConfig, _directives: any[]) * function _Default value: At default, will mirror Global Config_ * * @param conf - The base currentConfig to use as siteConfig - * @returns {object} - The siteConfig + * @returns The new siteConfig */ export const setSiteConfig = (conf: MermaidConfig): MermaidConfig => { siteConfig = assignWithDepth({}, defaultConfig); @@ -91,7 +91,7 @@ export const updateSiteConfig = (conf: MermaidConfig): MermaidConfig => { * * **Notes**: Returns **any** values in siteConfig. * - * @returns {object} - The siteConfig + * @returns The siteConfig */ export const getSiteConfig = (): MermaidConfig => { return assignWithDepth({}, siteConfig); @@ -107,8 +107,8 @@ export const getSiteConfig = (): MermaidConfig => { * keys. Any values found in conf with key found in siteConfig.secure will be replaced with the * corresponding siteConfig value. * - * @param {any} conf - The potential currentConfig - * @returns {any} - The currentConfig merged with the sanitized conf + * @param conf - The potential currentConfig + * @returns The currentConfig merged with the sanitized conf */ export const setConfig = (conf: MermaidConfig): MermaidConfig => { // sanitize(conf); @@ -131,7 +131,7 @@ export const setConfig = (conf: MermaidConfig): MermaidConfig => { * * **Notes**: Returns **any** the currentConfig * - * @returns {any} - The currentConfig + * @returns The currentConfig */ export const getConfig = (): MermaidConfig => { return assignWithDepth({}, currentConfig); @@ -146,7 +146,7 @@ export const getConfig = (): MermaidConfig => { * Ensures options parameter does not attempt to override siteConfig secure keys **Notes**: modifies * options in-place * - * @param {any} options - The potential setConfig parameter + * @param options - The potential setConfig parameter */ export const sanitize = (options: any) => { // Checking that options are not in the list of excluded options @@ -186,7 +186,7 @@ export const sanitize = (options: any) => { /** * Pushes in a directive to the configuration * - * @param {object} directive The directive to push in + * @param directive - The directive to push in */ export const addDirective = (directive: any) => { if (directive.fontFamily) { @@ -217,7 +217,8 @@ export const addDirective = (directive: any) => { * * **Notes**: (default: current siteConfig ) (optional, default `getSiteConfig()`) * - * @param config + * @param config - base set of values, which currentConfig could be **reset** to. + * Defaults to the current siteConfig (e.g returned by {@link getSiteConfig}). */ export const reset = (config = siteConfig): void => { // Replace current config with siteConfig diff --git a/packages/mermaid/src/defaultConfig.ts b/packages/mermaid/src/defaultConfig.ts index 3a9bd1841..570dc2da3 100644 --- a/packages/mermaid/src/defaultConfig.ts +++ b/packages/mermaid/src/defaultConfig.ts @@ -8,19 +8,27 @@ import { MermaidConfig } from './config.type'; * * These are the default options which can be overridden with the initialization call like so: * - * **Example 1:**
 mermaid.initialize({ flowchart:{ htmlLabels: false } }); 
+ * **Example 1:** * - * **Example 2:**
  
+ * ```html + * + * ``` * * A summary of all options and their defaults is found [here](#mermaidapi-configuration-defaults). * A description of each option follows below. - * - * @name Configuration */ const config: Partial = { /** @@ -30,8 +38,16 @@ const config: Partial = { * | --------- | --------------- | ------ | -------- | ---------------------------------------------- | * | theme | Built in Themes | string | Optional | 'default', 'forest', 'dark', 'neutral', 'null' | * - * **Notes:** To disable any pre-defined mermaid theme, use "null".
 "theme": "forest",
-   * "themeCSS": ".node rect { fill: red; }" 
+ * **Notes:** To disable any pre-defined mermaid theme, use "null". + * + * @example + * + * ```js + * { + * "theme": "forest", + * "themeCSS": ".node rect { fill: red; }" + * } + * ``` */ theme: 'default', themeVariables: theme['default'].getThemeVariables(), diff --git a/packages/mermaid/src/diagram-api/detectType.ts b/packages/mermaid/src/diagram-api/detectType.ts index 9536fded2..1c1abc51c 100644 --- a/packages/mermaid/src/diagram-api/detectType.ts +++ b/packages/mermaid/src/diagram-api/detectType.ts @@ -9,10 +9,13 @@ const anyComment = /\s*%%.*\n/gm; const detectors: Record = {}; /** - * @function detectType Detects the type of the graph text. Takes into consideration the possible - * existence of an %%init directive + * Detects the type of the graph text. * - * ```mermaid + * Takes into consideration the possible existence of an `%%init` directive + * + * @param text - The text defining the graph. For example: + * + * ```mermaid * %%{initialize: {"startOnLoad": true, logLevel: "fatal" }}%% * graph LR * a-->b @@ -23,13 +26,9 @@ const detectors: Record = {}; * f-->g * g-->h * ``` - * @param {string} text The text defining the graph - * @param {{ - * class: { defaultRenderer: string } | undefined; - * state: { defaultRenderer: string } | undefined; - * flowchart: { defaultRenderer: string } | undefined; - * }} [config] - * @returns {string} A graph definition key + * + * @param config - The mermaid config. + * @returns A graph definition key */ export const detectType = function (text: string, config?: MermaidConfig): string { text = text.replace(directive, '').replace(anyComment, '\n'); diff --git a/packages/mermaid/src/diagrams/common/common.ts b/packages/mermaid/src/diagrams/common/common.ts index e7fb395de..782915cc1 100644 --- a/packages/mermaid/src/diagrams/common/common.ts +++ b/packages/mermaid/src/diagrams/common/common.ts @@ -4,8 +4,8 @@ import { MermaidConfig } from '../../config.type'; /** * Gets the rows of lines in a string * - * @param {string | undefined} s The string to check the lines for - * @returns {string[]} The rows in that string + * @param s - The string to check the lines for + * @returns The rows in that string */ export const getRows = (s?: string): string[] => { if (!s) { @@ -18,8 +18,8 @@ export const getRows = (s?: string): string[] => { /** * Removes script tags from a text * - * @param {string} txt The text to sanitize - * @returns {string} The safer text + * @param txt - The text to sanitize + * @returns The safer text */ export const removeScript = (txt: string): string => { return DOMPurify.sanitize(txt); @@ -68,8 +68,8 @@ export const lineBreakRegex = //gi; /** * Whether or not a text has any line breaks * - * @param {string} text The text to test - * @returns {boolean} Whether or not the text has breaks + * @param text - The text to test + * @returns Whether or not the text has breaks */ export const hasBreaks = (text: string): boolean => { return lineBreakRegex.test(text); @@ -78,8 +78,8 @@ export const hasBreaks = (text: string): boolean => { /** * Splits on
tags * - * @param {string} text Text to split - * @returns {string[]} List of lines as strings + * @param text - Text to split + * @returns List of lines as strings */ export const splitBreaks = (text: string): string[] => { return text.split(lineBreakRegex); @@ -88,8 +88,8 @@ export const splitBreaks = (text: string): string[] => { /** * Converts placeholders to line breaks in HTML * - * @param {string} s HTML with placeholders - * @returns {string} HTML with breaks instead of placeholders + * @param s - HTML with placeholders + * @returns HTML with breaks instead of placeholders */ const placeholderToBreak = (s: string): string => { return s.replace(/#br#/g, '
'); @@ -98,8 +98,8 @@ const placeholderToBreak = (s: string): string => { /** * Opposite of `placeholderToBreak`, converts breaks to placeholders * - * @param {string} s HTML string - * @returns {string} String with placeholders + * @param s - HTML string + * @returns String with placeholders */ const breakToPlaceholder = (s: string): string => { return s.replace(lineBreakRegex, '#br#'); @@ -108,8 +108,8 @@ const breakToPlaceholder = (s: string): string => { /** * Gets the current URL * - * @param {boolean} useAbsolute Whether to return the absolute URL or not - * @returns {string} The current URL + * @param useAbsolute - Whether to return the absolute URL or not + * @returns The current URL */ const getUrl = (useAbsolute: boolean): string => { let url = ''; @@ -130,8 +130,8 @@ const getUrl = (useAbsolute: boolean): string => { /** * Converts a string/boolean into a boolean * - * @param {string | boolean} val String or boolean to convert - * @returns {boolean} The result from the input + * @param val - String or boolean to convert + * @returns The result from the input */ export const evaluate = (val?: string | boolean): boolean => val === false || ['false', 'null', '0'].includes(String(val).trim().toLowerCase()) ? false : true; @@ -139,12 +139,15 @@ export const evaluate = (val?: string | boolean): boolean => /** * Makes generics in typescript syntax * - * @example Array of array of strings in typescript syntax - * // returns "Array>" - * parseGenericTypes('Array~Array~string~~'); + * @example + * Array of array of strings in typescript syntax * - * @param {string} text The text to convert - * @returns {string} The converted string + * ```js + * // returns "Array>" + * parseGenericTypes('Array~Array~string~~'); + * ``` + * @param text - The text to convert + * @returns The converted string */ export const parseGenericTypes = function (text: string): string { let cleanedText = text; diff --git a/packages/mermaid/src/diagrams/error/errorRenderer.ts b/packages/mermaid/src/diagrams/error/errorRenderer.ts index df9ce2c6e..b4e267684 100644 --- a/packages/mermaid/src/diagrams/error/errorRenderer.ts +++ b/packages/mermaid/src/diagrams/error/errorRenderer.ts @@ -8,7 +8,7 @@ let conf = {}; /** * Merges the value of `conf` with the passed `cnf` * - * @param {object} cnf Config to merge + * @param cnf - Config to merge */ export const setConf = function (cnf: any) { conf = { ...conf, ...cnf }; @@ -17,11 +17,11 @@ export const setConf = function (cnf: any) { /** * Draws a an info picture in the tag with id: id based on the graph definition in text. * - * @param text - * @param {string} id The text for the error - * @param {string} mermaidVersion The version + * @param _text - Mermaid graph definition. + * @param id - The text for the error + * @param mermaidVersion - The version */ -export const draw = (text: string, id: string, mermaidVersion: string) => { +export const draw = (_text: string, id: string, mermaidVersion: string) => { try { log.debug('Renering svg for syntax error\n'); diff --git a/packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts b/packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts index 22fa5da8c..fa943d658 100644 --- a/packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts +++ b/packages/mermaid/src/diagrams/sequence/sequenceRenderer.ts @@ -10,6 +10,7 @@ import assignWithDepth from '../../assignWithDepth'; import utils from '../../utils'; import { configureSvgSize } from '../../setupGraphViewbox'; import addSVGAccessibilityFields from '../../accessibility'; +import Diagram from '../../Diagram'; let conf = {}; @@ -100,8 +101,8 @@ export const bounds = { // eslint-disable-next-line @typescript-eslint/no-this-alias const _self = this; let cnt = 0; - /** @param {any} type */ - function updateFn(type) { + /** @param type - Either `activation` or `undefined` */ + function updateFn(type?: 'activation') { return function updateItemBounds(item) { cnt++; // The loop sequenceItems is a stack so the biggest margins in the beginning of the sequenceItems @@ -200,15 +201,25 @@ export const bounds = { }, }; +/** Options for drawing a note in {@link drawNote} */ +interface NoteModel { + /** x axis start position */ + startx: number; + /** y axis position */ + starty: number; + /** the message to be shown */ + message: string; + /** Set this with a custom width to override the default configured width. */ + width: number; +} + /** * Draws an note in the diagram with the attached line * - * @param {any} elem - The diagram to draw to. - * @param {{ x: number; y: number; message: string; width: number }} noteModel - startX: x axis - * start position, verticalPos: y axis position, message: the message to be shown, width: Set - * this with a custom width to override the default configured width. + * @param elem - The diagram to draw to. + * @param noteModel - Note model options. */ -const drawNote = function (elem, noteModel) { +const drawNote = function (elem: any, noteModel: NoteModel) { bounds.bumpVerticalPos(conf.boxMargin); noteModel.height = conf.boxMargin; noteModel.starty = bounds.getVerticalPos(); @@ -278,11 +289,11 @@ const actorFont = (cnf) => { * message so it can be drawn later. We do not draw the message at this point so the arrowhead can * be on top of the activation box. * - * @param {any} diagram - The parent of the message element - * @param {any} msgModel - The model containing fields describing a message - * @returns {number} lineStartY - The Y coordinate at which the message line starts + * @param _diagram - The parent of the message element. + * @param msgModel - The model containing fields describing a message + * @returns `lineStartY` - The Y coordinate at which the message line starts */ -const boundMessage = function (diagram, msgModel) { +function boundMessage(_diagram, msgModel): number { bounds.bumpVerticalPos(10); const { startx, stopx, message } = msgModel; const lines = common.splitBreaks(message).length; @@ -321,17 +332,17 @@ const boundMessage = function (diagram, msgModel) { bounds.insert(msgModel.fromBounds, msgModel.starty, msgModel.toBounds, msgModel.stopy); return lineStartY; -}; +} /** * Draws a message. Note that the bounds have previously been updated by boundMessage. * - * @param {any} diagram - The parent of the message element - * @param {any} msgModel - The model containing fields describing a message - * @param {number} lineStartY - The Y coordinate at which the message line starts - * @param diagObj + * @param diagram - The parent of the message element + * @param msgModel - The model containing fields describing a message + * @param lineStartY - The Y coordinate at which the message line starts + * @param diagObj - The diagram object. */ -const drawMessage = function (diagram, msgModel, lineStartY, diagObj) { +const drawMessage = function (diagram, msgModel, lineStartY: number, diagObj: Diagram) { const { startx, stopx, starty, message, type, sequenceIndex, sequenceVisible } = msgModel; const textDims = utils.calculateTextDimensions(message, messageFont(conf)); const textObj = svgDraw.getTextObj(); @@ -554,13 +565,6 @@ const activationBounds = function (actor, actors) { return [left, right]; }; -/** - * @param {any} loopWidths - * @param {any} msg - * @param {any} preMargin - * @param {any} postMargin - * @param {any} addLoopFn - */ function adjustLoopHeightForWrap(loopWidths, msg, preMargin, postMargin, addLoopFn) { bounds.bumpVerticalPos(preMargin); let heightAdjust = postMargin; @@ -584,12 +588,12 @@ function adjustLoopHeightForWrap(loopWidths, msg, preMargin, postMargin, addLoop /** * Draws a sequenceDiagram in the tag with id: id based on the graph definition in text. * - * @param {any} _text The text of the diagram - * @param {any} id The id of the diagram which will be used as a DOM element id¨ - * @param {any} _version Mermaid version from package.json - * @param {any} diagObj A standard diagram containing the db and the text and type etc of the diagram + * @param _text - The text of the diagram + * @param id - The id of the diagram which will be used as a DOM element id¨ + * @param _version - Mermaid version from package.json + * @param diagObj - A standard diagram containing the db and the text and type etc of the diagram */ -export const draw = function (_text, id, _version, diagObj) { +export const draw = function (_text: string, id: string, _version: string, diagObj: Diagram) { const { securityLevel, sequence } = configApi.getConfig(); conf = sequence; // Handle root and Document for when rendering in sandbox mode @@ -632,10 +636,10 @@ export const draw = function (_text, id, _version, diagObj) { svgDraw.insertSequenceNumber(diagram); /** - * @param {any} msg - * @param {any} verticalPos + * @param msg - The message to draw. + * @param verticalPos - The vertical position of the message. */ - function activeEnd(msg, verticalPos) { + function activeEnd(msg: any, verticalPos: number) { const activationData = bounds.endActivation(msg); if (activationData.starty + 18 > verticalPos) { activationData.starty = verticalPos - 6; @@ -910,12 +914,16 @@ export const draw = function (_text, id, _version, diagObj) { * It will enumerate each given message, and will determine its text width, in relation to the actor * it originates from, and destined to. * - * @param {any} actors - The actors map - * @param {Array} messages - A list of message objects to iterate - * @param diagObj - * @returns {any} + * @param actors - The actors map + * @param messages - A list of message objects to iterate + * @param diagObj - The diagram object. + * @returns The max message width of each actor. */ -const getMaxMessageWidthPerActor = function (actors, messages, diagObj) { +function getMaxMessageWidthPerActor( + actors: { [id: string]: any }, + messages: any[], + diagObj: Diagram +): { [id: string]: number } { const maxMessageWidthPerActor = {}; messages.forEach(function (msg) { @@ -1008,7 +1016,7 @@ const getMaxMessageWidthPerActor = function (actors, messages, diagObj) { log.debug('maxMessageWidthPerActor:', maxMessageWidthPerActor); return maxMessageWidthPerActor; -}; +} const getRequiredPopupWidth = function (actor) { let requiredPopupWidth = 0; @@ -1025,15 +1033,19 @@ const getRequiredPopupWidth = function (actor) { }; /** - * This will calculate the optimal margin for each given actor, for a given actor->messageWidth map. + * This will calculate the optimal margin for each given actor, + * for a given actor → messageWidth map. * * An actor's margin is determined by the width of the actor, the width of the largest message that * originates from it, and the configured conf.actorMargin. * - * @param {any} actors - The actors map to calculate margins for - * @param {any} actorToMessageWidth - A map of actor key -> max message width it holds + * @param actors - The actors map to calculate margins for + * @param actorToMessageWidth - A map of actor key → max message width it holds */ -const calculateActorMargins = function (actors, actorToMessageWidth) { +function calculateActorMargins( + actors: { [id: string]: any }, + actorToMessageWidth: ReturnType +) { let maxHeight = 0; Object.keys(actors).forEach((prop) => { const actor = actors[prop]; @@ -1074,7 +1086,7 @@ const calculateActorMargins = function (actors, actorToMessageWidth) { } return Math.max(maxHeight, conf.height); -}; +} const buildNoteModel = function (msg, actors, diagObj) { const startx = actors[msg.from].x; diff --git a/packages/mermaid/src/diagrams/user-journey/journeyRenderer.ts b/packages/mermaid/src/diagrams/user-journey/journeyRenderer.ts index 208391ab3..3880a243a 100644 --- a/packages/mermaid/src/diagrams/user-journey/journeyRenderer.ts +++ b/packages/mermaid/src/diagrams/user-journey/journeyRenderer.ts @@ -15,7 +15,7 @@ export const setConf = function (cnf) { const actors = {}; -/** @param {any} diagram */ +/** @param diagram - The diagram to draw to. */ function drawActorLegend(diagram) { const conf = getConfig().journey; // Draw the actors @@ -157,8 +157,8 @@ export const bounds = { // eslint-disable-next-line @typescript-eslint/no-this-alias const _self = this; let cnt = 0; - /** @param {any} type */ - function updateFn(type) { + /** @param type - Set to `activation` if activation */ + function updateFn(type?: 'activation') { return function updateItemBounds(item) { cnt++; // The loop sequenceItems is a stack so the biggest margins in the beginning of the sequenceItems diff --git a/packages/mermaid/src/logger.ts b/packages/mermaid/src/logger.ts index b01934e88..e38bf93fe 100644 --- a/packages/mermaid/src/logger.ts +++ b/packages/mermaid/src/logger.ts @@ -27,7 +27,7 @@ export const log: Record = { /** * Sets a log level * - * @param {LogLevel} [level="fatal"] The level to set the logging to. Default is `"fatal"` + * @param level - The level to set the logging to. Default is `"fatal"` */ export const setLogLevel = function (level: keyof typeof LEVELS | number | string = 'fatal') { let numericLevel: number = LEVELS.fatal; @@ -80,10 +80,10 @@ export const setLogLevel = function (level: keyof typeof LEVELS | number | strin /** * Returns a format with the timestamp and the log level * - * @param {LogLevel} level The level for the log format - * @returns {string} The format with the timestamp and log level + * @param level - The level for the log format + * @returns The format with the timestamp and log level */ -const format = (level: string): string => { +const format = (level: Uppercase): string => { const time = moment().format('ss.SSS'); return `%c${time} : ${level} : `; }; diff --git a/packages/mermaid/src/mermaid.ts b/packages/mermaid/src/mermaid.ts index 399691083..c8edb3a06 100644 --- a/packages/mermaid/src/mermaid.ts +++ b/packages/mermaid/src/mermaid.ts @@ -19,12 +19,6 @@ import type { ParseErrorFunction } from './Diagram'; * elements with the attribute already set. This way the init function can be triggered several * times. * - * Optionally, `init` can accept in the second argument one of the following: - * - * - A DOM Node - * - An array of DOM nodes (as would come from a jQuery selector) - * - A W3C selector, a la `.mermaid` - * * ```mermaid * graph LR; * a(Find elements)-->b{Processed} @@ -34,9 +28,12 @@ import type { ParseErrorFunction } from './Diagram'; * * Renders the mermaid diagrams * - * @param config - * @param nodes - * @param callback + * @param config - **Deprecated**, please set configuration in {@link initialize}. + * @param nodes - **Default**: `.mermaid`. One of the following: + * - A DOM Node + * - An array of DOM nodes (as would come from a jQuery selector) + * - A W3C selector, a la `.mermaid` + * @param callback - Called once for each rendered diagram's id. */ const init = async function ( config?: MermaidConfig, @@ -202,7 +199,7 @@ if (typeof document !== 'undefined') { * This is provided for environments where the mermaid object can't directly have a new member added * to it (eg. dart interop wrapper). (Initially there is no parseError member of mermaid). * - * @param {function (err, hash)} newParseErrorHandler New parseError() callback. + * @param newParseErrorHandler - New parseError() callback. */ const setParseErrorHandler = function (newParseErrorHandler: (err: any, hash: any) => void) { mermaid.parseError = newParseErrorHandler; diff --git a/packages/mermaid/src/mermaidAPI.ts b/packages/mermaid/src/mermaidAPI.ts index d2c48361a..3a53bd584 100644 --- a/packages/mermaid/src/mermaidAPI.ts +++ b/packages/mermaid/src/mermaidAPI.ts @@ -9,8 +9,6 @@ * page or do something completely different. * * In addition to the render function, a number of behavioral configuration options are available. - * - * @name mermaidAPI */ import { select } from 'd3'; import { compile, serialize, stringify } from 'stylis'; @@ -34,8 +32,8 @@ import { MermaidConfig } from './config.type'; import { evaluate } from './diagrams/common/common'; /** - * @param text - * @param parseError + * @param text - The mermaid diagram definition. + * @param parseError - If set, handles errors. */ function parse(text: string, parseError?: ParseErrorFunction): boolean { addDiagrams(); @@ -100,14 +98,13 @@ export const decodeEntities = function (text: string): string { * }); * ``` * - * @param {string} id The id of the element to be rendered - * @param {string} text The graph definition - * @param {(svgCode: string, bindFunctions?: (element: Element) => void) => void} cb Callback which - * is called after rendering is finished with the svg code as param. - * @param {Element} container Selector to element in which a div with the graph temporarily will be + * @param id - The id of the element to be rendered + * @param text - The graph definition + * @param cb - Callback which is called after rendering is finished with the svg code as param. + * @param container - Selector to element in which a div with the graph temporarily will be * inserted. If one is provided a hidden div will be inserted in the body of the page instead. The * element will be removed when rendering is completed. - * @returns {void} + * @returns - Resolves when finished rendering. */ const render = async function ( id: string, @@ -455,7 +452,7 @@ const handleDirective = function (p: any, directive: any, type: string): void { } }; -/** @param {MermaidConfig} options */ +/** @param options - Initial Mermaid options */ async function initialize(options: MermaidConfig) { // Handle legacy location of font-family configuration if (options?.fontFamily) { diff --git a/packages/mermaid/src/themes/erDiagram-oldHardcodedValues.ts b/packages/mermaid/src/themes/erDiagram-oldHardcodedValues.ts index 8f88a70cd..95ce40e79 100644 --- a/packages/mermaid/src/themes/erDiagram-oldHardcodedValues.ts +++ b/packages/mermaid/src/themes/erDiagram-oldHardcodedValues.ts @@ -1,5 +1,5 @@ /** - * @file Values that have been hardcoded in src/diagrams/er/styles.js. These can be used by + * Values that have been hardcoded in src/diagrams/er/styles.js. These can be used by * theme-_._ files to maintain display styles until themes, styles, renderers are revised. -- * 2022-09-22 */ diff --git a/packages/mermaid/src/utils.ts b/packages/mermaid/src/utils.ts index ba46011dd..a38044bd6 100644 --- a/packages/mermaid/src/utils.ts +++ b/packages/mermaid/src/utils.ts @@ -4,6 +4,7 @@ import { curveBasis, curveBasisClosed, curveBasisOpen, + CurveFactory, curveLinear, curveLinearClosed, curveMonotoneX, @@ -42,13 +43,13 @@ const directiveWithoutOpen = /\s*(?:(?:(\w+)(?=:):|(\w+))\s*(?:(?:(\w+))|((?:(?![}][%]{2}).|\r?\n)*))?\s*)(?:[}][%]{2})?/gi; /** - * @function detectInit Detects the init config object from the text - * @param config + * Detects the init config object from the text * - * ```mermaid + * @param text - The text defining the graph. For example: * - * %%{init: {"theme": "debug", "logLevel": 1 }}%% - * graph LR + * ```mermaid + * %%{init: {"theme": "debug", "logLevel": 1 }}%% + * graph LR * a-->b * b-->c * c-->d @@ -58,11 +59,11 @@ const directiveWithoutOpen = * g-->h * ``` * - * Or + * Or * - * ```mermaid - * %%{initialize: {"theme": "dark", logLevel: "debug" }}%% - * graph LR + * ```mermaid + * %%{initialize: {"theme": "dark", logLevel: "debug" }}%% + * graph LR * a-->b * b-->c * c-->d @@ -71,8 +72,9 @@ const directiveWithoutOpen = * f-->g * g-->h * ``` - * @param {string} text The text defining the graph - * @returns {object} The json object representing the init passed to mermaid.initialize() + * + * @param config - Optional mermaid configuration object. + * @returns The json object representing the init passed to mermaid.initialize() */ export const detectInit = function (text: string, config?: MermaidConfig): MermaidConfig { const inits = detectDirective(text, /(?:init\b)|(?:initialize\b)/); @@ -104,12 +106,14 @@ export const detectInit = function (text: string, config?: MermaidConfig): Merma }; /** - * @function detectDirective Detects the directive from the text. Text can be single line or - * multiline. If type is null or omitted the first directive encountered in text will be returned + * Detects the directive from the text. * - * ```mermaid - * graph LR - * %%{someDirective}%% + * Text can be single line or multiline. If type is null or omitted, + * the first directive encountered in text will be returned + * + * ```mermaid + * graph LR + * %%{someDirective}%% * a-->b * b-->c * c-->d @@ -118,13 +122,16 @@ export const detectInit = function (text: string, config?: MermaidConfig): Merma * f-->g * g-->h * ``` - * @param {string} text The text defining the graph - * @param {string | RegExp} type The directive to return (default: null) - * @returns {object | Array} An object or Array representing the directive(s): { type: string, args: - * object|null } matched by the input type if a single directive was found, that directive object - * will be returned. + * + * @param text - The text defining the graph + * @param type - The directive to return (default: `null`) + * @returns An object or Array representing the directive(s) matched by the input type. + * If a single directive was found, that directive object will be returned. */ -export const detectDirective = function (text, type = null) { +export const detectDirective = function ( + text: string, + type: string | RegExp = null +): { type?: string; args?: any } | { type?: string; args?: any }[] { try { const commentWithoutDirectives = new RegExp( `[%]{2}(?![{]${directiveWithoutOpen.source})(?=[}][%]{2}).*\n`, @@ -166,12 +173,13 @@ export const detectDirective = function (text, type = null) { }; /** - * @function isSubstringInArray Detects whether a substring in present in a given array - * @param {string} str The substring to detect - * @param {Array} arr The array to search - * @returns {number} The array index containing the substring or -1 if not present + * Detects whether a substring in present in a given array + * + * @param str - The substring to detect + * @param arr - The array to search + * @returns The array index containing the substring or -1 if not present */ -export const isSubstringInArray = function (str, arr) { +export const isSubstringInArray = function (str: string, arr: string[]): number { for (let i = 0; i < arr.length; i++) { if (arr[i].match(str)) { return i; @@ -183,26 +191,26 @@ export const isSubstringInArray = function (str, arr) { /** * Returns a d3 curve given a curve name * - * @param {string | undefined} interpolate The interpolation name - * @param {any} defaultCurve The default curve to return - * @returns {import('d3-shape').CurveFactory} The curve factory to use + * @param interpolate - The interpolation name + * @param defaultCurve - The default curve to return + * @returns The curve factory to use */ -export const interpolateToCurve = (interpolate, defaultCurve) => { +export function interpolateToCurve(interpolate?: string, defaultCurve: CurveFactory): CurveFactory { if (!interpolate) { return defaultCurve; } const curveName = `curve${interpolate.charAt(0).toUpperCase() + interpolate.slice(1)}`; return d3CurveTypes[curveName] || defaultCurve; -}; +} /** * Formats a URL string * - * @param {string} linkStr String of the URL - * @param {{ securityLevel: string }} config Configuration passed to MermaidJS - * @returns {string | undefined} The formatted URL + * @param linkStr - String of the URL + * @param config - Configuration passed to MermaidJS + * @returns The formatted URL or `undefined`. */ -export const formatUrl = (linkStr, config) => { +export function formatUrl(linkStr: string, config: { securityLevel: string }): string | undefined { const url = linkStr.trim(); if (url) { @@ -212,15 +220,15 @@ export const formatUrl = (linkStr, config) => { return url; } -}; +} /** * Runs a function * - * @param {string} functionName A dot separated path to the function relative to the `window` - * @param {...any} params Parameters to pass to the function + * @param functionName - A dot separated path to the function relative to the `window` + * @param params - Parameters to pass to the function */ -export const runFunc = (functionName, ...params) => { +export const runFunc = (functionName: string, ...params) => { const arrPaths = functionName.split('.'); const len = arrPaths.length - 1; @@ -237,28 +245,31 @@ export const runFunc = (functionName, ...params) => { obj[fnName](...params); }; -/** - * @typedef {object} Point A (x, y) point - * @property {number} x The x value - * @property {number} y The y value - */ +/** A (x, y) point */ +interface Point { + /** The x value */ + x: number; + /** The y value */ + y: number; +} /** * Finds the distance between two points using the Distance Formula * - * @param {Point} p1 The first point - * @param {Point} p2 The second point - * @returns {number} The distance + * @param p1 - The first point + * @param p2 - The second point + * @returns The distance between the two points. */ -const distance = (p1, p2) => - p1 && p2 ? Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)) : 0; +function distance(p1: Point, p2: Point): number { + return p1 && p2 ? Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)) : 0; +} /** - * @param {Point[]} points List of points - * @returns {Point} - * @todo Give this a description + * TODO: Give this a description + * + * @param points - List of points */ -const traverseEdge = (points) => { +function traverseEdge(points: Point[]): Point { let prevPoint; let totalDistance = 0; @@ -297,20 +308,17 @@ const traverseEdge = (points) => { prevPoint = point; }); return center; -}; +} /** - * Alias for `traverseEdge` - * - * @param {Point[]} points List of points - * @returns {Point} Return result of `transverseEdge` + * {@inheritdoc traverseEdge} */ -const calcLabelPosition = (points) => { +function calcLabelPosition(points: Point[]): Point { if (points.length === 1) { return points[0]; } return traverseEdge(points); -}; +} const calcCardinalityPosition = (isRelationTypePresent, points, initialPosition) => { let prevPoint; @@ -366,14 +374,18 @@ const calcCardinalityPosition = (isRelationTypePresent, points, initialPosition) }; /** - * Position ['start_left', 'start_right', 'end_left', 'end_right'] + * Calculates the terminal label position. * - * @param {any} terminalMarkerSize - * @param {any} position - * @param {any} _points - * @returns {any} + * @param terminalMarkerSize - Terminal marker size. + * @param position - Position of label relative to points. + * @param _points - Array of points. + * @returns - The `cardinalityPosition`. */ -const calcTerminalLabelPosition = (terminalMarkerSize, position, _points) => { +function calcTerminalLabelPosition( + terminalMarkerSize: number, + position: 'start_left' | 'start_right' | 'end_left' | 'end_right', + _points: Point[] +): Point { // Todo looking to faster cloning method let points = JSON.parse(JSON.stringify(_points)); let prevPoint; @@ -441,15 +453,15 @@ const calcTerminalLabelPosition = (terminalMarkerSize, position, _points) => { cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2 - 5; } return cardinalityPosition; -}; +} /** * Gets styles from an array of declarations * - * @param {string[]} arr Declarations - * @returns {{ style: string; labelStyle: string }} The styles grouped as strings + * @param arr - Declarations + * @returns The styles grouped as strings */ -export const getStylesFromArray = (arr) => { +export function getStylesFromArray(arr: string[]): { style: string; labelStyle: string } { let style = ''; let labelStyle = ''; @@ -465,7 +477,7 @@ export const getStylesFromArray = (arr) => { } return { style: style, labelStyle: labelStyle }; -}; +} let cnt = 0; export const generateId = () => { @@ -474,10 +486,12 @@ export const generateId = () => { }; /** - * @param {any} length - * @returns {any} + * Generates a random hexadecimal id of the given length. + * + * @param length - Length of ID. + * @returns The generated ID. */ -function makeid(length) { +function makeid(length: number): string { let result = ''; const characters = '0123456789abcdef'; const charactersLength = characters.length; @@ -510,22 +524,25 @@ export const getTextObj = function () { /** * Adds text to an element * - * @param {SVGElement} elem Element to add text to - * @param {{ - * text: string; - * x: number; - * y: number; - * anchor: 'start' | 'middle' | 'end'; - * fontFamily: string; - * fontSize: string | number; - * fontWeight: string | number; - * fill: string; - * class: string | undefined; - * textMargin: number; - * }} textData - * @returns {SVGTextElement} Text element with given styling and content + * @param elem - SVG Element to add text to + * @param textData - Text options. + * @returns Text element with given styling and content */ -export const drawSimpleText = function (elem, textData) { +export const drawSimpleText = function ( + elem: SVGElement, + textData: { + text: string; + x: number; + y: number; + anchor: 'start' | 'middle' | 'end'; + fontFamily: string; + fontSize: string | number; + fontWeight: string | number; + fill: string; + class: string | undefined; + textMargin: number; + } +): SVGTextElement { // Remove and ignore br:s const nText = textData.text.replace(common.lineBreakRegex, ' '); @@ -623,43 +640,56 @@ const breakString = memoize( * * If the wrapped text text has greater height, we extend the height, so it's value won't overflow. * - * @param {any} text The text to measure - * @param {any} config - The config for fontSize, fontFamily, and fontWeight all impacting the + * @param text - The text to measure + * @param config - The config for fontSize, fontFamily, and fontWeight all impacting the * resulting size - * @returns {any} - The height for the given text + * @returns The height for the given text */ -export const calculateTextHeight = function (text, config) { +export function calculateTextHeight( + text: Parameters[0], + config: Parameters[1] +): ReturnType['height'] { config = Object.assign( { fontSize: 12, fontWeight: 400, fontFamily: 'Arial', margin: 15 }, config ); return calculateTextDimensions(text, config).height; -}; +} /** * This calculates the width of the given text, font size and family. * - * @param {any} text - The text to calculate the width of - * @param {any} config - The config for fontSize, fontFamily, and fontWeight all impacting the + * @param text - The text to calculate the width of + * @param config - The config for fontSize, fontFamily, and fontWeight all impacting the * resulting size - * @returns {any} - The width for the given text + * @returns The width for the given text */ -export const calculateTextWidth = function (text, config) { +export function calculateTextWidth( + text: Parameters[0], + config: Parameters[1] +): ReturnType['width'] { config = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: 'Arial' }, config); return calculateTextDimensions(text, config).width; -}; +} /** * This calculates the dimensions of the given text, font size, font family, font weight, and * margins. * - * @param {any} text - The text to calculate the width of - * @param {any} config - The config for fontSize, fontFamily, fontWeight, and margin all impacting + * @param text - The text to calculate the width of + * @param config - The config for fontSize, fontFamily, fontWeight, and margin all impacting * the resulting size - * @returns - The width for the given text + * @returns The dimensions for the given text */ export const calculateTextDimensions = memoize( - function (text, config) { + function ( + text: string, + config: { + fontSize?: number; + fontWeight?: number; + fontFamily?: string; + } + ) { config = Object.assign({ fontSize: 12, fontWeight: 400, fontFamily: 'Arial' }, config); const { fontSize, fontFamily, fontWeight } = config; if (!text) { @@ -741,10 +771,10 @@ let decoder; /** * Decodes HTML, source: {@link https://github.com/shrpne/entity-decode/blob/v2.0.1/browser.js} * - * @param {string} html HTML as a string - * @returns {string} Unescaped HTML + * @param html - HTML as a string + * @returns Unescaped HTML */ -export const entityDecode = function (html) { +export const entityDecode = function (html: string): string { decoder = decoder || document.createElement('div'); // Escape HTML before decoding for HTML Entities html = escape(html).replace(/%26/g, '&').replace(/%23/g, '#').replace(/%3B/g, ';'); @@ -756,9 +786,9 @@ export const entityDecode = function (html) { /** * Sanitizes directive objects * - * @param {object} args Directive's JSON + * @param args - Directive's JSON */ -export const directiveSanitizer = (args) => { +export const directiveSanitizer = (args: any) => { log.debug('directiveSanitizer called with', args); if (typeof args === 'object') { // check for array @@ -845,12 +875,12 @@ export interface DetailedError { hash: any; } -/** @param error */ +/** @param error - The error to check */ export function isDetailedError(error: unknown): error is DetailedError { return 'str' in error; } -/** @param error */ +/** @param error - The error to convert to an error message */ export function getErrorMessage(error: unknown): string { if (error instanceof Error) { return error.message; From a1c6d76a15083a389f065447ff5fb6046a13552d Mon Sep 17 00:00:00 2001 From: IMGSS <838632526@qq.com> Date: Sat, 22 Oct 2022 22:43:53 +0800 Subject: [PATCH 38/42] Update sequenceDiagram.md --- docs/sequenceDiagram.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sequenceDiagram.md b/docs/sequenceDiagram.md index 619f33243..a570f660a 100644 --- a/docs/sequenceDiagram.md +++ b/docs/sequenceDiagram.md @@ -97,7 +97,7 @@ Messages can be of two displayed either solid or with a dotted line. [Actor][Arrow][Actor]:Message text -There are six types of arrows currently supported: +There are eight types of arrows currently supported: | Type | Description | | ---- | ------------------------------------------------ | From f788ab54f33590c7cb78dc220ba1ad454bb5d58e Mon Sep 17 00:00:00 2001 From: shuaisguo Date: Sun, 23 Oct 2022 10:34:26 +0800 Subject: [PATCH 39/42] fix typo --- packages/mermaid/src/docs/sequenceDiagram.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mermaid/src/docs/sequenceDiagram.md b/packages/mermaid/src/docs/sequenceDiagram.md index 434e9572f..582bbe174 100644 --- a/packages/mermaid/src/docs/sequenceDiagram.md +++ b/packages/mermaid/src/docs/sequenceDiagram.md @@ -66,7 +66,7 @@ Messages can be of two displayed either solid or with a dotted line. [Actor][Arrow][Actor]:Message text ``` -There are six types of arrows currently supported: +There are eight types of arrows currently supported: | Type | Description | | ---- | ------------------------------------------------ | From 663edabb14850d68f90da455ca69bff5b2c5ca34 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 01:14:45 +0000 Subject: [PATCH 40/42] chore(deps): pin dependencies --- package.json | 6 +++--- pnpm-lock.yaml | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index ad80859b1..ee8c688b4 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "@applitools/eyes-cypress": "3.27.2", "@commitlint/cli": "17.1.2", "@commitlint/config-conventional": "17.1.0", - "@cspell/eslint-plugin": "^6.12.0", + "@cspell/eslint-plugin": "6.12.0", "@types/d3": "7.4.0", "@types/dompurify": "2.3.4", "@types/eslint": "8.4.6", @@ -119,8 +119,8 @@ "eslint-plugin-jsdoc": "39.3.6", "eslint-plugin-json": "3.1.0", "eslint-plugin-markdown": "3.0.0", - "eslint-plugin-no-only-tests": "^3.0.0", - "eslint-plugin-tsdoc": "^0.2.17", + "eslint-plugin-no-only-tests": "3.1.0", + "eslint-plugin-tsdoc": "0.2.17", "express": "4.18.2", "globby": "13.1.2", "husky": "8.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index db4590ed3..1c21d581c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,7 +11,7 @@ importers: '@braintree/sanitize-url': 6.0.0 '@commitlint/cli': 17.1.2 '@commitlint/config-conventional': 17.1.0 - '@cspell/eslint-plugin': ^6.12.0 + '@cspell/eslint-plugin': 6.12.0 '@types/d3': 7.4.0 '@types/dompurify': 2.3.4 '@types/eslint': 8.4.6 @@ -45,8 +45,8 @@ importers: eslint-plugin-jsdoc: 39.3.6 eslint-plugin-json: 3.1.0 eslint-plugin-markdown: 3.0.0 - eslint-plugin-no-only-tests: ^3.0.0 - eslint-plugin-tsdoc: ^0.2.17 + eslint-plugin-no-only-tests: 3.1.0 + eslint-plugin-tsdoc: 0.2.17 express: 4.18.2 fast-clone: 1.5.13 globby: 13.1.2 @@ -129,7 +129,7 @@ importers: eslint-plugin-jsdoc: 39.3.6_eslint@8.25.0 eslint-plugin-json: 3.1.0 eslint-plugin-markdown: 3.0.0_eslint@8.25.0 - eslint-plugin-no-only-tests: 3.0.0 + eslint-plugin-no-only-tests: 3.1.0 eslint-plugin-tsdoc: 0.2.17 express: 4.18.2 globby: 13.1.2 @@ -6090,8 +6090,8 @@ packages: - supports-color dev: true - /eslint-plugin-no-only-tests/3.0.0: - resolution: {integrity: sha512-I0PeXMs1vu21ap45hey4HQCJRqpcoIvGcNTPJe+UhUm8TwjQ6//mCrDqF8q0WS6LgmRDwQ4ovQej0AQsAHb5yg==} + /eslint-plugin-no-only-tests/3.1.0: + resolution: {integrity: sha512-Lf4YW/bL6Un1R6A76pRZyE1dl1vr31G/ev8UzIc/geCgFWyrKil8hVjYqWVKGB/UIGmb6Slzs9T0wNezdSVegw==} engines: {node: '>=5.0.0'} dev: true From 728d022f528fee1cc35c8a41555c332e06e2ccb8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 04:35:20 +0000 Subject: [PATCH 41/42] chore(deps): update all non-major dependencies --- docs/index.html | 8 +- package.json | 24 +- packages/mermaid/package.json | 14 +- packages/mermaid/src/docs/index.html | 8 +- pnpm-lock.yaml | 1282 +++++++++++--------------- 5 files changed, 585 insertions(+), 751 deletions(-) diff --git a/docs/index.html b/docs/index.html index 6f3f0f27b..094a6183a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -40,20 +40,20 @@ }; diff --git a/package.json b/package.json index ee8c688b4..1ec95e84f 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "module": "dist/mermaid.core.mjs", "types": "dist/mermaid.d.ts", "type": "module", - "packageManager": "pnpm@7.13.5", + "packageManager": "pnpm@7.13.6", "exports": { ".": { "require": "./dist/mermaid.min.js", @@ -70,7 +70,7 @@ ] }, "dependencies": { - "@braintree/sanitize-url": "6.0.0", + "@braintree/sanitize-url": "6.0.1", "@types/node": "18.11.0", "@types/uuid": "8.3.4", "d3": "7.6.1", @@ -88,21 +88,21 @@ "uuid": "9.0.0" }, "devDependencies": { - "@applitools/eyes-cypress": "3.27.2", + "@applitools/eyes-cypress": "3.27.5", "@commitlint/cli": "17.1.2", "@commitlint/config-conventional": "17.1.0", "@cspell/eslint-plugin": "6.12.0", "@types/d3": "7.4.0", "@types/dompurify": "2.3.4", - "@types/eslint": "8.4.6", + "@types/eslint": "8.4.7", "@types/express": "4.17.14", "@types/jsdom": "20.0.0", "@types/lodash": "4.14.186", "@types/mdast": "3.0.10", "@types/prettier": "2.7.1", "@types/stylis": "4.0.2", - "@typescript-eslint/eslint-plugin": "5.40.0", - "@typescript-eslint/parser": "5.40.0", + "@typescript-eslint/eslint-plugin": "5.40.1", + "@typescript-eslint/parser": "5.40.1", "@vitest/coverage-c8": "0.24.3", "@vitest/ui": "0.24.3", "concurrently": "7.4.0", @@ -110,13 +110,13 @@ "cypress": "10.10.0", "cypress-image-snapshot": "4.0.1", "documentation": "13.2.5", - "esbuild": "0.15.11", + "esbuild": "0.15.12", "eslint": "8.25.0", "eslint-config-prettier": "8.5.0", "eslint-plugin-cypress": "2.12.1", "eslint-plugin-html": "7.1.0", - "eslint-plugin-jest": "27.1.2", - "eslint-plugin-jsdoc": "39.3.6", + "eslint-plugin-jest": "27.1.3", + "eslint-plugin-jsdoc": "39.3.23", "eslint-plugin-json": "3.1.0", "eslint-plugin-markdown": "3.0.0", "eslint-plugin-no-only-tests": "3.1.0", @@ -125,13 +125,13 @@ "globby": "13.1.2", "husky": "8.0.1", "identity-obj-proxy": "3.0.0", - "jest": "29.2.0", + "jest": "29.2.1", "jison": "0.4.18", "jsdom": "20.0.1", "lint-staged": "13.0.3", "markdown-it": "13.0.1", "path-browserify": "1.0.1", - "pnpm": "7.13.5", + "pnpm": "7.13.6", "prettier": "2.7.1", "prettier-plugin-jsdoc": "0.4.2", "remark": "14.0.2", @@ -141,7 +141,7 @@ "typescript": "4.8.4", "unist-util-flatmap": "1.0.0", "vite": "3.1.8", - "vitepress": "1.0.0-alpha.21", + "vitepress": "1.0.0-alpha.22", "vitepress-plugin-mermaid": "2.0.8", "vitepress-plugin-search": "1.0.4-alpha.11", "vitest": "0.24.3" diff --git a/packages/mermaid/package.json b/packages/mermaid/package.json index b943eb432..9bda9088a 100644 --- a/packages/mermaid/package.json +++ b/packages/mermaid/package.json @@ -75,31 +75,31 @@ "stylis": "^4.1.2" }, "devDependencies": { - "@applitools/eyes-cypress": "3.27.2", + "@applitools/eyes-cypress": "3.27.5", "@commitlint/cli": "17.1.2", "@commitlint/config-conventional": "17.1.0", "@types/d3": "7.4.0", "@types/dompurify": "2.3.4", - "@types/eslint": "8.4.6", + "@types/eslint": "8.4.7", "@types/express": "4.17.14", "@types/jsdom": "20.0.0", "@types/lodash": "4.14.186", "@types/prettier": "2.7.1", "@types/stylis": "4.0.2", - "@typescript-eslint/eslint-plugin": "5.40.0", - "@typescript-eslint/parser": "5.40.0", + "@typescript-eslint/eslint-plugin": "5.40.1", + "@typescript-eslint/parser": "5.40.1", "concurrently": "7.4.0", "coveralls": "3.1.1", "cypress": "10.10.0", "cypress-image-snapshot": "4.0.1", "documentation": "13.2.5", - "esbuild": "0.15.11", + "esbuild": "0.15.12", "eslint": "8.25.0", "eslint-config-prettier": "8.5.0", "eslint-plugin-cypress": "2.12.1", "eslint-plugin-html": "7.1.0", - "eslint-plugin-jest": "27.1.2", - "eslint-plugin-jsdoc": "39.3.6", + "eslint-plugin-jest": "27.1.3", + "eslint-plugin-jsdoc": "39.3.23", "eslint-plugin-json": "3.1.0", "eslint-plugin-markdown": "3.0.0", "express": "4.18.2", diff --git a/packages/mermaid/src/docs/index.html b/packages/mermaid/src/docs/index.html index 5022e6dc9..685496261 100644 --- a/packages/mermaid/src/docs/index.html +++ b/packages/mermaid/src/docs/index.html @@ -40,20 +40,20 @@ }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1c21d581c..407176c99 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,14 +7,14 @@ importers: .: specifiers: - '@applitools/eyes-cypress': 3.27.2 - '@braintree/sanitize-url': 6.0.0 + '@applitools/eyes-cypress': 3.27.5 + '@braintree/sanitize-url': 6.0.1 '@commitlint/cli': 17.1.2 '@commitlint/config-conventional': 17.1.0 '@cspell/eslint-plugin': 6.12.0 '@types/d3': 7.4.0 '@types/dompurify': 2.3.4 - '@types/eslint': 8.4.6 + '@types/eslint': 8.4.7 '@types/express': 4.17.14 '@types/jsdom': 20.0.0 '@types/lodash': 4.14.186 @@ -23,8 +23,8 @@ importers: '@types/prettier': 2.7.1 '@types/stylis': 4.0.2 '@types/uuid': 8.3.4 - '@typescript-eslint/eslint-plugin': 5.40.0 - '@typescript-eslint/parser': 5.40.0 + '@typescript-eslint/eslint-plugin': 5.40.1 + '@typescript-eslint/parser': 5.40.1 '@vitest/coverage-c8': 0.24.3 '@vitest/ui': 0.24.3 concurrently: 7.4.0 @@ -36,13 +36,13 @@ importers: dagre-d3: 0.6.4 documentation: 13.2.5 dompurify: 2.4.0 - esbuild: 0.15.11 + esbuild: 0.15.12 eslint: 8.25.0 eslint-config-prettier: 8.5.0 eslint-plugin-cypress: 2.12.1 eslint-plugin-html: 7.1.0 - eslint-plugin-jest: 27.1.2 - eslint-plugin-jsdoc: 39.3.6 + eslint-plugin-jest: 27.1.3 + eslint-plugin-jsdoc: 39.3.23 eslint-plugin-json: 3.1.0 eslint-plugin-markdown: 3.0.0 eslint-plugin-no-only-tests: 3.1.0 @@ -53,7 +53,7 @@ importers: graphlib: 2.1.8 husky: 8.0.1 identity-obj-proxy: 3.0.0 - jest: 29.2.0 + jest: 29.2.1 jison: 0.4.18 jsdom: 20.0.1 khroma: 2.0.0 @@ -63,7 +63,7 @@ importers: moment-mini: 2.29.4 non-layered-tidy-tree-layout: 2.0.2 path-browserify: 1.0.1 - pnpm: 7.13.5 + pnpm: 7.13.6 prettier: 2.7.1 prettier-plugin-jsdoc: 0.4.2 remark: 14.0.2 @@ -76,12 +76,12 @@ importers: unist-util-flatmap: 1.0.0 uuid: 9.0.0 vite: 3.1.8 - vitepress: 1.0.0-alpha.21 + vitepress: 1.0.0-alpha.22 vitepress-plugin-mermaid: 2.0.8 vitepress-plugin-search: 1.0.4-alpha.11 vitest: 0.24.3 dependencies: - '@braintree/sanitize-url': 6.0.0 + '@braintree/sanitize-url': 6.0.1 '@types/node': 18.11.0 '@types/uuid': 8.3.4 d3: 7.6.1 @@ -98,35 +98,35 @@ importers: stylis: 4.1.2 uuid: 9.0.0 devDependencies: - '@applitools/eyes-cypress': 3.27.2 + '@applitools/eyes-cypress': 3.27.5 '@commitlint/cli': 17.1.2 '@commitlint/config-conventional': 17.1.0 '@cspell/eslint-plugin': 6.12.0 '@types/d3': 7.4.0 '@types/dompurify': 2.3.4 - '@types/eslint': 8.4.6 + '@types/eslint': 8.4.7 '@types/express': 4.17.14 '@types/jsdom': 20.0.0 '@types/lodash': 4.14.186 '@types/mdast': 3.0.10 '@types/prettier': 2.7.1 '@types/stylis': 4.0.2 - '@typescript-eslint/eslint-plugin': 5.40.0_25sstg4uu2sk4pm7xcyzuov7xq - '@typescript-eslint/parser': 5.40.0_z4bbprzjrhnsfa24uvmcbu7f5q + '@typescript-eslint/eslint-plugin': 5.40.1_ukgdydjtebaxmxfqp5v5ulh64y + '@typescript-eslint/parser': 5.40.1_z4bbprzjrhnsfa24uvmcbu7f5q '@vitest/coverage-c8': 0.24.3_ff3ihdoybm7ovley6q4itwsswa '@vitest/ui': 0.24.3 concurrently: 7.4.0 coveralls: 3.1.1 cypress: 10.10.0 - cypress-image-snapshot: 4.0.1_sldctbhq72okzn4urvbivac6lq + cypress-image-snapshot: 4.0.1_i53o2fh6a5o5tv3qlenzwcubc4 documentation: 13.2.5 - esbuild: 0.15.11 + esbuild: 0.15.12 eslint: 8.25.0 eslint-config-prettier: 8.5.0_eslint@8.25.0 eslint-plugin-cypress: 2.12.1_eslint@8.25.0 eslint-plugin-html: 7.1.0 - eslint-plugin-jest: 27.1.2_nc3c3bdiyy2hxtl32wv7esmvmq - eslint-plugin-jsdoc: 39.3.6_eslint@8.25.0 + eslint-plugin-jest: 27.1.3_ktuq5bhtjfperqqn2aknj5bg6m + eslint-plugin-jsdoc: 39.3.23_eslint@8.25.0 eslint-plugin-json: 3.1.0 eslint-plugin-markdown: 3.0.0_eslint@8.25.0 eslint-plugin-no-only-tests: 3.1.0 @@ -135,13 +135,13 @@ importers: globby: 13.1.2 husky: 8.0.1 identity-obj-proxy: 3.0.0 - jest: 29.2.0_pt3oab7md4pun52yk6ejrzjiwq + jest: 29.2.1_pt3oab7md4pun52yk6ejrzjiwq jison: 0.4.18 jsdom: 20.0.1 lint-staged: 13.0.3 markdown-it: 13.0.1 path-browserify: 1.0.1 - pnpm: 7.13.5 + pnpm: 7.13.6 prettier: 2.7.1 prettier-plugin-jsdoc: 0.4.2_prettier@2.7.1 remark: 14.0.2 @@ -151,27 +151,27 @@ importers: typescript: 4.8.4 unist-util-flatmap: 1.0.0 vite: 3.1.8 - vitepress: 1.0.0-alpha.21_tbpndr44ulefs3hehwpi2mkf2y - vitepress-plugin-mermaid: 2.0.8_orex2agllvbrjwlm6w3vfszwae - vitepress-plugin-search: 1.0.4-alpha.11_edcjrozpkfaskrqytnhbwsc3ky + vitepress: 1.0.0-alpha.22_tbpndr44ulefs3hehwpi2mkf2y + vitepress-plugin-mermaid: 2.0.8_m5gk66we2y6xlan2yvhce6nu2a + vitepress-plugin-search: 1.0.4-alpha.11_eny7drxhzzrhshlyu255qt5dum vitest: 0.24.3_ff3ihdoybm7ovley6q4itwsswa packages/mermaid: specifiers: - '@applitools/eyes-cypress': 3.27.2 + '@applitools/eyes-cypress': 3.27.5 '@braintree/sanitize-url': ^6.0.0 '@commitlint/cli': 17.1.2 '@commitlint/config-conventional': 17.1.0 '@types/d3': 7.4.0 '@types/dompurify': 2.3.4 - '@types/eslint': 8.4.6 + '@types/eslint': 8.4.7 '@types/express': 4.17.14 '@types/jsdom': 20.0.0 '@types/lodash': 4.14.186 '@types/prettier': 2.7.1 '@types/stylis': 4.0.2 - '@typescript-eslint/eslint-plugin': 5.40.0 - '@typescript-eslint/parser': 5.40.0 + '@typescript-eslint/eslint-plugin': 5.40.1 + '@typescript-eslint/parser': 5.40.1 concurrently: 7.4.0 coveralls: 3.1.1 cypress: 10.10.0 @@ -181,13 +181,13 @@ importers: dagre-d3: ^0.6.4 documentation: 13.2.5 dompurify: 2.4.0 - esbuild: 0.15.11 + esbuild: 0.15.12 eslint: 8.25.0 eslint-config-prettier: 8.5.0 eslint-plugin-cypress: 2.12.1 eslint-plugin-html: 7.1.0 - eslint-plugin-jest: 27.1.2 - eslint-plugin-jsdoc: 39.3.6 + eslint-plugin-jest: 27.1.3 + eslint-plugin-jsdoc: 39.3.23 eslint-plugin-json: 3.1.0 eslint-plugin-markdown: 3.0.0 express: 4.18.2 @@ -229,31 +229,31 @@ importers: non-layered-tidy-tree-layout: 2.0.2 stylis: 4.1.2 devDependencies: - '@applitools/eyes-cypress': 3.27.2 + '@applitools/eyes-cypress': 3.27.5 '@commitlint/cli': 17.1.2 '@commitlint/config-conventional': 17.1.0 '@types/d3': 7.4.0 '@types/dompurify': 2.3.4 - '@types/eslint': 8.4.6 + '@types/eslint': 8.4.7 '@types/express': 4.17.14 '@types/jsdom': 20.0.0 '@types/lodash': 4.14.186 '@types/prettier': 2.7.1 '@types/stylis': 4.0.2 - '@typescript-eslint/eslint-plugin': 5.40.0_25sstg4uu2sk4pm7xcyzuov7xq - '@typescript-eslint/parser': 5.40.0_z4bbprzjrhnsfa24uvmcbu7f5q + '@typescript-eslint/eslint-plugin': 5.40.1_ukgdydjtebaxmxfqp5v5ulh64y + '@typescript-eslint/parser': 5.40.1_z4bbprzjrhnsfa24uvmcbu7f5q concurrently: 7.4.0 coveralls: 3.1.1 cypress: 10.10.0 cypress-image-snapshot: 4.0.1_wsmbrbtpfgb2tvmlrj7mjfruri documentation: 13.2.5 - esbuild: 0.15.11 + esbuild: 0.15.12 eslint: 8.25.0 eslint-config-prettier: 8.5.0_eslint@8.25.0 eslint-plugin-cypress: 2.12.1_eslint@8.25.0 eslint-plugin-html: 7.1.0 - eslint-plugin-jest: 27.1.2_37sgn6sqs6ms4ljiz35av2ikje - eslint-plugin-jsdoc: 39.3.6_eslint@8.25.0 + eslint-plugin-jest: 27.1.3_pubrigz2e5aqv2qdhrj3u7msey + eslint-plugin-jsdoc: 39.3.23_eslint@8.25.0 eslint-plugin-json: 3.1.0 eslint-plugin-markdown: 3.0.0_eslint@8.25.0 express: 4.18.2 @@ -417,37 +417,48 @@ packages: '@algolia/requester-common': 4.14.2 dev: true - /@applitools/core-base/1.1.0: - resolution: {integrity: sha512-YcMF3a3tW7oDtxN7pQM8vUmezqMNcK+pgyYHKyjpRt/m2BUuNrymx+7CToR8n5sBDmfG6TWanufFkjocOtKq6g==} + /@applitools/core-base/1.1.4: + resolution: {integrity: sha512-dV5mOG59Yh1G2ZYZb1tU1HgXPU1mPp7x+IVtwp2eBrikkTzhIp4feCVj4LNPJZF8Hq7YfoxHYtF6EpBg/P7trw==} engines: {node: '>=12.13.0'} dependencies: - '@applitools/image': 1.0.2 - '@applitools/logger': 1.1.26 - '@applitools/req': 1.1.10 - '@applitools/types': 1.5.19 - '@applitools/utils': 1.3.12 + '@applitools/image': 1.0.4 + '@applitools/logger': 1.1.27 + '@applitools/req': 1.1.11 + '@applitools/utils': 1.3.13 transitivePeerDependencies: - encoding - supports-color dev: true - /@applitools/core/1.1.5: - resolution: {integrity: sha512-CroUu72ducqxEQSTBfNPyDCq3699A7r9zpp6fh5WP65WiaTzkf8WNviR3Ir/fDVteYr4wCGxGN6WfUIJ3Gh1IA==} + /@applitools/core-base/1.1.5: + resolution: {integrity: sha512-OvJZIEwJs8L/Kl8+6jjHZ0c4RizemXVCBzBnNu/JhzS54cwhp7wLTowN/ZI6w4WwRgwLrUF2FNQhd4ydiomNvg==} + engines: {node: '>=12.13.0'} + dependencies: + '@applitools/image': 1.0.4 + '@applitools/logger': 1.1.27 + '@applitools/req': 1.1.11 + '@applitools/utils': 1.3.13 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + + /@applitools/core/1.2.0: + resolution: {integrity: sha512-KwqZYkkXHVbvXgpTdV9L0RiHmxGqTrrlhn6MsEI1XpaEQ432dJAlQqH2n2H3g8y8Q8aU5AwZ6IvtOtXhEkxbbw==} engines: {node: '>=12.13.0'} hasBin: true dependencies: - '@applitools/core-base': 1.1.0 + '@applitools/core-base': 1.1.4 '@applitools/dom-capture': 11.2.0 '@applitools/dom-snapshot': 4.7.0 - '@applitools/driver': 1.10.5 - '@applitools/logger': 1.1.26 - '@applitools/nml-client': 1.3.3 - '@applitools/req': 1.1.10 - '@applitools/screenshoter': 3.6.3 + '@applitools/driver': 1.10.6 + '@applitools/logger': 1.1.27 + '@applitools/nml-client': 1.3.4 + '@applitools/req': 1.1.11 + '@applitools/screenshoter': 3.6.5 '@applitools/snippets': 2.4.5 - '@applitools/types': 1.5.19 - '@applitools/ufg-client': 1.0.9 - '@applitools/utils': 1.3.12 + '@applitools/ufg-client': 1.1.0 + '@applitools/utils': 1.3.13 abort-controller: 3.0.0 throat: 6.0.1 transitivePeerDependencies: @@ -457,12 +468,29 @@ packages: - utf-8-validate dev: true - /@applitools/dom-capture/11.1.2: - resolution: {integrity: sha512-LRs3yWiS7NQpDrNTx77zO7U/nldrzq5B5HnEmM/ZJM6xThOPZdTJNYEcdzQV8yfZVawX/pq/imyejcVIvhmFzA==} - engines: {node: '>=8.9.0'} + /@applitools/core/1.2.1: + resolution: {integrity: sha512-fVOSJJXF8rrOXoJ1b+fYsCq5Y50B6U3MYaAy1trQeOiKaZ5VLBb4Zv20bOAfijYIyYpwO/oaIE7i5xghXg8+Dw==} + engines: {node: '>=12.13.0'} + hasBin: true dependencies: - '@applitools/dom-shared': 1.0.5 - '@applitools/functional-commons': 1.6.0 + '@applitools/core-base': 1.1.5 + '@applitools/dom-capture': 11.2.0 + '@applitools/dom-snapshot': 4.7.0 + '@applitools/driver': 1.10.7 + '@applitools/logger': 1.1.27 + '@applitools/nml-client': 1.3.4 + '@applitools/req': 1.1.11 + '@applitools/screenshoter': 3.7.0 + '@applitools/snippets': 2.4.5 + '@applitools/ufg-client': 1.1.0 + '@applitools/utils': 1.3.13 + abort-controller: 3.0.0 + throat: 6.0.1 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate dev: true /@applitools/dom-capture/11.2.0: @@ -478,26 +506,11 @@ packages: engines: {node: '>=8.9.0'} dev: true - /@applitools/dom-shared/1.0.8: - resolution: {integrity: sha512-HQtYfFvtlPuE9ZShBamtW1LGW2Qq4HxjQx5nF7KiNvrRTlf5/e+AWpZhXCTVEhVkAcSNs/7xR2WvumOUd+usxg==} - engines: {node: '>=8.9.0'} - dev: true - /@applitools/dom-shared/1.0.9: resolution: {integrity: sha512-u6nRHBklRAaODILm0HRluE0IAwrnjs8AMNRBFxHThKGt4qpbkhnwazGMr4zDu3WCBjr/sA31kekUqNl0Jx3YeQ==} engines: {node: '>=8.9.0'} dev: true - /@applitools/dom-snapshot/4.6.2: - resolution: {integrity: sha512-8XFbsIl154VK3rqNhHbSzcYDNLJ8QEgHzWht5cM0WhScWVokXUfL+kDmqjLIMZ47VgP3XXxk0rgX5QOs2TZx8Q==} - engines: {node: '>=8.9.0'} - dependencies: - '@applitools/dom-shared': 1.0.8 - '@applitools/functional-commons': 1.6.0 - css-tree: 1.0.0-alpha.39 - pako: 1.0.11 - dev: true - /@applitools/dom-snapshot/4.7.0: resolution: {integrity: sha512-exLRB2dTLiqD8i5oOK/QyfNMSLramVF5CFYNI29WWQjbXkIpCGOomGA8/xL+sYiC53jjx3Y9u6jHtlkb5ASJAQ==} engines: {node: '>=8.9.0'} @@ -508,34 +521,33 @@ packages: pako: 1.0.11 dev: true - /@applitools/driver/1.10.5: - resolution: {integrity: sha512-I2KSRM2ZIo5AJh2ylLB/WECExmKVpx7GJCnsOHcriLh+E8XDhZkZtCQ9GEIM/aVRO0yLm70H24r0/qxNyikt1A==} + /@applitools/driver/1.10.6: + resolution: {integrity: sha512-fZgnDTCSd8CaiXXYyWGIaIAZisEw9Waj+SPoAi6osypvFkVQ71mynC+fkfI/B5JOEnoHYEpj4AXfiukEvq88zA==} engines: {node: '>=12.13.0'} dependencies: - '@applitools/logger': 1.1.26 + '@applitools/logger': 1.1.27 '@applitools/snippets': 2.4.5 - '@applitools/utils': 1.3.12 + '@applitools/utils': 1.3.13 semver: 7.3.7 dev: true - /@applitools/driver/1.9.26: - resolution: {integrity: sha512-owkCcmklmvDBu6uabewHQJTX5sLFj/ULccpXPEW8Z/UB+Nd/ttWwUz92OxLJFrYq1F4Nd8X1WIyrVYnuqYAE1g==} + /@applitools/driver/1.10.7: + resolution: {integrity: sha512-HaKnZ98y1PUnnT2tsHar5smPekNtxwWuEfwQFSWRp1OK5lgi+leUXtcXRROzsD1Z7kRGDuyMbqSDYINFDgWDlQ==} engines: {node: '>=12.13.0'} dependencies: - '@applitools/logger': 1.1.16 + '@applitools/logger': 1.1.27 '@applitools/snippets': 2.4.5 - '@applitools/types': 1.5.9 - '@applitools/utils': 1.3.10 + '@applitools/utils': 1.3.13 semver: 7.3.7 dev: true - /@applitools/execution-grid-client/1.1.24: - resolution: {integrity: sha512-SA6pl54KwkExr30lPRrEGfP3Ypfyfw8LLhVk7XWMLp4D7JgBPNyzAbY+KHLE4bVXRUBiXDzQGcf8scLVycajxg==} + /@applitools/execution-grid-client/1.1.30: + resolution: {integrity: sha512-LoX0ZcNDZZV4aD6bpldfOTk94tNznRcIZPAVRRrKiqQJWJnDPP661EGxykXsfVnluCHaOGmbDPH6bfJGdDfUuQ==} engines: {node: '>=12.13.0'} hasBin: true dependencies: - '@applitools/logger': 1.1.16 - '@applitools/utils': 1.3.10 + '@applitools/logger': 1.1.27 + '@applitools/utils': 1.3.13 abort-controller: 3.0.0 node-fetch: 2.6.7 proxy-agent: 5.0.0 @@ -546,62 +558,49 @@ packages: - supports-color dev: true - /@applitools/execution-grid-client/1.1.29: - resolution: {integrity: sha512-iI7oFmzM9G6Qmgmt1JsYJ2Qhs0C5hgrwxoehANa7d62HlGpppvKlv5gOAkkQphsyvLSrPTlfqKPRyh9/W6ZeZQ==} + /@applitools/eyes-api/1.9.0: + resolution: {integrity: sha512-XOmVb3SZGk3ae5Et72GR4C09xciAtzyfzVEaxAEbwB+ccI2QCkCbjN/GL6lVo0unc0urPhKSzIfxGu3z5mcZQA==} engines: {node: '>=12.13.0'} - hasBin: true dependencies: - '@applitools/logger': 1.1.26 - '@applitools/utils': 1.3.12 - abort-controller: 3.0.0 - node-fetch: 2.6.7 - proxy-agent: 5.0.0 - raw-body: 2.5.1 - yargs: 17.4.1 + '@applitools/core': 1.2.0 + '@applitools/logger': 1.1.27 + '@applitools/utils': 1.3.13 transitivePeerDependencies: + - bufferutil - encoding - supports-color + - utf-8-validate dev: true - /@applitools/eyes-api/1.8.5: - resolution: {integrity: sha512-pZK5RBvnG9/IiXDQFuErcUngbGNDcPLIhl1YydbfEDDtT+vo/mOd8Zq1VGZfHHSiLFr0gBnHAISS3d8n0J1/4w==} - engines: {node: '>=12.13.0'} - dependencies: - '@applitools/logger': 1.1.26 - '@applitools/types': 1.5.19 - '@applitools/utils': 1.3.12 - dev: true - - /@applitools/eyes-cypress/3.27.2: - resolution: {integrity: sha512-nk7j9FQFQ7F4OE2lFOFjuquEXR6b4Z9IKwM7MtCNoOpnvpb15WS7JQX9GAGkv4t9Gst500a7d8gndLmgYwOgKg==} + /@applitools/eyes-cypress/3.27.5: + resolution: {integrity: sha512-s/oavveA1x+oMLFp6AdzTdAVv7RgncnrE12/gBE2HuK17g6NL02tVky5fa2vF3OmFJefOE5ZpVQXsYCLIrgwlg==} engines: {node: '>=12.13.0'} hasBin: true dependencies: - '@applitools/eyes-api': 1.8.5 - '@applitools/eyes-universal': 2.16.3 + '@applitools/core': 1.2.1 + '@applitools/eyes-api': 1.9.0 + '@applitools/eyes-universal': 2.16.6 '@applitools/functional-commons': 1.6.0 - '@applitools/logger': 1.1.26 - '@applitools/visual-grid-client': 15.14.1 + '@applitools/logger': 1.1.27 chalk: 3.0.0 semver: 7.3.7 uuid: 8.3.2 ws: 8.5.0 transitivePeerDependencies: - bufferutil - - debug - encoding - supports-color - utf-8-validate dev: true - /@applitools/eyes-sdk-core/13.11.6: - resolution: {integrity: sha512-p7rf1A3pRF3CUxmYbOpHm0FjaWzGKy95eFHPvi1IcGdICQ0bZ7y9OyCEddXjPplqo+olHt2ZVXB5zzh70UO3iw==} + /@applitools/eyes-sdk-core/13.11.10: + resolution: {integrity: sha512-IxEH5KDoX3nInyKqYXWJQM1cqMrsCV7o3uhnjrCLaj4SWnT1eImmX+sIDFegnmSB5UvwhhozGqU/quymhhoJLQ==} engines: {node: '>=12.13.0'} dependencies: - '@applitools/core': 1.1.5 - '@applitools/driver': 1.10.5 - '@applitools/execution-grid-client': 1.1.29 - '@applitools/utils': 1.3.12 + '@applitools/core': 1.2.1 + '@applitools/driver': 1.10.7 + '@applitools/execution-grid-client': 1.1.30 + '@applitools/utils': 1.3.13 transitivePeerDependencies: - bufferutil - encoding @@ -609,41 +608,17 @@ packages: - utf-8-validate dev: true - /@applitools/eyes-sdk-core/13.9.1: - resolution: {integrity: sha512-4WNfdUAqi5rXSAKWMOZHJOG7LfHLJ0+k3ZXR1RuN9D2SnhQ1CA+JtfXYLZuBqqKl8GUSb/XizYpojOqJpFoAfw==} + /@applitools/eyes-universal/2.16.6: + resolution: {integrity: sha512-T4Q8fFOjXKofsAImpFC2UqnceGlWCgAiGKgKKoDtXCZCOxAPM5wE/vM4GZMVXLhWDZhpgXtQaqa6+sa5QLMyNg==} engines: {node: '>=12.13.0'} hasBin: true dependencies: - '@applitools/dom-capture': 11.1.2 - '@applitools/dom-snapshot': 4.6.2 - '@applitools/driver': 1.9.26 - '@applitools/execution-grid-client': 1.1.24 - '@applitools/isomorphic-fetch': 3.0.0 - '@applitools/logger': 1.1.16 - '@applitools/nml-client': 1.1.1 - '@applitools/screenshoter': 3.5.1 - '@applitools/snippets': 2.4.5 - '@applitools/types': 1.5.9 - '@applitools/utils': 1.3.10 - axios: 0.26.0 - chalk: 3.0.0 - tunnel: 0.0.6 - transitivePeerDependencies: - - debug - - encoding - - supports-color - dev: true - - /@applitools/eyes-universal/2.16.3: - resolution: {integrity: sha512-AYbr1eJS8cwWb08YtoSTn+KKjihKKe12HPYCZ7N3HKeHZD96DKunyG8ERop6YvuH7CrPJtfyZawgPGUdyjqPJw==} - engines: {node: '>=12.13.0'} - hasBin: true - dependencies: - '@applitools/core': 1.1.5 - '@applitools/execution-grid-client': 1.1.29 - '@applitools/eyes-sdk-core': 13.11.6 - '@applitools/logger': 1.1.26 - '@applitools/utils': 1.3.12 + '@applitools/core': 1.2.1 + '@applitools/driver': 1.10.7 + '@applitools/execution-grid-client': 1.1.30 + '@applitools/eyes-sdk-core': 13.11.10 + '@applitools/logger': 1.1.27 + '@applitools/utils': 1.3.13 proxy-agent: 5.0.0 webdriver: 7.16.11 ws: 7.4.6 @@ -660,48 +635,15 @@ packages: engines: {node: '>=8.0.0'} dev: true - /@applitools/http-commons/2.4.7: - resolution: {integrity: sha512-fsq8ULh70/htb9oHSMTkibMR7AiB+ScraYfQw4H7Sq7JfbFnlefSK0c6ZGfSrjJQx79GRfjrqQYtz59s5lxkcw==} - engines: {node: '>=8.0.0'} - dependencies: - '@applitools/functional-commons': 1.6.0 - '@applitools/monitoring-commons': 1.0.19 - agentkeepalive: 4.2.1 - debug: 4.3.4 - lodash.merge: 4.6.2 - node-fetch: 2.6.7 - transitivePeerDependencies: - - encoding - - supports-color - dev: true - - /@applitools/image/1.0.1: - resolution: {integrity: sha512-Z9SEOFcQnnPbIIbagN2RTqgKF1NuYEZnlPNVB4suxnSRxrrjvoVudnysMI2uqKbWjeL5fIxpKgZDNP5sibSuCQ==} + /@applitools/image/1.0.4: + resolution: {integrity: sha512-eNr/fa+loGz1hrgwv/NKuVP13uRyfRUPFyCU8EtTdSWuGFJXIqwhtQWCFCokX1EXnhoCyGfFBAzWgW9StqTGfQ==} engines: {node: '>=12.13.0'} dependencies: - '@applitools/utils': 1.3.10 + '@applitools/utils': 1.3.13 jpeg-js: 0.4.4 png-async: 0.9.4 dev: true - /@applitools/image/1.0.2: - resolution: {integrity: sha512-6paeiEsyHGg48zfPlL6Zw43VKNfKHbW+ynTTxTomceZot11OrC46kmy5MdyvMrHDG0ytb+CsMHPgqNJhNE0HLQ==} - engines: {node: '>=12.13.0'} - dependencies: - '@applitools/utils': 1.3.12 - jpeg-js: 0.4.4 - png-async: 0.9.4 - dev: true - - /@applitools/isomorphic-fetch/3.0.0: - resolution: {integrity: sha512-7rutaN/2M5wYjOIOTKS/Zuc1Na90fJNEAqvo/jCxt7nSD1kYscHV3aCk9t7RD59gmzLMvUTIxFbjl4RUMV8qfg==} - dependencies: - node-fetch: 2.6.7 - whatwg-fetch: 3.6.2 - transitivePeerDependencies: - - encoding - dev: true - /@applitools/jsdom/1.0.4: resolution: {integrity: sha512-JtjNfTJtphJYHEkicW4xlwtYuRP3TRvjoszfkrcpxTNMCbGkbop8ed9MuUfR83dAZj5NY9begbmEqJohLJco6w==} engines: {node: '>=12'} @@ -739,75 +681,31 @@ packages: - utf-8-validate dev: true - /@applitools/logger/1.1.16: - resolution: {integrity: sha512-AA18naLM/v+2k4YwUJ9ayuSUSQBRRlS7hZLQfHEFS9XZMcflSU8a5H0G2cl8AiZMj1hXK6bCIyH3x41x8aFtYQ==} + /@applitools/logger/1.1.27: + resolution: {integrity: sha512-lwKCNhuMfLkqxfwYhLalDg2JZNgNj6rEgD8LnozsQdfxqVXThrJb/fkdSaSeUwnF+ljJyR7fnPy+p742p66U0Q==} engines: {node: '>=12.13.0'} dependencies: - '@applitools/utils': 1.3.10 + '@applitools/utils': 1.3.13 chalk: 4.1.2 dev: true - /@applitools/logger/1.1.26: - resolution: {integrity: sha512-zrwucuOzMLXAyPudCwHiTs8RueTl1CPrQdvz5LHkcNvuhCzCTBOksAYlU8U7TdA/xfxGALLBfGZRbVRd/VF5sQ==} + /@applitools/nml-client/1.3.4: + resolution: {integrity: sha512-CKW/QKtxL3Ijk4FMNAtRNVrqFA5D6GMcD4bRuAeSPYkWBDHplxNgSIM2auBNGF8YVbWX7qu/pDs3iyvN/BfeSQ==} engines: {node: '>=12.13.0'} dependencies: - '@applitools/types': 1.5.19 - '@applitools/utils': 1.3.12 - chalk: 4.1.2 - dev: true - - /@applitools/monitoring-commons/1.0.19: - resolution: {integrity: sha512-rzEOvGoiEF4KnK0PJ9I0btdwnaNlIPLYhjF1vTEG15PoucbbKpix9fYusxWlDG7kMiZya8ZycVPc0woVlNaHRQ==} - engines: {node: '>=8.0.0'} - dependencies: - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@applitools/nml-client/1.1.1: - resolution: {integrity: sha512-5SGbk0LdznYiUp2yxT0z8eCFC115oA1ywJ+eDkpccNgLZlQrmUKo7MKtnKlnewn3n3eTYoGJpU4mn4jiy2tefQ==} - engines: {node: '>=12.13.0'} - dependencies: - '@applitools/req': 1.1.0 - '@applitools/utils': 1.3.10 + '@applitools/logger': 1.1.27 + '@applitools/req': 1.1.11 + '@applitools/utils': 1.3.13 transitivePeerDependencies: - encoding - supports-color dev: true - /@applitools/nml-client/1.3.3: - resolution: {integrity: sha512-5buXrh/7YX+vuDGItu8K1mVervRMxZ92rTfr8KxSGsesKGf/QUhTTAgTdte9EE8sS7xvWIGDV8fwlXwfJk/n0A==} + /@applitools/req/1.1.11: + resolution: {integrity: sha512-pgSH3UAWsQx9tqPuA1GB2Gv8A6jSF227v3BfLwavEnTYw1DIV6iKa7P7H5LNRD/iqsi7wiVK9v6eoOEj4tQzDQ==} engines: {node: '>=12.13.0'} dependencies: - '@applitools/logger': 1.1.26 - '@applitools/req': 1.1.10 - '@applitools/types': 1.5.19 - '@applitools/utils': 1.3.12 - transitivePeerDependencies: - - encoding - - supports-color - dev: true - - /@applitools/req/1.1.0: - resolution: {integrity: sha512-3NaS3F5vBJKvsxwI1bXI9ObDfuy8gfydLOVU4ZE+cKPICzIje5ZSGQjrlIsRt3ayfkJCqK+7r9l8Xyln+wZYig==} - engines: {node: '>=12.13.0'} - dependencies: - '@applitools/utils': 1.3.10 - abort-controller: 3.0.0 - node-fetch: 2.6.7 - proxy-agent: 5.0.0 - transitivePeerDependencies: - - encoding - - supports-color - dev: true - - /@applitools/req/1.1.10: - resolution: {integrity: sha512-PRGcqojWqCxoKAS7iDs1FWg8Kia6AP5xTDYMxoAWZoPQ+WVyk0vZUTa5I0T+0xBkVL1AKxE98FIoHqI8iWqmmQ==} - engines: {node: '>=12.13.0'} - dependencies: - '@applitools/types': 1.5.19 - '@applitools/utils': 1.3.12 + '@applitools/utils': 1.3.13 '@types/node-fetch': 2.6.2 abort-controller: 3.0.0 node-fetch: 2.6.7 @@ -817,26 +715,26 @@ packages: - supports-color dev: true - /@applitools/screenshoter/3.5.1: - resolution: {integrity: sha512-MueuoxNg2atSbeTZcc47HnBCkxubsDg7nAr0s5d/qTmVlEFxv618Sq6pCcZH7eK3S8W36CeXUd1GYfy8lUDg6w==} + /@applitools/screenshoter/3.6.5: + resolution: {integrity: sha512-mPhn6LsGs8Aj0lcxMDh72EEySgqT4x5iM5Tjsr1czQ4WVmPM/xC2TN7N1CwxmS0WFgEcVpjHj9Plfr4lQqNgfg==} engines: {node: '>=12.13.0'} dependencies: - '@applitools/image': 1.0.1 - '@applitools/logger': 1.1.16 + '@applitools/image': 1.0.4 + '@applitools/logger': 1.1.27 '@applitools/snippets': 2.4.5 - '@applitools/utils': 1.3.10 + '@applitools/utils': 1.3.13 jpeg-js: 0.4.4 png-async: 0.9.4 dev: true - /@applitools/screenshoter/3.6.3: - resolution: {integrity: sha512-xg62cKkU5qU6sfTsitg2QVEpVu1mVGqvLQcMY3anj0qmKSVeWPbcPA5MRs7bz0/qBDaEB202oYQinWOQmDWLjQ==} + /@applitools/screenshoter/3.7.0: + resolution: {integrity: sha512-d723TI4InLQi06TpVj4rP+V5OrNL9mFQr+cWv2MOMfQbuAnZETTRzvDyk97e3qoDJHAPjyQuxi81qEaxsFxhOA==} engines: {node: '>=12.13.0'} dependencies: - '@applitools/image': 1.0.2 - '@applitools/logger': 1.1.26 + '@applitools/image': 1.0.4 + '@applitools/logger': 1.1.27 '@applitools/snippets': 2.4.5 - '@applitools/utils': 1.3.12 + '@applitools/utils': 1.3.13 jpeg-js: 0.4.4 png-async: 0.9.4 dev: true @@ -846,25 +744,14 @@ packages: engines: {node: '>=12.13.0'} dev: true - /@applitools/types/1.5.19: - resolution: {integrity: sha512-0KYkVDOSQQRv3UtFfwq0cYerUo9SPkSO0KWsuwI1keO7ctnlyasXjKFRxx/bqrN2CklRSIEiXrvxOM6KAm6KRw==} - engines: {node: '>=12.13.0'} - dev: true - - /@applitools/types/1.5.9: - resolution: {integrity: sha512-8lBeXQ3dRRcIRREisGj9kxFXRNoctMbeAQHWfiSDe/6CS/qO2cGArWRPhOusFsZiYE1NEahgIM6exufztgkfKA==} - engines: {node: '>=12.13.0'} - dev: true - - /@applitools/ufg-client/1.0.9: - resolution: {integrity: sha512-n0asPit711UeTQlTxg4vW+8ER/WWgvbLK7LldGtMGvbdrwh+0L/h/AJeG0U/xBCwJ0s+734j5vY3msySSxjH4g==} + /@applitools/ufg-client/1.1.0: + resolution: {integrity: sha512-wVzKLarbAGKlyNSbxIzj6+k62PFkUaoQGKg2dovHWvHQGEy+5Su8EpT7mOQY2fYYoompw6L05v8gq0W8R/T2bg==} engines: {node: '>=12.13.0'} dependencies: '@applitools/jsdom': 1.0.4 - '@applitools/logger': 1.1.26 - '@applitools/req': 1.1.10 - '@applitools/types': 1.5.19 - '@applitools/utils': 1.3.12 + '@applitools/logger': 1.1.27 + '@applitools/req': 1.1.11 + '@applitools/utils': 1.3.13 abort-controller: 3.0.0 postcss-value-parser: 4.2.0 throat: 6.0.1 @@ -875,38 +762,11 @@ packages: - utf-8-validate dev: true - /@applitools/utils/1.3.10: - resolution: {integrity: sha512-CI/5BLB0D/aZn6uL8JJmsErI+TOHCa4Gz5Wi8sJknuPz/V9Ws6jIh9ZCTzvOCDUIp99qLJwD6TSA2BY9aMhCNw==} + /@applitools/utils/1.3.13: + resolution: {integrity: sha512-UwA1skl9kzK+WrXu7WyX6A4K4TdIFZbDAcFJq2PA5fhmbviAlk4iFJtQjyopYTdY0sSh3VRSsCPr3DsbFa79AA==} engines: {node: '>=12.13.0'} dev: true - /@applitools/utils/1.3.12: - resolution: {integrity: sha512-aWIMcq6wqzIVVIcbe1Q5f2g7PJeyLq17S0hH5xhqOArzJz/urAbLl98jHMOOkIBZVfuIAX0cIgaMPfuUpky96g==} - engines: {node: '>=12.13.0'} - dev: true - - /@applitools/visual-grid-client/15.14.1: - resolution: {integrity: sha512-Gy7S3miR+q8zcKEpH4RSnnZRlcEMN2bxgZ3RafkiCsr7FWIsGeKf0dqAJYljIXB+xU9cVla6Z5cnts/jsu7f4w==} - engines: {node: '>=12.13.0'} - dependencies: - '@applitools/eyes-sdk-core': 13.9.1 - '@applitools/functional-commons': 1.6.0 - '@applitools/http-commons': 2.4.7 - '@applitools/isomorphic-fetch': 3.0.0 - '@applitools/jsdom': 1.0.4 - '@applitools/logger': 1.1.16 - abort-controller: 3.0.0 - chalk: 3.0.0 - postcss-value-parser: 4.1.0 - throat: 5.0.0 - transitivePeerDependencies: - - bufferutil - - debug - - encoding - - supports-color - - utf-8-validate - dev: true - /@babel/code-frame/7.18.6: resolution: {integrity: sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==} engines: {node: '>=6.9.0'} @@ -1234,6 +1094,10 @@ packages: /@braintree/sanitize-url/6.0.0: resolution: {integrity: sha512-mgmE7XBYY/21erpzhexk4Cj1cyTQ9LzvnTxtzM17BJ7ERMNE6W72mQRo0I1Ud8eFJ+RVVIcBNhLFZ3GX4XFz5w==} + dev: false + + /@braintree/sanitize-url/6.0.1: + resolution: {integrity: sha512-zr9Qs9KFQiEvMWdZesjcmRJlUck5NR+eKGS1uyKk+oYTWwlYrsoPEi6VmG6/TzBD1hKCGEimrhTgGS6hvn/xIQ==} /@cnakazawa/watch/1.0.4: resolution: {integrity: sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ==} @@ -1731,17 +1595,17 @@ packages: - '@algolia/client-search' dev: true - /@es-joy/jsdoccomment/0.31.0: - resolution: {integrity: sha512-tc1/iuQcnaiSIUVad72PBierDFpsxdUHtEF/OrfqvM1CBAsIoMP51j52jTMb3dXriwhieTo289InzZj72jL3EQ==} - engines: {node: ^14 || ^16 || ^17 || ^18} + /@es-joy/jsdoccomment/0.33.0: + resolution: {integrity: sha512-bkxMGTlHPE4vfarXt1L1fOm81O18jTRFNgh3Fm4iPKctfWxcpJw4cpth5BhLkGZy4HFzGn/KfD/zGks/J+ZIIw==} + engines: {node: ^14 || ^16 || ^17 || ^18 || ^19} dependencies: comment-parser: 1.3.1 esquery: 1.4.0 jsdoc-type-pratt-parser: 3.1.0 dev: true - /@esbuild/android-arm/0.15.11: - resolution: {integrity: sha512-PzMcQLazLBkwDEkrNPi9AbjFt6+3I7HKbiYF2XtWQ7wItrHvEOeO3T8Am434zAozWtVP7lrTue1bEfc2nYWeCA==} + /@esbuild/android-arm/0.15.12: + resolution: {integrity: sha512-IC7TqIqiyE0MmvAhWkl/8AEzpOtbhRNDo7aph47We1NbE5w2bt/Q+giAhe0YYeVpYnIhGMcuZY92qDK6dQauvA==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -1749,8 +1613,8 @@ packages: dev: true optional: true - /@esbuild/linux-loong64/0.15.11: - resolution: {integrity: sha512-geWp637tUhNmhL3Xgy4Bj703yXB9dqiLJe05lCUfjSFDrQf9C/8pArusyPUbUbPwlC/EAUjBw32sxuIl/11dZw==} + /@esbuild/linux-loong64/0.15.12: + resolution: {integrity: sha512-tZEowDjvU7O7I04GYvWQOS4yyP9E/7YlsB0jjw1Ycukgr2ycEzKyIk5tms5WnLBymaewc6VmRKnn5IJWgK4eFw==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -1838,15 +1702,15 @@ packages: slash: 3.0.0 dev: true - /@jest/console/29.2.0: - resolution: {integrity: sha512-Xz1Wu+ZZxcB3RS8U3HdkFxlRJ7kLXI/by9X7d2/gvseIWPwYu/c1EsYy77cB5iyyHGOy3whS2HycjcuzIF4Jow==} + /@jest/console/29.2.1: + resolution: {integrity: sha512-MF8Adcw+WPLZGBiNxn76DOuczG3BhODTcMlDCA4+cFi41OkaY/lyI0XUUhi73F88Y+7IHoGmD80pN5CtxQUdSw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.2.0 + '@jest/types': 29.2.1 '@types/node': 18.11.0 chalk: 4.1.2 - jest-message-util: 29.2.0 - jest-util: 29.2.0 + jest-message-util: 29.2.1 + jest-util: 29.2.1 slash: 3.0.0 dev: true @@ -1890,8 +1754,8 @@ packages: - utf-8-validate dev: true - /@jest/core/29.2.0_ts-node@10.9.1: - resolution: {integrity: sha512-+gyJ3bX+kGEW/eqt/0kI7fLjqiFr3AN8O+rlEl1fYRf7D8h4Sj4tBGo9YOSirvWgvemoH2EPRya35bgvcPFzHQ==} + /@jest/core/29.2.1_ts-node@10.9.1: + resolution: {integrity: sha512-kuLKYqnqgerXkBUwlHVxeSuhSnd+JMnMCLfU98bpacBSfWEJPegytDh3P2m15/JHzet32hGGld4KR4OzMb6/Tg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 @@ -1899,11 +1763,11 @@ packages: node-notifier: optional: true dependencies: - '@jest/console': 29.2.0 - '@jest/reporters': 29.2.0 - '@jest/test-result': 29.2.0 - '@jest/transform': 29.2.0 - '@jest/types': 29.2.0 + '@jest/console': 29.2.1 + '@jest/reporters': 29.2.1 + '@jest/test-result': 29.2.1 + '@jest/transform': 29.2.1 + '@jest/types': 29.2.1 '@types/node': 18.11.0 ansi-escapes: 4.3.2 chalk: 4.1.2 @@ -1911,20 +1775,20 @@ packages: exit: 0.1.2 graceful-fs: 4.2.10 jest-changed-files: 29.2.0 - jest-config: 29.2.0_pt3oab7md4pun52yk6ejrzjiwq - jest-haste-map: 29.2.0 - jest-message-util: 29.2.0 + jest-config: 29.2.1_pt3oab7md4pun52yk6ejrzjiwq + jest-haste-map: 29.2.1 + jest-message-util: 29.2.1 jest-regex-util: 29.2.0 - jest-resolve: 29.2.0 - jest-resolve-dependencies: 29.2.0 - jest-runner: 29.2.0 - jest-runtime: 29.2.0 - jest-snapshot: 29.2.0 - jest-util: 29.2.0 - jest-validate: 29.2.0 - jest-watcher: 29.2.0 + jest-resolve: 29.2.1 + jest-resolve-dependencies: 29.2.1 + jest-runner: 29.2.1 + jest-runtime: 29.2.1 + jest-snapshot: 29.2.1 + jest-util: 29.2.1 + jest-validate: 29.2.1 + jest-watcher: 29.2.1 micromatch: 4.0.5 - pretty-format: 29.2.0 + pretty-format: 29.2.1 slash: 3.0.0 strip-ansi: 6.0.1 transitivePeerDependencies: @@ -1942,29 +1806,29 @@ packages: jest-mock: 26.6.2 dev: true - /@jest/environment/29.2.0: - resolution: {integrity: sha512-foaVv1QVPB31Mno3LlL58PxEQQOLZd9zQfCpyQQCQIpUAtdFP1INBjkphxrCfKT13VxpA0z5jFGIkmZk0DAg2Q==} + /@jest/environment/29.2.1: + resolution: {integrity: sha512-EutqA7T/X6zFjw6mAWRHND+ZkTPklmIEWCNbmwX6uCmOrFrWaLbDZjA+gePHJx6fFMMRvNfjXcvzXEtz54KPlg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/fake-timers': 29.2.0 - '@jest/types': 29.2.0 + '@jest/fake-timers': 29.2.1 + '@jest/types': 29.2.1 '@types/node': 18.11.0 - jest-mock: 29.2.0 + jest-mock: 29.2.1 dev: true - /@jest/expect-utils/29.2.0: - resolution: {integrity: sha512-nz2IDF7nb1qmj9hx8Ja3MFab2q9Ml8QbOaaeJNyX5JQJHU8QUvEDiMctmhGEkk3Kzr8w8vAqz4hPk/ogJSrUhg==} + /@jest/expect-utils/29.2.1: + resolution: {integrity: sha512-yr4aHNg5Z1CjKby5ozm7sKjgBlCOorlAoFcvrOQ/4rbZRfgZQdnmh7cth192PYIgiPZo2bBXvqdOApnAMWFJZg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: jest-get-type: 29.2.0 dev: true - /@jest/expect/29.2.0: - resolution: {integrity: sha512-+3lxcYL9e0xPJGOR33utxxejn+Mulz40kY0oy0FVsmIESW87NZDJ7B1ovaIqeX0xIgPX4laS5SGlqD2uSoBMcw==} + /@jest/expect/29.2.1: + resolution: {integrity: sha512-o14R2t2tHHHudwji43UKkzmmH49xfF5T++FQBK2tl88qwuBWQOcx7fNUYl+mA/9TPNAN0FkQ3usnpyS8FUwsvQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - expect: 29.2.0 - jest-snapshot: 29.2.0 + expect: 29.2.1 + jest-snapshot: 29.2.1 transitivePeerDependencies: - supports-color dev: true @@ -1981,16 +1845,16 @@ packages: jest-util: 26.6.2 dev: true - /@jest/fake-timers/29.2.0: - resolution: {integrity: sha512-mX0V0uQsgeSLTt0yTqanAhhpeUKMGd2uq+PSLAfO40h72bvfNNQ7pIEl9vIwNMFxRih1ENveEjSBsLjxGGDPSw==} + /@jest/fake-timers/29.2.1: + resolution: {integrity: sha512-KWil+8fef7Uj/P/PTZlPKk1Pw117wAmr71VWFV8ZDtRtkwmTG8oY4IRf0Ss44J2y5CYRy8d/zLOhxyoGRENjvA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.2.0 + '@jest/types': 29.2.1 '@sinonjs/fake-timers': 9.1.2 '@types/node': 18.11.0 - jest-message-util: 29.2.0 - jest-mock: 29.2.0 - jest-util: 29.2.0 + jest-message-util: 29.2.1 + jest-mock: 29.2.1 + jest-util: 29.2.1 dev: true /@jest/globals/26.6.2: @@ -2002,14 +1866,14 @@ packages: expect: 26.6.2 dev: true - /@jest/globals/29.2.0: - resolution: {integrity: sha512-JQxtEVNWiai1p3PIzAJZSyEqQdAJGvNKvinZDPfu0mhiYEVx6E+PiBuDWj1sVUW8hzu+R3DVqaWC9K2xcLRIAA==} + /@jest/globals/29.2.1: + resolution: {integrity: sha512-Z4EejYPP1OPVq2abk1+9urAwJqkgw5jB2UJGlPjb5ZwzPQF8WLMcigKEfFzZb2OHhEVPP0RZD0/DbVTY1R6iQA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 29.2.0 - '@jest/expect': 29.2.0 - '@jest/types': 29.2.0 - jest-mock: 29.2.0 + '@jest/environment': 29.2.1 + '@jest/expect': 29.2.1 + '@jest/types': 29.2.1 + jest-mock: 29.2.1 transitivePeerDependencies: - supports-color dev: true @@ -2048,8 +1912,8 @@ packages: - supports-color dev: true - /@jest/reporters/29.2.0: - resolution: {integrity: sha512-BXoAJatxTZ18U0cwD7C8qBo8V6vef8AXYRBZdhqE5DF9CmpqmhMfw9c7OUvYqMTnBBK9A0NgXGO4Lc9EJzdHvw==} + /@jest/reporters/29.2.1: + resolution: {integrity: sha512-sCsfUKM/yIF4nNed3e/rIgVIS58EiASGMDEPWqItfLZ9UO1ALW2ASDNJzdWkxEt0T8o2Ztj619G0KKrvK+McAw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 @@ -2058,10 +1922,10 @@ packages: optional: true dependencies: '@bcoe/v8-coverage': 0.2.3 - '@jest/console': 29.2.0 - '@jest/test-result': 29.2.0 - '@jest/transform': 29.2.0 - '@jest/types': 29.2.0 + '@jest/console': 29.2.1 + '@jest/test-result': 29.2.1 + '@jest/transform': 29.2.1 + '@jest/types': 29.2.1 '@jridgewell/trace-mapping': 0.3.15 '@types/node': 18.11.0 chalk: 4.1.2 @@ -2074,9 +1938,9 @@ packages: istanbul-lib-report: 3.0.0 istanbul-lib-source-maps: 4.0.1 istanbul-reports: 3.1.5 - jest-message-util: 29.2.0 - jest-util: 29.2.0 - jest-worker: 29.2.0 + jest-message-util: 29.2.1 + jest-util: 29.2.1 + jest-worker: 29.2.1 slash: 3.0.0 string-length: 4.0.2 strip-ansi: 6.0.1 @@ -2120,12 +1984,12 @@ packages: collect-v8-coverage: 1.0.1 dev: true - /@jest/test-result/29.2.0: - resolution: {integrity: sha512-l76EPJ6QqtzsCLS4aimJqWO53pxZ82o3aE+Brcmo1HJ/phb9+MR7gPhyDdN6VSGaLJCRVJBZgWEhAEz+qON0Fw==} + /@jest/test-result/29.2.1: + resolution: {integrity: sha512-lS4+H+VkhbX6z64tZP7PAUwPqhwj3kbuEHcaLuaBuB+riyaX7oa1txe0tXgrFj5hRWvZKvqO7LZDlNWeJ7VTPA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/console': 29.2.0 - '@jest/types': 29.2.0 + '@jest/console': 29.2.1 + '@jest/types': 29.2.1 '@types/istanbul-lib-coverage': 2.0.4 collect-v8-coverage: 1.0.1 dev: true @@ -2147,13 +2011,13 @@ packages: - utf-8-validate dev: true - /@jest/test-sequencer/29.2.0: - resolution: {integrity: sha512-NCnjZcGnVdva6IDqF7TCuFsXs2F1tohiNF9sasSJNzD7VfN5ic9XgcS/oPDalGiPLxCmGKj4kewqqrKAqBACcQ==} + /@jest/test-sequencer/29.2.1: + resolution: {integrity: sha512-O/pnk0/xGj3lxPVNwB6HREJ7AYvUdyP2xo/s14/9Dtf091HoOeyIhWLKQE/4HzB8lNQBMo6J5mg0bHz/uCWK7w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/test-result': 29.2.0 + '@jest/test-result': 29.2.1 graceful-fs: 4.2.10 - jest-haste-map: 29.2.0 + jest-haste-map: 29.2.1 slash: 3.0.0 dev: true @@ -2180,21 +2044,21 @@ packages: - supports-color dev: true - /@jest/transform/29.2.0: - resolution: {integrity: sha512-NXMujGHy+B4DAj4dGnVPD0SIXlR2Z/N8Gp9h3mF66kcIRult1WWqY3/CEIrJcKviNWaFPYhZjCG2L3fteWzcUw==} + /@jest/transform/29.2.1: + resolution: {integrity: sha512-xup+iEuaIRSQabQaeqxaQyN0vg1Dctrp9oTObQsNf3sZEowTIa5cANYuoyi8Tqhg4GCqEVLTf18KW7ii0UeFVA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/core': 7.12.3 - '@jest/types': 29.2.0 + '@jest/types': 29.2.1 '@jridgewell/trace-mapping': 0.3.15 babel-plugin-istanbul: 6.1.1 chalk: 4.1.2 convert-source-map: 1.8.0 fast-json-stable-stringify: 2.1.0 graceful-fs: 4.2.10 - jest-haste-map: 29.2.0 + jest-haste-map: 29.2.1 jest-regex-util: 29.2.0 - jest-util: 29.2.0 + jest-util: 29.2.1 micromatch: 4.0.5 pirates: 4.0.5 slash: 3.0.0 @@ -2214,8 +2078,8 @@ packages: chalk: 4.1.2 dev: true - /@jest/types/29.2.0: - resolution: {integrity: sha512-mfgpQz4Z2xGo37m6KD8xEpKelaVzvYVRijmLPePn9pxgaPEtX+SqIyPNzzoeCPXKYbB4L/wYSgXDL8o3Gop78Q==} + /@jest/types/29.2.1: + resolution: {integrity: sha512-O/QNDQODLnINEPAI0cl9U6zUIDXEWXt6IC1o2N2QENuos7hlGUIthlKyV4p6ki3TvXFX071blj8HUhgLGquPjw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/schemas': 29.0.0 @@ -2641,8 +2505,8 @@ packages: '@types/trusted-types': 2.0.2 dev: true - /@types/eslint/8.4.6: - resolution: {integrity: sha512-/fqTbjxyFUaYNO7VcW5g+4npmqVACz1bB7RTHYuLj+PRjw9hrCwrUXVQFpChUS0JsyEFvMZ7U/PfmvWgxJhI9g==} + /@types/eslint/8.4.7: + resolution: {integrity: sha512-ehM7cCt2RSFs42mb+lcmhFT9ouIlV92PuaeRGn8N8c98oMjG4Z5pJHA9b1QiCcuqnbPSHcyfiD3mlhqMaHsQIw==} dependencies: '@types/estree': 1.0.0 '@types/json-schema': 7.0.11 @@ -2797,6 +2661,10 @@ packages: '@types/node': 18.11.0 dev: true + /@types/semver/7.3.12: + resolution: {integrity: sha512-WwA1MW0++RfXmCr12xeYOOC5baSC9mSb0ZqCquFzKhcoF4TvHu5MKOuXsncgZcpVFhB1pXd5hZmM0ryAoCp12A==} + dev: true + /@types/serve-static/1.15.0: resolution: {integrity: sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==} dependencies: @@ -2864,8 +2732,8 @@ packages: dev: true optional: true - /@typescript-eslint/eslint-plugin/5.40.0_25sstg4uu2sk4pm7xcyzuov7xq: - resolution: {integrity: sha512-FIBZgS3DVJgqPwJzvZTuH4HNsZhHMa9SjxTKAZTlMsPw/UzpEjcf9f4dfgDJEHjK+HboUJo123Eshl6niwEm/Q==} + /@typescript-eslint/eslint-plugin/5.40.1_ukgdydjtebaxmxfqp5v5ulh64y: + resolution: {integrity: sha512-FsWboKkWdytGiXT5O1/R9j37YgcjO8MKHSUmWnIEjVaz0krHkplPnYi7mwdb+5+cs0toFNQb0HIrN7zONdIEWg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: '@typescript-eslint/parser': ^5.0.0 @@ -2875,10 +2743,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.40.0_z4bbprzjrhnsfa24uvmcbu7f5q - '@typescript-eslint/scope-manager': 5.40.0 - '@typescript-eslint/type-utils': 5.40.0_z4bbprzjrhnsfa24uvmcbu7f5q - '@typescript-eslint/utils': 5.40.0_z4bbprzjrhnsfa24uvmcbu7f5q + '@typescript-eslint/parser': 5.40.1_z4bbprzjrhnsfa24uvmcbu7f5q + '@typescript-eslint/scope-manager': 5.40.1 + '@typescript-eslint/type-utils': 5.40.1_z4bbprzjrhnsfa24uvmcbu7f5q + '@typescript-eslint/utils': 5.40.1_z4bbprzjrhnsfa24uvmcbu7f5q debug: 4.3.4 eslint: 8.25.0 ignore: 5.2.0 @@ -2890,8 +2758,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.40.0_z4bbprzjrhnsfa24uvmcbu7f5q: - resolution: {integrity: sha512-Ah5gqyX2ySkiuYeOIDg7ap51/b63QgWZA7w6AHtFrag7aH0lRQPbLzUjk0c9o5/KZ6JRkTTDKShL4AUrQa6/hw==} + /@typescript-eslint/parser/5.40.1_z4bbprzjrhnsfa24uvmcbu7f5q: + resolution: {integrity: sha512-IK6x55va5w4YvXd4b3VrXQPldV9vQTxi5ov+g4pMANsXPTXOcfjx08CRR1Dfrcc51syPtXHF5bgLlMHYFrvQtg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -2900,9 +2768,9 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.40.0 - '@typescript-eslint/types': 5.40.0 - '@typescript-eslint/typescript-estree': 5.40.0_typescript@4.8.4 + '@typescript-eslint/scope-manager': 5.40.1 + '@typescript-eslint/types': 5.40.1 + '@typescript-eslint/typescript-estree': 5.40.1_typescript@4.8.4 debug: 4.3.4 eslint: 8.25.0 typescript: 4.8.4 @@ -2910,16 +2778,16 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager/5.40.0: - resolution: {integrity: sha512-d3nPmjUeZtEWRvyReMI4I1MwPGC63E8pDoHy0BnrYjnJgilBD3hv7XOiETKLY/zTwI7kCnBDf2vWTRUVpYw0Uw==} + /@typescript-eslint/scope-manager/5.40.1: + resolution: {integrity: sha512-jkn4xsJiUQucI16OLCXrLRXDZ3afKhOIqXs4R3O+M00hdQLKR58WuyXPZZjhKLFCEP2g+TXdBRtLQ33UfAdRUg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.40.0 - '@typescript-eslint/visitor-keys': 5.40.0 + '@typescript-eslint/types': 5.40.1 + '@typescript-eslint/visitor-keys': 5.40.1 dev: true - /@typescript-eslint/type-utils/5.40.0_z4bbprzjrhnsfa24uvmcbu7f5q: - resolution: {integrity: sha512-nfuSdKEZY2TpnPz5covjJqav+g5qeBqwSHKBvz7Vm1SAfy93SwKk/JeSTymruDGItTwNijSsno5LhOHRS1pcfw==} + /@typescript-eslint/type-utils/5.40.1_z4bbprzjrhnsfa24uvmcbu7f5q: + resolution: {integrity: sha512-DLAs+AHQOe6n5LRraXiv27IYPhleF0ldEmx6yBqBgBLaNRKTkffhV1RPsjoJBhVup2zHxfaRtan8/YRBgYhU9Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: '*' @@ -2928,8 +2796,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.40.0_typescript@4.8.4 - '@typescript-eslint/utils': 5.40.0_z4bbprzjrhnsfa24uvmcbu7f5q + '@typescript-eslint/typescript-estree': 5.40.1_typescript@4.8.4 + '@typescript-eslint/utils': 5.40.1_z4bbprzjrhnsfa24uvmcbu7f5q debug: 4.3.4 eslint: 8.25.0 tsutils: 3.21.0_typescript@4.8.4 @@ -2938,13 +2806,13 @@ packages: - supports-color dev: true - /@typescript-eslint/types/5.40.0: - resolution: {integrity: sha512-V1KdQRTXsYpf1Y1fXCeZ+uhjW48Niiw0VGt4V8yzuaDTU8Z1Xl7yQDyQNqyAFcVhpYXIVCEuxSIWTsLDpHgTbw==} + /@typescript-eslint/types/5.40.1: + resolution: {integrity: sha512-Icg9kiuVJSwdzSQvtdGspOlWNjVDnF3qVIKXdJ103o36yRprdl3Ge5cABQx+csx960nuMF21v8qvO31v9t3OHw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree/5.40.0_typescript@4.8.4: - resolution: {integrity: sha512-b0GYlDj8TLTOqwX7EGbw2gL5EXS2CPEWhF9nGJiGmEcmlpNBjyHsTwbqpyIEPVpl6br4UcBOYlcI2FJVtJkYhg==} + /@typescript-eslint/typescript-estree/5.40.1_typescript@4.8.4: + resolution: {integrity: sha512-5QTP/nW5+60jBcEPfXy/EZL01qrl9GZtbgDZtDPlfW5zj/zjNrdI2B5zMUHmOsfvOr2cWqwVdWjobCiHcedmQA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: typescript: '*' @@ -2952,42 +2820,43 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.40.0 - '@typescript-eslint/visitor-keys': 5.40.0 + '@typescript-eslint/types': 5.40.1 + '@typescript-eslint/visitor-keys': 5.40.1 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.3.7 + semver: 7.3.8 tsutils: 3.21.0_typescript@4.8.4 typescript: 4.8.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils/5.40.0_z4bbprzjrhnsfa24uvmcbu7f5q: - resolution: {integrity: sha512-MO0y3T5BQ5+tkkuYZJBjePewsY+cQnfkYeRqS6tPh28niiIwPnQ1t59CSRcs1ZwJJNOdWw7rv9pF8aP58IMihA==} + /@typescript-eslint/utils/5.40.1_z4bbprzjrhnsfa24uvmcbu7f5q: + resolution: {integrity: sha512-a2TAVScoX9fjryNrW6BZRnreDUszxqm9eQ9Esv8n5nXApMW0zeANUYlwh/DED04SC/ifuBvXgZpIK5xeJHQ3aw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: '@types/json-schema': 7.0.11 - '@typescript-eslint/scope-manager': 5.40.0 - '@typescript-eslint/types': 5.40.0 - '@typescript-eslint/typescript-estree': 5.40.0_typescript@4.8.4 + '@types/semver': 7.3.12 + '@typescript-eslint/scope-manager': 5.40.1 + '@typescript-eslint/types': 5.40.1 + '@typescript-eslint/typescript-estree': 5.40.1_typescript@4.8.4 eslint: 8.25.0 eslint-scope: 5.1.1 eslint-utils: 3.0.0_eslint@8.25.0 - semver: 7.3.7 + semver: 7.3.8 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/visitor-keys/5.40.0: - resolution: {integrity: sha512-ijJ+6yig+x9XplEpG2K6FUdJeQGGj/15U3S56W9IqXKJqleuD7zJ2AX/miLezwxpd7ZxDAqO87zWufKg+RPZyQ==} + /@typescript-eslint/visitor-keys/5.40.1: + resolution: {integrity: sha512-A2DGmeZ+FMja0geX5rww+DpvILpwo1OsiQs0M+joPWJYsiEFBLsH0y1oFymPNul6Z5okSmHpP4ivkc2N0Cgfkw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.40.0 + '@typescript-eslint/types': 5.40.1 eslint-visitor-keys: 3.3.0 dev: true @@ -3328,17 +3197,6 @@ packages: - supports-color dev: true - /agentkeepalive/4.2.1: - resolution: {integrity: sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==} - engines: {node: '>= 8.0.0'} - dependencies: - debug: 4.3.4 - depd: 1.1.2 - humanize-ms: 1.2.1 - transitivePeerDependencies: - - supports-color - dev: true - /aggregate-error/3.1.0: resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} engines: {node: '>=8'} @@ -3614,14 +3472,6 @@ packages: - debug dev: true - /axios/0.26.0: - resolution: {integrity: sha512-lKoGLMYtHvFrPVt3r+RBMp9nh34N0M8zEfCWqdWZx6phynIEhQqAdydpyBAAG211zlhX9Rgu08cOamy6XjE5Og==} - dependencies: - follow-redirects: 1.15.2_debug@4.3.2 - transitivePeerDependencies: - - debug - dev: true - /babel-jest/26.6.3_@babel+core@7.12.3: resolution: {integrity: sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA==} engines: {node: '>= 10.14.2'} @@ -3641,14 +3491,14 @@ packages: - supports-color dev: true - /babel-jest/29.2.0_@babel+core@7.12.3: - resolution: {integrity: sha512-c8FkrW1chgcbyBqOo7jFGpQYfVnb43JqjQGV+C2r94k2rZJOukYOZ6+csAqKE4ms+PHc+yevnONxs27jQIxylw==} + /babel-jest/29.2.1_@babel+core@7.12.3: + resolution: {integrity: sha512-gQJwArok0mqoREiCYhXKWOgUhElJj9DpnssW6GL8dG7ARYqHEhrM9fmPHTjdqEGRVXZAd6+imo3/Vwa8TjLcsw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.8.0 dependencies: '@babel/core': 7.12.3 - '@jest/transform': 29.2.0 + '@jest/transform': 29.2.1 '@types/babel__core': 7.1.19 babel-plugin-istanbul: 6.1.1 babel-preset-jest: 29.2.0_@babel+core@7.12.3 @@ -4835,7 +4685,7 @@ packages: resolution: {integrity: sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==} dev: true - /cypress-image-snapshot/4.0.1_sldctbhq72okzn4urvbivac6lq: + /cypress-image-snapshot/4.0.1_i53o2fh6a5o5tv3qlenzwcubc4: resolution: {integrity: sha512-PBpnhX/XItlx3/DAk5ozsXQHUi72exybBNH5Mpqj1DVmjq+S5Jd9WE5CRa4q5q0zuMZb2V2VpXHth6MjFpgj9Q==} engines: {node: '>=8'} peerDependencies: @@ -4845,7 +4695,7 @@ packages: cypress: 10.10.0 fs-extra: 7.0.1 glob: 7.2.3 - jest-image-snapshot: 4.2.0_jest@29.2.0 + jest-image-snapshot: 4.2.0_jest@29.2.1 pkg-dir: 3.0.0 term-img: 4.1.0 transitivePeerDependencies: @@ -5414,11 +5264,6 @@ packages: engines: {node: '>=0.4.0'} dev: true - /depd/1.1.2: - resolution: {integrity: sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==} - engines: {node: '>= 0.6'} - dev: true - /depd/2.0.0: resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} engines: {node: '>= 0.8'} @@ -5712,8 +5557,8 @@ packages: string-template: 0.2.1 dev: true - /esbuild-android-64/0.15.11: - resolution: {integrity: sha512-rrwoXEiuI1kaw4k475NJpexs8GfJqQUKcD08VR8sKHmuW9RUuTR2VxcupVvHdiGh9ihxL9m3lpqB1kju92Ialw==} + /esbuild-android-64/0.15.12: + resolution: {integrity: sha512-MJKXwvPY9g0rGps0+U65HlTsM1wUs9lbjt5CU19RESqycGFDRijMDQsh68MtbzkqWSRdEtiKS1mtPzKneaAI0Q==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -5721,8 +5566,8 @@ packages: dev: true optional: true - /esbuild-android-arm64/0.15.11: - resolution: {integrity: sha512-/hDubOg7BHOhUUsT8KUIU7GfZm5bihqssvqK5PfO4apag7YuObZRZSzViyEKcFn2tPeHx7RKbSBXvAopSHDZJQ==} + /esbuild-android-arm64/0.15.12: + resolution: {integrity: sha512-Hc9SEcZbIMhhLcvhr1DH+lrrec9SFTiRzfJ7EGSBZiiw994gfkVV6vG0sLWqQQ6DD7V4+OggB+Hn0IRUdDUqvA==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -5730,8 +5575,8 @@ packages: dev: true optional: true - /esbuild-darwin-64/0.15.11: - resolution: {integrity: sha512-1DqHD0ms3AhiwkKnjRUzmiW7JnaJJr5FKrPiR7xuyMwnjDqvNWDdMq4rKSD9OC0piFNK6n0LghsglNMe2MwJtA==} + /esbuild-darwin-64/0.15.12: + resolution: {integrity: sha512-qkmqrTVYPFiePt5qFjP8w/S+GIUMbt6k8qmiPraECUWfPptaPJUGkCKrWEfYFRWB7bY23FV95rhvPyh/KARP8Q==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -5739,8 +5584,8 @@ packages: dev: true optional: true - /esbuild-darwin-arm64/0.15.11: - resolution: {integrity: sha512-OMzhxSbS0lwwrW40HHjRCeVIJTURdXFA8c3GU30MlHKuPCcvWNUIKVucVBtNpJySXmbkQMDJdJNrXzNDyvoqvQ==} + /esbuild-darwin-arm64/0.15.12: + resolution: {integrity: sha512-z4zPX02tQ41kcXMyN3c/GfZpIjKoI/BzHrdKUwhC/Ki5BAhWv59A9M8H+iqaRbwpzYrYidTybBwiZAIWCLJAkw==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -5748,8 +5593,8 @@ packages: dev: true optional: true - /esbuild-freebsd-64/0.15.11: - resolution: {integrity: sha512-8dKP26r0/Qyez8nTCwpq60QbuYKOeBygdgOAWGCRalunyeqWRoSZj9TQjPDnTTI9joxd3QYw3UhVZTKxO9QdRg==} + /esbuild-freebsd-64/0.15.12: + resolution: {integrity: sha512-XFL7gKMCKXLDiAiBjhLG0XECliXaRLTZh6hsyzqUqPUf/PY4C6EJDTKIeqqPKXaVJ8+fzNek88285krSz1QECw==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -5757,8 +5602,8 @@ packages: dev: true optional: true - /esbuild-freebsd-arm64/0.15.11: - resolution: {integrity: sha512-aSGiODiukLGGnSg/O9+cGO2QxEacrdCtCawehkWYTt5VX1ni2b9KoxpHCT9h9Y6wGqNHmXFnB47RRJ8BIqZgmQ==} + /esbuild-freebsd-arm64/0.15.12: + resolution: {integrity: sha512-jwEIu5UCUk6TjiG1X+KQnCGISI+ILnXzIzt9yDVrhjug2fkYzlLbl0K43q96Q3KB66v6N1UFF0r5Ks4Xo7i72g==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -5766,8 +5611,8 @@ packages: dev: true optional: true - /esbuild-linux-32/0.15.11: - resolution: {integrity: sha512-lsrAfdyJBGx+6aHIQmgqUonEzKYeBnyfJPkT6N2dOf1RoXYYV1BkWB6G02tjsrz1d5wZzaTc3cF+TKmuTo/ZwA==} + /esbuild-linux-32/0.15.12: + resolution: {integrity: sha512-uSQuSEyF1kVzGzuIr4XM+v7TPKxHjBnLcwv2yPyCz8riV8VUCnO/C4BF3w5dHiVpCd5Z1cebBtZJNlC4anWpwA==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -5775,8 +5620,8 @@ packages: dev: true optional: true - /esbuild-linux-64/0.15.11: - resolution: {integrity: sha512-Y2Rh+PcyVhQqXKBTacPCltINN3uIw2xC+dsvLANJ1SpK5NJUtxv8+rqWpjmBgaNWKQT1/uGpMmA9olALy9PLVA==} + /esbuild-linux-64/0.15.12: + resolution: {integrity: sha512-QcgCKb7zfJxqT9o5z9ZUeGH1k8N6iX1Y7VNsEi5F9+HzN1OIx7ESxtQXDN9jbeUSPiRH1n9cw6gFT3H4qbdvcA==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -5784,8 +5629,8 @@ packages: dev: true optional: true - /esbuild-linux-arm/0.15.11: - resolution: {integrity: sha512-TJllTVk5aSyqPFvvcHTvf6Wu1ZKhWpJ/qNmZO8LL/XeB+LXCclm7HQHNEIz6MT7IX8PmlC1BZYrOiw2sXSB95A==} + /esbuild-linux-arm/0.15.12: + resolution: {integrity: sha512-Wf7T0aNylGcLu7hBnzMvsTfEXdEdJY/hY3u36Vla21aY66xR0MS5I1Hw8nVquXjTN0A6fk/vnr32tkC/C2lb0A==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -5793,8 +5638,8 @@ packages: dev: true optional: true - /esbuild-linux-arm64/0.15.11: - resolution: {integrity: sha512-uhcXiTwTmD4OpxJu3xC5TzAAw6Wzf9O1XGWL448EE9bqGjgV1j+oK3lIHAfsHnuIn8K4nDW8yjX0Sv5S++oRuw==} + /esbuild-linux-arm64/0.15.12: + resolution: {integrity: sha512-HtNq5xm8fUpZKwWKS2/YGwSfTF+339L4aIA8yphNKYJckd5hVdhfdl6GM2P3HwLSCORS++++7++//ApEwXEuAQ==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -5802,8 +5647,8 @@ packages: dev: true optional: true - /esbuild-linux-mips64le/0.15.11: - resolution: {integrity: sha512-WD61y/R1M4BLe4gxXRypoQ0Ci+Vjf714QYzcPNkiYv5I8K8WDz2ZR8Bm6cqKxd6rD+e/rZgPDbhQ9PCf7TMHmA==} + /esbuild-linux-mips64le/0.15.12: + resolution: {integrity: sha512-Qol3+AvivngUZkTVFgLpb0H6DT+N5/zM3V1YgTkryPYFeUvuT5JFNDR3ZiS6LxhyF8EE+fiNtzwlPqMDqVcc6A==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -5811,8 +5656,8 @@ packages: dev: true optional: true - /esbuild-linux-ppc64le/0.15.11: - resolution: {integrity: sha512-JVleZS9oPVLTlBhPTWgOwxFWU/wMUdlBwTbGA4GF8c38sLbS13cupj+C8bLq929jU7EMWry4SaL+tKGIaTlqKg==} + /esbuild-linux-ppc64le/0.15.12: + resolution: {integrity: sha512-4D8qUCo+CFKaR0cGXtGyVsOI7w7k93Qxb3KFXWr75An0DHamYzq8lt7TNZKoOq/Gh8c40/aKaxvcZnTgQ0TJNg==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -5820,8 +5665,8 @@ packages: dev: true optional: true - /esbuild-linux-riscv64/0.15.11: - resolution: {integrity: sha512-9aLIalZ2HFHIOZpmVU11sEAS9F8TnHw49daEjcgMpBXHFF57VuT9f9/9LKJhw781Gda0P9jDkuCWJ0tFbErvJw==} + /esbuild-linux-riscv64/0.15.12: + resolution: {integrity: sha512-G9w6NcuuCI6TUUxe6ka0enjZHDnSVK8bO+1qDhMOCtl7Tr78CcZilJj8SGLN00zO5iIlwNRZKHjdMpfFgNn1VA==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -5829,8 +5674,8 @@ packages: dev: true optional: true - /esbuild-linux-s390x/0.15.11: - resolution: {integrity: sha512-sZHtiXXOKsLI3XGBGoYO4qKBzJlb8xNsWmvFiwFMHFzA4AXgDP1KDp7Dawe9C2pavTRBDvl+Ok4n/DHQ59oaTg==} + /esbuild-linux-s390x/0.15.12: + resolution: {integrity: sha512-Lt6BDnuXbXeqSlVuuUM5z18GkJAZf3ERskGZbAWjrQoi9xbEIsj/hEzVnSAFLtkfLuy2DE4RwTcX02tZFunXww==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -5838,8 +5683,8 @@ packages: dev: true optional: true - /esbuild-netbsd-64/0.15.11: - resolution: {integrity: sha512-hUC9yN06K9sg7ju4Vgu9ChAPdsEgtcrcLfyNT5IKwKyfpLvKUwCMZSdF+gRD3WpyZelgTQfJ+pDx5XFbXTlB0A==} + /esbuild-netbsd-64/0.15.12: + resolution: {integrity: sha512-jlUxCiHO1dsqoURZDQts+HK100o0hXfi4t54MNRMCAqKGAV33JCVvMplLAa2FwviSojT/5ZG5HUfG3gstwAG8w==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -5847,8 +5692,8 @@ packages: dev: true optional: true - /esbuild-openbsd-64/0.15.11: - resolution: {integrity: sha512-0bBo9SQR4t66Wd91LGMAqmWorzO0TTzVjYiifwoFtel8luFeXuPThQnEm5ztN4g0fnvcp7AnUPPzS/Depf17wQ==} + /esbuild-openbsd-64/0.15.12: + resolution: {integrity: sha512-1o1uAfRTMIWNOmpf8v7iudND0L6zRBYSH45sofCZywrcf7NcZA+c7aFsS1YryU+yN7aRppTqdUK1PgbZVaB1Dw==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -5856,8 +5701,8 @@ packages: dev: true optional: true - /esbuild-sunos-64/0.15.11: - resolution: {integrity: sha512-EuBdTGlsMTjEl1sQnBX2jfygy7iR6CKfvOzi+gEOfhDqbHXsmY1dcpbVtcwHAg9/2yUZSfMJHMAgf1z8M4yyyw==} + /esbuild-sunos-64/0.15.12: + resolution: {integrity: sha512-nkl251DpoWoBO9Eq9aFdoIt2yYmp4I3kvQjba3jFKlMXuqQ9A4q+JaqdkCouG3DHgAGnzshzaGu6xofGcXyPXg==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -5865,8 +5710,8 @@ packages: dev: true optional: true - /esbuild-windows-32/0.15.11: - resolution: {integrity: sha512-O0/Wo1Wk6dc0rZSxkvGpmTNIycEznHmkObTFz2VHBhjPsO4ZpCgfGxNkCpz4AdAIeMczpTXt/8d5vdJNKEGC+Q==} + /esbuild-windows-32/0.15.12: + resolution: {integrity: sha512-WlGeBZHgPC00O08luIp5B2SP4cNCp/PcS+3Pcg31kdcJPopHxLkdCXtadLU9J82LCfw4TVls21A6lilQ9mzHrw==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -5874,8 +5719,8 @@ packages: dev: true optional: true - /esbuild-windows-64/0.15.11: - resolution: {integrity: sha512-x977Q4HhNjnHx00b4XLAnTtj5vfbdEvkxaQwC1Zh5AN8g5EX+izgZ6e5QgqJgpzyRNJqh4hkgIJF1pyy1be0mQ==} + /esbuild-windows-64/0.15.12: + resolution: {integrity: sha512-VActO3WnWZSN//xjSfbiGOSyC+wkZtI8I4KlgrTo5oHJM6z3MZZBCuFaZHd8hzf/W9KPhF0lY8OqlmWC9HO5AA==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -5883,8 +5728,8 @@ packages: dev: true optional: true - /esbuild-windows-arm64/0.15.11: - resolution: {integrity: sha512-VwUHFACuBahrvntdcMKZteUZ9HaYrBRODoKe4tIWxguQRvvYoYb7iu5LrcRS/FQx8KPZNaa72zuqwVtHeXsITw==} + /esbuild-windows-arm64/0.15.12: + resolution: {integrity: sha512-Of3MIacva1OK/m4zCNIvBfz8VVROBmQT+gRX6pFTLPngFYcj6TFH/12VveAqq1k9VB2l28EoVMNMUCcmsfwyuA==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -5892,34 +5737,34 @@ packages: dev: true optional: true - /esbuild/0.15.11: - resolution: {integrity: sha512-OgHGuhlfZ//mToxjte1D5iiiQgWfJ2GByVMwEC/IuoXsBGkuyK1+KrjYu0laSpnN/L1UmLUCv0s25vObdc1bVg==} + /esbuild/0.15.12: + resolution: {integrity: sha512-PcT+/wyDqJQsRVhaE9uX/Oq4XLrFh0ce/bs2TJh4CSaw9xuvI+xFrH2nAYOADbhQjUgAhNWC5LKoUsakm4dxng==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.15.11 - '@esbuild/linux-loong64': 0.15.11 - esbuild-android-64: 0.15.11 - esbuild-android-arm64: 0.15.11 - esbuild-darwin-64: 0.15.11 - esbuild-darwin-arm64: 0.15.11 - esbuild-freebsd-64: 0.15.11 - esbuild-freebsd-arm64: 0.15.11 - esbuild-linux-32: 0.15.11 - esbuild-linux-64: 0.15.11 - esbuild-linux-arm: 0.15.11 - esbuild-linux-arm64: 0.15.11 - esbuild-linux-mips64le: 0.15.11 - esbuild-linux-ppc64le: 0.15.11 - esbuild-linux-riscv64: 0.15.11 - esbuild-linux-s390x: 0.15.11 - esbuild-netbsd-64: 0.15.11 - esbuild-openbsd-64: 0.15.11 - esbuild-sunos-64: 0.15.11 - esbuild-windows-32: 0.15.11 - esbuild-windows-64: 0.15.11 - esbuild-windows-arm64: 0.15.11 + '@esbuild/android-arm': 0.15.12 + '@esbuild/linux-loong64': 0.15.12 + esbuild-android-64: 0.15.12 + esbuild-android-arm64: 0.15.12 + esbuild-darwin-64: 0.15.12 + esbuild-darwin-arm64: 0.15.12 + esbuild-freebsd-64: 0.15.12 + esbuild-freebsd-arm64: 0.15.12 + esbuild-linux-32: 0.15.12 + esbuild-linux-64: 0.15.12 + esbuild-linux-arm: 0.15.12 + esbuild-linux-arm64: 0.15.12 + esbuild-linux-mips64le: 0.15.12 + esbuild-linux-ppc64le: 0.15.12 + esbuild-linux-riscv64: 0.15.12 + esbuild-linux-s390x: 0.15.12 + esbuild-netbsd-64: 0.15.12 + esbuild-openbsd-64: 0.15.12 + esbuild-sunos-64: 0.15.12 + esbuild-windows-32: 0.15.12 + esbuild-windows-64: 0.15.12 + esbuild-windows-arm64: 0.15.12 dev: true /escalade/3.1.1: @@ -6008,8 +5853,8 @@ packages: htmlparser2: 8.0.1 dev: true - /eslint-plugin-jest/27.1.2_37sgn6sqs6ms4ljiz35av2ikje: - resolution: {integrity: sha512-+nLOn5jvQKLUywXxXKsLuuENsB/FhygXOLI+l5QlF+ACGe0DM14FlpYrGZ4nEiTo0BGlL5MymG73XA/tC3v3fA==} + /eslint-plugin-jest/27.1.3_ktuq5bhtjfperqqn2aknj5bg6m: + resolution: {integrity: sha512-7DrIfYRQPa7JQd1Le8G/BJsfYHVUKQdJQ/6vULSp/4NjKZmSMJ/605G2hhScEra++SiH68zPEjLnrO74nHrMLg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@typescript-eslint/eslint-plugin': ^5.0.0 @@ -6021,8 +5866,30 @@ packages: jest: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 5.40.0_25sstg4uu2sk4pm7xcyzuov7xq - '@typescript-eslint/utils': 5.40.0_z4bbprzjrhnsfa24uvmcbu7f5q + '@typescript-eslint/eslint-plugin': 5.40.1_ukgdydjtebaxmxfqp5v5ulh64y + '@typescript-eslint/utils': 5.40.1_z4bbprzjrhnsfa24uvmcbu7f5q + eslint: 8.25.0 + jest: 29.2.1_pt3oab7md4pun52yk6ejrzjiwq + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /eslint-plugin-jest/27.1.3_pubrigz2e5aqv2qdhrj3u7msey: + resolution: {integrity: sha512-7DrIfYRQPa7JQd1Le8G/BJsfYHVUKQdJQ/6vULSp/4NjKZmSMJ/605G2hhScEra++SiH68zPEjLnrO74nHrMLg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@typescript-eslint/eslint-plugin': ^5.0.0 + eslint: ^7.0.0 || ^8.0.0 + jest: '*' + peerDependenciesMeta: + '@typescript-eslint/eslint-plugin': + optional: true + jest: + optional: true + dependencies: + '@typescript-eslint/eslint-plugin': 5.40.1_ukgdydjtebaxmxfqp5v5ulh64y + '@typescript-eslint/utils': 5.40.1_z4bbprzjrhnsfa24uvmcbu7f5q eslint: 8.25.0 jest: 26.6.3_ts-node@10.9.1 transitivePeerDependencies: @@ -6030,41 +5897,19 @@ packages: - typescript dev: true - /eslint-plugin-jest/27.1.2_nc3c3bdiyy2hxtl32wv7esmvmq: - resolution: {integrity: sha512-+nLOn5jvQKLUywXxXKsLuuENsB/FhygXOLI+l5QlF+ACGe0DM14FlpYrGZ4nEiTo0BGlL5MymG73XA/tC3v3fA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@typescript-eslint/eslint-plugin': ^5.0.0 - eslint: ^7.0.0 || ^8.0.0 - jest: '*' - peerDependenciesMeta: - '@typescript-eslint/eslint-plugin': - optional: true - jest: - optional: true - dependencies: - '@typescript-eslint/eslint-plugin': 5.40.0_25sstg4uu2sk4pm7xcyzuov7xq - '@typescript-eslint/utils': 5.40.0_z4bbprzjrhnsfa24uvmcbu7f5q - eslint: 8.25.0 - jest: 29.2.0_pt3oab7md4pun52yk6ejrzjiwq - transitivePeerDependencies: - - supports-color - - typescript - dev: true - - /eslint-plugin-jsdoc/39.3.6_eslint@8.25.0: - resolution: {integrity: sha512-R6dZ4t83qPdMhIOGr7g2QII2pwCjYyKP+z0tPOfO1bbAbQyKC20Y2Rd6z1te86Lq3T7uM8bNo+VD9YFpE8HU/g==} - engines: {node: ^14 || ^16 || ^17 || ^18} + /eslint-plugin-jsdoc/39.3.23_eslint@8.25.0: + resolution: {integrity: sha512-ZwutuEmsdz8sj9fCXz4r/4x3uZ4qrB6+ca3rIyH3HHEEj5t6xgOSBWIj8IkxZkBUKvoadWHM6iCPzkmXgPHpsA==} + engines: {node: ^14 || ^16 || ^17 || ^18 || ^19} peerDependencies: eslint: ^7.0.0 || ^8.0.0 dependencies: - '@es-joy/jsdoccomment': 0.31.0 + '@es-joy/jsdoccomment': 0.33.0 comment-parser: 1.3.1 debug: 4.3.4 escape-string-regexp: 4.0.0 eslint: 8.25.0 esquery: 1.4.0 - semver: 7.3.7 + semver: 7.3.8 spdx-expression-parse: 3.0.1 transitivePeerDependencies: - supports-color @@ -6376,15 +6221,15 @@ packages: jest-regex-util: 26.0.0 dev: true - /expect/29.2.0: - resolution: {integrity: sha512-03ClF3GWwUqd9Grgkr9ZSdaCJGMRA69PQ8jT7o+Bx100VlGiAFf9/8oIm9Qve7ZVJhuJxFftqFhviZJRxxNfvg==} + /expect/29.2.1: + resolution: {integrity: sha512-BJtA754Fba0YWRWHgjKUMTA3ltWarKgITXHQnbZ2mTxTXC4yMQlR0FI7HkB3fJYkhWBf4qjNiqvg3LDtXCcVRQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/expect-utils': 29.2.0 + '@jest/expect-utils': 29.2.1 jest-get-type: 29.2.0 - jest-matcher-utils: 29.2.0 - jest-message-util: 29.2.0 - jest-util: 29.2.0 + jest-matcher-utils: 29.2.1 + jest-message-util: 29.2.1 + jest-util: 29.2.1 dev: true /express/4.18.2: @@ -7419,12 +7264,6 @@ packages: engines: {node: '>=12.20.0'} dev: true - /humanize-ms/1.2.1: - resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} - dependencies: - ms: 2.1.3 - dev: true - /husky/8.0.1: resolution: {integrity: sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw==} engines: {node: '>=14'} @@ -7941,27 +7780,27 @@ packages: p-limit: 3.1.0 dev: true - /jest-circus/29.2.0: - resolution: {integrity: sha512-bpJRMe+VtvYlF3q8JNx+/cAo4FYvNCiR5s7Z0Scf8aC+KJ2ineSjZKtw1cIZbythlplkiro0My8nc65pfCqJ3A==} + /jest-circus/29.2.1: + resolution: {integrity: sha512-W+ZQQ5ln4Db2UZNM4NJIeasnhCdDhSuYW4eLgNAUi0XiSSpF634Kc5wiPvGiHvTgXMFVn1ZgWIijqhi9+kLNLg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 29.2.0 - '@jest/expect': 29.2.0 - '@jest/test-result': 29.2.0 - '@jest/types': 29.2.0 + '@jest/environment': 29.2.1 + '@jest/expect': 29.2.1 + '@jest/test-result': 29.2.1 + '@jest/types': 29.2.1 '@types/node': 18.11.0 chalk: 4.1.2 co: 4.6.0 dedent: 0.7.0 is-generator-fn: 2.1.0 - jest-each: 29.2.0 - jest-matcher-utils: 29.2.0 - jest-message-util: 29.2.0 - jest-runtime: 29.2.0 - jest-snapshot: 29.2.0 - jest-util: 29.2.0 + jest-each: 29.2.1 + jest-matcher-utils: 29.2.1 + jest-message-util: 29.2.1 + jest-runtime: 29.2.1 + jest-snapshot: 29.2.1 + jest-util: 29.2.1 p-limit: 3.1.0 - pretty-format: 29.2.0 + pretty-format: 29.2.1 slash: 3.0.0 stack-utils: 2.0.5 transitivePeerDependencies: @@ -7994,8 +7833,8 @@ packages: - utf-8-validate dev: true - /jest-cli/29.2.0_pt3oab7md4pun52yk6ejrzjiwq: - resolution: {integrity: sha512-/581TzbXeO+5kbtSlhXEthGiVJCC8AP0jgT0iZINAAMW+tTFj2uWU7z+HNUH5yIYdHV7AvRr0fWLrmHJGIruHg==} + /jest-cli/29.2.1_pt3oab7md4pun52yk6ejrzjiwq: + resolution: {integrity: sha512-UIMD5aNqvPKpdlJSaeUAoLfxsh9TZvOkaMETx5qXnkboc317bcbb0eLHbIj8sFBHdcJAIAM+IRKnIU7Wi61MBw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true peerDependencies: @@ -8004,16 +7843,16 @@ packages: node-notifier: optional: true dependencies: - '@jest/core': 29.2.0_ts-node@10.9.1 - '@jest/test-result': 29.2.0 - '@jest/types': 29.2.0 + '@jest/core': 29.2.1_ts-node@10.9.1 + '@jest/test-result': 29.2.1 + '@jest/types': 29.2.1 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.10 import-local: 3.1.0 - jest-config: 29.2.0_pt3oab7md4pun52yk6ejrzjiwq - jest-util: 29.2.0 - jest-validate: 29.2.0 + jest-config: 29.2.1_pt3oab7md4pun52yk6ejrzjiwq + jest-util: 29.2.1 + jest-validate: 29.2.1 prompts: 2.4.2 yargs: 17.5.1 transitivePeerDependencies: @@ -8057,8 +7896,8 @@ packages: - utf-8-validate dev: true - /jest-config/29.2.0_pt3oab7md4pun52yk6ejrzjiwq: - resolution: {integrity: sha512-IkdCsrHIoxDPZAyFcdtQrCQ3uftLqns6Joj0tlbxiAQW4k/zTXmIygqWBmPNxO9FbFkDrhtYZiLHXjaJh9rS+Q==} + /jest-config/29.2.1_pt3oab7md4pun52yk6ejrzjiwq: + resolution: {integrity: sha512-EV5F1tQYW/quZV2br2o88hnYEeRzG53Dfi6rSG3TZBuzGQ6luhQBux/RLlU5QrJjCdq3LXxRRM8F1LP6DN1ycA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@types/node': '*' @@ -8070,26 +7909,26 @@ packages: optional: true dependencies: '@babel/core': 7.12.3 - '@jest/test-sequencer': 29.2.0 - '@jest/types': 29.2.0 + '@jest/test-sequencer': 29.2.1 + '@jest/types': 29.2.1 '@types/node': 18.11.0 - babel-jest: 29.2.0_@babel+core@7.12.3 + babel-jest: 29.2.1_@babel+core@7.12.3 chalk: 4.1.2 ci-info: 3.4.0 deepmerge: 4.2.2 glob: 7.2.3 graceful-fs: 4.2.10 - jest-circus: 29.2.0 - jest-environment-node: 29.2.0 + jest-circus: 29.2.1 + jest-environment-node: 29.2.1 jest-get-type: 29.2.0 jest-regex-util: 29.2.0 - jest-resolve: 29.2.0 - jest-runner: 29.2.0 - jest-util: 29.2.0 - jest-validate: 29.2.0 + jest-resolve: 29.2.1 + jest-runner: 29.2.1 + jest-util: 29.2.1 + jest-validate: 29.2.1 micromatch: 4.0.5 parse-json: 5.2.0 - pretty-format: 29.2.0 + pretty-format: 29.2.1 slash: 3.0.0 strip-json-comments: 3.1.1 ts-node: 10.9.1_o6ib7qqltxpe7qrskddglns2ga @@ -8107,14 +7946,14 @@ packages: pretty-format: 26.6.2 dev: true - /jest-diff/29.2.0: - resolution: {integrity: sha512-GsH07qQL+/D/GxlnU+sSg9GL3fBOcuTlmtr3qr2pnkiODCwubNN2/7slW4m3CvxDsEus/VEOfQKRFLyXsUlnZw==} + /jest-diff/29.2.1: + resolution: {integrity: sha512-gfh/SMNlQmP3MOUgdzxPOd4XETDJifADpT937fN1iUGz+9DgOu2eUPHH25JDkLVcLwwqxv3GzVyK4VBUr9fjfA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: chalk: 4.1.2 diff-sequences: 29.2.0 jest-get-type: 29.2.0 - pretty-format: 29.2.0 + pretty-format: 29.2.1 dev: true /jest-docblock/26.0.0: @@ -8142,15 +7981,15 @@ packages: pretty-format: 26.6.2 dev: true - /jest-each/29.2.0: - resolution: {integrity: sha512-h4LeC3L/R7jIMfTdYowevPIssvcPYQ7Qzs+pCSYsJgPztIizXwKmnfhZXBA4WVqdmvMcpmseYEXb67JT7IJ2eg==} + /jest-each/29.2.1: + resolution: {integrity: sha512-sGP86H/CpWHMyK3qGIGFCgP6mt+o5tu9qG4+tobl0LNdgny0aitLXs9/EBacLy3Bwqy+v4uXClqJgASJWcruYw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.2.0 + '@jest/types': 29.2.1 chalk: 4.1.2 jest-get-type: 29.2.0 - jest-util: 29.2.0 - pretty-format: 29.2.0 + jest-util: 29.2.1 + pretty-format: 29.2.1 dev: true /jest-environment-jsdom/26.6.2: @@ -8183,16 +8022,16 @@ packages: jest-util: 26.6.2 dev: true - /jest-environment-node/29.2.0: - resolution: {integrity: sha512-b4qQGVStPMvtZG97Ac0rvnmSIjCZturFU7MQRMp4JDFl7zoaDLTtXmFjFP1tNmi9te6kR8d+Htbv3nYeoaIz6g==} + /jest-environment-node/29.2.1: + resolution: {integrity: sha512-PulFKwEMz6nTAdLUwglFKei3b/LixwlRiqTN6nvPE1JtrLtlnpd6LXnFI1NFHYJGlTmIWilMP2n9jEtPPKX50g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 29.2.0 - '@jest/fake-timers': 29.2.0 - '@jest/types': 29.2.0 + '@jest/environment': 29.2.1 + '@jest/fake-timers': 29.2.1 + '@jest/types': 29.2.1 '@types/node': 18.11.0 - jest-mock: 29.2.0 - jest-util: 29.2.0 + jest-mock: 29.2.1 + jest-util: 29.2.1 dev: true /jest-get-type/26.3.0: @@ -8228,19 +8067,19 @@ packages: - supports-color dev: true - /jest-haste-map/29.2.0: - resolution: {integrity: sha512-qu9lGFi7qJ8v37egS1phZZUJYiMyWnKwu83NlNT1qs50TbedIX2hFl+9ztsJ7U/ENaHwk1/Bs8fqOIQsScIRwg==} + /jest-haste-map/29.2.1: + resolution: {integrity: sha512-wF460rAFmYc6ARcCFNw4MbGYQjYkvjovb9GBT+W10Um8q5nHq98jD6fHZMDMO3tA56S8XnmNkM8GcA8diSZfnA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.2.0 + '@jest/types': 29.2.1 '@types/graceful-fs': 4.1.5 '@types/node': 18.11.0 anymatch: 3.1.2 fb-watchman: 2.0.2 graceful-fs: 4.2.10 jest-regex-util: 29.2.0 - jest-util: 29.2.0 - jest-worker: 29.2.0 + jest-util: 29.2.1 + jest-worker: 29.2.1 micromatch: 4.0.5 walker: 1.0.8 optionalDependencies: @@ -8265,7 +8104,7 @@ packages: ssim.js: 3.5.0 dev: true - /jest-image-snapshot/4.2.0_jest@29.2.0: + /jest-image-snapshot/4.2.0_jest@29.2.1: resolution: {integrity: sha512-6aAqv2wtfOgxiJeBayBCqHo1zX+A12SUNNzo7rIxiXh6W6xYVu8QyHWkada8HeRi+QUTHddp0O0Xa6kmQr+xbQ==} engines: {node: '>= 10.14.2'} peerDependencies: @@ -8274,7 +8113,7 @@ packages: chalk: 1.1.3 get-stdin: 5.0.1 glur: 1.1.2 - jest: 29.2.0_pt3oab7md4pun52yk6ejrzjiwq + jest: 29.2.1_pt3oab7md4pun52yk6ejrzjiwq lodash: 4.17.21 mkdirp: 0.5.6 pixelmatch: 5.3.0 @@ -8321,12 +8160,12 @@ packages: pretty-format: 26.6.2 dev: true - /jest-leak-detector/29.2.0: - resolution: {integrity: sha512-FXT9sCFdct42+oOqGIr/9kmUw3RbhvpkwidCBT5ySHHoWNGd3c9n7HXpFKjEz9UnUITRCGdn0q2s6Sxrq36kwg==} + /jest-leak-detector/29.2.1: + resolution: {integrity: sha512-1YvSqYoiurxKOJtySc+CGVmw/e1v4yNY27BjWTVzp0aTduQeA7pdieLiW05wTYG/twlKOp2xS/pWuikQEmklug==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: jest-get-type: 29.2.0 - pretty-format: 29.2.0 + pretty-format: 29.2.1 dev: true /jest-matcher-utils/26.6.2: @@ -8339,14 +8178,14 @@ packages: pretty-format: 26.6.2 dev: true - /jest-matcher-utils/29.2.0: - resolution: {integrity: sha512-FcEfKZ4vm28yCdBsvC69EkrEhcfex+IYlRctNJXsRG9+WC3WxgBNORnECIgqUtj7o/h1d8o7xB/dFUiLi4bqtw==} + /jest-matcher-utils/29.2.1: + resolution: {integrity: sha512-hUTBh7H/Mnb6GTpihbLh8uF5rjAMdekfW/oZNXUMAXi7bbmym2HiRpzgqf/zzkjgejMrVAkPdVSQj+32enlUww==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: chalk: 4.1.2 - jest-diff: 29.2.0 + jest-diff: 29.2.1 jest-get-type: 29.2.0 - pretty-format: 29.2.0 + pretty-format: 29.2.1 dev: true /jest-message-util/26.6.2: @@ -8364,17 +8203,17 @@ packages: stack-utils: 2.0.5 dev: true - /jest-message-util/29.2.0: - resolution: {integrity: sha512-arBfk5yMFMTnMB22GyG601xGSGthA02vWSewPaxoFo0F9wBqDOyxccPbCcYu8uibw3kduSHXdCOd1PsLSgdomg==} + /jest-message-util/29.2.1: + resolution: {integrity: sha512-Dx5nEjw9V8C1/Yj10S/8ivA8F439VS8vTq1L7hEgwHFn9ovSKNpYW/kwNh7UglaEgXO42XxzKJB+2x0nSglFVw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/code-frame': 7.18.6 - '@jest/types': 29.2.0 + '@jest/types': 29.2.1 '@types/stack-utils': 2.0.1 chalk: 4.1.2 graceful-fs: 4.2.10 micromatch: 4.0.5 - pretty-format: 29.2.0 + pretty-format: 29.2.1 slash: 3.0.0 stack-utils: 2.0.5 dev: true @@ -8387,13 +8226,13 @@ packages: '@types/node': 18.11.0 dev: true - /jest-mock/29.2.0: - resolution: {integrity: sha512-aiWGR0P8ivssIO17xkehLGFtCcef2ZwQFNPwEer1jQLHxPctDlIg3Hs6QMq1KpPz5dkCcgM7mwGif4a9IPznlg==} + /jest-mock/29.2.1: + resolution: {integrity: sha512-NDphaY/GqyQpTfnTZiTqqpMaw4Z0I7XnB7yBgrT6IwYrLGxpOhrejYr4ANY4YvO2sEGdd8Tx/6D0+WLQy7/qDA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.2.0 + '@jest/types': 29.2.1 '@types/node': 18.11.0 - jest-util: 29.2.0 + jest-util: 29.2.1 dev: true /jest-pnp-resolver/1.2.2_jest-resolve@26.6.2: @@ -8408,7 +8247,7 @@ packages: jest-resolve: 26.6.2 dev: true - /jest-pnp-resolver/1.2.2_jest-resolve@29.2.0: + /jest-pnp-resolver/1.2.2_jest-resolve@29.2.1: resolution: {integrity: sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==} engines: {node: '>=6'} peerDependencies: @@ -8417,7 +8256,7 @@ packages: jest-resolve: optional: true dependencies: - jest-resolve: 29.2.0 + jest-resolve: 29.2.1 dev: true /jest-regex-util/26.0.0: @@ -8441,12 +8280,12 @@ packages: - supports-color dev: true - /jest-resolve-dependencies/29.2.0: - resolution: {integrity: sha512-Cd0Z39sDntEnfR9PoUdFHUAGDvtKI0/7Wt73l3lt03A3yQ+A6Qi3XmBuqGjdFl2QbXaPa937oLhilG612P8HGQ==} + /jest-resolve-dependencies/29.2.1: + resolution: {integrity: sha512-o3mUGX2j08usj1jIAIE8KmUVpqVAn54k80kI27ldbZf2oJn6eghhB6DvJxjrcH40va9CQgWTfU5f2Ag/MoUqgQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: jest-regex-util: 29.2.0 - jest-snapshot: 29.2.0 + jest-snapshot: 29.2.1 transitivePeerDependencies: - supports-color dev: true @@ -8465,16 +8304,16 @@ packages: slash: 3.0.0 dev: true - /jest-resolve/29.2.0: - resolution: {integrity: sha512-f5c0ljNg2guDBCC7wi92vAhNuA0BtAG5vkY7Fob0c7sUMU1g87mTXqRmjrVFe2XvdwP5m5T/e5KJsCKu9hRvBA==} + /jest-resolve/29.2.1: + resolution: {integrity: sha512-1dJTW76Z9622Viq4yRcwBuEXuzGtE9B2kdl05RC8Om/lAzac9uEgC+M8Q5osVidbuBPmxm8wSrcItYhca2ZAtQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: chalk: 4.1.2 graceful-fs: 4.2.10 - jest-haste-map: 29.2.0 - jest-pnp-resolver: 1.2.2_jest-resolve@29.2.0 - jest-util: 29.2.0 - jest-validate: 29.2.0 + jest-haste-map: 29.2.1 + jest-pnp-resolver: 1.2.2_jest-resolve@29.2.1 + jest-util: 29.2.1 + jest-validate: 29.2.1 resolve: 1.22.1 resolve.exports: 1.1.0 slash: 3.0.0 @@ -8512,29 +8351,29 @@ packages: - utf-8-validate dev: true - /jest-runner/29.2.0: - resolution: {integrity: sha512-VPBrCwl9fM2mc5yk6yZhNrgXzRJMD5jfLmntkMLlrVq4hQPWbRK998iJlR+DOGCO04TC9PPYLntOJ001Vnf28g==} + /jest-runner/29.2.1: + resolution: {integrity: sha512-PojFI+uVhQ4u4YZKCN/a3yU0/l/pJJXhq1sW3JpCp8CyvGBYGddRFPKZ1WihApusxqWRTHjBJmGyPWv6Av2lWA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/console': 29.2.0 - '@jest/environment': 29.2.0 - '@jest/test-result': 29.2.0 - '@jest/transform': 29.2.0 - '@jest/types': 29.2.0 + '@jest/console': 29.2.1 + '@jest/environment': 29.2.1 + '@jest/test-result': 29.2.1 + '@jest/transform': 29.2.1 + '@jest/types': 29.2.1 '@types/node': 18.11.0 chalk: 4.1.2 emittery: 0.10.2 graceful-fs: 4.2.10 jest-docblock: 29.2.0 - jest-environment-node: 29.2.0 - jest-haste-map: 29.2.0 - jest-leak-detector: 29.2.0 - jest-message-util: 29.2.0 - jest-resolve: 29.2.0 - jest-runtime: 29.2.0 - jest-util: 29.2.0 - jest-watcher: 29.2.0 - jest-worker: 29.2.0 + jest-environment-node: 29.2.1 + jest-haste-map: 29.2.1 + jest-leak-detector: 29.2.1 + jest-message-util: 29.2.1 + jest-resolve: 29.2.1 + jest-runtime: 29.2.1 + jest-util: 29.2.1 + jest-watcher: 29.2.1 + jest-worker: 29.2.1 p-limit: 3.1.0 source-map-support: 0.5.13 transitivePeerDependencies: @@ -8581,30 +8420,30 @@ packages: - utf-8-validate dev: true - /jest-runtime/29.2.0: - resolution: {integrity: sha512-+GDmzCrswQF+mvI0upTYMe/OPYnlRRNLLDHM9AFLp2y7zxWoDoYgb8DL3WwJ8d9m743AzrnvBV9JQHi/0ed7dg==} + /jest-runtime/29.2.1: + resolution: {integrity: sha512-PSQ880OoIW9y8E6/jjhGn3eQNgNc6ndMzCZaKqy357bv7FqCfSyYepu3yDC6Sp1Vkt+GhP2M/PVgldS2uZSFZg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 29.2.0 - '@jest/fake-timers': 29.2.0 - '@jest/globals': 29.2.0 + '@jest/environment': 29.2.1 + '@jest/fake-timers': 29.2.1 + '@jest/globals': 29.2.1 '@jest/source-map': 29.2.0 - '@jest/test-result': 29.2.0 - '@jest/transform': 29.2.0 - '@jest/types': 29.2.0 + '@jest/test-result': 29.2.1 + '@jest/transform': 29.2.1 + '@jest/types': 29.2.1 '@types/node': 18.11.0 chalk: 4.1.2 cjs-module-lexer: 1.2.2 collect-v8-coverage: 1.0.1 glob: 7.2.3 graceful-fs: 4.2.10 - jest-haste-map: 29.2.0 - jest-message-util: 29.2.0 - jest-mock: 29.2.0 + jest-haste-map: 29.2.1 + jest-message-util: 29.2.1 + jest-mock: 29.2.1 jest-regex-util: 29.2.0 - jest-resolve: 29.2.0 - jest-snapshot: 29.2.0 - jest-util: 29.2.0 + jest-resolve: 29.2.1 + jest-snapshot: 29.2.1 + jest-util: 29.2.1 slash: 3.0.0 strip-bom: 4.0.0 transitivePeerDependencies: @@ -8638,13 +8477,13 @@ packages: jest-resolve: 26.6.2 natural-compare: 1.4.0 pretty-format: 26.6.2 - semver: 7.3.7 + semver: 7.3.8 transitivePeerDependencies: - supports-color dev: true - /jest-snapshot/29.2.0: - resolution: {integrity: sha512-YCKrOR0PLRXROmww73fHO9oeY4tL+LPQXWR3yml1+hKbQDR8j1VUrVzB65hKSJJgxBOr1vWx+hmz2by8JjAU5w==} + /jest-snapshot/29.2.1: + resolution: {integrity: sha512-KZdLD7iEz5M4ZYd+ezZ/kk73z+DtNbk/yJ4Qx7408Vb0CCuclJIZPa/HmIwSsCfIlOBNcYTKufr7x/Yv47oYlg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/core': 7.12.3 @@ -8653,24 +8492,24 @@ packages: '@babel/plugin-syntax-typescript': 7.18.6_@babel+core@7.12.3 '@babel/traverse': 7.19.1 '@babel/types': 7.19.0 - '@jest/expect-utils': 29.2.0 - '@jest/transform': 29.2.0 - '@jest/types': 29.2.0 + '@jest/expect-utils': 29.2.1 + '@jest/transform': 29.2.1 + '@jest/types': 29.2.1 '@types/babel__traverse': 7.18.2 '@types/prettier': 2.7.1 babel-preset-current-node-syntax: 1.0.1_@babel+core@7.12.3 chalk: 4.1.2 - expect: 29.2.0 + expect: 29.2.1 graceful-fs: 4.2.10 - jest-diff: 29.2.0 + jest-diff: 29.2.1 jest-get-type: 29.2.0 - jest-haste-map: 29.2.0 - jest-matcher-utils: 29.2.0 - jest-message-util: 29.2.0 - jest-util: 29.2.0 + jest-haste-map: 29.2.1 + jest-matcher-utils: 29.2.1 + jest-message-util: 29.2.1 + jest-util: 29.2.1 natural-compare: 1.4.0 - pretty-format: 29.2.0 - semver: 7.3.7 + pretty-format: 29.2.1 + semver: 7.3.8 transitivePeerDependencies: - supports-color dev: true @@ -8687,11 +8526,11 @@ packages: micromatch: 4.0.5 dev: true - /jest-util/29.2.0: - resolution: {integrity: sha512-8M1dx12ujkBbnhwytrezWY0Ut79hbflwodE+qZKjxSRz5qt4xDp6dQQJaOCFvCmE0QJqp9KyEK33lpPNjnhevw==} + /jest-util/29.2.1: + resolution: {integrity: sha512-P5VWDj25r7kj7kl4pN2rG/RN2c1TLfYYYZYULnS/35nFDjBai+hBeo3MDrYZS7p6IoY3YHZnt2vq4L6mKnLk0g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.2.0 + '@jest/types': 29.2.1 '@types/node': 18.11.0 chalk: 4.1.2 ci-info: 3.4.0 @@ -8711,16 +8550,16 @@ packages: pretty-format: 26.6.2 dev: true - /jest-validate/29.2.0: - resolution: {integrity: sha512-4Vl51bPNeFeDok9aJiOnrC6tqJbOp4iMCYlewoC2ZzYJZ5+6pfr3KObAdx5wP8auHcg2MRaguiqj5OdScZa72g==} + /jest-validate/29.2.1: + resolution: {integrity: sha512-DZVX5msG6J6DL5vUUw+++6LEkXUsPwB5R7fsfM7BXdz2Ipr0Ib046ak+8egrwAR++pvSM/5laxLK977ieIGxkQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.2.0 + '@jest/types': 29.2.1 camelcase: 6.3.0 chalk: 4.1.2 jest-get-type: 29.2.0 leven: 3.1.0 - pretty-format: 29.2.0 + pretty-format: 29.2.1 dev: true /jest-watcher/26.6.2: @@ -8736,17 +8575,17 @@ packages: string-length: 4.0.2 dev: true - /jest-watcher/29.2.0: - resolution: {integrity: sha512-bRh0JdUeN+cl9XfK7tMnXLm4Mv70hG2SZlqbkFe5CTs7oeCkbwlGBk/mEfEJ63mrxZ8LPbnfaMpfSmkhEQBEGA==} + /jest-watcher/29.2.1: + resolution: {integrity: sha512-7jFaHUaRq50l4w/f6RuY713bvI5XskMmjWCE54NGYcY74fLkShS8LucXJke1QfGnwDSCoIqGnGGGKPwdaBYz2Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/test-result': 29.2.0 - '@jest/types': 29.2.0 + '@jest/test-result': 29.2.1 + '@jest/types': 29.2.1 '@types/node': 18.11.0 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.10.2 - jest-util: 29.2.0 + jest-util: 29.2.1 string-length: 4.0.2 dev: true @@ -8759,12 +8598,12 @@ packages: supports-color: 7.2.0 dev: true - /jest-worker/29.2.0: - resolution: {integrity: sha512-mluOlMbRX1H59vGVzPcVg2ALfCausbBpxC8a2KWOzInhYHZibbHH8CB0C1JkmkpfurrkOYgF7FPmypuom1OM9A==} + /jest-worker/29.2.1: + resolution: {integrity: sha512-ROHTZ+oj7sBrgtv46zZ84uWky71AoYi0vEV9CdEtc1FQunsoAGe5HbQmW76nI5QWdvECVPrSi1MCVUmizSavMg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@types/node': 18.11.0 - jest-util: 29.2.0 + jest-util: 29.2.1 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true @@ -8785,8 +8624,8 @@ packages: - utf-8-validate dev: true - /jest/29.2.0_pt3oab7md4pun52yk6ejrzjiwq: - resolution: {integrity: sha512-6krPemKUXCEu5Fh3j6ZVoLMjpTQVm0OCU+7f3K/9gllX8wNIE6NSCQ6s0q2RDoiKLRaQlVRHyscjSPRPqCI0Fg==} + /jest/29.2.1_pt3oab7md4pun52yk6ejrzjiwq: + resolution: {integrity: sha512-K0N+7rx+fv3Us3KhuwRSJt55MMpZPs9Q3WSO/spRZSnsalX8yEYOTQ1PiSN7OvqzoRX4JEUXCbOJRlP4n8m5LA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true peerDependencies: @@ -8795,10 +8634,10 @@ packages: node-notifier: optional: true dependencies: - '@jest/core': 29.2.0_ts-node@10.9.1 - '@jest/types': 29.2.0 + '@jest/core': 29.2.1_ts-node@10.9.1 + '@jest/types': 29.2.1 import-local: 3.1.0 - jest-cli: 29.2.0_pt3oab7md4pun52yk6ejrzjiwq + jest-cli: 29.2.1_pt3oab7md4pun52yk6ejrzjiwq transitivePeerDependencies: - '@types/node' - supports-color @@ -9645,7 +9484,7 @@ packages: /mermaid/9.1.7: resolution: {integrity: sha512-MRVHXy5FLjnUQUG7YS3UN9jEN6FXCJbFCXVGJQjVIbiR6Vhw0j/6pLIjqsiah9xoHmQU6DEaKOvB3S1g/1nBPA==} dependencies: - '@braintree/sanitize-url': 6.0.0 + '@braintree/sanitize-url': 6.0.1 d3: 7.6.1 dagre: 0.8.5 dagre-d3: 0.6.4 @@ -10159,7 +9998,7 @@ packages: dependencies: growly: 1.3.0 is-wsl: 2.2.0 - semver: 7.3.7 + semver: 7.3.8 shellwords: 0.1.1 uuid: 8.3.2 which: 2.0.2 @@ -10193,7 +10032,7 @@ packages: dependencies: hosted-git-info: 4.1.0 is-core-module: 2.10.0 - semver: 7.3.7 + semver: 7.3.8 validate-npm-package-license: 3.0.4 dev: true @@ -10734,8 +10573,8 @@ packages: engines: {node: '>=12.13.0'} dev: true - /pnpm/7.13.5: - resolution: {integrity: sha512-7+xyYPunBiAAJclpmUU2CTqe7uHipDjguUF2qmd9+r8hfZEVj0TnMTfblPnRF9aiVsmE4X3zRPlY3A5zk7r73w==} + /pnpm/7.13.6: + resolution: {integrity: sha512-KIGf//0cojjX3cUL63gvAk8d5t9tg+5h6AxLGyxQwoCPtpsjXafm/auIJyDUUh9RVmcPusJxdiONkgxPnbW1YA==} engines: {node: '>=14.6'} hasBin: true dev: true @@ -10745,10 +10584,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /postcss-value-parser/4.1.0: - resolution: {integrity: sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==} - dev: true - /postcss-value-parser/4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} dev: true @@ -10811,8 +10646,8 @@ packages: react-is: 17.0.2 dev: true - /pretty-format/29.2.0: - resolution: {integrity: sha512-QCSUFdwOi924g24czhOH5eTkXxUCqlLGZBRCySlwDYHIXRJkdGyjJc9nZaqhlFBZws8dq5Dvk0lCilsmlfsPxw==} + /pretty-format/29.2.1: + resolution: {integrity: sha512-Y41Sa4aLCtKAXvwuIpTvcFBkyeYp2gdFWzXGA+ZNES3VwURIB165XO/z7CjETwzCCS53MjW/rLMyyqEnTtaOfA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/schemas': 29.0.0 @@ -11530,6 +11365,14 @@ packages: lru-cache: 6.0.0 dev: true + /semver/7.3.8: + resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + dev: true + /send/0.18.0: resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} engines: {node: '>= 0.8.0'} @@ -11902,7 +11745,7 @@ packages: figures: 3.2.0 find-up: 5.0.0 git-semver-tags: 4.1.1 - semver: 7.3.7 + semver: 7.3.8 stringify-package: 1.0.1 yargs: 16.2.0 dev: true @@ -12508,11 +12351,6 @@ packages: safe-buffer: 5.2.1 dev: true - /tunnel/0.0.6: - resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==} - engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'} - dev: true - /tweetnacl/0.14.5: resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==} dev: true @@ -13007,7 +12845,7 @@ packages: terser: optional: true dependencies: - esbuild: 0.15.11 + esbuild: 0.15.12 postcss: 8.4.16 resolve: 1.22.1 rollup: 2.78.1 @@ -13015,7 +12853,7 @@ packages: fsevents: 2.3.2 dev: true - /vitepress-plugin-mermaid/2.0.8_orex2agllvbrjwlm6w3vfszwae: + /vitepress-plugin-mermaid/2.0.8_m5gk66we2y6xlan2yvhce6nu2a: resolution: {integrity: sha512-ywWxTeg9kMv7ZPf/igCBF4ZHhWZAyRtbPnA12ICQuNK2AMp7r5IHOfnuX1EJQf8gNdsh8bcvvSvm8Ll92fdOTw==} peerDependencies: mermaid: ^8.0.0 || ^9.0.0 @@ -13024,10 +12862,10 @@ packages: dependencies: mermaid: 9.1.7 vite-plugin-md: 0.20.4_ddevayggxncg4aofvrlbkut4ha - vitepress: 1.0.0-alpha.21_tbpndr44ulefs3hehwpi2mkf2y + vitepress: 1.0.0-alpha.22_tbpndr44ulefs3hehwpi2mkf2y dev: true - /vitepress-plugin-search/1.0.4-alpha.11_edcjrozpkfaskrqytnhbwsc3ky: + /vitepress-plugin-search/1.0.4-alpha.11_eny7drxhzzrhshlyu255qt5dum: resolution: {integrity: sha512-fKJIpPj6QGQeXda31Dx5f9DtCYnPVHKQVsOUpnJOzahWHPPgGofslwwvwaeRMWIGvpslxi/m4RVK6C+ydqKukA==} engines: {node: ^14.13.1 || ^16.7.0 || >=18} peerDependencies: @@ -13036,12 +12874,12 @@ packages: vue: '3' dependencies: vite: 3.1.8 - vitepress: 1.0.0-alpha.21_tbpndr44ulefs3hehwpi2mkf2y + vitepress: 1.0.0-alpha.22_tbpndr44ulefs3hehwpi2mkf2y vue: 3.2.40 dev: true - /vitepress/1.0.0-alpha.21_tbpndr44ulefs3hehwpi2mkf2y: - resolution: {integrity: sha512-D/tkoDW16uUZ9pnWd28Kk1vX26zNiTml3m9oGbfx2pAfYg99PHd1GceZyEm4jZsJU0+n9S++1ctFxoQvsq376A==} + /vitepress/1.0.0-alpha.22_tbpndr44ulefs3hehwpi2mkf2y: + resolution: {integrity: sha512-IWqnAxMDNaiyl6Bz+/79l40Ho6xsjrqxRp/WZw0+5BXR0BTZbmHyhGtI3XrH6oSn8MisLPjCccikaj3mcmCoWg==} hasBin: true dependencies: '@docsearch/css': 3.2.1 @@ -13333,10 +13171,6 @@ packages: iconv-lite: 0.6.3 dev: true - /whatwg-fetch/3.6.2: - resolution: {integrity: sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA==} - dev: true - /whatwg-mimetype/2.3.0: resolution: {integrity: sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==} dev: true From fc24373667ce5fdf73d5199129db6fb8da3f4053 Mon Sep 17 00:00:00 2001 From: Caleb Usadi Date: Mon, 24 Oct 2022 23:41:34 -0400 Subject: [PATCH 42/42] Change fill attribute to style. --- packages/mermaid/src/diagrams/er/erRenderer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mermaid/src/diagrams/er/erRenderer.js b/packages/mermaid/src/diagrams/er/erRenderer.js index 3e6384e6a..a4d5c8bd1 100644 --- a/packages/mermaid/src/diagrams/er/erRenderer.js +++ b/packages/mermaid/src/diagrams/er/erRenderer.js @@ -357,7 +357,7 @@ const drawEntities = function (svgNode, entities, graph) { const rectNode = groupNode .insert('rect', '#' + textId) .attr('class', 'er entityBox') - .attr('fill', conf.fill) + .style('fill', conf.fill) .attr('fill-opacity', '100%') .attr('stroke', conf.stroke) .attr('x', 0)