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) • 2.33 kB
JavaScript
const s=require("./chunk-Y2CYZVJY-DPaYLFFP.cjs"),c=require("./chunk-WYO6CB5R-u4mJNOcO.cjs");var p=s.__name(e=>{const{handDrawnSeed:t}=c.getConfig2();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),u=s.__name(e=>{const t=d([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),d=s.__name(e=>{const t=new Map;return e.forEach(n=>{const[i,a]=n.split(":");t.set(i.trim(),a?.trim())}),t},"styles2Map"),h=s.__name(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),f=s.__name(e=>{const{stylesArray:t}=u(e),n=[],i=[],a=[],l=[];return t.forEach(r=>{const o=r[0];h(o)?n.push(r.join(":")+" !important"):(i.push(r.join(":")+" !important"),o.includes("stroke")&&a.push(r.join(":")+" !important"),o==="fill"&&l.push(r.join(":")+" !important"))}),{labelStyles:n.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:a,backgroundStyles:l}},"styles2String"),g=s.__name((e,t)=>{const{themeVariables:n,handDrawnSeed:i}=c.getConfig2(),{nodeBorder:a,mainBkg:l}=n,{stylesMap:r}=u(e);return Object.assign({roughness:.7,fill:r.get("fill")||l,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:r.get("stroke")||a,seed:i,strokeWidth:r.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:m(r.get("stroke-dasharray"))},t)},"userNodeOverrides"),m=s.__name(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const n=isNaN(t[0])?0:t[0];return[n,n]}return[isNaN(t[0])?0:t[0],isNaN(t[1])?0:t[1]]},"getStrokeDashArray");Object.defineProperty(exports,"compileStyles",{enumerable:!0,get:function(){return u}});Object.defineProperty(exports,"isLabelStyle",{enumerable:!0,get:function(){return h}});Object.defineProperty(exports,"solidStateFill",{enumerable:!0,get:function(){return p}});Object.defineProperty(exports,"styles2String",{enumerable:!0,get:function(){return f}});Object.defineProperty(exports,"userNodeOverrides",{enumerable:!0,get:function(){return g}});