UNPKG

@public-ui/components

Version:

Contains all web components that belong to KoliBri - The accessible HTML-Standard.

5 lines 2.26 kB
/*! * KoliBri - The accessible HTML-Standard */ import{V as t,L as o,v as i,E as e,W as n,Q as l,X as s,Y as a,_ as r,p as c,$ as f,J as d,a0 as u}from"./common-Cx_AGO_M.js";import{i as p,r as m}from"./dev.utils-02Sl9bQo.js";import"./index-BQlHOxik.js";const v=()=>{let t=e().KoliBri;if(t===undefined){t={};Object.defineProperty(e(),"KoliBri",{value:t,writable:false})}return t};function L(t,i){try{Object.defineProperty(v(),t,{get:function(){return i}})}catch(i){o.debug(`KoliBri property ${t} is already bind.`)}}const y=(t,i)=>o.debug(`${t} ${i?"":"not "}activated`);const h=()=>{p();if(t()){m();L("a11yColorContrast",n);L("querySelector",l);L("querySelectorAll",s);L("querySelectorColors",a);L("utils",(function(){return r}));L("parseJson",c);L("stringifyJson",f);y("Development mode",t());y("Experimental mode",d());y("Color contrast analysis",u());setTimeout((()=>{try{const t=i();const o=t===null||t===void 0?void 0:t.body;if(t&&o&&typeof t.createElement==="function"){const i=t.createElement("svg");i.setAttribute("aria-label","KoliBri-DevTools");i.setAttribute("xmlns","http://www.w3.org/2000/svg");i.setAttribute("role","toolbar");i.setAttribute("style","position: fixed;color: black;font-size: 200%;bottom: 0.25rem;right: 0.25rem;");i.innerHTML=`<svg\n xmlns="http://www.w3.org/2000/svg"\n width="50"\n height="50"\n viewBox="0 0 600 600"\n>\n <path d="M353 322L213 304V434L353 322Z" fill="#047" />\n <path d="M209 564V304L149 434L209 564Z" fill="#047" />\n <path d="M357 316L417 250L361 210L275 244L357 316Z" fill="#047" />\n <path d="M353 318L35 36L213 300L353 318Z" fill="#047" />\n <path d="M329 218L237 92L250 222L272 241L329 218Z" fill="#047" />\n <path d="M391 286L565 272L421 252L391 286Z" fill="#047" />\n</svg>`;o.appendChild(i)}}catch(t){o.debug(["Could not initialize DevTools UI (likely in SSR/test environment):",t])}}),100);if(u()){const t=setTimeout((()=>{clearTimeout(t);try{const t=i();const o=t===null||t===void 0?void 0:t.body;if(t&&o&&typeof t.createElement==="function"){setInterval((()=>{r.queryHtmlElementColors(t.createElement("div"),n(o),false,false)}),1e4)}}catch(t){o.debug(["Could not initialize color contrast analysis:",t])}}),2500)}}};export{h as initialize}; //# sourceMappingURL=devtools-CTlVZVnW.js.map