mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-19 05:59:38 +02:00
Merge branch 'master' into develop
This commit is contained in:
@@ -563,7 +563,8 @@ context('Sequence diagram', () => {
|
||||
});
|
||||
});
|
||||
context('links', () => {
|
||||
it('should support actor links and properties', () => {
|
||||
it('should support actor links and properties EXPERIMENTAL: USE WITH CAUTION', () => {
|
||||
//Be aware that the syntax for "properties" is likely to be changed.
|
||||
imgSnapshotTest(
|
||||
`
|
||||
%%{init: { "config": { "mirrorActors": true, "forceMenus": true }}}%%
|
||||
@@ -583,7 +584,8 @@ context('Sequence diagram', () => {
|
||||
{ logLevel: 0, sequence: { mirrorActors: true, noteFontSize: 18, noteFontFamily: 'Arial' } }
|
||||
);
|
||||
});
|
||||
it('should support actor links and properties when not mirrored', () => {
|
||||
it('should support actor links and properties when not mirrored EXPERIMENTAL: USE WITH CAUTION', () => {
|
||||
//Be aware that the syntax for "properties" is likely to be changed.
|
||||
imgSnapshotTest(
|
||||
`
|
||||
%%{init: { "config": { "mirrorActors": false, "forceMenus": true, "wrap": true }}}%%
|
||||
|
2068
dist/mermaid.core.js
vendored
2068
dist/mermaid.core.js
vendored
File diff suppressed because one or more lines are too long
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
2
dist/mermaid.esm.min.mjs
vendored
2
dist/mermaid.esm.min.mjs
vendored
File diff suppressed because one or more lines are too long
603
dist/mermaid.js
vendored
603
dist/mermaid.js
vendored
@@ -11443,10 +11443,8 @@ var rectWithTitle = function rectWithTitle(parent, node) {
|
||||
|
||||
|
||||
var halfPadding = node.padding / 2;
|
||||
(0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(descr).attr('transform', 'translate( ' + ( // (titleBox.width - bbox.width) / 2 +
|
||||
bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + ', ' + (titleBox.height + halfPadding + 5) + ')');
|
||||
(0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(text).attr('transform', 'translate( ' + ( // (titleBox.width - bbox.width) / 2 +
|
||||
bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + ', ' + 0 + ')'); // Get the size of the label
|
||||
(0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(descr).attr('transform', 'translate( ' + (bbox.width > titleBox.width ? 0 : (titleBox.width - bbox.width) / 2) + ', ' + (titleBox.height + halfPadding + 5) + ')');
|
||||
(0,d3__WEBPACK_IMPORTED_MODULE_0__.select)(text).attr('transform', 'translate( ' + (bbox.width < titleBox.width ? 0 : -(titleBox.width - bbox.width) / 2) + ', ' + 0 + ')'); // Get the size of the label
|
||||
// Bounding box for title and text
|
||||
|
||||
bbox = label.node().getBBox(); // Center the label
|
||||
@@ -20396,8 +20394,10 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js");
|
||||
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../config */ "./src/config.js");
|
||||
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../config */ "./src/config.js");
|
||||
/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
|
||||
/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js");
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -20622,7 +20622,10 @@ var addLinks = function addLinks(actorId, text) {
|
||||
var actor = getActor(actorId); // JSON.parse the text
|
||||
|
||||
try {
|
||||
var links = JSON.parse(text.text); // add the deserialized text to the actor's links field.
|
||||
var sanitizedText = (0,_common_common__WEBPACK_IMPORTED_MODULE_2__.sanitizeText)(text.text, _config__WEBPACK_IMPORTED_MODULE_3__.getConfig());
|
||||
sanitizedText = sanitizedText.replace(/&/g, '&');
|
||||
sanitizedText = sanitizedText.replace(/=/g, '=');
|
||||
var links = JSON.parse(sanitizedText); // add the deserialized text to the actor's links field.
|
||||
|
||||
insertLinks(actor, links);
|
||||
} catch (e) {
|
||||
@@ -20635,9 +20638,12 @@ var addALink = function addALink(actorId, text) {
|
||||
|
||||
try {
|
||||
var links = {};
|
||||
var sep = text.text.indexOf('@');
|
||||
var label = text.text.slice(0, sep - 1).trim();
|
||||
var link = text.text.slice(sep + 1).trim();
|
||||
var sanitizedText = (0,_common_common__WEBPACK_IMPORTED_MODULE_2__.sanitizeText)(text.text, _config__WEBPACK_IMPORTED_MODULE_3__.getConfig());
|
||||
var sep = sanitizedText.indexOf('@');
|
||||
sanitizedText = sanitizedText.replace(/&/g, '&');
|
||||
sanitizedText = sanitizedText.replace(/=/g, '=');
|
||||
var label = sanitizedText.slice(0, sep - 1).trim();
|
||||
var link = sanitizedText.slice(sep + 1).trim();
|
||||
links[label] = link; // add the deserialized text to the actor's links field.
|
||||
|
||||
insertLinks(actor, links);
|
||||
@@ -20661,7 +20667,8 @@ var addProperties = function addProperties(actorId, text) {
|
||||
var actor = getActor(actorId); // JSON.parse the text
|
||||
|
||||
try {
|
||||
var properties = JSON.parse(text.text); // add the deserialized text to the actor's property field.
|
||||
var sanitizedText = (0,_common_common__WEBPACK_IMPORTED_MODULE_2__.sanitizeText)(text.text, _config__WEBPACK_IMPORTED_MODULE_3__.getConfig());
|
||||
var properties = JSON.parse(sanitizedText); // add the deserialized text to the actor's property field.
|
||||
|
||||
insertProperties(actor, properties);
|
||||
} catch (e) {
|
||||
@@ -20830,7 +20837,7 @@ var apply = function apply(param) {
|
||||
getTitle: getTitle,
|
||||
parseDirective: parseDirective,
|
||||
getConfig: function getConfig() {
|
||||
return _config__WEBPACK_IMPORTED_MODULE_2__.getConfig().sequence;
|
||||
return _config__WEBPACK_IMPORTED_MODULE_3__.getConfig().sequence;
|
||||
},
|
||||
getTitleWrapped: getTitleWrapped,
|
||||
clear: clear,
|
||||
@@ -20877,6 +20884,93 @@ __webpack_require__.r(__webpack_exports__);
|
||||
|
||||
|
||||
|
||||
_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy = _sequenceDb__WEBPACK_IMPORTED_MODULE_2__["default"];
|
||||
var conf = {};
|
||||
var bounds = {
|
||||
data: {
|
||||
startx: undefined,
|
||||
stopx: undefined,
|
||||
starty: undefined,
|
||||
stopy: undefined
|
||||
},
|
||||
verticalPos: 0,
|
||||
sequenceItems: [],
|
||||
activations: [],
|
||||
models: {
|
||||
getHeight: function getHeight() {
|
||||
return Math.max.apply(null, this.actors.length === 0 ? [0] : this.actors.map(function (actor) {
|
||||
return actor.height || 0;
|
||||
})) + (this.loops.length === 0 ? 0 : this.loops.map(function (it) {
|
||||
return it.height || 0;
|
||||
}).reduce(function (acc, h) {
|
||||
return acc + h;
|
||||
})) + (this.messages.length === 0 ? 0 : this.messages.map(function (it) {
|
||||
return it.height || 0;
|
||||
}).reduce(function (acc, h) {
|
||||
return acc + h;
|
||||
})) + (this.notes.length === 0 ? 0 : this.notes.map(function (it) {
|
||||
return it.height || 0;
|
||||
}).reduce(function (acc, h) {
|
||||
return acc + h;
|
||||
}));
|
||||
},
|
||||
clear: function clear() {
|
||||
this.actors = [];
|
||||
this.loops = [];
|
||||
this.messages = [];
|
||||
this.notes = [];
|
||||
},
|
||||
addActor: function addActor(actorModel) {
|
||||
this.actors.push(actorModel);
|
||||
},
|
||||
addLoop: function addLoop(loopModel) {
|
||||
this.loops.push(loopModel);
|
||||
},
|
||||
addMessage: function addMessage(msgModel) {
|
||||
this.messages.push(msgModel);
|
||||
},
|
||||
addNote: function addNote(noteModel) {
|
||||
this.notes.push(noteModel);
|
||||
},
|
||||
lastActor: function lastActor() {
|
||||
return this.actors[this.actors.length - 1];
|
||||
},
|
||||
lastLoop: function lastLoop() {
|
||||
return this.loops[this.loops.length - 1];
|
||||
},
|
||||
lastMessage: function lastMessage() {
|
||||
return this.messages[this.messages.length - 1];
|
||||
},
|
||||
lastNote: function lastNote() {
|
||||
return this.notes[this.notes.length - 1];
|
||||
},
|
||||
actors: [],
|
||||
loops: [],
|
||||
messages: [],
|
||||
notes: []
|
||||
},
|
||||
init: function init() {
|
||||
this.sequenceItems = [];
|
||||
this.activations = [];
|
||||
this.models.clear();
|
||||
this.data = {
|
||||
startx: undefined,
|
||||
stopx: undefined,
|
||||
starty: undefined,
|
||||
stopy: undefined
|
||||
};
|
||||
this.verticalPos = 0;
|
||||
setConf(_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy.getConfig());
|
||||
},
|
||||
updateVal: function updateVal(obj, key, val, fun) {
|
||||
if (typeof obj[key] === 'undefined') {
|
||||
obj[key] = val;
|
||||
} else {
|
||||
obj[key] = fun(val, obj[key]);
|
||||
}
|
||||
},
|
||||
updateBounds: function updateBounds(startx, starty, stopx, stopy) {
|
||||
var _self = this;
|
||||
|
||||
_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_1__.parser.yy = _sequenceDb__WEBPACK_IMPORTED_MODULE_2__["default"];
|
||||
var conf = {};
|
||||
@@ -21963,7 +22057,9 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ "getNoteRect": () => (/* binding */ getNoteRect),
|
||||
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js");
|
||||
/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js");
|
||||
/* harmony import */ var _interactionDb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../interactionDb */ "./src/interactionDb.js");
|
||||
|
||||
|
||||
var drawRect = function drawRect(elem, rectData) {
|
||||
var rectElem = elem.append('rect');
|
||||
@@ -21987,6 +22083,18 @@ var sanitizeUrl = function sanitizeUrl(s) {
|
||||
return s.replace(/&/g, '&').replace(/</g, '<').replace(/javascript:/g, '');
|
||||
};
|
||||
|
||||
var addPopupInteraction = function addPopupInteraction(id, actorCnt) {
|
||||
(0,_interactionDb__WEBPACK_IMPORTED_MODULE_0__.addFunction)(function () {
|
||||
var arr = document.querySelectorAll(id);
|
||||
arr[0].addEventListener('mouseover', function () {
|
||||
popupMenuUpFunc('actor' + actorCnt + '_popup');
|
||||
});
|
||||
arr[0].addEventListener('mouseout', function () {
|
||||
popupMenuDownFunc('actor' + actorCnt + '_popup');
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var drawPopup = function drawPopup(elem, actor, minMenuWidth, textAttrs, forceMenus) {
|
||||
if (actor.links === undefined || actor.links === null || Object.keys(actor.links).length === 0) {
|
||||
return {
|
||||
@@ -22008,8 +22116,7 @@ var drawPopup = function drawPopup(elem, actor, minMenuWidth, textAttrs, forceMe
|
||||
g.attr('id', 'actor' + actorCnt + '_popup');
|
||||
g.attr('class', 'actorPopupMenu');
|
||||
g.attr('display', displayValue);
|
||||
g.attr('onmouseover', popupMenu('actor' + actorCnt + '_popup'));
|
||||
g.attr('onmouseout', popdownMenu('actor' + actorCnt + '_popup'));
|
||||
addPopupInteraction('#actor' + actorCnt + '_popup', actorCnt);
|
||||
var actorClass = '';
|
||||
|
||||
if (typeof rectData.class !== 'undefined') {
|
||||
@@ -22071,10 +22178,27 @@ var popupMenu = function popupMenu(popid) {
|
||||
var popdownMenu = function popdownMenu(popid) {
|
||||
return "var pu = document.getElementById('" + popid + "'); if (pu != null) { pu.style.display = 'none'; }";
|
||||
};
|
||||
|
||||
var popupMenuUpFunc = function popupMenuUpFunc(popupId) {
|
||||
var pu = document.getElementById(popupId);
|
||||
|
||||
if (pu != null) {
|
||||
pu.style.display = 'block';
|
||||
}
|
||||
};
|
||||
|
||||
var popupMenuDownFunc = function popupMenuDownFunc(popupId) {
|
||||
var pu = document.getElementById(popupId);
|
||||
|
||||
if (pu != null) {
|
||||
pu.style.display = 'none';
|
||||
}
|
||||
};
|
||||
|
||||
var drawText = function drawText(elem, textData) {
|
||||
var prevTextHeight = 0,
|
||||
textHeight = 0;
|
||||
var lines = textData.text.split(_common_common__WEBPACK_IMPORTED_MODULE_0__["default"].lineBreakRegex);
|
||||
var lines = textData.text.split(_common_common__WEBPACK_IMPORTED_MODULE_1__["default"].lineBreakRegex);
|
||||
var textElems = [];
|
||||
var dy = 0;
|
||||
|
||||
@@ -22238,8 +22362,8 @@ var drawActorTypeParticipant = function drawActorTypeParticipant(elem, actor, co
|
||||
actor.actorCnt = actorCnt;
|
||||
|
||||
if (actor.links != null) {
|
||||
g.attr('onmouseover', popupMenu('actor' + actorCnt + '_popup'));
|
||||
g.attr('onmouseout', popdownMenu('actor' + actorCnt + '_popup'));
|
||||
g.attr('id', 'root-' + actorCnt);
|
||||
addPopupInteraction('#root-' + actorCnt, actorCnt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22294,6 +22418,18 @@ var drawActorTypeActor = function drawActorTypeActor(elem, actor, conf) {
|
||||
actorCnt++;
|
||||
elem.append('line').attr('id', 'actor' + actorCnt).attr('x1', center).attr('y1', 80).attr('x2', center).attr('y2', 2000).attr('class', 'actor-line').attr('stroke-width', '0.5px').attr('stroke', '#999');
|
||||
}
|
||||
};
|
||||
var anchorElement = function anchorElement(elem) {
|
||||
return elem.append('g');
|
||||
};
|
||||
/**
|
||||
* Draws an activation in the diagram
|
||||
* @param elem - element to append activation rect.
|
||||
* @param bounds - activation box bounds.
|
||||
* @param verticalPos - precise y cooridnate of bottom activation box edge.
|
||||
* @param conf - sequence diagram config object.
|
||||
* @param actorActivations - number of activations on the actor.
|
||||
*/
|
||||
|
||||
var actElem = elem.append('g');
|
||||
actElem.attr('class', 'actor-man');
|
||||
@@ -22549,7 +22685,7 @@ var _drawTextCandidateFunc = function () {
|
||||
var actorFontSize = conf.actorFontSize,
|
||||
actorFontFamily = conf.actorFontFamily,
|
||||
actorFontWeight = conf.actorFontWeight;
|
||||
var lines = content.split(_common_common__WEBPACK_IMPORTED_MODULE_0__["default"].lineBreakRegex);
|
||||
var lines = content.split(_common_common__WEBPACK_IMPORTED_MODULE_1__["default"].lineBreakRegex);
|
||||
|
||||
for (var i = 0; i < lines.length; i++) {
|
||||
var dy = i * actorFontSize - actorFontSize * (lines.length - 1) / 2;
|
||||
@@ -22596,7 +22732,7 @@ var _drawMenuItemTextCandidateFunc = function () {
|
||||
var actorFontSize = conf.actorFontSize,
|
||||
actorFontFamily = conf.actorFontFamily,
|
||||
actorFontWeight = conf.actorFontWeight;
|
||||
var lines = content.split(_common_common__WEBPACK_IMPORTED_MODULE_0__["default"].lineBreakRegex);
|
||||
var lines = content.split(_common_common__WEBPACK_IMPORTED_MODULE_1__["default"].lineBreakRegex);
|
||||
|
||||
for (var i = 0; i < lines.length; i++) {
|
||||
var dy = i * actorFontSize - actorFontSize * (lines.length - 1) / 2;
|
||||
@@ -22730,10 +22866,39 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
||||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
||||
|
||||
|
||||
// let conf;
|
||||
|
||||
/**
|
||||
* Draws a start state as a black circle
|
||||
*/
|
||||
|
||||
var drawStartState = function drawStartState(g) {
|
||||
return g.append('circle') // .style('stroke', 'black')
|
||||
// .style('fill', 'black')
|
||||
.attr('class', 'start-state').attr('r', (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().state.sizeUnit).attr('cx', (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().state.padding + (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().state.sizeUnit).attr('cy', (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().state.padding + (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().state.sizeUnit);
|
||||
};
|
||||
/**
|
||||
* Draws a start state as a black circle
|
||||
*/
|
||||
|
||||
var drawDivider = function drawDivider(g) {
|
||||
return g.append('line').style('stroke', 'grey').style('stroke-dasharray', '3').attr('x1', (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().state.textHeight).attr('class', 'divider').attr('x2', (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().state.textHeight * 2).attr('y1', 0).attr('y2', 0);
|
||||
};
|
||||
/**
|
||||
* Draws a an end state as a black circle
|
||||
*/
|
||||
|
||||
var drawSimpleState = function drawSimpleState(g, stateDef) {
|
||||
var state = g.append('text').attr('x', 2 * (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().state.padding).attr('y', (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().state.textHeight + 2 * (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().state.padding).attr('font-size', (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().state.fontSize).attr('class', 'state-title').text(stateDef.id);
|
||||
var classBox = state.node().getBBox();
|
||||
g.insert('rect', ':first-child').attr('x', (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().state.padding).attr('y', (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().state.padding).attr('width', classBox.width + 2 * (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().state.padding).attr('height', classBox.height + 2 * (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().state.padding).attr('rx', (0,_config__WEBPACK_IMPORTED_MODULE_1__.getConfig)().state.radius);
|
||||
return state;
|
||||
};
|
||||
/**
|
||||
* Draws a state with descriptions
|
||||
* @param {*} g
|
||||
* @param {*} stateDef
|
||||
*/
|
||||
|
||||
// let conf;
|
||||
|
||||
@@ -23150,9 +23315,20 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../config */ "./src/config.js");
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
var rootDoc = [];
|
||||
var parseDirective = function parseDirective(statement, context, type) {
|
||||
_mermaidAPI__WEBPACK_IMPORTED_MODULE_0__["default"].parseDirective(this, statement, context, type);
|
||||
};
|
||||
|
||||
var setRootDoc = function setRootDoc(o) {
|
||||
_logger__WEBPACK_IMPORTED_MODULE_1__.log.info('Setting root doc', o); // rootDoc = { id: 'root', doc: o };
|
||||
|
||||
rootDoc = o;
|
||||
};
|
||||
|
||||
var getRootDoc = function getRootDoc() {
|
||||
return rootDoc;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -23205,6 +23381,14 @@ var docTranslator = function docTranslator(parent, node, first) {
|
||||
}
|
||||
} // If any divider was encountered
|
||||
|
||||
if (_doc.doc) {
|
||||
doc = _doc.doc;
|
||||
} else {
|
||||
doc = _doc;
|
||||
} // let doc = root.doc;
|
||||
// if (!doc) {
|
||||
// doc = root;
|
||||
// }
|
||||
|
||||
if (doc.length > 0 && currentDoc.length > 0) {
|
||||
var _newNode = {
|
||||
@@ -23222,7 +23406,6 @@ var docTranslator = function docTranslator(parent, node, first) {
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var getRootDocV2 = function getRootDocV2() {
|
||||
docTranslator({
|
||||
@@ -23250,6 +23433,14 @@ var extract = function extract(_doc) {
|
||||
// doc = root;
|
||||
// }
|
||||
|
||||
addState(id1, type1);
|
||||
addState(id2, type2);
|
||||
currentDocument.relations.push({
|
||||
id1: id1,
|
||||
id2: id2,
|
||||
title: _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(title, _config__WEBPACK_IMPORTED_MODULE_4__.getConfig())
|
||||
});
|
||||
};
|
||||
|
||||
_logger__WEBPACK_IMPORTED_MODULE_1__.log.info(doc);
|
||||
clear();
|
||||
@@ -23489,9 +23680,36 @@ __webpack_require__.r(__webpack_exports__);
|
||||
|
||||
|
||||
|
||||
g.setEdge(from, to, {
|
||||
arrowhead: 'none',
|
||||
arrowType: '',
|
||||
style: 'fill:none',
|
||||
labelStyle: '',
|
||||
classes: 'transition note-edge',
|
||||
arrowheadStyle: 'fill: #333',
|
||||
labelpos: 'c',
|
||||
labelType: 'text',
|
||||
thickness: 'normal'
|
||||
});
|
||||
} else {
|
||||
g.setNode(node.id, nodeData);
|
||||
}
|
||||
}
|
||||
|
||||
if (parent) {
|
||||
if (parent.id !== 'root') {
|
||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.trace('Setting node ', node.id, ' to be child of its parent ', parent.id);
|
||||
g.setParent(node.id, parent.id);
|
||||
}
|
||||
}
|
||||
|
||||
if (node.doc) {
|
||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.trace('Adding nodes children ');
|
||||
setupDoc(g, node, node.doc, !altFlag);
|
||||
}
|
||||
};
|
||||
|
||||
var cnt = 0;
|
||||
|
||||
var conf = {};
|
||||
var setConf = function setConf(cnf) {
|
||||
@@ -23543,6 +23761,9 @@ var setupNode = function setupNode(g, parent, node, altFlag) {
|
||||
};
|
||||
} // Build of the array of description strings accordinging
|
||||
|
||||
if (typeof dir === 'undefined') {
|
||||
dir = 'LR';
|
||||
}
|
||||
|
||||
if (node.description) {
|
||||
if (Array.isArray(nodeDb[node.id].description)) {
|
||||
@@ -23827,7 +24048,17 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../config */ "./src/config.js");
|
||||
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
|
||||
|
||||
graph.setDefaultEdgeLabel(function () {
|
||||
return {};
|
||||
});
|
||||
_stateDb__WEBPACK_IMPORTED_MODULE_4__["default"].extract(doc);
|
||||
var states = _stateDb__WEBPACK_IMPORTED_MODULE_4__["default"].getStates();
|
||||
var relations = _stateDb__WEBPACK_IMPORTED_MODULE_4__["default"].getRelations();
|
||||
var keys = Object.keys(states);
|
||||
var first = true;
|
||||
|
||||
for (var _i = 0; _i < keys.length; _i++) {
|
||||
var stateDef = states[keys[_i]];
|
||||
|
||||
|
||||
|
||||
@@ -24833,7 +25064,7 @@ var initGraphics = function initGraphics(graphics) {
|
||||
initGraphics: initGraphics
|
||||
});
|
||||
|
||||
/***/ }),
|
||||
log.trace = function () {};
|
||||
|
||||
/***/ "./src/errorRenderer.js":
|
||||
/*!******************************!*\
|
||||
@@ -24898,6 +25129,31 @@ var draw = function draw(id, ver) {
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/interactionDb.js":
|
||||
/*!******************************!*\
|
||||
!*** ./src/interactionDb.js ***!
|
||||
\******************************/
|
||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ "addFunction": () => (/* binding */ addFunction),
|
||||
/* harmony export */ "attachFunctions": () => (/* binding */ attachFunctions)
|
||||
/* harmony export */ });
|
||||
var interactionFunctions = [];
|
||||
var addFunction = function addFunction(func) {
|
||||
interactionFunctions.push(func);
|
||||
};
|
||||
var attachFunctions = function attachFunctions() {
|
||||
interactionFunctions.forEach(function (f) {
|
||||
f();
|
||||
});
|
||||
interactionFunctions = [];
|
||||
};
|
||||
|
||||
var callback;
|
||||
|
||||
/***/ "./src/logger.js":
|
||||
/*!***********************!*\
|
||||
!*** ./src/logger.js ***!
|
||||
@@ -24978,7 +25234,12 @@ var format = function format(level) {
|
||||
return "%c".concat(time, " : ").concat(level, " : ");
|
||||
};
|
||||
|
||||
/***/ }),
|
||||
var initialize = function initialize(config) {
|
||||
// mermaidAPI.reset();
|
||||
if (typeof config.mermaid !== 'undefined') {
|
||||
if (typeof config.mermaid.startOnLoad !== 'undefined') {
|
||||
mermaid.startOnLoad = config.mermaid.startOnLoad;
|
||||
}
|
||||
|
||||
/***/ "./src/mermaid.js":
|
||||
/*!************************!*\
|
||||
@@ -25000,6 +25261,8 @@ __webpack_require__.r(__webpack_exports__);
|
||||
*/
|
||||
|
||||
|
||||
var contentLoaded = function contentLoaded() {
|
||||
var config;
|
||||
|
||||
/**
|
||||
* ## init
|
||||
@@ -25190,7 +25453,6 @@ var mermaid = {
|
||||
};
|
||||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mermaid);
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./src/mermaidAPI.js":
|
||||
/*!***************************!*\
|
||||
@@ -25258,9 +25520,10 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _diagrams_user_journey_parser_journey__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./diagrams/user-journey/parser/journey */ "./src/diagrams/user-journey/parser/journey.jison");
|
||||
/* harmony import */ var _diagrams_user_journey_parser_journey__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_diagrams_user_journey_parser_journey__WEBPACK_IMPORTED_MODULE_22__);
|
||||
/* harmony import */ var _errorRenderer__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./errorRenderer */ "./src/errorRenderer.js");
|
||||
/* harmony import */ var _interactionDb__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./interactionDb */ "./src/interactionDb.js");
|
||||
/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./logger */ "./src/logger.js");
|
||||
/* harmony import */ var _styles__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./styles */ "./src/styles.js");
|
||||
/* harmony import */ var _themes__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./themes */ "./src/themes/index.js");
|
||||
/* harmony import */ var _themes__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./themes */ "./src/themes/index.js");
|
||||
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./src/utils.js");
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
@@ -25297,21 +25560,64 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
||||
|
||||
|
||||
|
||||
var graphType = _utils__WEBPACK_IMPORTED_MODULE_2__["default"].detectType(text, cnf);
|
||||
var parser;
|
||||
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('Type ' + graphType);
|
||||
|
||||
|
||||
|
||||
|
||||
case 'sequence':
|
||||
parser = (_diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_8___default());
|
||||
parser.parser.yy = _diagrams_sequence_sequenceDb__WEBPACK_IMPORTED_MODULE_9__["default"];
|
||||
break;
|
||||
|
||||
|
||||
|
||||
|
||||
case 'state':
|
||||
parser = (_diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_14___default());
|
||||
parser.parser.yy = _diagrams_state_stateDb__WEBPACK_IMPORTED_MODULE_15__["default"];
|
||||
break;
|
||||
|
||||
case 'stateDiagram':
|
||||
parser = (_diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_14___default());
|
||||
parser.parser.yy = _diagrams_state_stateDb__WEBPACK_IMPORTED_MODULE_15__["default"];
|
||||
break;
|
||||
|
||||
case 'info':
|
||||
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('info info info');
|
||||
parser = (_diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_16___default());
|
||||
parser.parser.yy = _diagrams_info_infoDb__WEBPACK_IMPORTED_MODULE_17__["default"];
|
||||
break;
|
||||
|
||||
case 'pie':
|
||||
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('pie');
|
||||
parser = (_diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_18___default());
|
||||
parser.parser.yy = _diagrams_pie_pieDb__WEBPACK_IMPORTED_MODULE_19__["default"];
|
||||
break;
|
||||
|
||||
case 'er':
|
||||
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('er');
|
||||
parser = (_diagrams_er_parser_erDiagram__WEBPACK_IMPORTED_MODULE_20___default());
|
||||
parser.parser.yy = _diagrams_er_erDb__WEBPACK_IMPORTED_MODULE_21__["default"];
|
||||
break;
|
||||
|
||||
case 'journey':
|
||||
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('Journey');
|
||||
parser = (_diagrams_user_journey_parser_journey__WEBPACK_IMPORTED_MODULE_22___default());
|
||||
parser.parser.yy = _diagrams_user_journey_journeyDb__WEBPACK_IMPORTED_MODULE_23__["default"];
|
||||
break;
|
||||
|
||||
case 'requirement':
|
||||
case 'requirementDiagram':
|
||||
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('RequirementDiagram');
|
||||
parser = (_diagrams_requirement_parser_requirementDiagram__WEBPACK_IMPORTED_MODULE_24___default());
|
||||
parser.parser.yy = _diagrams_requirement_requirementDb__WEBPACK_IMPORTED_MODULE_25__["default"];
|
||||
break;
|
||||
}
|
||||
|
||||
parser.parser.yy.graphType = graphType;
|
||||
|
||||
|
||||
|
||||
@@ -25552,6 +25858,11 @@ var render = function render(id, _txt, cb, container) {
|
||||
userStyles += "\n".concat(cnf.themeCSS);
|
||||
} // user provided theme CSS
|
||||
|
||||
case 'classDiagram':
|
||||
cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
|
||||
_diagrams_class_classRenderer_v2__WEBPACK_IMPORTED_MODULE_35__["default"].setConf(cnf.class);
|
||||
_diagrams_class_classRenderer_v2__WEBPACK_IMPORTED_MODULE_35__["default"].draw(txt, id);
|
||||
break;
|
||||
|
||||
if (cnf.fontFamily !== undefined) {
|
||||
userStyles += "\n:root { --mermaid-font-family: ".concat(cnf.fontFamily, "}");
|
||||
@@ -25562,6 +25873,11 @@ var render = function render(id, _txt, cb, container) {
|
||||
userStyles += "\n:root { --mermaid-alt-font-family: ".concat(cnf.altFontFamily, "}");
|
||||
} // classDef
|
||||
|
||||
case 'pie':
|
||||
//cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
|
||||
//pieRenderer.setConf(cnf.pie);
|
||||
_diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_40__["default"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_39__.version);
|
||||
break;
|
||||
|
||||
if (graphType === 'flowchart' || graphType === 'flowchart-v2' || graphType === 'graph') {
|
||||
var classes = _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_26__["default"].getClasses(txt);
|
||||
@@ -25747,6 +26063,7 @@ var render = function render(id, _txt, cb, container) {
|
||||
_logger__WEBPACK_IMPORTED_MODULE_3__.log.debug('CB = undefined!');
|
||||
}
|
||||
|
||||
(0,_interactionDb__WEBPACK_IMPORTED_MODULE_45__.attachFunctions)();
|
||||
var node = (0,d3__WEBPACK_IMPORTED_MODULE_0__.select)('#d' + id).node();
|
||||
|
||||
if (node !== null && typeof node.remove === 'function') {
|
||||
@@ -25884,11 +26201,11 @@ function initialize(options) {
|
||||
|
||||
_config__WEBPACK_IMPORTED_MODULE_1__.saveConfigFromInitilize(options);
|
||||
|
||||
if (options && options.theme && _themes__WEBPACK_IMPORTED_MODULE_45__["default"][options.theme]) {
|
||||
if (options && options.theme && _themes__WEBPACK_IMPORTED_MODULE_46__["default"][options.theme]) {
|
||||
// Todo merge with user options
|
||||
options.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_45__["default"][options.theme].getThemeVariables(options.themeVariables);
|
||||
options.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_46__["default"][options.theme].getThemeVariables(options.themeVariables);
|
||||
} else {
|
||||
if (options) options.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_45__["default"]["default"].getThemeVariables(options.themeVariables);
|
||||
if (options) options.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_46__["default"]["default"].getThemeVariables(options.themeVariables);
|
||||
}
|
||||
|
||||
var config = _typeof(options) === 'object' ? _config__WEBPACK_IMPORTED_MODULE_1__.setSiteConfig(options) : _config__WEBPACK_IMPORTED_MODULE_1__.getSiteConfig();
|
||||
@@ -26637,8 +26954,50 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
var Theme = /*#__PURE__*/function () {
|
||||
function Theme() {
|
||||
_classCallCheck(this, Theme);
|
||||
|
||||
/* Base variables */
|
||||
this.background = '#f4f4f4';
|
||||
this.primaryColor = '#ECECFF';
|
||||
this.secondaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, {
|
||||
h: 120
|
||||
});
|
||||
this.secondaryColor = '#ffffde';
|
||||
this.tertiaryColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.adjust)(this.primaryColor, {
|
||||
h: -160
|
||||
});
|
||||
this.primaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.primaryColor, this.darkMode);
|
||||
this.secondaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.secondaryColor, this.darkMode);
|
||||
this.tertiaryBorderColor = (0,_theme_helpers__WEBPACK_IMPORTED_MODULE_1__.mkBorder)(this.tertiaryColor, this.darkMode); // this.noteBorderColor = mkBorder(this.noteBkgColor, this.darkMode);
|
||||
|
||||
this.primaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.primaryColor);
|
||||
this.secondaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.secondaryColor);
|
||||
this.tertiaryTextColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.tertiaryColor);
|
||||
this.lineColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background);
|
||||
this.textColor = (0,khroma__WEBPACK_IMPORTED_MODULE_0__.invert)(this.background);
|
||||
this.background = 'white';
|
||||
this.mainBkg = '#ECECFF';
|
||||
this.secondBkg = '#ffffde';
|
||||
this.lineColor = '#333333';
|
||||
this.border1 = '#9370DB';
|
||||
this.border2 = '#aaaa33';
|
||||
this.arrowheadColor = '#333333';
|
||||
this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif';
|
||||
this.fontSize = '16px';
|
||||
this.labelBackground = '#e8e8e8';
|
||||
this.textColor = '#333';
|
||||
/* Flowchart variables */
|
||||
|
||||
this.nodeBkg = 'calculated';
|
||||
this.nodeBorder = 'calculated';
|
||||
this.clusterBkg = 'calculated';
|
||||
this.clusterBorder = 'calculated';
|
||||
this.defaultLinkColor = 'calculated';
|
||||
this.titleColor = 'calculated';
|
||||
this.edgeLabelBackground = 'calculated';
|
||||
/* Sequence Diagram variables */
|
||||
|
||||
var Theme = /*#__PURE__*/function () {
|
||||
function Theme() {
|
||||
@@ -27480,7 +27839,7 @@ var getThemeVariables = function getThemeVariables(userOverrides) {
|
||||
return theme;
|
||||
};
|
||||
|
||||
/***/ }),
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
||||
|
||||
/***/ "./src/utils.js":
|
||||
/*!**********************!*\
|
||||
@@ -27546,6 +27905,13 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
||||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
||||
|
||||
|
||||
if (results) {
|
||||
var type = detectType(text, cnf);
|
||||
['config'].forEach(function (prop) {
|
||||
if (typeof results[prop] !== 'undefined') {
|
||||
if (type === 'flowchart-v2') {
|
||||
type = 'flowchart';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30543,7 +30909,6 @@ __webpack_require__.r(__webpack_exports__);
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/d3-color/src/lab.js":
|
||||
/*!******************************************!*\
|
||||
@@ -30565,8 +30930,27 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./color.js */ "./node_modules/d3-color/src/color.js");
|
||||
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./math.js */ "./node_modules/d3-color/src/math.js");
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/d3-color/src/lab.js":
|
||||
/*!******************************************!*\
|
||||
!*** ./node_modules/d3-color/src/lab.js ***!
|
||||
\******************************************/
|
||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ "gray": () => (/* binding */ gray),
|
||||
/* harmony export */ "default": () => (/* binding */ lab),
|
||||
/* harmony export */ "Lab": () => (/* binding */ Lab),
|
||||
/* harmony export */ "lch": () => (/* binding */ lch),
|
||||
/* harmony export */ "hcl": () => (/* binding */ hcl),
|
||||
/* harmony export */ "Hcl": () => (/* binding */ Hcl)
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var _define_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./define.js */ "./node_modules/d3-color/src/define.js");
|
||||
/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./color.js */ "./node_modules/d3-color/src/color.js");
|
||||
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./math.js */ "./node_modules/d3-color/src/math.js");
|
||||
|
||||
// https://observablehq.com/@mbostock/lab-and-rgb
|
||||
var K = 18,
|
||||
@@ -31405,8 +31789,16 @@ function formatDate(date) {
|
||||
};
|
||||
}
|
||||
|
||||
function formatRow(row) {
|
||||
return row.map(formatValue).join(delimiter);
|
||||
}
|
||||
|
||||
/***/ }),
|
||||
function formatValue(value) {
|
||||
return value == null ? ""
|
||||
: value instanceof Date ? formatDate(value)
|
||||
: reFormat.test(value += "") ? "\"" + value.replace(/"/g, "\"\"") + "\""
|
||||
: value;
|
||||
}
|
||||
|
||||
/***/ "./node_modules/d3-dsv/src/index.js":
|
||||
/*!******************************************!*\
|
||||
@@ -31440,12 +31832,12 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _autoType_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./autoType.js */ "./node_modules/d3-dsv/src/autoType.js");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/***/ "./node_modules/d3-dsv/src/tsv.js":
|
||||
/*!****************************************!*\
|
||||
!*** ./node_modules/d3-dsv/src/tsv.js ***!
|
||||
@@ -31891,8 +32283,12 @@ var polyInOut = (function custom(e) {
|
||||
return polyInOut;
|
||||
})(exponent);
|
||||
|
||||
var polyOut = (function custom(e) {
|
||||
e = +e;
|
||||
|
||||
/***/ }),
|
||||
function polyOut(t) {
|
||||
return 1 - Math.pow(1 - t, e);
|
||||
}
|
||||
|
||||
/***/ "./node_modules/d3-ease/src/quad.js":
|
||||
/*!******************************************!*\
|
||||
@@ -32009,6 +32405,13 @@ __webpack_require__.r(__webpack_exports__);
|
||||
return x = (0,_formatDecimal_js__WEBPACK_IMPORTED_MODULE_0__.formatDecimalParts)(Math.abs(x)), x ? x[1] : NaN;
|
||||
}
|
||||
|
||||
defaultLocale({
|
||||
decimal: ".",
|
||||
thousands: ",",
|
||||
grouping: [3],
|
||||
currency: ["$", ""],
|
||||
minus: "-"
|
||||
});
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -33018,7 +33421,6 @@ __webpack_require__.r(__webpack_exports__);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
@@ -33054,7 +33456,10 @@ function lab(start, end) {
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(a, b) {
|
||||
var i = {},
|
||||
c = {},
|
||||
k;
|
||||
|
||||
/***/ "./node_modules/d3-interpolate/src/number.js":
|
||||
/*!***************************************************!*\
|
||||
@@ -33143,7 +33548,6 @@ __webpack_require__.r(__webpack_exports__);
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/d3-interpolate/src/piecewise.js":
|
||||
/*!******************************************************!*\
|
||||
@@ -33165,6 +33569,7 @@ function piecewise(interpolate, values) {
|
||||
};
|
||||
}
|
||||
|
||||
rgb.gamma = rgbGamma;
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -33207,7 +33612,13 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./color.js */ "./node_modules/d3-interpolate/src/color.js");
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/d3-interpolate/src/string.js":
|
||||
/*!***************************************************!*\
|
||||
!*** ./node_modules/d3-interpolate/src/string.js ***!
|
||||
\***************************************************/
|
||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||
|
||||
|
||||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((function rgbGamma(y) {
|
||||
@@ -33361,8 +33772,22 @@ function one(b) {
|
||||
});
|
||||
}
|
||||
|
||||
function skewX(a, b, s, q) {
|
||||
if (a !== b) {
|
||||
q.push({i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: (0,_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(a, b)});
|
||||
} else if (b) {
|
||||
s.push(pop(s) + "skewX(" + b + degParen);
|
||||
}
|
||||
}
|
||||
|
||||
/***/ }),
|
||||
function scale(xa, ya, xb, yb, s, q) {
|
||||
if (xa !== xb || ya !== yb) {
|
||||
var i = s.push(pop(s) + "scale(", null, ",", null, ")");
|
||||
q.push({i: i - 4, x: (0,_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(xa, xb)}, {i: i - 2, x: (0,_number_js__WEBPACK_IMPORTED_MODULE_0__["default"])(ya, yb)});
|
||||
} else if (xb !== 1 || yb !== 1) {
|
||||
s.push(pop(s) + "scale(" + xb + "," + yb + ")");
|
||||
}
|
||||
}
|
||||
|
||||
/***/ "./node_modules/d3-interpolate/src/transform/decompose.js":
|
||||
/*!****************************************************************!*\
|
||||
@@ -33404,7 +33829,10 @@ var identity = {
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
var cssNode,
|
||||
cssRoot,
|
||||
cssView,
|
||||
svgNode;
|
||||
|
||||
/***/ "./node_modules/d3-interpolate/src/transform/index.js":
|
||||
/*!************************************************************!*\
|
||||
@@ -33526,6 +33954,15 @@ function parseSvg(value) {
|
||||
return (0,_decompose_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value.a, value.b, value.c, value.d, value.e, value.f);
|
||||
}
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__)
|
||||
/* harmony export */ });
|
||||
var rho = Math.SQRT2,
|
||||
rho2 = 2,
|
||||
rho4 = 4,
|
||||
epsilon2 = 1e-12;
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -33550,14 +33987,69 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ "./node_modules/d3-interpolate/src/constant.js");
|
||||
/* harmony import */ var _numberArray_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./numberArray.js */ "./node_modules/d3-interpolate/src/numberArray.js");
|
||||
|
||||
// p0 = [ux0, uy0, w0]
|
||||
// p1 = [ux1, uy1, w1]
|
||||
/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(p0, p1) {
|
||||
var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],
|
||||
ux1 = p1[0], uy1 = p1[1], w1 = p1[2],
|
||||
dx = ux1 - ux0,
|
||||
dy = uy1 - uy0,
|
||||
d2 = dx * dx + dy * dy,
|
||||
i,
|
||||
S;
|
||||
|
||||
// Special case for u0 ≅ u1.
|
||||
if (d2 < epsilon2) {
|
||||
S = Math.log(w1 / w0) / rho;
|
||||
i = function(t) {
|
||||
return [
|
||||
ux0 + t * dx,
|
||||
uy0 + t * dy,
|
||||
w0 * Math.exp(rho * t * S)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// General case.
|
||||
else {
|
||||
var d1 = Math.sqrt(d2),
|
||||
b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),
|
||||
b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),
|
||||
r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),
|
||||
r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
|
||||
S = (r1 - r0) / rho;
|
||||
i = function(t) {
|
||||
var s = t * S,
|
||||
coshr0 = cosh(r0),
|
||||
u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));
|
||||
return [
|
||||
ux0 + u * dx,
|
||||
uy0 + u * dy,
|
||||
w0 * coshr0 / cosh(rho * s + r0)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
i.duration = S * 1000;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/d3-path/src/index.js":
|
||||
/*!*******************************************!*\
|
||||
!*** ./node_modules/d3-path/src/index.js ***!
|
||||
\*******************************************/
|
||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ "path": () => (/* reexport safe */ _path_js__WEBPACK_IMPORTED_MODULE_0__["default"])
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var _path_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./path.js */ "./node_modules/d3-path/src/path.js");
|
||||
|
||||
/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(a, b) {
|
||||
var t = typeof b, c;
|
||||
@@ -33624,7 +34116,6 @@ function tanh(x) {
|
||||
w0 * Math.exp(rho * t * S)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// General case.
|
||||
else {
|
||||
@@ -34100,7 +34591,6 @@ __webpack_require__.r(__webpack_exports__);
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/d3-quadtree/src/index.js":
|
||||
/*!***********************************************!*\
|
||||
@@ -37729,7 +38219,19 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interval.js */ "./node_modules/d3-time/src/interval.js");
|
||||
/* harmony import */ var _duration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./duration.js */ "./node_modules/d3-time/src/duration.js");
|
||||
|
||||
/***/ "./node_modules/d3-time/src/utcMonth.js":
|
||||
/*!**********************************************!*\
|
||||
!*** ./node_modules/d3-time/src/utcMonth.js ***!
|
||||
\**********************************************/
|
||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
|
||||
/* harmony export */ "utcMonths": () => (/* binding */ utcMonths)
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interval.js */ "./node_modules/d3-time/src/interval.js");
|
||||
|
||||
var utcMinute = (0,_interval_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(date) {
|
||||
date.setUTCSeconds(0, 0);
|
||||
@@ -37761,6 +38263,13 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./interval.js */ "./node_modules/d3-time/src/interval.js");
|
||||
|
||||
var utcSunday = utcWeekday(0);
|
||||
var utcMonday = utcWeekday(1);
|
||||
var utcTuesday = utcWeekday(2);
|
||||
var utcWednesday = utcWeekday(3);
|
||||
var utcThursday = utcWeekday(4);
|
||||
var utcFriday = utcWeekday(5);
|
||||
var utcSaturday = utcWeekday(6);
|
||||
|
||||
var utcMonth = (0,_interval_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(date) {
|
||||
date.setUTCDate(1);
|
||||
@@ -126714,7 +127223,7 @@ function combine (array, callback) {
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = JSON.parse('{"name":"mermaid","version":"8.13.2","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 --progress --color","build:production":"yarn build:development --mode production --config webpack.config.prod.babel.js","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 src","e2e:depr":"yarn lint && jest e2e --config e2e/jest.config.js","cypress":"percy exec -- cypress run","e2e":"start-server-and-test dev http://localhost:9000/ cypress","e2e-upd":"yarn lint && jest e2e -u --config e2e/jest.config.js","dev":"webpack serve --config webpack.config.e2e.js","test":"yarn lint && jest src/.*","test:watch":"jest --watch src","prepublishOnly":"yarn build && yarn test","prepare":"yarn build"},"repository":{"type":"git","url":"https://github.com/knsv/mermaid"},"author":"Knut Sveidqvist","license":"MIT","standard":{"ignore":["**/parser/*.js","dist/**/*.js","cypress/**/*.js"],"globals":["page"]},"dependencies":{"@braintree/sanitize-url":"^3.1.0","d3":"^7.0.0","dagre":"^0.8.5","dagre-d3":"^0.6.4","dompurify":"2.3.3","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","@percy/cli":"^1.0.0-beta.58","@percy/cypress":"^3.1.0","@percy/migrate":"^0.11.0","babel-jest":"^27.0.6","babel-loader":"^8.2.2","concurrently":"^6.2.2","coveralls":"^3.0.2","css-to-string-loader":"^0.1.3","cypress":"8.6.0","documentation":"13.2.0","eslint":"^8.0.0","eslint-config-prettier":"^8.3.0","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","moment":"^2.23.0","path-browserify":"^1.0.1","prettier":"^2.3.2","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-node-externals":"^3.0.0"},"files":["dist"],"sideEffects":["**/*.css","**/*.scss"],"husky":{"hooks":{"pre-push":"yarn test"}}}');
|
||||
module.exports = JSON.parse('{"name":"mermaid","version":"8.13.3","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 --progress --color","build:production":"yarn build:development --mode production --config webpack.config.prod.babel.js","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 src","e2e:depr":"yarn lint && jest e2e --config e2e/jest.config.js","cypress":"percy exec -- cypress run","e2e":"start-server-and-test dev http://localhost:9000/ cypress","e2e-upd":"yarn lint && jest e2e -u --config e2e/jest.config.js","dev":"webpack serve --config webpack.config.e2e.js","test":"yarn lint && jest src/.*","test:watch":"jest --watch src","prepublishOnly":"yarn build && yarn test","prepare":"yarn build"},"repository":{"type":"git","url":"https://github.com/knsv/mermaid"},"author":"Knut Sveidqvist","license":"MIT","standard":{"ignore":["**/parser/*.js","dist/**/*.js","cypress/**/*.js"],"globals":["page"]},"dependencies":{"@braintree/sanitize-url":"^3.1.0","d3":"^7.0.0","dagre":"^0.8.5","dagre-d3":"^0.6.4","dompurify":"2.3.3","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","@percy/cli":"^1.0.0-beta.58","@percy/cypress":"^3.1.0","@percy/migrate":"^0.11.0","babel-jest":"^27.0.6","babel-loader":"^8.2.2","concurrently":"^6.2.2","coveralls":"^3.0.2","css-to-string-loader":"^0.1.3","cypress":"8.5.0","documentation":"13.2.0","eslint":"^7.30.0","eslint-config-prettier":"^8.3.0","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","moment":"^2.23.0","path-browserify":"^1.0.1","prettier":"^2.3.2","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-node-externals":"^3.0.0"},"files":["dist"],"sideEffects":["**/*.css","**/*.scss"],"husky":{"hooks":{"pre-push":"yarn test"}}}');
|
||||
|
||||
/***/ })
|
||||
|
||||
|
2
dist/mermaid.js.map
vendored
2
dist/mermaid.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/mermaid.min.js
vendored
2
dist/mermaid.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/mermaid.min.js.map
vendored
2
dist/mermaid.min.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mermaid",
|
||||
"version": "8.13.2",
|
||||
"version": "8.13.3",
|
||||
"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",
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import mermaidAPI from '../../mermaidAPI';
|
||||
import * as configApi from '../../config';
|
||||
import { log } from '../../logger';
|
||||
import { sanitizeText } from '../common/common';
|
||||
|
||||
let prevActor = undefined;
|
||||
let actors = {};
|
||||
@@ -219,7 +220,10 @@ export const addLinks = function (actorId, text) {
|
||||
const actor = getActor(actorId);
|
||||
// JSON.parse the text
|
||||
try {
|
||||
const links = JSON.parse(text.text);
|
||||
let sanitizedText = sanitizeText(text.text, configApi.getConfig());
|
||||
sanitizedText = sanitizedText.replace(/&/g, '&');
|
||||
sanitizedText = sanitizedText.replace(/=/g, '=');
|
||||
const links = JSON.parse(sanitizedText);
|
||||
// add the deserialized text to the actor's links field.
|
||||
insertLinks(actor, links);
|
||||
} catch (e) {
|
||||
@@ -232,9 +236,12 @@ export const addALink = function (actorId, text) {
|
||||
const actor = getActor(actorId);
|
||||
try {
|
||||
const links = {};
|
||||
var sep = text.text.indexOf('@');
|
||||
var label = text.text.slice(0, sep - 1).trim();
|
||||
var link = text.text.slice(sep + 1).trim();
|
||||
let sanitizedText = sanitizeText(text.text, configApi.getConfig());
|
||||
var sep = sanitizedText.indexOf('@');
|
||||
sanitizedText = sanitizedText.replace(/&/g, '&');
|
||||
sanitizedText = sanitizedText.replace(/=/g, '=');
|
||||
var label = sanitizedText.slice(0, sep - 1).trim();
|
||||
var link = sanitizedText.slice(sep + 1).trim();
|
||||
|
||||
links[label] = link;
|
||||
// add the deserialized text to the actor's links field.
|
||||
@@ -259,7 +266,8 @@ export const addProperties = function (actorId, text) {
|
||||
const actor = getActor(actorId);
|
||||
// JSON.parse the text
|
||||
try {
|
||||
const properties = JSON.parse(text.text);
|
||||
let sanitizedText = sanitizeText(text.text, configApi.getConfig());
|
||||
const properties = JSON.parse(sanitizedText);
|
||||
// add the deserialized text to the actor's property field.
|
||||
insertProperties(actor, properties);
|
||||
} catch (e) {
|
||||
|
@@ -976,7 +976,8 @@ link a: Tests @ https://tests.contoso.com/?svc=alice@contoso.com
|
||||
expect(actors.a.links["Tests"]).toBe("https://tests.contoso.com/?svc=alice@contoso.com");
|
||||
});
|
||||
|
||||
it('it should handle properties', function () {
|
||||
it('it should handle properties EXPERIMENTAL: USE WITH CAUTION', function () {
|
||||
//Be aware that the syntax for "properties" is likely to be changed.
|
||||
const str = `
|
||||
sequenceDiagram
|
||||
participant a as Alice
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import common from '../common/common';
|
||||
import { addFunction } from '../../interactionDb';
|
||||
|
||||
export const drawRect = function (elem, rectData) {
|
||||
const rectElem = elem.append('rect');
|
||||
@@ -25,6 +26,17 @@ const sanitizeUrl = function (s) {
|
||||
.replace(/javascript:/g, '');
|
||||
};
|
||||
|
||||
const addPopupInteraction = (id, actorCnt) => {
|
||||
addFunction(() => {
|
||||
const arr = document.querySelectorAll(id);
|
||||
arr[0].addEventListener('mouseover', function () {
|
||||
popupMenuUpFunc('actor' + actorCnt + '_popup');
|
||||
});
|
||||
arr[0].addEventListener('mouseout', function () {
|
||||
popupMenuDownFunc('actor' + actorCnt + '_popup');
|
||||
});
|
||||
});
|
||||
};
|
||||
export const drawPopup = function (elem, actor, minMenuWidth, textAttrs, forceMenus) {
|
||||
if (actor.links === undefined || actor.links === null || Object.keys(actor.links).length === 0) {
|
||||
return { height: 0, width: 0 };
|
||||
@@ -43,9 +55,7 @@ export const drawPopup = function (elem, actor, minMenuWidth, textAttrs, forceMe
|
||||
g.attr('id', 'actor' + actorCnt + '_popup');
|
||||
g.attr('class', 'actorPopupMenu');
|
||||
g.attr('display', displayValue);
|
||||
g.attr('onmouseover', popupMenu('actor' + actorCnt + '_popup'));
|
||||
g.attr('onmouseout', popdownMenu('actor' + actorCnt + '_popup'));
|
||||
|
||||
addPopupInteraction('#actor' + actorCnt + '_popup', actorCnt);
|
||||
var actorClass = '';
|
||||
if (typeof rectData.class !== 'undefined') {
|
||||
actorClass = ' ' + rectData.class;
|
||||
@@ -123,6 +133,19 @@ export const popdownMenu = function (popid) {
|
||||
);
|
||||
};
|
||||
|
||||
const popupMenuUpFunc = function (popupId) {
|
||||
var pu = document.getElementById(popupId);
|
||||
if (pu != null) {
|
||||
pu.style.display = 'block';
|
||||
}
|
||||
};
|
||||
|
||||
const popupMenuDownFunc = function (popupId) {
|
||||
var pu = document.getElementById(popupId);
|
||||
if (pu != null) {
|
||||
pu.style.display = 'none';
|
||||
}
|
||||
};
|
||||
export const drawText = function (elem, textData) {
|
||||
let prevTextHeight = 0,
|
||||
textHeight = 0;
|
||||
@@ -321,9 +344,10 @@ const drawActorTypeParticipant = function (elem, actor, conf) {
|
||||
|
||||
g = boxpluslineGroup.append('g');
|
||||
actor.actorCnt = actorCnt;
|
||||
|
||||
if (actor.links != null) {
|
||||
g.attr('onmouseover', popupMenu('actor' + actorCnt + '_popup'));
|
||||
g.attr('onmouseout', popdownMenu('actor' + actorCnt + '_popup'));
|
||||
g.attr('id', 'root-' + actorCnt);
|
||||
addPopupInteraction('#root-' + actorCnt, actorCnt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,6 +394,7 @@ const drawActorTypeParticipant = function (elem, actor, conf) {
|
||||
actor.height = bounds.height;
|
||||
height = bounds.height;
|
||||
}
|
||||
|
||||
return height;
|
||||
};
|
||||
|
||||
|
10
src/interactionDb.js
Normal file
10
src/interactionDb.js
Normal file
@@ -0,0 +1,10 @@
|
||||
let interactionFunctions = [];
|
||||
export const addFunction = (func) => {
|
||||
interactionFunctions.push(func);
|
||||
};
|
||||
export const attachFunctions = () => {
|
||||
interactionFunctions.forEach((f) => {
|
||||
f();
|
||||
});
|
||||
interactionFunctions = [];
|
||||
};
|
@@ -54,6 +54,7 @@ import journeyDb from './diagrams/user-journey/journeyDb';
|
||||
import journeyRenderer from './diagrams/user-journey/journeyRenderer';
|
||||
import journeyParser from './diagrams/user-journey/parser/journey';
|
||||
import errorRenderer from './errorRenderer';
|
||||
import { attachFunctions } from './interactionDb';
|
||||
|
||||
// import * as configApi from './config';
|
||||
// // , {
|
||||
@@ -483,6 +484,7 @@ const render = function (id, _txt, cb, container) {
|
||||
} else {
|
||||
log.debug('CB = undefined!');
|
||||
}
|
||||
attachFunctions();
|
||||
|
||||
const node = select('#d' + id).node();
|
||||
if (node !== null && typeof node.remove === 'function') {
|
||||
|
Reference in New Issue
Block a user