UNPKG

@nteract/monaco-editor

Version:

A React component for the monaco editor, tailored for nteract

83 lines 3.01 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.customMonacoHCLightTheme = exports.HCLightThemeName = exports.customMonacoDarkTheme = exports.DarkThemeName = exports.customMonacoLightTheme = exports.LightThemeName = void 0; const monaco = __importStar(require("monaco-editor/esm/vs/editor/editor.api")); /** * The default light theme with customized background */ exports.LightThemeName = "nteract-light"; /** * Default monaco theme for light theme */ exports.customMonacoLightTheme = { base: "vs", inherit: true, rules: [], colors: { // Ensure that editor background is set to white // Without this, the Monaco light theme has a yellowish tone. "editor.background": "#FFFFFF" } }; monaco.editor.defineTheme(exports.LightThemeName, exports.customMonacoLightTheme); /** * The default dark theme with customized background */ exports.DarkThemeName = "nteract-dark"; /** * Default monaco theme for dark theme */ exports.customMonacoDarkTheme = { base: "vs-dark", inherit: true, rules: [], colors: { "editor.background": "#111111" } }; monaco.editor.defineTheme(exports.DarkThemeName, exports.customMonacoDarkTheme); /** * The custom high contrast light theme with customized background */ exports.HCLightThemeName = "nteract-hc-light"; /** * Default monaco theme for light high contrast mode */ exports.customMonacoHCLightTheme = { base: "vs", inherit: true, rules: [ { token: "annotation", foreground: "000000" }, { token: "delimiter.html", foreground: "000000" }, { token: "operator.scss", foreground: "000000" }, { token: "operator.sql", foreground: "000000" }, { token: "operator.swift", foreground: "000000" }, { token: "predefined.sql", foreground: "000000" } ], colors: { // Ensure that editor background is set to white // Without this, the Monaco light theme has a yellowish tone. "editor.background": "#FFFFFF" } }; monaco.editor.defineTheme(exports.HCLightThemeName, exports.customMonacoHCLightTheme); //# sourceMappingURL=theme.js.map