UNPKG

yanzi-monaco-editorbb

Version:

这是一个基于微软的monaco和vue封装的一个代码编辑器,浏览器可运行。主要功能有:html、javascript、css代码编辑,高亮显示,语法错误提示等,可以帮您的项目很快的拥有一个web端的代码编辑器

256 lines (245 loc) 8.44 kB
((typeof self !== 'undefined' ? self : this)["webpackJsonpyanziMonacoEditor"] = (typeof self !== 'undefined' ? self : this)["webpackJsonpyanziMonacoEditor"] || []).push([[16],{ /***/ "bfb2": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); /* harmony import */ var core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("4d63"); /* harmony import */ var core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var core_js_modules_es_regexp_dot_all_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("c607"); /* harmony import */ var core_js_modules_es_regexp_dot_all_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_dot_all_js__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("ac1f"); /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("2c3e"); /* harmony import */ var core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("25f0"); /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_4__); /*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.32.1(29a273516805a852aa8edc5e05059f119b13eff0) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/ // src/basic-languages/css/css.ts var conf = { wordPattern: /(#?-?\d*\.\d\w*%?)|((::|[@#.!:])?[\w-?]+%?)|::|[@#.!:]/g, comments: { blockComment: ["/*", "*/"] }, brackets: [["{", "}"], ["[", "]"], ["(", ")"]], autoClosingPairs: [{ open: "{", close: "}", notIn: ["string", "comment"] }, { open: "[", close: "]", notIn: ["string", "comment"] }, { open: "(", close: ")", notIn: ["string", "comment"] }, { open: '"', close: '"', notIn: ["string", "comment"] }, { open: "'", close: "'", notIn: ["string", "comment"] }], surroundingPairs: [{ open: "{", close: "}" }, { open: "[", close: "]" }, { open: "(", close: ")" }, { open: '"', close: '"' }, { open: "'", close: "'" }], folding: { markers: { start: new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"), end: new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/") } } }; var language = { defaultToken: "", tokenPostfix: ".css", ws: "[ \n\r\f]*", identifier: "-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*", brackets: [{ open: "{", close: "}", token: "delimiter.bracket" }, { open: "[", close: "]", token: "delimiter.bracket" }, { open: "(", close: ")", token: "delimiter.parenthesis" }, { open: "<", close: ">", token: "delimiter.angle" }], tokenizer: { root: [{ include: "@selector" }], selector: [{ include: "@comments" }, { include: "@import" }, { include: "@strings" }, ["[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)", { token: "keyword", next: "@keyframedeclaration" }], ["[@](page|content|font-face|-moz-document)", { token: "keyword" }], ["[@](charset|namespace)", { token: "keyword", next: "@declarationbody" }], ["(url-prefix)(\\()", ["attribute.value", { token: "delimiter.parenthesis", next: "@urldeclaration" }]], ["(url)(\\()", ["attribute.value", { token: "delimiter.parenthesis", next: "@urldeclaration" }]], { include: "@selectorname" }, ["[\\*]", "tag"], ["[>\\+,]", "delimiter"], ["\\[", { token: "delimiter.bracket", next: "@selectorattribute" }], ["{", { token: "delimiter.bracket", next: "@selectorbody" }]], selectorbody: [{ include: "@comments" }, ["[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))", "attribute.name", "@rulevalue"], ["}", { token: "delimiter.bracket", next: "@pop" }]], selectorname: [["(\\.|#(?=[^{])|%|(@identifier)|:)+", "tag"]], selectorattribute: [{ include: "@term" }, ["]", { token: "delimiter.bracket", next: "@pop" }]], term: [{ include: "@comments" }, ["(url-prefix)(\\()", ["attribute.value", { token: "delimiter.parenthesis", next: "@urldeclaration" }]], ["(url)(\\()", ["attribute.value", { token: "delimiter.parenthesis", next: "@urldeclaration" }]], { include: "@functioninvocation" }, { include: "@numbers" }, { include: "@name" }, { include: "@strings" }, ["([<>=\\+\\-\\*\\/\\^\\|\\~,])", "delimiter"], [",", "delimiter"]], rulevalue: [{ include: "@comments" }, { include: "@strings" }, { include: "@term" }, ["!important", "keyword"], [";", "delimiter", "@pop"], ["(?=})", { token: "", next: "@pop" }]], warndebug: [["[@](warn|debug)", { token: "keyword", next: "@declarationbody" }]], import: [["[@](import)", { token: "keyword", next: "@declarationbody" }]], urldeclaration: [{ include: "@strings" }, ["[^)\r\n]+", "string"], ["\\)", { token: "delimiter.parenthesis", next: "@pop" }]], parenthizedterm: [{ include: "@term" }, ["\\)", { token: "delimiter.parenthesis", next: "@pop" }]], declarationbody: [{ include: "@term" }, [";", "delimiter", "@pop"], ["(?=})", { token: "", next: "@pop" }]], comments: [["\\/\\*", "comment", "@comment"], ["\\/\\/+.*", "comment"]], comment: [["\\*\\/", "comment", "@pop"], [/[^*/]+/, "comment"], [/./, "comment"]], name: [["@identifier", "attribute.value"]], numbers: [["-?(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?", { token: "attribute.value.number", next: "@units" }], ["#[0-9a-fA-F_]+(?!\\w)", "attribute.value.hex"]], units: [["(em|ex|ch|rem|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?", "attribute.value.unit", "@pop"]], keyframedeclaration: [["@identifier", "attribute.value"], ["{", { token: "delimiter.bracket", switchTo: "@keyframebody" }]], keyframebody: [{ include: "@term" }, ["{", { token: "delimiter.bracket", next: "@selectorbody" }], ["}", { token: "delimiter.bracket", next: "@pop" }]], functioninvocation: [["@identifier\\(", { token: "attribute.value", next: "@functionarguments" }]], functionarguments: [["\\$@identifier@ws:", "attribute.name"], ["[,]", "delimiter"], { include: "@term" }, ["\\)", { token: "attribute.value", next: "@pop" }]], strings: [['~?"', { token: "string", next: "@stringenddoublequote" }], ["~?'", { token: "string", next: "@stringendquote" }]], stringenddoublequote: [["\\\\.", "string"], ['"', { token: "string", next: "@pop" }], [/[^\\"]+/, "string"], [".", "string"]], stringendquote: [["\\\\.", "string"], ["'", { token: "string", next: "@pop" }], [/[^\\']+/, "string"], [".", "string"]] } }; /***/ }) }]);