@stylexjs/shared 0.2.0-beta.9 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/common-types.d.ts +50 -0
- package/lib/common-types.js.flow +65 -0
- package/lib/convert-to-className.d.ts +16 -0
- package/lib/convert-to-className.js +17 -26
- package/lib/convert-to-className.js.flow +23 -0
- package/lib/generate-css-rule.d.ts +17 -0
- package/lib/generate-css-rule.js +6 -17
- package/lib/generate-css-rule.js.flow +17 -0
- package/lib/hash.d.ts +11 -0
- package/lib/hash.js +3 -27
- package/lib/hash.js.flow +10 -0
- package/lib/index.d.ts +42 -85
- package/lib/index.js +19 -27
- package/lib/index.js.flow +57 -3
- package/lib/messages.d.ts +36 -0
- package/lib/messages.js +28 -53
- package/lib/messages.js.flow +39 -0
- package/lib/physical-rtl/generate-ltr.d.ts +11 -0
- package/lib/physical-rtl/generate-ltr.js +18 -46
- package/lib/physical-rtl/generate-ltr.js.flow +12 -0
- package/lib/physical-rtl/generate-rtl.d.ts +13 -0
- package/lib/physical-rtl/generate-rtl.js +18 -50
- package/lib/physical-rtl/generate-rtl.js.flow +12 -0
- package/lib/preprocess-rules/PreRule.d.ts +52 -0
- package/lib/preprocess-rules/PreRule.js +87 -0
- package/lib/preprocess-rules/PreRule.js.flow +64 -0
- package/lib/preprocess-rules/application-order.d.ts +290 -0
- package/lib/preprocess-rules/application-order.js +59 -125
- package/lib/preprocess-rules/application-order.js.flow +241 -0
- package/lib/preprocess-rules/basic-validation.d.ts +13 -0
- package/lib/preprocess-rules/basic-validation.js +83 -0
- package/lib/preprocess-rules/basic-validation.js.flow +13 -0
- package/lib/preprocess-rules/flatten-raw-style-obj.d.ts +25 -0
- package/lib/preprocess-rules/flatten-raw-style-obj.js +120 -0
- package/lib/preprocess-rules/flatten-raw-style-obj.js.flow +27 -0
- package/lib/preprocess-rules/index.d.ts +18 -0
- package/lib/preprocess-rules/index.js +0 -9
- package/lib/preprocess-rules/index.js.flow +19 -0
- package/lib/preprocess-rules/legacy-expand-shorthands.d.ts +200 -0
- package/lib/preprocess-rules/legacy-expand-shorthands.js +90 -123
- package/lib/preprocess-rules/legacy-expand-shorthands.js.flow +179 -0
- package/lib/preprocess-rules/property-specificity.d.ts +89 -0
- package/lib/preprocess-rules/property-specificity.js +46 -74
- package/lib/preprocess-rules/property-specificity.js.flow +98 -0
- 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-create-theme.d.ts +26 -0
- package/lib/stylex-create-theme.js +62 -0
- package/lib/stylex-create-theme.js.flow +19 -0
- package/lib/stylex-create.d.ts +23 -0
- package/lib/stylex-create.js +30 -146
- package/lib/stylex-create.js.flow +30 -0
- package/lib/stylex-define-vars.d.ts +36 -0
- package/lib/stylex-define-vars.js +72 -0
- package/lib/stylex-define-vars.js.flow +28 -0
- package/lib/stylex-first-that-works.d.ts +13 -0
- package/lib/stylex-first-that-works.js +0 -10
- package/lib/stylex-first-that-works.js.flow +12 -0
- package/lib/stylex-include.d.ts +18 -0
- package/lib/stylex-include.js +0 -10
- package/lib/stylex-include.js.flow +20 -0
- package/lib/stylex-keyframes.d.ts +17 -0
- package/lib/stylex-keyframes.js +6 -26
- package/lib/stylex-keyframes.js.flow +20 -0
- package/lib/transform-value.d.ts +22 -0
- package/lib/transform-value.js +9 -23
- package/lib/transform-value.js.flow +25 -0
- package/lib/types/index.d.ts +205 -0
- package/lib/types/index.js +191 -0
- package/lib/types/index.js.flow +241 -0
- package/lib/utils/Rule.d.ts +58 -0
- package/lib/utils/Rule.js +0 -21
- package/lib/utils/Rule.js.flow +64 -0
- package/lib/utils/dashify.d.ts +11 -0
- package/lib/utils/dashify.js +0 -8
- package/lib/utils/dashify.js.flow +10 -0
- package/lib/utils/default-options.d.ts +11 -0
- package/lib/utils/default-options.js +14 -0
- package/lib/utils/default-options.js.flow +25 -0
- package/lib/utils/file-based-identifier.d.ts +15 -0
- package/lib/utils/file-based-identifier.js +14 -0
- package/lib/utils/file-based-identifier.js.flow +14 -0
- package/lib/utils/genCSSRule.d.ts +15 -0
- package/lib/utils/genCSSRule.js +9 -18
- package/lib/utils/genCSSRule.js.flow +15 -0
- package/lib/utils/normalize-value.d.ts +16 -0
- package/lib/utils/normalize-value.js +8 -15
- package/lib/utils/normalize-value.js.flow +16 -0
- 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.d.ts +17 -0
- package/lib/utils/normalizers/detect-unclosed-fns.js +0 -12
- package/lib/utils/normalizers/detect-unclosed-fns.js.flow +16 -0
- package/lib/utils/normalizers/font-size-px-to-rem.d.ts +19 -0
- package/lib/utils/normalizers/font-size-px-to-rem.js +9 -19
- package/lib/utils/normalizers/font-size-px-to-rem.js.flow +18 -0
- package/lib/utils/normalizers/leading-zero.d.ts +17 -0
- package/lib/utils/normalizers/leading-zero.js +0 -12
- package/lib/utils/normalizers/leading-zero.js.flow +16 -0
- package/lib/utils/normalizers/quotes.d.ts +18 -0
- package/lib/utils/normalizers/quotes.js +0 -13
- package/lib/utils/normalizers/quotes.js.flow +17 -0
- package/lib/utils/normalizers/timings.d.ts +18 -0
- package/lib/utils/normalizers/timings.js +0 -14
- package/lib/utils/normalizers/timings.js.flow +17 -0
- package/lib/utils/normalizers/whitespace.d.ts +19 -0
- package/lib/utils/normalizers/whitespace.js +0 -15
- package/lib/utils/normalizers/whitespace.js.flow +18 -0
- package/lib/utils/normalizers/zero-dimensions.d.ts +19 -0
- package/lib/utils/normalizers/zero-dimensions.js +0 -15
- package/lib/utils/normalizers/zero-dimensions.js.flow +18 -0
- package/lib/utils/object-utils.d.ts +66 -0
- package/lib/utils/object-utils.js +21 -13
- package/lib/utils/object-utils.js.flow +77 -0
- package/lib/utils/property-priorities.d.ts +11 -0
- package/lib/utils/property-priorities.js +516 -101
- package/lib/utils/property-priorities.js.flow +10 -0
- package/lib/utils/split-css-value.d.ts +14 -0
- package/lib/utils/split-css-value.js +0 -14
- package/lib/utils/split-css-value.js.flow +15 -0
- package/lib/validate.d.ts +12 -0
- package/lib/validate.js +1 -10
- package/lib/validate.js.flow +12 -0
- package/package.json +4 -5
- package/lib/expand-shorthands.d.ts +0 -5
- package/lib/expand-shorthands.js +0 -330
- package/lib/namespace-transforms/__tests__/preflatten.test.js +0 -120
- package/lib/namespace-transforms/preflatten.js +0 -89
- package/lib/preprocess-rules/expand-shorthands.js +0 -156
- package/lib/preprocess-rules/null-out-longhand.js +0 -310
- package/lib/preprocess-rules/react-native-web.js +0 -142
- package/lib/stylex-defaultValue.js +0 -397
@@ -0,0 +1,89 @@
|
|
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 { TStyleValue } from '../common-types';
|
11
|
+
type TReturn = ReadonlyArray<[string, TStyleValue]>;
|
12
|
+
declare const shorthands: {
|
13
|
+
all: (_: TStyleValue) => TReturn;
|
14
|
+
animation: (_value: TStyleValue) => TReturn;
|
15
|
+
background: (_value: TStyleValue) => TReturn;
|
16
|
+
border: (_rawValue: TStyleValue) => TReturn;
|
17
|
+
borderInline: (_rawValue: TStyleValue) => TReturn;
|
18
|
+
borderBlock: (_rawValue: TStyleValue) => TReturn;
|
19
|
+
borderTop: (_rawValue: TStyleValue) => TReturn;
|
20
|
+
borderInlineEnd: (_rawValue: TStyleValue) => TReturn;
|
21
|
+
borderRight: (_rawValue: TStyleValue) => TReturn;
|
22
|
+
borderBottom: (_rawValue: TStyleValue) => TReturn;
|
23
|
+
borderInlineStart: (_rawValue: TStyleValue) => TReturn;
|
24
|
+
borderLeft: (_rawValue: TStyleValue) => TReturn;
|
25
|
+
};
|
26
|
+
declare const aliases: {
|
27
|
+
borderHorizontal: any;
|
28
|
+
borderVertical: any;
|
29
|
+
borderBlockStart: any;
|
30
|
+
borderEnd: any;
|
31
|
+
borderBlockEnd: any;
|
32
|
+
borderStart: any;
|
33
|
+
blockSize: (val: TStyleValue) => TReturn;
|
34
|
+
inlineSize: (val: TStyleValue) => TReturn;
|
35
|
+
minBlockSize: (val: TStyleValue) => TReturn;
|
36
|
+
minInlineSize: (val: TStyleValue) => TReturn;
|
37
|
+
maxBlockSize: (val: TStyleValue) => TReturn;
|
38
|
+
maxInlineSize: (val: TStyleValue) => TReturn;
|
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;
|
45
|
+
borderBlockStartColor: (value: TStyleValue) => TReturn;
|
46
|
+
borderBlockEndColor: (value: TStyleValue) => TReturn;
|
47
|
+
borderBlockStartStyle: (value: TStyleValue) => TReturn;
|
48
|
+
borderBlockEndStyle: (value: TStyleValue) => TReturn;
|
49
|
+
borderBlockStartWidth: (value: TStyleValue) => TReturn;
|
50
|
+
borderBlockEndWidth: (value: TStyleValue) => TReturn;
|
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;
|
57
|
+
borderTopStartRadius: (value: TStyleValue) => TReturn;
|
58
|
+
borderTopEndRadius: (value: TStyleValue) => TReturn;
|
59
|
+
borderBottomStartRadius: (value: TStyleValue) => TReturn;
|
60
|
+
borderBottomEndRadius: (value: TStyleValue) => TReturn;
|
61
|
+
containIntrinsicBlockSize: (value: TStyleValue) => TReturn;
|
62
|
+
containIntrinsicInlineSize: (value: TStyleValue) => TReturn;
|
63
|
+
marginBlockStart: (value: TStyleValue) => TReturn;
|
64
|
+
marginBlockEnd: (value: TStyleValue) => TReturn;
|
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;
|
71
|
+
paddingBlockStart: (rawValue: TStyleValue) => TReturn;
|
72
|
+
paddingBlockEnd: (rawValue: TStyleValue) => TReturn;
|
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;
|
79
|
+
insetBlockStart: (value: TStyleValue) => TReturn;
|
80
|
+
insetBlockEnd: (value: TStyleValue) => TReturn;
|
81
|
+
start: (val: TStyleValue) => TReturn;
|
82
|
+
end: (val: TStyleValue) => TReturn;
|
83
|
+
};
|
84
|
+
declare const $$EXPORT_DEFAULT_DECLARATION$$: Readonly</**
|
85
|
+
* > 96 | ...typeof shorthands,
|
86
|
+
* | ^^^^^^^^^^^^^^^^^^^^ Unsupported feature: Translating "object types with complex spreads" is currently not supported.
|
87
|
+
**/
|
88
|
+
any>;
|
89
|
+
export default $$EXPORT_DEFAULT_DECLARATION$$;
|
@@ -4,132 +4,104 @@ 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
|
-
/**
|
10
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
11
|
-
*
|
12
|
-
* This source code is licensed under the MIT license found in the
|
13
|
-
* LICENSE file in the root directory of this source tree.
|
14
|
-
*
|
15
|
-
*
|
16
|
-
*/
|
17
|
-
|
18
7
|
const shorthands = {
|
19
8
|
all: _ => {
|
20
9
|
throw new Error('all is not supported');
|
21
10
|
},
|
22
|
-
animation:
|
11
|
+
animation: _value => {
|
23
12
|
throw new Error('animation is not supported');
|
24
13
|
},
|
25
|
-
background:
|
14
|
+
background: _value => {
|
26
15
|
throw new Error('background is not supported. Use background-color, border-image etc. instead.');
|
27
16
|
},
|
28
|
-
border:
|
17
|
+
border: _rawValue => {
|
29
18
|
throw new Error('border is not supported. Use border-width, border-style and border-color instead.');
|
30
19
|
},
|
31
|
-
borderInline:
|
20
|
+
borderInline: _rawValue => {
|
32
21
|
throw new Error('borderInline is not supported. Use borderInlineWidth, borderInlineStyle and borderInlineColor instead.');
|
33
22
|
},
|
34
|
-
|
35
|
-
borderBlock: rawValue => {
|
23
|
+
borderBlock: _rawValue => {
|
36
24
|
throw new Error('borderBlock is not supported. Use borderBlockWidth, borderBlockStyle and borderBlockColor instead.');
|
37
25
|
},
|
38
|
-
|
39
|
-
borderTop: rawValue => {
|
26
|
+
borderTop: _rawValue => {
|
40
27
|
throw new Error('borderTop is not supported. Use borderTopWidth, borderTopStyle and borderTopColor instead.');
|
41
28
|
},
|
42
|
-
|
43
|
-
borderInlineEnd: rawValue => {
|
29
|
+
borderInlineEnd: _rawValue => {
|
44
30
|
throw new Error('borderInlineEnd is not supported. Use borderInlineEndWidth, borderInlineEndStyle and borderInlineEndColor instead.');
|
45
31
|
},
|
46
|
-
|
47
|
-
borderRight: rawValue => {
|
32
|
+
borderRight: _rawValue => {
|
48
33
|
throw new Error('borderRight is not supported. Use borderRightWidth, borderRightStyle and borderRightColor instead.');
|
49
34
|
},
|
50
|
-
|
51
|
-
borderBottom: rawValue => {
|
35
|
+
borderBottom: _rawValue => {
|
52
36
|
throw new Error('borderBottom is not supported. Use borderBottomWidth, borderBottomStyle and borderBottomColor instead.');
|
53
37
|
},
|
54
|
-
|
55
|
-
borderInlineStart: rawValue => {
|
38
|
+
borderInlineStart: _rawValue => {
|
56
39
|
throw new Error('borderInlineStart is not supported. Use borderInlineStartWidth, borderInlineStartStyle and borderInlineStartColor instead.');
|
57
40
|
},
|
58
|
-
|
59
|
-
borderLeft: rawValue => {
|
41
|
+
borderLeft: _rawValue => {
|
60
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(' '));
|
61
|
-
},
|
62
|
-
margin: value => {
|
63
|
-
const values = (0, _splitCssValue.default)(value);
|
64
|
-
if (values.length === 1) {
|
65
|
-
return [['margin', values[0]]];
|
66
|
-
} else {
|
67
|
-
throw new Error('margin shorthand with multiple values is not supported. Use marginTop, marginInlineEnd, marginBottom and marginInlineStart instead.');
|
68
|
-
}
|
69
|
-
},
|
70
|
-
padding: rawValue => {
|
71
|
-
const values = (0, _splitCssValue.default)(rawValue);
|
72
|
-
if (values.length === 1) {
|
73
|
-
return [['padding', values[0]]];
|
74
|
-
}
|
75
|
-
throw new Error('padding shorthand with multiple values is not supported. Use paddingTop, paddingInlineEnd, paddingBottom and paddingInlineStart instead.');
|
76
43
|
}
|
77
44
|
};
|
78
45
|
const aliases = {
|
79
|
-
// @UNSUPPORTED
|
80
46
|
borderHorizontal: shorthands.borderInline,
|
81
|
-
// @UNSUPPORTED
|
82
47
|
borderVertical: shorthands.borderBlock,
|
83
|
-
// @UNSUPPORTED
|
84
48
|
borderBlockStart: shorthands.borderTop,
|
85
|
-
// @UNSUPPORTED
|
86
49
|
borderEnd: shorthands.borderInlineEnd,
|
87
|
-
// @UNSUPPORTED
|
88
50
|
borderBlockEnd: shorthands.borderBottom,
|
89
|
-
// @UNSUPPORTED
|
90
51
|
borderStart: shorthands.borderInlineStart,
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
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]],
|
97
64
|
borderBlockStartColor: value => [['borderTopColor', value]],
|
98
65
|
borderBlockEndColor: value => [['borderBottomColor', value]],
|
99
66
|
borderBlockStartStyle: value => [['borderTopStyle', value]],
|
100
67
|
borderBlockEndStyle: value => [['borderBottomStyle', value]],
|
101
68
|
borderBlockStartWidth: value => [['borderTopWidth', value]],
|
102
69
|
borderBlockEndWidth: value => [['borderBottomWidth', value]],
|
103
|
-
borderStartColor:
|
104
|
-
borderEndColor:
|
105
|
-
borderStartStyle:
|
106
|
-
borderEndStyle:
|
107
|
-
borderStartWidth:
|
108
|
-
borderEndWidth:
|
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]],
|
109
76
|
borderTopStartRadius: value => [['borderStartStartRadius', value]],
|
110
77
|
borderTopEndRadius: value => [['borderStartEndRadius', value]],
|
111
78
|
borderBottomStartRadius: value => [['borderEndStartRadius', value]],
|
112
79
|
borderBottomEndRadius: value => [['borderEndEndRadius', value]],
|
80
|
+
containIntrinsicBlockSize: value => [['containIntrinsicHeight', value]],
|
81
|
+
containIntrinsicInlineSize: value => [['containIntrinsicWidth', value]],
|
113
82
|
marginBlockStart: value => [['marginTop', value]],
|
114
83
|
marginBlockEnd: value => [['marginBottom', value]],
|
115
|
-
marginStart:
|
116
|
-
marginEnd:
|
117
|
-
marginHorizontal:
|
118
|
-
marginVertical:
|
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]],
|
119
90
|
paddingBlockStart: rawValue => [['paddingTop', rawValue]],
|
120
91
|
paddingBlockEnd: rawValue => [['paddingBottom', rawValue]],
|
121
|
-
paddingStart:
|
122
|
-
paddingEnd:
|
123
|
-
paddingHorizontal:
|
124
|
-
paddingVertical:
|
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]],
|
125
98
|
insetBlockStart: value => [['top', value]],
|
126
99
|
insetBlockEnd: value => [['bottom', value]],
|
127
|
-
start:
|
128
|
-
end:
|
100
|
+
start: val => [['insetInlineStart', val]],
|
101
|
+
end: val => [['insetInlineEnd', val]]
|
129
102
|
};
|
130
103
|
const expansions = {
|
131
104
|
...shorthands,
|
132
105
|
...aliases
|
133
106
|
};
|
134
|
-
var _default = expansions;
|
135
|
-
exports.default = _default;
|
107
|
+
var _default = exports.default = expansions;
|
@@ -0,0 +1,98 @@
|
|
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 { TStyleValue } from '../common-types';
|
11
|
+
|
12
|
+
/// # Handle CSS shorthands in a React Native compatible way.
|
13
|
+
///
|
14
|
+
/// This means:
|
15
|
+
/// - disallowing certain properties altogether by throwing errors
|
16
|
+
/// - disallowing multiple values within many shorthands
|
17
|
+
/// - Treating certain non-standard properties as aliases for real CSS properties
|
18
|
+
|
19
|
+
type TReturn = $ReadOnlyArray<[string, TStyleValue]>;
|
20
|
+
|
21
|
+
declare const shorthands: {
|
22
|
+
all: (_: TStyleValue) => TReturn,
|
23
|
+
animation: (_value: TStyleValue) => TReturn,
|
24
|
+
background: (_value: TStyleValue) => TReturn,
|
25
|
+
border: (_rawValue: TStyleValue) => TReturn,
|
26
|
+
borderInline: (_rawValue: TStyleValue) => TReturn,
|
27
|
+
borderBlock: (_rawValue: TStyleValue) => TReturn,
|
28
|
+
borderTop: (_rawValue: TStyleValue) => TReturn,
|
29
|
+
borderInlineEnd: (_rawValue: TStyleValue) => TReturn,
|
30
|
+
borderRight: (_rawValue: TStyleValue) => TReturn,
|
31
|
+
borderBottom: (_rawValue: TStyleValue) => TReturn,
|
32
|
+
borderInlineStart: (_rawValue: TStyleValue) => TReturn,
|
33
|
+
borderLeft: (_rawValue: TStyleValue) => TReturn,
|
34
|
+
};
|
35
|
+
|
36
|
+
declare const aliases: {
|
37
|
+
borderHorizontal: $FlowFixMe,
|
38
|
+
borderVertical: $FlowFixMe,
|
39
|
+
borderBlockStart: $FlowFixMe,
|
40
|
+
borderEnd: $FlowFixMe,
|
41
|
+
borderBlockEnd: $FlowFixMe,
|
42
|
+
borderStart: $FlowFixMe,
|
43
|
+
blockSize: (val: TStyleValue) => TReturn,
|
44
|
+
inlineSize: (val: TStyleValue) => TReturn,
|
45
|
+
minBlockSize: (val: TStyleValue) => TReturn,
|
46
|
+
minInlineSize: (val: TStyleValue) => TReturn,
|
47
|
+
maxBlockSize: (val: TStyleValue) => TReturn,
|
48
|
+
maxInlineSize: (val: TStyleValue) => TReturn,
|
49
|
+
borderHorizontalWidth: (val: TStyleValue) => TReturn,
|
50
|
+
borderHorizontalStyle: (val: TStyleValue) => TReturn,
|
51
|
+
borderHorizontalColor: (val: TStyleValue) => TReturn,
|
52
|
+
borderVerticalWidth: (val: TStyleValue) => TReturn,
|
53
|
+
borderVerticalStyle: (val: TStyleValue) => TReturn,
|
54
|
+
borderVerticalColor: (val: TStyleValue) => TReturn,
|
55
|
+
borderBlockStartColor: (value: TStyleValue) => TReturn,
|
56
|
+
borderBlockEndColor: (value: TStyleValue) => TReturn,
|
57
|
+
borderBlockStartStyle: (value: TStyleValue) => TReturn,
|
58
|
+
borderBlockEndStyle: (value: TStyleValue) => TReturn,
|
59
|
+
borderBlockStartWidth: (value: TStyleValue) => TReturn,
|
60
|
+
borderBlockEndWidth: (value: TStyleValue) => TReturn,
|
61
|
+
borderStartColor: (val: TStyleValue) => TReturn,
|
62
|
+
borderEndColor: (val: TStyleValue) => TReturn,
|
63
|
+
borderStartStyle: (val: TStyleValue) => TReturn,
|
64
|
+
borderEndStyle: (val: TStyleValue) => TReturn,
|
65
|
+
borderStartWidth: (val: TStyleValue) => TReturn,
|
66
|
+
borderEndWidth: (val: TStyleValue) => TReturn,
|
67
|
+
borderTopStartRadius: (value: TStyleValue) => TReturn,
|
68
|
+
borderTopEndRadius: (value: TStyleValue) => TReturn,
|
69
|
+
borderBottomStartRadius: (value: TStyleValue) => TReturn,
|
70
|
+
borderBottomEndRadius: (value: TStyleValue) => TReturn,
|
71
|
+
containIntrinsicBlockSize: (value: TStyleValue) => TReturn,
|
72
|
+
containIntrinsicInlineSize: (value: TStyleValue) => TReturn,
|
73
|
+
marginBlockStart: (value: TStyleValue) => TReturn,
|
74
|
+
marginBlockEnd: (value: TStyleValue) => TReturn,
|
75
|
+
marginStart: (val: TStyleValue) => TReturn,
|
76
|
+
marginEnd: (val: TStyleValue) => TReturn,
|
77
|
+
marginHorizontal: (val: TStyleValue) => TReturn,
|
78
|
+
marginVertical: (val: TStyleValue) => TReturn,
|
79
|
+
overflowBlock: (value: TStyleValue) => TReturn,
|
80
|
+
overflowInline: (value: TStyleValue) => TReturn,
|
81
|
+
paddingBlockStart: (rawValue: TStyleValue) => TReturn,
|
82
|
+
paddingBlockEnd: (rawValue: TStyleValue) => TReturn,
|
83
|
+
paddingStart: (val: TStyleValue) => TReturn,
|
84
|
+
paddingEnd: (val: TStyleValue) => TReturn,
|
85
|
+
paddingHorizontal: (val: TStyleValue) => TReturn,
|
86
|
+
paddingVertical: (val: TStyleValue) => TReturn,
|
87
|
+
scrollMarginBlockStart: (value: TStyleValue) => TReturn,
|
88
|
+
scrollMarginBlockEnd: (value: TStyleValue) => TReturn,
|
89
|
+
insetBlockStart: (value: TStyleValue) => TReturn,
|
90
|
+
insetBlockEnd: (value: TStyleValue) => TReturn,
|
91
|
+
start: (val: TStyleValue) => TReturn,
|
92
|
+
end: (val: TStyleValue) => TReturn,
|
93
|
+
};
|
94
|
+
|
95
|
+
declare export default $ReadOnly<{
|
96
|
+
...typeof shorthands,
|
97
|
+
...typeof aliases,
|
98
|
+
}>;
|