@windicss/plugin-utils
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -312,2 +312,4 @@ import * as windicss_types_interfaces from 'windicss/types/interfaces'; | ||
declare function SvelteExtractor(code: string, id?: string): ExtractorResultDetailed; | ||
declare type NestedArrayable<T> = T | (T | T[])[]; | ||
@@ -326,2 +328,2 @@ declare function flattenArray<T>(v: NestedArrayable<T>): T[]; | ||
export { CompletionsResult, DefaultExtractor, LayerMeta, LayerName, NestedArrayable, PugExtractor, ResolvedOptions, SupportedLayers, TagNames, TransformCssOptions, Transformer, TransformerFunction, TransformerOptions, UserOptions, WindiPluginUtils, WindiPluginUtilsOptions, applyExtractors, buildAliasTransformer, createUtils, defaultAlias, defineConfig, escapeRegExp, exclude, flattenArray, getDefaultExtractors, htmlTags, include, isResolvedOptions, kebabCase, mergeArrays, mergeWindicssConfig, preflightTags, resolveOptions, transformGroups }; | ||
export { CompletionsResult, DefaultExtractor, LayerMeta, LayerName, NestedArrayable, PugExtractor, ResolvedOptions, SupportedLayers, SvelteExtractor, TagNames, TransformCssOptions, Transformer, TransformerFunction, TransformerOptions, UserOptions, WindiPluginUtils, WindiPluginUtilsOptions, applyExtractors, buildAliasTransformer, createUtils, defaultAlias, defineConfig, escapeRegExp, exclude, flattenArray, getDefaultExtractors, htmlTags, include, isResolvedOptions, kebabCase, mergeArrays, mergeWindicssConfig, preflightTags, resolveOptions, transformGroups }; |
@@ -47,2 +47,3 @@ var __create = Object.create; | ||
SupportedLayers: () => SupportedLayers, | ||
SvelteExtractor: () => SvelteExtractor, | ||
WindiCssOptions: () => import_config2.WindiCssOptions, | ||
@@ -262,3 +263,3 @@ applyExtractors: () => applyExtractors, | ||
var regexClassSplitter = /[\s'"`{}]/g; | ||
var regexClassGroup = /([!\w+-<@][\w+:_/-]*?\w):\(([!\w\s:/\\,%#\[\].$-]*?)\)/gm; | ||
var regexClassGroup = /([!\w+-<@][\w+:_/-]*?\w):\(((?:[!\w\s:/\\,%#.$-]|\[.*?\])*?)\)/gm; | ||
var regexAttributifyItem = /(?:\s|^)([\w+:_/-]+)=(['"{])((?:\\\2|\\\\|\n|\r|.)*?)(?:\2|\})/gm; | ||
@@ -271,2 +272,3 @@ var regexClassCheck1 = /^!?[a-z\d@<>.+-](?:\([\w,.%#-]*\)|[\w:/\\,%#\[\].$-])*$/; | ||
]; | ||
var regexSvelteClass = /class:([\w:/\\,%#\[\].$-]+?)=\{/g; | ||
function validClassName(i) { | ||
@@ -347,5 +349,27 @@ return regexClassChecks.every((r) => i.length > 2 && i.match(r)); | ||
// src/extractors/svelte.ts | ||
function SvelteExtractor(code, id) { | ||
const result = DefaultExtractor(code, id); | ||
return { | ||
tags: result.tags, | ||
get classes() { | ||
return [ | ||
...result.classes, | ||
...Array.from(code.matchAll(regexSvelteClass)).map((i) => i[1]).filter(Boolean) | ||
]; | ||
}, | ||
get attributes() { | ||
return result.attributes; | ||
} | ||
}; | ||
} | ||
// src/extractors/helper.ts | ||
function getDefaultExtractors() { | ||
const extractors = []; | ||
const extractors = [ | ||
{ | ||
extractor: SvelteExtractor, | ||
extensions: ["svelte"] | ||
} | ||
]; | ||
try { | ||
@@ -951,2 +975,3 @@ require("pug"); | ||
SupportedLayers, | ||
SvelteExtractor, | ||
WindiCssOptions, | ||
@@ -953,0 +978,0 @@ applyExtractors, |
{ | ||
"name": "@windicss/plugin-utils", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Common utils for building integrations of Windi CSS", | ||
@@ -26,3 +26,3 @@ "keywords": [ | ||
"@antfu/utils": "^0.2.4", | ||
"@windicss/config": "1.3.0", | ||
"@windicss/config": "1.4.0", | ||
"debug": "^4.3.2", | ||
@@ -29,0 +29,0 @@ "fast-glob": "^3.2.7", |
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
76976
2268
+ Added@windicss/config@1.4.0(transitive)
- Removed@windicss/config@1.3.0(transitive)
Updated@windicss/config@1.4.0