@openfga/frontend-utils
Version:
Exposes helpful utilities for building authoring experiences of OpenFGA Models.
26 lines (25 loc) • 983 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.monacoThemes = void 0;
exports.buildMonacoTheme = buildMonacoTheme;
const constants_1 = require("../../constants");
const theme_1 = require("../../theme");
const utils_1 = require("../../theme/utils");
function buildMonacoTheme(themeConfig) {
return {
base: themeConfig.baseTheme || "vs",
inherit: true,
colors: {
"editor.background": themeConfig.background.color,
},
rules: Object.values(theme_1.OpenFgaDslThemeToken).map((token) => {
const style = (0, utils_1.getThemeTokenStyle)(token, themeConfig);
return Object.assign({ token: `${token}.${constants_1.LANGUAGE_NAME}` }, style);
}),
};
}
const monacoThemes = {};
exports.monacoThemes = monacoThemes;
Object.values(theme_1.SupportedTheme).forEach((themeName) => {
monacoThemes[themeName] = buildMonacoTheme(theme_1.supportedThemes[themeName]);
});