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.
@@ -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]+$/.test(propertyPortion)) {
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.9",
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": "^3.0.4",
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
  }
package/tsconfig.json CHANGED
@@ -2,6 +2,7 @@
2
2
  "compilerOptions": {
3
3
  "target": "es6",
4
4
  "module": "nodenext",
5
+ "rootDir": "./src",
5
6
  "declaration": true,
6
7
  "outDir": "./lib",
7
8
  "esModuleInterop": true,