mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-22 17:56:43 +02:00
Version 9.0.0
This commit is contained in:
364
dist/mermaid.core.js
vendored
364
dist/mermaid.core.js
vendored
@@ -13283,24 +13283,6 @@ var config = {
|
|||||||
*/
|
*/
|
||||||
defaultRenderer: 'dagre-wrapper'
|
defaultRenderer: 'dagre-wrapper'
|
||||||
},
|
},
|
||||||
git: {
|
|
||||||
arrowMarkerAbsolute: false,
|
|
||||||
useWidth: undefined,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* | Parameter | Description | Type | Required | Values |
|
|
||||||
* | ----------- | ----------- | ------- | -------- | ----------- |
|
|
||||||
* | useMaxWidth | See notes | boolean | 4 | true, false |
|
|
||||||
*
|
|
||||||
* **Notes:**
|
|
||||||
*
|
|
||||||
* When this flag is set the height and width is set to 100% and is then scaling with the
|
|
||||||
* available space if not the absolute space required is used.
|
|
||||||
*
|
|
||||||
* Default value: true
|
|
||||||
*/
|
|
||||||
useMaxWidth: true
|
|
||||||
},
|
|
||||||
state: {
|
state: {
|
||||||
dividerMargin: 10,
|
dividerMargin: 10,
|
||||||
sizeUnit: 5,
|
sizeUnit: 5,
|
||||||
@@ -13505,26 +13487,19 @@ var config = {
|
|||||||
},
|
},
|
||||||
gitGraph: {
|
gitGraph: {
|
||||||
diagramPadding: 8,
|
diagramPadding: 8,
|
||||||
nodeSpacing: 150,
|
|
||||||
nodeFillColor: 'yellow',
|
|
||||||
nodeStrokeWidth: 2,
|
|
||||||
nodeStrokeColor: 'grey',
|
|
||||||
lineStrokeWidth: 4,
|
|
||||||
branchOffset: 50,
|
|
||||||
lineColor: 'grey',
|
|
||||||
leftMargin: 50,
|
|
||||||
branchColors: ['#442f74', '#983351', '#609732', '#AA9A39'],
|
|
||||||
nodeRadius: 10,
|
|
||||||
nodeLabel: {
|
nodeLabel: {
|
||||||
width: 75,
|
width: 75,
|
||||||
height: 100,
|
height: 100,
|
||||||
x: -25,
|
x: -25,
|
||||||
y: 0
|
y: 0
|
||||||
}
|
},
|
||||||
|
mainBranchName: 'main',
|
||||||
|
showCommitLabel: true,
|
||||||
|
showBranches: true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
||||||
config.git.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
config.gitGraph.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
||||||
|
|
||||||
var keyify = function keyify(obj) {
|
var keyify = function keyify(obj) {
|
||||||
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
||||||
@@ -19792,33 +19767,34 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
/* harmony export */ "setDirection": () => (/* binding */ setDirection),
|
/* harmony export */ "setDirection": () => (/* binding */ setDirection),
|
||||||
/* harmony export */ "setOptions": () => (/* binding */ setOptions)
|
/* harmony export */ "setOptions": () => (/* binding */ setOptions)
|
||||||
/* harmony export */ });
|
/* harmony export */ });
|
||||||
/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
|
/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
|
||||||
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
|
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
|
||||||
/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js");
|
/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js");
|
||||||
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../config */ "./src/config.js");
|
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../config */ "./src/config.js");
|
||||||
/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js");
|
/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var mainBranchName = (0,_config__WEBPACK_IMPORTED_MODULE_0__.getConfig)().gitGraph.mainBranchName;
|
||||||
var commits = {};
|
var commits = {};
|
||||||
var head = null;
|
var head = null;
|
||||||
var branches = {
|
var branches = {};
|
||||||
main: head
|
branches[mainBranchName] = head;
|
||||||
};
|
var curBranch = mainBranchName;
|
||||||
var curBranch = 'main';
|
|
||||||
var direction = 'LR';
|
var direction = 'LR';
|
||||||
var seq = 0;
|
var seq = 0;
|
||||||
|
|
||||||
function getId() {
|
function getId() {
|
||||||
return (0,_utils__WEBPACK_IMPORTED_MODULE_0__.random)({
|
return (0,_utils__WEBPACK_IMPORTED_MODULE_1__.random)({
|
||||||
length: 7
|
length: 7
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var parseDirective = function parseDirective(statement, context, type) {
|
var parseDirective = function parseDirective(statement, context, type) {
|
||||||
_mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].parseDirective(this, statement, context, type);
|
_mermaidAPI__WEBPACK_IMPORTED_MODULE_2__["default"].parseDirective(this, statement, context, type);
|
||||||
}; // /**
|
}; // /**
|
||||||
// * @param currentCommit
|
// * @param currentCommit
|
||||||
// * @param otherCommit
|
// * @param otherCommit
|
||||||
@@ -19879,24 +19855,24 @@ var setDirection = function setDirection(dir) {
|
|||||||
};
|
};
|
||||||
var options = {};
|
var options = {};
|
||||||
var setOptions = function setOptions(rawOptString) {
|
var setOptions = function setOptions(rawOptString) {
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('options str', rawOptString);
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('options str', rawOptString);
|
||||||
rawOptString = rawOptString && rawOptString.trim();
|
rawOptString = rawOptString && rawOptString.trim();
|
||||||
rawOptString = rawOptString || '{}';
|
rawOptString = rawOptString || '{}';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
options = JSON.parse(rawOptString);
|
options = JSON.parse(rawOptString);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.error('error while parsing gitGraph options', e.message);
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.error('error while parsing gitGraph options', e.message);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var getOptions = function getOptions() {
|
var getOptions = function getOptions() {
|
||||||
return options;
|
return options;
|
||||||
};
|
};
|
||||||
var commit = function commit(msg, id, type, tag) {
|
var commit = function commit(msg, id, type, tag) {
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('Entering commit:', msg, id, type, tag);
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('Entering commit:', msg, id, type, tag);
|
||||||
id = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(id, _config__WEBPACK_IMPORTED_MODULE_4__.getConfig());
|
id = _common_common__WEBPACK_IMPORTED_MODULE_4__["default"].sanitizeText(id, _config__WEBPACK_IMPORTED_MODULE_0__.getConfig());
|
||||||
msg = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(msg, _config__WEBPACK_IMPORTED_MODULE_4__.getConfig());
|
msg = _common_common__WEBPACK_IMPORTED_MODULE_4__["default"].sanitizeText(msg, _config__WEBPACK_IMPORTED_MODULE_0__.getConfig());
|
||||||
tag = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(tag, _config__WEBPACK_IMPORTED_MODULE_4__.getConfig());
|
tag = _common_common__WEBPACK_IMPORTED_MODULE_4__["default"].sanitizeText(tag, _config__WEBPACK_IMPORTED_MODULE_0__.getConfig());
|
||||||
var commit = {
|
var commit = {
|
||||||
id: id ? id : seq + '-' + getId(),
|
id: id ? id : seq + '-' + getId(),
|
||||||
message: msg,
|
message: msg,
|
||||||
@@ -19909,15 +19885,15 @@ var commit = function commit(msg, id, type, tag) {
|
|||||||
head = commit;
|
head = commit;
|
||||||
commits[commit.id] = commit;
|
commits[commit.id] = commit;
|
||||||
branches[curBranch] = commit.id;
|
branches[curBranch] = commit.id;
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('in pushCommit ' + commit.id);
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('in pushCommit ' + commit.id);
|
||||||
};
|
};
|
||||||
var branch = function branch(name) {
|
var branch = function branch(name) {
|
||||||
name = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(name, _config__WEBPACK_IMPORTED_MODULE_4__.getConfig());
|
name = _common_common__WEBPACK_IMPORTED_MODULE_4__["default"].sanitizeText(name, _config__WEBPACK_IMPORTED_MODULE_0__.getConfig());
|
||||||
|
|
||||||
if (typeof branches[name] === 'undefined') {
|
if (typeof branches[name] === 'undefined') {
|
||||||
branches[name] = head != null ? head.id : null;
|
branches[name] = head != null ? head.id : null;
|
||||||
checkout(name);
|
checkout(name);
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('in createBranch');
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('in createBranch');
|
||||||
} else {
|
} else {
|
||||||
var error = new Error('Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ' + name + '")');
|
var error = new Error('Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ' + name + '")');
|
||||||
error.hash = {
|
error.hash = {
|
||||||
@@ -19936,7 +19912,7 @@ var branch = function branch(name) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
var merge = function merge(otherBranch) {
|
var merge = function merge(otherBranch) {
|
||||||
otherBranch = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(otherBranch, _config__WEBPACK_IMPORTED_MODULE_4__.getConfig());
|
otherBranch = _common_common__WEBPACK_IMPORTED_MODULE_4__["default"].sanitizeText(otherBranch, _config__WEBPACK_IMPORTED_MODULE_0__.getConfig());
|
||||||
var currentCommit = commits[branches[curBranch]];
|
var currentCommit = commits[branches[curBranch]];
|
||||||
var otherCommit = commits[branches[otherBranch]];
|
var otherCommit = commits[branches[otherBranch]];
|
||||||
|
|
||||||
@@ -20042,12 +20018,11 @@ var merge = function merge(otherBranch) {
|
|||||||
commits[commit.id] = commit;
|
commits[commit.id] = commit;
|
||||||
branches[curBranch] = commit.id; // }
|
branches[curBranch] = commit.id; // }
|
||||||
|
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug(branches);
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug(branches);
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('in mergeBranch');
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('in mergeBranch');
|
||||||
};
|
};
|
||||||
var checkout = function checkout(branch) {
|
var checkout = function checkout(branch) {
|
||||||
branch = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(branch, _config__WEBPACK_IMPORTED_MODULE_4__.getConfig());
|
branch = _common_common__WEBPACK_IMPORTED_MODULE_4__["default"].sanitizeText(branch, _config__WEBPACK_IMPORTED_MODULE_0__.getConfig());
|
||||||
console.info(branches);
|
|
||||||
|
|
||||||
if (typeof branches[branch] === 'undefined') {
|
if (typeof branches[branch] === 'undefined') {
|
||||||
var error = new Error('Trying to checkout branch which is not yet created. (Help try using "branch ' + branch + '")');
|
var error = new Error('Trying to checkout branch which is not yet created. (Help try using "branch ' + branch + '")');
|
||||||
@@ -20068,9 +20043,6 @@ var checkout = function checkout(branch) {
|
|||||||
} else {
|
} else {
|
||||||
curBranch = branch;
|
curBranch = branch;
|
||||||
var id = branches[curBranch];
|
var id = branches[curBranch];
|
||||||
console.log(id);
|
|
||||||
console.log('hi');
|
|
||||||
console.log(commits);
|
|
||||||
head = commits[id];
|
head = commits[id];
|
||||||
}
|
}
|
||||||
}; // export const reset = function (commitRef) {
|
}; // export const reset = function (commitRef) {
|
||||||
@@ -20129,7 +20101,7 @@ function prettyPrintCommitHistory(commitArr) {
|
|||||||
if (branches[_branch] === commit.id) label.push(_branch);
|
if (branches[_branch] === commit.id) label.push(_branch);
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug(label.join(' '));
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug(label.join(' '));
|
||||||
|
|
||||||
if (commit.parents && commit.parents.length == 2) {
|
if (commit.parents && commit.parents.length == 2) {
|
||||||
var newCommit = commits[commit.parents[0]];
|
var newCommit = commits[commit.parents[0]];
|
||||||
@@ -20149,17 +20121,17 @@ function prettyPrintCommitHistory(commitArr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var prettyPrint = function prettyPrint() {
|
var prettyPrint = function prettyPrint() {
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug(commits);
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug(commits);
|
||||||
var node = getCommitsArray()[0];
|
var node = getCommitsArray()[0];
|
||||||
prettyPrintCommitHistory([node]);
|
prettyPrintCommitHistory([node]);
|
||||||
};
|
};
|
||||||
var clear = function clear() {
|
var clear = function clear() {
|
||||||
commits = {};
|
commits = {};
|
||||||
head = null;
|
head = null;
|
||||||
branches = {
|
var mainBranch = (0,_config__WEBPACK_IMPORTED_MODULE_0__.getConfig)().gitGraph.mainBranchName;
|
||||||
main: head
|
branches = {};
|
||||||
};
|
branches[mainBranch] = null;
|
||||||
curBranch = 'main';
|
curBranch = mainBranch;
|
||||||
seq = 0;
|
seq = 0;
|
||||||
};
|
};
|
||||||
var getBranchesAsObjArray = function getBranchesAsObjArray() {
|
var getBranchesAsObjArray = function getBranchesAsObjArray() {
|
||||||
@@ -20185,7 +20157,7 @@ var getCommitsArray = function getCommitsArray() {
|
|||||||
return commits[key];
|
return commits[key];
|
||||||
});
|
});
|
||||||
commitArr.forEach(function (o) {
|
commitArr.forEach(function (o) {
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug(o.id);
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug(o.id);
|
||||||
});
|
});
|
||||||
commitArr.sort(function (a, b) {
|
commitArr.sort(function (a, b) {
|
||||||
return a.seq - b.seq;
|
return a.seq - b.seq;
|
||||||
@@ -20210,7 +20182,7 @@ var commitType = {
|
|||||||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
||||||
parseDirective: parseDirective,
|
parseDirective: parseDirective,
|
||||||
getConfig: function getConfig() {
|
getConfig: function getConfig() {
|
||||||
return _config__WEBPACK_IMPORTED_MODULE_4__.getConfig().gitGraph;
|
return _config__WEBPACK_IMPORTED_MODULE_0__.getConfig().gitGraph;
|
||||||
},
|
},
|
||||||
setDirection: setDirection,
|
setDirection: setDirection,
|
||||||
setOptions: setOptions,
|
setOptions: setOptions,
|
||||||
@@ -20249,26 +20221,19 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
|
/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
|
||||||
/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
|
/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
|
||||||
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
|
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
|
||||||
/* harmony import */ var _gitGraphAst__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./gitGraphAst */ "./src/diagrams/git/gitGraphAst.js");
|
/* harmony import */ var _gitGraphAst__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./gitGraphAst */ "./src/diagrams/git/gitGraphAst.js");
|
||||||
/* harmony import */ var _parser_gitGraph__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/gitGraph */ "./src/diagrams/git/parser/gitGraph.jison");
|
/* harmony import */ var _parser_gitGraph__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parser/gitGraph */ "./src/diagrams/git/parser/gitGraph.jison");
|
||||||
/* harmony import */ var _parser_gitGraph__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_gitGraph__WEBPACK_IMPORTED_MODULE_3__);
|
/* harmony import */ var _parser_gitGraph__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_parser_gitGraph__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
|
/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
|
||||||
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../config */ "./src/config.js");
|
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../config */ "./src/config.js");
|
||||||
/* eslint-disable */
|
|
||||||
|
|
||||||
|
|
||||||
//import * as db from './mockDb';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* eslint-disable */
|
|
||||||
|
|
||||||
//import * as configApi from '../../config';
|
|
||||||
|
|
||||||
var allCommitsDict = {};
|
var allCommitsDict = {};
|
||||||
var branchNum; //let conf = configApi.getConfig();
|
var branchNum;
|
||||||
//const commitType = db.commitType;
|
|
||||||
|
|
||||||
var commitType = {
|
var commitType = {
|
||||||
NORMAL: 0,
|
NORMAL: 0,
|
||||||
REVERSE: 1,
|
REVERSE: 1,
|
||||||
@@ -20286,46 +20251,18 @@ var clear = function clear() {
|
|||||||
allCommitsDict = {};
|
allCommitsDict = {};
|
||||||
maxPos = 0;
|
maxPos = 0;
|
||||||
lanes = [];
|
lanes = [];
|
||||||
}; // let apiConfig = {};
|
};
|
||||||
// export const setConf = function(c) {
|
|
||||||
// apiConfig = c;
|
|
||||||
// };
|
|
||||||
|
|
||||||
/** @param svg */
|
|
||||||
|
|
||||||
|
|
||||||
function svgCreateDefs(svg) {
|
|
||||||
var config = (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().gitGraph;
|
|
||||||
svg.append('defs').append('g').attr('id', 'def-commit').append('circle').attr('r', config.nodeRadius).attr('cx', 0).attr('cy', 0);
|
|
||||||
svg.select('#def-commit').append('foreignObject').attr('width', config.nodeLabel.width).attr('height', config.nodeLabel.height).attr('x', config.nodeLabel.x).attr('y', config.nodeLabel.y).attr('class', 'node-label').attr('requiredFeatures', 'http://www.w3.org/TR/SVG11/feature#Extensibility').append('p').html('');
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @param svg
|
* Draws a text, used for labels of the branches
|
||||||
* @param points
|
|
||||||
* @param colorIdx
|
|
||||||
* @param interpolate
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
// Pass in the element and its pre-transform coords
|
|
||||||
*
|
*
|
||||||
* @param element
|
* @param {string} txt The text
|
||||||
* @param coords
|
* @returns {SVGElement}
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param svg
|
|
||||||
* @param fromId
|
|
||||||
* @param toId
|
|
||||||
* @param direction
|
|
||||||
* @param color
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
var drawText = function drawText(txt) {
|
var drawText = function drawText(txt) {
|
||||||
var svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text'); // svgLabel.setAttribute('style', style.replace('color:', 'fill:'));
|
var svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text');
|
||||||
|
var rows = []; // Handling of new lines in the label
|
||||||
var rows = [];
|
|
||||||
|
|
||||||
if (typeof txt === 'string') {
|
if (typeof txt === 'string') {
|
||||||
rows = txt.split(/\\n|\n|<br\s*\/?>/gi);
|
rows = txt.split(/\\n|\n|<br\s*\/?>/gi);
|
||||||
@@ -20352,8 +20289,19 @@ var drawText = function drawText(txt) {
|
|||||||
|
|
||||||
return svgLabel;
|
return svgLabel;
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* Draws the commits with its symbol and labels. The function has tywo modes, one which only
|
||||||
|
* calculates the positions and one that does the actual drawing. This for a simple way getting the
|
||||||
|
* vertical leyering rcorrect in the graph.
|
||||||
|
*
|
||||||
|
* @param {any} svg
|
||||||
|
* @param {any} commits
|
||||||
|
* @param {any} modifyGraph
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
var drawCommits = function drawCommits(svg, commits, modifyGraph) {
|
var drawCommits = function drawCommits(svg, commits, modifyGraph) {
|
||||||
|
var gitGraphConfig = (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().gitGraph;
|
||||||
var gBullets = svg.append('g').attr('class', 'commit-bullets');
|
var gBullets = svg.append('g').attr('class', 'commit-bullets');
|
||||||
var gLabels = svg.append('g').attr('class', 'commit-labels');
|
var gLabels = svg.append('g').attr('class', 'commit-labels');
|
||||||
var pos = 0;
|
var pos = 0;
|
||||||
@@ -20364,7 +20312,7 @@ var drawCommits = function drawCommits(svg, commits, modifyGraph) {
|
|||||||
sortedKeys.forEach(function (key, index) {
|
sortedKeys.forEach(function (key, index) {
|
||||||
var commit = commits[key];
|
var commit = commits[key];
|
||||||
var y = branchPos[commit.branch].pos;
|
var y = branchPos[commit.branch].pos;
|
||||||
var x = pos + 10; // Don't draw the commits now but calculate the positioning which is used by the branmch lines etc.
|
var x = pos + 10; // Don't draw the commits now but calculate the positioning which is used by the branch lines etc.
|
||||||
|
|
||||||
if (modifyGraph) {
|
if (modifyGraph) {
|
||||||
var typeClass;
|
var typeClass;
|
||||||
@@ -20433,9 +20381,9 @@ var drawCommits = function drawCommits(svg, commits, modifyGraph) {
|
|||||||
|
|
||||||
if (modifyGraph) {
|
if (modifyGraph) {
|
||||||
var px = 4;
|
var px = 4;
|
||||||
var py = 2;
|
var py = 2; // Draw the commit label
|
||||||
|
|
||||||
if (commit.type !== commitType.MERGE) {
|
if (commit.type !== commitType.MERGE && gitGraphConfig.showCommitLabel) {
|
||||||
var labelBkg = gLabels.insert('rect').attr('class', 'commit-label-bkg');
|
var labelBkg = gLabels.insert('rect').attr('class', 'commit-label-bkg');
|
||||||
var text = gLabels.append('text').attr('x', pos).attr('y', y + 25).attr('class', 'commit-label').text(commit.id);
|
var text = gLabels.append('text').attr('x', pos).attr('y', y + 25).attr('class', 'commit-label').text(commit.id);
|
||||||
var bbox = text.node().getBBox(); // Now we have the label, lets position the background
|
var bbox = text.node().getBBox(); // Now we have the label, lets position the background
|
||||||
@@ -20466,9 +20414,12 @@ var drawCommits = function drawCommits(svg, commits, modifyGraph) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* Detect if there are other commits between commit1s x-position and commit2s x-position on the same branch as commit2.
|
* Detect if there are other commits between commit1s x-position and commit2s x-position on the same
|
||||||
* @param {*} commit1
|
* branch as commit2.
|
||||||
* @param {*} commit2
|
*
|
||||||
|
* @param {any} commit1
|
||||||
|
* @param {any} commit2
|
||||||
|
* @param allCommits
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -20484,7 +20435,13 @@ var hasOverlappingCommits = function hasOverlappingCommits(commit1, commit2, all
|
|||||||
return overlappingComits.length > 0;
|
return overlappingComits.length > 0;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
|
* This function find a lane in the y-axis that is not overlapping with any other lanes. This is
|
||||||
|
* used for drawing the lines between commits.
|
||||||
*
|
*
|
||||||
|
* @param {any} y1
|
||||||
|
* @param {any} y2
|
||||||
|
* @param {any} _depth
|
||||||
|
* @returns
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -20512,13 +20469,22 @@ var findLane = function findLane(y1, y2, _depth) {
|
|||||||
var diff = Math.abs(y1 - y2);
|
var diff = Math.abs(y1 - y2);
|
||||||
return findLane(y1, y2 - diff / 5, depth);
|
return findLane(y1, y2 - diff / 5, depth);
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* This function draw trhe lines between the commits. They were arrows initially.
|
||||||
|
*
|
||||||
|
* @param {any} svg
|
||||||
|
* @param {any} commit1
|
||||||
|
* @param {any} commit2
|
||||||
|
* @param {any} allCommits
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
var drawArrow = function drawArrow(svg, commit1, commit2, allCommits) {
|
var drawArrow = function drawArrow(svg, commit1, commit2, allCommits) {
|
||||||
var conf = (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)();
|
var conf = (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)();
|
||||||
var p1 = commitPos[commit1.id];
|
var p1 = commitPos[commit1.id];
|
||||||
var p2 = commitPos[commit2.id];
|
var p2 = commitPos[commit2.id];
|
||||||
var overlappingCommits = hasOverlappingCommits(commit1, commit2, allCommits);
|
var overlappingCommits = hasOverlappingCommits(commit1, commit2, allCommits); // log.debug('drawArrow', p1, p2, overlappingCommits, commit1.id, commit2.id);
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('drawArrow', p1, p2, overlappingCommits, commit1.id, commit2.id);
|
|
||||||
var url = '';
|
var url = '';
|
||||||
|
|
||||||
if (conf.arrowMarkerAbsolute) {
|
if (conf.arrowMarkerAbsolute) {
|
||||||
@@ -20591,6 +20557,8 @@ var drawArrows = function drawArrows(svg, commits) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
|
* This function adds the branches and the branches' labels to the svg.
|
||||||
|
*
|
||||||
* @param svg
|
* @param svg
|
||||||
* @param commitid
|
* @param commitid
|
||||||
* @param branches
|
* @param branches
|
||||||
@@ -20599,6 +20567,7 @@ var drawArrows = function drawArrows(svg, commits) {
|
|||||||
|
|
||||||
|
|
||||||
var drawBranches = function drawBranches(svg, branches) {
|
var drawBranches = function drawBranches(svg, branches) {
|
||||||
|
var gitGraphConfig = (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().gitGraph;
|
||||||
var g = svg.append('g');
|
var g = svg.append('g');
|
||||||
branches.forEach(function (branch, index) {
|
branches.forEach(function (branch, index) {
|
||||||
var pos = branchPos[branch.name].pos;
|
var pos = branchPos[branch.name].pos;
|
||||||
@@ -20608,9 +20577,10 @@ var drawBranches = function drawBranches(svg, branches) {
|
|||||||
line.attr('x2', maxPos);
|
line.attr('x2', maxPos);
|
||||||
line.attr('y2', pos);
|
line.attr('y2', pos);
|
||||||
line.attr('class', 'branch branch' + index);
|
line.attr('class', 'branch branch' + index);
|
||||||
lanes.push(pos); // Create the actual text element
|
lanes.push(pos);
|
||||||
|
var name = index === 0 ? gitGraphConfig.mainBranchName : branch.name; // Create the actual text element
|
||||||
|
|
||||||
var labelElement = drawText(branch.name); // Create outer g, edgeLabel, this will be positioned after graph layout
|
var labelElement = drawText(name); // Create outer g, edgeLabel, this will be positioned after graph layout
|
||||||
|
|
||||||
var bkg = g.insert('rect');
|
var bkg = g.insert('rect');
|
||||||
var branchLabel = g.insert('g').attr('class', 'branchLabel'); // Create inner g, label, this will be positioned now for centering the text
|
var branchLabel = g.insert('g').attr('class', 'branchLabel'); // Create inner g, label, this will be positioned now for centering the text
|
||||||
@@ -20628,24 +20598,26 @@ var drawBranches = function drawBranches(svg, branches) {
|
|||||||
* @param commit
|
* @param commit
|
||||||
* @param direction
|
* @param direction
|
||||||
* @param branchColor
|
* @param branchColor
|
||||||
|
* @param txt
|
||||||
|
* @param id
|
||||||
|
* @param ver
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
var draw = function draw(txt, id, ver) {
|
var draw = function draw(txt, id, ver) {
|
||||||
clear();
|
clear();
|
||||||
var conf = (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)();
|
var conf = (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)();
|
||||||
var config = conf.gitGraph; // try {
|
var gitGraphConfig = (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().gitGraph; // try {
|
||||||
|
|
||||||
var parser = (_parser_gitGraph__WEBPACK_IMPORTED_MODULE_3___default().parser);
|
var parser = (_parser_gitGraph__WEBPACK_IMPORTED_MODULE_2___default().parser);
|
||||||
parser.yy = _gitGraphAst__WEBPACK_IMPORTED_MODULE_4__["default"];
|
parser.yy = _gitGraphAst__WEBPACK_IMPORTED_MODULE_3__["default"];
|
||||||
parser.yy.clear();
|
parser.yy.clear();
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('in gitgraph renderer', txt + '\n', 'id:', id, ver); // // Parse the graph definition
|
_logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('in gitgraph renderer', txt + '\n', 'id:', id, ver); // // Parse the graph definition
|
||||||
|
|
||||||
parser.parse(txt + '\n'); // config = Object.assign(config, apiConfig, db.getOptions());
|
parser.parse(txt + '\n');
|
||||||
|
var direction = _gitGraphAst__WEBPACK_IMPORTED_MODULE_3__["default"].getDirection();
|
||||||
var direction = _gitGraphAst__WEBPACK_IMPORTED_MODULE_4__["default"].getDirection();
|
allCommitsDict = _gitGraphAst__WEBPACK_IMPORTED_MODULE_3__["default"].getCommits();
|
||||||
allCommitsDict = _gitGraphAst__WEBPACK_IMPORTED_MODULE_4__["default"].getCommits();
|
var branches = _gitGraphAst__WEBPACK_IMPORTED_MODULE_3__["default"].getBranchesAsObjArray(); // Position branches vertically
|
||||||
var branches = _gitGraphAst__WEBPACK_IMPORTED_MODULE_4__["default"].getBranchesAsObjArray(); // Position branches vertically
|
|
||||||
|
|
||||||
var pos = 0;
|
var pos = 0;
|
||||||
branches.forEach(function (branch, index) {
|
branches.forEach(function (branch, index) {
|
||||||
@@ -20655,24 +20627,21 @@ var draw = function draw(txt, id, ver) {
|
|||||||
};
|
};
|
||||||
pos += 50;
|
pos += 50;
|
||||||
});
|
});
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('brach pos ', branchPos);
|
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('effective options', config, branches);
|
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('commits', allCommitsDict);
|
|
||||||
var diagram = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)("[id=\"".concat(id, "\"]"));
|
var diagram = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)("[id=\"".concat(id, "\"]"));
|
||||||
svgCreateDefs(diagram);
|
|
||||||
diagram.append('defs').append('marker').attr('id', 'arrowhead').attr('refX', 24).attr('refY', 10).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 24).attr('markerHeight', 24).attr('orient', 'auto').append('path').attr('d', 'M 0 0 L 20 10 L 0 20 z'); // this is actual shape for arrowhead
|
|
||||||
|
|
||||||
drawCommits(diagram, allCommitsDict, false);
|
drawCommits(diagram, allCommitsDict, false);
|
||||||
drawBranches(diagram, branches);
|
|
||||||
|
if (gitGraphConfig.showBranches) {
|
||||||
|
drawBranches(diagram, branches);
|
||||||
|
}
|
||||||
|
|
||||||
drawArrows(diagram, allCommitsDict);
|
drawArrows(diagram, allCommitsDict);
|
||||||
drawCommits(diagram, allCommitsDict, true);
|
drawCommits(diagram, allCommitsDict, true);
|
||||||
var padding = config.diagramPadding;
|
var padding = gitGraphConfig.diagramPadding;
|
||||||
var svgBounds = diagram.node().getBBox();
|
var svgBounds = diagram.node().getBBox();
|
||||||
var width = svgBounds.width + padding * 2;
|
var width = svgBounds.width + padding * 2;
|
||||||
var height = svgBounds.height + padding * 2;
|
var height = svgBounds.height + padding * 2;
|
||||||
(0,_utils__WEBPACK_IMPORTED_MODULE_5__.configureSvgSize)(diagram, height, width, conf.useMaxWidth);
|
(0,_utils__WEBPACK_IMPORTED_MODULE_5__.configureSvgSize)(diagram, height, width, conf.useMaxWidth);
|
||||||
var vBox = "".concat(svgBounds.x - padding, " ").concat(svgBounds.y - padding, " ").concat(width, " ").concat(height); // logger.debug(`viewBox ${vBox}`);
|
var vBox = "".concat(svgBounds.x - padding, " ").concat(svgBounds.y - padding, " ").concat(width, " ").concat(height);
|
||||||
|
|
||||||
diagram.attr('viewBox', vBox);
|
diagram.attr('viewBox', vBox);
|
||||||
};
|
};
|
||||||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
||||||
@@ -26956,7 +26925,7 @@ function parse(text) {
|
|||||||
|
|
||||||
if (graphInit) {
|
if (graphInit) {
|
||||||
reinitialize(graphInit);
|
reinitialize(graphInit);
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('reinit ', graphInit);
|
_logger__WEBPACK_IMPORTED_MODULE_4__.log.info('reinit ', graphInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
var graphType = _utils__WEBPACK_IMPORTED_MODULE_3__["default"].detectType(text, cnf);
|
var graphType = _utils__WEBPACK_IMPORTED_MODULE_3__["default"].detectType(text, cnf);
|
||||||
@@ -26964,7 +26933,7 @@ function parse(text) {
|
|||||||
_logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('Type ' + graphType);
|
_logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('Type ' + graphType);
|
||||||
|
|
||||||
switch (graphType) {
|
switch (graphType) {
|
||||||
case 'git':
|
case 'gitGraph':
|
||||||
parser = (_diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_5___default());
|
parser = (_diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_5___default());
|
||||||
parser.parser.yy = _diagrams_git_gitGraphAst__WEBPACK_IMPORTED_MODULE_6__["default"];
|
parser.parser.yy = _diagrams_git_gitGraphAst__WEBPACK_IMPORTED_MODULE_6__["default"];
|
||||||
break;
|
break;
|
||||||
@@ -27128,7 +27097,8 @@ var render = function render(id, _txt, cb, container) {
|
|||||||
_config__WEBPACK_IMPORTED_MODULE_2__.addDirective(graphInit);
|
_config__WEBPACK_IMPORTED_MODULE_2__.addDirective(graphInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
var cnf = _config__WEBPACK_IMPORTED_MODULE_2__.getConfig(); // Check the maximum allowed text size
|
var cnf = _config__WEBPACK_IMPORTED_MODULE_2__.getConfig();
|
||||||
|
_logger__WEBPACK_IMPORTED_MODULE_4__.log.debug(cnf); // Check the maximum allowed text size
|
||||||
|
|
||||||
if (_txt.length > cnf.maxTextSize) {
|
if (_txt.length > cnf.maxTextSize) {
|
||||||
txt = 'graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa';
|
txt = 'graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa';
|
||||||
@@ -27280,7 +27250,7 @@ var render = function render(id, _txt, cb, container) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
switch (graphType) {
|
switch (graphType) {
|
||||||
case 'git':
|
case 'gitGraph':
|
||||||
// cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
|
// cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
|
||||||
//gitGraphRenderer.setConf(cnf.git);
|
//gitGraphRenderer.setConf(cnf.git);
|
||||||
_diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_29__["default"].draw(txt, id, false);
|
_diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_29__["default"].draw(txt, id, false);
|
||||||
@@ -27719,7 +27689,7 @@ var themes = {
|
|||||||
class: _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_3__["default"],
|
class: _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_3__["default"],
|
||||||
stateDiagram: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_4__["default"],
|
stateDiagram: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_4__["default"],
|
||||||
state: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_4__["default"],
|
state: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_4__["default"],
|
||||||
git: _diagrams_git_styles__WEBPACK_IMPORTED_MODULE_5__["default"],
|
gitGraph: _diagrams_git_styles__WEBPACK_IMPORTED_MODULE_5__["default"],
|
||||||
info: _diagrams_info_styles__WEBPACK_IMPORTED_MODULE_6__["default"],
|
info: _diagrams_info_styles__WEBPACK_IMPORTED_MODULE_6__["default"],
|
||||||
pie: _diagrams_pie_styles__WEBPACK_IMPORTED_MODULE_7__["default"],
|
pie: _diagrams_pie_styles__WEBPACK_IMPORTED_MODULE_7__["default"],
|
||||||
er: _diagrams_er_styles__WEBPACK_IMPORTED_MODULE_8__["default"],
|
er: _diagrams_er_styles__WEBPACK_IMPORTED_MODULE_8__["default"],
|
||||||
@@ -28054,14 +28024,14 @@ var Theme = /*#__PURE__*/function () {
|
|||||||
this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git7, 25);
|
this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git7, 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.gitInv0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0);
|
this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0);
|
||||||
this.gitInv1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1);
|
this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1);
|
||||||
this.gitInv2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2);
|
this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2);
|
||||||
this.gitInv3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3);
|
this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3);
|
||||||
this.gitInv4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4);
|
this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4);
|
||||||
this.gitInv5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5);
|
this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5);
|
||||||
this.gitInv6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6);
|
this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6);
|
||||||
this.gitInv7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7);
|
this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7);
|
||||||
this.branchLabelColor = this.branchLabelColor || (this.darkMode ? 'black' : this.labelTextColor);
|
this.branchLabelColor = this.branchLabelColor || (this.darkMode ? 'black' : this.labelTextColor);
|
||||||
this.gitBranchLabel0 = this.gitBranchLabel0 || this.branchLabelColor;
|
this.gitBranchLabel0 = this.gitBranchLabel0 || this.branchLabelColor;
|
||||||
this.gitBranchLabel1 = this.gitBranchLabel1 || this.branchLabelColor;
|
this.gitBranchLabel1 = this.gitBranchLabel1 || this.branchLabelColor;
|
||||||
@@ -28354,14 +28324,14 @@ var Theme = /*#__PURE__*/function () {
|
|||||||
this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, {
|
this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, {
|
||||||
h: +120
|
h: +120
|
||||||
}), 20);
|
}), 20);
|
||||||
this.gitInv0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0);
|
this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0);
|
||||||
this.gitInv1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1);
|
this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1);
|
||||||
this.gitInv2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2);
|
this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2);
|
||||||
this.gitInv3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3);
|
this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3);
|
||||||
this.gitInv4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4);
|
this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4);
|
||||||
this.gitInv5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5);
|
this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5);
|
||||||
this.gitInv6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6);
|
this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6);
|
||||||
this.gitInv7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7);
|
this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7);
|
||||||
this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
||||||
this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
||||||
this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
||||||
@@ -28706,22 +28676,22 @@ var Theme = /*#__PURE__*/function () {
|
|||||||
this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git7, 25);
|
this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git7, 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.gitInv0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)((0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0), 25);
|
this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)((0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0), 25);
|
||||||
this.gitInv1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1);
|
this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1);
|
||||||
this.gitInv2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2);
|
this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2);
|
||||||
this.gitInv3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3);
|
this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3);
|
||||||
this.gitInv4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4);
|
this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4);
|
||||||
this.gitInv5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5);
|
this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5);
|
||||||
this.gitInv6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6);
|
this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6);
|
||||||
this.gitInv7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7);
|
this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7);
|
||||||
this.gitBranchLabel0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.labelTextColor);
|
this.gitBranchLabel0 = this.gitBranchLabel0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.labelTextColor);
|
||||||
this.gitBranchLabel1 = this.labelTextColor;
|
this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor;
|
||||||
this.gitBranchLabel2 = this.labelTextColor;
|
this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor;
|
||||||
this.gitBranchLabel3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.labelTextColor);
|
this.gitBranchLabel3 = this.gitBranchLabel3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.labelTextColor);
|
||||||
this.gitBranchLabel4 = this.labelTextColor;
|
this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor;
|
||||||
this.gitBranchLabel5 = this.labelTextColor;
|
this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor;
|
||||||
this.gitBranchLabel6 = this.labelTextColor;
|
this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor;
|
||||||
this.gitBranchLabel7 = this.labelTextColor;
|
this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor;
|
||||||
this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
||||||
this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
||||||
this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
||||||
@@ -29034,14 +29004,14 @@ var Theme = /*#__PURE__*/function () {
|
|||||||
this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git7, 25);
|
this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git7, 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.gitInv0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0);
|
this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0);
|
||||||
this.gitInv1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1);
|
this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1);
|
||||||
this.gitInv2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2);
|
this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2);
|
||||||
this.gitInv3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3);
|
this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3);
|
||||||
this.gitInv4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4);
|
this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4);
|
||||||
this.gitInv5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5);
|
this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5);
|
||||||
this.gitInv6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6);
|
this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6);
|
||||||
this.gitInv7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7);
|
this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7);
|
||||||
this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
||||||
this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
||||||
this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
||||||
@@ -29373,14 +29343,14 @@ var Theme = /*#__PURE__*/function () {
|
|||||||
this.git7 = this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, {
|
this.git7 = this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, {
|
||||||
h: +120
|
h: +120
|
||||||
});
|
});
|
||||||
this.gitInv0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0);
|
this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0);
|
||||||
this.gitInv1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1);
|
this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1);
|
||||||
this.gitInv2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2);
|
this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2);
|
||||||
this.gitInv3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3);
|
this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3);
|
||||||
this.gitInv4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4);
|
this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4);
|
||||||
this.gitInv5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5);
|
this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5);
|
||||||
this.gitInv6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6);
|
this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6);
|
||||||
this.gitInv7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7);
|
this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7);
|
||||||
this.branchLabelColor = this.branchLabelColor || this.labelTextColor;
|
this.branchLabelColor = this.branchLabelColor || this.labelTextColor;
|
||||||
this.gitBranchLabel0 = this.branchLabelColor;
|
this.gitBranchLabel0 = this.branchLabelColor;
|
||||||
this.gitBranchLabel1 = 'white';
|
this.gitBranchLabel1 = 'white';
|
||||||
@@ -29702,7 +29672,7 @@ var detectType = function detectType(text, cnf) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (text.match(/^\s*gitGraph/)) {
|
if (text.match(/^\s*gitGraph/)) {
|
||||||
return 'git';
|
return 'gitGraph';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (text.match(/^\s*flowchart/)) {
|
if (text.match(/^\s*flowchart/)) {
|
||||||
@@ -31411,7 +31381,7 @@ module.exports = require("stylis");
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = JSON.parse('{"name":"mermaid","version":"8.14.0","description":"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.","main":"dist/mermaid.core.js","module":"dist/mermaid.esm.min.mjs","exports":{".":{"require":"./dist/mermaid.core.js","import":"./dist/mermaid.esm.min.mjs"},"./*":"./*"},"keywords":["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph"],"scripts":{"build:development":"webpack --mode development --progress --color","build:production":"webpack --mode production --progress --color","build":"concurrently \\"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:development --watch","release":"yarn build","lint":"eslint ./ --ext js,html","lint:fix":"yarn lint --fix","e2e:depr":"yarn lint && jest e2e --config e2e/jest.config.js","cypress":"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 serve --config ./.webpack/webpack.config.e2e.babel.js","test":"yarn lint && jest src/.*","test:watch":"jest --watch src","prepublishOnly":"yarn build && yarn test","prepare":"husky install && yarn build","pre-commit":"lint-staged"},"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":"^6.0.0","caniuse-lite":"^1.0.30001325","cypress-image-snapshot":"^4.0.1","d3":"^7.0.0","dagre":"^0.8.5","dagre-d3":"^0.6.4","dompurify":"2.3.6","graphlib":"^2.1.8","khroma":"^1.4.1","moment-mini":"^2.24.0","stylis":"^4.0.10"},"devDependencies":{"@babel/core":"^7.14.6","@babel/eslint-parser":"^7.14.7","@babel/preset-env":"^7.14.7","@babel/register":"^7.14.5","@commitlint/cli":"^16.0.0","@commitlint/config-conventional":"^16.0.0","babel-jest":"^27.0.6","babel-loader":"^8.2.2","concurrently":"^7.0.0","coveralls":"^3.0.2","css-to-string-loader":"^0.1.3","cypress":"9.5.2","documentation":"13.2.0","eslint":"^8.2.0","eslint-config-prettier":"^8.3.0","eslint-plugin-cypress":"^2.12.1","eslint-plugin-html":"^6.2.0","eslint-plugin-jest":"^26.0.0","eslint-plugin-jsdoc":"^38.0.3","eslint-plugin-markdown":"^2.2.1","eslint-plugin-prettier":"^4.0.0","husky":"^7.0.1","identity-obj-proxy":"^3.0.0","jest":"^27.0.6","jison":"^0.4.18","js-base64":"3.7.2","lint-staged":"^12.1.2","moment":"^2.23.0","path-browserify":"^1.0.1","prettier":"^2.3.2","prettier-plugin-jsdoc":"^0.3.30","start-server-and-test":"^1.12.6","terser-webpack-plugin":"^5.2.4","webpack":"^5.53.0","webpack-cli":"^4.7.2","webpack-dev-server":"^4.3.0","webpack-merge":"^5.8.0","webpack-node-externals":"^3.0.0"},"files":["dist"],"sideEffects":["**/*.css","**/*.scss"]}');
|
module.exports = JSON.parse('{"name":"mermaid","version":"9.0.0","description":"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.","main":"dist/mermaid.core.js","module":"dist/mermaid.esm.min.mjs","exports":{".":{"require":"./dist/mermaid.core.js","import":"./dist/mermaid.esm.min.mjs"},"./*":"./*"},"keywords":["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph"],"scripts":{"build:development":"webpack --mode development --progress --color","build:production":"webpack --mode production --progress --color","build":"concurrently \\"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:development --watch","release":"yarn build","lint":"eslint ./ --ext js,html","lint:fix":"yarn lint --fix","e2e:depr":"yarn lint && jest e2e --config e2e/jest.config.js","cypress":"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 serve --config ./.webpack/webpack.config.e2e.babel.js","test":"yarn lint && jest src/.*","test:watch":"jest --watch src","prepublishOnly":"yarn build && yarn test","prepare":"husky install && yarn build","pre-commit":"lint-staged"},"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":"^6.0.0","cypress-image-snapshot":"^4.0.1","d3":"^7.0.0","dagre":"^0.8.5","dagre-d3":"^0.6.4","dompurify":"2.3.6","graphlib":"^2.1.8","khroma":"^1.4.1","moment-mini":"^2.24.0","stylis":"^4.0.10"},"devDependencies":{"@babel/core":"^7.14.6","@babel/eslint-parser":"^7.14.7","@babel/preset-env":"^7.14.7","@babel/register":"^7.14.5","@commitlint/cli":"^16.0.0","@commitlint/config-conventional":"^16.0.0","babel-jest":"^27.0.6","babel-loader":"^8.2.2","concurrently":"^7.0.0","coveralls":"^3.0.2","css-to-string-loader":"^0.1.3","cypress":"9.5.2","documentation":"13.2.0","eslint":"^8.2.0","eslint-config-prettier":"^8.3.0","eslint-plugin-cypress":"^2.12.1","eslint-plugin-html":"^6.2.0","eslint-plugin-jest":"^26.0.0","eslint-plugin-jsdoc":"^38.0.3","eslint-plugin-markdown":"^2.2.1","eslint-plugin-prettier":"^4.0.0","husky":"^7.0.1","identity-obj-proxy":"^3.0.0","jest":"^27.0.6","jison":"^0.4.18","js-base64":"3.7.2","lint-staged":"^12.1.2","moment":"^2.23.0","path-browserify":"^1.0.1","prettier":"^2.3.2","prettier-plugin-jsdoc":"^0.3.30","start-server-and-test":"^1.12.6","terser-webpack-plugin":"^5.2.4","webpack":"^5.53.0","webpack-cli":"^4.7.2","webpack-dev-server":"^4.3.0","webpack-merge":"^5.8.0","webpack-node-externals":"^3.0.0"},"files":["dist"],"sideEffects":["**/*.css","**/*.scss"]}');
|
||||||
|
|
||||||
/***/ })
|
/***/ })
|
||||||
|
|
||||||
|
2
dist/mermaid.core.js.map
vendored
2
dist/mermaid.core.js.map
vendored
File diff suppressed because one or more lines are too long
364
dist/mermaid.js
vendored
364
dist/mermaid.js
vendored
@@ -13327,24 +13327,6 @@ var config = {
|
|||||||
*/
|
*/
|
||||||
defaultRenderer: 'dagre-wrapper'
|
defaultRenderer: 'dagre-wrapper'
|
||||||
},
|
},
|
||||||
git: {
|
|
||||||
arrowMarkerAbsolute: false,
|
|
||||||
useWidth: undefined,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* | Parameter | Description | Type | Required | Values |
|
|
||||||
* | ----------- | ----------- | ------- | -------- | ----------- |
|
|
||||||
* | useMaxWidth | See notes | boolean | 4 | true, false |
|
|
||||||
*
|
|
||||||
* **Notes:**
|
|
||||||
*
|
|
||||||
* When this flag is set the height and width is set to 100% and is then scaling with the
|
|
||||||
* available space if not the absolute space required is used.
|
|
||||||
*
|
|
||||||
* Default value: true
|
|
||||||
*/
|
|
||||||
useMaxWidth: true
|
|
||||||
},
|
|
||||||
state: {
|
state: {
|
||||||
dividerMargin: 10,
|
dividerMargin: 10,
|
||||||
sizeUnit: 5,
|
sizeUnit: 5,
|
||||||
@@ -13549,26 +13531,19 @@ var config = {
|
|||||||
},
|
},
|
||||||
gitGraph: {
|
gitGraph: {
|
||||||
diagramPadding: 8,
|
diagramPadding: 8,
|
||||||
nodeSpacing: 150,
|
|
||||||
nodeFillColor: 'yellow',
|
|
||||||
nodeStrokeWidth: 2,
|
|
||||||
nodeStrokeColor: 'grey',
|
|
||||||
lineStrokeWidth: 4,
|
|
||||||
branchOffset: 50,
|
|
||||||
lineColor: 'grey',
|
|
||||||
leftMargin: 50,
|
|
||||||
branchColors: ['#442f74', '#983351', '#609732', '#AA9A39'],
|
|
||||||
nodeRadius: 10,
|
|
||||||
nodeLabel: {
|
nodeLabel: {
|
||||||
width: 75,
|
width: 75,
|
||||||
height: 100,
|
height: 100,
|
||||||
x: -25,
|
x: -25,
|
||||||
y: 0
|
y: 0
|
||||||
}
|
},
|
||||||
|
mainBranchName: 'main',
|
||||||
|
showCommitLabel: true,
|
||||||
|
showBranches: true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
||||||
config.git.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
config.gitGraph.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
||||||
|
|
||||||
var keyify = function keyify(obj) {
|
var keyify = function keyify(obj) {
|
||||||
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
||||||
@@ -19826,33 +19801,34 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
/* harmony export */ "setDirection": () => (/* binding */ setDirection),
|
/* harmony export */ "setDirection": () => (/* binding */ setDirection),
|
||||||
/* harmony export */ "setOptions": () => (/* binding */ setOptions)
|
/* harmony export */ "setOptions": () => (/* binding */ setOptions)
|
||||||
/* harmony export */ });
|
/* harmony export */ });
|
||||||
/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
|
/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
|
||||||
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
|
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
|
||||||
/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js");
|
/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js");
|
||||||
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../config */ "./src/config.js");
|
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../config */ "./src/config.js");
|
||||||
/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js");
|
/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var mainBranchName = (0,_config__WEBPACK_IMPORTED_MODULE_0__.getConfig)().gitGraph.mainBranchName;
|
||||||
var commits = {};
|
var commits = {};
|
||||||
var head = null;
|
var head = null;
|
||||||
var branches = {
|
var branches = {};
|
||||||
main: head
|
branches[mainBranchName] = head;
|
||||||
};
|
var curBranch = mainBranchName;
|
||||||
var curBranch = 'main';
|
|
||||||
var direction = 'LR';
|
var direction = 'LR';
|
||||||
var seq = 0;
|
var seq = 0;
|
||||||
|
|
||||||
function getId() {
|
function getId() {
|
||||||
return (0,_utils__WEBPACK_IMPORTED_MODULE_0__.random)({
|
return (0,_utils__WEBPACK_IMPORTED_MODULE_1__.random)({
|
||||||
length: 7
|
length: 7
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var parseDirective = function parseDirective(statement, context, type) {
|
var parseDirective = function parseDirective(statement, context, type) {
|
||||||
_mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].parseDirective(this, statement, context, type);
|
_mermaidAPI__WEBPACK_IMPORTED_MODULE_2__["default"].parseDirective(this, statement, context, type);
|
||||||
}; // /**
|
}; // /**
|
||||||
// * @param currentCommit
|
// * @param currentCommit
|
||||||
// * @param otherCommit
|
// * @param otherCommit
|
||||||
@@ -19913,24 +19889,24 @@ var setDirection = function setDirection(dir) {
|
|||||||
};
|
};
|
||||||
var options = {};
|
var options = {};
|
||||||
var setOptions = function setOptions(rawOptString) {
|
var setOptions = function setOptions(rawOptString) {
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('options str', rawOptString);
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('options str', rawOptString);
|
||||||
rawOptString = rawOptString && rawOptString.trim();
|
rawOptString = rawOptString && rawOptString.trim();
|
||||||
rawOptString = rawOptString || '{}';
|
rawOptString = rawOptString || '{}';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
options = JSON.parse(rawOptString);
|
options = JSON.parse(rawOptString);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.error('error while parsing gitGraph options', e.message);
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.error('error while parsing gitGraph options', e.message);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var getOptions = function getOptions() {
|
var getOptions = function getOptions() {
|
||||||
return options;
|
return options;
|
||||||
};
|
};
|
||||||
var commit = function commit(msg, id, type, tag) {
|
var commit = function commit(msg, id, type, tag) {
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('Entering commit:', msg, id, type, tag);
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('Entering commit:', msg, id, type, tag);
|
||||||
id = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(id, _config__WEBPACK_IMPORTED_MODULE_4__.getConfig());
|
id = _common_common__WEBPACK_IMPORTED_MODULE_4__["default"].sanitizeText(id, _config__WEBPACK_IMPORTED_MODULE_0__.getConfig());
|
||||||
msg = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(msg, _config__WEBPACK_IMPORTED_MODULE_4__.getConfig());
|
msg = _common_common__WEBPACK_IMPORTED_MODULE_4__["default"].sanitizeText(msg, _config__WEBPACK_IMPORTED_MODULE_0__.getConfig());
|
||||||
tag = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(tag, _config__WEBPACK_IMPORTED_MODULE_4__.getConfig());
|
tag = _common_common__WEBPACK_IMPORTED_MODULE_4__["default"].sanitizeText(tag, _config__WEBPACK_IMPORTED_MODULE_0__.getConfig());
|
||||||
var commit = {
|
var commit = {
|
||||||
id: id ? id : seq + '-' + getId(),
|
id: id ? id : seq + '-' + getId(),
|
||||||
message: msg,
|
message: msg,
|
||||||
@@ -19943,15 +19919,15 @@ var commit = function commit(msg, id, type, tag) {
|
|||||||
head = commit;
|
head = commit;
|
||||||
commits[commit.id] = commit;
|
commits[commit.id] = commit;
|
||||||
branches[curBranch] = commit.id;
|
branches[curBranch] = commit.id;
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('in pushCommit ' + commit.id);
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('in pushCommit ' + commit.id);
|
||||||
};
|
};
|
||||||
var branch = function branch(name) {
|
var branch = function branch(name) {
|
||||||
name = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(name, _config__WEBPACK_IMPORTED_MODULE_4__.getConfig());
|
name = _common_common__WEBPACK_IMPORTED_MODULE_4__["default"].sanitizeText(name, _config__WEBPACK_IMPORTED_MODULE_0__.getConfig());
|
||||||
|
|
||||||
if (typeof branches[name] === 'undefined') {
|
if (typeof branches[name] === 'undefined') {
|
||||||
branches[name] = head != null ? head.id : null;
|
branches[name] = head != null ? head.id : null;
|
||||||
checkout(name);
|
checkout(name);
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('in createBranch');
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('in createBranch');
|
||||||
} else {
|
} else {
|
||||||
var error = new Error('Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ' + name + '")');
|
var error = new Error('Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ' + name + '")');
|
||||||
error.hash = {
|
error.hash = {
|
||||||
@@ -19970,7 +19946,7 @@ var branch = function branch(name) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
var merge = function merge(otherBranch) {
|
var merge = function merge(otherBranch) {
|
||||||
otherBranch = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(otherBranch, _config__WEBPACK_IMPORTED_MODULE_4__.getConfig());
|
otherBranch = _common_common__WEBPACK_IMPORTED_MODULE_4__["default"].sanitizeText(otherBranch, _config__WEBPACK_IMPORTED_MODULE_0__.getConfig());
|
||||||
var currentCommit = commits[branches[curBranch]];
|
var currentCommit = commits[branches[curBranch]];
|
||||||
var otherCommit = commits[branches[otherBranch]];
|
var otherCommit = commits[branches[otherBranch]];
|
||||||
|
|
||||||
@@ -20076,12 +20052,11 @@ var merge = function merge(otherBranch) {
|
|||||||
commits[commit.id] = commit;
|
commits[commit.id] = commit;
|
||||||
branches[curBranch] = commit.id; // }
|
branches[curBranch] = commit.id; // }
|
||||||
|
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug(branches);
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug(branches);
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('in mergeBranch');
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('in mergeBranch');
|
||||||
};
|
};
|
||||||
var checkout = function checkout(branch) {
|
var checkout = function checkout(branch) {
|
||||||
branch = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(branch, _config__WEBPACK_IMPORTED_MODULE_4__.getConfig());
|
branch = _common_common__WEBPACK_IMPORTED_MODULE_4__["default"].sanitizeText(branch, _config__WEBPACK_IMPORTED_MODULE_0__.getConfig());
|
||||||
console.info(branches);
|
|
||||||
|
|
||||||
if (typeof branches[branch] === 'undefined') {
|
if (typeof branches[branch] === 'undefined') {
|
||||||
var error = new Error('Trying to checkout branch which is not yet created. (Help try using "branch ' + branch + '")');
|
var error = new Error('Trying to checkout branch which is not yet created. (Help try using "branch ' + branch + '")');
|
||||||
@@ -20102,9 +20077,6 @@ var checkout = function checkout(branch) {
|
|||||||
} else {
|
} else {
|
||||||
curBranch = branch;
|
curBranch = branch;
|
||||||
var id = branches[curBranch];
|
var id = branches[curBranch];
|
||||||
console.log(id);
|
|
||||||
console.log('hi');
|
|
||||||
console.log(commits);
|
|
||||||
head = commits[id];
|
head = commits[id];
|
||||||
}
|
}
|
||||||
}; // export const reset = function (commitRef) {
|
}; // export const reset = function (commitRef) {
|
||||||
@@ -20163,7 +20135,7 @@ function prettyPrintCommitHistory(commitArr) {
|
|||||||
if (branches[_branch] === commit.id) label.push(_branch);
|
if (branches[_branch] === commit.id) label.push(_branch);
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug(label.join(' '));
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug(label.join(' '));
|
||||||
|
|
||||||
if (commit.parents && commit.parents.length == 2) {
|
if (commit.parents && commit.parents.length == 2) {
|
||||||
var newCommit = commits[commit.parents[0]];
|
var newCommit = commits[commit.parents[0]];
|
||||||
@@ -20183,17 +20155,17 @@ function prettyPrintCommitHistory(commitArr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var prettyPrint = function prettyPrint() {
|
var prettyPrint = function prettyPrint() {
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug(commits);
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug(commits);
|
||||||
var node = getCommitsArray()[0];
|
var node = getCommitsArray()[0];
|
||||||
prettyPrintCommitHistory([node]);
|
prettyPrintCommitHistory([node]);
|
||||||
};
|
};
|
||||||
var clear = function clear() {
|
var clear = function clear() {
|
||||||
commits = {};
|
commits = {};
|
||||||
head = null;
|
head = null;
|
||||||
branches = {
|
var mainBranch = (0,_config__WEBPACK_IMPORTED_MODULE_0__.getConfig)().gitGraph.mainBranchName;
|
||||||
main: head
|
branches = {};
|
||||||
};
|
branches[mainBranch] = null;
|
||||||
curBranch = 'main';
|
curBranch = mainBranch;
|
||||||
seq = 0;
|
seq = 0;
|
||||||
};
|
};
|
||||||
var getBranchesAsObjArray = function getBranchesAsObjArray() {
|
var getBranchesAsObjArray = function getBranchesAsObjArray() {
|
||||||
@@ -20219,7 +20191,7 @@ var getCommitsArray = function getCommitsArray() {
|
|||||||
return commits[key];
|
return commits[key];
|
||||||
});
|
});
|
||||||
commitArr.forEach(function (o) {
|
commitArr.forEach(function (o) {
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug(o.id);
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug(o.id);
|
||||||
});
|
});
|
||||||
commitArr.sort(function (a, b) {
|
commitArr.sort(function (a, b) {
|
||||||
return a.seq - b.seq;
|
return a.seq - b.seq;
|
||||||
@@ -20244,7 +20216,7 @@ var commitType = {
|
|||||||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
||||||
parseDirective: parseDirective,
|
parseDirective: parseDirective,
|
||||||
getConfig: function getConfig() {
|
getConfig: function getConfig() {
|
||||||
return _config__WEBPACK_IMPORTED_MODULE_4__.getConfig().gitGraph;
|
return _config__WEBPACK_IMPORTED_MODULE_0__.getConfig().gitGraph;
|
||||||
},
|
},
|
||||||
setDirection: setDirection,
|
setDirection: setDirection,
|
||||||
setOptions: setOptions,
|
setOptions: setOptions,
|
||||||
@@ -20282,26 +20254,19 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
/* harmony export */ });
|
/* harmony export */ });
|
||||||
/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "./node_modules/d3/src/index.js");
|
/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "./node_modules/d3/src/index.js");
|
||||||
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
|
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
|
||||||
/* harmony import */ var _gitGraphAst__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./gitGraphAst */ "./src/diagrams/git/gitGraphAst.js");
|
/* harmony import */ var _gitGraphAst__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./gitGraphAst */ "./src/diagrams/git/gitGraphAst.js");
|
||||||
/* harmony import */ var _parser_gitGraph__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/gitGraph */ "./src/diagrams/git/parser/gitGraph.jison");
|
/* harmony import */ var _parser_gitGraph__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parser/gitGraph */ "./src/diagrams/git/parser/gitGraph.jison");
|
||||||
/* harmony import */ var _parser_gitGraph__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_gitGraph__WEBPACK_IMPORTED_MODULE_3__);
|
/* harmony import */ var _parser_gitGraph__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_parser_gitGraph__WEBPACK_IMPORTED_MODULE_2__);
|
||||||
/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
|
/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
|
||||||
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../config */ "./src/config.js");
|
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../config */ "./src/config.js");
|
||||||
/* eslint-disable */
|
|
||||||
|
|
||||||
|
|
||||||
//import * as db from './mockDb';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* eslint-disable */
|
|
||||||
|
|
||||||
//import * as configApi from '../../config';
|
|
||||||
|
|
||||||
var allCommitsDict = {};
|
var allCommitsDict = {};
|
||||||
var branchNum; //let conf = configApi.getConfig();
|
var branchNum;
|
||||||
//const commitType = db.commitType;
|
|
||||||
|
|
||||||
var commitType = {
|
var commitType = {
|
||||||
NORMAL: 0,
|
NORMAL: 0,
|
||||||
REVERSE: 1,
|
REVERSE: 1,
|
||||||
@@ -20319,46 +20284,18 @@ var clear = function clear() {
|
|||||||
allCommitsDict = {};
|
allCommitsDict = {};
|
||||||
maxPos = 0;
|
maxPos = 0;
|
||||||
lanes = [];
|
lanes = [];
|
||||||
}; // let apiConfig = {};
|
};
|
||||||
// export const setConf = function(c) {
|
|
||||||
// apiConfig = c;
|
|
||||||
// };
|
|
||||||
|
|
||||||
/** @param svg */
|
|
||||||
|
|
||||||
|
|
||||||
function svgCreateDefs(svg) {
|
|
||||||
var config = (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().gitGraph;
|
|
||||||
svg.append('defs').append('g').attr('id', 'def-commit').append('circle').attr('r', config.nodeRadius).attr('cx', 0).attr('cy', 0);
|
|
||||||
svg.select('#def-commit').append('foreignObject').attr('width', config.nodeLabel.width).attr('height', config.nodeLabel.height).attr('x', config.nodeLabel.x).attr('y', config.nodeLabel.y).attr('class', 'node-label').attr('requiredFeatures', 'http://www.w3.org/TR/SVG11/feature#Extensibility').append('p').html('');
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @param svg
|
* Draws a text, used for labels of the branches
|
||||||
* @param points
|
|
||||||
* @param colorIdx
|
|
||||||
* @param interpolate
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
// Pass in the element and its pre-transform coords
|
|
||||||
*
|
*
|
||||||
* @param element
|
* @param {string} txt The text
|
||||||
* @param coords
|
* @returns {SVGElement}
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param svg
|
|
||||||
* @param fromId
|
|
||||||
* @param toId
|
|
||||||
* @param direction
|
|
||||||
* @param color
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
var drawText = function drawText(txt) {
|
var drawText = function drawText(txt) {
|
||||||
var svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text'); // svgLabel.setAttribute('style', style.replace('color:', 'fill:'));
|
var svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text');
|
||||||
|
var rows = []; // Handling of new lines in the label
|
||||||
var rows = [];
|
|
||||||
|
|
||||||
if (typeof txt === 'string') {
|
if (typeof txt === 'string') {
|
||||||
rows = txt.split(/\\n|\n|<br\s*\/?>/gi);
|
rows = txt.split(/\\n|\n|<br\s*\/?>/gi);
|
||||||
@@ -20385,8 +20322,19 @@ var drawText = function drawText(txt) {
|
|||||||
|
|
||||||
return svgLabel;
|
return svgLabel;
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* Draws the commits with its symbol and labels. The function has tywo modes, one which only
|
||||||
|
* calculates the positions and one that does the actual drawing. This for a simple way getting the
|
||||||
|
* vertical leyering rcorrect in the graph.
|
||||||
|
*
|
||||||
|
* @param {any} svg
|
||||||
|
* @param {any} commits
|
||||||
|
* @param {any} modifyGraph
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
var drawCommits = function drawCommits(svg, commits, modifyGraph) {
|
var drawCommits = function drawCommits(svg, commits, modifyGraph) {
|
||||||
|
var gitGraphConfig = (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().gitGraph;
|
||||||
var gBullets = svg.append('g').attr('class', 'commit-bullets');
|
var gBullets = svg.append('g').attr('class', 'commit-bullets');
|
||||||
var gLabels = svg.append('g').attr('class', 'commit-labels');
|
var gLabels = svg.append('g').attr('class', 'commit-labels');
|
||||||
var pos = 0;
|
var pos = 0;
|
||||||
@@ -20397,7 +20345,7 @@ var drawCommits = function drawCommits(svg, commits, modifyGraph) {
|
|||||||
sortedKeys.forEach(function (key, index) {
|
sortedKeys.forEach(function (key, index) {
|
||||||
var commit = commits[key];
|
var commit = commits[key];
|
||||||
var y = branchPos[commit.branch].pos;
|
var y = branchPos[commit.branch].pos;
|
||||||
var x = pos + 10; // Don't draw the commits now but calculate the positioning which is used by the branmch lines etc.
|
var x = pos + 10; // Don't draw the commits now but calculate the positioning which is used by the branch lines etc.
|
||||||
|
|
||||||
if (modifyGraph) {
|
if (modifyGraph) {
|
||||||
var typeClass;
|
var typeClass;
|
||||||
@@ -20466,9 +20414,9 @@ var drawCommits = function drawCommits(svg, commits, modifyGraph) {
|
|||||||
|
|
||||||
if (modifyGraph) {
|
if (modifyGraph) {
|
||||||
var px = 4;
|
var px = 4;
|
||||||
var py = 2;
|
var py = 2; // Draw the commit label
|
||||||
|
|
||||||
if (commit.type !== commitType.MERGE) {
|
if (commit.type !== commitType.MERGE && gitGraphConfig.showCommitLabel) {
|
||||||
var labelBkg = gLabels.insert('rect').attr('class', 'commit-label-bkg');
|
var labelBkg = gLabels.insert('rect').attr('class', 'commit-label-bkg');
|
||||||
var text = gLabels.append('text').attr('x', pos).attr('y', y + 25).attr('class', 'commit-label').text(commit.id);
|
var text = gLabels.append('text').attr('x', pos).attr('y', y + 25).attr('class', 'commit-label').text(commit.id);
|
||||||
var bbox = text.node().getBBox(); // Now we have the label, lets position the background
|
var bbox = text.node().getBBox(); // Now we have the label, lets position the background
|
||||||
@@ -20499,9 +20447,12 @@ var drawCommits = function drawCommits(svg, commits, modifyGraph) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* Detect if there are other commits between commit1s x-position and commit2s x-position on the same branch as commit2.
|
* Detect if there are other commits between commit1s x-position and commit2s x-position on the same
|
||||||
* @param {*} commit1
|
* branch as commit2.
|
||||||
* @param {*} commit2
|
*
|
||||||
|
* @param {any} commit1
|
||||||
|
* @param {any} commit2
|
||||||
|
* @param allCommits
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -20517,7 +20468,13 @@ var hasOverlappingCommits = function hasOverlappingCommits(commit1, commit2, all
|
|||||||
return overlappingComits.length > 0;
|
return overlappingComits.length > 0;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
|
* This function find a lane in the y-axis that is not overlapping with any other lanes. This is
|
||||||
|
* used for drawing the lines between commits.
|
||||||
*
|
*
|
||||||
|
* @param {any} y1
|
||||||
|
* @param {any} y2
|
||||||
|
* @param {any} _depth
|
||||||
|
* @returns
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -20545,13 +20502,22 @@ var findLane = function findLane(y1, y2, _depth) {
|
|||||||
var diff = Math.abs(y1 - y2);
|
var diff = Math.abs(y1 - y2);
|
||||||
return findLane(y1, y2 - diff / 5, depth);
|
return findLane(y1, y2 - diff / 5, depth);
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* This function draw trhe lines between the commits. They were arrows initially.
|
||||||
|
*
|
||||||
|
* @param {any} svg
|
||||||
|
* @param {any} commit1
|
||||||
|
* @param {any} commit2
|
||||||
|
* @param {any} allCommits
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
var drawArrow = function drawArrow(svg, commit1, commit2, allCommits) {
|
var drawArrow = function drawArrow(svg, commit1, commit2, allCommits) {
|
||||||
var conf = (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)();
|
var conf = (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)();
|
||||||
var p1 = commitPos[commit1.id];
|
var p1 = commitPos[commit1.id];
|
||||||
var p2 = commitPos[commit2.id];
|
var p2 = commitPos[commit2.id];
|
||||||
var overlappingCommits = hasOverlappingCommits(commit1, commit2, allCommits);
|
var overlappingCommits = hasOverlappingCommits(commit1, commit2, allCommits); // log.debug('drawArrow', p1, p2, overlappingCommits, commit1.id, commit2.id);
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('drawArrow', p1, p2, overlappingCommits, commit1.id, commit2.id);
|
|
||||||
var url = '';
|
var url = '';
|
||||||
|
|
||||||
if (conf.arrowMarkerAbsolute) {
|
if (conf.arrowMarkerAbsolute) {
|
||||||
@@ -20624,6 +20590,8 @@ var drawArrows = function drawArrows(svg, commits) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
|
* This function adds the branches and the branches' labels to the svg.
|
||||||
|
*
|
||||||
* @param svg
|
* @param svg
|
||||||
* @param commitid
|
* @param commitid
|
||||||
* @param branches
|
* @param branches
|
||||||
@@ -20632,6 +20600,7 @@ var drawArrows = function drawArrows(svg, commits) {
|
|||||||
|
|
||||||
|
|
||||||
var drawBranches = function drawBranches(svg, branches) {
|
var drawBranches = function drawBranches(svg, branches) {
|
||||||
|
var gitGraphConfig = (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().gitGraph;
|
||||||
var g = svg.append('g');
|
var g = svg.append('g');
|
||||||
branches.forEach(function (branch, index) {
|
branches.forEach(function (branch, index) {
|
||||||
var pos = branchPos[branch.name].pos;
|
var pos = branchPos[branch.name].pos;
|
||||||
@@ -20641,9 +20610,10 @@ var drawBranches = function drawBranches(svg, branches) {
|
|||||||
line.attr('x2', maxPos);
|
line.attr('x2', maxPos);
|
||||||
line.attr('y2', pos);
|
line.attr('y2', pos);
|
||||||
line.attr('class', 'branch branch' + index);
|
line.attr('class', 'branch branch' + index);
|
||||||
lanes.push(pos); // Create the actual text element
|
lanes.push(pos);
|
||||||
|
var name = index === 0 ? gitGraphConfig.mainBranchName : branch.name; // Create the actual text element
|
||||||
|
|
||||||
var labelElement = drawText(branch.name); // Create outer g, edgeLabel, this will be positioned after graph layout
|
var labelElement = drawText(name); // Create outer g, edgeLabel, this will be positioned after graph layout
|
||||||
|
|
||||||
var bkg = g.insert('rect');
|
var bkg = g.insert('rect');
|
||||||
var branchLabel = g.insert('g').attr('class', 'branchLabel'); // Create inner g, label, this will be positioned now for centering the text
|
var branchLabel = g.insert('g').attr('class', 'branchLabel'); // Create inner g, label, this will be positioned now for centering the text
|
||||||
@@ -20661,24 +20631,26 @@ var drawBranches = function drawBranches(svg, branches) {
|
|||||||
* @param commit
|
* @param commit
|
||||||
* @param direction
|
* @param direction
|
||||||
* @param branchColor
|
* @param branchColor
|
||||||
|
* @param txt
|
||||||
|
* @param id
|
||||||
|
* @param ver
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
var draw = function draw(txt, id, ver) {
|
var draw = function draw(txt, id, ver) {
|
||||||
clear();
|
clear();
|
||||||
var conf = (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)();
|
var conf = (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)();
|
||||||
var config = conf.gitGraph; // try {
|
var gitGraphConfig = (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().gitGraph; // try {
|
||||||
|
|
||||||
var parser = (_parser_gitGraph__WEBPACK_IMPORTED_MODULE_3___default().parser);
|
var parser = (_parser_gitGraph__WEBPACK_IMPORTED_MODULE_2___default().parser);
|
||||||
parser.yy = _gitGraphAst__WEBPACK_IMPORTED_MODULE_4__["default"];
|
parser.yy = _gitGraphAst__WEBPACK_IMPORTED_MODULE_3__["default"];
|
||||||
parser.yy.clear();
|
parser.yy.clear();
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('in gitgraph renderer', txt + '\n', 'id:', id, ver); // // Parse the graph definition
|
_logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('in gitgraph renderer', txt + '\n', 'id:', id, ver); // // Parse the graph definition
|
||||||
|
|
||||||
parser.parse(txt + '\n'); // config = Object.assign(config, apiConfig, db.getOptions());
|
parser.parse(txt + '\n');
|
||||||
|
var direction = _gitGraphAst__WEBPACK_IMPORTED_MODULE_3__["default"].getDirection();
|
||||||
var direction = _gitGraphAst__WEBPACK_IMPORTED_MODULE_4__["default"].getDirection();
|
allCommitsDict = _gitGraphAst__WEBPACK_IMPORTED_MODULE_3__["default"].getCommits();
|
||||||
allCommitsDict = _gitGraphAst__WEBPACK_IMPORTED_MODULE_4__["default"].getCommits();
|
var branches = _gitGraphAst__WEBPACK_IMPORTED_MODULE_3__["default"].getBranchesAsObjArray(); // Position branches vertically
|
||||||
var branches = _gitGraphAst__WEBPACK_IMPORTED_MODULE_4__["default"].getBranchesAsObjArray(); // Position branches vertically
|
|
||||||
|
|
||||||
var pos = 0;
|
var pos = 0;
|
||||||
branches.forEach(function (branch, index) {
|
branches.forEach(function (branch, index) {
|
||||||
@@ -20688,24 +20660,21 @@ var draw = function draw(txt, id, ver) {
|
|||||||
};
|
};
|
||||||
pos += 50;
|
pos += 50;
|
||||||
});
|
});
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('brach pos ', branchPos);
|
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('effective options', config, branches);
|
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('commits', allCommitsDict);
|
|
||||||
var diagram = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)("[id=\"".concat(id, "\"]"));
|
var diagram = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)("[id=\"".concat(id, "\"]"));
|
||||||
svgCreateDefs(diagram);
|
|
||||||
diagram.append('defs').append('marker').attr('id', 'arrowhead').attr('refX', 24).attr('refY', 10).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 24).attr('markerHeight', 24).attr('orient', 'auto').append('path').attr('d', 'M 0 0 L 20 10 L 0 20 z'); // this is actual shape for arrowhead
|
|
||||||
|
|
||||||
drawCommits(diagram, allCommitsDict, false);
|
drawCommits(diagram, allCommitsDict, false);
|
||||||
drawBranches(diagram, branches);
|
|
||||||
|
if (gitGraphConfig.showBranches) {
|
||||||
|
drawBranches(diagram, branches);
|
||||||
|
}
|
||||||
|
|
||||||
drawArrows(diagram, allCommitsDict);
|
drawArrows(diagram, allCommitsDict);
|
||||||
drawCommits(diagram, allCommitsDict, true);
|
drawCommits(diagram, allCommitsDict, true);
|
||||||
var padding = config.diagramPadding;
|
var padding = gitGraphConfig.diagramPadding;
|
||||||
var svgBounds = diagram.node().getBBox();
|
var svgBounds = diagram.node().getBBox();
|
||||||
var width = svgBounds.width + padding * 2;
|
var width = svgBounds.width + padding * 2;
|
||||||
var height = svgBounds.height + padding * 2;
|
var height = svgBounds.height + padding * 2;
|
||||||
(0,_utils__WEBPACK_IMPORTED_MODULE_5__.configureSvgSize)(diagram, height, width, conf.useMaxWidth);
|
(0,_utils__WEBPACK_IMPORTED_MODULE_5__.configureSvgSize)(diagram, height, width, conf.useMaxWidth);
|
||||||
var vBox = "".concat(svgBounds.x - padding, " ").concat(svgBounds.y - padding, " ").concat(width, " ").concat(height); // logger.debug(`viewBox ${vBox}`);
|
var vBox = "".concat(svgBounds.x - padding, " ").concat(svgBounds.y - padding, " ").concat(width, " ").concat(height);
|
||||||
|
|
||||||
diagram.attr('viewBox', vBox);
|
diagram.attr('viewBox', vBox);
|
||||||
};
|
};
|
||||||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
||||||
@@ -26977,7 +26946,7 @@ function parse(text) {
|
|||||||
|
|
||||||
if (graphInit) {
|
if (graphInit) {
|
||||||
reinitialize(graphInit);
|
reinitialize(graphInit);
|
||||||
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('reinit ', graphInit);
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.info('reinit ', graphInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
var graphType = _utils__WEBPACK_IMPORTED_MODULE_2__["default"].detectType(text, cnf);
|
var graphType = _utils__WEBPACK_IMPORTED_MODULE_2__["default"].detectType(text, cnf);
|
||||||
@@ -26985,7 +26954,7 @@ function parse(text) {
|
|||||||
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('Type ' + graphType);
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('Type ' + graphType);
|
||||||
|
|
||||||
switch (graphType) {
|
switch (graphType) {
|
||||||
case 'git':
|
case 'gitGraph':
|
||||||
parser = (_diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_4___default());
|
parser = (_diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_4___default());
|
||||||
parser.parser.yy = _diagrams_git_gitGraphAst__WEBPACK_IMPORTED_MODULE_5__["default"];
|
parser.parser.yy = _diagrams_git_gitGraphAst__WEBPACK_IMPORTED_MODULE_5__["default"];
|
||||||
break;
|
break;
|
||||||
@@ -27149,7 +27118,8 @@ var render = function render(id, _txt, cb, container) {
|
|||||||
_config__WEBPACK_IMPORTED_MODULE_1__.addDirective(graphInit);
|
_config__WEBPACK_IMPORTED_MODULE_1__.addDirective(graphInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
var cnf = _config__WEBPACK_IMPORTED_MODULE_1__.getConfig(); // Check the maximum allowed text size
|
var cnf = _config__WEBPACK_IMPORTED_MODULE_1__.getConfig();
|
||||||
|
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug(cnf); // Check the maximum allowed text size
|
||||||
|
|
||||||
if (_txt.length > cnf.maxTextSize) {
|
if (_txt.length > cnf.maxTextSize) {
|
||||||
txt = 'graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa';
|
txt = 'graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa';
|
||||||
@@ -27301,7 +27271,7 @@ var render = function render(id, _txt, cb, container) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
switch (graphType) {
|
switch (graphType) {
|
||||||
case 'git':
|
case 'gitGraph':
|
||||||
// cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
|
// cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
|
||||||
//gitGraphRenderer.setConf(cnf.git);
|
//gitGraphRenderer.setConf(cnf.git);
|
||||||
_diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_30__["default"].draw(txt, id, false);
|
_diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_30__["default"].draw(txt, id, false);
|
||||||
@@ -27740,7 +27710,7 @@ var themes = {
|
|||||||
class: _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_3__["default"],
|
class: _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_3__["default"],
|
||||||
stateDiagram: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_4__["default"],
|
stateDiagram: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_4__["default"],
|
||||||
state: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_4__["default"],
|
state: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_4__["default"],
|
||||||
git: _diagrams_git_styles__WEBPACK_IMPORTED_MODULE_5__["default"],
|
gitGraph: _diagrams_git_styles__WEBPACK_IMPORTED_MODULE_5__["default"],
|
||||||
info: _diagrams_info_styles__WEBPACK_IMPORTED_MODULE_6__["default"],
|
info: _diagrams_info_styles__WEBPACK_IMPORTED_MODULE_6__["default"],
|
||||||
pie: _diagrams_pie_styles__WEBPACK_IMPORTED_MODULE_7__["default"],
|
pie: _diagrams_pie_styles__WEBPACK_IMPORTED_MODULE_7__["default"],
|
||||||
er: _diagrams_er_styles__WEBPACK_IMPORTED_MODULE_8__["default"],
|
er: _diagrams_er_styles__WEBPACK_IMPORTED_MODULE_8__["default"],
|
||||||
@@ -28075,14 +28045,14 @@ var Theme = /*#__PURE__*/function () {
|
|||||||
this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git7, 25);
|
this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git7, 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.gitInv0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0);
|
this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0);
|
||||||
this.gitInv1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1);
|
this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1);
|
||||||
this.gitInv2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2);
|
this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2);
|
||||||
this.gitInv3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3);
|
this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3);
|
||||||
this.gitInv4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4);
|
this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4);
|
||||||
this.gitInv5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5);
|
this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5);
|
||||||
this.gitInv6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6);
|
this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6);
|
||||||
this.gitInv7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7);
|
this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7);
|
||||||
this.branchLabelColor = this.branchLabelColor || (this.darkMode ? 'black' : this.labelTextColor);
|
this.branchLabelColor = this.branchLabelColor || (this.darkMode ? 'black' : this.labelTextColor);
|
||||||
this.gitBranchLabel0 = this.gitBranchLabel0 || this.branchLabelColor;
|
this.gitBranchLabel0 = this.gitBranchLabel0 || this.branchLabelColor;
|
||||||
this.gitBranchLabel1 = this.gitBranchLabel1 || this.branchLabelColor;
|
this.gitBranchLabel1 = this.gitBranchLabel1 || this.branchLabelColor;
|
||||||
@@ -28375,14 +28345,14 @@ var Theme = /*#__PURE__*/function () {
|
|||||||
this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, {
|
this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.lighten)(this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, {
|
||||||
h: +120
|
h: +120
|
||||||
}), 20);
|
}), 20);
|
||||||
this.gitInv0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0);
|
this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0);
|
||||||
this.gitInv1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1);
|
this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1);
|
||||||
this.gitInv2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2);
|
this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2);
|
||||||
this.gitInv3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3);
|
this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3);
|
||||||
this.gitInv4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4);
|
this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4);
|
||||||
this.gitInv5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5);
|
this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5);
|
||||||
this.gitInv6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6);
|
this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6);
|
||||||
this.gitInv7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7);
|
this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7);
|
||||||
this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
||||||
this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
||||||
this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
||||||
@@ -28727,22 +28697,22 @@ var Theme = /*#__PURE__*/function () {
|
|||||||
this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git7, 25);
|
this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git7, 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.gitInv0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)((0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0), 25);
|
this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)((0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0), 25);
|
||||||
this.gitInv1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1);
|
this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1);
|
||||||
this.gitInv2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2);
|
this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2);
|
||||||
this.gitInv3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3);
|
this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3);
|
||||||
this.gitInv4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4);
|
this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4);
|
||||||
this.gitInv5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5);
|
this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5);
|
||||||
this.gitInv6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6);
|
this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6);
|
||||||
this.gitInv7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7);
|
this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7);
|
||||||
this.gitBranchLabel0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.labelTextColor);
|
this.gitBranchLabel0 = this.gitBranchLabel0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.labelTextColor);
|
||||||
this.gitBranchLabel1 = this.labelTextColor;
|
this.gitBranchLabel1 = this.gitBranchLabel1 || this.labelTextColor;
|
||||||
this.gitBranchLabel2 = this.labelTextColor;
|
this.gitBranchLabel2 = this.gitBranchLabel2 || this.labelTextColor;
|
||||||
this.gitBranchLabel3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.labelTextColor);
|
this.gitBranchLabel3 = this.gitBranchLabel3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.labelTextColor);
|
||||||
this.gitBranchLabel4 = this.labelTextColor;
|
this.gitBranchLabel4 = this.gitBranchLabel4 || this.labelTextColor;
|
||||||
this.gitBranchLabel5 = this.labelTextColor;
|
this.gitBranchLabel5 = this.gitBranchLabel5 || this.labelTextColor;
|
||||||
this.gitBranchLabel6 = this.labelTextColor;
|
this.gitBranchLabel6 = this.gitBranchLabel6 || this.labelTextColor;
|
||||||
this.gitBranchLabel7 = this.labelTextColor;
|
this.gitBranchLabel7 = this.gitBranchLabel7 || this.labelTextColor;
|
||||||
this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
||||||
this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
||||||
this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
||||||
@@ -29055,14 +29025,14 @@ var Theme = /*#__PURE__*/function () {
|
|||||||
this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git7, 25);
|
this.git7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.darken)(this.git7, 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.gitInv0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0);
|
this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0);
|
||||||
this.gitInv1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1);
|
this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1);
|
||||||
this.gitInv2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2);
|
this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2);
|
||||||
this.gitInv3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3);
|
this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3);
|
||||||
this.gitInv4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4);
|
this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4);
|
||||||
this.gitInv5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5);
|
this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5);
|
||||||
this.gitInv6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6);
|
this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6);
|
||||||
this.gitInv7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7);
|
this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7);
|
||||||
this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
this.tagLabelColor = this.tagLabelColor || this.primaryTextColor;
|
||||||
this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
this.tagLabelBackground = this.tagLabelBackground || this.primaryColor;
|
||||||
this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
this.tagLabelBorder = this.tagBorder || this.primaryBorderColor;
|
||||||
@@ -29394,14 +29364,14 @@ var Theme = /*#__PURE__*/function () {
|
|||||||
this.git7 = this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, {
|
this.git7 = this.pie8 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, {
|
||||||
h: +120
|
h: +120
|
||||||
});
|
});
|
||||||
this.gitInv0 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0);
|
this.gitInv0 = this.gitInv0 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git0);
|
||||||
this.gitInv1 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1);
|
this.gitInv1 = this.gitInv1 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git1);
|
||||||
this.gitInv2 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2);
|
this.gitInv2 = this.gitInv2 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git2);
|
||||||
this.gitInv3 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3);
|
this.gitInv3 = this.gitInv3 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git3);
|
||||||
this.gitInv4 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4);
|
this.gitInv4 = this.gitInv4 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git4);
|
||||||
this.gitInv5 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5);
|
this.gitInv5 = this.gitInv5 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git5);
|
||||||
this.gitInv6 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6);
|
this.gitInv6 = this.gitInv6 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git6);
|
||||||
this.gitInv7 = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7);
|
this.gitInv7 = this.gitInv7 || (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.git7);
|
||||||
this.branchLabelColor = this.branchLabelColor || this.labelTextColor;
|
this.branchLabelColor = this.branchLabelColor || this.labelTextColor;
|
||||||
this.gitBranchLabel0 = this.branchLabelColor;
|
this.gitBranchLabel0 = this.branchLabelColor;
|
||||||
this.gitBranchLabel1 = 'white';
|
this.gitBranchLabel1 = 'white';
|
||||||
@@ -29721,7 +29691,7 @@ var detectType = function detectType(text, cnf) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (text.match(/^\s*gitGraph/)) {
|
if (text.match(/^\s*gitGraph/)) {
|
||||||
return 'git';
|
return 'gitGraph';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (text.match(/^\s*flowchart/)) {
|
if (text.match(/^\s*flowchart/)) {
|
||||||
@@ -129115,7 +129085,7 @@ function combine (array, callback) {
|
|||||||
/***/ ((module) => {
|
/***/ ((module) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
module.exports = JSON.parse('{"name":"mermaid","version":"8.14.0","description":"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.","main":"dist/mermaid.core.js","module":"dist/mermaid.esm.min.mjs","exports":{".":{"require":"./dist/mermaid.core.js","import":"./dist/mermaid.esm.min.mjs"},"./*":"./*"},"keywords":["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph"],"scripts":{"build:development":"webpack --mode development --progress --color","build:production":"webpack --mode production --progress --color","build":"concurrently \\"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:development --watch","release":"yarn build","lint":"eslint ./ --ext js,html","lint:fix":"yarn lint --fix","e2e:depr":"yarn lint && jest e2e --config e2e/jest.config.js","cypress":"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 serve --config ./.webpack/webpack.config.e2e.babel.js","test":"yarn lint && jest src/.*","test:watch":"jest --watch src","prepublishOnly":"yarn build && yarn test","prepare":"husky install && yarn build","pre-commit":"lint-staged"},"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":"^6.0.0","caniuse-lite":"^1.0.30001325","cypress-image-snapshot":"^4.0.1","d3":"^7.0.0","dagre":"^0.8.5","dagre-d3":"^0.6.4","dompurify":"2.3.6","graphlib":"^2.1.8","khroma":"^1.4.1","moment-mini":"^2.24.0","stylis":"^4.0.10"},"devDependencies":{"@babel/core":"^7.14.6","@babel/eslint-parser":"^7.14.7","@babel/preset-env":"^7.14.7","@babel/register":"^7.14.5","@commitlint/cli":"^16.0.0","@commitlint/config-conventional":"^16.0.0","babel-jest":"^27.0.6","babel-loader":"^8.2.2","concurrently":"^7.0.0","coveralls":"^3.0.2","css-to-string-loader":"^0.1.3","cypress":"9.5.2","documentation":"13.2.0","eslint":"^8.2.0","eslint-config-prettier":"^8.3.0","eslint-plugin-cypress":"^2.12.1","eslint-plugin-html":"^6.2.0","eslint-plugin-jest":"^26.0.0","eslint-plugin-jsdoc":"^38.0.3","eslint-plugin-markdown":"^2.2.1","eslint-plugin-prettier":"^4.0.0","husky":"^7.0.1","identity-obj-proxy":"^3.0.0","jest":"^27.0.6","jison":"^0.4.18","js-base64":"3.7.2","lint-staged":"^12.1.2","moment":"^2.23.0","path-browserify":"^1.0.1","prettier":"^2.3.2","prettier-plugin-jsdoc":"^0.3.30","start-server-and-test":"^1.12.6","terser-webpack-plugin":"^5.2.4","webpack":"^5.53.0","webpack-cli":"^4.7.2","webpack-dev-server":"^4.3.0","webpack-merge":"^5.8.0","webpack-node-externals":"^3.0.0"},"files":["dist"],"sideEffects":["**/*.css","**/*.scss"]}');
|
module.exports = JSON.parse('{"name":"mermaid","version":"9.0.0","description":"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.","main":"dist/mermaid.core.js","module":"dist/mermaid.esm.min.mjs","exports":{".":{"require":"./dist/mermaid.core.js","import":"./dist/mermaid.esm.min.mjs"},"./*":"./*"},"keywords":["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph"],"scripts":{"build:development":"webpack --mode development --progress --color","build:production":"webpack --mode production --progress --color","build":"concurrently \\"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:development --watch","release":"yarn build","lint":"eslint ./ --ext js,html","lint:fix":"yarn lint --fix","e2e:depr":"yarn lint && jest e2e --config e2e/jest.config.js","cypress":"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 serve --config ./.webpack/webpack.config.e2e.babel.js","test":"yarn lint && jest src/.*","test:watch":"jest --watch src","prepublishOnly":"yarn build && yarn test","prepare":"husky install && yarn build","pre-commit":"lint-staged"},"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":"^6.0.0","cypress-image-snapshot":"^4.0.1","d3":"^7.0.0","dagre":"^0.8.5","dagre-d3":"^0.6.4","dompurify":"2.3.6","graphlib":"^2.1.8","khroma":"^1.4.1","moment-mini":"^2.24.0","stylis":"^4.0.10"},"devDependencies":{"@babel/core":"^7.14.6","@babel/eslint-parser":"^7.14.7","@babel/preset-env":"^7.14.7","@babel/register":"^7.14.5","@commitlint/cli":"^16.0.0","@commitlint/config-conventional":"^16.0.0","babel-jest":"^27.0.6","babel-loader":"^8.2.2","concurrently":"^7.0.0","coveralls":"^3.0.2","css-to-string-loader":"^0.1.3","cypress":"9.5.2","documentation":"13.2.0","eslint":"^8.2.0","eslint-config-prettier":"^8.3.0","eslint-plugin-cypress":"^2.12.1","eslint-plugin-html":"^6.2.0","eslint-plugin-jest":"^26.0.0","eslint-plugin-jsdoc":"^38.0.3","eslint-plugin-markdown":"^2.2.1","eslint-plugin-prettier":"^4.0.0","husky":"^7.0.1","identity-obj-proxy":"^3.0.0","jest":"^27.0.6","jison":"^0.4.18","js-base64":"3.7.2","lint-staged":"^12.1.2","moment":"^2.23.0","path-browserify":"^1.0.1","prettier":"^2.3.2","prettier-plugin-jsdoc":"^0.3.30","start-server-and-test":"^1.12.6","terser-webpack-plugin":"^5.2.4","webpack":"^5.53.0","webpack-cli":"^4.7.2","webpack-dev-server":"^4.3.0","webpack-merge":"^5.8.0","webpack-node-externals":"^3.0.0"},"files":["dist"],"sideEffects":["**/*.css","**/*.scss"]}');
|
||||||
|
|
||||||
/***/ })
|
/***/ })
|
||||||
|
|
||||||
|
2
dist/mermaid.js.map
vendored
2
dist/mermaid.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mermaid",
|
"name": "mermaid",
|
||||||
"version": "8.14.0",
|
"version": "9.0.0",
|
||||||
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
||||||
"main": "dist/mermaid.core.js",
|
"main": "dist/mermaid.core.js",
|
||||||
"module": "dist/mermaid.esm.min.mjs",
|
"module": "dist/mermaid.esm.min.mjs",
|
||||||
|
Reference in New Issue
Block a user