@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
4 lines • 2.74 kB
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
;var common=require("./common-1pTy2kta.js"),dev_utils=require("./dev.utils-B5e6BOel.js");require("./index-BH-BeuHg.js");const getKoliBri=()=>{let o=common.getWindow().KoliBri;return void 0===o&&(o={},Object.defineProperty(common.getWindow(),"KoliBri",{value:o,writable:!1})),o};function prototypeKoliBri(o,e){try{Object.defineProperty(getKoliBri(),o,{get:function(){return e}})}catch(e){common.Log.debug(`KoliBri property ${o} is already bind.`)}}const metaModeLog=(o,e)=>common.Log.debug(`${o} ${e?"":"not "}activated`),initialize=()=>{if(dev_utils.initKoliBri(),common.isDevMode()&&(dev_utils.renderDevAdvice(),prototypeKoliBri("a11yColorContrast",common.koliBriA11yColorContrast),prototypeKoliBri("querySelector",common.koliBriQuerySelector),prototypeKoliBri("querySelectorAll",common.koliBriQuerySelectorAll),prototypeKoliBri("querySelectorColors",common.koliBriQuerySelectorColors),prototypeKoliBri("utils",function(){return common.KoliBriUtils}),prototypeKoliBri("parseJson",common.parseJson),prototypeKoliBri("stringifyJson",common.stringifyJson),metaModeLog("Development mode",common.isDevMode()),metaModeLog("Experimental mode",common.getExperimentalMode()),metaModeLog("Color contrast analysis",common.getColorContrastAnalysis()),setTimeout(()=>{try{const o=common.getDocument(),e=null==o?void 0:o.body;if(o&&e&&"function"==typeof o.createElement){const t=o.createElement("svg");t.setAttribute("aria-label","KoliBri-DevTools"),t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("role","toolbar"),t.setAttribute("style","position: fixed;color: black;font-size: 200%;bottom: 0.25rem;right: 0.25rem;"),t.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>',e.appendChild(t)}}catch(o){common.Log.debug(["Could not initialize DevTools UI (likely in SSR/test environment):",o])}},100),common.getColorContrastAnalysis())){const o=setTimeout(()=>{clearTimeout(o);try{const o=common.getDocument(),e=null==o?void 0:o.body;o&&e&&"function"==typeof o.createElement&&setInterval(()=>{common.KoliBriUtils.queryHtmlElementColors(o.createElement("div"),common.koliBriA11yColorContrast(e),!1,!1)},1e4)}catch(o){common.Log.debug(["Could not initialize color contrast analysis:",o])}},2500)}};exports.initialize=initialize;