summaryrefslogtreecommitdiff
path: root/node_modules/postcss/lib
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/postcss/lib')
-rw-r--r--node_modules/postcss/lib/at-rule.d.ts28
-rw-r--r--node_modules/postcss/lib/container.d.ts50
-rw-r--r--node_modules/postcss/lib/container.js2
-rw-r--r--node_modules/postcss/lib/declaration.d.ts4
-rw-r--r--node_modules/postcss/lib/document.d.ts1
-rw-r--r--node_modules/postcss/lib/map-generator.js2
-rw-r--r--node_modules/postcss/lib/no-work-result.js4
-rw-r--r--node_modules/postcss/lib/node.d.ts6
-rw-r--r--node_modules/postcss/lib/parser.js1
-rw-r--r--node_modules/postcss/lib/processor.js2
-rw-r--r--node_modules/postcss/lib/root.d.ts1
-rw-r--r--node_modules/postcss/lib/rule.d.ts8
12 files changed, 88 insertions, 21 deletions
diff --git a/node_modules/postcss/lib/at-rule.d.ts b/node_modules/postcss/lib/at-rule.d.ts
index 8eebc489..5bdee38b 100644
--- a/node_modules/postcss/lib/at-rule.d.ts
+++ b/node_modules/postcss/lib/at-rule.d.ts
@@ -1,4 +1,7 @@
-import Container, { ContainerProps } from './container.js'
+import Container, {
+ ContainerProps,
+ ContainerWithChildren
+} from './container.js'
declare namespace AtRule {
export interface AtRuleRaws extends Record<string, unknown> {
@@ -81,12 +84,31 @@ declare class AtRule_ extends Container {
*
* ```js
* const root = postcss.parse('@media print {}')
- * media.name //=> 'media'
* const media = root.first
+ * media.name //=> 'media'
* ```
*/
name: string
/**
+ * An array containing the layer’s children.
+ *
+ * ```js
+ * const root = postcss.parse('@layer example { a { color: black } }')
+ * const layer = root.first
+ * layer.nodes.length //=> 1
+ * layer.nodes[0].selector //=> 'a'
+ * ```
+ *
+ * Can be `undefinded` if the at-rule has no body.
+ *
+ * ```js
+ * const root = postcss.parse('@layer a, b, c;')
+ * const layer = root.first
+ * layer.nodes //=> undefined
+ * ```
+ */
+ nodes: Container['nodes']
+ /**
* The at-rule’s parameters, the values that follow the at-rule’s name
* but precede any `{}` block.
*
@@ -97,7 +119,7 @@ declare class AtRule_ extends Container {
* ```
*/
params: string
- parent: Container | undefined
+ parent: ContainerWithChildren | undefined
raws: AtRule.AtRuleRaws
diff --git a/node_modules/postcss/lib/container.d.ts b/node_modules/postcss/lib/container.d.ts
index bd6b1ba0..d16b85d0 100644
--- a/node_modules/postcss/lib/container.d.ts
+++ b/node_modules/postcss/lib/container.d.ts
@@ -5,6 +5,12 @@ import Node, { ChildNode, ChildProps, NodeProps } from './node.js'
import Rule from './rule.js'
declare namespace Container {
+ export class ContainerWithChildren<
+ Child extends Node = ChildNode
+ > extends Container_<Child> {
+ nodes: Child[]
+ }
+
export interface ValueOptions {
/**
* String that’s used to narrow down values and speed up the regexp search.
@@ -43,7 +49,7 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
* root.nodes[0].nodes[0].prop //=> 'color'
* ```
*/
- nodes: Child[]
+ nodes: Child[] | undefined
/**
* Inserts new nodes to the end of the container.
@@ -66,7 +72,15 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
* @return This node for methods chain.
*/
append(
- ...nodes: (ChildProps | ChildProps[] | Node | Node[] | string | string[])[]
+ ...nodes: (
+ | ChildProps
+ | ChildProps[]
+ | Node
+ | Node[]
+ | string
+ | string[]
+ | undefined
+ )[]
): this
assign(overrides: Container.ContainerProps | object): this
@@ -146,7 +160,14 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
*/
insertAfter(
oldNode: Child | number,
- newNode: Child | Child[] | ChildProps | ChildProps[] | string | string[]
+ newNode:
+ | Child
+ | Child[]
+ | ChildProps
+ | ChildProps[]
+ | string
+ | string[]
+ | undefined
): this
/**
* Insert new node before old node within the container.
@@ -161,7 +182,14 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
*/
insertBefore(
oldNode: Child | number,
- newNode: Child | Child[] | ChildProps | ChildProps[] | string | string[]
+ newNode:
+ | Child
+ | Child[]
+ | ChildProps
+ | ChildProps[]
+ | string
+ | string[]
+ | undefined
): this
/**
@@ -202,7 +230,15 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
* @return This node for methods chain.
*/
prepend(
- ...nodes: (ChildProps | ChildProps[] | Node | Node[] | string | string[])[]
+ ...nodes: (
+ | ChildProps
+ | ChildProps[]
+ | Node
+ | Node[]
+ | string
+ | string[]
+ | undefined
+ )[]
): this
/**
* Add child to the end of the node.
@@ -447,6 +483,8 @@ declare abstract class Container_<Child extends Node = ChildNode> extends Node {
get last(): Child | undefined
}
-declare class Container<Child extends Node = ChildNode> extends Container_<Child> {}
+declare class Container<
+ Child extends Node = ChildNode
+> extends Container_<Child> {}
export = Container
diff --git a/node_modules/postcss/lib/container.js b/node_modules/postcss/lib/container.js
index 914c0530..462e3f0d 100644
--- a/node_modules/postcss/lib/container.js
+++ b/node_modules/postcss/lib/container.js
@@ -173,6 +173,8 @@ class Container extends Node {
normalize(nodes, sample) {
if (typeof nodes === 'string') {
nodes = cleanSource(parse(nodes).nodes)
+ } else if (typeof nodes === 'undefined') {
+ nodes = []
} else if (Array.isArray(nodes)) {
nodes = nodes.slice(0)
for (let i of nodes) {
diff --git a/node_modules/postcss/lib/declaration.d.ts b/node_modules/postcss/lib/declaration.d.ts
index 655deea5..a5db984a 100644
--- a/node_modules/postcss/lib/declaration.d.ts
+++ b/node_modules/postcss/lib/declaration.d.ts
@@ -1,4 +1,4 @@
-import Container from './container.js'
+import { ContainerWithChildren } from './container.js'
import Node from './node.js'
declare namespace Declaration {
@@ -79,7 +79,7 @@ declare class Declaration_ extends Node {
*/
important: boolean
- parent: Container | undefined
+ parent: ContainerWithChildren | undefined
/**
* The property name for a CSS declaration.
diff --git a/node_modules/postcss/lib/document.d.ts b/node_modules/postcss/lib/document.d.ts
index f018f6e6..a368f166 100644
--- a/node_modules/postcss/lib/document.d.ts
+++ b/node_modules/postcss/lib/document.d.ts
@@ -35,6 +35,7 @@ declare namespace Document {
* ```
*/
declare class Document_ extends Container<Root> {
+ nodes: Root[]
parent: undefined
type: 'document'
diff --git a/node_modules/postcss/lib/map-generator.js b/node_modules/postcss/lib/map-generator.js
index b5da1642..ea1ef5ec 100644
--- a/node_modules/postcss/lib/map-generator.js
+++ b/node_modules/postcss/lib/map-generator.js
@@ -52,7 +52,7 @@ class MapGenerator {
if (this.mapOpts.sourcesContent === false) {
map = new SourceMapConsumer(prev.text)
if (map.sourcesContent) {
- map.sourcesContent = map.sourcesContent.map(() => null)
+ map.sourcesContent = null
}
} else {
map = prev.consumer()
diff --git a/node_modules/postcss/lib/no-work-result.js b/node_modules/postcss/lib/no-work-result.js
index aa3fdb4e..05821b7a 100644
--- a/node_modules/postcss/lib/no-work-result.js
+++ b/node_modules/postcss/lib/no-work-result.js
@@ -38,8 +38,8 @@ class NoWorkResult {
this.result.map = generatedMap
}
} else {
- map.clearAnnotation();
- this.result.css = map.css;
+ map.clearAnnotation()
+ this.result.css = map.css
}
}
diff --git a/node_modules/postcss/lib/node.d.ts b/node_modules/postcss/lib/node.d.ts
index 71b30159..59716564 100644
--- a/node_modules/postcss/lib/node.d.ts
+++ b/node_modules/postcss/lib/node.d.ts
@@ -246,7 +246,7 @@ declare abstract class Node_ {
* @param newNode New node.
* @return This node for methods chain.
*/
- after(newNode: Node | Node.ChildProps | Node[] | string): this
+ after(newNode: Node | Node.ChildProps | Node[] | string | undefined): this
/**
* It assigns properties to an existing node instance.
@@ -273,7 +273,7 @@ declare abstract class Node_ {
* @param newNode New node.
* @return This node for methods chain.
*/
- before(newNode: Node | Node.ChildProps | Node[] | string): this
+ before(newNode: Node | Node.ChildProps | Node[] | string | undefined): this
/**
* Clear the code style properties for the node and its children.
@@ -531,6 +531,6 @@ declare abstract class Node_ {
warn(result: Result, message: string, options?: WarningOptions): Warning
}
-declare class Node extends Node_ { }
+declare class Node extends Node_ {}
export = Node
diff --git a/node_modules/postcss/lib/parser.js b/node_modules/postcss/lib/parser.js
index e1e2e19e..bc761ded 100644
--- a/node_modules/postcss/lib/parser.js
+++ b/node_modules/postcss/lib/parser.js
@@ -28,7 +28,6 @@ class Parser {
this.current = this.root
this.spaces = ''
this.semicolon = false
- this.customProperty = false
this.createTokenizer()
this.root.source = { input, start: { column: 1, line: 1, offset: 0 } }
diff --git a/node_modules/postcss/lib/processor.js b/node_modules/postcss/lib/processor.js
index 9d6a5acd..b9e587cd 100644
--- a/node_modules/postcss/lib/processor.js
+++ b/node_modules/postcss/lib/processor.js
@@ -7,7 +7,7 @@ let Root = require('./root')
class Processor {
constructor(plugins = []) {
- this.version = '8.4.33'
+ this.version = '8.4.35'
this.plugins = this.normalize(plugins)
}
diff --git a/node_modules/postcss/lib/root.d.ts b/node_modules/postcss/lib/root.d.ts
index 98fb4bc9..9046aacd 100644
--- a/node_modules/postcss/lib/root.d.ts
+++ b/node_modules/postcss/lib/root.d.ts
@@ -54,6 +54,7 @@ declare namespace Root {
* ```
*/
declare class Root_ extends Container {
+ nodes: NonNullable<Container['nodes']>
parent: Document | undefined
raws: Root.RootRaws
type: 'root'
diff --git a/node_modules/postcss/lib/rule.d.ts b/node_modules/postcss/lib/rule.d.ts
index 04be5d6c..fc5dd721 100644
--- a/node_modules/postcss/lib/rule.d.ts
+++ b/node_modules/postcss/lib/rule.d.ts
@@ -1,4 +1,7 @@
-import Container, { ContainerProps } from './container.js'
+import Container, {
+ ContainerProps,
+ ContainerWithChildren
+} from './container.js'
declare namespace Rule {
export interface RuleRaws extends Record<string, unknown> {
@@ -69,7 +72,8 @@ declare namespace Rule {
* ```
*/
declare class Rule_ extends Container {
- parent: Container | undefined
+ nodes: NonNullable<Container['nodes']>
+ parent: ContainerWithChildren | undefined
raws: Rule.RuleRaws
/**
* The rule’s full selector represented as a string.