@swc/plugin-styled-jsx 1.5.5 → 1.5.7
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/Cargo.toml +5 -4
- package/package.json +1 -1
- package/src/transform_css.rs +11 -1
- package/swc_plugin_styled_jsx.wasm +0 -0
package/Cargo.toml
CHANGED
|
@@ -4,7 +4,7 @@ description = "SWC plugin for styled-jsx"
|
|
|
4
4
|
edition = "2021"
|
|
5
5
|
license = "Apache-2.0"
|
|
6
6
|
name = "swc_plugin_styled_jsx"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.7.0"
|
|
8
8
|
|
|
9
9
|
[lib]
|
|
10
10
|
crate-type = ["cdylib", "rlib"]
|
|
@@ -17,8 +17,9 @@ custom_transform = ["swc_core/common_concurrent"]
|
|
|
17
17
|
easy-error = "1.0.0"
|
|
18
18
|
tracing = "0.1.32"
|
|
19
19
|
|
|
20
|
-
swc_core = { version = "0.
|
|
20
|
+
swc_core = { version = "0.38.1", features = [
|
|
21
21
|
"common",
|
|
22
|
+
"ecma_ast",
|
|
22
23
|
"css_ast",
|
|
23
24
|
"css_codegen",
|
|
24
25
|
"css_parser",
|
|
@@ -31,7 +32,7 @@ swc_core = { version = "0.32.8", features = [
|
|
|
31
32
|
] }
|
|
32
33
|
|
|
33
34
|
[dev-dependencies]
|
|
34
|
-
testing = "0.31.
|
|
35
|
+
testing = "0.31.8"
|
|
35
36
|
swc_core = { features = [
|
|
36
37
|
"testing_transform"
|
|
37
|
-
], version = "0.
|
|
38
|
+
], version = "0.38.1" }
|
package/package.json
CHANGED
package/src/transform_css.rs
CHANGED
|
@@ -12,7 +12,10 @@ use swc_core::{
|
|
|
12
12
|
writer::basic::{BasicCssWriter, BasicCssWriterConfig},
|
|
13
13
|
CodeGenerator, CodegenConfig, Emit,
|
|
14
14
|
},
|
|
15
|
-
parser::{
|
|
15
|
+
parser::{
|
|
16
|
+
parse_str, parse_tokens,
|
|
17
|
+
parser::{input::Tokens, ParserConfig},
|
|
18
|
+
},
|
|
16
19
|
prefixer::prefixer,
|
|
17
20
|
visit::{VisitMut, VisitMutWith},
|
|
18
21
|
},
|
|
@@ -42,6 +45,7 @@ pub fn transform_css(
|
|
|
42
45
|
style_info.css_span.hi,
|
|
43
46
|
ParserConfig {
|
|
44
47
|
allow_wrong_line_comments: true,
|
|
48
|
+
..Default::default()
|
|
45
49
|
},
|
|
46
50
|
// We ignore errors because we inject placeholders for expressions which is
|
|
47
51
|
// not a valid css.
|
|
@@ -234,6 +238,7 @@ impl Namespacer {
|
|
|
234
238
|
PseudoClassSelectorChildren::ForgivingRelativeSelectorList(v) => {
|
|
235
239
|
to_tokens(v).tokens
|
|
236
240
|
}
|
|
241
|
+
PseudoClassSelectorChildren::ComplexSelector(v) => to_tokens(v).tokens,
|
|
237
242
|
})
|
|
238
243
|
.collect::<Vec<_>>();
|
|
239
244
|
|
|
@@ -251,6 +256,9 @@ impl Namespacer {
|
|
|
251
256
|
PseudoElementSelectorChildren::CompoundSelector(v) => {
|
|
252
257
|
to_tokens(v).tokens
|
|
253
258
|
}
|
|
259
|
+
PseudoElementSelectorChildren::CustomHighlightName(v) => {
|
|
260
|
+
to_tokens(v).tokens
|
|
261
|
+
}
|
|
254
262
|
})
|
|
255
263
|
.collect::<Vec<_>>();
|
|
256
264
|
|
|
@@ -283,6 +291,7 @@ impl Namespacer {
|
|
|
283
291
|
&args,
|
|
284
292
|
ParserConfig {
|
|
285
293
|
allow_wrong_line_comments: true,
|
|
294
|
+
..Default::default()
|
|
286
295
|
},
|
|
287
296
|
// TODO(kdy1): We might be able to report syntax errors.
|
|
288
297
|
&mut vec![],
|
|
@@ -520,6 +529,7 @@ where
|
|
|
520
529
|
StringInput::new(&s, span.lo, span.hi),
|
|
521
530
|
ParserConfig {
|
|
522
531
|
allow_wrong_line_comments: true,
|
|
532
|
+
..Default::default()
|
|
523
533
|
},
|
|
524
534
|
);
|
|
525
535
|
|
|
Binary file
|