UNPKG

ranui

Version:

A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.

34 lines (33 loc) 1.23 kB
import { n as i } from "./chunk-Y2CYZVJY-0JxdZxki.js"; import { f, x as r } from "./chunk-WYO6CB5R-DDHkKowO.js"; import { p as d } from "./chunk-ICXQ74PX-DR8rL-xF.js"; var h = /* @__PURE__ */ i(({ flowchart: n }) => { const o = n?.subGraphTitleMargin?.top ?? 0, t = n?.subGraphTitleMargin?.bottom ?? 0; return { subGraphTitleTopMargin: o, subGraphTitleBottomMargin: t, subGraphTitleTotalMargin: o + t }; }, "getSubGraphTitleMargins"); async function c(n, o) { const t = n.getElementsByTagName("img"); if (!t || t.length === 0) return; const l = o.replace(/<img[^>]*>/g, "").trim() === ""; await Promise.all([...t].map((e) => new Promise((p) => { function a() { if (e.style.display = "flex", e.style.flexDirection = "column", l) { const m = r().fontSize ? r().fontSize : window.getComputedStyle(document.body).fontSize, g = 5, [u = f.fontSize] = d(m), s = u * g + "px"; e.style.minWidth = s, e.style.maxWidth = s; } else e.style.width = "100%"; p(e); } i(a, "setupImage"), setTimeout(() => { e.complete && a(); }), e.addEventListener("error", a), e.addEventListener("load", a); }))); } i(c, "configureLabelImages"); export { h as n, c as t };