@tbela99/css-parser 1.4.11 → 1.5.0
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/CHANGELOG.md +6 -0
- package/README.md +11 -4
- package/dist/index-umd-web.js +2116 -1699
- package/dist/index.cjs +2128 -1694
- package/dist/index.d.ts +781 -269
- package/dist/lib/ast/clone.js +13 -8
- package/dist/lib/ast/expand.js +45 -9
- package/dist/lib/ast/features/calc.js +2 -1
- package/dist/lib/ast/features/if.js +24 -4
- package/dist/lib/ast/features/prefix.js +13 -31
- package/dist/lib/ast/features/shorthand.js +1 -1
- package/dist/lib/ast/features/transform.js +5 -2
- package/dist/lib/ast/find.js +7 -5
- package/dist/lib/ast/minify.js +80 -35
- package/dist/lib/ast/node.js +50 -0
- package/dist/lib/ast/types.js +1 -1
- package/dist/lib/ast/walk.js +27 -7
- package/dist/lib/fs/resolve.js +60 -28
- package/dist/lib/parser/declaration/map.js +14 -5
- package/dist/lib/parser/linesmap.js +5 -13
- package/dist/lib/parser/parse.js +489 -719
- package/dist/lib/parser/source.js +16 -2
- package/dist/lib/parser/tokenize.js +382 -278
- package/dist/lib/parser/utils/at-rule-container.js +2 -1
- package/dist/lib/parser/utils/selector.js +88 -10
- package/dist/lib/renderer/render.js +174 -99
- package/dist/lib/renderer/sourcemap/lib/codec.js +78 -0
- package/dist/lib/renderer/sourcemap/sourcemap.js +190 -34
- package/dist/lib/syntax/syntax.js +14 -151
- package/dist/lib/validation/match.js +81 -1
- package/dist/node.js +41 -26
- package/dist/utils/sync.d.ts +16 -0
- package/dist/utils/sync.js +52 -0
- package/dist/web.js +26 -28
- package/llms.txt +12 -5
- package/package.json +1 -1
- package/dist/lib/renderer/sourcemap/lib/encode.js +0 -37
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SourceMap } from '../renderer/sourcemap/sourcemap.js';
|
|
1
2
|
import { LineMap } from './linesmap.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -8,6 +9,7 @@ let sourceId = 0;
|
|
|
8
9
|
* Source file helper class
|
|
9
10
|
*/
|
|
10
11
|
class SourceFile {
|
|
12
|
+
inputSourceMap = null;
|
|
11
13
|
/**
|
|
12
14
|
* Source file ID
|
|
13
15
|
*/
|
|
@@ -26,7 +28,6 @@ class SourceFile {
|
|
|
26
28
|
content;
|
|
27
29
|
/**
|
|
28
30
|
* Constructor
|
|
29
|
-
* @param id
|
|
30
31
|
* @param content
|
|
31
32
|
* @param lines
|
|
32
33
|
* @param file
|
|
@@ -40,7 +41,6 @@ class SourceFile {
|
|
|
40
41
|
/**
|
|
41
42
|
* Update source content
|
|
42
43
|
* @param content
|
|
43
|
-
* @param lines
|
|
44
44
|
*/
|
|
45
45
|
append(content) {
|
|
46
46
|
this.content += content;
|
|
@@ -98,6 +98,20 @@ class SourceFile {
|
|
|
98
98
|
addLineStart(lineStart) {
|
|
99
99
|
this.lineStarts.addLineStart(lineStart);
|
|
100
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* set input source map
|
|
103
|
+
* @param inputSourceMap
|
|
104
|
+
*/
|
|
105
|
+
setInputSourceMap(inputSourceMap) {
|
|
106
|
+
this.inputSourceMap = inputSourceMap == null ? null : new SourceMap(inputSourceMap);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* return input source map
|
|
110
|
+
* @returns
|
|
111
|
+
*/
|
|
112
|
+
getInputSourceMap() {
|
|
113
|
+
return this.inputSourceMap;
|
|
114
|
+
}
|
|
101
115
|
}
|
|
102
116
|
|
|
103
117
|
export { SourceFile };
|