@codemirror/lang-css
Advanced tools
Comparing version 0.18.0 to 0.19.0
@@ -0,3 +1,13 @@ | ||
## 0.19.0 (2021-08-11) | ||
### Breaking changes | ||
Update dependencies to 0.19.0 | ||
## 0.18.0 (2021-03-03) | ||
### Breaking changes | ||
Update dependencies to 0.18. | ||
## 0.17.1 (2021-01-06) | ||
@@ -4,0 +14,0 @@ |
@@ -1,8 +0,19 @@ | ||
import { LezerLanguage, LanguageSupport } from '@codemirror/language'; | ||
import { LRLanguage, LanguageSupport } from '@codemirror/language'; | ||
import { Extension } from '@codemirror/state'; | ||
declare const cssLanguage: LezerLanguage; | ||
/** | ||
A language provider based on the [Lezer CSS | ||
parser](https://github.com/lezer-parser/css), extended with | ||
highlighting and indentation information. | ||
*/ | ||
declare const cssLanguage: LRLanguage; | ||
/** | ||
CSS property and value keyword completion. | ||
*/ | ||
declare const cssCompletion: Extension; | ||
/** | ||
Language support for CSS. | ||
*/ | ||
declare function css(): LanguageSupport; | ||
export { css, cssCompletion, cssLanguage }; |
@@ -1,3 +0,3 @@ | ||
import { parser } from 'lezer-css'; | ||
import { syntaxTree, LezerLanguage, indentNodeProp, continuedIndent, foldNodeProp, foldInside, LanguageSupport } from '@codemirror/language'; | ||
import { parser } from '@lezer/css'; | ||
import { syntaxTree, LRLanguage, indentNodeProp, continuedIndent, foldNodeProp, foldInside, LanguageSupport } from '@codemirror/language'; | ||
import { styleTags, tags as tags$1 } from '@codemirror/highlight'; | ||
@@ -17,3 +17,3 @@ | ||
} | ||
const pseudoClasses = [ | ||
const pseudoClasses = /*@__PURE__*/[ | ||
"active", "after", "before", "checked", "default", | ||
@@ -28,3 +28,3 @@ "disabled", "empty", "enabled", "first-child", "first-letter", | ||
].map(name => ({ type: "class", label: name })); | ||
const values = [ | ||
const values = /*@__PURE__*/[ | ||
"above", "absolute", "activeborder", "additive", "activecaption", "after-white-space", | ||
@@ -85,3 +85,3 @@ "ahead", "alias", "all", "all-scroll", "alphabetic", "alternate", "always", | ||
"windowtext", "words", "wrap", "wrap-reverse", "x-large", "x-small", "xor", "xx-large", "xx-small" | ||
].map(name => ({ type: "keyword", label: name })).concat([ | ||
].map(name => ({ type: "keyword", label: name })).concat(/*@__PURE__*/[ | ||
"aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", | ||
@@ -114,3 +114,3 @@ "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", | ||
].map(name => ({ type: "constant", label: name }))); | ||
const tags = [ | ||
const tags = /*@__PURE__*/[ | ||
"a", "abbr", "address", "article", "aside", "b", "bdi", "bdo", "blockquote", "body", | ||
@@ -126,3 +126,3 @@ "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "dd", "del", | ||
const completeCSS = context => { | ||
let { state, pos } = context, node = syntaxTree(state).resolve(pos, -1); | ||
let { state, pos } = context, node = syntaxTree(state).resolveInner(pos, -1); | ||
if (node.name == "PropertyName") | ||
@@ -152,15 +152,17 @@ return { from: node.from, options: properties(), span }; | ||
/// A language provider based on the [Lezer CSS | ||
/// parser](https://github.com/lezer-parser/css), extended with | ||
/// highlighting and indentation information. | ||
const cssLanguage = LezerLanguage.define({ | ||
parser: parser.configure({ | ||
/** | ||
A language provider based on the [Lezer CSS | ||
parser](https://github.com/lezer-parser/css), extended with | ||
highlighting and indentation information. | ||
*/ | ||
const cssLanguage = /*@__PURE__*/LRLanguage.define({ | ||
parser: /*@__PURE__*/parser.configure({ | ||
props: [ | ||
indentNodeProp.add({ | ||
Declaration: continuedIndent() | ||
/*@__PURE__*/indentNodeProp.add({ | ||
Declaration: /*@__PURE__*/continuedIndent() | ||
}), | ||
foldNodeProp.add({ | ||
/*@__PURE__*/foldNodeProp.add({ | ||
Block: foldInside | ||
}), | ||
styleTags({ | ||
/*@__PURE__*/styleTags({ | ||
"import charset namespace keyframes": tags$1.definitionKeyword, | ||
@@ -173,3 +175,3 @@ "media supports": tags$1.controlKeyword, | ||
ClassName: tags$1.className, | ||
PseudoClassName: tags$1.constant(tags$1.className), | ||
PseudoClassName: /*@__PURE__*/tags$1.constant(tags$1.className), | ||
not: tags$1.operatorKeyword, | ||
@@ -192,3 +194,3 @@ IdName: tags$1.labelName, | ||
Comment: tags$1.blockComment, | ||
ParenthesizedContent: tags$1.special(tags$1.name), | ||
ParenthesizedContent: /*@__PURE__*/tags$1.special(tags$1.name), | ||
ColorLiteral: tags$1.color, | ||
@@ -210,5 +212,9 @@ StringLiteral: tags$1.string, | ||
}); | ||
/// CSS property and value keyword completion. | ||
const cssCompletion = cssLanguage.data.of({ autocomplete: completeCSS }); | ||
/// Language support for CSS. | ||
/** | ||
CSS property and value keyword completion. | ||
*/ | ||
const cssCompletion = /*@__PURE__*/cssLanguage.data.of({ autocomplete: completeCSS }); | ||
/** | ||
Language support for CSS. | ||
*/ | ||
function css() { | ||
@@ -215,0 +221,0 @@ return new LanguageSupport(cssLanguage, cssCompletion); |
{ | ||
"name": "@codemirror/lang-css", | ||
"version": "0.18.0", | ||
"version": "0.19.0", | ||
"description": "CSS language support for the CodeMirror code editor", | ||
"scripts": { | ||
"test": "echo 'No tests'", | ||
"prepare": "tsc -p tsconfig.local.json && rollup -c" | ||
"test": "cm-runtests", | ||
"prepare": "cm-buildhelper src/css.ts" | ||
}, | ||
@@ -29,12 +29,10 @@ "keywords": [ | ||
"dependencies": { | ||
"@codemirror/autocomplete": "^0.18.0", | ||
"@codemirror/highlight": "^0.18.0", | ||
"@codemirror/language": "^0.18.0", | ||
"@codemirror/state": "^0.18.0", | ||
"lezer-css": "^0.13.0" | ||
"@codemirror/autocomplete": "^0.19.0", | ||
"@codemirror/highlight": "^0.19.0", | ||
"@codemirror/language": "^0.19.0", | ||
"@codemirror/state": "^0.19.0", | ||
"@lezer/css": "^0.14.0" | ||
}, | ||
"devDependencies": { | ||
"rollup": "^2.35.1", | ||
"rollup-plugin-dts": "^2.0.1", | ||
"typescript": "^4.1.3" | ||
"@codemirror/buildhelper": "^0.1.0" | ||
}, | ||
@@ -41,0 +39,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
1
445
2
32692
8
+ Added@lezer/css@^0.14.0
+ Added@codemirror/autocomplete@0.19.15(transitive)
+ Added@codemirror/highlight@0.19.8(transitive)
+ Added@codemirror/rangeset@0.19.9(transitive)
+ Added@codemirror/state@0.19.9(transitive)
+ Added@codemirror/text@0.19.6(transitive)
+ Added@codemirror/tooltip@0.19.16(transitive)
+ Added@codemirror/view@0.19.48(transitive)
+ Added@lezer/common@0.15.12(transitive)
- Removedlezer-css@^0.13.0
- Removed@codemirror/autocomplete@0.18.8(transitive)
- Removed@codemirror/highlight@0.18.4(transitive)
- Removed@codemirror/rangeset@0.18.5(transitive)
- Removed@codemirror/state@0.18.7(transitive)
- Removed@codemirror/text@0.18.1(transitive)
- Removed@codemirror/tooltip@0.18.4(transitive)
- Removed@codemirror/view@0.18.19(transitive)
- Removedlezer@0.13.5(transitive)
- Removedlezer-css@0.13.1(transitive)
- Removedlezer-tree@0.13.2(transitive)
Updated@codemirror/language@^0.19.0
Updated@codemirror/state@^0.19.0