-
Notifications
You must be signed in to change notification settings - Fork 326
/
Copy pathindex-test.js.snap
225 lines (212 loc) · 7.88 KB
/
index-test.js.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`esbuild-plugin-stylex extracts and bundles CSS without inject calls, bundles JS 1`] = `
""use strict";
(() => {
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
}) : x)(function(x) {
if (typeof require !== "undefined")
return require.apply(this, arguments);
throw Error('Dynamic require of "' + x + '" is not supported');
});
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// __tests__/__fixtures__/index.js
var import_stylex3 = __toESM(__require("@stylexjs/stylex"), 1);
// __tests__/__fixtures__/fooStyles.js
var import_stylex = __toESM(__require("@stylexjs/stylex"), 1);
var fooStyles_default = {
foo: {
display: "xt0psk2",
width: "xh8yej3",
$$css: true
}
};
// __tests__/__fixtures__/bazStyles.js
var import_stylex2 = __toESM(__require("@stylexjs/stylex"), 1);
var bazStyles_default = {
baz: {
display: "x1lliihq",
height: "xnsd7bc",
width: "x3hqpx7",
$$css: true
}
};
// __tests__/__fixtures__/index.js
var styles = {
bar: {
animationName: "x127lhb5",
display: "x78zum5",
marginLeft: "x16ydxro",
marginInlineStart: null,
marginInlineEnd: null,
height: "x1xa6b72",
backgroundColor: "xrkmrrc x1r3o6fz",
$$css: true
}
};
function App() {
return import_stylex3.default.props(fooStyles_default.foo, styles.bar, bazStyles_default.baz);
}
})();
"
`;
exports[`esbuild-plugin-stylex extracts and bundles CSS without inject calls, bundles JS 2`] = `
"
@layer priority1, priority2, priority3;
@layer priority1{
@keyframes xekv6nw-B{0%{opacity:0;}100%{opacity:1;}}
}
@layer priority2{
.x127lhb5{animation-name:xekv6nw-B}
.xrkmrrc{background-color:red}
.x1lliihq{display:block}
.x78zum5{display:flex}
.xt0psk2{display:inline}
.x1r3o6fz:hover{background-color:pink}
}
@layer priority3{
.x1xa6b72{height:700px}
.xnsd7bc{height:900px}
.x16ydxro{margin-left:10px}
.xh8yej3{width:100%}
.x3hqpx7{width:50%}
}"
`;
exports[`esbuild-plugin-stylex extracts and bundles CSS without inject calls, bundles and transforms TS 1`] = `
""use strict";
(() => {
// __tests__/__fixtures__/index.ts
function App() {
return {
className: "xlu94hl xgbg9yd"
};
}
})();
"
`;
exports[`esbuild-plugin-stylex extracts and bundles CSS without inject calls, bundles and transforms TS 2`] = `
"
@layer priority1, priority2;
@layer priority1{
:root, .xokpgiz{--x1b96qz0:white;--x1cpylmt:pink;--xr6c0rs:green;}
}
@layer priority2{
.xlu94hl{background-color:var(--x1b96qz0)}
.xfpfjxz{color:var(--x1cpylmt)}
.xgbg9yd{color:var(--xr6c0rs)}
}"
`;
exports[`esbuild-plugin-stylex preserves stylex.inject calls and does not extract CSS in development mode 1`] = `
""use strict";
(() => {
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
}) : x)(function(x) {
if (typeof require !== "undefined")
return require.apply(this, arguments);
throw Error('Dynamic require of "' + x + '" is not supported');
});
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// __tests__/__fixtures__/index.js
var import_stylex_inject3 = __toESM(__require("@stylexjs/stylex/lib/stylex-inject"), 1);
var import_stylex3 = __toESM(__require("@stylexjs/stylex"), 1);
// __tests__/__fixtures__/fooStyles.js
var import_stylex_inject = __toESM(__require("@stylexjs/stylex/lib/stylex-inject"), 1);
var import_stylex = __toESM(__require("@stylexjs/stylex"), 1);
var _inject2 = import_stylex_inject.default;
_inject2(".display-xt0psk2{display:inline}", 3e3);
_inject2(".width-xh8yej3{width:100%}", 4e3);
var fooStyles_default = {
foo: {
fooStyles__foo: "fooStyles__foo",
display: "display-xt0psk2",
width: "width-xh8yej3",
$$css: true
}
};
// __tests__/__fixtures__/bazStyles.js
var import_stylex_inject2 = __toESM(__require("@stylexjs/stylex/lib/stylex-inject"), 1);
var import_stylex2 = __toESM(__require("@stylexjs/stylex"), 1);
var _inject22 = import_stylex_inject2.default;
_inject22(".display-x1lliihq{display:block}", 3e3);
_inject22(".height-xnsd7bc{height:900px}", 4e3);
_inject22(".width-x3hqpx7{width:50%}", 4e3);
var bazStyles_default = {
baz: {
bazStyles__baz: "bazStyles__baz",
display: "display-x1lliihq",
height: "height-xnsd7bc",
width: "width-x3hqpx7",
$$css: true
}
};
// __tests__/__fixtures__/index.js
var _inject23 = import_stylex_inject3.default;
_inject23("@keyframes xekv6nw-B{0%{opacity:0;}100%{opacity:1;}}", 1);
_inject23(".animationName-x127lhb5{animation-name:xekv6nw-B}", 3e3);
_inject23(".display-x78zum5{display:flex}", 3e3);
_inject23(".marginLeft-x16ydxro{margin-left:10px}", 4e3);
_inject23(".height-x1xa6b72{height:700px}", 4e3);
_inject23(".backgroundColor-xrkmrrc{background-color:red}", 3e3);
_inject23(".backgroundColor-x1r3o6fz:hover{background-color:pink}", 3130);
var styles = {
bar: {
"index__styles.bar": "index__styles.bar",
animationName: "animationName-x127lhb5",
display: "display-x78zum5",
marginLeft: "marginLeft-x16ydxro",
marginInlineStart: null,
marginInlineEnd: null,
height: "height-x1xa6b72",
backgroundColor: "backgroundColor-xrkmrrc backgroundColor-x1r3o6fz",
$$css: true
}
};
function App() {
return import_stylex3.default.props(fooStyles_default.foo, styles.bar, bazStyles_default.baz);
}
})();
"
`;