@stylable/core
Advanced tools
Comparing version 4.5.0 to 4.5.1
@@ -16,2 +16,3 @@ import type * as postcss from 'postcss'; | ||
TOO_MANY_STATE_TYPES: (name: string, types: string[]) => string; | ||
NO_STATE_ARGUMENT_GIVEN: (name: string, type: string) => string; | ||
NO_STATE_TYPE_GIVEN: (name: string) => string; | ||
@@ -18,0 +19,0 @@ TOO_MANY_ARGS_IN_VALIDATOR: (name: string, validator: string, args: string[]) => string; |
@@ -20,2 +20,3 @@ "use strict"; | ||
TOO_MANY_STATE_TYPES: (name, types) => `pseudo-state "${name}(${types.join(', ')})" definition must be of a single type`, | ||
NO_STATE_ARGUMENT_GIVEN: (name, type) => `pseudo-state "${name}" expected argument of type "${type}" but got none`, | ||
NO_STATE_TYPE_GIVEN: (name) => `pseudo-state "${name}" expected a definition of a single type, but received none`, | ||
@@ -195,2 +196,7 @@ TOO_MANY_ARGS_IN_VALIDATOR: (name, validator, args) => `pseudo-state "${name}" expected "${validator}" validator to receive a single argument, but it received "${args.join(', ')}"`, | ||
let actualParam = resolveParam(meta, resolver, diagnostics, rule, node.content || stateDef.defaultValue); | ||
if (rule && !node.content && !stateDef.defaultValue) { | ||
diagnostics.warn(rule, exports.stateErrors.NO_STATE_ARGUMENT_GIVEN(name, stateDef.type), { | ||
word: name, | ||
}); | ||
} | ||
const validator = state_validators_1.systemValidators[stateDef.type]; | ||
@@ -197,0 +203,0 @@ let stateParamOutput; |
@@ -278,2 +278,3 @@ "use strict"; | ||
case 'property': | ||
this.checkRedeclareSymbol(atRule.params, atRule); | ||
this.addCSSVarDefinition(atRule); | ||
@@ -280,0 +281,0 @@ break; |
@@ -298,2 +298,3 @@ "use strict"; | ||
} | ||
const startedAnchor = context.currentAnchor; | ||
// loop over selectors | ||
@@ -315,7 +316,4 @@ for (const selectorChunks of selectorListChunks) { | ||
if (selectorListChunks.length - 1 > context.selectorIndex) { | ||
context.initRootAnchor({ | ||
name: originMeta.root, | ||
type: 'class', | ||
resolved: context.metaParts.class[originMeta.root], | ||
}); | ||
// reset current anchor | ||
context.initRootAnchor(startedAnchor); | ||
} | ||
@@ -322,0 +320,0 @@ } |
{ | ||
"name": "@stylable/core", | ||
"version": "4.5.0", | ||
"version": "4.5.1", | ||
"description": "CSS for Components", | ||
@@ -18,5 +18,5 @@ "main": "dist/index.js", | ||
"lodash.clonedeepwith": "^4.5.0", | ||
"postcss": "^8.3.5", | ||
"postcss": "^8.3.6", | ||
"postcss-js": "^3.0.3", | ||
"postcss-nested": "^5.0.5", | ||
"postcss-nested": "^5.0.6", | ||
"postcss-safe-parser": "^6.0.0", | ||
@@ -41,3 +41,3 @@ "postcss-value-parser": "^4.1.0", | ||
"author": "Wix.com", | ||
"license": "BSD-3-Clause" | ||
"license": "MIT" | ||
} |
@@ -27,2 +27,2 @@ # @stylable/core | ||
Copyright (c) 2017 Wix.com Ltd. All Rights Reserved. Use of this source code is governed by a [BSD license](./LICENSE). | ||
Copyright (c) 2017 Wix.com Ltd. All Rights Reserved. Use of this source code is governed by a [MIT license](./LICENSE). |
@@ -24,2 +24,4 @@ import type * as postcss from 'postcss'; | ||
`pseudo-state "${name}(${types.join(', ')})" definition must be of a single type`, | ||
NO_STATE_ARGUMENT_GIVEN: (name: string, type: string) => | ||
`pseudo-state "${name}" expected argument of type "${type}" but got none`, | ||
NO_STATE_TYPE_GIVEN: (name: string) => | ||
@@ -299,2 +301,8 @@ `pseudo-state "${name}" expected a definition of a single type, but received none`, | ||
if (rule && !node.content && !stateDef.defaultValue) { | ||
diagnostics.warn(rule, stateErrors.NO_STATE_ARGUMENT_GIVEN(name, stateDef.type), { | ||
word: name, | ||
}); | ||
} | ||
const validator = systemValidators[stateDef.type]; | ||
@@ -301,0 +309,0 @@ |
@@ -303,2 +303,3 @@ import { murmurhash3_32_gc } from './murmurhash'; | ||
case 'property': | ||
this.checkRedeclareSymbol(atRule.params, atRule); | ||
this.addCSSVarDefinition(atRule); | ||
@@ -305,0 +306,0 @@ break; |
@@ -468,2 +468,3 @@ import { basename } from 'path'; | ||
} | ||
const startedAnchor = context.currentAnchor!; | ||
// loop over selectors | ||
@@ -485,7 +486,4 @@ for (const selectorChunks of selectorListChunks) { | ||
if (selectorListChunks.length - 1 > context.selectorIndex) { | ||
context.initRootAnchor({ | ||
name: originMeta.root, | ||
type: 'class', | ||
resolved: context.metaParts.class[originMeta.root], | ||
}); | ||
// reset current anchor | ||
context.initRootAnchor(startedAnchor); | ||
} | ||
@@ -724,4 +722,6 @@ } | ||
if (!metaParts) { | ||
const resolvedClasses: Record<string, Array<CSSResolve<ClassSymbol | ElementSymbol>>> = | ||
{}; | ||
const resolvedClasses: Record< | ||
string, | ||
Array<CSSResolve<ClassSymbol | ElementSymbol>> | ||
> = {}; | ||
for (const className of Object.keys(meta.classes)) { | ||
@@ -773,4 +773,6 @@ resolvedClasses[className] = this.resolver.resolveExtends( | ||
const resolvedElements: Record<string, Array<CSSResolve<ClassSymbol | ElementSymbol>>> = | ||
{}; | ||
const resolvedElements: Record< | ||
string, | ||
Array<CSSResolve<ClassSymbol | ElementSymbol>> | ||
> = {}; | ||
for (const k of Object.keys(meta.elements)) { | ||
@@ -777,0 +779,0 @@ resolvedElements[k] = this.resolver.resolveExtends(meta, k, true); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
697458
11996
Updatedpostcss@^8.3.6
Updatedpostcss-nested@^5.0.6