@stylable/module-utils
Advanced tools
Comparing version 4.13.0 to 4.13.1
@@ -1,3 +0,3 @@ | ||
import { StylableMeta } from '@stylable/core'; | ||
import type { StylableMeta } from '@stylable/core'; | ||
export declare function generateDTSSourceMap(dtsContent: string, meta: StylableMeta, targetFilePath?: string): string; | ||
//# sourceMappingURL=generate-dts-sourcemaps.d.ts.map |
@@ -5,3 +5,2 @@ "use strict"; | ||
const path_1 = require("path"); | ||
const core_1 = require("@stylable/core"); | ||
const features_1 = require("@stylable/core/dist/features"); | ||
@@ -111,9 +110,8 @@ const process_declaration_functions_1 = require("@stylable/core/dist/process-declaration-functions"); | ||
let currentClass = entryClassName; | ||
while (currentClass[core_1.valueMapping.states]) { | ||
if (((_a = currentClass[core_1.valueMapping.states]) === null || _a === void 0 ? void 0 : _a[stripQuotes(stateToken.stateName.value)]) !== | ||
undefined) { | ||
while (currentClass[`-st-states`]) { | ||
if (((_a = currentClass[`-st-states`]) === null || _a === void 0 ? void 0 : _a[stripQuotes(stateToken.stateName.value)]) !== undefined) { | ||
return currentClass.name; | ||
} | ||
if (((_b = currentClass[core_1.valueMapping.extends]) === null || _b === void 0 ? void 0 : _b._kind) === 'class') { | ||
currentClass = currentClass[core_1.valueMapping.extends]; | ||
if (((_b = currentClass['-st-extends']) === null || _b === void 0 ? void 0 : _b._kind) === 'class') { | ||
currentClass = currentClass[`-st-extends`]; | ||
} | ||
@@ -133,3 +131,3 @@ } | ||
meta.rawAst.walkRules(`.${srcClassName}`, (rule) => { | ||
return rule.walkDecls(core_1.valueMapping.states, (decl) => { | ||
return rule.walkDecls(`-st-states`, (decl) => { | ||
if (decl.source && decl.source.start) | ||
@@ -136,0 +134,0 @@ stateSourcePosition = { |
@@ -1,4 +0,4 @@ | ||
import { StylableResults } from '@stylable/core'; | ||
import type { StylableResults } from '@stylable/core'; | ||
export declare const SPACING: string; | ||
export declare function generateDTSContent({ exports, meta }: StylableResults): string; | ||
//# sourceMappingURL=generate-dts.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.generateDTSContent = exports.SPACING = void 0; | ||
const core_1 = require("@stylable/core"); | ||
exports.SPACING = ' '.repeat(4); | ||
@@ -23,7 +22,7 @@ const asString = (v) => JSON.stringify(v); | ||
while (currentClass) { | ||
const stStates = currentClass[core_1.valueMapping.states]; | ||
const stStates = currentClass[`-st-states`]; | ||
if (stStates) { | ||
addStatesEntries(stateEntries, stStates); | ||
} | ||
const extendedClass = currentClass[core_1.valueMapping.extends]; | ||
const extendedClass = currentClass[`-st-extends`]; | ||
currentClass = extendedClass && extendedClass._kind === 'class' ? extendedClass : undefined; | ||
@@ -30,0 +29,0 @@ } |
{ | ||
"name": "@stylable/module-utils", | ||
"version": "4.13.0", | ||
"version": "4.13.1", | ||
"description": "Stylable module creation utilities", | ||
@@ -10,3 +10,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@stylable/core": "^4.13.0", | ||
"@stylable/core": "^4.13.1", | ||
"@tokey/core": "^1.3.0", | ||
@@ -13,0 +13,0 @@ "vlq": "^2.0.4" |
import { basename } from 'path'; | ||
import { ClassSymbol, StylableMeta, valueMapping } from '@stylable/core'; | ||
import type { ClassSymbol, StylableMeta } from '@stylable/core'; | ||
import { STSymbol, CSSKeyframes } from '@stylable/core/dist/features'; | ||
@@ -150,12 +150,9 @@ import { processDeclarationFunctions } from '@stylable/core/dist/process-declaration-functions'; | ||
while (currentClass[valueMapping.states]) { | ||
if ( | ||
currentClass[valueMapping.states]?.[stripQuotes(stateToken.stateName.value)] !== | ||
undefined | ||
) { | ||
while (currentClass[`-st-states`]) { | ||
if (currentClass[`-st-states`]?.[stripQuotes(stateToken.stateName.value)] !== undefined) { | ||
return currentClass.name; | ||
} | ||
if (currentClass[valueMapping.extends]?._kind === 'class') { | ||
currentClass = currentClass[valueMapping.extends] as ClassSymbol; | ||
if (currentClass['-st-extends']?._kind === 'class') { | ||
currentClass = currentClass[`-st-extends`]; | ||
} | ||
@@ -184,3 +181,3 @@ } | ||
meta.rawAst.walkRules(`.${srcClassName}`, (rule) => { | ||
return rule.walkDecls(valueMapping.states, (decl) => { | ||
return rule.walkDecls(`-st-states`, (decl) => { | ||
if (decl.source && decl.source.start) | ||
@@ -187,0 +184,0 @@ stateSourcePosition = { |
@@ -1,4 +0,3 @@ | ||
import { | ||
import type { | ||
ClassSymbol, | ||
MappedStates, | ||
StateParsedValue, | ||
@@ -8,4 +7,4 @@ StylableMeta, | ||
StylableSymbol, | ||
valueMapping, | ||
} from '@stylable/core'; | ||
import type { MappedStates } from '@stylable/core/dist/index-internal'; | ||
@@ -37,3 +36,3 @@ export const SPACING = ' '.repeat(4); | ||
while (currentClass) { | ||
const stStates = currentClass[valueMapping.states]; | ||
const stStates = currentClass[`-st-states`]; | ||
@@ -44,3 +43,3 @@ if (stStates) { | ||
const extendedClass = currentClass[valueMapping.extends] as StylableSymbol; | ||
const extendedClass = currentClass[`-st-extends`] as StylableSymbol; | ||
currentClass = extendedClass && extendedClass._kind === 'class' ? extendedClass : undefined; | ||
@@ -47,0 +46,0 @@ } |
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
93087
1599
Updated@stylable/core@^4.13.1