@stylexjs/shared 0.12.0 → 0.17.0
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/lib/index.d.ts +10 -36
- package/lib/index.js +8 -25
- package/lib/index.js.flow +10 -43
- package/lib/utils/property-priorities.d.ts +4 -0
- package/lib/utils/property-priorities.js +54 -8
- package/lib/utils/property-priorities.js.flow +8 -0
- package/package.json +5 -21
- package/README.md +0 -81
- package/lib/common-types.d.ts +0 -50
- package/lib/common-types.js +0 -1
- package/lib/common-types.js.flow +0 -63
- package/lib/convert-to-className.d.ts +0 -20
- package/lib/convert-to-className.js +0 -66
- package/lib/convert-to-className.js.flow +0 -27
- package/lib/generate-css-rule.d.ts +0 -17
- package/lib/generate-css-rule.js +0 -25
- package/lib/generate-css-rule.js.flow +0 -17
- package/lib/hash.d.ts +0 -12
- package/lib/hash.js +0 -50
- package/lib/hash.js.flow +0 -12
- package/lib/messages.d.ts +0 -42
- package/lib/messages.js +0 -39
- package/lib/messages.js.flow +0 -45
- package/lib/physical-rtl/generate-ltr.d.ts +0 -13
- package/lib/physical-rtl/generate-ltr.js +0 -103
- package/lib/physical-rtl/generate-ltr.js.flow +0 -12
- package/lib/physical-rtl/generate-rtl.d.ts +0 -13
- package/lib/physical-rtl/generate-rtl.js +0 -177
- package/lib/physical-rtl/generate-rtl.js.flow +0 -12
- package/lib/preprocess-rules/PreRule.d.ts +0 -50
- package/lib/preprocess-rules/PreRule.js +0 -76
- package/lib/preprocess-rules/PreRule.js.flow +0 -62
- package/lib/preprocess-rules/application-order.d.ts +0 -183
- package/lib/preprocess-rules/application-order.js +0 -186
- package/lib/preprocess-rules/application-order.js.flow +0 -134
- package/lib/preprocess-rules/basic-validation.d.ts +0 -13
- package/lib/preprocess-rules/basic-validation.js +0 -73
- package/lib/preprocess-rules/basic-validation.js.flow +0 -13
- package/lib/preprocess-rules/flatten-raw-style-obj.d.ts +0 -20
- package/lib/preprocess-rules/flatten-raw-style-obj.js +0 -98
- package/lib/preprocess-rules/flatten-raw-style-obj.js.flow +0 -23
- package/lib/preprocess-rules/index.d.ts +0 -18
- package/lib/preprocess-rules/index.js +0 -33
- package/lib/preprocess-rules/index.js.flow +0 -22
- package/lib/preprocess-rules/legacy-expand-shorthands.d.ts +0 -165
- package/lib/preprocess-rules/legacy-expand-shorthands.js +0 -147
- package/lib/preprocess-rules/legacy-expand-shorthands.js.flow +0 -144
- package/lib/preprocess-rules/property-specificity.d.ts +0 -78
- package/lib/preprocess-rules/property-specificity.js +0 -107
- package/lib/preprocess-rules/property-specificity.js.flow +0 -87
- package/lib/stylex-consts-utils.d.ts +0 -11
- package/lib/stylex-consts-utils.js +0 -1
- package/lib/stylex-consts-utils.js.flow +0 -14
- package/lib/stylex-create-theme.d.ts +0 -26
- package/lib/stylex-create-theme.js +0 -58
- package/lib/stylex-create-theme.js.flow +0 -19
- package/lib/stylex-create.d.ts +0 -27
- package/lib/stylex-create.js +0 -64
- package/lib/stylex-create.js.flow +0 -37
- package/lib/stylex-define-consts.d.ts +0 -23
- package/lib/stylex-define-consts.js +0 -42
- package/lib/stylex-define-consts.js.flow +0 -18
- package/lib/stylex-define-vars.d.ts +0 -28
- package/lib/stylex-define-vars.js +0 -96
- package/lib/stylex-define-vars.js.flow +0 -27
- package/lib/stylex-first-that-works.d.ts +0 -13
- package/lib/stylex-first-that-works.js +0 -26
- package/lib/stylex-first-that-works.js.flow +0 -12
- package/lib/stylex-include.d.ts +0 -18
- package/lib/stylex-include.js +0 -28
- package/lib/stylex-include.js.flow +0 -20
- package/lib/stylex-keyframes.d.ts +0 -17
- package/lib/stylex-keyframes.js +0 -55
- package/lib/stylex-keyframes.js.flow +0 -20
- package/lib/stylex-vars-utils.d.ts +0 -27
- package/lib/stylex-vars-utils.js +0 -69
- package/lib/stylex-vars-utils.js.flow +0 -31
- package/lib/transform-value.d.ts +0 -22
- package/lib/transform-value.js +0 -50
- package/lib/transform-value.js.flow +0 -25
- package/lib/types/index.d.ts +0 -240
- package/lib/types/index.js +0 -147
- package/lib/types/index.js.flow +0 -280
- package/lib/utils/Rule.d.ts +0 -58
- package/lib/utils/Rule.js +0 -50
- package/lib/utils/Rule.js.flow +0 -64
- package/lib/utils/dashify.d.ts +0 -11
- package/lib/utils/dashify.js +0 -9
- package/lib/utils/dashify.js.flow +0 -10
- package/lib/utils/default-options.d.ts +0 -11
- package/lib/utils/default-options.js +0 -17
- package/lib/utils/default-options.js.flow +0 -12
- package/lib/utils/file-based-identifier.d.ts +0 -15
- package/lib/utils/file-based-identifier.js +0 -14
- package/lib/utils/file-based-identifier.js.flow +0 -14
- package/lib/utils/genCSSRule.d.ts +0 -15
- package/lib/utils/genCSSRule.js +0 -15
- package/lib/utils/genCSSRule.js.flow +0 -15
- package/lib/utils/media-query-transform.d.ts +0 -16
- package/lib/utils/media-query-transform.js +0 -53
- package/lib/utils/media-query-transform.js.flow +0 -20
- package/lib/utils/normalize-value.d.ts +0 -16
- package/lib/utils/normalize-value.js +0 -28
- package/lib/utils/normalize-value.js.flow +0 -16
- package/lib/utils/normalizers/convert-camel-case-values.d.ts +0 -14
- package/lib/utils/normalizers/convert-camel-case-values.js +0 -23
- package/lib/utils/normalizers/convert-camel-case-values.js.flow +0 -13
- package/lib/utils/normalizers/detect-unclosed-fns.d.ts +0 -17
- package/lib/utils/normalizers/detect-unclosed-fns.js +0 -17
- package/lib/utils/normalizers/detect-unclosed-fns.js.flow +0 -16
- package/lib/utils/normalizers/font-size-px-to-rem.d.ts +0 -19
- package/lib/utils/normalizers/font-size-px-to-rem.js +0 -24
- package/lib/utils/normalizers/font-size-px-to-rem.js.flow +0 -18
- package/lib/utils/normalizers/leading-zero.d.ts +0 -17
- package/lib/utils/normalizers/leading-zero.js +0 -24
- package/lib/utils/normalizers/leading-zero.js.flow +0 -16
- package/lib/utils/normalizers/quotes.d.ts +0 -18
- package/lib/utils/normalizers/quotes.js +0 -17
- package/lib/utils/normalizers/quotes.js.flow +0 -17
- package/lib/utils/normalizers/timings.d.ts +0 -18
- package/lib/utils/normalizers/timings.js +0 -25
- package/lib/utils/normalizers/timings.js.flow +0 -17
- package/lib/utils/normalizers/whitespace.d.ts +0 -19
- package/lib/utils/normalizers/whitespace.js +0 -54
- package/lib/utils/normalizers/whitespace.js.flow +0 -18
- package/lib/utils/normalizers/zero-dimensions.d.ts +0 -19
- package/lib/utils/normalizers/zero-dimensions.js +0 -42
- package/lib/utils/normalizers/zero-dimensions.js.flow +0 -18
- package/lib/utils/object-utils.d.ts +0 -66
- package/lib/utils/object-utils.js +0 -99
- package/lib/utils/object-utils.js.flow +0 -78
- package/lib/utils/rule-utils.d.ts +0 -15
- package/lib/utils/rule-utils.js +0 -41
- package/lib/utils/rule-utils.js.flow +0 -16
- package/lib/utils/split-css-value.d.ts +0 -14
- package/lib/utils/split-css-value.js +0 -33
- package/lib/utils/split-css-value.js.flow +0 -15
- package/lib/validate.d.ts +0 -12
- package/lib/validate.js +0 -21
- package/lib/validate.js.flow +0 -12
package/lib/types/index.js.flow
DELETED
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @flow strict
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
// import type { Color as ColorType } from './stylex-types-color';
|
|
11
|
-
|
|
12
|
-
// We want all in one file?
|
|
13
|
-
// option 1, create interface an implement it in the class
|
|
14
|
-
// why? All the types have a single base definition of props
|
|
15
|
-
// We want on type that defines CSS Types
|
|
16
|
-
// Option 2: Do a union type and make
|
|
17
|
-
|
|
18
|
-
// interface CSSType {
|
|
19
|
-
// toString(): string;
|
|
20
|
-
// }
|
|
21
|
-
|
|
22
|
-
type NestedWithNumbers =
|
|
23
|
-
| number
|
|
24
|
-
| string
|
|
25
|
-
| $ReadOnly<{
|
|
26
|
-
default: NestedWithNumbers,
|
|
27
|
-
[string]: NestedWithNumbers,
|
|
28
|
-
}>;
|
|
29
|
-
|
|
30
|
-
type ValueWithDefault =
|
|
31
|
-
| string
|
|
32
|
-
| $ReadOnly<{
|
|
33
|
-
default: ValueWithDefault,
|
|
34
|
-
[string]: ValueWithDefault,
|
|
35
|
-
}>;
|
|
36
|
-
|
|
37
|
-
type CSSSyntax =
|
|
38
|
-
| '*'
|
|
39
|
-
| '<length>'
|
|
40
|
-
| '<number>'
|
|
41
|
-
| '<percentage>'
|
|
42
|
-
| '<length-percentage>'
|
|
43
|
-
| '<color>'
|
|
44
|
-
| '<image>'
|
|
45
|
-
| '<url>'
|
|
46
|
-
| '<integer>'
|
|
47
|
-
| '<angle>'
|
|
48
|
-
| '<time>'
|
|
49
|
-
| '<resolution>'
|
|
50
|
-
| '<transform-function>'
|
|
51
|
-
| '<custom-ident>'
|
|
52
|
-
| '<transform-list>';
|
|
53
|
-
|
|
54
|
-
type CSSSyntaxType = CSSSyntax;
|
|
55
|
-
|
|
56
|
-
declare class BaseCSSType {
|
|
57
|
-
+value: ValueWithDefault;
|
|
58
|
-
+syntax: CSSSyntaxType;
|
|
59
|
-
constructor(value: ValueWithDefault): void;
|
|
60
|
-
}
|
|
61
|
-
export interface CSSType<+_T: string | number = string | number> {
|
|
62
|
-
+value: ValueWithDefault;
|
|
63
|
-
+syntax: CSSSyntaxType;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
declare export const isCSSType: (
|
|
67
|
-
value: mixed,
|
|
68
|
-
) => implies value is CSSType<string | number>;
|
|
69
|
-
|
|
70
|
-
type AngleValue = string;
|
|
71
|
-
declare export class Angle<+T: AngleValue>
|
|
72
|
-
extends BaseCSSType
|
|
73
|
-
implements CSSType<T>
|
|
74
|
-
{
|
|
75
|
-
+value: ValueWithDefault;
|
|
76
|
-
+syntax: CSSSyntaxType;
|
|
77
|
-
static +syntax: CSSSyntaxType;
|
|
78
|
-
static create<T: AngleValue = AngleValue>(value: ValueWithDefault): Angle<T>;
|
|
79
|
-
}
|
|
80
|
-
declare export const angle: <T: AngleValue = AngleValue>(
|
|
81
|
-
value: ValueWithDefault,
|
|
82
|
-
// $FlowIgnore[method-unbinding]
|
|
83
|
-
) => Angle<T>;
|
|
84
|
-
|
|
85
|
-
type ColorValue = string;
|
|
86
|
-
declare export class Color<+T: ColorValue>
|
|
87
|
-
extends BaseCSSType
|
|
88
|
-
implements CSSType<T>
|
|
89
|
-
{
|
|
90
|
-
+value: ValueWithDefault;
|
|
91
|
-
+syntax: CSSSyntaxType;
|
|
92
|
-
static create<T: ColorValue = ColorValue>(value: ValueWithDefault): Color<T>;
|
|
93
|
-
}
|
|
94
|
-
declare export const color: <T: ColorValue = ColorValue>(
|
|
95
|
-
value: ValueWithDefault,
|
|
96
|
-
// $FlowIgnore[method-unbinding]
|
|
97
|
-
) => Color<T>;
|
|
98
|
-
|
|
99
|
-
type URLValue = string;
|
|
100
|
-
|
|
101
|
-
declare export class Url<+T: URLValue>
|
|
102
|
-
extends BaseCSSType
|
|
103
|
-
implements CSSType<T>
|
|
104
|
-
{
|
|
105
|
-
+value: ValueWithDefault;
|
|
106
|
-
+syntax: CSSSyntaxType;
|
|
107
|
-
static create<T: URLValue = URLValue>(value: ValueWithDefault): Url<T>;
|
|
108
|
-
}
|
|
109
|
-
declare export const url: <T: URLValue = URLValue>(
|
|
110
|
-
value: ValueWithDefault,
|
|
111
|
-
) => Url<T>;
|
|
112
|
-
|
|
113
|
-
type ImageValue = string;
|
|
114
|
-
|
|
115
|
-
declare export class Image<+T: ImageValue>
|
|
116
|
-
extends Url<T>
|
|
117
|
-
implements CSSType<T>
|
|
118
|
-
{
|
|
119
|
-
+value: ValueWithDefault;
|
|
120
|
-
+syntax: CSSSyntaxType;
|
|
121
|
-
constructor(value: ValueWithDefault): void;
|
|
122
|
-
static create<T: ImageValue = ImageValue>(value: ValueWithDefault): Image<T>;
|
|
123
|
-
}
|
|
124
|
-
declare export const image: <T: ImageValue = ImageValue>(
|
|
125
|
-
value: ValueWithDefault,
|
|
126
|
-
// $FlowIgnore[method-unbinding]
|
|
127
|
-
) => Image<T>;
|
|
128
|
-
|
|
129
|
-
type IntegerValue = number;
|
|
130
|
-
|
|
131
|
-
declare export class Integer<+T: IntegerValue>
|
|
132
|
-
extends BaseCSSType
|
|
133
|
-
implements CSSType<T>
|
|
134
|
-
{
|
|
135
|
-
+value: ValueWithDefault;
|
|
136
|
-
+syntax: CSSSyntaxType;
|
|
137
|
-
static create<T: IntegerValue = IntegerValue>(value: T): Integer<T>;
|
|
138
|
-
}
|
|
139
|
-
declare export const integer: <T: IntegerValue = IntegerValue>(
|
|
140
|
-
value: T,
|
|
141
|
-
) => Integer<T>;
|
|
142
|
-
|
|
143
|
-
type LengthPercentageValue = string;
|
|
144
|
-
|
|
145
|
-
declare export class LengthPercentage<+_T: LengthPercentageValue>
|
|
146
|
-
extends BaseCSSType
|
|
147
|
-
implements CSSType<string>
|
|
148
|
-
{
|
|
149
|
-
+value: ValueWithDefault;
|
|
150
|
-
+syntax: CSSSyntaxType;
|
|
151
|
-
static createLength<_T: LengthPercentageValue | number>(
|
|
152
|
-
value: ValueWithDefault,
|
|
153
|
-
): LengthPercentage<string>;
|
|
154
|
-
static createPercentage<_T: LengthPercentageValue | number>(
|
|
155
|
-
value: ValueWithDefault,
|
|
156
|
-
): LengthPercentage<string>;
|
|
157
|
-
}
|
|
158
|
-
declare export const lengthPercentage: <_T: LengthPercentageValue | number>(
|
|
159
|
-
value: ValueWithDefault,
|
|
160
|
-
// $FlowIgnore[method-unbinding]
|
|
161
|
-
) => LengthPercentage<string>;
|
|
162
|
-
|
|
163
|
-
type LengthValue = number | string;
|
|
164
|
-
|
|
165
|
-
declare export class Length<+_T: LengthValue>
|
|
166
|
-
extends LengthPercentage<string>
|
|
167
|
-
implements CSSType<string>
|
|
168
|
-
{
|
|
169
|
-
+value: ValueWithDefault;
|
|
170
|
-
+syntax: CSSSyntaxType;
|
|
171
|
-
static create<T: LengthValue = LengthValue>(
|
|
172
|
-
value: NestedWithNumbers,
|
|
173
|
-
): Length<T>;
|
|
174
|
-
}
|
|
175
|
-
declare export const length: <T: LengthValue = LengthValue>(
|
|
176
|
-
value: NestedWithNumbers,
|
|
177
|
-
// $FlowIgnore[method-unbinding]
|
|
178
|
-
) => Length<T>;
|
|
179
|
-
|
|
180
|
-
type PercentageValue = string | number;
|
|
181
|
-
|
|
182
|
-
declare export class Percentage<+_T: PercentageValue>
|
|
183
|
-
extends LengthPercentage<string>
|
|
184
|
-
implements CSSType<string>
|
|
185
|
-
{
|
|
186
|
-
+value: ValueWithDefault;
|
|
187
|
-
+syntax: CSSSyntaxType;
|
|
188
|
-
static create<T: PercentageValue = PercentageValue>(
|
|
189
|
-
value: NestedWithNumbers,
|
|
190
|
-
): Percentage<T>;
|
|
191
|
-
}
|
|
192
|
-
declare export const percentage: <T: PercentageValue = PercentageValue>(
|
|
193
|
-
value: NestedWithNumbers,
|
|
194
|
-
// $FlowIgnore[method-unbinding]
|
|
195
|
-
) => Percentage<T>;
|
|
196
|
-
|
|
197
|
-
type NumberValue = number;
|
|
198
|
-
|
|
199
|
-
declare export class Num<+T: NumberValue>
|
|
200
|
-
extends BaseCSSType
|
|
201
|
-
implements CSSType<T>
|
|
202
|
-
{
|
|
203
|
-
+value: ValueWithDefault;
|
|
204
|
-
+syntax: CSSSyntaxType;
|
|
205
|
-
static create<T: NumberValue = NumberValue>(value: NestedWithNumbers): Num<T>;
|
|
206
|
-
}
|
|
207
|
-
declare export const number: <T: NumberValue = NumberValue>(
|
|
208
|
-
value: NestedWithNumbers,
|
|
209
|
-
// $FlowIgnore[method-unbinding]
|
|
210
|
-
) => Num<T>;
|
|
211
|
-
|
|
212
|
-
type ResolutionValue = string | 0;
|
|
213
|
-
|
|
214
|
-
declare export class Resolution<+T: ResolutionValue>
|
|
215
|
-
extends BaseCSSType
|
|
216
|
-
implements CSSType<T>
|
|
217
|
-
{
|
|
218
|
-
+value: ValueWithDefault;
|
|
219
|
-
+syntax: CSSSyntaxType;
|
|
220
|
-
static create<T: ResolutionValue = ResolutionValue>(
|
|
221
|
-
value: ValueWithDefault,
|
|
222
|
-
): Resolution<T>;
|
|
223
|
-
}
|
|
224
|
-
declare export const resolution: <T: ResolutionValue = ResolutionValue>(
|
|
225
|
-
value: ValueWithDefault,
|
|
226
|
-
// $FlowIgnore[method-unbinding]
|
|
227
|
-
) => Resolution<T>;
|
|
228
|
-
|
|
229
|
-
type TimeValue = string | 0;
|
|
230
|
-
|
|
231
|
-
declare export class Time<+T: TimeValue>
|
|
232
|
-
extends BaseCSSType
|
|
233
|
-
implements CSSType<T>
|
|
234
|
-
{
|
|
235
|
-
+value: ValueWithDefault;
|
|
236
|
-
+syntax: CSSSyntaxType;
|
|
237
|
-
static create<T: TimeValue = TimeValue>(value: ValueWithDefault): Time<T>;
|
|
238
|
-
}
|
|
239
|
-
declare export const time: <T: TimeValue = TimeValue>(
|
|
240
|
-
value: ValueWithDefault,
|
|
241
|
-
// $FlowIgnore[method-unbinding]
|
|
242
|
-
) => Time<T>;
|
|
243
|
-
|
|
244
|
-
type TransformFunctionValue = string;
|
|
245
|
-
|
|
246
|
-
declare export class TransformFunction<+T: TransformFunctionValue>
|
|
247
|
-
extends BaseCSSType
|
|
248
|
-
implements CSSType<T>
|
|
249
|
-
{
|
|
250
|
-
+value: ValueWithDefault;
|
|
251
|
-
+syntax: CSSSyntaxType;
|
|
252
|
-
static create<T: TransformFunctionValue = TransformFunctionValue>(
|
|
253
|
-
value: ValueWithDefault,
|
|
254
|
-
): TransformFunction<T>;
|
|
255
|
-
}
|
|
256
|
-
declare export const transformFunction: <
|
|
257
|
-
T: TransformFunctionValue = TransformFunctionValue,
|
|
258
|
-
>(
|
|
259
|
-
value: ValueWithDefault,
|
|
260
|
-
// $FlowIgnore[method-unbinding]
|
|
261
|
-
) => TransformFunction<T>;
|
|
262
|
-
|
|
263
|
-
type TransformListValue = string;
|
|
264
|
-
|
|
265
|
-
declare export class TransformList<T: TransformListValue>
|
|
266
|
-
extends BaseCSSType
|
|
267
|
-
implements CSSType<T>
|
|
268
|
-
{
|
|
269
|
-
+value: ValueWithDefault;
|
|
270
|
-
+syntax: CSSSyntaxType;
|
|
271
|
-
static create<T: TransformListValue = TransformListValue>(
|
|
272
|
-
value: ValueWithDefault,
|
|
273
|
-
): TransformList<T>;
|
|
274
|
-
}
|
|
275
|
-
declare export const transformList: <
|
|
276
|
-
T: TransformListValue = TransformListValue,
|
|
277
|
-
>(
|
|
278
|
-
value: ValueWithDefault,
|
|
279
|
-
// $FlowIgnore[method-unbinding]
|
|
280
|
-
) => TransformList<T>;
|
package/lib/utils/Rule.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* This could be an interface, but we use a class so that we can
|
|
12
|
-
* use instanceof to check for it.
|
|
13
|
-
*/
|
|
14
|
-
export declare class Rule<V> {}
|
|
15
|
-
/**
|
|
16
|
-
* This is a class that represents a raw style rule.
|
|
17
|
-
*
|
|
18
|
-
* It exists to track the actual CSS rule that should be compiled
|
|
19
|
-
* even as we transform the structure of the RawStyles object.
|
|
20
|
-
*/
|
|
21
|
-
export declare class RawRule<V> extends Rule<V> {
|
|
22
|
-
readonly key: string;
|
|
23
|
-
readonly value: V;
|
|
24
|
-
readonly psuedos: null | undefined | ReadonlyArray<string>;
|
|
25
|
-
readonly atRules: null | undefined | ReadonlyArray<string>;
|
|
26
|
-
constructor(
|
|
27
|
-
key: string,
|
|
28
|
-
value: V,
|
|
29
|
-
psuedos: null | undefined | ReadonlyArray<string>,
|
|
30
|
-
atRules: null | undefined | ReadonlyArray<string>,
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
export declare class RawRuleList<V> extends Rule<V> {
|
|
34
|
-
readonly rules: ReadonlyArray<Rule<V>>;
|
|
35
|
-
constructor(rules: ReadonlyArray<Rule<V>>);
|
|
36
|
-
}
|
|
37
|
-
export declare class RawRuleRTLTuple<V1, V2> extends Rule<V1 | V2> {
|
|
38
|
-
readonly rules: [RawRule<V1>, RawRule<V2>];
|
|
39
|
-
constructor(rule1: RawRule<V1>, rule2: RawRule<V2>);
|
|
40
|
-
}
|
|
41
|
-
export declare class CompiledRule<V> extends Rule<V> {
|
|
42
|
-
readonly key: string;
|
|
43
|
-
readonly value: V;
|
|
44
|
-
readonly psuedos: null | undefined | ReadonlyArray<string>;
|
|
45
|
-
readonly atRules: null | undefined | ReadonlyArray<string>;
|
|
46
|
-
readonly className: string;
|
|
47
|
-
constructor(
|
|
48
|
-
key: string,
|
|
49
|
-
value: V,
|
|
50
|
-
psuedos: null | undefined | ReadonlyArray<string>,
|
|
51
|
-
atRules: null | undefined | ReadonlyArray<string>,
|
|
52
|
-
className: string,
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
export declare class CompiledRuleTuple2<V1, V2> extends Rule<V1 | V2> {
|
|
56
|
-
readonly rules: [CompiledRule<V1>, CompiledRule<V2>];
|
|
57
|
-
constructor(rule1: CompiledRule<V1>, rule2: CompiledRule<V2>);
|
|
58
|
-
}
|
package/lib/utils/Rule.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Rule = exports.RawRuleRTLTuple = exports.RawRuleList = exports.RawRule = exports.CompiledRuleTuple2 = exports.CompiledRule = void 0;
|
|
7
|
-
class Rule {}
|
|
8
|
-
exports.Rule = Rule;
|
|
9
|
-
class RawRule extends Rule {
|
|
10
|
-
constructor(key, value, psuedos, atRules) {
|
|
11
|
-
super();
|
|
12
|
-
this.key = key;
|
|
13
|
-
this.value = value;
|
|
14
|
-
this.psuedos = psuedos;
|
|
15
|
-
this.atRules = atRules;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.RawRule = RawRule;
|
|
19
|
-
class RawRuleList extends Rule {
|
|
20
|
-
constructor(rules) {
|
|
21
|
-
super();
|
|
22
|
-
this.rules = rules;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.RawRuleList = RawRuleList;
|
|
26
|
-
class RawRuleRTLTuple extends Rule {
|
|
27
|
-
constructor(rule1, rule2) {
|
|
28
|
-
super();
|
|
29
|
-
this.rules = [rule1, rule2];
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.RawRuleRTLTuple = RawRuleRTLTuple;
|
|
33
|
-
class CompiledRule extends Rule {
|
|
34
|
-
constructor(key, value, psuedos, atRules, className) {
|
|
35
|
-
super();
|
|
36
|
-
this.key = key;
|
|
37
|
-
this.value = value;
|
|
38
|
-
this.psuedos = psuedos;
|
|
39
|
-
this.atRules = atRules;
|
|
40
|
-
this.className = className;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.CompiledRule = CompiledRule;
|
|
44
|
-
class CompiledRuleTuple2 extends Rule {
|
|
45
|
-
constructor(rule1, rule2) {
|
|
46
|
-
super();
|
|
47
|
-
this.rules = [rule1, rule2];
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.CompiledRuleTuple2 = CompiledRuleTuple2;
|
package/lib/utils/Rule.js.flow
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @flow strict
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* This could be an interface, but we use a class so that we can
|
|
12
|
-
* use instanceof to check for it.
|
|
13
|
-
*/
|
|
14
|
-
// eslint-disable-next-line no-unused-vars
|
|
15
|
-
declare export class Rule<+V> {}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* This is a class that represents a raw style rule.
|
|
19
|
-
*
|
|
20
|
-
* It exists to track the actual CSS rule that should be compiled
|
|
21
|
-
* even as we transform the structure of the RawStyles object.
|
|
22
|
-
*/
|
|
23
|
-
declare export class RawRule<V> extends Rule<V> {
|
|
24
|
-
+key: string;
|
|
25
|
-
+value: V;
|
|
26
|
-
+psuedos: ?$ReadOnlyArray<string>;
|
|
27
|
-
+atRules: ?$ReadOnlyArray<string>;
|
|
28
|
-
constructor(
|
|
29
|
-
key: string,
|
|
30
|
-
value: V,
|
|
31
|
-
psuedos: ?$ReadOnlyArray<string>,
|
|
32
|
-
atRules: ?$ReadOnlyArray<string>,
|
|
33
|
-
): void;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
declare export class RawRuleList<V> extends Rule<V> {
|
|
37
|
-
+rules: $ReadOnlyArray<Rule<V>>;
|
|
38
|
-
constructor(rules: $ReadOnlyArray<Rule<V>>): void;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
declare export class RawRuleRTLTuple<V1, V2> extends Rule<V1 | V2> {
|
|
42
|
-
+rules: [RawRule<V1>, RawRule<V2>];
|
|
43
|
-
constructor(rule1: RawRule<V1>, rule2: RawRule<V2>): void;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
declare export class CompiledRule<V> extends Rule<V> {
|
|
47
|
-
+key: string;
|
|
48
|
-
+value: V;
|
|
49
|
-
+psuedos: ?$ReadOnlyArray<string>;
|
|
50
|
-
+atRules: ?$ReadOnlyArray<string>;
|
|
51
|
-
+className: string;
|
|
52
|
-
constructor(
|
|
53
|
-
key: string,
|
|
54
|
-
value: V,
|
|
55
|
-
psuedos: ?$ReadOnlyArray<string>,
|
|
56
|
-
atRules: ?$ReadOnlyArray<string>,
|
|
57
|
-
className: string,
|
|
58
|
-
): void;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
declare export class CompiledRuleTuple2<V1, V2> extends Rule<V1 | V2> {
|
|
62
|
-
+rules: [CompiledRule<V1>, CompiledRule<V2>];
|
|
63
|
-
constructor(rule1: CompiledRule<V1>, rule2: CompiledRule<V2>): void;
|
|
64
|
-
}
|
package/lib/utils/dashify.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
declare function dashify(str: string): string;
|
|
11
|
-
export default dashify;
|
package/lib/utils/dashify.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @flow strict
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
declare export default function dashify(str: string): string;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import type { StyleXOptions } from '../common-types';
|
|
11
|
-
export declare const defaultOptions: StyleXOptions;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.defaultOptions = void 0;
|
|
7
|
-
const defaultOptions = exports.defaultOptions = {
|
|
8
|
-
classNamePrefix: 'x',
|
|
9
|
-
dev: false,
|
|
10
|
-
debug: false,
|
|
11
|
-
enableDebugClassNames: true,
|
|
12
|
-
enableDebugDataProp: true,
|
|
13
|
-
enableMinifiedKeys: true,
|
|
14
|
-
useRemForFontSize: true,
|
|
15
|
-
styleResolution: 'application-order',
|
|
16
|
-
test: false
|
|
17
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @flow strict
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import type { StyleXOptions } from '../common-types';
|
|
11
|
-
|
|
12
|
-
declare export const defaultOptions: StyleXOptions;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
declare function genFileBasedIdentifier($$PARAM_0$$: {
|
|
11
|
-
readonly fileName: string;
|
|
12
|
-
readonly exportName: string;
|
|
13
|
-
readonly key?: string;
|
|
14
|
-
}): string;
|
|
15
|
-
export default genFileBasedIdentifier;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = genFileBasedIdentifier;
|
|
7
|
-
function genFileBasedIdentifier(_ref) {
|
|
8
|
-
let {
|
|
9
|
-
fileName,
|
|
10
|
-
exportName,
|
|
11
|
-
key
|
|
12
|
-
} = _ref;
|
|
13
|
-
return `${fileName}//${exportName}${key != null ? `.${key}` : ''}`;
|
|
14
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @flow strict
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
declare export default function genFileBasedIdentifier({
|
|
11
|
-
+fileName: string,
|
|
12
|
-
+exportName: string,
|
|
13
|
-
+key?: string,
|
|
14
|
-
}): string;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
export declare function genCSSRule(
|
|
11
|
-
className: string,
|
|
12
|
-
decls: string,
|
|
13
|
-
pseudos: ReadonlyArray<string>,
|
|
14
|
-
atRules: ReadonlyArray<string>,
|
|
15
|
-
): string;
|
package/lib/utils/genCSSRule.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.genCSSRule = genCSSRule;
|
|
7
|
-
const THUMB_VARIANTS = ['::-webkit-slider-thumb', '::-moz-range-thumb', '::-ms-thumb'];
|
|
8
|
-
function genCSSRule(className, decls, pseudos, atRules) {
|
|
9
|
-
const pseudo = pseudos.filter(p => p !== '::thumb').join('');
|
|
10
|
-
let selectorForAtRules = `.${className}` + atRules.map(() => `.${className}`).join('') + pseudo;
|
|
11
|
-
if (pseudos.includes('::thumb')) {
|
|
12
|
-
selectorForAtRules = THUMB_VARIANTS.map(suffix => selectorForAtRules + suffix).join(', ');
|
|
13
|
-
}
|
|
14
|
-
return atRules.reduce((acc, atRule) => `${atRule}{${acc}}`, `${selectorForAtRules}{${decls}}`);
|
|
15
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @flow strict
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
declare export function genCSSRule(
|
|
11
|
-
className: string,
|
|
12
|
-
decls: string,
|
|
13
|
-
pseudos: $ReadOnlyArray<string>,
|
|
14
|
-
atRules: $ReadOnlyArray<string>,
|
|
15
|
-
): string;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { MediaQuery } from '@style-value-parser/src/at-queries-from-tokens/media-query';
|
|
11
|
-
export declare function applyLastMediaQueryWins(
|
|
12
|
-
mediaQuery: MediaQuery,
|
|
13
|
-
): MediaQuery;
|
|
14
|
-
export declare function transformMediaQueryStyles(
|
|
15
|
-
styles: Record<string, any>,
|
|
16
|
-
): Record<string, any>;
|