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.19.3 to 0.20.0

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## 0.20.0 (2022-04-20)
### Breaking changes
Update dependencies to 0.20.0
## 0.19.3 (2021-09-24)

@@ -2,0 +8,0 @@

4

dist/index.d.ts
import { LRLanguage, LanguageSupport } from '@codemirror/language';
import { Extension } from '@codemirror/state';
import { CompletionSource } from '@codemirror/autocomplete';

@@ -16,3 +15,2 @@

declare const cssLanguage: LRLanguage;
declare const cssCompletion: Extension;
/**

@@ -23,2 +21,2 @@ Language support for CSS.

export { css, cssCompletion, cssCompletionSource, cssLanguage };
export { css, cssCompletionSource, cssLanguage };
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';

@@ -120,3 +119,3 @@ let _properties = null;

].map(name => ({ type: "type", label: name }));
const span = /^[\w-]*/;
const identifier = /^[\w-]*/;
/**

@@ -128,12 +127,12 @@ CSS property and value keyword completion source.

if (node.name == "PropertyName")
return { from: node.from, options: properties(), span };
return { from: node.from, options: properties(), validFor: identifier };
if (node.name == "ValueName")
return { from: node.from, options: values, span };
return { from: node.from, options: values, validFor: identifier };
if (node.name == "PseudoClassName")
return { from: node.from, options: pseudoClasses, span };
return { from: node.from, options: pseudoClasses, validFor: identifier };
if (node.name == "TagName") {
for (let { parent } = node; parent; parent = parent.parent)
if (parent.name == "Block")
return { from: node.from, options: properties(), span };
return { from: node.from, options: tags, span };
return { from: node.from, options: properties(), validFor: identifier };
return { from: node.from, options: tags, validFor: identifier };
}

@@ -144,7 +143,7 @@ if (!context.explicit)

if (before && before.name == ":" && above.name == "PseudoClassSelector")
return { from: pos, options: pseudoClasses, span };
return { from: pos, options: pseudoClasses, validFor: identifier };
if (before && before.name == ":" && above.name == "Declaration" || above.name == "ArgList")
return { from: pos, options: values, span };
return { from: pos, options: values, validFor: identifier };
if (above.name == "Block")
return { from: pos, options: properties(), span };
return { from: pos, options: properties(), validFor: identifier };
return null;

@@ -166,38 +165,2 @@ };

Block: foldInside
}),
/*@__PURE__*/styleTags({
"import charset namespace keyframes": tags$1.definitionKeyword,
"media supports": tags$1.controlKeyword,
"from to selector": tags$1.keyword,
NamespaceName: tags$1.namespace,
KeyframeName: tags$1.labelName,
TagName: tags$1.tagName,
ClassName: tags$1.className,
PseudoClassName: /*@__PURE__*/tags$1.constant(tags$1.className),
IdName: tags$1.labelName,
"FeatureName PropertyName": tags$1.propertyName,
AttributeName: tags$1.attributeName,
NumberLiteral: tags$1.number,
KeywordQuery: tags$1.keyword,
UnaryQueryOp: tags$1.operatorKeyword,
"CallTag ValueName": tags$1.atom,
VariableName: tags$1.variableName,
Callee: tags$1.operatorKeyword,
Unit: tags$1.unit,
"UniversalSelector NestingSelector": tags$1.definitionOperator,
AtKeyword: tags$1.keyword,
MatchOp: tags$1.compareOperator,
"ChildOp SiblingOp, LogicOp": tags$1.logicOperator,
BinOp: tags$1.arithmeticOperator,
Important: tags$1.modifier,
Comment: tags$1.blockComment,
ParenthesizedContent: /*@__PURE__*/tags$1.special(tags$1.name),
ColorLiteral: tags$1.color,
StringLiteral: tags$1.string,
":": tags$1.punctuation,
"PseudoOp #": tags$1.derefOperator,
"; ,": tags$1.separator,
"( )": tags$1.paren,
"[ ]": tags$1.squareBracket,
"{ }": tags$1.brace
})

@@ -212,4 +175,2 @@ ]

});
// FIXME remove on next major version
const cssCompletion = /*@__PURE__*/cssLanguage.data.of({ autocomplete: cssCompletionSource });
/**

@@ -219,5 +180,5 @@ Language support for CSS.

function css() {
return new LanguageSupport(cssLanguage, cssCompletion);
return new LanguageSupport(cssLanguage, cssLanguage.data.of({ autocomplete: cssCompletionSource }));
}
export { css, cssCompletion, cssCompletionSource, cssLanguage };
export { css, cssCompletionSource, cssLanguage };
{
"name": "@codemirror/lang-css",
"version": "0.19.3",
"version": "0.20.0",
"description": "CSS language support for the CodeMirror code editor",

@@ -29,7 +29,6 @@ "scripts": {

"dependencies": {
"@codemirror/autocomplete": "^0.19.0",
"@codemirror/highlight": "^0.19.6",
"@codemirror/language": "^0.19.0",
"@codemirror/state": "^0.19.0",
"@lezer/css": "^0.15.2"
"@codemirror/autocomplete": "^0.20.0",
"@codemirror/language": "^0.20.0",
"@codemirror/state": "^0.20.0",
"@lezer/css": "^0.16.0"
},

@@ -36,0 +35,0 @@ "devDependencies": {

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