postcss 8.4.31 → 8.4.49
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/README.md +1 -1
- package/lib/at-rule.d.ts +40 -15
- package/lib/comment.d.ts +10 -9
- package/lib/container.d.ts +57 -26
- package/lib/container.js +16 -8
- package/lib/css-syntax-error.d.ts +1 -1
- package/lib/css-syntax-error.js +47 -14
- package/lib/declaration.d.ts +21 -18
- package/lib/document.d.ts +5 -4
- package/lib/fromJSON.js +3 -3
- package/lib/input.d.ts +3 -0
- package/lib/input.js +4 -4
- package/lib/lazy-result.js +5 -5
- package/lib/list.d.ts +5 -2
- package/lib/map-generator.js +18 -9
- package/lib/no-work-result.js +5 -2
- package/lib/node.d.ts +20 -15
- package/lib/node.js +63 -19
- package/lib/parse.js +1 -1
- package/lib/parser.js +6 -7
- package/lib/postcss.d.mts +1 -4
- package/lib/postcss.d.ts +20 -8
- package/lib/postcss.js +12 -12
- package/lib/previous-map.js +8 -6
- package/lib/processor.d.ts +1 -1
- package/lib/processor.js +7 -7
- package/lib/result.d.ts +0 -1
- package/lib/root.d.ts +5 -4
- package/lib/rule.d.ts +32 -19
- package/lib/tokenize.js +2 -2
- package/package.json +4 -4
package/lib/rule.d.ts
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
import Container, {
|
1
|
+
import Container, {
|
2
|
+
ContainerProps,
|
3
|
+
ContainerWithChildren
|
4
|
+
} from './container.js'
|
2
5
|
|
3
6
|
declare namespace Rule {
|
4
7
|
export interface RuleRaws extends Record<string, unknown> {
|
@@ -37,14 +40,21 @@ declare namespace Rule {
|
|
37
40
|
semicolon?: boolean
|
38
41
|
}
|
39
42
|
|
40
|
-
export
|
43
|
+
export type RuleProps = {
|
41
44
|
/** Information used to generate byte-to-byte equal node string as it was in the origin input. */
|
42
45
|
raws?: RuleRaws
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
46
|
+
} & (
|
47
|
+
| {
|
48
|
+
/** Selector or selectors of the rule. */
|
49
|
+
selector: string
|
50
|
+
selectors?: never
|
51
|
+
}
|
52
|
+
| {
|
53
|
+
selector?: never
|
54
|
+
/** Selectors of the rule represented as an array of strings. */
|
55
|
+
selectors: readonly string[]
|
56
|
+
}
|
57
|
+
) & ContainerProps
|
48
58
|
|
49
59
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
50
60
|
export { Rule_ as default }
|
@@ -69,8 +79,18 @@ declare namespace Rule {
|
|
69
79
|
* ```
|
70
80
|
*/
|
71
81
|
declare class Rule_ extends Container {
|
72
|
-
|
82
|
+
nodes: NonNullable<Container['nodes']>
|
83
|
+
parent: ContainerWithChildren | undefined
|
73
84
|
raws: Rule.RuleRaws
|
85
|
+
type: 'rule'
|
86
|
+
constructor(defaults?: Rule.RuleProps)
|
87
|
+
|
88
|
+
assign(overrides: object | Rule.RuleProps): this
|
89
|
+
clone(overrides?: Partial<Rule.RuleProps>): this
|
90
|
+
|
91
|
+
cloneAfter(overrides?: Partial<Rule.RuleProps>): this
|
92
|
+
|
93
|
+
cloneBefore(overrides?: Partial<Rule.RuleProps>): this
|
74
94
|
/**
|
75
95
|
* The rule’s full selector represented as a string.
|
76
96
|
*
|
@@ -80,8 +100,8 @@ declare class Rule_ extends Container {
|
|
80
100
|
* rule.selector //=> 'a, b'
|
81
101
|
* ```
|
82
102
|
*/
|
83
|
-
selector: string
|
84
|
-
|
103
|
+
get selector(): string
|
104
|
+
set selector(value: string)
|
85
105
|
/**
|
86
106
|
* An array containing the rule’s individual selectors.
|
87
107
|
* Groups of selectors are split at commas.
|
@@ -97,15 +117,8 @@ declare class Rule_ extends Container {
|
|
97
117
|
* rule.selector //=> 'a, strong'
|
98
118
|
* ```
|
99
119
|
*/
|
100
|
-
selectors: string[]
|
101
|
-
|
102
|
-
type: 'rule'
|
103
|
-
|
104
|
-
constructor(defaults?: Rule.RuleProps)
|
105
|
-
assign(overrides: object | Rule.RuleProps): this
|
106
|
-
clone(overrides?: Partial<Rule.RuleProps>): Rule
|
107
|
-
cloneAfter(overrides?: Partial<Rule.RuleProps>): Rule
|
108
|
-
cloneBefore(overrides?: Partial<Rule.RuleProps>): Rule
|
120
|
+
get selectors(): string[]
|
121
|
+
set selectors(values: string[])
|
109
122
|
}
|
110
123
|
|
111
124
|
declare class Rule extends Rule_ {}
|
package/lib/tokenize.js
CHANGED
@@ -29,8 +29,8 @@ module.exports = function tokenizer(input, options = {}) {
|
|
29
29
|
let css = input.css.valueOf()
|
30
30
|
let ignore = options.ignoreErrors
|
31
31
|
|
32
|
-
let code,
|
33
|
-
let escaped, escapePos,
|
32
|
+
let code, content, escape, next, quote
|
33
|
+
let currentToken, escaped, escapePos, n, prev
|
34
34
|
|
35
35
|
let length = css.length
|
36
36
|
let pos = 0
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "postcss",
|
3
|
-
"version": "8.4.
|
3
|
+
"version": "8.4.49",
|
4
4
|
"description": "Tool for transforming styles with JS plugins",
|
5
5
|
"engines": {
|
6
6
|
"node": "^10 || ^12 || >=14"
|
@@ -74,9 +74,9 @@
|
|
74
74
|
"url": "https://github.com/postcss/postcss/issues"
|
75
75
|
},
|
76
76
|
"dependencies": {
|
77
|
-
"nanoid": "^3.3.
|
78
|
-
"picocolors": "^1.
|
79
|
-
"source-map-js": "^1.
|
77
|
+
"nanoid": "^3.3.7",
|
78
|
+
"picocolors": "^1.1.1",
|
79
|
+
"source-map-js": "^1.2.1"
|
80
80
|
},
|
81
81
|
"browser": {
|
82
82
|
"./lib/terminal-highlight": false,
|