+68
@@ -0,0 +1,68 @@
|
||||
import {
|
||||
parseFontSize
|
||||
} from "./chunk-GUBXVVWZ.js";
|
||||
import {
|
||||
defaultConfig_default,
|
||||
getConfig2
|
||||
} from "./chunk-6YWVU24R.js";
|
||||
import {
|
||||
__name
|
||||
} from "./chunk-XOKMXDAB.js";
|
||||
|
||||
// node_modules/mermaid/dist/chunks/mermaid.core/chunk-ZZ45TVLE.mjs
|
||||
var getSubGraphTitleMargins = __name(({
|
||||
flowchart
|
||||
}) => {
|
||||
var _a, _b;
|
||||
const subGraphTitleTopMargin = ((_a = flowchart == null ? void 0 : flowchart.subGraphTitleMargin) == null ? void 0 : _a.top) ?? 0;
|
||||
const subGraphTitleBottomMargin = ((_b = flowchart == null ? void 0 : flowchart.subGraphTitleMargin) == null ? void 0 : _b.bottom) ?? 0;
|
||||
const subGraphTitleTotalMargin = subGraphTitleTopMargin + subGraphTitleBottomMargin;
|
||||
return {
|
||||
subGraphTitleTopMargin,
|
||||
subGraphTitleBottomMargin,
|
||||
subGraphTitleTotalMargin
|
||||
};
|
||||
}, "getSubGraphTitleMargins");
|
||||
async function configureLabelImages(container, labelText) {
|
||||
const images = container.getElementsByTagName("img");
|
||||
if (!images || images.length === 0) {
|
||||
return;
|
||||
}
|
||||
const noImgText = labelText.replace(/<img[^>]*>/g, "").trim() === "";
|
||||
await Promise.all(
|
||||
[...images].map(
|
||||
(img) => new Promise((res) => {
|
||||
function setupImage() {
|
||||
img.style.display = "flex";
|
||||
img.style.flexDirection = "column";
|
||||
if (noImgText) {
|
||||
const bodyFontSize = getConfig2().fontSize ? getConfig2().fontSize : window.getComputedStyle(document.body).fontSize;
|
||||
const enlargingFactor = 5;
|
||||
const [parsedBodyFontSize = defaultConfig_default.fontSize] = parseFontSize(bodyFontSize);
|
||||
const width = parsedBodyFontSize * enlargingFactor + "px";
|
||||
img.style.minWidth = width;
|
||||
img.style.maxWidth = width;
|
||||
} else {
|
||||
img.style.width = "100%";
|
||||
}
|
||||
res(img);
|
||||
}
|
||||
__name(setupImage, "setupImage");
|
||||
setTimeout(() => {
|
||||
if (img.complete) {
|
||||
setupImage();
|
||||
}
|
||||
});
|
||||
img.addEventListener("error", setupImage);
|
||||
img.addEventListener("load", setupImage);
|
||||
})
|
||||
)
|
||||
);
|
||||
}
|
||||
__name(configureLabelImages, "configureLabelImages");
|
||||
|
||||
export {
|
||||
getSubGraphTitleMargins,
|
||||
configureLabelImages
|
||||
};
|
||||
//# sourceMappingURL=chunk-LN4HZV3Y.js.map
|
||||
Reference in New Issue
Block a user