aliascss 1.5.4 → 1.5.6

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.
@@ -1105,7 +1105,7 @@ export const staticClassNamesAlias = {
1105
1105
  'owt/thin': 'outline-width: thin',
1106
1106
  'owt/thick': 'outline-width: thick',
1107
1107
  'owtn': 'outline-width: thin',
1108
- 'owww': 'overflow-wrap: word-wrap',
1108
+ 'owa': 'overflow-wrap: anywhere',
1109
1109
  'oxa': 'overflow-x: auto',
1110
1110
  'oxh': 'overflow-x: hidden',
1111
1111
  'oxs': 'overflow-x: scroll',
@@ -1309,7 +1309,7 @@ export const staticClassNamesAlias = {
1309
1309
  'tdn': 'text-decoration: none',
1310
1310
  'tdo': 'text-decoration: overline',
1311
1311
  'tdsbd': 'text-decoration-skip: box-decoration',
1312
- 'tdsd2': 'text-decoration-style:doubled ',
1312
+ 'tdsd2': 'text-decoration-style:double ',
1313
1313
  'tdsd3': 'text-decoration-style: dotted',
1314
1314
  'tdsd': 'text-decoration-style: dashed',
1315
1315
  'tdsd/double': 'text-decoration-style: double',
@@ -1522,7 +1522,7 @@ export const staticClassNamesAlias = {
1522
1522
  'wwbw': 'word-wrap: break-word',
1523
1523
  'wwn': 'word-wrap: normal',
1524
1524
  'wwnl': 'word-wrap: normal',
1525
- 'wwow': 'word-wrap: overflow-wrap',
1525
+ 'wwa': 'word-wrap: anywhere',
1526
1526
  'wxc': 'width:max-content',
1527
1527
  'xhn': 'max-height: none',
1528
1528
  'xwn': 'max-width: none',
@@ -21,6 +21,9 @@ export default _default;
21
21
  export declare function staticValueCompiler(property: string, alias: string | boolean | undefined, values: string[]): {
22
22
  [key: string]: string;
23
23
  };
24
+ export declare function oldstaticValueCompiler(property: string, alias: string | boolean | undefined, values: string[]): {
25
+ [key: string]: string;
26
+ };
24
27
  export declare function extractProperty(className: string, data: {
25
28
  [key: string]: Property;
26
29
  }): ({} | null)[];
@@ -18,6 +18,24 @@ export default (key, compiler) => {
18
18
  return [dynamicCompilerObj, staticCompilerObj];
19
19
  };
20
20
  export function staticValueCompiler(property, alias = false, values) {
21
+ const result = {};
22
+ values.forEach((value) => {
23
+ const parts = value.split(':');
24
+ const val = parts[0].trim();
25
+ if (!val)
26
+ return; // '' placeholder: no class, no empty declaration
27
+ parts.forEach((part) => {
28
+ const each = part.trim();
29
+ if (!each || /\s/.test(each))
30
+ return; // a value with spaces can't be a class; its short code still is
31
+ result[`${property}-${each}`] = `${property}:${val}`;
32
+ if (alias)
33
+ result[`${alias}-${each}`] = `${property}:${val}`;
34
+ });
35
+ });
36
+ return result;
37
+ }
38
+ export function oldstaticValueCompiler(property, alias = false, values) {
21
39
  const result = {};
22
40
  if (values.length) {
23
41
  values.forEach((value) => {
@@ -142,9 +142,13 @@ export function splitTopLevel(str) {
142
142
  return out;
143
143
  }
144
144
  // Join prefix + item. A combinator item (starts with "_") is attached directly.
145
- export const joinGroupItem = (prefix, item) => prefix && item.startsWith('_')
146
- ? prefix + item
147
- : (prefix + '-').replace(/--$/, '-') + item.replace(/^--/, '-');
145
+ export const joinGroupItem = (prefix, item) => {
146
+ if (prefix && item.startsWith('_'))
147
+ return prefix + item;
148
+ if (/^-[a-z]/i.test(item))
149
+ return prefix + item; // -webkit-…, -moz-…: the item's own dash is the joiner
150
+ return (prefix + '-').replace(/--$/, '-') + item.replace(/^--/, '-');
151
+ };
148
152
  // Parse one keyframes step written as @<stops><styles>:
149
153
  // stops: 25 | 25% | 12.5 | [0,25,50] | [0,50%]
150
154
  // styles: [class,class] a group (commas inside ( ) are kept)
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "aliascss",
3
- "version": "1.5.4",
3
+ "version": "1.5.6",
4
4
  "description": "AliasCSS is a CSS post processor.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
7
7
  "bin": "bin/aliascss.js",
8
8
  "type": "module",
9
9
  "typings": "dist/index.d.ts",
10
+ "files": ["lib", "dist", "bin", "llms.txt", "README.md", "LICENSE", "CHANGELOG.md"],
10
11
  "scripts": {
11
12
  "test": "jest --config jestconfig.json",
12
13
  "build": "tsc",
package/.prettierrc DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "printWidth": 120,
3
- "trailingComma": "all",
4
- "singleQuote": true
5
- }