@swc/plugin-styled-jsx 7.0.0 → 7.0.2
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 +12 -0
- package/README.md +12 -0
- package/__tests__/__snapshots__/wasm.test.ts.snap +1715 -0
- package/__tests__/wasm.test.ts +89 -0
- package/package.json +6 -2
- package/swc_plugin_styled_jsx.wasm +0 -0
|
@@ -0,0 +1,1715 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform .expressions correctly 1`] = `
|
|
4
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
5
|
+
const darken = (c)=>c;
|
|
6
|
+
const color = "red";
|
|
7
|
+
const otherColor = "green";
|
|
8
|
+
const mediumScreen = "680px";
|
|
9
|
+
const animationDuration = "200ms";
|
|
10
|
+
const animationName = "my-cool-animation";
|
|
11
|
+
const obj = {
|
|
12
|
+
display: "block"
|
|
13
|
+
};
|
|
14
|
+
export default (({ display })=>/*#__PURE__*/ React.createElement("div", {
|
|
15
|
+
className: "jsx-7d790162c8ab53bf " + _JSXStyle.dynamic([
|
|
16
|
+
[
|
|
17
|
+
"f374bce66bf8bc53",
|
|
18
|
+
[
|
|
19
|
+
display ? "block" : "none"
|
|
20
|
+
]
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"9ff947367eb295a9",
|
|
24
|
+
[
|
|
25
|
+
darken(color) + 2
|
|
26
|
+
]
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"97031d45e1e1883c",
|
|
30
|
+
[
|
|
31
|
+
darken(color)
|
|
32
|
+
]
|
|
33
|
+
]
|
|
34
|
+
])
|
|
35
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
36
|
+
className: "jsx-7d790162c8ab53bf " + _JSXStyle.dynamic([
|
|
37
|
+
[
|
|
38
|
+
"f374bce66bf8bc53",
|
|
39
|
+
[
|
|
40
|
+
display ? "block" : "none"
|
|
41
|
+
]
|
|
42
|
+
],
|
|
43
|
+
[
|
|
44
|
+
"9ff947367eb295a9",
|
|
45
|
+
[
|
|
46
|
+
darken(color) + 2
|
|
47
|
+
]
|
|
48
|
+
],
|
|
49
|
+
[
|
|
50
|
+
"97031d45e1e1883c",
|
|
51
|
+
[
|
|
52
|
+
darken(color)
|
|
53
|
+
]
|
|
54
|
+
]
|
|
55
|
+
])
|
|
56
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
57
|
+
id: "b858211f1ae5f9a7"
|
|
58
|
+
}, \`p.\${color}.jsx-7d790162c8ab53bf{color:\${otherColor};display:\${obj.display}}\`), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
59
|
+
id: "94239b6d6b42c9b5"
|
|
60
|
+
}, "p.jsx-7d790162c8ab53bf{color:red}"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
61
|
+
id: "bfe06f4e2e097633"
|
|
62
|
+
}, \`body{background:\${color}}\`), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
63
|
+
id: "bfe06f4e2e097633"
|
|
64
|
+
}, \`body{background:\${color}}\`), "// TODO: the next two should have the same hash", /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
65
|
+
id: "73815d631c0fd05a"
|
|
66
|
+
}, \`p.jsx-7d790162c8ab53bf{color:\${color}}\`), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
67
|
+
id: "73815d631c0fd05a"
|
|
68
|
+
}, \`p.jsx-7d790162c8ab53bf{color:\${color}}\`), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
69
|
+
id: "97031d45e1e1883c",
|
|
70
|
+
dynamic: [
|
|
71
|
+
darken(color)
|
|
72
|
+
]
|
|
73
|
+
}, \`p.__jsx-style-dynamic-selector{color:\${darken(color)}}\`), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
74
|
+
id: "9ff947367eb295a9",
|
|
75
|
+
dynamic: [
|
|
76
|
+
darken(color) + 2
|
|
77
|
+
]
|
|
78
|
+
}, \`p.__jsx-style-dynamic-selector{color:\${darken(color) + 2}}\`), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
79
|
+
id: "df2e7ce1df099141"
|
|
80
|
+
}, \`@media(min-width:\${mediumScreen}){p.jsx-7d790162c8ab53bf{color:green}p.jsx-7d790162c8ab53bf{color:\${\`red\`}}}p.jsx-7d790162c8ab53bf{color:red}\`), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
81
|
+
id: "a7e92eb9fe137ba9"
|
|
82
|
+
}, \`p.jsx-7d790162c8ab53bf{-webkit-animation-duration:\${animationDuration};-moz-animation-duration:\${animationDuration};-o-animation-duration:\${animationDuration};animation-duration:\${animationDuration}}\`), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
83
|
+
id: "33b91b924c07e1e8"
|
|
84
|
+
}, \`p.jsx-7d790162c8ab53bf{-webkit-animation:\${animationDuration} forwards \${animationName};-moz-animation:\${animationDuration} forwards \${animationName};-o-animation:\${animationDuration} forwards \${animationName};animation:\${animationDuration} forwards \${animationName}}div.jsx-7d790162c8ab53bf{background:\${color}}\`), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
85
|
+
id: "f374bce66bf8bc53",
|
|
86
|
+
dynamic: [
|
|
87
|
+
display ? "block" : "none"
|
|
88
|
+
]
|
|
89
|
+
}, \`span.__jsx-style-dynamic-selector{display:\${display ? "block" : "none"}}\`), "// TODO: causes bad syntax"));
|
|
90
|
+
"
|
|
91
|
+
`;
|
|
92
|
+
|
|
93
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform absent correctly 1`] = `
|
|
94
|
+
"const a = ()=>/*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement("p", null, "hi"), /*#__PURE__*/ React.createElement("style", null, "woot"));
|
|
95
|
+
"
|
|
96
|
+
`;
|
|
97
|
+
|
|
98
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform attribute-generation-classname-rewriting correctly 1`] = `
|
|
99
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
100
|
+
export default (()=>{
|
|
101
|
+
const Element = "div";
|
|
102
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
103
|
+
className: "jsx-abb4c2202db1a207"
|
|
104
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
105
|
+
...test.test,
|
|
106
|
+
className: "jsx-abb4c2202db1a207" + " " + (test.test && test.test.className != null && test.test.className || "test")
|
|
107
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
108
|
+
...test.test.test,
|
|
109
|
+
className: "jsx-abb4c2202db1a207" + " " + (test.test.test && test.test.test.className != null && test.test.test.className || "test")
|
|
110
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
111
|
+
...this.test.test,
|
|
112
|
+
className: "jsx-abb4c2202db1a207" + " " + (this.test.test && this.test.test.className != null && this.test.test.className || "test")
|
|
113
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
114
|
+
"data-test": "test",
|
|
115
|
+
className: "jsx-abb4c2202db1a207"
|
|
116
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
117
|
+
className: "jsx-abb4c2202db1a207" + " " + "test"
|
|
118
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
119
|
+
className: "jsx-abb4c2202db1a207" + " " + \`test\`
|
|
120
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
121
|
+
className: "jsx-abb4c2202db1a207" + " " + \`test\${true ? " test2" : ""}\`
|
|
122
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
123
|
+
className: "jsx-abb4c2202db1a207" + " " + ("test " + test || "")
|
|
124
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
125
|
+
className: "jsx-abb4c2202db1a207" + " " + ([
|
|
126
|
+
"test",
|
|
127
|
+
"test2"
|
|
128
|
+
].join(" ") || "")
|
|
129
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
130
|
+
className: "jsx-abb4c2202db1a207" + " " + (true && "test" || "")
|
|
131
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
132
|
+
className: "jsx-abb4c2202db1a207" + " " + ((test ? "test" : null) || "")
|
|
133
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
134
|
+
className: "jsx-abb4c2202db1a207" + " " + (test || "")
|
|
135
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
136
|
+
className: "jsx-abb4c2202db1a207" + " " + (test && "test" || "")
|
|
137
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
138
|
+
className: "jsx-abb4c2202db1a207" + " " + (test && test("test") || "")
|
|
139
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
140
|
+
className: "jsx-abb4c2202db1a207" + " " + (undefined || "")
|
|
141
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
142
|
+
className: "jsx-abb4c2202db1a207" + " " + (null || "")
|
|
143
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
144
|
+
className: "jsx-abb4c2202db1a207" + " " + (false || "")
|
|
145
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
146
|
+
"data-test": true,
|
|
147
|
+
className: "jsx-abb4c2202db1a207" + " " + "test"
|
|
148
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
149
|
+
"data-test": true,
|
|
150
|
+
className: "jsx-abb4c2202db1a207" + " " + "test"
|
|
151
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
152
|
+
"data-test": "test",
|
|
153
|
+
className: "jsx-abb4c2202db1a207" + " " + "test"
|
|
154
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
155
|
+
...props,
|
|
156
|
+
className: "jsx-abb4c2202db1a207" + " " + (props && props.className != null && props.className || "test")
|
|
157
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
158
|
+
...props,
|
|
159
|
+
...rest,
|
|
160
|
+
className: "jsx-abb4c2202db1a207" + " " + (rest && rest.className != null && rest.className || props && props.className != null && props.className || "test")
|
|
161
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
162
|
+
...props,
|
|
163
|
+
className: "jsx-abb4c2202db1a207" + " " + (props && props.className != null && props.className || \`test \${test ? "test" : ""}\`)
|
|
164
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
165
|
+
...props,
|
|
166
|
+
className: "jsx-abb4c2202db1a207" + " " + (props && props.className != null && props.className || test && test("test") || "")
|
|
167
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
168
|
+
...props,
|
|
169
|
+
className: "jsx-abb4c2202db1a207" + " " + (props && props.className != null && props.className || test && test("test") && "test" || "")
|
|
170
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
171
|
+
...props,
|
|
172
|
+
className: "jsx-abb4c2202db1a207" + " " + (props && props.className != null && props.className || test && test("test") && test2("test") || "")
|
|
173
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
174
|
+
...props,
|
|
175
|
+
className: "jsx-abb4c2202db1a207" + " " + "test"
|
|
176
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
177
|
+
...props,
|
|
178
|
+
...rest,
|
|
179
|
+
className: "jsx-abb4c2202db1a207" + " " + "test"
|
|
180
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
181
|
+
...props,
|
|
182
|
+
...rest,
|
|
183
|
+
className: "jsx-abb4c2202db1a207" + " " + (rest && rest.className != null && rest.className || "test")
|
|
184
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
185
|
+
...props,
|
|
186
|
+
className: "jsx-abb4c2202db1a207" + " " + (props && props.className != null && props.className || "")
|
|
187
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
188
|
+
...props,
|
|
189
|
+
...rest,
|
|
190
|
+
className: "jsx-abb4c2202db1a207" + " " + (rest && rest.className != null && rest.className || props && props.className != null && props.className || "")
|
|
191
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
192
|
+
...props,
|
|
193
|
+
"data-foo": true,
|
|
194
|
+
...rest,
|
|
195
|
+
className: "jsx-abb4c2202db1a207" + " " + (rest && rest.className != null && rest.className || props && props.className != null && props.className || "")
|
|
196
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
197
|
+
...props,
|
|
198
|
+
"data-foo": true,
|
|
199
|
+
...rest,
|
|
200
|
+
className: "jsx-abb4c2202db1a207" + " " + (rest && rest.className != null && rest.className || "test")
|
|
201
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
202
|
+
id: "foo",
|
|
203
|
+
className: "jsx-abb4c2202db1a207"
|
|
204
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
205
|
+
className: "jsx-abb4c2202db1a207" + " " + "foo"
|
|
206
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
207
|
+
className: "foo",
|
|
208
|
+
className: "jsx-abb4c2202db1a207" + " " + "test"
|
|
209
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
210
|
+
className: "test",
|
|
211
|
+
className: "jsx-abb4c2202db1a207" + " " + "foo"
|
|
212
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
213
|
+
...bar,
|
|
214
|
+
className: "jsx-abb4c2202db1a207" + " " + (bar && bar.className != null && bar.className || "foo")
|
|
215
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
216
|
+
className: "foo",
|
|
217
|
+
...bar,
|
|
218
|
+
className: "jsx-abb4c2202db1a207" + " " + "test"
|
|
219
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
220
|
+
className: "test",
|
|
221
|
+
...bar,
|
|
222
|
+
className: "jsx-abb4c2202db1a207" + " " + (bar && bar.className != null && bar.className || "foo")
|
|
223
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
224
|
+
className: "test",
|
|
225
|
+
className: "jsx-abb4c2202db1a207" + " " + (props.className || "")
|
|
226
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
227
|
+
className: "test",
|
|
228
|
+
...bar,
|
|
229
|
+
className: "jsx-abb4c2202db1a207" + " " + (bar && bar.className != null && bar.className || props.className || "")
|
|
230
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
231
|
+
className: "test",
|
|
232
|
+
...bar,
|
|
233
|
+
className: "jsx-abb4c2202db1a207" + " " + (props.className || "")
|
|
234
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
235
|
+
...bar(),
|
|
236
|
+
className: "jsx-abb4c2202db1a207" + " " + "test"
|
|
237
|
+
}), /*#__PURE__*/ React.createElement(Element, {
|
|
238
|
+
className: "jsx-abb4c2202db1a207"
|
|
239
|
+
}), /*#__PURE__*/ React.createElement(Element, {
|
|
240
|
+
className: "jsx-abb4c2202db1a207" + " " + "test"
|
|
241
|
+
}), /*#__PURE__*/ React.createElement(Element, {
|
|
242
|
+
...props,
|
|
243
|
+
className: "jsx-abb4c2202db1a207" + " " + (props && props.className != null && props.className || "")
|
|
244
|
+
}), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
245
|
+
id: "abb4c2202db1a207"
|
|
246
|
+
}, "div.jsx-abb4c2202db1a207{color:red}"));
|
|
247
|
+
});
|
|
248
|
+
"
|
|
249
|
+
`;
|
|
250
|
+
|
|
251
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform attribute-generation-modes correctly 1`] = `
|
|
252
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
253
|
+
import styles from "./styles";
|
|
254
|
+
const styles2 = require("./styles2");
|
|
255
|
+
// external only
|
|
256
|
+
export const Test1 = ()=>/*#__PURE__*/ React.createElement("div", {
|
|
257
|
+
className: \`jsx-\${styles2.__hash} jsx-\${styles.__hash}\`
|
|
258
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
259
|
+
className: \`jsx-\${styles2.__hash} jsx-\${styles.__hash}\`
|
|
260
|
+
}, "external only"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
261
|
+
id: styles.__hash
|
|
262
|
+
}, styles), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
263
|
+
id: styles2.__hash
|
|
264
|
+
}, styles2));
|
|
265
|
+
// external and static
|
|
266
|
+
export const Test2 = ()=>/*#__PURE__*/ React.createElement("div", {
|
|
267
|
+
className: "jsx-81a68341e430a972 " + \`jsx-\${styles.__hash}\`
|
|
268
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
269
|
+
className: "jsx-81a68341e430a972 " + \`jsx-\${styles.__hash}\`
|
|
270
|
+
}, "external and static"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
271
|
+
id: "81a68341e430a972"
|
|
272
|
+
}, "p.jsx-81a68341e430a972{color:red}"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
273
|
+
id: styles.__hash
|
|
274
|
+
}, styles));
|
|
275
|
+
// external and dynamic
|
|
276
|
+
export const Test3 = ({ color })=>/*#__PURE__*/ React.createElement("div", {
|
|
277
|
+
className: \`jsx-\${styles.__hash}\` + " " + _JSXStyle.dynamic([
|
|
278
|
+
[
|
|
279
|
+
"ef5a1b863e7906fd",
|
|
280
|
+
[
|
|
281
|
+
color
|
|
282
|
+
]
|
|
283
|
+
]
|
|
284
|
+
])
|
|
285
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
286
|
+
className: \`jsx-\${styles.__hash}\` + " " + _JSXStyle.dynamic([
|
|
287
|
+
[
|
|
288
|
+
"ef5a1b863e7906fd",
|
|
289
|
+
[
|
|
290
|
+
color
|
|
291
|
+
]
|
|
292
|
+
]
|
|
293
|
+
])
|
|
294
|
+
}, "external and dynamic"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
295
|
+
id: "ef5a1b863e7906fd",
|
|
296
|
+
dynamic: [
|
|
297
|
+
color
|
|
298
|
+
]
|
|
299
|
+
}, \`p.__jsx-style-dynamic-selector{color:\${color}}\`), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
300
|
+
id: styles.__hash
|
|
301
|
+
}, styles));
|
|
302
|
+
// external, static and dynamic
|
|
303
|
+
export const Test4 = ({ color })=>/*#__PURE__*/ React.createElement("div", {
|
|
304
|
+
className: \`jsx-\${styles.__hash}\` + " jsx-ceba8c9ce34e3d0c " + _JSXStyle.dynamic([
|
|
305
|
+
[
|
|
306
|
+
"76298716cb999a3b",
|
|
307
|
+
[
|
|
308
|
+
color
|
|
309
|
+
]
|
|
310
|
+
]
|
|
311
|
+
])
|
|
312
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
313
|
+
className: \`jsx-\${styles.__hash}\` + " jsx-ceba8c9ce34e3d0c " + _JSXStyle.dynamic([
|
|
314
|
+
[
|
|
315
|
+
"76298716cb999a3b",
|
|
316
|
+
[
|
|
317
|
+
color
|
|
318
|
+
]
|
|
319
|
+
]
|
|
320
|
+
])
|
|
321
|
+
}, "external, static and dynamic"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
322
|
+
id: "ceba8c9ce34e3d0c"
|
|
323
|
+
}, "p.jsx-ceba8c9ce34e3d0c{display:inline-block}"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
324
|
+
id: "76298716cb999a3b",
|
|
325
|
+
dynamic: [
|
|
326
|
+
color
|
|
327
|
+
]
|
|
328
|
+
}, \`p.__jsx-style-dynamic-selector{color:\${color}}\`), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
329
|
+
id: styles.__hash
|
|
330
|
+
}, styles));
|
|
331
|
+
// static only
|
|
332
|
+
export const Test5 = ()=>/*#__PURE__*/ React.createElement("div", {
|
|
333
|
+
className: "jsx-df0159ebd3f9fb6f"
|
|
334
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
335
|
+
className: "jsx-df0159ebd3f9fb6f"
|
|
336
|
+
}, "static only"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
337
|
+
id: "ceba8c9ce34e3d0c"
|
|
338
|
+
}, "p.jsx-df0159ebd3f9fb6f{display:inline-block}"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
339
|
+
id: "81a68341e430a972"
|
|
340
|
+
}, "p.jsx-df0159ebd3f9fb6f{color:red}"));
|
|
341
|
+
// static and dynamic
|
|
342
|
+
export const Test6 = ({ color })=>/*#__PURE__*/ React.createElement("div", {
|
|
343
|
+
className: "jsx-ceba8c9ce34e3d0c " + _JSXStyle.dynamic([
|
|
344
|
+
[
|
|
345
|
+
"3895e17ce77b69d1",
|
|
346
|
+
[
|
|
347
|
+
color
|
|
348
|
+
]
|
|
349
|
+
]
|
|
350
|
+
])
|
|
351
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
352
|
+
className: "jsx-ceba8c9ce34e3d0c " + _JSXStyle.dynamic([
|
|
353
|
+
[
|
|
354
|
+
"3895e17ce77b69d1",
|
|
355
|
+
[
|
|
356
|
+
color
|
|
357
|
+
]
|
|
358
|
+
]
|
|
359
|
+
])
|
|
360
|
+
}, "static and dynamic"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
361
|
+
id: "ceba8c9ce34e3d0c"
|
|
362
|
+
}, "p.jsx-ceba8c9ce34e3d0c{display:inline-block}"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
363
|
+
id: "3895e17ce77b69d1",
|
|
364
|
+
dynamic: [
|
|
365
|
+
color
|
|
366
|
+
]
|
|
367
|
+
}, \`p.__jsx-style-dynamic-selector{color:\${color}}\`));
|
|
368
|
+
// dynamic only
|
|
369
|
+
export const Test7 = ({ color })=>/*#__PURE__*/ React.createElement("div", {
|
|
370
|
+
className: _JSXStyle.dynamic([
|
|
371
|
+
[
|
|
372
|
+
"bd26d92615520db6",
|
|
373
|
+
[
|
|
374
|
+
color
|
|
375
|
+
]
|
|
376
|
+
]
|
|
377
|
+
])
|
|
378
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
379
|
+
className: _JSXStyle.dynamic([
|
|
380
|
+
[
|
|
381
|
+
"bd26d92615520db6",
|
|
382
|
+
[
|
|
383
|
+
color
|
|
384
|
+
]
|
|
385
|
+
]
|
|
386
|
+
])
|
|
387
|
+
}, "dynamic only"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
388
|
+
id: "bd26d92615520db6",
|
|
389
|
+
dynamic: [
|
|
390
|
+
color
|
|
391
|
+
]
|
|
392
|
+
}, \`p.__jsx-style-dynamic-selector{color:\${color}}\`));
|
|
393
|
+
// dynamic with scoped compound variable
|
|
394
|
+
export const Test8 = ({ color })=>{
|
|
395
|
+
if (color) {
|
|
396
|
+
const innerProps = {
|
|
397
|
+
color
|
|
398
|
+
};
|
|
399
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
400
|
+
className: _JSXStyle.dynamic([
|
|
401
|
+
[
|
|
402
|
+
"f0cf5707c4f40fc2",
|
|
403
|
+
[
|
|
404
|
+
innerProps.color
|
|
405
|
+
]
|
|
406
|
+
]
|
|
407
|
+
])
|
|
408
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
409
|
+
className: _JSXStyle.dynamic([
|
|
410
|
+
[
|
|
411
|
+
"f0cf5707c4f40fc2",
|
|
412
|
+
[
|
|
413
|
+
innerProps.color
|
|
414
|
+
]
|
|
415
|
+
]
|
|
416
|
+
])
|
|
417
|
+
}, "dynamic with scoped compound variable"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
418
|
+
id: "f0cf5707c4f40fc2",
|
|
419
|
+
dynamic: [
|
|
420
|
+
innerProps.color
|
|
421
|
+
]
|
|
422
|
+
}, \`p.__jsx-style-dynamic-selector{color:\${innerProps.color}}\`));
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
// dynamic with compound variable
|
|
426
|
+
export const Test9 = ({ color })=>{
|
|
427
|
+
const innerProps = {
|
|
428
|
+
color
|
|
429
|
+
};
|
|
430
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
431
|
+
className: _JSXStyle.dynamic([
|
|
432
|
+
[
|
|
433
|
+
"58ca1b812573d314",
|
|
434
|
+
[
|
|
435
|
+
innerProps.color
|
|
436
|
+
]
|
|
437
|
+
]
|
|
438
|
+
])
|
|
439
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
440
|
+
className: _JSXStyle.dynamic([
|
|
441
|
+
[
|
|
442
|
+
"58ca1b812573d314",
|
|
443
|
+
[
|
|
444
|
+
innerProps.color
|
|
445
|
+
]
|
|
446
|
+
]
|
|
447
|
+
])
|
|
448
|
+
}, "dynamic with compound variable"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
449
|
+
id: "58ca1b812573d314",
|
|
450
|
+
dynamic: [
|
|
451
|
+
innerProps.color
|
|
452
|
+
]
|
|
453
|
+
}, \`p.__jsx-style-dynamic-selector{color:\${innerProps.color}}\`));
|
|
454
|
+
};
|
|
455
|
+
const foo = "red";
|
|
456
|
+
// dynamic with constant variable
|
|
457
|
+
export const Test10 = ()=>/*#__PURE__*/ React.createElement("div", {
|
|
458
|
+
className: "jsx-563898a29d0c8d10"
|
|
459
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
460
|
+
className: "jsx-563898a29d0c8d10"
|
|
461
|
+
}, "dynamic with constant variable"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
462
|
+
id: "563898a29d0c8d10"
|
|
463
|
+
}, \`p.jsx-563898a29d0c8d10{color:\${foo}}\`));
|
|
464
|
+
// dynamic with complex scope
|
|
465
|
+
export const Test11 = ({ color })=>{
|
|
466
|
+
const items = Array.from({
|
|
467
|
+
length: 5
|
|
468
|
+
}).map((item, i)=>/*#__PURE__*/ React.createElement("li", {
|
|
469
|
+
key: i,
|
|
470
|
+
className: _JSXStyle.dynamic([
|
|
471
|
+
[
|
|
472
|
+
"118434e743df3274",
|
|
473
|
+
[
|
|
474
|
+
color
|
|
475
|
+
]
|
|
476
|
+
]
|
|
477
|
+
]) + " " + "item"
|
|
478
|
+
}, /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
479
|
+
id: "118434e743df3274",
|
|
480
|
+
dynamic: [
|
|
481
|
+
color
|
|
482
|
+
]
|
|
483
|
+
}, \`.item.__jsx-style-dynamic-selector{color:\${color}}\`), "Item #", i + 1));
|
|
484
|
+
return /*#__PURE__*/ React.createElement("ul", {
|
|
485
|
+
className: "items"
|
|
486
|
+
}, items);
|
|
487
|
+
};
|
|
488
|
+
"
|
|
489
|
+
`;
|
|
490
|
+
|
|
491
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform class correctly 1`] = `
|
|
492
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
493
|
+
class _class {
|
|
494
|
+
render() {
|
|
495
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
496
|
+
className: "jsx-b2b86d63f35d25ee"
|
|
497
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
498
|
+
className: "jsx-b2b86d63f35d25ee"
|
|
499
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
500
|
+
id: "b2b86d63f35d25ee"
|
|
501
|
+
}, "p.jsx-b2b86d63f35d25ee{color:red}"));
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
export { _class as default };
|
|
505
|
+
"
|
|
506
|
+
`;
|
|
507
|
+
|
|
508
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform component-attribute correctly 1`] = `
|
|
509
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
510
|
+
const Test = ()=>/*#__PURE__*/ React.createElement("div", {
|
|
511
|
+
className: "jsx-a9535d7d5f32c3c4"
|
|
512
|
+
}, /*#__PURE__*/ React.createElement("span", {
|
|
513
|
+
className: "jsx-a9535d7d5f32c3c4"
|
|
514
|
+
}, "test"), /*#__PURE__*/ React.createElement(Component, null), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
515
|
+
id: "a9535d7d5f32c3c4"
|
|
516
|
+
}, "span.jsx-a9535d7d5f32c3c4{color:red}"));
|
|
517
|
+
"
|
|
518
|
+
`;
|
|
519
|
+
|
|
520
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform conflicts correctly 1`] = `
|
|
521
|
+
"// TODO
|
|
522
|
+
// export const _JSXStyle = '_JSXStyle-literal'
|
|
523
|
+
// export default function() {
|
|
524
|
+
// return (
|
|
525
|
+
// <div>
|
|
526
|
+
// <p>test</p>
|
|
527
|
+
// <style jsx>{\`
|
|
528
|
+
// p {
|
|
529
|
+
// color: red;
|
|
530
|
+
// }
|
|
531
|
+
// \`}</style>
|
|
532
|
+
// </div>
|
|
533
|
+
// )
|
|
534
|
+
// }
|
|
535
|
+
"
|
|
536
|
+
`;
|
|
537
|
+
|
|
538
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform css-selector-after-pseudo correctly 1`] = `
|
|
539
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
540
|
+
function NavigationItem({ active, className }) {
|
|
541
|
+
return /*#__PURE__*/ React.createElement("span", {
|
|
542
|
+
className: "jsx-e73bf96b356a8634" + " " + (cn({
|
|
543
|
+
active
|
|
544
|
+
}, className, "navigation-item") || "")
|
|
545
|
+
}, /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
546
|
+
id: "e73bf96b356a8634"
|
|
547
|
+
}, '.navigation-item.jsx-e73bf96b356a8634 a::after{content:attr(data-text);content:attr(data-text)/""}'));
|
|
548
|
+
}
|
|
549
|
+
export default NavigationItem;
|
|
550
|
+
"
|
|
551
|
+
`;
|
|
552
|
+
|
|
553
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform css-tag-same-file correctly 1`] = `
|
|
554
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
555
|
+
export default (({ children })=>/*#__PURE__*/ React.createElement("div", {
|
|
556
|
+
className: \`jsx-\${styles.__hash}\`
|
|
557
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
558
|
+
className: \`jsx-\${styles.__hash}\`
|
|
559
|
+
}, children), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
560
|
+
id: styles.__hash
|
|
561
|
+
}, styles)));
|
|
562
|
+
const styles = new String("p.jsx-556239d258b6d66a{color:red}");
|
|
563
|
+
styles.__hash = "556239d258b6d66a";
|
|
564
|
+
class Test extends React.Component {
|
|
565
|
+
render() {
|
|
566
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
567
|
+
className: \`jsx-\${styles.__hash}\`
|
|
568
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
569
|
+
className: \`jsx-\${styles.__hash}\`
|
|
570
|
+
}, this.props.children), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
571
|
+
id: styles.__hash
|
|
572
|
+
}, styles));
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
"
|
|
576
|
+
`;
|
|
577
|
+
|
|
578
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform different-jsx-ids correctly 1`] = `
|
|
579
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
580
|
+
const color = "red";
|
|
581
|
+
const otherColor = "green";
|
|
582
|
+
const A = ()=>/*#__PURE__*/ React.createElement("div", {
|
|
583
|
+
className: "jsx-73815d631c0fd05a"
|
|
584
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
585
|
+
className: "jsx-73815d631c0fd05a"
|
|
586
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
587
|
+
id: "73815d631c0fd05a"
|
|
588
|
+
}, \`p.jsx-73815d631c0fd05a{color:\${color}}\`));
|
|
589
|
+
const B = ()=>/*#__PURE__*/ React.createElement("div", {
|
|
590
|
+
className: "jsx-dd59f687949dba4a"
|
|
591
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
592
|
+
className: "jsx-dd59f687949dba4a"
|
|
593
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
594
|
+
id: "dd59f687949dba4a"
|
|
595
|
+
}, \`p.jsx-dd59f687949dba4a{color:\${otherColor}}\`));
|
|
596
|
+
export default (()=>/*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement(A, null), /*#__PURE__*/ React.createElement(B, null)));
|
|
597
|
+
"
|
|
598
|
+
`;
|
|
599
|
+
|
|
600
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform dynamic-element correctly 1`] = `
|
|
601
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
602
|
+
export default (({ level = 1 })=>{
|
|
603
|
+
const Element = \`h\${level}\`;
|
|
604
|
+
return /*#__PURE__*/ React.createElement(Element, {
|
|
605
|
+
className: "jsx-fca64cc3f069b519" + " " + "root"
|
|
606
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
607
|
+
className: "jsx-fca64cc3f069b519"
|
|
608
|
+
}, "dynamic element"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
609
|
+
id: "fca64cc3f069b519"
|
|
610
|
+
}, ".root.jsx-fca64cc3f069b519{background:red}"));
|
|
611
|
+
});
|
|
612
|
+
export const TestLowerCase = ({ level = 1 })=>{
|
|
613
|
+
const element = \`h\${level}\`;
|
|
614
|
+
return /*#__PURE__*/ React.createElement("element", {
|
|
615
|
+
className: "jsx-fca64cc3f069b519" + " " + "root"
|
|
616
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
617
|
+
className: "jsx-fca64cc3f069b519"
|
|
618
|
+
}, "dynamic element"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
619
|
+
id: "fca64cc3f069b519"
|
|
620
|
+
}, ".root.jsx-fca64cc3f069b519{background:red}"));
|
|
621
|
+
};
|
|
622
|
+
const Element2 = "div";
|
|
623
|
+
export const Test2 = ()=>{
|
|
624
|
+
return /*#__PURE__*/ React.createElement(Element2, {
|
|
625
|
+
className: "root"
|
|
626
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
627
|
+
className: "jsx-fca64cc3f069b519"
|
|
628
|
+
}, "dynamic element"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
629
|
+
id: "fca64cc3f069b519"
|
|
630
|
+
}, ".root.jsx-fca64cc3f069b519{background:red}"));
|
|
631
|
+
};
|
|
632
|
+
export const Test3 = ({ Component = "div" })=>{
|
|
633
|
+
return /*#__PURE__*/ React.createElement(Component, {
|
|
634
|
+
className: "jsx-fca64cc3f069b519"
|
|
635
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
636
|
+
className: "jsx-fca64cc3f069b519"
|
|
637
|
+
}, "dynamic element"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
638
|
+
id: "fca64cc3f069b519"
|
|
639
|
+
}, ".root.jsx-fca64cc3f069b519{background:red}"));
|
|
640
|
+
};
|
|
641
|
+
"
|
|
642
|
+
`;
|
|
643
|
+
|
|
644
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform dynamic-element-class correctly 1`] = `
|
|
645
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
646
|
+
class _class {
|
|
647
|
+
render() {
|
|
648
|
+
const Element = "div";
|
|
649
|
+
return /*#__PURE__*/ React.createElement(Element, {
|
|
650
|
+
className: "jsx-f825b24bbab5b83b" + " " + "root"
|
|
651
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
652
|
+
className: "jsx-f825b24bbab5b83b"
|
|
653
|
+
}, "dynamic element"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
654
|
+
id: "f825b24bbab5b83b"
|
|
655
|
+
}, ".root.jsx-f825b24bbab5b83b{background:red}"));
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
export { _class as default };
|
|
659
|
+
const Element2 = "div";
|
|
660
|
+
export const Test2 = class {
|
|
661
|
+
render() {
|
|
662
|
+
return /*#__PURE__*/ React.createElement(Element2, {
|
|
663
|
+
className: "root"
|
|
664
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
665
|
+
className: "jsx-f825b24bbab5b83b"
|
|
666
|
+
}, "dynamic element"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
667
|
+
id: "f825b24bbab5b83b"
|
|
668
|
+
}, ".root.jsx-f825b24bbab5b83b{background:red}"));
|
|
669
|
+
}
|
|
670
|
+
};
|
|
671
|
+
"
|
|
672
|
+
`;
|
|
673
|
+
|
|
674
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform dynamic-element-external correctly 1`] = `
|
|
675
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
676
|
+
import styles from "./styles2";
|
|
677
|
+
export default (({ level = 1 })=>{
|
|
678
|
+
const Element = \`h\${level}\`;
|
|
679
|
+
return /*#__PURE__*/ React.createElement(Element, {
|
|
680
|
+
className: \`jsx-\${styles.__hash}\` + " " + "root"
|
|
681
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
682
|
+
className: \`jsx-\${styles.__hash}\`
|
|
683
|
+
}, "dynamic element"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
684
|
+
id: styles.__hash
|
|
685
|
+
}, styles));
|
|
686
|
+
});
|
|
687
|
+
"
|
|
688
|
+
`;
|
|
689
|
+
|
|
690
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform dynamic-this-in-arrow correctly 1`] = `
|
|
691
|
+
"// TODO
|
|
692
|
+
// import React, { Component } from 'react'
|
|
693
|
+
// export default class Index extends Component {
|
|
694
|
+
// static getInitialProps() {
|
|
695
|
+
// return { color: 'aquamarine' }
|
|
696
|
+
// }
|
|
697
|
+
// render() {
|
|
698
|
+
// return (
|
|
699
|
+
// <div>
|
|
700
|
+
// {[1, 2].map(idx => (
|
|
701
|
+
// <div key={idx}>
|
|
702
|
+
// {[3, 4].map(idx2 => (
|
|
703
|
+
// <div key={idx2}>{this.props.color}</div>
|
|
704
|
+
// ))}
|
|
705
|
+
// </div>
|
|
706
|
+
// ))}
|
|
707
|
+
// {[1, 2].map(idx => (
|
|
708
|
+
// <div key={idx}>
|
|
709
|
+
// <div>
|
|
710
|
+
// {this.props.color}
|
|
711
|
+
// <div className="something">
|
|
712
|
+
// <React.Fragment>
|
|
713
|
+
// <div>
|
|
714
|
+
// <div>{this.props.color} hello there</div>
|
|
715
|
+
// </div>
|
|
716
|
+
// </React.Fragment>
|
|
717
|
+
// </div>
|
|
718
|
+
// </div>
|
|
719
|
+
// </div>
|
|
720
|
+
// ))}
|
|
721
|
+
// <style jsx>{\`
|
|
722
|
+
// div {
|
|
723
|
+
// background: \${this.props.color};
|
|
724
|
+
// }
|
|
725
|
+
// \`}</style>
|
|
726
|
+
// </div>
|
|
727
|
+
// )
|
|
728
|
+
// }
|
|
729
|
+
// }
|
|
730
|
+
"
|
|
731
|
+
`;
|
|
732
|
+
|
|
733
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform exported-jsx-style correctly 1`] = `
|
|
734
|
+
"// module.exports = () => <p><style jsx>{\`p { color:red; }\`}</style></p>
|
|
735
|
+
"
|
|
736
|
+
`;
|
|
737
|
+
|
|
738
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform exported-non-jsx-style correctly 1`] = `
|
|
739
|
+
"// module.exports = () => <p><style>{\`p { color:red; }\`}</style></p>
|
|
740
|
+
"
|
|
741
|
+
`;
|
|
742
|
+
|
|
743
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform external-nested-scope correctly 1`] = `
|
|
744
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
745
|
+
function test() {
|
|
746
|
+
({
|
|
747
|
+
styles: /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
748
|
+
id: "7b844396f2efe2ef"
|
|
749
|
+
}, "div.jsx-7b844396f2efe2ef{color:red}"),
|
|
750
|
+
className: "jsx-7b844396f2efe2ef"
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
"
|
|
754
|
+
`;
|
|
755
|
+
|
|
756
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform external-stylesheet correctly 1`] = `
|
|
757
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
758
|
+
import styles from "./styles";
|
|
759
|
+
const styles2 = require("./styles2");
|
|
760
|
+
import { foo as styles3 } from "./styles";
|
|
761
|
+
export default (()=>/*#__PURE__*/ React.createElement("div", {
|
|
762
|
+
className: "jsx-bee92b62eadf8a14 " + \`jsx-\${styles.__hash} jsx-\${styles3.__hash}\`
|
|
763
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
764
|
+
className: "jsx-bee92b62eadf8a14 " + \`jsx-\${styles.__hash} jsx-\${styles3.__hash}\` + " " + "foo"
|
|
765
|
+
}, "test"), /*#__PURE__*/ React.createElement("p", {
|
|
766
|
+
className: "jsx-bee92b62eadf8a14 " + \`jsx-\${styles.__hash} jsx-\${styles3.__hash}\`
|
|
767
|
+
}, "woot"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
768
|
+
id: styles2.__hash
|
|
769
|
+
}, styles2), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
770
|
+
id: styles3.__hash
|
|
771
|
+
}, styles3), /*#__PURE__*/ React.createElement("div", {
|
|
772
|
+
className: "jsx-bee92b62eadf8a14 " + \`jsx-\${styles.__hash} jsx-\${styles3.__hash}\`
|
|
773
|
+
}, "woot"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
774
|
+
id: "bee92b62eadf8a14"
|
|
775
|
+
}, "p.jsx-bee92b62eadf8a14{color:red}div.jsx-bee92b62eadf8a14{color:green}"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
776
|
+
id: styles.__hash
|
|
777
|
+
}, styles)));
|
|
778
|
+
export const Test = ()=>/*#__PURE__*/ React.createElement("div", {
|
|
779
|
+
className: "jsx-bee92b62eadf8a14 " + \`jsx-\${styles3.__hash}\`
|
|
780
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
781
|
+
className: "jsx-bee92b62eadf8a14 " + \`jsx-\${styles3.__hash}\` + " " + "foo"
|
|
782
|
+
}, "test"), /*#__PURE__*/ React.createElement("p", {
|
|
783
|
+
className: "jsx-bee92b62eadf8a14 " + \`jsx-\${styles3.__hash}\`
|
|
784
|
+
}, "woot"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
785
|
+
id: styles3.__hash
|
|
786
|
+
}, styles3), /*#__PURE__*/ React.createElement("div", {
|
|
787
|
+
className: "jsx-bee92b62eadf8a14 " + \`jsx-\${styles3.__hash}\`
|
|
788
|
+
}, "woot"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
789
|
+
id: "bee92b62eadf8a14"
|
|
790
|
+
}, "p.jsx-bee92b62eadf8a14{color:red}div.jsx-bee92b62eadf8a14{color:green}"));
|
|
791
|
+
"
|
|
792
|
+
`;
|
|
793
|
+
|
|
794
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform external-stylesheet-global correctly 1`] = `
|
|
795
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
796
|
+
import styles, { foo as styles3 } from "./styles";
|
|
797
|
+
const styles2 = require("./styles2");
|
|
798
|
+
export default (()=>/*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement("p", null, "test"), /*#__PURE__*/ React.createElement("div", null, "woot"), /*#__PURE__*/ React.createElement("p", null, "woot"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
799
|
+
id: styles2.__hash
|
|
800
|
+
}, styles2), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
801
|
+
id: styles3.__hash
|
|
802
|
+
}, styles3), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
803
|
+
id: styles.__hash
|
|
804
|
+
}, styles)));
|
|
805
|
+
"
|
|
806
|
+
`;
|
|
807
|
+
|
|
808
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform external-stylesheet-multi-line correctly 1`] = `
|
|
809
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
810
|
+
import styles from "./styles";
|
|
811
|
+
export default (()=>/*#__PURE__*/ React.createElement("div", {
|
|
812
|
+
className: \`jsx-\${styles.__hash}\`
|
|
813
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
814
|
+
className: \`jsx-\${styles.__hash}\`
|
|
815
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
816
|
+
id: styles.__hash
|
|
817
|
+
}, styles)));
|
|
818
|
+
"
|
|
819
|
+
`;
|
|
820
|
+
|
|
821
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform fragment correctly 1`] = `
|
|
822
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
823
|
+
import React from "react";
|
|
824
|
+
export default (()=>/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("p", {
|
|
825
|
+
className: "jsx-6dd5f97e085c0297"
|
|
826
|
+
}, "Testing!!!"), /*#__PURE__*/ React.createElement("p", {
|
|
827
|
+
className: "jsx-6dd5f97e085c0297" + " " + "foo"
|
|
828
|
+
}, "Bar"), /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("h3", {
|
|
829
|
+
id: "head",
|
|
830
|
+
className: "jsx-6dd5f97e085c0297"
|
|
831
|
+
}, "Title..."), /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("p", {
|
|
832
|
+
className: "jsx-6dd5f97e085c0297"
|
|
833
|
+
}, "hello"), /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("p", {
|
|
834
|
+
className: "jsx-6dd5f97e085c0297"
|
|
835
|
+
}, "foo"), /*#__PURE__*/ React.createElement("p", {
|
|
836
|
+
className: "jsx-6dd5f97e085c0297"
|
|
837
|
+
}, "bar")), /*#__PURE__*/ React.createElement("p", {
|
|
838
|
+
className: "jsx-6dd5f97e085c0297"
|
|
839
|
+
}, "world"))), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
840
|
+
id: "6dd5f97e085c0297"
|
|
841
|
+
}, "p.jsx-6dd5f97e085c0297{color:cyan}.foo.jsx-6dd5f97e085c0297{font-size:18px;color:hotpink}#head.jsx-6dd5f97e085c0297{text-decoration:underline}")));
|
|
842
|
+
function Component1() {
|
|
843
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("div", null, "test"));
|
|
844
|
+
}
|
|
845
|
+
function Component2() {
|
|
846
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
847
|
+
className: "jsx-678f41ca6d3b294b"
|
|
848
|
+
}, /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
849
|
+
id: "678f41ca6d3b294b"
|
|
850
|
+
}, "div.jsx-678f41ca6d3b294b{color:red}"));
|
|
851
|
+
}
|
|
852
|
+
"
|
|
853
|
+
`;
|
|
854
|
+
|
|
855
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform global correctly 1`] = `
|
|
856
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
857
|
+
const Test = ()=>/*#__PURE__*/ React.createElement("div", {
|
|
858
|
+
className: "jsx-f84dd0db2f59ea88"
|
|
859
|
+
}, /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
860
|
+
id: "f84dd0db2f59ea88"
|
|
861
|
+
}, "body{color:red}:hover{color:red;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-animation:foo 1s ease-out;-moz-animation:foo 1s ease-out;-o-animation:foo 1s ease-out;animation:foo 1s ease-out}div a{display:none}[data-test]>div{color:red}"));
|
|
862
|
+
const Test2 = ()=>/*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
863
|
+
id: "94239b6d6b42c9b5"
|
|
864
|
+
}, "p{color:red}");
|
|
865
|
+
"
|
|
866
|
+
`;
|
|
867
|
+
|
|
868
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform global-child-selector correctly 1`] = `
|
|
869
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
870
|
+
const Test = ()=>/*#__PURE__*/ React.createElement("div", {
|
|
871
|
+
className: "jsx-5a206f122d1cb32e"
|
|
872
|
+
}, /*#__PURE__*/ React.createElement("span", {
|
|
873
|
+
className: "jsx-5a206f122d1cb32e"
|
|
874
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
875
|
+
id: "5a206f122d1cb32e"
|
|
876
|
+
}, "div.jsx-5a206f122d1cb32e>span{color:red}"));
|
|
877
|
+
"
|
|
878
|
+
`;
|
|
879
|
+
|
|
880
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform global-redundant correctly 1`] = `
|
|
881
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
882
|
+
export default function IndexPage() {
|
|
883
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
884
|
+
className: "jsx-b6abd0684ba81871"
|
|
885
|
+
}, "should be blue.", /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
886
|
+
id: "b6abd0684ba81871"
|
|
887
|
+
}, "div{color:blue}"));
|
|
888
|
+
}
|
|
889
|
+
"
|
|
890
|
+
`;
|
|
891
|
+
|
|
892
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform issue--317 correctly 1`] = `
|
|
893
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
894
|
+
export const MyComponent = ()=>/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("div", {
|
|
895
|
+
className: "jsx-98442910aac83b4a"
|
|
896
|
+
}), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
897
|
+
id: "98442910aac83b4a"
|
|
898
|
+
}, "div.jsx-98442910aac83b4a{background-image:url(\\"data:image/svg+xml,%3Csvg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 24 24' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'%3E%3Cg%3E%3Cpath fill='none' d='M0 0h24v24H0z'%3E%3C/path%3E%3Cpath d='M17 3h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1h2v2h6V1h2v2zm3 6V5h-3v2h-2V5H9v2H7V5H4v4h16zm0 2H4v8h16v-8zM6 13h5v4H6v-4z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E%0A\\")}"));
|
|
899
|
+
"
|
|
900
|
+
`;
|
|
901
|
+
|
|
902
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform issue-30480 correctly 1`] = `
|
|
903
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
904
|
+
export default (({ breakPoint })=>/*#__PURE__*/ React.createElement("div", {
|
|
905
|
+
className: _JSXStyle.dynamic([
|
|
906
|
+
[
|
|
907
|
+
"5f9d9d6c208bf9e0",
|
|
908
|
+
[
|
|
909
|
+
breakPoint
|
|
910
|
+
]
|
|
911
|
+
]
|
|
912
|
+
])
|
|
913
|
+
}, /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
914
|
+
id: "5f9d9d6c208bf9e0",
|
|
915
|
+
dynamic: [
|
|
916
|
+
breakPoint
|
|
917
|
+
]
|
|
918
|
+
}, \`@media(\${breakPoint}){.test.__jsx-style-dynamic-selector{margin-bottom:1em}}\`)));
|
|
919
|
+
"
|
|
920
|
+
`;
|
|
921
|
+
|
|
922
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform issue-30570 correctly 1`] = `
|
|
923
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
924
|
+
export default function IndexPage() {
|
|
925
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
926
|
+
className: "jsx-6226396a225d1c8b"
|
|
927
|
+
}, /*#__PURE__*/ React.createElement("h1", {
|
|
928
|
+
className: "jsx-6226396a225d1c8b"
|
|
929
|
+
}, "Hello World."), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
930
|
+
id: "6226396a225d1c8b"
|
|
931
|
+
}, "@supports((display:flex)or (display:-webkit-box)or (display:-webkit-flex)or (display:-moz-box)or (display:-ms-flexbox)){h1{color:hotpink}}"));
|
|
932
|
+
}
|
|
933
|
+
"
|
|
934
|
+
`;
|
|
935
|
+
|
|
936
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform issue-31562-interpolation-in-mdea correctly 1`] = `
|
|
937
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
938
|
+
class _class {
|
|
939
|
+
render() {
|
|
940
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
941
|
+
className: _JSXStyle.dynamic([
|
|
942
|
+
[
|
|
943
|
+
"8ef51f7b1531565",
|
|
944
|
+
[
|
|
945
|
+
Typography.base.size.default,
|
|
946
|
+
Typography.base.lineHeight,
|
|
947
|
+
Target.mediumPlus,
|
|
948
|
+
Typography.base.size.mediumPlus,
|
|
949
|
+
Target.largePlus,
|
|
950
|
+
Typography.base.size.largePlus
|
|
951
|
+
]
|
|
952
|
+
]
|
|
953
|
+
])
|
|
954
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
955
|
+
className: _JSXStyle.dynamic([
|
|
956
|
+
[
|
|
957
|
+
"8ef51f7b1531565",
|
|
958
|
+
[
|
|
959
|
+
Typography.base.size.default,
|
|
960
|
+
Typography.base.lineHeight,
|
|
961
|
+
Target.mediumPlus,
|
|
962
|
+
Typography.base.size.mediumPlus,
|
|
963
|
+
Target.largePlus,
|
|
964
|
+
Typography.base.size.largePlus
|
|
965
|
+
]
|
|
966
|
+
]
|
|
967
|
+
])
|
|
968
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
969
|
+
id: "8ef51f7b1531565",
|
|
970
|
+
dynamic: [
|
|
971
|
+
Typography.base.size.default,
|
|
972
|
+
Typography.base.lineHeight,
|
|
973
|
+
Target.mediumPlus,
|
|
974
|
+
Typography.base.size.mediumPlus,
|
|
975
|
+
Target.largePlus,
|
|
976
|
+
Typography.base.size.largePlus
|
|
977
|
+
]
|
|
978
|
+
}, \`html{font-size:\${Typography.base.size.default};line-height:\${Typography.base.lineHeight}}@media \${Target.mediumPlus}{html{font-size:\${Typography.base.size.mediumPlus}}}@media \${Target.largePlus}{html{font-size:\${Typography.base.size.largePlus}}}\`));
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
export { _class as default };
|
|
982
|
+
"
|
|
983
|
+
`;
|
|
984
|
+
|
|
985
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform legacy-nesting correctly 1`] = `
|
|
986
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
987
|
+
export default (()=>/*#__PURE__*/ React.createElement("div", {
|
|
988
|
+
className: "jsx-3b0234e9651851cb"
|
|
989
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
990
|
+
className: "jsx-3b0234e9651851cb"
|
|
991
|
+
}, "test"), /*#__PURE__*/ React.createElement("p", {
|
|
992
|
+
className: "jsx-3b0234e9651851cb"
|
|
993
|
+
}, "woot"), /*#__PURE__*/ React.createElement("p", {
|
|
994
|
+
className: "jsx-3b0234e9651851cb"
|
|
995
|
+
}, "woot"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
996
|
+
id: "3b0234e9651851cb"
|
|
997
|
+
}, ".container.jsx-3b0234e9651851cb{color:blue;padding:3rem}.container.jsx-3b0234e9651851cb .inner.jsx-3b0234e9651851cb{color:yellow}")));
|
|
998
|
+
"
|
|
999
|
+
`;
|
|
1000
|
+
|
|
1001
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform mixed-global-scoped correctly 1`] = `
|
|
1002
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1003
|
+
const Test = ()=>/*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1004
|
+
id: "94239b6d6b42c9b5"
|
|
1005
|
+
}, "p{color:red}");
|
|
1006
|
+
export default (()=>/*#__PURE__*/ React.createElement("div", {
|
|
1007
|
+
className: "jsx-8de09a4a01c37bbf"
|
|
1008
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
1009
|
+
className: "jsx-8de09a4a01c37bbf"
|
|
1010
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1011
|
+
id: "80dff25115d29c0e"
|
|
1012
|
+
}, "body{background:red}"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1013
|
+
id: "94239b6d6b42c9b5"
|
|
1014
|
+
}, "p.jsx-8de09a4a01c37bbf{color:red}")));
|
|
1015
|
+
"
|
|
1016
|
+
`;
|
|
1017
|
+
|
|
1018
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform multiple-jsx correctly 1`] = `
|
|
1019
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1020
|
+
const attrs = {
|
|
1021
|
+
id: "test"
|
|
1022
|
+
};
|
|
1023
|
+
const Test1 = ()=>/*#__PURE__*/ React.createElement("div", {
|
|
1024
|
+
className: "jsx-a9535d7d5f32c3c4"
|
|
1025
|
+
}, /*#__PURE__*/ React.createElement("span", {
|
|
1026
|
+
...attrs,
|
|
1027
|
+
"data-test": "test",
|
|
1028
|
+
className: "jsx-a9535d7d5f32c3c4" + " " + (attrs && attrs.className != null && attrs.className || "")
|
|
1029
|
+
}, "test"), /*#__PURE__*/ React.createElement(Component, null), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1030
|
+
id: "a9535d7d5f32c3c4"
|
|
1031
|
+
}, "span.jsx-a9535d7d5f32c3c4{color:red}"));
|
|
1032
|
+
const Test2 = ()=>/*#__PURE__*/ React.createElement("span", null, "test");
|
|
1033
|
+
const Test3 = ()=>/*#__PURE__*/ React.createElement("div", {
|
|
1034
|
+
className: "jsx-a9535d7d5f32c3c4"
|
|
1035
|
+
}, /*#__PURE__*/ React.createElement("span", {
|
|
1036
|
+
className: "jsx-a9535d7d5f32c3c4"
|
|
1037
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1038
|
+
id: "a9535d7d5f32c3c4"
|
|
1039
|
+
}, "span.jsx-a9535d7d5f32c3c4{color:red}"));
|
|
1040
|
+
class _class {
|
|
1041
|
+
render() {
|
|
1042
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
1043
|
+
className: "jsx-b2b86d63f35d25ee"
|
|
1044
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
1045
|
+
className: "jsx-b2b86d63f35d25ee"
|
|
1046
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1047
|
+
id: "b2b86d63f35d25ee"
|
|
1048
|
+
}, "p.jsx-b2b86d63f35d25ee{color:red}"));
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
export { _class as default };
|
|
1052
|
+
"
|
|
1053
|
+
`;
|
|
1054
|
+
|
|
1055
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform next-54653 correctly 1`] = `
|
|
1056
|
+
"const _defaultExport = new String("@media(max-width:870px){th.expiration-date-cell,td.expiration-date-cell{display:none}}");
|
|
1057
|
+
_defaultExport.__hash = "fd71bf06ba8860bb";
|
|
1058
|
+
export default _defaultExport;
|
|
1059
|
+
"
|
|
1060
|
+
`;
|
|
1061
|
+
|
|
1062
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform next-55679 correctly 1`] = `
|
|
1063
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1064
|
+
import { AppProps } from "next/app";
|
|
1065
|
+
const someVar = "--var-1";
|
|
1066
|
+
export default function App({ Component, pageProps }) {
|
|
1067
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1068
|
+
id: "acc68473fe2ae892"
|
|
1069
|
+
}, \`:root{\${someVar}:red;background-color:var(\${someVar})}\`), /*#__PURE__*/ React.createElement(Component, {
|
|
1070
|
+
...pageProps,
|
|
1071
|
+
className: "jsx-acc68473fe2ae892" + " " + (pageProps && pageProps.className != null && pageProps.className || "")
|
|
1072
|
+
}));
|
|
1073
|
+
}
|
|
1074
|
+
"
|
|
1075
|
+
`;
|
|
1076
|
+
|
|
1077
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform next-61788 correctly 1`] = `
|
|
1078
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1079
|
+
const MOBILE_MAX = 767;
|
|
1080
|
+
export default function Home() {
|
|
1081
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
1082
|
+
className: _JSXStyle.dynamic([
|
|
1083
|
+
[
|
|
1084
|
+
"cd44ce38d77d54f1",
|
|
1085
|
+
[
|
|
1086
|
+
MOBILE_MAX
|
|
1087
|
+
]
|
|
1088
|
+
]
|
|
1089
|
+
])
|
|
1090
|
+
}, /*#__PURE__*/ React.createElement("h1", {
|
|
1091
|
+
className: _JSXStyle.dynamic([
|
|
1092
|
+
[
|
|
1093
|
+
"cd44ce38d77d54f1",
|
|
1094
|
+
[
|
|
1095
|
+
MOBILE_MAX
|
|
1096
|
+
]
|
|
1097
|
+
]
|
|
1098
|
+
]) + " " + "header"
|
|
1099
|
+
}, "Hello"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1100
|
+
id: "cd44ce38d77d54f1",
|
|
1101
|
+
dynamic: [
|
|
1102
|
+
MOBILE_MAX
|
|
1103
|
+
]
|
|
1104
|
+
}, \`.header.__jsx-style-dynamic-selector{font-size:48px}@media screen and (max-width:\${MOBILE_MAX}px){.header.__jsx-style-dynamic-selector{font-size:12px}}\`));
|
|
1105
|
+
}
|
|
1106
|
+
"
|
|
1107
|
+
`;
|
|
1108
|
+
|
|
1109
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform next-64389 correctly 1`] = `
|
|
1110
|
+
""use client";
|
|
1111
|
+
import _JSXStyle from "styled-jsx/style";
|
|
1112
|
+
const color = "color: red;";
|
|
1113
|
+
export default function RootLayout({ children }) {
|
|
1114
|
+
return /*#__PURE__*/ React.createElement("html", {
|
|
1115
|
+
className: "jsx-7813f497af86b7a2"
|
|
1116
|
+
}, /*#__PURE__*/ React.createElement("head", {
|
|
1117
|
+
className: "jsx-7813f497af86b7a2"
|
|
1118
|
+
}), /*#__PURE__*/ React.createElement("body", {
|
|
1119
|
+
className: "jsx-7813f497af86b7a2"
|
|
1120
|
+
}, children), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1121
|
+
id: "7813f497af86b7a2"
|
|
1122
|
+
}, \`body{\${color}}body p{font-size:72px}\`));
|
|
1123
|
+
}
|
|
1124
|
+
"
|
|
1125
|
+
`;
|
|
1126
|
+
|
|
1127
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform non-styled-jsx-style correctly 1`] = `
|
|
1128
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1129
|
+
export default (()=>/*#__PURE__*/ React.createElement("div", {
|
|
1130
|
+
className: "jsx-94239b6d6b42c9b5"
|
|
1131
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
1132
|
+
className: "jsx-94239b6d6b42c9b5"
|
|
1133
|
+
}, "woot"), /*#__PURE__*/ React.createElement("style", {
|
|
1134
|
+
dangerouslySetInnerHTML: {
|
|
1135
|
+
__html: \`body { margin: 0; }\`
|
|
1136
|
+
}
|
|
1137
|
+
}), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1138
|
+
id: "94239b6d6b42c9b5"
|
|
1139
|
+
}, "p.jsx-94239b6d6b42c9b5{color:red}")));
|
|
1140
|
+
"
|
|
1141
|
+
`;
|
|
1142
|
+
|
|
1143
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform not-styled-jsx-tagged-templates correctly 1`] = `
|
|
1144
|
+
"import css from "hell";
|
|
1145
|
+
const color = "red";
|
|
1146
|
+
const bar = css\`
|
|
1147
|
+
div {
|
|
1148
|
+
font-size: 3em;
|
|
1149
|
+
}
|
|
1150
|
+
\`;
|
|
1151
|
+
export const uh = bar;
|
|
1152
|
+
export const foo = css\`
|
|
1153
|
+
div {
|
|
1154
|
+
color: \${color};
|
|
1155
|
+
}
|
|
1156
|
+
\`;
|
|
1157
|
+
export default css\`
|
|
1158
|
+
div {
|
|
1159
|
+
font-size: 3em;
|
|
1160
|
+
}
|
|
1161
|
+
p {
|
|
1162
|
+
color: \${color};
|
|
1163
|
+
}
|
|
1164
|
+
\`;
|
|
1165
|
+
const Title = styled.h1\`
|
|
1166
|
+
color: red;
|
|
1167
|
+
font-size: 50px;
|
|
1168
|
+
\`;
|
|
1169
|
+
const AnotherTitle = Title.extend\`
|
|
1170
|
+
color: blue;
|
|
1171
|
+
\`;
|
|
1172
|
+
export const Component = ()=>/*#__PURE__*/ React.createElement(AnotherTitle, null, "My page");
|
|
1173
|
+
"
|
|
1174
|
+
`;
|
|
1175
|
+
|
|
1176
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform number-after-placeholder correctly 1`] = `
|
|
1177
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1178
|
+
import Link from "next/link";
|
|
1179
|
+
export default function IndexPage() {
|
|
1180
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
1181
|
+
className: "jsx-c52d3257f955c0e4"
|
|
1182
|
+
}, "Hello World.", " ", /*#__PURE__*/ React.createElement(Link, {
|
|
1183
|
+
href: "/about"
|
|
1184
|
+
}, /*#__PURE__*/ React.createElement("a", {
|
|
1185
|
+
className: "jsx-c52d3257f955c0e4"
|
|
1186
|
+
}, "Abound")), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1187
|
+
id: "c52d3257f955c0e4"
|
|
1188
|
+
}, \`a.jsx-c52d3257f955c0e4{color:\${"#abcdef"}12}\`));
|
|
1189
|
+
}
|
|
1190
|
+
"
|
|
1191
|
+
`;
|
|
1192
|
+
|
|
1193
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform one-off-global-selectors correctly 1`] = `
|
|
1194
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1195
|
+
export default (()=>/*#__PURE__*/ React.createElement("div", {
|
|
1196
|
+
className: "jsx-c7c3a8e231c9215a"
|
|
1197
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
1198
|
+
className: "jsx-c7c3a8e231c9215a"
|
|
1199
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1200
|
+
id: "c7c3a8e231c9215a"
|
|
1201
|
+
}, ".container.jsx-c7c3a8e231c9215a>*{color:red}")));
|
|
1202
|
+
"
|
|
1203
|
+
`;
|
|
1204
|
+
|
|
1205
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform pack-2714 correctly 1`] = `
|
|
1206
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1207
|
+
const { className: cardClassName, styles } = {
|
|
1208
|
+
styles: /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1209
|
+
id: "764ef3f9149f0521"
|
|
1210
|
+
}, \`.jsx-764ef3f9149f0521:hover{z-index:\${hoverAnimation ? "1" : "auto"}}\`),
|
|
1211
|
+
className: "jsx-764ef3f9149f0521"
|
|
1212
|
+
};
|
|
1213
|
+
"
|
|
1214
|
+
`;
|
|
1215
|
+
|
|
1216
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform pack-2819 correctly 1`] = `
|
|
1217
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1218
|
+
export default (()=>/*#__PURE__*/ React.createElement("div", {
|
|
1219
|
+
className: "jsx-d3bc3634b8d1b3fb"
|
|
1220
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
1221
|
+
className: "jsx-d3bc3634b8d1b3fb"
|
|
1222
|
+
}, "test"), /*#__PURE__*/ React.createElement("p", {
|
|
1223
|
+
className: "jsx-d3bc3634b8d1b3fb"
|
|
1224
|
+
}, "woot"), /*#__PURE__*/ React.createElement("p", {
|
|
1225
|
+
className: "jsx-d3bc3634b8d1b3fb"
|
|
1226
|
+
}, "woot"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1227
|
+
id: "d3bc3634b8d1b3fb"
|
|
1228
|
+
}, ".container.jsx-d3bc3634b8d1b3fb{color:blue;padding:3rem}.container.jsx-d3bc3634b8d1b3fb.inner.jsx-d3bc3634b8d1b3fb{color:yellow}")));
|
|
1229
|
+
"
|
|
1230
|
+
`;
|
|
1231
|
+
|
|
1232
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform source-maps correctly 1`] = `
|
|
1233
|
+
"// TODO: needs sourcemaps
|
|
1234
|
+
// export default () => (
|
|
1235
|
+
// <div>
|
|
1236
|
+
// <p>test</p>
|
|
1237
|
+
// <p>woot</p>
|
|
1238
|
+
// <style jsx>{'p { color: red }'}</style>
|
|
1239
|
+
// </div>
|
|
1240
|
+
// )
|
|
1241
|
+
"
|
|
1242
|
+
`;
|
|
1243
|
+
|
|
1244
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform stateless correctly 1`] = `
|
|
1245
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1246
|
+
export default (()=>/*#__PURE__*/ React.createElement("div", {
|
|
1247
|
+
className: "jsx-94239b6d6b42c9b5"
|
|
1248
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
1249
|
+
className: "jsx-94239b6d6b42c9b5"
|
|
1250
|
+
}, "test"), /*#__PURE__*/ React.createElement("p", {
|
|
1251
|
+
className: "jsx-94239b6d6b42c9b5"
|
|
1252
|
+
}, "woot"), /*#__PURE__*/ React.createElement("p", {
|
|
1253
|
+
className: "jsx-94239b6d6b42c9b5"
|
|
1254
|
+
}, "woot"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1255
|
+
id: "94239b6d6b42c9b5"
|
|
1256
|
+
}, "p.jsx-94239b6d6b42c9b5{color:red}")));
|
|
1257
|
+
"
|
|
1258
|
+
`;
|
|
1259
|
+
|
|
1260
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform styles correctly 1`] = `
|
|
1261
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1262
|
+
import colors, { size } from "./constants";
|
|
1263
|
+
const color = "red";
|
|
1264
|
+
const bar = new String("div.jsx-aaed0341accea8f{font-size:3em}");
|
|
1265
|
+
bar.__hash = "aaed0341accea8f";
|
|
1266
|
+
const baz = new String("div{font-size:3em}");
|
|
1267
|
+
baz.__hash = "aaed0341accea8f";
|
|
1268
|
+
const a = new String(\`div{font-size:\${size}em}\`);
|
|
1269
|
+
a.__hash = "7c86155cabf5dc29";
|
|
1270
|
+
export const uh = bar;
|
|
1271
|
+
export const foo = new String(\`div.jsx-94c5b10770851b72{color:\${color}}\`);
|
|
1272
|
+
foo.__hash = "94c5b10770851b72";
|
|
1273
|
+
({
|
|
1274
|
+
styles: /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1275
|
+
id: "7cf3236ca7e1da12"
|
|
1276
|
+
}, \`div.jsx-7cf3236ca7e1da12{color:\${colors.green.light}}a.jsx-7cf3236ca7e1da12{color:red}\`),
|
|
1277
|
+
className: "jsx-7cf3236ca7e1da12"
|
|
1278
|
+
});
|
|
1279
|
+
const b = {
|
|
1280
|
+
styles: /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1281
|
+
id: "5b414b974635264"
|
|
1282
|
+
}, \`div.jsx-5b414b974635264{color:\${colors.green.light}}a.jsx-5b414b974635264{color:red}\`),
|
|
1283
|
+
className: "jsx-5b414b974635264"
|
|
1284
|
+
};
|
|
1285
|
+
const dynamic = (colors)=>{
|
|
1286
|
+
const b = {
|
|
1287
|
+
styles: /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1288
|
+
id: "b396cc7974579919",
|
|
1289
|
+
dynamic: [
|
|
1290
|
+
colors.green.light
|
|
1291
|
+
]
|
|
1292
|
+
}, \`div.__jsx-style-dynamic-selector{color:\${colors.green.light}}a.__jsx-style-dynamic-selector{color:red}\`),
|
|
1293
|
+
className: _JSXStyle.dynamic([
|
|
1294
|
+
[
|
|
1295
|
+
"b396cc7974579919",
|
|
1296
|
+
[
|
|
1297
|
+
colors.green.light
|
|
1298
|
+
]
|
|
1299
|
+
]
|
|
1300
|
+
])
|
|
1301
|
+
};
|
|
1302
|
+
};
|
|
1303
|
+
export default {
|
|
1304
|
+
styles: /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1305
|
+
id: "b4488421eff98e80"
|
|
1306
|
+
}, \`div.jsx-b4488421eff98e80{font-size:3em}p.jsx-b4488421eff98e80{color:\${color}}\`),
|
|
1307
|
+
className: "jsx-b4488421eff98e80"
|
|
1308
|
+
};
|
|
1309
|
+
"
|
|
1310
|
+
`;
|
|
1311
|
+
|
|
1312
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform styles-external-invalid correctly 1`] = `
|
|
1313
|
+
"// TODO
|
|
1314
|
+
// import css from 'styled-jsx/css'
|
|
1315
|
+
// const color = 'red'
|
|
1316
|
+
// export const foo = css\`div { color: \${color}}\`
|
|
1317
|
+
// const props = { color: 'red ' }
|
|
1318
|
+
// export default css\`
|
|
1319
|
+
// div { font-size: 3em; color: \${props.color} }
|
|
1320
|
+
// p { color: \${this.props.color};}
|
|
1321
|
+
// \`
|
|
1322
|
+
"
|
|
1323
|
+
`;
|
|
1324
|
+
|
|
1325
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform styles-external-invalid2 correctly 1`] = `
|
|
1326
|
+
"// TODO
|
|
1327
|
+
// import css from 'styled-jsx/css'
|
|
1328
|
+
// const color = 'red'
|
|
1329
|
+
// export const foo = css\`div { color: \${color}}\`
|
|
1330
|
+
// export default css\`
|
|
1331
|
+
// div { font-size: 3em }
|
|
1332
|
+
// p { color: \${props.color};}
|
|
1333
|
+
// \`
|
|
1334
|
+
"
|
|
1335
|
+
`;
|
|
1336
|
+
|
|
1337
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform styles2 correctly 1`] = `
|
|
1338
|
+
"// TODO: support common js
|
|
1339
|
+
// import css from 'styled-jsx/css'
|
|
1340
|
+
// module.exports = css\`
|
|
1341
|
+
// div { font-size: 3em }
|
|
1342
|
+
// \`
|
|
1343
|
+
"
|
|
1344
|
+
`;
|
|
1345
|
+
|
|
1346
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform too-many correctly 1`] = `
|
|
1347
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1348
|
+
export const Red = ({ Component = "button" })=>{
|
|
1349
|
+
return /*#__PURE__*/ React.createElement(Component, {
|
|
1350
|
+
className: _JSXStyle.dynamic([
|
|
1351
|
+
[
|
|
1352
|
+
"5a2b0b6f23b33f9",
|
|
1353
|
+
[
|
|
1354
|
+
e1,
|
|
1355
|
+
e2,
|
|
1356
|
+
e3,
|
|
1357
|
+
e4,
|
|
1358
|
+
e5,
|
|
1359
|
+
e6,
|
|
1360
|
+
e7,
|
|
1361
|
+
e8,
|
|
1362
|
+
e9,
|
|
1363
|
+
e10,
|
|
1364
|
+
e11,
|
|
1365
|
+
e12,
|
|
1366
|
+
e13,
|
|
1367
|
+
e14,
|
|
1368
|
+
e15
|
|
1369
|
+
]
|
|
1370
|
+
]
|
|
1371
|
+
])
|
|
1372
|
+
}, /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1373
|
+
id: "5a2b0b6f23b33f9",
|
|
1374
|
+
dynamic: [
|
|
1375
|
+
e1,
|
|
1376
|
+
e2,
|
|
1377
|
+
e3,
|
|
1378
|
+
e4,
|
|
1379
|
+
e5,
|
|
1380
|
+
e6,
|
|
1381
|
+
e7,
|
|
1382
|
+
e8,
|
|
1383
|
+
e9,
|
|
1384
|
+
e10,
|
|
1385
|
+
e11,
|
|
1386
|
+
e12,
|
|
1387
|
+
e13,
|
|
1388
|
+
e14,
|
|
1389
|
+
e15
|
|
1390
|
+
]
|
|
1391
|
+
}, \`.button.__jsx-style-dynamic-selector{--button-1:\${e1};--button-2:\${e2};--button-3:\${e3};--button-4:\${e4};--button-5:\${e5};--button-6:\${e6};--button-7:\${e7};--button-8:\${e8};--button-9:\${e9};--button-10:\${e10};--button-11:\${e11};--button-12:\${e12};--button-13:\${e13};--button-14:\${e14};--button-15:\${e15}}\`));
|
|
1392
|
+
};
|
|
1393
|
+
"
|
|
1394
|
+
`;
|
|
1395
|
+
|
|
1396
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform tpl-escape-1 correctly 1`] = `
|
|
1397
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1398
|
+
class _class {
|
|
1399
|
+
render() {
|
|
1400
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
1401
|
+
className: "jsx-71816f8e3c42a736"
|
|
1402
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
1403
|
+
className: "jsx-71816f8e3c42a736"
|
|
1404
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1405
|
+
id: "71816f8e3c42a736"
|
|
1406
|
+
}, 'p.jsx-71816f8e3c42a736{content:"\`"}'));
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
export { _class as default };
|
|
1410
|
+
"
|
|
1411
|
+
`;
|
|
1412
|
+
|
|
1413
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform tpl-escape-2 correctly 1`] = `
|
|
1414
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1415
|
+
export default function Home({ fontFamily }) {
|
|
1416
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
1417
|
+
className: _JSXStyle.dynamic([
|
|
1418
|
+
[
|
|
1419
|
+
"d3142704be9609d2",
|
|
1420
|
+
[
|
|
1421
|
+
fontFamily
|
|
1422
|
+
]
|
|
1423
|
+
]
|
|
1424
|
+
])
|
|
1425
|
+
}, /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1426
|
+
id: "d3142704be9609d2",
|
|
1427
|
+
dynamic: [
|
|
1428
|
+
fontFamily
|
|
1429
|
+
]
|
|
1430
|
+
}, \`body{font-family:\${fontFamily}}code:before,code:after{content:"\\\`"}\`));
|
|
1431
|
+
}
|
|
1432
|
+
"
|
|
1433
|
+
`;
|
|
1434
|
+
|
|
1435
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform tpl-placeholder-1-as-property correctly 1`] = `
|
|
1436
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1437
|
+
class _class {
|
|
1438
|
+
render() {
|
|
1439
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
1440
|
+
className: _JSXStyle.dynamic([
|
|
1441
|
+
[
|
|
1442
|
+
"f9aa00e7cff3b4b",
|
|
1443
|
+
[
|
|
1444
|
+
inputSize ? "height: calc(2 * var(--a)) !important;" : ""
|
|
1445
|
+
]
|
|
1446
|
+
]
|
|
1447
|
+
])
|
|
1448
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
1449
|
+
className: _JSXStyle.dynamic([
|
|
1450
|
+
[
|
|
1451
|
+
"f9aa00e7cff3b4b",
|
|
1452
|
+
[
|
|
1453
|
+
inputSize ? "height: calc(2 * var(--a)) !important;" : ""
|
|
1454
|
+
]
|
|
1455
|
+
]
|
|
1456
|
+
])
|
|
1457
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1458
|
+
id: "f9aa00e7cff3b4b",
|
|
1459
|
+
dynamic: [
|
|
1460
|
+
inputSize ? "height: calc(2 * var(--a)) !important;" : ""
|
|
1461
|
+
]
|
|
1462
|
+
}, \`@media only screen{a.__jsx-style-dynamic-selector{\${inputSize ? "height: calc(2 * var(--a)) !important;" : ""}}}\`));
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
export { _class as default };
|
|
1466
|
+
"
|
|
1467
|
+
`;
|
|
1468
|
+
|
|
1469
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform tpl-placeholder-2-as-part-of-value correctly 1`] = `
|
|
1470
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1471
|
+
class _class {
|
|
1472
|
+
render() {
|
|
1473
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
1474
|
+
className: _JSXStyle.dynamic([
|
|
1475
|
+
[
|
|
1476
|
+
"c78f5a8771ac2a3b",
|
|
1477
|
+
[
|
|
1478
|
+
a[b],
|
|
1479
|
+
-1 * (c || 0),
|
|
1480
|
+
d
|
|
1481
|
+
]
|
|
1482
|
+
]
|
|
1483
|
+
])
|
|
1484
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
1485
|
+
className: _JSXStyle.dynamic([
|
|
1486
|
+
[
|
|
1487
|
+
"c78f5a8771ac2a3b",
|
|
1488
|
+
[
|
|
1489
|
+
a[b],
|
|
1490
|
+
-1 * (c || 0),
|
|
1491
|
+
d
|
|
1492
|
+
]
|
|
1493
|
+
]
|
|
1494
|
+
])
|
|
1495
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1496
|
+
id: "c78f5a8771ac2a3b",
|
|
1497
|
+
dynamic: [
|
|
1498
|
+
a[b],
|
|
1499
|
+
-1 * (c || 0),
|
|
1500
|
+
d
|
|
1501
|
+
]
|
|
1502
|
+
}, \`.a:hover .b.__jsx-style-dynamic-selector{a:\${a[b]}px!important;b:translate3d(0,\${-1 * (c || 0)}px,-\${d}px)scale(1)!important}\`));
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
export { _class as default };
|
|
1506
|
+
"
|
|
1507
|
+
`;
|
|
1508
|
+
|
|
1509
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform tpl-placeholder-3-as-value correctly 1`] = `
|
|
1510
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1511
|
+
class _class {
|
|
1512
|
+
render() {
|
|
1513
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
1514
|
+
className: _JSXStyle.dynamic([
|
|
1515
|
+
[
|
|
1516
|
+
"eee2d2bddf546a68",
|
|
1517
|
+
[
|
|
1518
|
+
a
|
|
1519
|
+
]
|
|
1520
|
+
]
|
|
1521
|
+
])
|
|
1522
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
1523
|
+
className: _JSXStyle.dynamic([
|
|
1524
|
+
[
|
|
1525
|
+
"eee2d2bddf546a68",
|
|
1526
|
+
[
|
|
1527
|
+
a
|
|
1528
|
+
]
|
|
1529
|
+
]
|
|
1530
|
+
])
|
|
1531
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1532
|
+
id: "eee2d2bddf546a68",
|
|
1533
|
+
dynamic: [
|
|
1534
|
+
a
|
|
1535
|
+
]
|
|
1536
|
+
}, \`@media only screen{a.__jsx-style-dynamic-selector{color:\${a}}}\`));
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
export { _class as default };
|
|
1540
|
+
"
|
|
1541
|
+
`;
|
|
1542
|
+
|
|
1543
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform tpl-placeholder-4-as-part-of-value-in-multiple correctly 1`] = `
|
|
1544
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1545
|
+
class _class {
|
|
1546
|
+
render() {
|
|
1547
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
1548
|
+
className: _JSXStyle.dynamic([
|
|
1549
|
+
[
|
|
1550
|
+
"78e5427773a40a7d",
|
|
1551
|
+
[
|
|
1552
|
+
a || "var(--c)",
|
|
1553
|
+
b || "inherit"
|
|
1554
|
+
]
|
|
1555
|
+
]
|
|
1556
|
+
])
|
|
1557
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
1558
|
+
className: _JSXStyle.dynamic([
|
|
1559
|
+
[
|
|
1560
|
+
"78e5427773a40a7d",
|
|
1561
|
+
[
|
|
1562
|
+
a || "var(--c)",
|
|
1563
|
+
b || "inherit"
|
|
1564
|
+
]
|
|
1565
|
+
]
|
|
1566
|
+
])
|
|
1567
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1568
|
+
id: "78e5427773a40a7d",
|
|
1569
|
+
dynamic: [
|
|
1570
|
+
a || "var(--c)",
|
|
1571
|
+
b || "inherit"
|
|
1572
|
+
]
|
|
1573
|
+
}, \`.a:hover .b.__jsx-style-dynamic-selector{display:inline-block;padding:0 \${a || "var(--c)"};color:\${b || "inherit"}}\`));
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
export { _class as default };
|
|
1577
|
+
"
|
|
1578
|
+
`;
|
|
1579
|
+
|
|
1580
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform tpl-placeholder-5-values-of-multiple-properties correctly 1`] = `
|
|
1581
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1582
|
+
class _class {
|
|
1583
|
+
render() {
|
|
1584
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
1585
|
+
className: _JSXStyle.dynamic([
|
|
1586
|
+
[
|
|
1587
|
+
"37d42e5b6f9d65f8",
|
|
1588
|
+
[
|
|
1589
|
+
a ? "100%" : "200px",
|
|
1590
|
+
b ? "0" : "8px 20px"
|
|
1591
|
+
]
|
|
1592
|
+
]
|
|
1593
|
+
])
|
|
1594
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
1595
|
+
className: _JSXStyle.dynamic([
|
|
1596
|
+
[
|
|
1597
|
+
"37d42e5b6f9d65f8",
|
|
1598
|
+
[
|
|
1599
|
+
a ? "100%" : "200px",
|
|
1600
|
+
b ? "0" : "8px 20px"
|
|
1601
|
+
]
|
|
1602
|
+
]
|
|
1603
|
+
])
|
|
1604
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1605
|
+
id: "37d42e5b6f9d65f8",
|
|
1606
|
+
dynamic: [
|
|
1607
|
+
a ? "100%" : "200px",
|
|
1608
|
+
b ? "0" : "8px 20px"
|
|
1609
|
+
]
|
|
1610
|
+
}, \`.item.__jsx-style-dynamic-selector{max-width:\${a ? "100%" : "200px"};padding:\${b ? "0" : "8px 20px"}}\`));
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
export { _class as default };
|
|
1614
|
+
"
|
|
1615
|
+
`;
|
|
1616
|
+
|
|
1617
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform transform-css correctly 1`] = `
|
|
1618
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1619
|
+
export default (()=>/*#__PURE__*/ React.createElement("div", {
|
|
1620
|
+
className: "jsx-374655937fd2de40"
|
|
1621
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
1622
|
+
className: "jsx-374655937fd2de40"
|
|
1623
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1624
|
+
id: "374655937fd2de40"
|
|
1625
|
+
}, 'html.jsx-374655937fd2de40{background-image:-webkit-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:-moz-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:-o-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:linear-gradient(0deg,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg)}p{color:#001}p{color:#002}p,a.jsx-374655937fd2de40{color:#003}.foo+a{color:#004}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif}p.jsx-374655937fd2de40{color:#005}p.jsx-374655937fd2de40{color:#006}*.jsx-374655937fd2de40{color:#007}[href="woot"].jsx-374655937fd2de40{color:#008}p.jsx-374655937fd2de40 a.jsx-374655937fd2de40 span.jsx-374655937fd2de40{color:#009}p.jsx-374655937fd2de40 span{background:#00a}p.jsx-374655937fd2de40 a[title="\\'w \\' \\' t\\'"].jsx-374655937fd2de40{margin:auto}p.jsx-374655937fd2de40 span:not(.test){color:#00b}p.jsx-374655937fd2de40,h1.jsx-374655937fd2de40{color:#00c;-webkit-animation:hahaha 3s ease forwards infinite;-moz-animation:hahaha 3s ease forwards infinite;-o-animation:hahaha 3s ease forwards infinite;animation:hahaha 3s ease forwards infinite;-webkit-animation-name:hahaha;-moz-animation-name:hahaha;-o-animation-name:hahaha;animation-name:hahaha;-webkit-animation-delay:100ms;-moz-animation-delay:100ms;-o-animation-delay:100ms;animation-delay:100ms}p.jsx-374655937fd2de40{-webkit-animation:hahaha 1s,hehehe 2s;-moz-animation:hahaha 1s,hehehe 2s;-o-animation:hahaha 1s,hehehe 2s;animation:hahaha 1s,hehehe 2s}p.jsx-374655937fd2de40:hover{color:#00d}p.jsx-374655937fd2de40::before{color:#00e}.jsx-374655937fd2de40:hover{color:#00f}.jsx-374655937fd2de40::before{color:#010}.jsx-374655937fd2de40:hover p.jsx-374655937fd2de40{color:#011}p.jsx-374655937fd2de40+a.jsx-374655937fd2de40{color:#012}p.jsx-374655937fd2de40~a.jsx-374655937fd2de40{color:#013}p.jsx-374655937fd2de40>a.jsx-374655937fd2de40{color:#014}@-webkit-keyframes hahaha{from{top:0}to{top:100}}@-moz-keyframes hahaha{from{top:0}to{top:100}}@-o-keyframes hahaha{from{top:0}to{top:100}}@keyframes hahaha{from{top:0}to{top:100}}@-webkit-keyframes hehehe{from{left:0}to{left:100}}@-moz-keyframes hehehe{from{left:0}to{left:100}}@-o-keyframes hehehe{from{left:0}to{left:100}}@keyframes hehehe{from{left:0}to{left:100}}@media(min-width:500px){.test.jsx-374655937fd2de40{color:#015}}.test.jsx-374655937fd2de40{display:block}.inline-flex.jsx-374655937fd2de40{display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-ms-inline-flexbox;display:inline-flex}.flex.jsx-374655937fd2de40{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.test.jsx-374655937fd2de40{-webkit-box-shadow:0 0 10px black,inset 0 0 5px black;-moz-box-shadow:0 0 10px black,inset 0 0 5px black;box-shadow:0 0 10px black,inset 0 0 5px black}.test[title=","].jsx-374655937fd2de40{display:inline-block}.test.is-status.jsx-374655937fd2de40 .test.jsx-374655937fd2de40{color:#016}.a-selector.jsx-374655937fd2de40:hover,.a-selector.jsx-374655937fd2de40:focus{outline:none}@media(min-width:1px)and (max-width:768px){[class*="grid__col--"].jsx-374655937fd2de40{margin-top:12px;margin-bottom:12px}}@media(max-width:64em){.test.jsx-374655937fd2de40{margin-bottom:1em}@supports(-moz-appearance:none)and (display:contents){.test.jsx-374655937fd2de40{margin-bottom:2rem}}}')));
|
|
1626
|
+
"
|
|
1627
|
+
`;
|
|
1628
|
+
|
|
1629
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform transform-css-complex-selector correctly 1`] = `
|
|
1630
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1631
|
+
export default (()=>/*#__PURE__*/ React.createElement("div", {
|
|
1632
|
+
className: "jsx-2e0b2fdc9a904355"
|
|
1633
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
1634
|
+
className: "jsx-2e0b2fdc9a904355"
|
|
1635
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1636
|
+
id: "2e0b2fdc9a904355"
|
|
1637
|
+
}, "p.jsx-2e0b2fdc9a904355 a.jsx-2e0b2fdc9a904355 span.jsx-2e0b2fdc9a904355{color:red}p.jsx-2e0b2fdc9a904355 span{background:blue}p.jsx-2e0b2fdc9a904355 a[title=\\"'w ' ' t'\\"].jsx-2e0b2fdc9a904355{margin:auto}p.jsx-2e0b2fdc9a904355 span:not(.test){color:green}p.jsx-2e0b2fdc9a904355,h1.jsx-2e0b2fdc9a904355{color:blue;-webkit-animation:hahaha 3s ease forwards infinite;-moz-animation:hahaha 3s ease forwards infinite;-o-animation:hahaha 3s ease forwards infinite;animation:hahaha 3s ease forwards infinite;-webkit-animation-name:hahaha;-moz-animation-name:hahaha;-o-animation-name:hahaha;animation-name:hahaha;-webkit-animation-delay:100ms;-moz-animation-delay:100ms;-o-animation-delay:100ms;animation-delay:100ms}p.jsx-2e0b2fdc9a904355{-webkit-animation:hahaha 1s,hehehe 2s;-moz-animation:hahaha 1s,hehehe 2s;-o-animation:hahaha 1s,hehehe 2s;animation:hahaha 1s,hehehe 2s}p.jsx-2e0b2fdc9a904355:hover{color:red}p.jsx-2e0b2fdc9a904355::before{color:red}.jsx-2e0b2fdc9a904355:hover{color:red}.jsx-2e0b2fdc9a904355::before{color:red}.jsx-2e0b2fdc9a904355:hover p.jsx-2e0b2fdc9a904355{color:red}p.jsx-2e0b2fdc9a904355+a.jsx-2e0b2fdc9a904355{color:red}p.jsx-2e0b2fdc9a904355~a.jsx-2e0b2fdc9a904355{color:red}p.jsx-2e0b2fdc9a904355>a.jsx-2e0b2fdc9a904355{color:red}@-webkit-keyframes hahaha{from{top:0}to{top:100}}@-moz-keyframes hahaha{from{top:0}to{top:100}}@-o-keyframes hahaha{from{top:0}to{top:100}}@keyframes hahaha{from{top:0}to{top:100}}@-webkit-keyframes hehehe{from{left:0}to{left:100}}@-moz-keyframes hehehe{from{left:0}to{left:100}}@-o-keyframes hehehe{from{left:0}to{left:100}}@keyframes hehehe{from{left:0}to{left:100}}@media(min-width:500px){.test.jsx-2e0b2fdc9a904355{color:red}}.test.jsx-2e0b2fdc9a904355{display:block}.inline-flex.jsx-2e0b2fdc9a904355{display:-webkit-inline-box;display:-webkit-inline-flex;display:-moz-inline-box;display:-ms-inline-flexbox;display:inline-flex}.flex.jsx-2e0b2fdc9a904355{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}.test.jsx-2e0b2fdc9a904355{-webkit-box-shadow:0 0 10px black,inset 0 0 5px black;-moz-box-shadow:0 0 10px black,inset 0 0 5px black;box-shadow:0 0 10px black,inset 0 0 5px black}.test[title=\\",\\"].jsx-2e0b2fdc9a904355{display:inline-block}.test.is-status.jsx-2e0b2fdc9a904355 .test.jsx-2e0b2fdc9a904355{color:red}.a-selector.jsx-2e0b2fdc9a904355:hover,.a-selector.jsx-2e0b2fdc9a904355:focus{outline:none}")));
|
|
1638
|
+
"
|
|
1639
|
+
`;
|
|
1640
|
+
|
|
1641
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform transform-css-complex-selector-2 correctly 1`] = `
|
|
1642
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1643
|
+
export default (()=>/*#__PURE__*/ React.createElement("div", {
|
|
1644
|
+
className: "jsx-f12d8626937fd2c6"
|
|
1645
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
1646
|
+
className: "jsx-f12d8626937fd2c6"
|
|
1647
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1648
|
+
id: "f12d8626937fd2c6"
|
|
1649
|
+
}, ".a-selector.jsx-f12d8626937fd2c6:hover,.a-selector.jsx-f12d8626937fd2c6:focus{outline:none}")));
|
|
1650
|
+
"
|
|
1651
|
+
`;
|
|
1652
|
+
|
|
1653
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform transform-css-global correctly 1`] = `
|
|
1654
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1655
|
+
export default (()=>/*#__PURE__*/ React.createElement("div", {
|
|
1656
|
+
className: "jsx-13e06bb770708a4c"
|
|
1657
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
1658
|
+
className: "jsx-13e06bb770708a4c"
|
|
1659
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1660
|
+
id: "13e06bb770708a4c"
|
|
1661
|
+
}, 'html.jsx-13e06bb770708a4c{background-image:-webkit-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:-moz-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:-o-linear-gradient(bottom,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg);background-image:linear-gradient(0deg,rgba(255,255,255,.8),rgba(255,255,255,.8)),url(/static/background.svg)}p{color:#001}h1{color:#002}h2,a.jsx-13e06bb770708a4c{color:#003}.foo+a{color:#004}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif}')));
|
|
1662
|
+
"
|
|
1663
|
+
`;
|
|
1664
|
+
|
|
1665
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform transform-css-media-query correctly 1`] = `
|
|
1666
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1667
|
+
export default (()=>/*#__PURE__*/ React.createElement("div", {
|
|
1668
|
+
className: "jsx-ec1bf2b940b30dc"
|
|
1669
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
1670
|
+
className: "jsx-ec1bf2b940b30dc"
|
|
1671
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1672
|
+
id: "ec1bf2b940b30dc"
|
|
1673
|
+
}, '@media(min-width:1px)and (max-width:768px){[class*="grid__col--"].jsx-ec1bf2b940b30dc{margin-top:12px;margin-bottom:12px}}@media(max-width:64em){.test.jsx-ec1bf2b940b30dc{margin-bottom:1em}@supports(-moz-appearance:none)and (display:contents){.test.jsx-ec1bf2b940b30dc{margin-bottom:2rem}}}')));
|
|
1674
|
+
"
|
|
1675
|
+
`;
|
|
1676
|
+
|
|
1677
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform transform-css-normal correctly 1`] = `
|
|
1678
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1679
|
+
export default (()=>/*#__PURE__*/ React.createElement("div", {
|
|
1680
|
+
className: "jsx-292192d0348369b"
|
|
1681
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
1682
|
+
className: "jsx-292192d0348369b"
|
|
1683
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1684
|
+
id: "292192d0348369b"
|
|
1685
|
+
}, 'p.jsx-292192d0348369b{color:red}p.jsx-292192d0348369b{color:red}*.jsx-292192d0348369b{color:blue}[href="woot"].jsx-292192d0348369b{color:red}')));
|
|
1686
|
+
"
|
|
1687
|
+
`;
|
|
1688
|
+
|
|
1689
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform transform-css-nth-1 correctly 1`] = `
|
|
1690
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1691
|
+
export default (()=>/*#__PURE__*/ React.createElement("div", {
|
|
1692
|
+
className: "jsx-d8153edfc80ef241"
|
|
1693
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
1694
|
+
className: "jsx-d8153edfc80ef241"
|
|
1695
|
+
}, "test"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1696
|
+
id: "d8153edfc80ef241"
|
|
1697
|
+
}, "li.jsx-d8153edfc80ef241:nth-child(2){color:lime}")));
|
|
1698
|
+
"
|
|
1699
|
+
`;
|
|
1700
|
+
|
|
1701
|
+
exports[`Should load swc-confidential wasm plugin correctly > Should transform whitespace correctly 1`] = `
|
|
1702
|
+
"import _JSXStyle from "styled-jsx/style";
|
|
1703
|
+
export default (()=>/*#__PURE__*/ React.createElement("div", {
|
|
1704
|
+
className: "jsx-94239b6d6b42c9b5"
|
|
1705
|
+
}, /*#__PURE__*/ React.createElement("p", {
|
|
1706
|
+
className: "jsx-94239b6d6b42c9b5"
|
|
1707
|
+
}, "test"), /*#__PURE__*/ React.createElement("p", {
|
|
1708
|
+
className: "jsx-94239b6d6b42c9b5"
|
|
1709
|
+
}, "woot"), /*#__PURE__*/ React.createElement("p", {
|
|
1710
|
+
className: "jsx-94239b6d6b42c9b5"
|
|
1711
|
+
}, "woot"), /*#__PURE__*/ React.createElement(_JSXStyle, {
|
|
1712
|
+
id: "94239b6d6b42c9b5"
|
|
1713
|
+
}, "p.jsx-94239b6d6b42c9b5{color:red}")));
|
|
1714
|
+
"
|
|
1715
|
+
`;
|