Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@codemirror/lang-css

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codemirror/lang-css - npm Package Compare versions

Comparing version 0.18.0 to 0.19.0

10

CHANGELOG.md

@@ -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 @@

15

dist/index.d.ts

@@ -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 };

48

dist/index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc