Skip to main content
Glama
deleonio
by deleonio
dev.utils.ts2.22 kB
import { Log, getDocument, isTestMode, setColorContrastAnalysis, setExperimentalMode } from '../schema'; import { Env } from '@stencil/core'; import { getWindow } from '../schema'; const initMeta = (): void => { try { const document = getDocument(); if (!document || typeof document.querySelector !== 'function') { return; // Skip meta initialization if document is not available } const meta = document.querySelector('meta[name="kolibri"]'); if (meta && meta.hasAttribute('content')) { const content = meta.getAttribute('content'); if (typeof content === 'string') { setExperimentalMode(content.includes('experimental-mode=true')); setColorContrastAnalysis(content.includes('color-contrast-analysis=true')); } } } catch (error) { // Ignore meta initialization errors in test/SSR environments } }; const getKoliBri = (): Record<string, unknown> => { let kolibri = getWindow().KoliBri; if (kolibri === undefined) { kolibri = {}; Object.defineProperty(getWindow(), 'KoliBri', { value: kolibri, writable: false, }); } return kolibri; }; export { getKoliBri }; export const initKoliBri = (): void => { initMeta(); Log.debug( ` ,--. ,--. ,--. ,--. ,-----. ,--. | .' / ,---. | | \`--' | |) /_ ,--.--. \`--' | . ' | .-. | | | ,--. | .-. \\ | .--' ,--. | |\\ \\ | '-' | | | | | | '--' / | | | | \`--' \`--´ \`---´ \`--' \`--' \`------´ \`--' \`--' 🚹 The accessible HTML-Standard | 👉 https://public-ui.github.io | ${Env.kolibriVersion} `, { forceLog: true, }, ); }; export const renderDevAdvice = (): void => { if (getKoliBri().adviceShown !== true) { Object.defineProperty(getKoliBri(), 'adviceShown', { get: function () { return true; }, }); Log.debug( ` You are using the KoliBri component library. If you have any suggestions for improvement or find a problem, please contact us: Ticket: https://github.com/public-ui/kolibri/issues/new/choose (for privacy reasons, please use email) Email: kolibri@itzbund.de `, ); } }; let nonce = (): string => Math.floor(Math.random() * 16777215).toString(16); if (isTestMode()) { nonce = (): string => 'nonce'; } export { nonce };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/deleonio/public-ui-kolibri'

If you have feedback or need assistance with the MCP directory API, please join our Discord server