@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
28 lines (27 loc) • 1.59 kB
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
import { register as coreRegister } from "adopted-style-sheets";
import { Log, setRuntimeMode } from "../schema";
import { setCustomTagNames } from "./component-names";
import { initializeI18n } from "./i18n";
let initialized = false;
let options;
export const bootstrap = async (themes, loaders, koliBriOptions) => {
var _a, _b;
const nodeEnv = typeof process !== 'undefined' && process.env ? process.env.NODE_ENV : undefined;
setRuntimeMode((koliBriOptions === null || koliBriOptions === void 0 ? void 0 : koliBriOptions.environment) || nodeEnv || 'production');
initializeI18n((_b = (_a = koliBriOptions === null || koliBriOptions === void 0 ? void 0 : koliBriOptions.translation) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : 'de', koliBriOptions === null || koliBriOptions === void 0 ? void 0 : koliBriOptions.translations);
if (koliBriOptions === null || koliBriOptions === void 0 ? void 0 : koliBriOptions.transformTagName) {
setCustomTagNames(koliBriOptions === null || koliBriOptions === void 0 ? void 0 : koliBriOptions.transformTagName);
}
const coreRegisterReturnValue = await coreRegister(themes, loaders, koliBriOptions);
initialized = true;
options = koliBriOptions;
Log.info('Development mode active - Enhanced debugging features available');
return coreRegisterReturnValue;
};
export const register = bootstrap;
export const isInitialized = () => initialized;
export const getOptions = () => options;
//# sourceMappingURL=bootstrap.js.map