@tbela99/css-parser 0.8.0 → 0.9.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/.editorconfig +484 -0
- package/README.md +13 -8
- package/dist/index-umd-web.js +2451 -2554
- package/dist/index.cjs +2605 -2708
- package/dist/index.d.ts +73 -23
- package/dist/lib/ast/expand.js +29 -4
- package/dist/lib/ast/math/expression.js +1 -1
- package/dist/lib/ast/minify.js +31 -17
- package/dist/lib/ast/types.js +2 -0
- package/dist/lib/ast/walk.js +12 -0
- package/dist/lib/parser/declaration/map.js +59 -52
- package/dist/lib/parser/declaration/set.js +0 -12
- package/dist/lib/parser/parse.js +204 -139
- package/dist/lib/parser/tokenize.js +15 -3
- package/dist/lib/renderer/color/color.js +2 -2
- package/dist/lib/renderer/color/hex.js +1 -1
- package/dist/lib/renderer/color/hsl.js +1 -1
- package/dist/lib/renderer/color/hwb.js +2 -2
- package/dist/lib/renderer/color/lab.js +3 -2
- package/dist/lib/renderer/color/lch.js +1 -1
- package/dist/lib/renderer/color/oklab.js +2 -2
- package/dist/lib/renderer/color/oklch.js +1 -1
- package/dist/lib/renderer/color/p3.js +1 -1
- package/dist/lib/renderer/color/prophotoRgb.js +2 -2
- package/dist/lib/renderer/color/prophotorgb.js +2 -2
- package/dist/lib/renderer/color/rgb.js +1 -1
- package/dist/lib/renderer/color/srgb.js +2 -2
- package/dist/lib/renderer/color/utils/constants.js +1 -1
- package/dist/lib/renderer/color/xyz.js +2 -18
- package/dist/lib/renderer/color/xyzd50.js +20 -2
- package/dist/lib/renderer/render.js +37 -8
- package/dist/lib/renderer/sourcemap/sourcemap.js +1 -1
- package/dist/lib/syntax/syntax.js +337 -1
- package/dist/lib/validation/at-rules/container.js +353 -0
- package/dist/lib/validation/at-rules/counter-style.js +2 -2
- package/dist/lib/validation/at-rules/custom-media.js +52 -0
- package/dist/lib/validation/at-rules/document.js +40 -60
- package/dist/lib/validation/at-rules/else.js +5 -0
- package/dist/lib/validation/at-rules/font-feature-values.js +3 -0
- package/dist/lib/validation/at-rules/import.js +64 -59
- package/dist/lib/validation/at-rules/layer.js +3 -0
- package/dist/lib/validation/at-rules/media.js +118 -29
- package/dist/lib/validation/at-rules/supports.js +51 -20
- package/dist/lib/validation/at-rules/when.js +178 -0
- package/dist/lib/validation/atrule.js +25 -10
- package/dist/lib/validation/config.js +20 -15
- package/dist/lib/validation/config.json.js +242 -74
- package/dist/lib/validation/declaration.js +32 -10
- package/dist/lib/validation/parser/parse.js +87 -103
- package/dist/lib/validation/parser/types.js +2 -2
- package/dist/lib/validation/selector.js +6 -3
- package/dist/lib/validation/syntax.js +86 -6
- package/dist/lib/validation/syntaxes/complex-selector-list.js +16 -12
- package/dist/lib/validation/syntaxes/complex-selector.js +17 -247
- package/dist/lib/validation/syntaxes/compound-selector.js +226 -0
- package/dist/lib/validation/syntaxes/image.js +29 -0
- package/dist/lib/validation/syntaxes/keyframe-block-list.js +1 -1
- package/dist/lib/validation/syntaxes/keyframe-selector.js +1 -1
- package/dist/lib/validation/syntaxes/layer-name.js +5 -16
- package/dist/lib/validation/syntaxes/relative-selector-list.js +43 -13
- package/dist/lib/validation/utils/list.js +2 -2
- package/dist/node/index.js +1 -1
- package/dist/web/index.js +1 -1
- package/package.json +10 -9
|
@@ -6,12 +6,12 @@ import '../../renderer/color/utils/constants.js';
|
|
|
6
6
|
import '../../renderer/sourcemap/lib/encode.js';
|
|
7
7
|
import '../../parser/utils/config.js';
|
|
8
8
|
|
|
9
|
-
function splitTokenList(tokenList) {
|
|
9
|
+
function splitTokenList(tokenList, split = [EnumToken.CommaTokenType]) {
|
|
10
10
|
return tokenList.reduce((acc, curr) => {
|
|
11
11
|
if (curr.typ == EnumToken.CommentTokenType) {
|
|
12
12
|
return acc;
|
|
13
13
|
}
|
|
14
|
-
if (curr.typ
|
|
14
|
+
if (split.includes(curr.typ)) {
|
|
15
15
|
acc.push([]);
|
|
16
16
|
}
|
|
17
17
|
else {
|
package/dist/node/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import '../lib/validation/config.js';
|
|
|
13
13
|
import '../lib/validation/parser/types.js';
|
|
14
14
|
import '../lib/validation/parser/parse.js';
|
|
15
15
|
import '../lib/validation/syntaxes/complex-selector.js';
|
|
16
|
-
import {
|
|
16
|
+
import { dirname, resolve } from '../lib/fs/resolve.js';
|
|
17
17
|
import { load } from './load.js';
|
|
18
18
|
|
|
19
19
|
/**
|
package/dist/web/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import '../lib/validation/config.js';
|
|
|
12
12
|
import '../lib/validation/parser/types.js';
|
|
13
13
|
import '../lib/validation/parser/parse.js';
|
|
14
14
|
import '../lib/validation/syntaxes/complex-selector.js';
|
|
15
|
-
import {
|
|
15
|
+
import { dirname, resolve } from '../lib/fs/resolve.js';
|
|
16
16
|
import { load } from './load.js';
|
|
17
17
|
|
|
18
18
|
/**
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tbela99/css-parser",
|
|
3
3
|
"description": "CSS parser for node and the browser",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "v0.9.1",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/node/index.js",
|
|
7
|
+
"./node": "./dist/node/index.js",
|
|
7
8
|
"./umd": "./dist/index-umd-web.js",
|
|
8
9
|
"./web": "./dist/web/index.js",
|
|
9
10
|
"./cjs": "./dist/index.cjs"
|
|
@@ -17,8 +18,8 @@
|
|
|
17
18
|
"build": "rollup -c;./build.sh dist/index.d.ts 'declare interface' 'declare type'",
|
|
18
19
|
"test": "web-test-runner \"test/**/web.spec.js\" --node-resolve --playwright --browsers chromium firefox webkit --root-dir=.; mocha --reporter-options='maxDiffSize=1801920' \"test/**/node.spec.js\"",
|
|
19
20
|
"test:node": "mocha --reporter-options='maxDiffSize=1801920' \"test/**/node.spec.js\"",
|
|
20
|
-
"test:cov": "c8 --reporter=html --reporter=text --reporter=json-summary mocha --reporter-options='maxDiffSize=1801920' \"test/**/node.spec.js\"",
|
|
21
|
-
"test:web-cov": "web-test-runner \"test/**/web.spec.js\" --node-resolve --playwright --browsers chromium firefox webkit --root-dir=. --coverage",
|
|
21
|
+
"test:cov": "c8 -x dist/lib/validation/syntax.js -x 'dist/lib/validation/parser/*.js' --reporter=html --reporter=text --reporter=json-summary mocha --reporter-options='maxDiffSize=1801920' \"test/**/node.spec.js\"",
|
|
22
|
+
"test:web-cov": "web-test-runner -x dist/lib/validation/syntax.js,dist/lib/validation/parser \"test/**/web.spec.js\" --node-resolve --playwright --browsers chromium firefox webkit --root-dir=. --coverage",
|
|
22
23
|
"profile": "node --enable-source-maps --inspect-brk test/inspect.js",
|
|
23
24
|
"syntax-update": "esno tools/validation.ts",
|
|
24
25
|
"debug": "web-test-runner \"test/**/web.spec.js\" --manual --open --node-resolve --root-dir=."
|
|
@@ -56,15 +57,15 @@
|
|
|
56
57
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
57
58
|
"@types/chai": "^5.0.1",
|
|
58
59
|
"@types/mocha": "^10.0.10",
|
|
59
|
-
"@types/node": "^22.
|
|
60
|
-
"@types/web": "^0.0.
|
|
61
|
-
"@web/test-runner": "^0.
|
|
60
|
+
"@types/node": "^22.13.5",
|
|
61
|
+
"@types/web": "^0.0.206",
|
|
62
|
+
"@web/test-runner": "^0.20.0",
|
|
62
63
|
"@web/test-runner-playwright": "^0.11.0",
|
|
63
64
|
"c8": "^10.1.3",
|
|
64
65
|
"esno": "^4.8.0",
|
|
65
|
-
"mocha": "^11.0
|
|
66
|
-
"playwright": "^1.
|
|
67
|
-
"rollup": "^4.
|
|
66
|
+
"mocha": "^11.1.0",
|
|
67
|
+
"playwright": "^1.50.1",
|
|
68
|
+
"rollup": "^4.34.8",
|
|
68
69
|
"rollup-plugin-dts": "^6.1.1",
|
|
69
70
|
"tslib": "^2.8.1"
|
|
70
71
|
}
|