text/js/styles-c10674c1-D5w-rKcB.ch...

1 строка
29 KiB
Plaintext
Исходник Обычный вид История

{"version":3,"file":"styles-c10674c1-D5w-rKcB.chunk.mjs","sources":["../node_modules/d3-selection/src/selectAll.js","../node_modules/dagre-d3-es/src/dagre-js/util.js","../node_modules/dagre-d3-es/src/dagre-js/label/add-html-label.js","../node_modules/mermaid/dist/styles-c10674c1.js"],"sourcesContent":["import array from \"./array.js\";\nimport {Selection, root} from \"./selection/index.js\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([document.querySelectorAll(selector)], [document.documentElement])\n : new Selection([array(selector)], root);\n}\n","import * as _ from 'lodash-es';\n\n// Public utility functions\nexport { isSubgraph, edgeToId, applyStyle, applyClass, applyTransition };\n\n/*\n * Returns true if the specified node in the graph is a subgraph node. A\n * subgraph node is one that contains other nodes.\n */\nfunction isSubgraph(g, v) {\n return !!g.children(v).length;\n}\n\nfunction edgeToId(e) {\n return escapeId(e.v) + ':' + escapeId(e.w) + ':' + escapeId(e.name);\n}\n\nvar ID_DELIM = /:/g;\nfunction escapeId(str) {\n return str ? String(str).replace(ID_DELIM, '\\\\:') : '';\n}\n\nfunction applyStyle(dom, styleFn) {\n if (styleFn) {\n dom.attr('style', styleFn);\n }\n}\n\nfunction applyClass(dom, classFn, otherClasses) {\n if (classFn) {\n dom.attr('class', classFn).attr('class', otherClasses + ' ' + dom.attr('class'));\n }\n}\n\nfunction applyTransition(selection, g) {\n var graph = g.graph();\n\n if (_.isPlainObject(graph)) {\n var transition = graph.transition;\n if (_.isFunction(transition)) {\n return transition(selection);\n }\n }\n\n return selection;\n}\n","import * as util from '../util.js';\n\nexport { addHtmlLabel };\n\nfunction addHtmlLabel(root, node) {\n var fo = root.append('foreignObject').attr('width', '100000');\n\n var div = fo.append('xhtml:div');\n div.attr('xmlns', 'http://www.w3.org/1999/xhtml');\n\n var label = node.label;\n switch (typeof label) {\n case 'function':\n div.insert(label);\n break;\n case 'object':\n // Currently we assume this is a DOM object.\n div.insert(function () {\n return label;\n });\n break;\n default:\n div.html(label);\n }\n\n util.applyStyle(div, node.labelStyle);\n div.style('display', 'inline-block');\n // Fix for firefox\n div.style('white-space', 'nowrap');\n\n var client = div.node().getBoundingClientRect();\n fo.attr('width', client.width).attr('height', client.height);\n\n return fo;\n}\n","import * as graphlib from \"dagre-d3-es/src/graphlib/index.js\";\nimport { curveLinear, select, selectAll } from \"d3\";\nimport { k as getStylesFromArray, l as log, m as evaluate, c as getConfig, e as common, r as renderKatex, n as interpolateToCurve, u as utils, o as setupGraphViewbox } from \"./mermaid-b5860b54.js\";\nimport { r as render } from \"./index-3862675e.js\";\nimport { addHtmlLabel } from \"dagre-d3-es/src/dagre-js/label/add-html-label.js\";\nimport * as khroma from \"khroma\";\nconst conf = {};\nconst setConf = function(cnf) {\n const keys = Object.keys(cnf);\n for (const key of keys) {\n conf[key] = cnf[key];\n }\n};\nconst addVertices = async function(vert, g, svgId, root, doc, diagObj) {\n const svg = root.select(`[id=\"${svgId}\"]`);\n const keys = Object.keys(vert);\n for (const id of keys) {\n const vertex = vert[id];\n let classStr = \"default\";\n if (vertex.classes.length > 0) {\n classStr = vertex.classes.join(\" \");\n }\n classStr = classStr + \" flowchart-label\";\n const styles = getStylesFromArray(vertex.styles);\n let vertexText = vertex.text !== void 0 ? vertex.text : vertex.id;\n let vertexNode;\n log.info(\"vertex\", vertex, vertex.labelType);\n if (vertex.labelType === \"markdown\") {\n log.info(\"vertex\", vertex, vertex.labelType);\n } else {\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n const node = {\n label: vertexText\n };\n vertexNode = addHtmlLabel(svg, node).node();\n