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.

2 lines (1 loc) 1.21 kB
const a=require("./chunk-Y2CYZVJY-DPaYLFFP.cjs"),o=require("./chunk-WYO6CB5R-u4mJNOcO.cjs"),d=require("./chunk-ICXQ74PX-BbT9JaEW.cjs");var m=a.__name(({flowchart:n})=>{const r=n?.subGraphTitleMargin?.top??0,t=n?.subGraphTitleMargin?.bottom??0;return{subGraphTitleTopMargin:r,subGraphTitleBottomMargin:t,subGraphTitleTotalMargin:r+t}},"getSubGraphTitleMargins");async function u(n,r){const t=n.getElementsByTagName("img");if(!t||t.length===0)return;const l=r.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...t].map(e=>new Promise(c=>{function i(){if(e.style.display="flex",e.style.flexDirection="column",l){const g=o.getConfig2().fontSize?o.getConfig2().fontSize:window.getComputedStyle(document.body).fontSize,f=5,[p=o.defaultConfig_default.fontSize]=d.parseFontSize(g),s=p*f+"px";e.style.minWidth=s,e.style.maxWidth=s}else e.style.width="100%";c(e)}a.__name(i,"setupImage"),setTimeout(()=>{e.complete&&i()}),e.addEventListener("error",i),e.addEventListener("load",i)})))}a.__name(u,"configureLabelImages");Object.defineProperty(exports,"configureLabelImages",{enumerable:!0,get:function(){return u}});Object.defineProperty(exports,"getSubGraphTitleMargins",{enumerable:!0,get:function(){return m}});