mermaid 8.10.2 → 8.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -656,7 +656,7 @@ module.exports = function(module) {
656
656
  /*! exports provided: name, version, description, main, keywords, scripts, repository, author, license, standard, dependencies, devDependencies, files, yarn-upgrade-all, sideEffects, husky, default */
657
657
  /***/ (function(module) {
658
658
 
659
- module.exports = JSON.parse("{\"name\":\"mermaid\",\"version\":\"8.10.2\",\"description\":\"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.\",\"main\":\"dist/mermaid.core.js\",\"keywords\":[\"diagram\",\"markdown\",\"flowchart\",\"sequence diagram\",\"gantt\",\"class diagram\",\"git graph\"],\"scripts\":{\"build:development\":\"webpack --progress --colors\",\"build:production\":\"yarn build:development -p --config webpack.config.prod.babel.js\",\"build\":\"yarn build:development && yarn build:production\",\"postbuild\":\"documentation build src/mermaidAPI.js src/config.js src/defaultConfig.js --shallow -f md --markdown-toc false > docs/Setup.md\",\"build:watch\":\"yarn build --watch\",\"minify\":\"minify ./dist/mermaid.js > ./dist/mermaid.min.js\",\"release\":\"yarn build\",\"lint\":\"eslint src\",\"e2e:depr\":\"yarn lint && jest e2e --config e2e/jest.config.js\",\"cypress\":\"percy exec -- cypress run\",\"e2e\":\"start-server-and-test dev http://localhost:9000/ cypress\",\"e2e-upd\":\"yarn lint && jest e2e -u --config e2e/jest.config.js\",\"dev\":\"webpack-dev-server --config webpack.config.e2e.js\",\"test\":\"yarn lint && jest src/.*\",\"test:watch\":\"jest --watch src\",\"prepublishOnly\":\"yarn build && yarn test\",\"prepare\":\"yarn build\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/knsv/mermaid\"},\"author\":\"Knut Sveidqvist\",\"license\":\"MIT\",\"standard\":{\"ignore\":[\"**/parser/*.js\",\"dist/**/*.js\",\"cypress/**/*.js\"],\"globals\":[\"page\"]},\"dependencies\":{\"@braintree/sanitize-url\":\"^3.1.0\",\"d3\":\"^5.7.0\",\"dagre\":\"^0.8.4\",\"dagre-d3\":\"^0.6.4\",\"entity-decode\":\"^2.0.2\",\"graphlib\":\"^2.1.7\",\"he\":\"^1.2.0\",\"khroma\":\"^1.1.0\",\"minify\":\"^4.1.1\",\"moment-mini\":\"^2.22.1\",\"stylis\":\"^3.5.2\"},\"devDependencies\":{\"@babel/core\":\"^7.2.2\",\"@babel/preset-env\":\"^7.8.4\",\"@babel/register\":\"^7.0.0\",\"@percy/cypress\":\"*\",\"babel-core\":\"7.0.0-bridge.0\",\"babel-eslint\":\"^10.1.0\",\"babel-jest\":\"^24.9.0\",\"babel-loader\":\"^8.0.4\",\"coveralls\":\"^3.0.2\",\"css-loader\":\"^2.0.1\",\"css-to-string-loader\":\"^0.1.3\",\"cypress\":\"4.0.1\",\"documentation\":\"^12.0.1\",\"eslint\":\"^6.3.0\",\"eslint-config-prettier\":\"^6.3.0\",\"eslint-plugin-prettier\":\"^3.1.0\",\"husky\":\"^1.2.1\",\"identity-obj-proxy\":\"^3.0.0\",\"jest\":\"^24.9.0\",\"jison\":\"^0.4.18\",\"moment\":\"^2.23.0\",\"node-sass\":\"^5.0.0\",\"prettier\":\"^1.18.2\",\"puppeteer\":\"^1.17.0\",\"sass-loader\":\"^7.1.0\",\"start-server-and-test\":\"^1.10.6\",\"terser-webpack-plugin\":\"^2.2.2\",\"webpack\":\"^4.41.2\",\"webpack-bundle-analyzer\":\"^3.7.0\",\"webpack-cli\":\"^3.1.2\",\"webpack-dev-server\":\"^3.4.1\",\"webpack-node-externals\":\"^1.7.2\",\"yarn-upgrade-all\":\"^0.5.0\"},\"files\":[\"dist\"],\"yarn-upgrade-all\":{\"ignore\":[\"babel-core\"]},\"sideEffects\":[\"**/*.css\",\"**/*.scss\"],\"husky\":{\"hooks\":{\"pre-push\":\"yarn test\"}}}");
659
+ module.exports = JSON.parse("{\"name\":\"mermaid\",\"version\":\"8.11.0\",\"description\":\"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.\",\"main\":\"dist/mermaid.core.js\",\"keywords\":[\"diagram\",\"markdown\",\"flowchart\",\"sequence diagram\",\"gantt\",\"class diagram\",\"git graph\"],\"scripts\":{\"build:development\":\"webpack --progress --colors\",\"build:production\":\"yarn build:development -p --config webpack.config.prod.babel.js\",\"build\":\"yarn build:development && yarn build:production\",\"postbuild\":\"documentation build src/mermaidAPI.js src/config.js src/defaultConfig.js --shallow -f md --markdown-toc false > docs/Setup.md\",\"build:watch\":\"yarn build --watch\",\"minify\":\"minify ./dist/mermaid.js > ./dist/mermaid.min.js\",\"release\":\"yarn build\",\"lint\":\"eslint src\",\"e2e:depr\":\"yarn lint && jest e2e --config e2e/jest.config.js\",\"cypress\":\"percy exec -- cypress run\",\"e2e\":\"start-server-and-test dev http://localhost:9000/ cypress\",\"e2e-upd\":\"yarn lint && jest e2e -u --config e2e/jest.config.js\",\"dev\":\"webpack-dev-server --config webpack.config.e2e.js\",\"test\":\"yarn lint && jest src/.*\",\"test:watch\":\"jest --watch src\",\"prepublishOnly\":\"yarn build && yarn test\",\"prepare\":\"yarn build\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/knsv/mermaid\"},\"author\":\"Knut Sveidqvist\",\"license\":\"MIT\",\"standard\":{\"ignore\":[\"**/parser/*.js\",\"dist/**/*.js\",\"cypress/**/*.js\"],\"globals\":[\"page\"]},\"dependencies\":{\"@braintree/sanitize-url\":\"^3.1.0\",\"d3\":\"^5.7.0\",\"dagre\":\"^0.8.4\",\"dagre-d3\":\"^0.6.4\",\"entity-decode\":\"^2.0.2\",\"graphlib\":\"^2.1.7\",\"khroma\":\"^1.1.0\",\"moment-mini\":\"^2.22.1\",\"stylis\":\"^3.5.2\"},\"devDependencies\":{\"@babel/core\":\"^7.2.2\",\"@babel/preset-env\":\"^7.8.4\",\"@babel/register\":\"^7.0.0\",\"@percy/cypress\":\"*\",\"babel-core\":\"7.0.0-bridge.0\",\"babel-eslint\":\"^10.1.0\",\"babel-jest\":\"^24.9.0\",\"babel-loader\":\"^8.0.4\",\"coveralls\":\"^3.0.2\",\"css-loader\":\"^2.0.1\",\"css-to-string-loader\":\"^0.1.3\",\"cypress\":\"4.0.1\",\"documentation\":\"^12.0.1\",\"eslint\":\"^6.3.0\",\"eslint-config-prettier\":\"^6.3.0\",\"eslint-plugin-prettier\":\"^3.1.0\",\"husky\":\"^1.2.1\",\"identity-obj-proxy\":\"^3.0.0\",\"jest\":\"^24.9.0\",\"jison\":\"^0.4.18\",\"minify\":\"^4.1.1\",\"moment\":\"^2.23.0\",\"node-sass\":\"^5.0.0\",\"prettier\":\"^1.18.2\",\"puppeteer\":\"^1.17.0\",\"sass-loader\":\"^7.1.0\",\"start-server-and-test\":\"^1.10.6\",\"terser-webpack-plugin\":\"^2.2.2\",\"webpack\":\"^4.41.2\",\"webpack-bundle-analyzer\":\"^3.7.0\",\"webpack-cli\":\"^3.1.2\",\"webpack-dev-server\":\"^3.4.1\",\"webpack-node-externals\":\"^1.7.2\",\"yarn-upgrade-all\":\"^0.5.0\"},\"files\":[\"dist\"],\"yarn-upgrade-all\":{\"ignore\":[\"babel-core\"]},\"sideEffects\":[\"**/*.css\",\"**/*.scss\"],\"husky\":{\"hooks\":{\"pre-push\":\"yarn test\"}}}");
660
660
 
661
661
  /***/ }),
662
662
 
@@ -1007,7 +1007,7 @@ var roundedWithTitle = function roundedWithTitle(parent, node) {
1007
1007
  var width = node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width;
1008
1008
 
1009
1009
  if (node.width <= bbox.width + node.padding) {
1010
- node.diff = (bbox.width + node.padding - node.width) / 2;
1010
+ node.diff = (bbox.width + node.padding * 0 - node.width) / 2;
1011
1011
  } else {
1012
1012
  node.diff = -node.padding / 2;
1013
1013
  } // center the rect around its coordinate
@@ -1039,6 +1039,7 @@ var divider = function divider(parent, node) {
1039
1039
  var rectBox = rect.node().getBBox();
1040
1040
  node.width = rectBox.width;
1041
1041
  node.height = rectBox.height;
1042
+ node.diff = -node.padding / 2;
1042
1043
 
1043
1044
  node.intersect = function (point) {
1044
1045
  return Object(_intersect_intersect_rect__WEBPACK_IMPORTED_MODULE_0__["default"])(node, point);
@@ -3939,7 +3940,7 @@ var config = {
3939
3940
  *
3940
3941
  * **Notes**:
3941
3942
  *
3942
- * - **strict**: (**default**) tags in text are encoded, click functionality is disabeled
3943
+ * - **strict**: (**default**) tags in text are encoded, click functionality is disabled
3943
3944
  * - **loose**: tags in text are allowed, click functionality is enabled
3944
3945
  * - **antiscript**: html tags in text are allowed, (only script element is removed), click functionality is enabled
3945
3946
  */
@@ -4813,7 +4814,7 @@ var config = {
4813
4814
  *
4814
4815
  * Default value: 'dagre-d3'
4815
4816
  */
4816
- defaultRenderer: 'dagre-d3'
4817
+ defaultRenderer: 'dagre-wrapper'
4817
4818
  },
4818
4819
 
4819
4820
  /**
@@ -7305,6 +7306,9 @@ var removeScript = function removeScript(txt) {
7305
7306
  }
7306
7307
  }
7307
7308
 
7309
+ rs = rs.replace(/javascript:/g, '#');
7310
+ rs = rs.replace(/onerror=/g, 'onerror:');
7311
+ rs = rs.replace(/<iframe/g, '');
7308
7312
  return rs;
7309
7313
  };
7310
7314
  var sanitizeText = function sanitizeText(text, config) {
@@ -20943,7 +20947,7 @@ var _drawTextCandidateFunc = function () {
20943
20947
  function byFo(content, g, x, y, width, height, textAttrs, conf) {
20944
20948
  var s = g.append('switch');
20945
20949
  var f = s.append('foreignObject').attr('x', x).attr('y', y).attr('width', width).attr('height', height);
20946
- var text = f.append('div').style('display', 'table').style('height', '100%').style('width', '100%');
20950
+ var text = f.append('xhtml:div').style('display', 'table').style('height', '100%').style('width', '100%');
20947
20951
  text.append('div').style('display', 'table-cell').style('text-align', 'center').style('vertical-align', 'middle').text(content);
20948
20952
  byTspan(content, s, x, y, width, height, textAttrs, conf);
20949
20953
 
@@ -23453,13 +23457,14 @@ function drawActorLegend(diagram) {
23453
23457
 
23454
23458
  var yPos = 60;
23455
23459
  Object.keys(actors).forEach(function (person) {
23456
- var colour = actors[person];
23460
+ var colour = actors[person].color;
23457
23461
  var circleData = {
23458
23462
  cx: 20,
23459
23463
  cy: yPos,
23460
23464
  r: 7,
23461
23465
  fill: colour,
23462
- stroke: '#000'
23466
+ stroke: '#000',
23467
+ pos: actors[person].position
23463
23468
  };
23464
23469
  _svgDraw__WEBPACK_IMPORTED_MODULE_3__["default"].drawCircle(diagram, circleData);
23465
23470
  var labelData = {
@@ -23494,7 +23499,10 @@ var draw = function draw(text, id) {
23494
23499
 
23495
23500
  var actorPos = 0;
23496
23501
  actorNames.forEach(function (actorName) {
23497
- actors[actorName] = conf.actorColours[actorPos % conf.actorColours.length];
23502
+ actors[actorName] = {
23503
+ color: conf.actorColours[actorPos % conf.actorColours.length],
23504
+ position: actorPos
23505
+ };
23498
23506
  actorPos++;
23499
23507
  });
23500
23508
  drawActorLegend(diagram);
@@ -24358,7 +24366,7 @@ if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
24358
24366
  "use strict";
24359
24367
  __webpack_require__.r(__webpack_exports__);
24360
24368
  var getStyles = function getStyles(options) {
24361
- return ".label {\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n color: ".concat(options.textColor, ";\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ").concat(options.textColor, "\n }\n\n .legend {\n fill: ").concat(options.textColor, ";\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ").concat(options.textColor, "\n }\n\n .face {\n fill: #FFF8DC;\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ").concat(options.arrowheadColor, ";\n }\n\n .edgePath .path {\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ").concat(options.lineColor, ";\n fill: none;\n }\n\n .edgeLabel {\n background-color: ").concat(options.edgeLabelBackground, ";\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ").concat(options.titleColor, ";\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: ").concat(options.tertiaryColor, ";\n border: 1px solid ").concat(options.border2, ";\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType0) : '', ";\n }\n .task-type-1, .section-type-1 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType1) : '', ";\n }\n .task-type-2, .section-type-2 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType2) : '', ";\n }\n .task-type-3, .section-type-3 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType3) : '', ";\n }\n .task-type-4, .section-type-4 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType4) : '', ";\n }\n .task-type-5, .section-type-5 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType5) : '', ";\n }\n .task-type-6, .section-type-6 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType6) : '', ";\n }\n .task-type-7, .section-type-7 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType7) : '', ";\n }\n");
24369
+ return ".label {\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n color: ".concat(options.textColor, ";\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ").concat(options.textColor, "\n }\n\n .legend {\n fill: ").concat(options.textColor, ";\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ").concat(options.textColor, "\n }\n\n .face {\n ").concat(options.faceColor ? "fill: ".concat(options.faceColor) : 'fill: #FFF8DC', ";\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ").concat(options.arrowheadColor, ";\n }\n\n .edgePath .path {\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ").concat(options.lineColor, ";\n fill: none;\n }\n\n .edgeLabel {\n background-color: ").concat(options.edgeLabelBackground, ";\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ").concat(options.titleColor, ";\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: ").concat(options.tertiaryColor, ";\n border: 1px solid ").concat(options.border2, ";\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType0) : '', ";\n }\n .task-type-1, .section-type-1 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType1) : '', ";\n }\n .task-type-2, .section-type-2 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType2) : '', ";\n }\n .task-type-3, .section-type-3 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType3) : '', ";\n }\n .task-type-4, .section-type-4 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType4) : '', ";\n }\n .task-type-5, .section-type-5 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType5) : '', ";\n }\n .task-type-6, .section-type-6 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType6) : '', ";\n }\n .task-type-7, .section-type-7 {\n ").concat(options.fillType0 ? "fill: ".concat(options.fillType7) : '', ";\n }\n\n .actor-0 {\n ").concat(options.actor0 ? "fill: ".concat(options.actor0) : '', ";\n }\n .actor-1 {\n ").concat(options.actor1 ? "fill: ".concat(options.actor1) : '', ";\n }\n .actor-2 {\n ").concat(options.actor2 ? "fill: ".concat(options.actor2) : '', ";\n }\n .actor-3 {\n ").concat(options.actor3 ? "fill: ".concat(options.actor3) : '', ";\n }\n .actor-4 {\n ").concat(options.actor4 ? "fill: ".concat(options.actor4) : '', ";\n }\n .actor-5 {\n ").concat(options.actor5 ? "fill: ".concat(options.actor5) : '', ";\n }\n\n }\n");
24362
24370
  };
24363
24371
 
24364
24372
  /* harmony default export */ __webpack_exports__["default"] = (getStyles);
@@ -24443,6 +24451,7 @@ var drawCircle = function drawCircle(element, circleData) {
24443
24451
  var circleElement = element.append('circle');
24444
24452
  circleElement.attr('cx', circleData.cx);
24445
24453
  circleElement.attr('cy', circleData.cy);
24454
+ circleElement.attr('class', 'actor-' + circleData.pos);
24446
24455
  circleElement.attr('fill', circleData.fill);
24447
24456
  circleElement.attr('stroke', circleData.stroke);
24448
24457
  circleElement.attr('r', circleData.r);
@@ -24535,14 +24544,15 @@ var drawTask = function drawTask(elem, task, conf) {
24535
24544
  drawRect(g, rect);
24536
24545
  var xPos = task.x + 14;
24537
24546
  task.people.forEach(function (person) {
24538
- var colour = task.actors[person];
24547
+ var colour = task.actors[person].color;
24539
24548
  var circle = {
24540
24549
  cx: xPos,
24541
24550
  cy: task.y,
24542
24551
  r: 7,
24543
24552
  fill: colour,
24544
24553
  stroke: '#000',
24545
- title: person
24554
+ title: person,
24555
+ pos: task.actors[person].position
24546
24556
  };
24547
24557
  drawCircle(g, circle);
24548
24558
  xPos += 10;
@@ -24619,7 +24629,7 @@ var _drawTextCandidateFunc = function () {
24619
24629
  function byFo(content, g, x, y, width, height, textAttrs, conf) {
24620
24630
  var body = g.append('switch');
24621
24631
  var f = body.append('foreignObject').attr('x', x).attr('y', y).attr('width', width).attr('height', height).attr('position', 'fixed');
24622
- var text = f.append('div').style('display', 'table').style('height', '100%').style('width', '100%');
24632
+ var text = f.append('xhtml:div').style('display', 'table').style('height', '100%').style('width', '100%');
24623
24633
  text.append('div').attr('class', 'label').style('display', 'table-cell').style('text-align', 'center').style('vertical-align', 'middle') // .style('color', colour)
24624
24634
  .text(content);
24625
24635
  byTspan(content, body, x, y, width, height, textAttrs, conf);
@@ -24822,7 +24832,6 @@ __webpack_require__.r(__webpack_exports__);
24822
24832
  * Web page integration module for the mermaid framework. It uses the mermaidAPI for mermaid functionality and to render
24823
24833
  * the diagrams to svg code.
24824
24834
  */
24825
- // import { decode } from 'he';
24826
24835
 
24827
24836
 
24828
24837