react-native-css 3.0.0-preview.0 → 3.0.0-preview.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/babel/index.js +6 -2
- package/dist/commonjs/babel/index.js.map +1 -1
- package/dist/commonjs/compiler/atRules.js +3 -1
- package/dist/commonjs/compiler/atRules.js.map +1 -1
- package/dist/commonjs/compiler/declarations.js +114 -35
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/stylesheet.js +5 -0
- package/dist/commonjs/compiler/stylesheet.js.map +1 -1
- package/dist/commonjs/jest/index.js +0 -1
- package/dist/commonjs/jest/index.js.map +1 -1
- package/dist/commonjs/runtime/native/api.js +21 -2
- package/dist/commonjs/runtime/native/api.js.map +1 -1
- package/dist/commonjs/runtime/native/reactivity.js +1 -5
- package/dist/commonjs/runtime/native/reactivity.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/line-height.js +25 -0
- package/dist/commonjs/runtime/native/styles/line-height.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/resolve.js +2 -0
- package/dist/commonjs/runtime/native/styles/resolve.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js +19 -11
- package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/units.js +10 -8
- package/dist/commonjs/runtime/native/styles/units.js.map +1 -1
- package/dist/commonjs/runtime/web/api.js +18 -0
- package/dist/commonjs/runtime/web/api.js.map +1 -1
- package/dist/commonjs/style-collection/root.js +1 -0
- package/dist/commonjs/style-collection/root.js.map +1 -1
- package/dist/module/babel/index.js +2 -2
- package/dist/module/babel/index.js.map +1 -1
- package/dist/module/compiler/atRules.js +3 -1
- package/dist/module/compiler/atRules.js.map +1 -1
- package/dist/module/compiler/declarations.js +109 -35
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/stylesheet.js +5 -0
- package/dist/module/compiler/stylesheet.js.map +1 -1
- package/dist/module/jest/index.js +1 -2
- package/dist/module/jest/index.js.map +1 -1
- package/dist/module/runtime/native/api.js +21 -3
- package/dist/module/runtime/native/api.js.map +1 -1
- package/dist/module/runtime/native/reactivity.js +0 -4
- package/dist/module/runtime/native/reactivity.js.map +1 -1
- package/dist/module/runtime/native/styles/line-height.js +20 -0
- package/dist/module/runtime/native/styles/line-height.js.map +1 -0
- package/dist/module/runtime/native/styles/resolve.js +2 -0
- package/dist/module/runtime/native/styles/resolve.js.map +1 -1
- package/dist/module/runtime/native/styles/shorthands/box-shadow.js +19 -11
- package/dist/module/runtime/native/styles/shorthands/box-shadow.js.map +1 -1
- package/dist/module/runtime/native/styles/units.js +11 -8
- package/dist/module/runtime/native/styles/units.js.map +1 -1
- package/dist/module/runtime/web/api.js +18 -1
- package/dist/module/runtime/web/api.js.map +1 -1
- package/dist/module/style-collection/root.js +1 -0
- package/dist/module/style-collection/root.js.map +1 -1
- package/dist/typescript/commonjs/src/babel/index.d.ts +3 -0
- package/dist/typescript/commonjs/src/babel/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +15 -4
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/api.d.ts +13 -1
- package/dist/typescript/commonjs/src/runtime/native/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts +0 -2
- package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/line-height.d.ts +3 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/line-height.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/units.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/web/api.d.ts +8 -2
- package/dist/typescript/commonjs/src/runtime/web/api.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/index.d.ts +3 -0
- package/dist/typescript/module/src/babel/index.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/declarations.d.ts +15 -4
- package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/api.d.ts +13 -1
- package/dist/typescript/module/src/runtime/native/api.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/reactivity.d.ts +0 -2
- package/dist/typescript/module/src/runtime/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/line-height.d.ts +3 -0
- package/dist/typescript/module/src/runtime/native/styles/line-height.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/units.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/web/api.d.ts +8 -2
- package/dist/typescript/module/src/runtime/web/api.d.ts.map +1 -1
- package/package.json +9 -10
- package/src/babel/index.ts +2 -2
- package/src/compiler/atRules.ts +2 -0
- package/src/compiler/declarations.ts +156 -46
- package/src/compiler/stylesheet.ts +6 -0
- package/src/jest/index.ts +1 -2
- package/src/runtime/native/{api.ts → api.tsx} +31 -4
- package/src/runtime/native/reactivity.ts +0 -4
- package/src/runtime/native/styles/line-height.ts +25 -0
- package/src/runtime/native/styles/resolve.ts +2 -0
- package/src/runtime/native/styles/shorthands/box-shadow.ts +24 -18
- package/src/runtime/native/styles/units.ts +13 -8
- package/src/runtime/web/{api.ts → api.tsx} +28 -2
- package/src/style-collection/root.ts +2 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
// cSpell:ignore rcap,vmin,svmin,lvmin,dvmin,cqmin,vmax,svmax,lvmax,dvmax,cqmax,currentcolor,oklab,oklch,prophoto
|
|
3
|
+
// cSpell:ignore rcap,vmin,svmin,lvmin,dvmin,cqmin,vmax,svmax,lvmax,dvmax,cqmax,currentcolor,oklab,oklch,prophoto,squircle,oldstyle,nums
|
|
4
4
|
|
|
5
5
|
import Color from "colorjs.io";
|
|
6
6
|
import { parseEasingFunction, parseIterationCount } from "./keyframes.js";
|
|
@@ -9,9 +9,7 @@ const CommaSeparator = Symbol("CommaSeparator");
|
|
|
9
9
|
const propertyRename = {
|
|
10
10
|
"background-image": "experimental_backgroundImage"
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
// TODO: We need a better way to handle this
|
|
14
|
-
const unparsedRuntimeParsing = new Set(["animation", "border", "box-shadow", "text-shadow", "transform", "scale", "rotate", "translate"]);
|
|
12
|
+
const unparsedRuntimeParsing = new Set(["animation", "border", "box-shadow", "line-height", "rotate", "scale", "text-shadow", "transform", "translate"]);
|
|
15
13
|
const parsers = {
|
|
16
14
|
"align-content": parseAlignContent,
|
|
17
15
|
"align-items": parseAlignItems,
|
|
@@ -26,6 +24,7 @@ const parsers = {
|
|
|
26
24
|
"animation-play-state": addAnimationValue,
|
|
27
25
|
"animation-timing-function": addAnimationValue,
|
|
28
26
|
"aspect-ratio": parseAspectRatio,
|
|
27
|
+
"backface-visibility": parseBackfaceVisibility,
|
|
29
28
|
"background-color": parseColorDeclaration,
|
|
30
29
|
"background-image": parseBackgroundImage,
|
|
31
30
|
"block-size": parseSizeDeclaration,
|
|
@@ -81,8 +80,9 @@ const parsers = {
|
|
|
81
80
|
"border-top-style": parseBorderStyleDeclaration,
|
|
82
81
|
"border-top-width": parseBorderSideWidthDeclaration,
|
|
83
82
|
"border-width": parseBorderWidth,
|
|
84
|
-
"bottom":
|
|
83
|
+
"bottom": parseSizeWithAutoDeclaration,
|
|
85
84
|
"box-shadow": parseBoxShadow,
|
|
85
|
+
"box-sizing": parseBoxSizing,
|
|
86
86
|
"caret-color": parseColorOrAutoDeclaration,
|
|
87
87
|
"color": parseFontColorDeclaration,
|
|
88
88
|
"column-gap": parseGap,
|
|
@@ -90,10 +90,11 @@ const parsers = {
|
|
|
90
90
|
"container-name": parseContainerName,
|
|
91
91
|
"container-type": parseContainerType,
|
|
92
92
|
"display": parseDisplay,
|
|
93
|
+
"direction": parseDirection,
|
|
93
94
|
"fill": parseSVGPaint,
|
|
94
95
|
"filter": parseFilter,
|
|
95
96
|
"flex": parseFlex,
|
|
96
|
-
"flex-basis":
|
|
97
|
+
"flex-basis": parseLengthPercentageDeclaration,
|
|
97
98
|
"flex-direction": ({
|
|
98
99
|
value
|
|
99
100
|
}) => value,
|
|
@@ -114,30 +115,30 @@ const parsers = {
|
|
|
114
115
|
"font-variant-caps": parseFontVariantCapsDeclaration,
|
|
115
116
|
"font-weight": parseFontWeightDeclaration,
|
|
116
117
|
"gap": parseGap,
|
|
117
|
-
"height":
|
|
118
|
-
"inline-size":
|
|
118
|
+
"height": parseSizeWithAutoDeclaration,
|
|
119
|
+
"inline-size": parseSizeWithAutoDeclaration,
|
|
119
120
|
"inset": parseInset,
|
|
120
121
|
"inset-block": parseInsetBlock,
|
|
121
|
-
"inset-block-end":
|
|
122
|
-
"inset-block-start":
|
|
122
|
+
"inset-block-end": parseLengthPercentageDeclaration,
|
|
123
|
+
"inset-block-start": parseLengthPercentageDeclaration,
|
|
123
124
|
"inset-inline": parseInsetInline,
|
|
124
|
-
"inset-inline-end":
|
|
125
|
-
"inset-inline-start":
|
|
125
|
+
"inset-inline-end": parseLengthPercentageDeclaration,
|
|
126
|
+
"inset-inline-start": parseLengthPercentageDeclaration,
|
|
126
127
|
"justify-content": parseJustifyContent,
|
|
127
|
-
"left":
|
|
128
|
+
"left": parseSizeWithAutoDeclaration,
|
|
128
129
|
"letter-spacing": parseLetterSpacing,
|
|
129
130
|
"line-height": parseLineHeightDeclaration,
|
|
130
131
|
"margin": parseMargin,
|
|
131
132
|
"margin-block": parseMarginBlock,
|
|
132
133
|
"margin-block-end": parseLengthPercentageOrAutoDeclaration,
|
|
133
134
|
"margin-block-start": parseLengthPercentageOrAutoDeclaration,
|
|
134
|
-
"margin-bottom":
|
|
135
|
+
"margin-bottom": parseSizeWithAutoDeclaration,
|
|
135
136
|
"margin-inline": parseMarginInline,
|
|
136
137
|
"margin-inline-end": parseLengthPercentageOrAutoDeclaration,
|
|
137
138
|
"margin-inline-start": parseLengthPercentageOrAutoDeclaration,
|
|
138
|
-
"margin-left":
|
|
139
|
-
"margin-right":
|
|
140
|
-
"margin-top":
|
|
139
|
+
"margin-left": parseSizeWithAutoDeclaration,
|
|
140
|
+
"margin-right": parseSizeWithAutoDeclaration,
|
|
141
|
+
"margin-top": parseSizeWithAutoDeclaration,
|
|
141
142
|
"max-block-size": parseSizeDeclaration,
|
|
142
143
|
"max-height": parseSizeDeclaration,
|
|
143
144
|
"max-inline-size": parseSizeDeclaration,
|
|
@@ -148,21 +149,24 @@ const parsers = {
|
|
|
148
149
|
"min-width": parseSizeDeclaration,
|
|
149
150
|
"opacity": ({
|
|
150
151
|
value
|
|
151
|
-
}) => value,
|
|
152
|
+
}) => round(value),
|
|
153
|
+
"outline-color": parseColorDeclaration,
|
|
154
|
+
"outline-style": parseOutlineStyle,
|
|
155
|
+
"outline-width": parseBorderSideWidthDeclaration,
|
|
152
156
|
"overflow": parseOverflow,
|
|
153
157
|
"padding": parsePadding,
|
|
154
158
|
"padding-block": parsePaddingBlock,
|
|
155
|
-
"padding-block-end":
|
|
156
|
-
"padding-block-start":
|
|
159
|
+
"padding-block-end": parseLengthPercentageDeclaration,
|
|
160
|
+
"padding-block-start": parseLengthPercentageDeclaration,
|
|
157
161
|
"padding-bottom": parseSizeDeclaration,
|
|
158
162
|
"padding-inline": parsePaddingInline,
|
|
159
|
-
"padding-inline-end":
|
|
160
|
-
"padding-inline-start":
|
|
163
|
+
"padding-inline-end": parseLengthPercentageDeclaration,
|
|
164
|
+
"padding-inline-start": parseLengthPercentageDeclaration,
|
|
161
165
|
"padding-left": parseSizeDeclaration,
|
|
162
166
|
"padding-right": parseSizeDeclaration,
|
|
163
167
|
"padding-top": parseSizeDeclaration,
|
|
164
168
|
"position": parsePosition,
|
|
165
|
-
"right":
|
|
169
|
+
"right": parseSizeWithAutoDeclaration,
|
|
166
170
|
"rotate": parseRotate,
|
|
167
171
|
"row-gap": parseGap,
|
|
168
172
|
"scale": parseScale,
|
|
@@ -177,7 +181,7 @@ const parsers = {
|
|
|
177
181
|
"text-transform": ({
|
|
178
182
|
value
|
|
179
183
|
}) => value.case,
|
|
180
|
-
"top":
|
|
184
|
+
"top": parseSizeWithAutoDeclaration,
|
|
181
185
|
"transform": parseTransform,
|
|
182
186
|
"transition": addTransitionValue,
|
|
183
187
|
"transition-delay": addTransitionValue,
|
|
@@ -188,7 +192,7 @@ const parsers = {
|
|
|
188
192
|
"user-select": parseUserSelect,
|
|
189
193
|
"vertical-align": parseVerticalAlign,
|
|
190
194
|
"visibility": parseVisibility,
|
|
191
|
-
"width":
|
|
195
|
+
"width": parseSizeWithAutoDeclaration,
|
|
192
196
|
"z-index": parseZIndex
|
|
193
197
|
};
|
|
194
198
|
|
|
@@ -393,16 +397,24 @@ function parseMarginBlock({
|
|
|
393
397
|
value
|
|
394
398
|
}, builder) {
|
|
395
399
|
builder.addShorthand("margin-block", {
|
|
396
|
-
"margin-block-start": parseLengthPercentageOrAuto(value.blockStart, builder
|
|
397
|
-
|
|
400
|
+
"margin-block-start": parseLengthPercentageOrAuto(value.blockStart, builder, {
|
|
401
|
+
allowAuto: true
|
|
402
|
+
}),
|
|
403
|
+
"margin-block-end": parseLengthPercentageOrAuto(value.blockEnd, builder, {
|
|
404
|
+
allowAuto: true
|
|
405
|
+
})
|
|
398
406
|
});
|
|
399
407
|
}
|
|
400
408
|
function parseMarginInline({
|
|
401
409
|
value
|
|
402
410
|
}, builder) {
|
|
403
411
|
builder.addShorthand("margin-inline", {
|
|
404
|
-
"margin-inline-start": parseLengthPercentageOrAuto(value.inlineStart, builder
|
|
405
|
-
|
|
412
|
+
"margin-inline-start": parseLengthPercentageOrAuto(value.inlineStart, builder, {
|
|
413
|
+
allowAuto: true
|
|
414
|
+
}),
|
|
415
|
+
"margin-inline-end": parseLengthPercentageOrAuto(value.inlineEnd, builder, {
|
|
416
|
+
allowAuto: true
|
|
417
|
+
})
|
|
406
418
|
});
|
|
407
419
|
}
|
|
408
420
|
function parsePadding({
|
|
@@ -604,13 +616,24 @@ export function parseCustomDeclaration(declaration, builder) {
|
|
|
604
616
|
if (property === "-webkit-line-clamp") {
|
|
605
617
|
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
606
618
|
} else if (property === "-rn-ripple-style") {
|
|
607
|
-
|
|
619
|
+
if (parseUnparsed(declaration.value.value, builder, property) === "borderless") {
|
|
620
|
+
builder.addDescriptor(property, true);
|
|
621
|
+
}
|
|
622
|
+
} else if (property === "-rn-ripple-layer") {
|
|
623
|
+
if (parseUnparsed(declaration.value.value, builder, property) === "foreground") {
|
|
624
|
+
builder.addDescriptor(property, true);
|
|
625
|
+
}
|
|
608
626
|
} else if (property === "object-fit") {
|
|
609
627
|
// https://github.com/parcel-bundler/lightningcss/issues/1046
|
|
610
628
|
parseObjectFit(declaration.value, builder);
|
|
611
629
|
} else if (property === "object-position") {
|
|
612
630
|
// https://github.com/parcel-bundler/lightningcss/issues/1047
|
|
613
631
|
parseObjectPosition(declaration.value, builder);
|
|
632
|
+
} else if (property === "outline-offset") {
|
|
633
|
+
// https://github.com/parcel-bundler/lightningcss/issues/1048
|
|
634
|
+
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
635
|
+
} else if (property === "corner-shape") {
|
|
636
|
+
parseCornerShape(declaration.value, builder);
|
|
614
637
|
} else if (validProperties.has(property) || property.startsWith("--") || property.startsWith("-rn-")) {
|
|
615
638
|
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
616
639
|
} else {
|
|
@@ -983,6 +1006,11 @@ export function parseAngle(angle, builder) {
|
|
|
983
1006
|
export function parseSizeDeclaration(declaration, builder) {
|
|
984
1007
|
return parseSize(declaration.value, builder);
|
|
985
1008
|
}
|
|
1009
|
+
export function parseSizeWithAutoDeclaration(declaration, builder) {
|
|
1010
|
+
return parseSize(declaration.value, builder, {
|
|
1011
|
+
allowAuto: true
|
|
1012
|
+
});
|
|
1013
|
+
}
|
|
986
1014
|
export function parsePointerEvents({
|
|
987
1015
|
value
|
|
988
1016
|
}, builder) {
|
|
@@ -1198,9 +1226,14 @@ export function parseColor(cssColor, builder) {
|
|
|
1198
1226
|
});
|
|
1199
1227
|
}
|
|
1200
1228
|
}
|
|
1201
|
-
export function
|
|
1229
|
+
export function parseLengthPercentageDeclaration(value, builder) {
|
|
1202
1230
|
return parseLengthPercentageOrAuto(value.value, builder);
|
|
1203
1231
|
}
|
|
1232
|
+
export function parseLengthPercentageOrAutoDeclaration(value, builder) {
|
|
1233
|
+
return parseLengthPercentageOrAuto(value.value, builder, {
|
|
1234
|
+
allowAuto: true
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1204
1237
|
export function parseLengthPercentageOrAuto(lengthPercentageOrAuto, builder, {
|
|
1205
1238
|
allowAuto = false
|
|
1206
1239
|
} = {}) {
|
|
@@ -1246,7 +1279,7 @@ export function parseJustifyContent(declaration, builder) {
|
|
|
1246
1279
|
return value;
|
|
1247
1280
|
}
|
|
1248
1281
|
export function parseAlignContent(declaration, builder) {
|
|
1249
|
-
const allowed = new Set(["flex-start", "flex-end", "center", "stretch", "space-between", "space-around"]);
|
|
1282
|
+
const allowed = new Set(["flex-start", "flex-end", "center", "stretch", "space-between", "space-around", "space-evenly"]);
|
|
1250
1283
|
let value;
|
|
1251
1284
|
switch (declaration.value.type) {
|
|
1252
1285
|
case "normal":
|
|
@@ -1390,7 +1423,7 @@ export function parseTextDecorationLine(value, builder) {
|
|
|
1390
1423
|
export function parsePosition({
|
|
1391
1424
|
value
|
|
1392
1425
|
}, builder) {
|
|
1393
|
-
if (value.type === "absolute" || value.type === "relative") {
|
|
1426
|
+
if (value.type === "absolute" || value.type === "relative" || value.type === "static") {
|
|
1394
1427
|
return value.type;
|
|
1395
1428
|
}
|
|
1396
1429
|
builder.addWarning("value", value.type);
|
|
@@ -1474,7 +1507,7 @@ function parseFontFamily({
|
|
|
1474
1507
|
return value[0];
|
|
1475
1508
|
}
|
|
1476
1509
|
export function parseLineHeightDeclaration(declaration, builder) {
|
|
1477
|
-
|
|
1510
|
+
builder.addDescriptor("line-height", [{}, "lineHeight", [parseLineHeight(declaration.value, builder)], 1]);
|
|
1478
1511
|
}
|
|
1479
1512
|
export function parseLineHeight(value, builder) {
|
|
1480
1513
|
switch (value.type) {
|
|
@@ -1600,11 +1633,18 @@ export function parseBoxShadow({
|
|
|
1600
1633
|
builder.addDescriptor(`boxShadow.[${index}].inset`, shadow.inset ? true : undefined);
|
|
1601
1634
|
}
|
|
1602
1635
|
}
|
|
1636
|
+
export function parseBoxSizing(declaration, builder) {
|
|
1637
|
+
if (["border-box", "content-box"].includes(declaration.value)) {
|
|
1638
|
+
return declaration.value;
|
|
1639
|
+
}
|
|
1640
|
+
builder.addWarning("value", declaration.value);
|
|
1641
|
+
return undefined;
|
|
1642
|
+
}
|
|
1603
1643
|
export function parseDisplay({
|
|
1604
1644
|
value
|
|
1605
1645
|
}, builder) {
|
|
1606
1646
|
if (value.type === "keyword") {
|
|
1607
|
-
if (value.value === "none") {
|
|
1647
|
+
if (value.value === "none" || value.value === "contents") {
|
|
1608
1648
|
return value.value;
|
|
1609
1649
|
} else {
|
|
1610
1650
|
builder.addWarning("value", value.value);
|
|
@@ -1655,6 +1695,14 @@ export function parseDisplay({
|
|
|
1655
1695
|
}
|
|
1656
1696
|
}
|
|
1657
1697
|
}
|
|
1698
|
+
export function parseDirection(declaration, builder) {
|
|
1699
|
+
if (["ltr", "rtl"].includes(declaration.value)) {
|
|
1700
|
+
builder.addDescriptor("direction", declaration.value);
|
|
1701
|
+
builder.addDescriptor("--__rn-css-direction", declaration.value);
|
|
1702
|
+
}
|
|
1703
|
+
builder.addWarning("value", declaration.value);
|
|
1704
|
+
return;
|
|
1705
|
+
}
|
|
1658
1706
|
export function parseAspectRatio({
|
|
1659
1707
|
value
|
|
1660
1708
|
}) {
|
|
@@ -1671,6 +1719,16 @@ export function parseAspectRatio({
|
|
|
1671
1719
|
}
|
|
1672
1720
|
}
|
|
1673
1721
|
}
|
|
1722
|
+
export function parseBackfaceVisibility({
|
|
1723
|
+
value
|
|
1724
|
+
}, builder) {
|
|
1725
|
+
if (["visible", "hidden"].includes(value)) {
|
|
1726
|
+
return value;
|
|
1727
|
+
} else {
|
|
1728
|
+
builder.addWarning("value", value);
|
|
1729
|
+
return;
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1674
1732
|
export function parseDimension({
|
|
1675
1733
|
unit,
|
|
1676
1734
|
value
|
|
@@ -2080,6 +2138,14 @@ function parseObjectPosition(declaration, builder) {
|
|
|
2080
2138
|
});
|
|
2081
2139
|
builder.addDescriptor("object-position", [{}, "join", [parseUnparsed(declaration.value, builder, "object-position"), " "]]);
|
|
2082
2140
|
}
|
|
2141
|
+
function parseCornerShape(declaration, builder) {
|
|
2142
|
+
const shape = parseUnparsed(declaration.value, builder, "corner-shape");
|
|
2143
|
+
if (shape === "round") {
|
|
2144
|
+
builder.addDescriptor("borderCurve", "circular");
|
|
2145
|
+
} else if (shape === "squircle") {
|
|
2146
|
+
builder.addDescriptor("borderCurve", "continuous");
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2083
2149
|
function parseVisibility(declaration, builder) {
|
|
2084
2150
|
if (declaration.value === "visible") {
|
|
2085
2151
|
builder.addDescriptor("opacity", 1);
|
|
@@ -2089,6 +2155,14 @@ function parseVisibility(declaration, builder) {
|
|
|
2089
2155
|
builder.addWarning("value", declaration.value);
|
|
2090
2156
|
}
|
|
2091
2157
|
}
|
|
2158
|
+
function parseOutlineStyle(declaration, builder) {
|
|
2159
|
+
const allowed = ["solid", "dotted", "dashed"];
|
|
2160
|
+
if (declaration.value.type !== "auto" && allowed.includes(declaration.value.value)) {
|
|
2161
|
+
builder.addDescriptor("outlineStyle", declaration.value.value);
|
|
2162
|
+
} else {
|
|
2163
|
+
builder.addWarning("value", declaration.value.type === "auto" ? "auto" : declaration.value.value);
|
|
2164
|
+
}
|
|
2165
|
+
}
|
|
2092
2166
|
function parseFilter(declaration, builder) {
|
|
2093
2167
|
if (declaration.value.type === "none") {
|
|
2094
2168
|
return "unset";
|