@arcgis/coding-components
Version:
ArcGIS Coding Components
25 lines (24 loc) • 872 B
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import { i } from "./monaco-importer.js";
import { StandaloneServices as t } from "monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js";
import { IStandaloneThemeService as n } from "monaco-editor/esm/vs/editor/standalone/common/standaloneTheme.js";
import { generateTokensCSSForColorMap as a } from "monaco-editor/esm/vs/editor/common/languages/supports/tokenization.js";
async function c(e, o) {
return (await (await i()).colorize(e, o, { tabSize: 2 })).replace(/<br\s*\/?>$/u, "");
}
async function S(e, o, r) {
e?.tagName === "CODE" && (e.innerHTML = await c(o ?? "", r));
}
function d() {
const o = t.get(n).getColorTheme();
return a(o.tokenTheme.getColorMap());
}
function g(e) {
return t.get(n).onDidColorThemeChange(() => e());
}
export {
S as a,
c,
d as g,
g as o
};