aliascss 1.3.9 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/aliascss.config.bk.js +131 -0
- package/aliascss.config.js +14 -94
- package/dist/aliascss.js +1 -1
- package/docc.md +228 -1
- package/lib/classPrinter.js +16 -2
- package/lib/compilers/border.js +23 -1
- package/lib/compilers/color.js +12 -4
- package/lib/compilers/timingFunction.js +5 -2
- package/lib/compilers/transition.js +2 -0
- package/lib/config.d.ts +1 -0
- package/lib/config.js +3 -1
- package/lib/css-properties-all.js +16 -6
- package/lib/custom-css-compilers.js +128 -1
- package/lib/node/compileFile.d.ts +1 -1
- package/lib/node/compileFile.js +21 -2
- package/lib/node/extractClassNamesFromFile.js +1 -1
- package/lib/prebuild.d.ts +19 -75
- package/lib/prebuild.js +573 -96
- package/lib/prefix/element-selector.js +1 -1
- package/lib/prefix/extractMediaPrefix.js +5 -2
- package/lib/prefix/extractPrefix.js +19 -0
- package/lib/prefix/fallback-selector.d.ts +5 -0
- package/lib/prefix/fallback-selector.js +14 -0
- package/lib/prefix/responsive.js +24 -37
- package/lib/returnPropertyAndValue.js +28 -19
- package/lib/returnStatement.js +14 -3
- package/lib/static/customStaticClassNames.js +1 -0
- package/lib/static/staticClassNamesAlias-without-global-value.d.ts +3 -0
- package/lib/static/staticClassNamesAlias-without-global-value.js +1290 -0
- package/lib/utils/browser-helper.d.ts +1 -0
- package/lib/utils/browser-helper.js +37 -0
- package/lib/utils/createCompilerObj.js +4 -3
- package/package.json +4 -3
- package/tsconfig.json +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// async function mapRawAttributeNames() {
|
|
2
|
+
// const maps = {
|
|
3
|
+
// kfs: Object.create(null),
|
|
4
|
+
// cls: Object.create(null),
|
|
5
|
+
// };
|
|
6
|
+
export {};
|
|
7
|
+
// const response = await fetch(window.location.href);
|
|
8
|
+
// const html = await response.text();
|
|
9
|
+
// const tagRegex = /<([A-Za-z][A-Za-z0-9:_-]*)(?:\s+[\s\S]*?)?>/g;
|
|
10
|
+
// const attributeRegex =
|
|
11
|
+
// /([A-Za-z_:][A-Za-z0-9_.:-]*)(?=\s*(?:=|$))/g;
|
|
12
|
+
// const prefixes = [
|
|
13
|
+
// ["keyframes", maps.kfs],
|
|
14
|
+
// ["class", maps.cls],
|
|
15
|
+
// ];
|
|
16
|
+
// let tag;
|
|
17
|
+
// while ((tag = tagRegex.exec(html))) {
|
|
18
|
+
// attributeRegex.lastIndex = 0;
|
|
19
|
+
// let match;
|
|
20
|
+
// while ((match = attributeRegex.exec(tag[0]))) {
|
|
21
|
+
// const rawName = match[1];
|
|
22
|
+
// const name = rawName.toLowerCase();
|
|
23
|
+
// for (const [prefix, map] of prefixes) {
|
|
24
|
+
// if (
|
|
25
|
+
// name.startsWith(`${prefix}-`) ||
|
|
26
|
+
// name.startsWith(`${prefix}_`) ||
|
|
27
|
+
// name.startsWith(`${prefix}:`)
|
|
28
|
+
// ) {
|
|
29
|
+
// map[name] = rawName;
|
|
30
|
+
// break;
|
|
31
|
+
// }
|
|
32
|
+
// }
|
|
33
|
+
// }
|
|
34
|
+
// }
|
|
35
|
+
// return maps;
|
|
36
|
+
// }
|
|
37
|
+
// export default mapRawAttributeNames;
|
|
@@ -34,7 +34,8 @@ export function staticValueCompiler(property, alias = false, values) {
|
|
|
34
34
|
export function extractProperty(className, data) {
|
|
35
35
|
// we just need parts before '--' or __ as they can't be in property is any;
|
|
36
36
|
const splittedClassName = className.split('--')[0];
|
|
37
|
-
const extractPossiblePropertyPortion = splittedClassName.match(/^[A-Z]?[a-z-]+/);
|
|
37
|
+
// const extractPossiblePropertyPortion = splittedClassName.match(/^[A-Z]?[a-z-]+/);
|
|
38
|
+
const extractPossiblePropertyPortion = splittedClassName.match(/^[a-z-]+/i);
|
|
38
39
|
// Not a valid Aliascss class name
|
|
39
40
|
if (!extractPossiblePropertyPortion)
|
|
40
41
|
return [null, null];
|
|
@@ -50,8 +51,8 @@ export function extractProperty(className, data) {
|
|
|
50
51
|
}
|
|
51
52
|
else {
|
|
52
53
|
// remove last -[a-z]+ and try again un till ^[a-z]+ means we are at begin ing
|
|
53
|
-
while (/[-][a-z]
|
|
54
|
-
propertyPortion = propertyPortion.replace(/[-][a-z]
|
|
54
|
+
while (/[-][a-z]+$/i.test(propertyPortion)) {
|
|
55
|
+
propertyPortion = propertyPortion.replace(/[-][a-z]+$/i, '');
|
|
55
56
|
if (data.hasOwnProperty(propertyPortion)) {
|
|
56
57
|
propertyHolder = data[propertyPortion];
|
|
57
58
|
break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aliascss",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "AliasCSS is a CSS post processor.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/jest": "^29.5.14",
|
|
29
29
|
"@types/postcss-sorting": "^8.0.2",
|
|
30
|
-
"browser-sync": "^
|
|
30
|
+
"browser-sync": "^1.9.2",
|
|
31
31
|
"jest": "^29.6.2",
|
|
32
32
|
"jest-ts-webcompat-resolver": "^1.0.0",
|
|
33
33
|
"ts-jest": "^29.1.1",
|
|
@@ -58,7 +58,8 @@
|
|
|
58
58
|
"fast-glob": "^3.3.1",
|
|
59
59
|
"postcss": "^8.4.39",
|
|
60
60
|
"postcss-discard-duplicates": "^7.0.0",
|
|
61
|
-
"postcss-safe-parser": "^7.0.0"
|
|
61
|
+
"postcss-safe-parser": "^7.0.0",
|
|
62
|
+
"postcss-sort-media-queries": "^6.7.1"
|
|
62
63
|
},
|
|
63
64
|
"homepage": "https://aliascss.com"
|
|
64
65
|
}
|