|
1 | 1 | var _a, _b;
|
2 |
| -import { _ as getConfig, l as log, E as clear$1, B as rgba, o as getStylesFromArray, c as getConfig$1, j as d3select, k as configureSvgSize } from "./mermaid-c5809711.js"; |
3 |
| -import { c as clone } from "./clone-d2e37f8c.js"; |
4 |
| -import { c as channel } from "./channel-d3ac35ac.js"; |
5 |
| -import { h as insertEdge, f as insertEdgeLabel, j as positionEdgeLabel, e as insertNode, p as positionNode, a as insertMarkers } from "./edges-1e1ebc73.js"; |
6 |
| -import { G as Graph } from "./graph-af3d5df6.js"; |
| 2 | +import { c as getConfig, _ as getConfig$1, l as log, E as clear$1, f as common, B as rgba, o as getStylesFromArray, j as d3select, k as configureSvgSize } from "./mermaid-dcacb631.js"; |
| 3 | +import { c as clone } from "./clone-9ea6bfeb.js"; |
| 4 | +import { c as channel } from "./channel-f9001828.js"; |
| 5 | +import { h as insertEdge, f as insertEdgeLabel, j as positionEdgeLabel, e as insertNode, p as positionNode, a as insertMarkers } from "./edges-ce5cfb7c.js"; |
| 6 | +import { G as Graph } from "./graph-fe24fab6.js"; |
7 | 7 | import { o as ordinal } from "./ordinal-475e0c0c.js";
|
8 | 8 | import { d as d3schemeTableau10 } from "./Tableau10-31042135.js";
|
9 |
| -import "./createText-f6615236.js"; |
10 |
| -import "./line-65d70945.js"; |
| 9 | +import "./createText-b70fe78a.js"; |
| 10 | +import "./line-87f517ef.js"; |
11 | 11 | import "./array-b7dcf730.js";
|
12 | 12 | import "./path-39bad7e2.js";
|
13 | 13 | import "./init-cc95ec8e.js";
|
@@ -956,7 +956,9 @@ const COLOR_KEYWORD = "color";
|
956 | 956 | const FILL_KEYWORD = "fill";
|
957 | 957 | const BG_FILL = "bgFill";
|
958 | 958 | const STYLECLASS_SEP = ",";
|
| 959 | +const config = getConfig(); |
959 | 960 | let classes = {};
|
| 961 | +const sanitizeText = (txt) => common.sanitizeText(txt, config); |
960 | 962 | const addStyleClass = function(id, styleAttributes = "") {
|
961 | 963 | if (classes[id] === void 0) {
|
962 | 964 | classes[id] = { id, styles: [], textStyles: [] };
|
@@ -998,6 +1000,9 @@ const populateBlockDatabase = (_blockList, parent) => {
|
998 | 1000 | const blockList = _blockList.flat();
|
999 | 1001 | const children = [];
|
1000 | 1002 | for (const block of blockList) {
|
| 1003 | + if (block.label) { |
| 1004 | + block.label = sanitizeText(block.label); |
| 1005 | + } |
1001 | 1006 | if (block.type === "classDef") {
|
1002 | 1007 | addStyleClass(block.id, block.css);
|
1003 | 1008 | continue;
|
@@ -1171,7 +1176,7 @@ const getClasses$1 = function() {
|
1171 | 1176 | return classes;
|
1172 | 1177 | };
|
1173 | 1178 | const db = {
|
1174 |
| - getConfig: () => getConfig().block, |
| 1179 | + getConfig: () => getConfig$1().block, |
1175 | 1180 | typeStr2Type,
|
1176 | 1181 | edgeTypeStr2Type,
|
1177 | 1182 | edgeStrToEdgeData,
|
@@ -1404,7 +1409,7 @@ function getNodeFromBlock(block, db2, positioned = false) {
|
1404 | 1409 | positioned,
|
1405 | 1410 | intersect: void 0,
|
1406 | 1411 | type: vertex.type,
|
1407 |
| - padding: padding2 ?? (((_c = (_b2 = getConfig()) == null ? void 0 : _b2.block) == null ? void 0 : _c.padding) || 0) |
| 1412 | + padding: padding2 ?? (((_c = (_b2 = getConfig$1()) == null ? void 0 : _b2.block) == null ? void 0 : _c.padding) || 0) |
1408 | 1413 | };
|
1409 | 1414 | return node;
|
1410 | 1415 | }
|
@@ -1512,7 +1517,7 @@ async function insertEdges(elem, edges, blocks2, db2, id) {
|
1512 | 1517 | }
|
1513 | 1518 | }
|
1514 | 1519 | }
|
1515 |
| -const padding = ((_b = (_a = getConfig$1()) == null ? void 0 : _a.block) == null ? void 0 : _b.padding) || 8; |
| 1520 | +const padding = ((_b = (_a = getConfig()) == null ? void 0 : _a.block) == null ? void 0 : _b.padding) || 8; |
1516 | 1521 | function calculateBlockPosition(columns, position) {
|
1517 | 1522 | if (columns === 0 || !Number.isInteger(columns)) {
|
1518 | 1523 | throw new Error("Columns must be an integer !== 0.");
|
@@ -1765,7 +1770,7 @@ const getClasses = function(text, diagObj) {
|
1765 | 1770 | return diagObj.db.getClasses();
|
1766 | 1771 | };
|
1767 | 1772 | const draw = async function(text, id, _version, diagObj) {
|
1768 |
| - const { securityLevel, block: conf } = getConfig(); |
| 1773 | + const { securityLevel, block: conf } = getConfig$1(); |
1769 | 1774 | const db2 = diagObj.db;
|
1770 | 1775 | let sandboxElement;
|
1771 | 1776 | if (securityLevel === "sandbox") {
|
|
0 commit comments