@stylexjs/shared 0.2.0-beta.21 → 0.2.0-beta.23
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/convert-to-className.js +6 -6
- package/lib/generate-css-rule.js +3 -3
- package/lib/hash.js +10 -11
- package/lib/index.d.ts +4 -4
- package/lib/index.js +12 -21
- package/lib/index.js.flow +4 -4
- package/lib/messages.d.ts +2 -1
- package/lib/messages.js +29 -54
- package/lib/messages.js.flow +2 -1
- package/lib/physical-rtl/generate-ltr.js +39 -39
- package/lib/physical-rtl/generate-rtl.js +57 -57
- package/lib/preprocess-rules/PreRule.js +2 -2
- package/lib/preprocess-rules/application-order.d.ts +36 -8
- package/lib/preprocess-rules/application-order.js +149 -164
- package/lib/preprocess-rules/application-order.js.flow +35 -7
- package/lib/preprocess-rules/basic-validation.js +6 -6
- package/lib/preprocess-rules/flatten-raw-style-obj.js +10 -10
- package/lib/preprocess-rules/index.js +6 -6
- package/lib/preprocess-rules/legacy-expand-shorthands.d.ts +22 -2
- package/lib/preprocess-rules/legacy-expand-shorthands.js +81 -65
- package/lib/preprocess-rules/legacy-expand-shorthands.js.flow +22 -2
- package/lib/preprocess-rules/property-specificity.d.ts +29 -25
- package/lib/preprocess-rules/property-specificity.js +63 -75
- package/lib/preprocess-rules/property-specificity.js.flow +28 -24
- package/lib/properties/CSS Animations.json +445 -0
- package/lib/properties/CSS Backgrounds and Borders.json +1085 -0
- package/lib/properties/CSS Basic User Interface.json +365 -0
- package/lib/properties/CSS Box Alignment.json +245 -0
- package/lib/properties/CSS Box Model.json +501 -0
- package/lib/properties/CSS Color.json +100 -0
- package/lib/properties/CSS Columns.json +185 -0
- package/lib/properties/CSS Containment.json +203 -0
- package/lib/properties/CSS Counter Styles.json +56 -0
- package/lib/properties/CSS Display.json +20 -0
- package/lib/properties/CSS Flexible Box Layout.json +167 -0
- package/lib/properties/CSS Fonts.json +684 -0
- package/lib/properties/CSS Fragmentation.json +110 -0
- package/lib/properties/CSS Generated Content.json +38 -0
- package/lib/properties/CSS Grid Layout.json +500 -0
- package/lib/properties/CSS Images.json +91 -0
- package/lib/properties/CSS Inline.json +38 -0
- package/lib/properties/CSS Lists and Counters.json +86 -0
- package/lib/properties/CSS Logical Properties.json +1086 -0
- package/lib/properties/CSS Masking.json +399 -0
- package/lib/properties/CSS Miscellaneous.json +38 -0
- package/lib/properties/CSS Motion Path.json +132 -0
- package/lib/properties/CSS Overflow.json +216 -0
- package/lib/properties/CSS Pages.json +83 -0
- package/lib/properties/CSS Positioning.json +166 -0
- package/lib/properties/CSS Ruby.json +55 -0
- package/lib/properties/CSS Scroll Anchoring.json +19 -0
- package/lib/properties/CSS Scroll Snap.json +604 -0
- package/lib/properties/CSS Scrollbars.json +38 -0
- package/lib/properties/CSS Shapes.json +56 -0
- package/lib/properties/CSS Speech.json +20 -0
- package/lib/properties/CSS Table.json +115 -0
- package/lib/properties/CSS Text Decoration.json +312 -0
- package/lib/properties/CSS Text.json +415 -0
- package/lib/properties/CSS Transforms.json +188 -0
- package/lib/properties/CSS Transitions.json +122 -0
- package/lib/properties/CSS Variables.json +20 -0
- package/lib/properties/CSS View Transitions.json +20 -0
- package/lib/properties/CSS Will Change.json +20 -0
- package/lib/properties/CSS Writing Modes.json +92 -0
- package/lib/properties/Compositing and Blending.json +62 -0
- package/lib/properties/Filter Effects.json +38 -0
- package/lib/properties/MathML.json +56 -0
- package/lib/properties/Microsoft Extensions.json +885 -0
- package/lib/properties/Mozilla Extensions.json +607 -0
- package/lib/properties/Pointer Events.json +20 -0
- package/lib/properties/WebKit Extensions.json +707 -0
- package/lib/properties.json +10122 -0
- package/lib/{stylex-override-vars.d.ts → stylex-create-theme.d.ts} +2 -2
- package/lib/{stylex-override-vars.js → stylex-create-theme.js} +13 -13
- package/lib/{stylex-override-vars.js.flow → stylex-create-theme.js.flow} +1 -1
- package/lib/stylex-create.js +1 -1
- package/lib/{stylex-create-vars.d.ts → stylex-define-vars.d.ts} +2 -2
- package/lib/{stylex-create-vars.js → stylex-define-vars.js} +9 -9
- package/lib/{stylex-create-vars.js.flow → stylex-define-vars.js.flow} +1 -1
- package/lib/stylex-keyframes.js +6 -6
- package/lib/transform-value.js +13 -15
- package/lib/types/index.js +33 -46
- package/lib/utils/dashify.js +1 -1
- package/lib/utils/default-options.js +4 -5
- package/lib/utils/file-based-identifier.js +1 -1
- package/lib/utils/genCSSRule.js +6 -6
- package/lib/utils/normalize-value.js +3 -2
- package/lib/utils/normalizers/convert-camel-case-transition-props.d.ts +14 -0
- package/lib/utils/normalizers/convert-camel-case-transition-props.js +23 -0
- package/lib/utils/normalizers/convert-camel-case-transition-props.js.flow +13 -0
- package/lib/utils/normalizers/convert-camel-case-values.d.ts +14 -0
- package/lib/utils/normalizers/convert-camel-case-values.js +23 -0
- package/lib/utils/normalizers/convert-camel-case-values.js.flow +13 -0
- package/lib/utils/normalizers/detect-unclosed-fns.js +2 -2
- package/lib/utils/normalizers/font-size-px-to-rem.js +4 -4
- package/lib/utils/normalizers/leading-zero.js +3 -3
- package/lib/utils/normalizers/quotes.js +4 -4
- package/lib/utils/normalizers/timings.js +4 -4
- package/lib/utils/normalizers/whitespace.js +12 -12
- package/lib/utils/normalizers/zero-dimensions.js +8 -8
- package/lib/utils/object-utils.d.ts +3 -6
- package/lib/utils/object-utils.js +2 -2
- package/lib/utils/property-priorities.js +527 -88
- package/lib/utils/split-css-value.js +8 -8
- package/lib/validate.js +2 -2
- package/package.json +2 -2
@@ -10,19 +10,19 @@ var _legacyExpandShorthands = _interopRequireDefault(require("./legacy-expand-sh
|
|
10
10
|
var _propertySpecificity = _interopRequireDefault(require("./property-specificity"));
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12
12
|
const expansions = {
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
'application-order': _applicationOrder.default,
|
14
|
+
'property-specificity': _propertySpecificity.default,
|
15
|
+
'legacy-expand-shorthands': _legacyExpandShorthands.default
|
16
16
|
};
|
17
17
|
function getExpandedKeys(options) {
|
18
|
-
return Object.keys(expansions[options.styleResolution ??
|
18
|
+
return Object.keys(expansions[options.styleResolution ?? 'application-order']);
|
19
19
|
}
|
20
20
|
function flatMapExpandedShorthands(objEntry, options) {
|
21
21
|
const [key, value] = objEntry;
|
22
|
-
const expansion = expansions[options.styleResolution ??
|
22
|
+
const expansion = expansions[options.styleResolution ?? 'application-order'][key];
|
23
23
|
if (expansion) {
|
24
24
|
if (Array.isArray(value)) {
|
25
|
-
throw new Error(
|
25
|
+
throw new Error('Cannot use fallbacks for shorthands. Use the expansion instead.');
|
26
26
|
}
|
27
27
|
return expansion(value);
|
28
28
|
}
|
@@ -120,19 +120,32 @@ declare const shorthands: {
|
|
120
120
|
inset: (rawValue: TStyleValue) => TReturn;
|
121
121
|
insetInline: (rawValue: TStyleValue) => TReturn;
|
122
122
|
insetBlock: (rawValue: TStyleValue) => TReturn;
|
123
|
+
start: (rawValue: TStyleValue) => TReturn;
|
124
|
+
end: (rawValue: TStyleValue) => TReturn;
|
125
|
+
left: (rawValue: TStyleValue) => TReturn;
|
126
|
+
right: (rawValue: TStyleValue) => TReturn;
|
127
|
+
gap: (rawValue: TStyleValue) => TReturn;
|
123
128
|
margin: (rawValue: TStyleValue) => TReturn;
|
124
129
|
marginHorizontal: (rawValue: TStyleValue) => TReturn;
|
130
|
+
marginStart: (rawValue: TStyleValue) => TReturn;
|
131
|
+
marginEnd: (rawValue: TStyleValue) => TReturn;
|
132
|
+
marginLeft: (rawValue: TStyleValue) => TReturn;
|
133
|
+
marginRight: (rawValue: TStyleValue) => TReturn;
|
125
134
|
marginVertical: (rawValue: TStyleValue) => TReturn;
|
126
135
|
overflow: (rawValue: TStyleValue) => TReturn;
|
127
136
|
padding: (rawValue: TStyleValue) => TReturn;
|
128
137
|
paddingHorizontal: (val: TStyleValue) => TReturn;
|
138
|
+
paddingStart: (val: TStyleValue) => TReturn;
|
139
|
+
paddingEnd: (val: TStyleValue) => TReturn;
|
140
|
+
paddingLeft: (val: TStyleValue) => TReturn;
|
141
|
+
paddingRight: (val: TStyleValue) => TReturn;
|
129
142
|
paddingVertical: (val: TStyleValue) => TReturn;
|
130
143
|
};
|
131
144
|
declare const aliases: {
|
132
145
|
insetBlockStart: (val: TStyleValue) => TReturn;
|
133
146
|
insetBlockEnd: (val: TStyleValue) => TReturn;
|
134
|
-
insetInlineStart:
|
135
|
-
insetInlineEnd:
|
147
|
+
insetInlineStart: any;
|
148
|
+
insetInlineEnd: any;
|
136
149
|
blockSize: (val: TStyleValue) => TReturn;
|
137
150
|
inlineSize: (val: TStyleValue) => TReturn;
|
138
151
|
minBlockSize: (val: TStyleValue) => TReturn;
|
@@ -161,18 +174,25 @@ declare const aliases: {
|
|
161
174
|
borderStartEndRadius: (val: TStyleValue) => TReturn;
|
162
175
|
borderEndStartRadius: (val: TStyleValue) => TReturn;
|
163
176
|
borderEndEndRadius: (val: TStyleValue) => TReturn;
|
177
|
+
gridGap: any;
|
178
|
+
gridRowGap: (value: TStyleValue) => TReturn;
|
179
|
+
gridColumnGap: (value: TStyleValue) => TReturn;
|
164
180
|
marginBlock: any;
|
165
181
|
marginBlockStart: (val: TStyleValue) => TReturn;
|
166
182
|
marginBlockEnd: (val: TStyleValue) => TReturn;
|
167
183
|
marginInline: any;
|
168
184
|
marginInlineStart: (val: TStyleValue) => TReturn;
|
169
185
|
marginInlineEnd: (val: TStyleValue) => TReturn;
|
186
|
+
overflowBlock: (value: TStyleValue) => TReturn;
|
187
|
+
overflowInline: (value: TStyleValue) => TReturn;
|
170
188
|
paddingBlock: any;
|
171
189
|
paddingBlockStart: (val: TStyleValue) => TReturn;
|
172
190
|
paddingBlockEnd: (val: TStyleValue) => TReturn;
|
173
191
|
paddingInline: any;
|
174
192
|
paddingInlineStart: (val: TStyleValue) => TReturn;
|
175
193
|
paddingInlineEnd: (val: TStyleValue) => TReturn;
|
194
|
+
scrollMarginBlockStart: (value: TStyleValue) => TReturn;
|
195
|
+
scrollMarginBlockEnd: (value: TStyleValue) => TReturn;
|
176
196
|
};
|
177
197
|
declare const expansions: Omit<shorthands, keyof (aliases | {})> &
|
178
198
|
Omit<aliases, keyof ({})> & {};
|
@@ -8,113 +8,129 @@ var _splitCssValue = _interopRequireDefault(require("../utils/split-css-value"))
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
9
9
|
const shorthands = {
|
10
10
|
border: rawValue => {
|
11
|
-
return [[
|
11
|
+
return [['borderTop', rawValue], ['borderEnd', rawValue], ['borderBottom', rawValue], ['borderStart', rawValue]];
|
12
12
|
},
|
13
13
|
borderColor: rawValue => {
|
14
14
|
const [top, right = top, bottom = top, left = right] = (0, _splitCssValue.default)(rawValue);
|
15
|
-
return [[
|
15
|
+
return [['borderTopColor', top], ['borderEndColor', right], ['borderBottomColor', bottom], ['borderStartColor', left]];
|
16
16
|
},
|
17
17
|
borderHorizontal: rawValue => {
|
18
|
-
return [[
|
18
|
+
return [['borderStart', rawValue], ['borderEnd', rawValue]];
|
19
19
|
},
|
20
20
|
borderStyle: rawValue => {
|
21
21
|
const [top, right = top, bottom = top, left = right] = (0, _splitCssValue.default)(rawValue);
|
22
|
-
return [[
|
22
|
+
return [['borderTopStyle', top], ['borderEndStyle', right], ['borderBottomStyle', bottom], ['borderStartStyle', left]];
|
23
23
|
},
|
24
24
|
borderVertical: rawValue => {
|
25
|
-
return [[
|
25
|
+
return [['borderTop', rawValue], ['borderBottom', rawValue]];
|
26
26
|
},
|
27
27
|
borderWidth: rawValue => {
|
28
28
|
const [top, right = top, bottom = top, left = right] = (0, _splitCssValue.default)(rawValue);
|
29
|
-
return [[
|
29
|
+
return [['borderTopWidth', top], ['borderEndWidth', right], ['borderBottomWidth', bottom], ['borderStartWidth', left]];
|
30
30
|
},
|
31
|
-
borderHorizontalColor: rawValue => [[
|
32
|
-
borderHorizontalStyle: rawValue => [[
|
33
|
-
borderHorizontalWidth: rawValue => [[
|
34
|
-
borderVerticalColor: rawValue => [[
|
35
|
-
borderVerticalStyle: rawValue => [[
|
36
|
-
borderVerticalWidth: rawValue => [[
|
31
|
+
borderHorizontalColor: rawValue => [['borderStartColor', rawValue], ['borderEndColor', rawValue]],
|
32
|
+
borderHorizontalStyle: rawValue => [['borderStartStyle', rawValue], ['borderEndStyle', rawValue]],
|
33
|
+
borderHorizontalWidth: rawValue => [['borderStartWidth', rawValue], ['borderEndWidth', rawValue]],
|
34
|
+
borderVerticalColor: rawValue => [['borderTopColor', rawValue], ['borderBottomColor', rawValue]],
|
35
|
+
borderVerticalStyle: rawValue => [['borderTopStyle', rawValue], ['borderBottomStyle', rawValue]],
|
36
|
+
borderVerticalWidth: rawValue => [['borderTopWidth', rawValue], ['borderBottomWidth', rawValue]],
|
37
37
|
borderRadius: rawValue => {
|
38
38
|
const [top, right = top, bottom = top, left = right] = (0, _splitCssValue.default)(rawValue);
|
39
|
-
return [[
|
39
|
+
return [['borderTopStartRadius', top], ['borderTopEndRadius', right], ['borderBottomEndRadius', bottom], ['borderBottomStartRadius', left]];
|
40
|
+
},
|
41
|
+
inset: rawValue => [['top', rawValue], ['end', rawValue], ['bottom', rawValue], ['start', rawValue]],
|
42
|
+
insetInline: rawValue => [...shorthands.start(rawValue), ...shorthands.end(rawValue)],
|
43
|
+
insetBlock: rawValue => [['top', rawValue], ['bottom', rawValue]],
|
44
|
+
start: rawValue => [['start', rawValue], ['left', null], ['right', null]],
|
45
|
+
end: rawValue => [['end', rawValue], ['left', null], ['right', null]],
|
46
|
+
left: rawValue => [['left', rawValue], ['start', null], ['end', null]],
|
47
|
+
right: rawValue => [['right', rawValue], ['start', null], ['end', null]],
|
48
|
+
gap: rawValue => {
|
49
|
+
const [row, column = row] = (0, _splitCssValue.default)(rawValue);
|
50
|
+
return [['rowGap', row], ['columnGap', column]];
|
40
51
|
},
|
41
|
-
inset: rawValue => [["top", rawValue], ["end", rawValue], ["bottom", rawValue], ["start", rawValue]],
|
42
|
-
insetInline: rawValue => [["start", rawValue], ["end", rawValue]],
|
43
|
-
insetBlock: rawValue => [["top", rawValue], ["bottom", rawValue]],
|
44
52
|
margin: rawValue => {
|
45
53
|
const [top, right = top, bottom = top, left = right] = (0, _splitCssValue.default)(rawValue);
|
46
|
-
return [[
|
47
|
-
},
|
48
|
-
marginHorizontal: rawValue => {
|
49
|
-
return [["marginStart", rawValue], ["marginEnd", rawValue]];
|
54
|
+
return [['marginTop', top], ['marginEnd', right], ['marginBottom', bottom], ['marginStart', left]];
|
50
55
|
},
|
56
|
+
marginHorizontal: rawValue => [...shorthands.marginStart(rawValue), ...shorthands.marginEnd(rawValue)],
|
57
|
+
marginStart: rawValue => [['marginStart', rawValue], ['marginLeft', null], ['marginRight', null]],
|
58
|
+
marginEnd: rawValue => [['marginEnd', rawValue], ['marginLeft', null], ['marginRight', null]],
|
59
|
+
marginLeft: rawValue => [['marginLeft', rawValue], ['marginStart', null], ['marginEnd', null]],
|
60
|
+
marginRight: rawValue => [['marginRight', rawValue], ['marginStart', null], ['marginEnd', null]],
|
51
61
|
marginVertical: rawValue => {
|
52
|
-
return [[
|
62
|
+
return [['marginTop', rawValue], ['marginBottom', rawValue]];
|
53
63
|
},
|
54
64
|
overflow: rawValue => {
|
55
65
|
const [x, y = x] = (0, _splitCssValue.default)(rawValue);
|
56
|
-
return [[
|
66
|
+
return [['overflowX', x], ['overflowY', y]];
|
57
67
|
},
|
58
68
|
padding: rawValue => {
|
59
69
|
const [top, right = top, bottom = top, left = right] = (0, _splitCssValue.default)(rawValue);
|
60
|
-
return [[
|
61
|
-
},
|
62
|
-
paddingHorizontal: val => {
|
63
|
-
return [["paddingStart", val], ["paddingEnd", val]];
|
70
|
+
return [['paddingTop', top], ['paddingEnd', right], ['paddingBottom', bottom], ['paddingStart', left]];
|
64
71
|
},
|
65
|
-
|
66
|
-
|
67
|
-
|
72
|
+
paddingHorizontal: val => [...shorthands.paddingStart(val), ...shorthands.paddingEnd(val)],
|
73
|
+
paddingStart: val => [['paddingStart', val], ['paddingLeft', null], ['paddingRight', null]],
|
74
|
+
paddingEnd: val => [['paddingEnd', val], ['paddingLeft', null], ['paddingRight', null]],
|
75
|
+
paddingLeft: val => [['paddingLeft', val], ['paddingStart', null], ['paddingEnd', null]],
|
76
|
+
paddingRight: val => [['paddingRight', val], ['paddingStart', null], ['paddingEnd', null]],
|
77
|
+
paddingVertical: val => [['paddingTop', val], ['paddingBottom', val]]
|
68
78
|
};
|
69
79
|
const aliases = {
|
70
|
-
insetBlockStart: val => [[
|
71
|
-
insetBlockEnd: val => [[
|
72
|
-
insetInlineStart:
|
73
|
-
insetInlineEnd:
|
74
|
-
blockSize: val => [[
|
75
|
-
inlineSize: val => [[
|
76
|
-
minBlockSize: val => [[
|
77
|
-
minInlineSize: val => [[
|
78
|
-
maxBlockSize: val => [[
|
79
|
-
maxInlineSize: val => [[
|
80
|
+
insetBlockStart: val => [['top', val]],
|
81
|
+
insetBlockEnd: val => [['bottom', val]],
|
82
|
+
insetInlineStart: shorthands.start,
|
83
|
+
insetInlineEnd: shorthands.end,
|
84
|
+
blockSize: val => [['height', val]],
|
85
|
+
inlineSize: val => [['width', val]],
|
86
|
+
minBlockSize: val => [['minHeight', val]],
|
87
|
+
minInlineSize: val => [['minWidth', val]],
|
88
|
+
maxBlockSize: val => [['maxHeight', val]],
|
89
|
+
maxInlineSize: val => [['maxWidth', val]],
|
80
90
|
borderBlockWidth: shorthands.borderVerticalWidth,
|
81
91
|
borderBlockStyle: shorthands.borderVerticalStyle,
|
82
92
|
borderBlockColor: shorthands.borderVerticalColor,
|
83
|
-
borderBlockStartWidth: val => [[
|
84
|
-
borderBlockStartStyle: val => [[
|
85
|
-
borderBlockStartColor: val => [[
|
86
|
-
borderBlockEndWidth: val => [[
|
87
|
-
borderBlockEndStyle: val => [[
|
88
|
-
borderBlockEndColor: val => [[
|
93
|
+
borderBlockStartWidth: val => [['borderTopWidth', val]],
|
94
|
+
borderBlockStartStyle: val => [['borderTopStyle', val]],
|
95
|
+
borderBlockStartColor: val => [['borderTopColor', val]],
|
96
|
+
borderBlockEndWidth: val => [['borderBottomWidth', val]],
|
97
|
+
borderBlockEndStyle: val => [['borderBottomStyle', val]],
|
98
|
+
borderBlockEndColor: val => [['borderBottomColor', val]],
|
89
99
|
borderInlineWidth: shorthands.borderHorizontalWidth,
|
90
100
|
borderInlineStyle: shorthands.borderHorizontalStyle,
|
91
101
|
borderInlineColor: shorthands.borderHorizontalColor,
|
92
|
-
borderInlineStartWidth: val => [[
|
93
|
-
borderInlineStartStyle: val => [[
|
94
|
-
borderInlineStartColor: val => [[
|
95
|
-
borderInlineEndWidth: val => [[
|
96
|
-
borderInlineEndStyle: val => [[
|
97
|
-
borderInlineEndColor: val => [[
|
98
|
-
borderStartStartRadius: val => [[
|
99
|
-
borderStartEndRadius: val => [[
|
100
|
-
borderEndStartRadius: val => [[
|
101
|
-
borderEndEndRadius: val => [[
|
102
|
+
borderInlineStartWidth: val => [['borderStartWidth', val]],
|
103
|
+
borderInlineStartStyle: val => [['borderStartStyle', val]],
|
104
|
+
borderInlineStartColor: val => [['borderStartColor', val]],
|
105
|
+
borderInlineEndWidth: val => [['borderEndWidth', val]],
|
106
|
+
borderInlineEndStyle: val => [['borderEndStyle', val]],
|
107
|
+
borderInlineEndColor: val => [['borderEndColor', val]],
|
108
|
+
borderStartStartRadius: val => [['borderTopStartRadius', val]],
|
109
|
+
borderStartEndRadius: val => [['borderTopEndRadius', val]],
|
110
|
+
borderEndStartRadius: val => [['borderBottomStartRadius', val]],
|
111
|
+
borderEndEndRadius: val => [['borderBottomEndRadius', val]],
|
112
|
+
gridGap: shorthands.gap,
|
113
|
+
gridRowGap: value => [['rowGap', value]],
|
114
|
+
gridColumnGap: value => [['columnGap', value]],
|
102
115
|
marginBlock: shorthands.marginVertical,
|
103
|
-
marginBlockStart: val => [[
|
104
|
-
marginBlockEnd: val => [[
|
116
|
+
marginBlockStart: val => [['marginTop', val]],
|
117
|
+
marginBlockEnd: val => [['marginBottom', val]],
|
105
118
|
marginInline: shorthands.marginHorizontal,
|
106
|
-
marginInlineStart: val => [[
|
107
|
-
marginInlineEnd: val => [[
|
119
|
+
marginInlineStart: val => [['marginStart', val]],
|
120
|
+
marginInlineEnd: val => [['marginEnd', val]],
|
121
|
+
overflowBlock: value => [['overflowY', value]],
|
122
|
+
overflowInline: value => [['overflowX', value]],
|
108
123
|
paddingBlock: shorthands.paddingVertical,
|
109
|
-
paddingBlockStart: val => [[
|
110
|
-
paddingBlockEnd: val => [[
|
124
|
+
paddingBlockStart: val => [['paddingTop', val]],
|
125
|
+
paddingBlockEnd: val => [['paddingBottom', val]],
|
111
126
|
paddingInline: shorthands.paddingHorizontal,
|
112
|
-
paddingInlineStart: val => [[
|
113
|
-
paddingInlineEnd: val => [[
|
127
|
+
paddingInlineStart: val => [['paddingStart', val]],
|
128
|
+
paddingInlineEnd: val => [['paddingEnd', val]],
|
129
|
+
scrollMarginBlockStart: value => [['scrollMarginTop', value]],
|
130
|
+
scrollMarginBlockEnd: value => [['scrollMarginBottom', value]]
|
114
131
|
};
|
115
132
|
const expansions = {
|
116
133
|
...shorthands,
|
117
134
|
...aliases
|
118
135
|
};
|
119
|
-
var _default = expansions;
|
120
|
-
exports.default = _default;
|
136
|
+
var _default = exports.default = expansions;
|
@@ -98,20 +98,33 @@ declare const shorthands: {
|
|
98
98
|
inset: (rawValue: TStyleValue) => TReturn,
|
99
99
|
insetInline: (rawValue: TStyleValue) => TReturn,
|
100
100
|
insetBlock: (rawValue: TStyleValue) => TReturn,
|
101
|
+
start: (rawValue: TStyleValue) => TReturn,
|
102
|
+
end: (rawValue: TStyleValue) => TReturn,
|
103
|
+
left: (rawValue: TStyleValue) => TReturn,
|
104
|
+
right: (rawValue: TStyleValue) => TReturn,
|
105
|
+
gap: (rawValue: TStyleValue) => TReturn,
|
101
106
|
margin: (rawValue: TStyleValue) => TReturn,
|
102
107
|
marginHorizontal: (rawValue: TStyleValue) => TReturn,
|
108
|
+
marginStart: (rawValue: TStyleValue) => TReturn,
|
109
|
+
marginEnd: (rawValue: TStyleValue) => TReturn,
|
110
|
+
marginLeft: (rawValue: TStyleValue) => TReturn,
|
111
|
+
marginRight: (rawValue: TStyleValue) => TReturn,
|
103
112
|
marginVertical: (rawValue: TStyleValue) => TReturn,
|
104
113
|
overflow: (rawValue: TStyleValue) => TReturn,
|
105
114
|
padding: (rawValue: TStyleValue) => TReturn,
|
106
115
|
paddingHorizontal: (val: TStyleValue) => TReturn,
|
116
|
+
paddingStart: (val: TStyleValue) => TReturn,
|
117
|
+
paddingEnd: (val: TStyleValue) => TReturn,
|
118
|
+
paddingLeft: (val: TStyleValue) => TReturn,
|
119
|
+
paddingRight: (val: TStyleValue) => TReturn,
|
107
120
|
paddingVertical: (val: TStyleValue) => TReturn,
|
108
121
|
};
|
109
122
|
|
110
123
|
declare const aliases: {
|
111
124
|
insetBlockStart: (val: TStyleValue) => TReturn,
|
112
125
|
insetBlockEnd: (val: TStyleValue) => TReturn,
|
113
|
-
insetInlineStart:
|
114
|
-
insetInlineEnd:
|
126
|
+
insetInlineStart: $FlowFixMe,
|
127
|
+
insetInlineEnd: $FlowFixMe,
|
115
128
|
blockSize: (val: TStyleValue) => TReturn,
|
116
129
|
inlineSize: (val: TStyleValue) => TReturn,
|
117
130
|
minBlockSize: (val: TStyleValue) => TReturn,
|
@@ -140,18 +153,25 @@ declare const aliases: {
|
|
140
153
|
borderStartEndRadius: (val: TStyleValue) => TReturn,
|
141
154
|
borderEndStartRadius: (val: TStyleValue) => TReturn,
|
142
155
|
borderEndEndRadius: (val: TStyleValue) => TReturn,
|
156
|
+
gridGap: $FlowFixMe,
|
157
|
+
gridRowGap: (value: TStyleValue) => TReturn,
|
158
|
+
gridColumnGap: (value: TStyleValue) => TReturn,
|
143
159
|
marginBlock: $FlowFixMe,
|
144
160
|
marginBlockStart: (val: TStyleValue) => TReturn,
|
145
161
|
marginBlockEnd: (val: TStyleValue) => TReturn,
|
146
162
|
marginInline: $FlowFixMe,
|
147
163
|
marginInlineStart: (val: TStyleValue) => TReturn,
|
148
164
|
marginInlineEnd: (val: TStyleValue) => TReturn,
|
165
|
+
overflowBlock: (value: TStyleValue) => TReturn,
|
166
|
+
overflowInline: (value: TStyleValue) => TReturn,
|
149
167
|
paddingBlock: $FlowFixMe,
|
150
168
|
paddingBlockStart: (val: TStyleValue) => TReturn,
|
151
169
|
paddingBlockEnd: (val: TStyleValue) => TReturn,
|
152
170
|
paddingInline: $FlowFixMe,
|
153
171
|
paddingInlineStart: (val: TStyleValue) => TReturn,
|
154
172
|
paddingInlineEnd: (val: TStyleValue) => TReturn,
|
173
|
+
scrollMarginBlockStart: (value: TStyleValue) => TReturn,
|
174
|
+
scrollMarginBlockEnd: (value: TStyleValue) => TReturn,
|
155
175
|
};
|
156
176
|
|
157
177
|
declare const expansions: { ...shorthands, ...aliases };
|
@@ -22,8 +22,6 @@ declare const shorthands: {
|
|
22
22
|
borderBottom: (_rawValue: TStyleValue) => TReturn;
|
23
23
|
borderInlineStart: (_rawValue: TStyleValue) => TReturn;
|
24
24
|
borderLeft: (_rawValue: TStyleValue) => TReturn;
|
25
|
-
margin: (value: TStyleValue) => TReturn;
|
26
|
-
padding: (rawValue: TStyleValue) => TReturn;
|
27
25
|
};
|
28
26
|
declare const aliases: {
|
29
27
|
borderHorizontal: any;
|
@@ -38,47 +36,53 @@ declare const aliases: {
|
|
38
36
|
minInlineSize: (val: TStyleValue) => TReturn;
|
39
37
|
maxBlockSize: (val: TStyleValue) => TReturn;
|
40
38
|
maxInlineSize: (val: TStyleValue) => TReturn;
|
41
|
-
borderHorizontalWidth: (
|
42
|
-
borderHorizontalStyle: (
|
43
|
-
borderHorizontalColor: (
|
44
|
-
borderVerticalWidth: (
|
45
|
-
borderVerticalStyle: (
|
46
|
-
borderVerticalColor: (
|
39
|
+
borderHorizontalWidth: (val: TStyleValue) => TReturn;
|
40
|
+
borderHorizontalStyle: (val: TStyleValue) => TReturn;
|
41
|
+
borderHorizontalColor: (val: TStyleValue) => TReturn;
|
42
|
+
borderVerticalWidth: (val: TStyleValue) => TReturn;
|
43
|
+
borderVerticalStyle: (val: TStyleValue) => TReturn;
|
44
|
+
borderVerticalColor: (val: TStyleValue) => TReturn;
|
47
45
|
borderBlockStartColor: (value: TStyleValue) => TReturn;
|
48
46
|
borderBlockEndColor: (value: TStyleValue) => TReturn;
|
49
47
|
borderBlockStartStyle: (value: TStyleValue) => TReturn;
|
50
48
|
borderBlockEndStyle: (value: TStyleValue) => TReturn;
|
51
49
|
borderBlockStartWidth: (value: TStyleValue) => TReturn;
|
52
50
|
borderBlockEndWidth: (value: TStyleValue) => TReturn;
|
53
|
-
borderStartColor: (
|
54
|
-
borderEndColor: (
|
55
|
-
borderStartStyle: (
|
56
|
-
borderEndStyle: (
|
57
|
-
borderStartWidth: (
|
58
|
-
borderEndWidth: (
|
51
|
+
borderStartColor: (val: TStyleValue) => TReturn;
|
52
|
+
borderEndColor: (val: TStyleValue) => TReturn;
|
53
|
+
borderStartStyle: (val: TStyleValue) => TReturn;
|
54
|
+
borderEndStyle: (val: TStyleValue) => TReturn;
|
55
|
+
borderStartWidth: (val: TStyleValue) => TReturn;
|
56
|
+
borderEndWidth: (val: TStyleValue) => TReturn;
|
59
57
|
borderTopStartRadius: (value: TStyleValue) => TReturn;
|
60
58
|
borderTopEndRadius: (value: TStyleValue) => TReturn;
|
61
59
|
borderBottomStartRadius: (value: TStyleValue) => TReturn;
|
62
60
|
borderBottomEndRadius: (value: TStyleValue) => TReturn;
|
61
|
+
containIntrinsicBlockSize: (value: TStyleValue) => TReturn;
|
62
|
+
containIntrinsicInlineSize: (value: TStyleValue) => TReturn;
|
63
63
|
marginBlockStart: (value: TStyleValue) => TReturn;
|
64
64
|
marginBlockEnd: (value: TStyleValue) => TReturn;
|
65
|
-
marginStart: (
|
66
|
-
marginEnd: (
|
67
|
-
marginHorizontal: (
|
68
|
-
marginVertical: (
|
65
|
+
marginStart: (val: TStyleValue) => TReturn;
|
66
|
+
marginEnd: (val: TStyleValue) => TReturn;
|
67
|
+
marginHorizontal: (val: TStyleValue) => TReturn;
|
68
|
+
marginVertical: (val: TStyleValue) => TReturn;
|
69
|
+
overflowBlock: (value: TStyleValue) => TReturn;
|
70
|
+
overflowInline: (value: TStyleValue) => TReturn;
|
69
71
|
paddingBlockStart: (rawValue: TStyleValue) => TReturn;
|
70
72
|
paddingBlockEnd: (rawValue: TStyleValue) => TReturn;
|
71
|
-
paddingStart: (
|
72
|
-
paddingEnd: (
|
73
|
-
paddingHorizontal: (
|
74
|
-
paddingVertical: (
|
73
|
+
paddingStart: (val: TStyleValue) => TReturn;
|
74
|
+
paddingEnd: (val: TStyleValue) => TReturn;
|
75
|
+
paddingHorizontal: (val: TStyleValue) => TReturn;
|
76
|
+
paddingVertical: (val: TStyleValue) => TReturn;
|
77
|
+
scrollMarginBlockStart: (value: TStyleValue) => TReturn;
|
78
|
+
scrollMarginBlockEnd: (value: TStyleValue) => TReturn;
|
75
79
|
insetBlockStart: (value: TStyleValue) => TReturn;
|
76
80
|
insetBlockEnd: (value: TStyleValue) => TReturn;
|
77
|
-
start: (
|
78
|
-
end: (
|
81
|
+
start: (val: TStyleValue) => TReturn;
|
82
|
+
end: (val: TStyleValue) => TReturn;
|
79
83
|
};
|
80
84
|
declare const $$EXPORT_DEFAULT_DECLARATION$$: Readonly</**
|
81
|
-
* >
|
85
|
+
* > 96 | ...typeof shorthands,
|
82
86
|
* | ^^^^^^^^^^^^^^^^^^^^ Unsupported feature: Translating "object types with complex spreads" is currently not supported.
|
83
87
|
**/
|
84
88
|
any>;
|
@@ -4,59 +4,42 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
-
var _splitCssValue = _interopRequireDefault(require("../utils/split-css-value"));
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
9
7
|
const shorthands = {
|
10
8
|
all: _ => {
|
11
|
-
throw new Error(
|
9
|
+
throw new Error('all is not supported');
|
12
10
|
},
|
13
11
|
animation: _value => {
|
14
|
-
throw new Error(
|
12
|
+
throw new Error('animation is not supported');
|
15
13
|
},
|
16
14
|
background: _value => {
|
17
|
-
throw new Error(
|
15
|
+
throw new Error('background is not supported. Use background-color, border-image etc. instead.');
|
18
16
|
},
|
19
17
|
border: _rawValue => {
|
20
|
-
throw new Error(
|
18
|
+
throw new Error('border is not supported. Use border-width, border-style and border-color instead.');
|
21
19
|
},
|
22
20
|
borderInline: _rawValue => {
|
23
|
-
throw new Error(
|
21
|
+
throw new Error('borderInline is not supported. Use borderInlineWidth, borderInlineStyle and borderInlineColor instead.');
|
24
22
|
},
|
25
23
|
borderBlock: _rawValue => {
|
26
|
-
throw new Error(
|
24
|
+
throw new Error('borderBlock is not supported. Use borderBlockWidth, borderBlockStyle and borderBlockColor instead.');
|
27
25
|
},
|
28
26
|
borderTop: _rawValue => {
|
29
|
-
throw new Error(
|
27
|
+
throw new Error('borderTop is not supported. Use borderTopWidth, borderTopStyle and borderTopColor instead.');
|
30
28
|
},
|
31
29
|
borderInlineEnd: _rawValue => {
|
32
|
-
throw new Error(
|
30
|
+
throw new Error('borderInlineEnd is not supported. Use borderInlineEndWidth, borderInlineEndStyle and borderInlineEndColor instead.');
|
33
31
|
},
|
34
32
|
borderRight: _rawValue => {
|
35
|
-
throw new Error(
|
33
|
+
throw new Error('borderRight is not supported. Use borderRightWidth, borderRightStyle and borderRightColor instead.');
|
36
34
|
},
|
37
35
|
borderBottom: _rawValue => {
|
38
|
-
throw new Error(
|
36
|
+
throw new Error('borderBottom is not supported. Use borderBottomWidth, borderBottomStyle and borderBottomColor instead.');
|
39
37
|
},
|
40
38
|
borderInlineStart: _rawValue => {
|
41
|
-
throw new Error(
|
39
|
+
throw new Error('borderInlineStart is not supported. Use borderInlineStartWidth, borderInlineStartStyle and borderInlineStartColor instead.');
|
42
40
|
},
|
43
41
|
borderLeft: _rawValue => {
|
44
|
-
throw new Error([
|
45
|
-
},
|
46
|
-
margin: value => {
|
47
|
-
const values = (0, _splitCssValue.default)(value);
|
48
|
-
if (values.length === 1) {
|
49
|
-
return [["margin", values[0]]];
|
50
|
-
} else {
|
51
|
-
throw new Error("margin shorthand with multiple values is not supported. Use marginTop, marginInlineEnd, marginBottom and marginInlineStart instead.");
|
52
|
-
}
|
53
|
-
},
|
54
|
-
padding: rawValue => {
|
55
|
-
const values = (0, _splitCssValue.default)(rawValue);
|
56
|
-
if (values.length === 1) {
|
57
|
-
return [["padding", values[0]]];
|
58
|
-
}
|
59
|
-
throw new Error("padding shorthand with multiple values is not supported. Use paddingTop, paddingInlineEnd, paddingBottom and paddingInlineStart instead.");
|
42
|
+
throw new Error(['`borderLeft` is not supported.', 'You could use `borderLeftWidth`, `borderLeftStyle` and `borderLeftColor`,', 'but it is preferable to use `borderInlineStartWidth`, `borderInlineStartStyle` and `borderInlineStartColor`.'].join(' '));
|
60
43
|
}
|
61
44
|
};
|
62
45
|
const aliases = {
|
@@ -66,54 +49,59 @@ const aliases = {
|
|
66
49
|
borderEnd: shorthands.borderInlineEnd,
|
67
50
|
borderBlockEnd: shorthands.borderBottom,
|
68
51
|
borderStart: shorthands.borderInlineStart,
|
69
|
-
blockSize: val => [[
|
70
|
-
inlineSize: val => [[
|
71
|
-
minBlockSize: val => [[
|
72
|
-
minInlineSize: val => [[
|
73
|
-
maxBlockSize: val => [[
|
74
|
-
maxInlineSize: val => [[
|
75
|
-
borderHorizontalWidth:
|
76
|
-
borderHorizontalStyle:
|
77
|
-
borderHorizontalColor:
|
78
|
-
borderVerticalWidth:
|
79
|
-
borderVerticalStyle:
|
80
|
-
borderVerticalColor:
|
81
|
-
borderBlockStartColor: value => [[
|
82
|
-
borderBlockEndColor: value => [[
|
83
|
-
borderBlockStartStyle: value => [[
|
84
|
-
borderBlockEndStyle: value => [[
|
85
|
-
borderBlockStartWidth: value => [[
|
86
|
-
borderBlockEndWidth: value => [[
|
87
|
-
borderStartColor:
|
88
|
-
borderEndColor:
|
89
|
-
borderStartStyle:
|
90
|
-
borderEndStyle:
|
91
|
-
borderStartWidth:
|
92
|
-
borderEndWidth:
|
93
|
-
borderTopStartRadius: value => [[
|
94
|
-
borderTopEndRadius: value => [[
|
95
|
-
borderBottomStartRadius: value => [[
|
96
|
-
borderBottomEndRadius: value => [[
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
52
|
+
blockSize: val => [['height', val]],
|
53
|
+
inlineSize: val => [['width', val]],
|
54
|
+
minBlockSize: val => [['minHeight', val]],
|
55
|
+
minInlineSize: val => [['minWidth', val]],
|
56
|
+
maxBlockSize: val => [['maxHeight', val]],
|
57
|
+
maxInlineSize: val => [['maxWidth', val]],
|
58
|
+
borderHorizontalWidth: val => [['borderInlineWidth', val]],
|
59
|
+
borderHorizontalStyle: val => [['borderInlineStyle', val]],
|
60
|
+
borderHorizontalColor: val => [['borderInlineColor', val]],
|
61
|
+
borderVerticalWidth: val => [['borderBlockWidth', val]],
|
62
|
+
borderVerticalStyle: val => [['borderBlockStyle', val]],
|
63
|
+
borderVerticalColor: val => [['borderBlockColor', val]],
|
64
|
+
borderBlockStartColor: value => [['borderTopColor', value]],
|
65
|
+
borderBlockEndColor: value => [['borderBottomColor', value]],
|
66
|
+
borderBlockStartStyle: value => [['borderTopStyle', value]],
|
67
|
+
borderBlockEndStyle: value => [['borderBottomStyle', value]],
|
68
|
+
borderBlockStartWidth: value => [['borderTopWidth', value]],
|
69
|
+
borderBlockEndWidth: value => [['borderBottomWidth', value]],
|
70
|
+
borderStartColor: val => [['borderInlineStartColor', val]],
|
71
|
+
borderEndColor: val => [['borderInlineEndColor', val]],
|
72
|
+
borderStartStyle: val => [['borderInlineStartStyle', val]],
|
73
|
+
borderEndStyle: val => [['borderInlineEndStyle', val]],
|
74
|
+
borderStartWidth: val => [['borderInlineStartWidth', val]],
|
75
|
+
borderEndWidth: val => [['borderInlineEndWidth', val]],
|
76
|
+
borderTopStartRadius: value => [['borderStartStartRadius', value]],
|
77
|
+
borderTopEndRadius: value => [['borderStartEndRadius', value]],
|
78
|
+
borderBottomStartRadius: value => [['borderEndStartRadius', value]],
|
79
|
+
borderBottomEndRadius: value => [['borderEndEndRadius', value]],
|
80
|
+
containIntrinsicBlockSize: value => [['containIntrinsicHeight', value]],
|
81
|
+
containIntrinsicInlineSize: value => [['containIntrinsicWidth', value]],
|
82
|
+
marginBlockStart: value => [['marginTop', value]],
|
83
|
+
marginBlockEnd: value => [['marginBottom', value]],
|
84
|
+
marginStart: val => [['marginInlineStart', val]],
|
85
|
+
marginEnd: val => [['marginInlineEnd', val]],
|
86
|
+
marginHorizontal: val => [['marginInline', val]],
|
87
|
+
marginVertical: val => [['marginBlock', val]],
|
88
|
+
overflowBlock: value => [['overflowY', value]],
|
89
|
+
overflowInline: value => [['overflowX', value]],
|
90
|
+
paddingBlockStart: rawValue => [['paddingTop', rawValue]],
|
91
|
+
paddingBlockEnd: rawValue => [['paddingBottom', rawValue]],
|
92
|
+
paddingStart: val => [['paddingInlineStart', val]],
|
93
|
+
paddingEnd: val => [['paddingInlineEnd', val]],
|
94
|
+
paddingHorizontal: val => [['paddingInline', val]],
|
95
|
+
paddingVertical: val => [['paddingBlock', val]],
|
96
|
+
scrollMarginBlockStart: value => [['scrollMarginTop', value]],
|
97
|
+
scrollMarginBlockEnd: value => [['scrollMarginBottom', value]],
|
98
|
+
insetBlockStart: value => [['top', value]],
|
99
|
+
insetBlockEnd: value => [['bottom', value]],
|
100
|
+
start: val => [['insetInlineStart', val]],
|
101
|
+
end: val => [['insetInlineEnd', val]]
|
113
102
|
};
|
114
103
|
const expansions = {
|
115
104
|
...shorthands,
|
116
105
|
...aliases
|
117
106
|
};
|
118
|
-
var _default = expansions;
|
119
|
-
exports.default = _default;
|
107
|
+
var _default = exports.default = expansions;
|