react-native-css 3.0.0-nightly.61014be → 3.0.0-nightly.d8cb1bc

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.
Files changed (214) hide show
  1. package/dist/commonjs/compiler/atRules.js +1 -1
  2. package/dist/commonjs/compiler/attributes.test.js +1 -1
  3. package/dist/commonjs/compiler/attributes.test.js.map +1 -1
  4. package/dist/commonjs/compiler/compiler.js +26 -17
  5. package/dist/commonjs/compiler/compiler.js.map +1 -1
  6. package/dist/commonjs/compiler/declarations.js +173 -74
  7. package/dist/commonjs/compiler/declarations.js.map +1 -1
  8. package/dist/commonjs/compiler/inheritance.test.js +7 -7
  9. package/dist/commonjs/compiler/inheritance.test.js.map +1 -1
  10. package/dist/commonjs/compiler/selector-builder.js +457 -0
  11. package/dist/commonjs/compiler/selector-builder.js.map +1 -0
  12. package/dist/commonjs/compiler/selectors.js +10 -6
  13. package/dist/commonjs/compiler/selectors.js.map +1 -1
  14. package/dist/commonjs/compiler/stylesheet.js +113 -39
  15. package/dist/commonjs/compiler/stylesheet.js.map +1 -1
  16. package/dist/commonjs/jest/index.js +23 -7
  17. package/dist/commonjs/jest/index.js.map +1 -1
  18. package/dist/commonjs/metro/index.js +1 -1
  19. package/dist/commonjs/metro/index.js.map +1 -1
  20. package/dist/commonjs/poison.pill.js +4 -1
  21. package/dist/commonjs/poison.pill.js.map +1 -1
  22. package/dist/commonjs/runtime/native/conditions/attributes.js +42 -0
  23. package/dist/commonjs/runtime/native/conditions/attributes.js.map +1 -0
  24. package/dist/commonjs/runtime/native/conditions/container-query.js +28 -21
  25. package/dist/commonjs/runtime/native/conditions/container-query.js.map +1 -1
  26. package/dist/commonjs/runtime/native/conditions/guards.js.map +1 -1
  27. package/dist/commonjs/runtime/native/conditions/index.js +10 -46
  28. package/dist/commonjs/runtime/native/conditions/index.js.map +1 -1
  29. package/dist/commonjs/runtime/native/conditions/media-query.js +17 -17
  30. package/dist/commonjs/runtime/native/conditions/media-query.js.map +1 -1
  31. package/dist/commonjs/runtime/native/injection.js +3 -2
  32. package/dist/commonjs/runtime/native/injection.js.map +1 -1
  33. package/dist/commonjs/runtime/native/react/interaction.js +10 -10
  34. package/dist/commonjs/runtime/native/react/interaction.js.map +1 -1
  35. package/dist/commonjs/runtime/native/react/rules.js +9 -9
  36. package/dist/commonjs/runtime/native/react/rules.js.map +1 -1
  37. package/dist/commonjs/runtime/native/react/useNativeCss.js +1 -0
  38. package/dist/commonjs/runtime/native/react/useNativeCss.js.map +1 -1
  39. package/dist/commonjs/runtime/native/reactivity.js +1 -12
  40. package/dist/commonjs/runtime/native/reactivity.js.map +1 -1
  41. package/dist/commonjs/runtime/native/root.js +28 -0
  42. package/dist/commonjs/runtime/native/root.js.map +1 -0
  43. package/dist/commonjs/runtime/native/styles/calculate-props.js +53 -48
  44. package/dist/commonjs/runtime/native/styles/calculate-props.js.map +1 -1
  45. package/dist/commonjs/runtime/native/styles/index.js +12 -12
  46. package/dist/commonjs/runtime/native/styles/index.js.map +1 -1
  47. package/dist/commonjs/runtime/native/styles/units.js +6 -3
  48. package/dist/commonjs/runtime/native/styles/units.js.map +1 -1
  49. package/dist/commonjs/runtime/native/styles/variables.js +3 -2
  50. package/dist/commonjs/runtime/native/styles/variables.js.map +1 -1
  51. package/dist/commonjs/runtime/utils/specificity.js +2 -1
  52. package/dist/commonjs/runtime/utils/specificity.js.map +1 -1
  53. package/dist/module/compiler/atRules.js +1 -1
  54. package/dist/module/compiler/attributes.test.js +1 -1
  55. package/dist/module/compiler/attributes.test.js.map +1 -1
  56. package/dist/module/compiler/compiler.js +26 -17
  57. package/dist/module/compiler/compiler.js.map +1 -1
  58. package/dist/module/compiler/compiler.types.js.map +1 -1
  59. package/dist/module/compiler/declarations.js +168 -70
  60. package/dist/module/compiler/declarations.js.map +1 -1
  61. package/dist/module/compiler/inheritance.test.js +7 -7
  62. package/dist/module/compiler/inheritance.test.js.map +1 -1
  63. package/dist/module/compiler/selector-builder.js +452 -0
  64. package/dist/module/compiler/selector-builder.js.map +1 -0
  65. package/dist/module/compiler/selectors.js +10 -6
  66. package/dist/module/compiler/selectors.js.map +1 -1
  67. package/dist/module/compiler/stylesheet.js +112 -38
  68. package/dist/module/compiler/stylesheet.js.map +1 -1
  69. package/dist/module/jest/index.js +23 -7
  70. package/dist/module/jest/index.js.map +1 -1
  71. package/dist/module/metro/index.js +1 -1
  72. package/dist/module/metro/index.js.map +1 -1
  73. package/dist/module/poison.pill.js +4 -1
  74. package/dist/module/poison.pill.js.map +1 -1
  75. package/dist/module/runtime/native/conditions/attributes.js +38 -0
  76. package/dist/module/runtime/native/conditions/attributes.js.map +1 -0
  77. package/dist/module/runtime/native/conditions/container-query.js +28 -21
  78. package/dist/module/runtime/native/conditions/container-query.js.map +1 -1
  79. package/dist/module/runtime/native/conditions/guards.js.map +1 -1
  80. package/dist/module/runtime/native/conditions/index.js +10 -46
  81. package/dist/module/runtime/native/conditions/index.js.map +1 -1
  82. package/dist/module/runtime/native/conditions/media-query.js +17 -17
  83. package/dist/module/runtime/native/conditions/media-query.js.map +1 -1
  84. package/dist/module/runtime/native/injection.js +2 -1
  85. package/dist/module/runtime/native/injection.js.map +1 -1
  86. package/dist/module/runtime/native/react/interaction.js +10 -10
  87. package/dist/module/runtime/native/react/interaction.js.map +1 -1
  88. package/dist/module/runtime/native/react/rules.js +9 -9
  89. package/dist/module/runtime/native/react/rules.js.map +1 -1
  90. package/dist/module/runtime/native/react/useNativeCss.js +1 -0
  91. package/dist/module/runtime/native/react/useNativeCss.js.map +1 -1
  92. package/dist/module/runtime/native/reactivity.js +0 -11
  93. package/dist/module/runtime/native/reactivity.js.map +1 -1
  94. package/dist/module/runtime/native/root.js +24 -0
  95. package/dist/module/runtime/native/root.js.map +1 -0
  96. package/dist/module/runtime/native/styles/calculate-props.js +53 -48
  97. package/dist/module/runtime/native/styles/calculate-props.js.map +1 -1
  98. package/dist/module/runtime/native/styles/index.js +12 -12
  99. package/dist/module/runtime/native/styles/index.js.map +1 -1
  100. package/dist/module/runtime/native/styles/units.js +6 -3
  101. package/dist/module/runtime/native/styles/units.js.map +1 -1
  102. package/dist/module/runtime/native/styles/variables.js +2 -1
  103. package/dist/module/runtime/native/styles/variables.js.map +1 -1
  104. package/dist/module/runtime/utils/specificity.js +2 -1
  105. package/dist/module/runtime/utils/specificity.js.map +1 -1
  106. package/dist/typescript/commonjs/src/compiler/compiler.d.ts +9 -2
  107. package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
  108. package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +5 -4
  109. package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
  110. package/dist/typescript/commonjs/src/compiler/declarations.d.ts +16 -19
  111. package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
  112. package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts +23 -0
  113. package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -0
  114. package/dist/typescript/commonjs/src/compiler/selectors.d.ts +3 -2
  115. package/dist/typescript/commonjs/src/compiler/selectors.d.ts.map +1 -1
  116. package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +21 -7
  117. package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
  118. package/dist/typescript/commonjs/src/jest/index.d.ts +10 -3
  119. package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
  120. package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
  121. package/dist/typescript/commonjs/src/poison.pill.d.ts.map +1 -1
  122. package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts +5 -0
  123. package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts.map +1 -0
  124. package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts +3 -3
  125. package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts.map +1 -1
  126. package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts +2 -2
  127. package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts.map +1 -1
  128. package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts +2 -2
  129. package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts.map +1 -1
  130. package/dist/typescript/commonjs/src/runtime/native/conditions/media-query.d.ts +2 -2
  131. package/dist/typescript/commonjs/src/runtime/native/conditions/media-query.d.ts.map +1 -1
  132. package/dist/typescript/commonjs/src/runtime/native/injection.d.ts.map +1 -1
  133. package/dist/typescript/commonjs/src/runtime/native/react/interaction.d.ts +2 -2
  134. package/dist/typescript/commonjs/src/runtime/native/react/interaction.d.ts.map +1 -1
  135. package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts +2 -1
  136. package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts.map +1 -1
  137. package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts +2 -10
  138. package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts.map +1 -1
  139. package/dist/typescript/commonjs/src/runtime/native/root.d.ts +11 -0
  140. package/dist/typescript/commonjs/src/runtime/native/root.d.ts.map +1 -0
  141. package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
  142. package/dist/typescript/commonjs/src/runtime/native/styles/units.d.ts.map +1 -1
  143. package/dist/typescript/commonjs/src/runtime/native/styles/variables.d.ts.map +1 -1
  144. package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts +1 -0
  145. package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts.map +1 -1
  146. package/dist/typescript/module/src/compiler/compiler.d.ts +9 -2
  147. package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
  148. package/dist/typescript/module/src/compiler/compiler.types.d.ts +5 -4
  149. package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
  150. package/dist/typescript/module/src/compiler/declarations.d.ts +16 -19
  151. package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
  152. package/dist/typescript/module/src/compiler/selector-builder.d.ts +23 -0
  153. package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -0
  154. package/dist/typescript/module/src/compiler/selectors.d.ts +3 -2
  155. package/dist/typescript/module/src/compiler/selectors.d.ts.map +1 -1
  156. package/dist/typescript/module/src/compiler/stylesheet.d.ts +21 -7
  157. package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
  158. package/dist/typescript/module/src/jest/index.d.ts +10 -3
  159. package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
  160. package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
  161. package/dist/typescript/module/src/poison.pill.d.ts.map +1 -1
  162. package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts +5 -0
  163. package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts.map +1 -0
  164. package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts +3 -3
  165. package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts.map +1 -1
  166. package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts +2 -2
  167. package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts.map +1 -1
  168. package/dist/typescript/module/src/runtime/native/conditions/index.d.ts +2 -2
  169. package/dist/typescript/module/src/runtime/native/conditions/index.d.ts.map +1 -1
  170. package/dist/typescript/module/src/runtime/native/conditions/media-query.d.ts +2 -2
  171. package/dist/typescript/module/src/runtime/native/conditions/media-query.d.ts.map +1 -1
  172. package/dist/typescript/module/src/runtime/native/injection.d.ts.map +1 -1
  173. package/dist/typescript/module/src/runtime/native/react/interaction.d.ts +2 -2
  174. package/dist/typescript/module/src/runtime/native/react/interaction.d.ts.map +1 -1
  175. package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts +2 -1
  176. package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts.map +1 -1
  177. package/dist/typescript/module/src/runtime/native/reactivity.d.ts +2 -10
  178. package/dist/typescript/module/src/runtime/native/reactivity.d.ts.map +1 -1
  179. package/dist/typescript/module/src/runtime/native/root.d.ts +11 -0
  180. package/dist/typescript/module/src/runtime/native/root.d.ts.map +1 -0
  181. package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
  182. package/dist/typescript/module/src/runtime/native/styles/units.d.ts.map +1 -1
  183. package/dist/typescript/module/src/runtime/native/styles/variables.d.ts.map +1 -1
  184. package/dist/typescript/module/src/runtime/utils/specificity.d.ts +1 -0
  185. package/dist/typescript/module/src/runtime/utils/specificity.d.ts.map +1 -1
  186. package/package.json +4 -3
  187. package/src/compiler/atRules.ts +1 -1
  188. package/src/compiler/attributes.test.ts +1 -1
  189. package/src/compiler/compiler.ts +30 -31
  190. package/src/compiler/compiler.types.ts +7 -5
  191. package/src/compiler/declarations.ts +293 -69
  192. package/src/compiler/inheritance.test.ts +6 -6
  193. package/src/compiler/selector-builder.ts +531 -0
  194. package/src/compiler/selectors.ts +20 -6
  195. package/src/compiler/stylesheet.ts +154 -45
  196. package/src/jest/index.ts +30 -6
  197. package/src/metro/index.ts +6 -3
  198. package/src/poison.pill.ts +5 -1
  199. package/src/runtime/native/conditions/attributes.ts +52 -0
  200. package/src/runtime/native/conditions/container-query.ts +27 -22
  201. package/src/runtime/native/conditions/guards.ts +1 -2
  202. package/src/runtime/native/conditions/index.ts +12 -66
  203. package/src/runtime/native/conditions/media-query.ts +18 -20
  204. package/src/runtime/native/injection.ts +1 -1
  205. package/src/runtime/native/react/interaction.ts +12 -12
  206. package/src/runtime/native/react/rules.ts +9 -9
  207. package/src/runtime/native/react/useNativeCss.ts +3 -0
  208. package/src/runtime/native/reactivity.ts +2 -21
  209. package/src/runtime/native/root.ts +31 -0
  210. package/src/runtime/native/styles/calculate-props.ts +59 -49
  211. package/src/runtime/native/styles/index.ts +12 -12
  212. package/src/runtime/native/styles/units.ts +7 -3
  213. package/src/runtime/native/styles/variables.ts +2 -6
  214. package/src/runtime/utils/specificity.ts +1 -0
@@ -29,37 +29,44 @@ const parsers = {
29
29
  "block-size": parseSizeDeclaration,
30
30
  "border": parseBorder,
31
31
  "border-block": parseBorderBlock,
32
- "border-block-color": parseBorderBlockColor,
32
+ "border-block-color": parseBorderColor,
33
33
  "border-block-end": parseBorderBlockEnd,
34
34
  "border-block-end-color": parseColorDeclaration,
35
35
  "border-block-end-width": parseBorderSideWidthDeclaration,
36
36
  "border-block-start": parseBorderBlockStart,
37
37
  "border-block-start-color": parseColorDeclaration,
38
38
  "border-block-start-width": parseBorderSideWidthDeclaration,
39
+ "border-block-style": parseBorderBlockStyle,
39
40
  "border-block-width": parseBorderBlockWidth,
40
41
  "border-bottom": parseBorderSide,
41
42
  "border-bottom-color": parseColorDeclaration,
42
43
  "border-bottom-left-radius": parseSize2DDimensionPercentageDeclaration,
43
44
  "border-bottom-right-radius": parseSize2DDimensionPercentageDeclaration,
45
+ "border-bottom-style": parseBorderStyleDeclaration,
44
46
  "border-bottom-width": parseBorderSideWidthDeclaration,
45
47
  "border-color": parseBorderColor,
46
48
  "border-end-end-radius": parseSize2DDimensionPercentageDeclaration,
47
49
  "border-end-start-radius": parseSize2DDimensionPercentageDeclaration,
48
50
  "border-inline": parseBorderInline,
49
- "border-inline-color": parseBorderBlockColor,
51
+ "border-inline-color": parseBorderColor,
50
52
  "border-inline-end": parseBorderInlineEnd,
51
53
  "border-inline-end-color": parseColorDeclaration,
54
+ "border-inline-end-style": parseBorderInlineStyle,
52
55
  "border-inline-end-width": parseBorderSideWidthDeclaration,
53
56
  "border-inline-start": parseBorderInlineStart,
54
57
  "border-inline-start-color": parseColorDeclaration,
58
+ "border-inline-start-style": parseBorderInlineStyle,
55
59
  "border-inline-start-width": parseBorderSideWidthDeclaration,
56
- "border-inline-width": parseBorderBlockWidth,
60
+ "border-inline-style": parseBorderInlineStyle,
61
+ "border-inline-width": parseBorderInlineWidth,
57
62
  "border-left": parseBorderSide,
58
63
  "border-left-color": parseColorDeclaration,
64
+ "border-left-style": parseBorderStyleDeclaration,
59
65
  "border-left-width": parseBorderSideWidthDeclaration,
60
66
  "border-radius": parseBorderRadius,
61
67
  "border-right": parseBorderSide,
62
68
  "border-right-color": parseColorDeclaration,
69
+ "border-right-style": parseBorderStyleDeclaration,
63
70
  "border-right-width": parseBorderSideWidthDeclaration,
64
71
  "border-start-end-radius": parseSize2DDimensionPercentageDeclaration,
65
72
  "border-start-start-radius": parseSize2DDimensionPercentageDeclaration,
@@ -68,11 +75,12 @@ const parsers = {
68
75
  "border-top-color": parseColorDeclaration,
69
76
  "border-top-left-radius": parseSize2DDimensionPercentageDeclaration,
70
77
  "border-top-right-radius": parseSize2DDimensionPercentageDeclaration,
78
+ "border-top-style": parseBorderStyleDeclaration,
71
79
  "border-top-width": parseBorderSideWidthDeclaration,
72
80
  "border-width": parseBorderWidth,
73
81
  "bottom": parseSizeDeclaration,
74
82
  "box-shadow": parseBoxShadow,
75
- "caret-color": parseColorOrAuto,
83
+ "caret-color": parseCaretColor,
76
84
  "color": parseFontColorDeclaration,
77
85
  "column-gap": parseGap,
78
86
  "container": parseContainer,
@@ -183,6 +191,12 @@ const parsers = {
183
191
  // This is missing LightningCSS types
184
192
  parsers["pointer-events"] = parsePointerEvents;
185
193
  const validProperties = new Set(Object.keys(parsers));
194
+ function parseCaretColor(declaration, builder) {
195
+ builder.addMapping({
196
+ [declaration.property]: ["cursorColor"]
197
+ });
198
+ builder.addDescriptor("caret-color", parseColorOrAutoDeclaration(declaration, builder));
199
+ }
186
200
  export function parseDeclaration(declaration, builder) {
187
201
  if ("vendorPrefix" in declaration && declaration.vendorPrefix.length) {
188
202
  return;
@@ -191,9 +205,9 @@ export function parseDeclaration(declaration, builder) {
191
205
  return;
192
206
  }
193
207
  if (declaration.property === "unparsed") {
194
- parseDeclarationUnparsed(declaration, builder);
208
+ parseUnparsedDeclaration(declaration, builder);
195
209
  } else if (declaration.property === "custom") {
196
- parseDeclarationCustom(declaration, builder);
210
+ parseCustomDeclaration(declaration, builder);
197
211
  } else {
198
212
  parseWithParser(declaration, builder);
199
213
  }
@@ -202,6 +216,7 @@ function parseWithParser(declaration, builder) {
202
216
  if (declaration.property in parsers) {
203
217
  const parser = parsers[declaration.property];
204
218
  builder.descriptorProperty = declaration.property;
219
+ builder.setWarningProperty(declaration.property);
205
220
  const value = parser(declaration, builder, declaration.property);
206
221
  if (value !== undefined) {
207
222
  builder.addDescriptor(propertyRename[declaration.property] ?? declaration.property, value);
@@ -246,15 +261,25 @@ function parseBorderRadius({
246
261
  "border-top-right-radius": parseSize2DDimensionPercentage(value.topRight, builder)
247
262
  });
248
263
  }
249
- function parseBorderColor({
250
- value
251
- }, builder) {
252
- builder.addShorthand("border-color", {
253
- "border-top-color": parseColor(value.top, builder),
254
- "border-bottom-color": parseColor(value.bottom, builder),
255
- "border-left-color": parseColor(value.left, builder),
256
- "border-right-color": parseColor(value.right, builder)
257
- });
264
+ function parseBorderColor(declaration, builder) {
265
+ switch (declaration.property) {
266
+ case "border-color":
267
+ builder.addShorthand("border-color", {
268
+ "border-top-color": parseColor(declaration.value.top, builder),
269
+ "border-bottom-color": parseColor(declaration.value.bottom, builder),
270
+ "border-left-color": parseColor(declaration.value.left, builder),
271
+ "border-right-color": parseColor(declaration.value.right, builder)
272
+ });
273
+ break;
274
+ case "border-block-color":
275
+ builder.addDescriptor("border-top-color", parseColor(declaration.value.start, builder));
276
+ builder.addDescriptor("border-bottom-color", parseColor(declaration.value.end, builder));
277
+ break;
278
+ case "border-inline-color":
279
+ builder.addDescriptor("border-left-color", parseColor(declaration.value.start, builder));
280
+ builder.addDescriptor("border-right-color", parseColor(declaration.value.end, builder));
281
+ break;
282
+ }
258
283
  }
259
284
  function parseBorderWidth({
260
285
  value
@@ -322,6 +347,19 @@ function parseBorderInlineEnd({
322
347
  builder.addDescriptor("border-right-color", parseColor(value.color, builder));
323
348
  builder.addDescriptor("border-right-width", parseBorderSideWidth(value.width, builder));
324
349
  }
350
+ export function parseBorderInlineWidth(declaration, builder) {
351
+ builder.addDescriptor("border-left-width", parseBorderSideWidth(declaration.value.start, builder));
352
+ builder.addDescriptor("border-right-width", parseBorderSideWidth(declaration.value.end, builder));
353
+ }
354
+ export function parseBorderInlineStyle(declaration, builder) {
355
+ if (typeof declaration.value === "string") {
356
+ builder.addDescriptor("border-style", parseBorderStyle(declaration.value, builder));
357
+ } else if (declaration.value.start === declaration.value.end) {
358
+ builder.addDescriptor("border-style", parseBorderStyle(declaration.value.start, builder));
359
+ } else {
360
+ builder.addWarning("property", "border-inline-style");
361
+ }
362
+ }
325
363
  function parseFlexFlow({
326
364
  value
327
365
  }, builder) {
@@ -481,7 +519,11 @@ function parseLetterSpacing({
481
519
  if (value.type === "normal") {
482
520
  return;
483
521
  }
484
- return parseLength(value.value, builder);
522
+ const descriptor = parseLength(value.value, builder);
523
+ if (Array.isArray(descriptor) && descriptor[1] === "em" && typeof descriptor[2] === "number") {
524
+ return descriptor[2];
525
+ }
526
+ return descriptor;
485
527
  }
486
528
  function parseTextDecoration({
487
529
  value
@@ -499,7 +541,8 @@ function parseZIndex({
499
541
  return;
500
542
  }
501
543
  }
502
- function parseContainerType(_value, _builder) {
544
+ function parseContainerType(_declaration, builder) {
545
+ builder.addContainer(["___default___"]);
503
546
  return;
504
547
  }
505
548
  function parseContainerName({
@@ -514,12 +557,13 @@ function parseContainer({
514
557
  builder.addContainer(value.name.type === "none" ? false : value.name.value);
515
558
  return;
516
559
  }
517
- export function parseDeclarationUnparsed(declaration, builder) {
560
+ export function parseUnparsedDeclaration(declaration, builder) {
518
561
  let property = declaration.value.propertyId.property;
519
562
  if (!(property in parsers)) {
520
563
  builder.addWarning("property", property);
521
564
  return;
522
565
  }
566
+ builder.setWarningProperty(property);
523
567
 
524
568
  /**
525
569
  * React Native doesn't support all the logical properties
@@ -534,14 +578,14 @@ export function parseDeclarationUnparsed(declaration, builder) {
534
578
  */
535
579
  builder.descriptorProperty = property;
536
580
  if (unparsedRuntimeParsing.has(property)) {
537
- const args = parseUnparsed(declaration.value.value, builder);
581
+ const args = parseUnparsed(declaration.value.value, builder, property);
538
582
  if (property === "animation") {
539
583
  builder.addDescriptor("animation", [{}, `@${toRNProperty(property)}`, args]);
540
584
  } else {
541
585
  builder.addDescriptor(property, [{}, `@${toRNProperty(property)}`, args, 1]);
542
586
  }
543
587
  } else {
544
- const value = parseUnparsed(declaration.value.value, builder);
588
+ const value = parseUnparsed(declaration.value.value, builder, property);
545
589
  builder.addDescriptor(property, value);
546
590
  if (property === "font-size") {
547
591
  builder.addDescriptor("--__rn-css-em", value);
@@ -551,16 +595,21 @@ export function parseDeclarationUnparsed(declaration, builder) {
551
595
  }
552
596
  }
553
597
  }
554
- export function parseDeclarationCustom(declaration, builder) {
598
+ export function parseCustomDeclaration(declaration, builder) {
555
599
  const property = declaration.value.name;
556
600
  if (validProperties.has(property) || property.startsWith("--") || property.startsWith("-rn-")) {
557
- builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, allowAuto.has(property)));
601
+ builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
602
+ } else if (property === "-webkit-line-clamp") {
603
+ builder.addMapping({
604
+ [property]: ["numberOfLines"]
605
+ });
606
+ builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
558
607
  } else {
559
608
  builder.addWarning("property", declaration.value.name);
560
609
  }
561
610
  }
562
- export function reduceParseUnparsed(tokenOrValues, builder) {
563
- const result = tokenOrValues.map(tokenOrValue => parseUnparsed(tokenOrValue, builder)).filter(v => v !== undefined);
611
+ export function reduceParseUnparsed(tokenOrValues, builder, property, allowAuto) {
612
+ const result = tokenOrValues.map(tokenOrValue => parseUnparsed(tokenOrValue, builder, property, allowAuto)).filter(v => v !== undefined);
564
613
  if (result.length === 0) {
565
614
  return undefined;
566
615
  }
@@ -574,6 +623,9 @@ export function reduceParseUnparsed(tokenOrValues, builder) {
574
623
  currentGroup.push(value);
575
624
  }
576
625
  }
626
+
627
+ // Groups are the tokens grouped together by comma location
628
+ // If a group only has 1 item, it shouldn't be an array
577
629
  groups = groups.flatMap(group => {
578
630
  if (!Array.isArray(group)) {
579
631
  return [];
@@ -587,21 +639,26 @@ export function reduceParseUnparsed(tokenOrValues, builder) {
587
639
  } else {
588
640
  return [first];
589
641
  }
642
+ } else if (
643
+ // This is a special case for <ratio> values
644
+ group.includes("/") && group.every(item => typeof item === "string" && item === "/" ? item : typeof item === "number")) {
645
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string
646
+ return [group.join(" ")];
590
647
  } else {
591
648
  return [group];
592
649
  }
593
650
  });
594
651
  return groups.length === 1 ? groups[0] : groups;
595
652
  }
596
- export function unparsedFunction(token, builder) {
597
- return [{}, token.value.name, reduceParseUnparsed(token.value.arguments, builder)];
653
+ export function unparsedFunction(token, builder, property, allowAuto) {
654
+ return [{}, token.value.name, reduceParseUnparsed(token.value.arguments, builder, property, allowAuto)];
598
655
  }
599
656
 
600
657
  /**
601
658
  * When the CSS cannot be parsed (often due to a runtime condition like a CSS variable)
602
659
  * This export function best efforts parsing it into a export function that we can evaluate at runtime
603
660
  */
604
- export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
661
+ export function parseUnparsed(tokenOrValue, builder, property, allowAuto = allowAutoProperties.has(property)) {
605
662
  if (tokenOrValue === undefined || tokenOrValue === null) {
606
663
  return;
607
664
  }
@@ -620,7 +677,7 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
620
677
  return round(tokenOrValue);
621
678
  }
622
679
  if (Array.isArray(tokenOrValue)) {
623
- const args = reduceParseUnparsed(tokenOrValue, builder);
680
+ const args = reduceParseUnparsed(tokenOrValue, builder, property, allowAuto);
624
681
  if (!args) return;
625
682
  if (Array.isArray(args) && args.length === 1) return args[0];
626
683
  return args;
@@ -628,12 +685,12 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
628
685
  switch (tokenOrValue.type) {
629
686
  case "unresolved-color":
630
687
  {
631
- return parseUnresolvedColor(tokenOrValue.value, builder);
688
+ return parseUnresolvedColor(tokenOrValue.value, builder, property, allowAuto);
632
689
  }
633
690
  case "var":
634
691
  {
635
692
  let args = tokenOrValue.value.name.ident.slice(2);
636
- const fallback = parseUnparsed(tokenOrValue.value.fallback, builder);
693
+ const fallback = parseUnparsed(tokenOrValue.value.fallback, builder, property, allowAuto);
637
694
  if (fallback !== undefined) {
638
695
  args = [args, fallback];
639
696
  }
@@ -654,7 +711,8 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
654
711
  case "translateX":
655
712
  case "translateY":
656
713
  tokenOrValue.value.name = `@${tokenOrValue.value.name}`;
657
- return unparsedFunction(tokenOrValue, builder);
714
+ return unparsedFunction(tokenOrValue, builder, property, allowAuto);
715
+ case "blur":
658
716
  case "brightness":
659
717
  case "contrast":
660
718
  case "cubic-bezier":
@@ -678,17 +736,17 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
678
736
  case "sepia":
679
737
  case "shadow":
680
738
  case "steps":
681
- return unparsedFunction(tokenOrValue, builder);
739
+ return unparsedFunction(tokenOrValue, builder, property, allowAuto);
682
740
  case "hairlineWidth":
683
741
  return [{}, tokenOrValue.value.name, []];
684
742
  case "calc":
685
743
  case "max":
686
744
  case "min":
687
745
  case "clamp":
688
- return parseCalcFn(tokenOrValue.value.name, tokenOrValue.value.arguments, builder);
746
+ return parseCalcFn(tokenOrValue.value.name, tokenOrValue.value.arguments, builder, property);
689
747
  default:
690
748
  {
691
- builder.addWarning("function", tokenOrValue.value.name);
749
+ builder.addWarning("value", `${tokenOrValue.value.name}()`);
692
750
  return;
693
751
  }
694
752
  }
@@ -734,11 +792,17 @@ export function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
734
792
  return parseDimension(tokenOrValue.value, builder);
735
793
  case "comma":
736
794
  return CommaSeparator;
795
+ case "delim":
796
+ {
797
+ if (property === "aspect-ratio" && tokenOrValue.value.value === "/") {
798
+ return tokenOrValue.value.value;
799
+ }
800
+ return;
801
+ }
737
802
  case "at-keyword":
738
803
  case "hash":
739
804
  case "id-hash":
740
805
  case "unquoted-url":
741
- case "delim":
742
806
  case "white-space":
743
807
  case "comment":
744
808
  case "colon":
@@ -791,22 +855,30 @@ export function parseLength(length, builder) {
791
855
  inlineRem = 14
792
856
  } = builder.getOptions();
793
857
  if (typeof length === "number") {
794
- return length;
858
+ return round(length);
795
859
  }
796
860
  if ("unit" in length) {
797
861
  switch (length.unit) {
798
862
  case "px":
799
- return length.value;
863
+ {
864
+ if (length.value === Infinity) {
865
+ return 9999;
866
+ } else if (length.value === -Infinity) {
867
+ return -9999;
868
+ } else {
869
+ return round(length.value);
870
+ }
871
+ }
800
872
  case "rem":
801
873
  if (typeof inlineRem === "number") {
802
874
  return length.value * inlineRem;
803
875
  } else {
804
- return [{}, "rem", length.value];
876
+ return [{}, "rem", round(length.value)];
805
877
  }
806
878
  case "vw":
807
879
  case "vh":
808
880
  case "em":
809
- return [{}, length.unit, length.value, 1];
881
+ return [{}, length.unit, round(length.value), 1];
810
882
  case "in":
811
883
  case "cm":
812
884
  case "mm":
@@ -891,7 +963,7 @@ export function parseAngle(angle, builder) {
891
963
  case "rad":
892
964
  return `${angle.value}${angle.type}`;
893
965
  default:
894
- builder.addWarning("value", angle.value);
966
+ builder.addWarning("value", `${angle.value} ${angle.type}`);
895
967
  return undefined;
896
968
  }
897
969
  }
@@ -949,7 +1021,7 @@ export function parseSize(size, builder, options, {
949
1021
  }
950
1022
  return;
951
1023
  }
952
- export function parseColorOrAuto({
1024
+ export function parseColorOrAutoDeclaration({
953
1025
  value
954
1026
  }, builder) {
955
1027
  if (value.type === "auto") {
@@ -1339,19 +1411,27 @@ export function parseBorderStyle(value, builder) {
1339
1411
  builder.addWarning("value", value.top);
1340
1412
  return undefined;
1341
1413
  }
1342
- export function parseBorderBlockColor({
1343
- value
1344
- }, builder) {
1345
- builder.addDescriptor("border-top-color", parseColor(value.start, builder));
1346
- builder.addDescriptor("border-bottom-color", parseColor(value.end, builder));
1347
- return;
1348
- }
1349
1414
  export function parseBorderBlockWidth(declaration, builder) {
1350
1415
  builder.addDescriptor("border-top-width", parseBorderSideWidth(declaration.value.start, builder));
1351
1416
  builder.addDescriptor("border-bottom-width", parseBorderSideWidth(declaration.value.end, builder));
1352
1417
  }
1418
+ function parseBorderBlockStyle(declaration, builder) {
1419
+ if (declaration.value.start === declaration.value.end) {
1420
+ builder.addDescriptor("border-style", parseBorderStyle(declaration.value.start, builder));
1421
+ } else {
1422
+ builder.addWarning("property", "border-block-style");
1423
+ }
1424
+ }
1353
1425
  export function parseBorderSideWidthDeclaration(declaration, builder) {
1354
- return parseBorderSideWidth(declaration.value, builder);
1426
+ if (declaration.property.includes("block")) {
1427
+ builder.addDescriptor(`border-${declaration.property.includes("start") ? "top" : "bottom"}-width`, parseBorderSideWidth(declaration.value, builder));
1428
+ return;
1429
+ } else if (declaration.property.includes("inline")) {
1430
+ builder.addDescriptor(`border-${declaration.property.includes("start") ? "left" : "right"}-width`, parseBorderSideWidth(declaration.value, builder));
1431
+ return;
1432
+ } else {
1433
+ return parseBorderSideWidth(declaration.value, builder);
1434
+ }
1355
1435
  }
1356
1436
  export function parseBorderSideWidth(value, builder) {
1357
1437
  if (value.type === "length") {
@@ -1396,7 +1476,7 @@ export function parseLineHeight(value, builder) {
1396
1476
  return parseLength(length, builder);
1397
1477
  case "percentage":
1398
1478
  case "calc":
1399
- builder.addWarning("value", typeof length.value === "number" ? length.value : JSON.stringify(length.value));
1479
+ builder.addWarning("style", "line-height", typeof length.value === "number" ? length.value : JSON.stringify(length.value));
1400
1480
  return;
1401
1481
  default:
1402
1482
  {
@@ -1466,8 +1546,8 @@ export function parseLengthOrCoercePercentageToRuntime(value, builder) {
1466
1546
  }
1467
1547
  export function parseGap(declaration, builder) {
1468
1548
  if ("column" in declaration.value) {
1469
- builder.addDescriptor("row-gap", parseGap(declaration, builder));
1470
- builder.addDescriptor("column-gap", parseGap(declaration, builder));
1549
+ builder.addDescriptor("row-gap", parseGapValue(declaration.value.row, builder));
1550
+ builder.addDescriptor("column-gap", parseGapValue(declaration.value.column, builder));
1471
1551
  return;
1472
1552
  } else {
1473
1553
  if (declaration.value.type === "normal") {
@@ -1477,6 +1557,13 @@ export function parseGap(declaration, builder) {
1477
1557
  return parseLength(declaration.value.value, builder);
1478
1558
  }
1479
1559
  }
1560
+ function parseGapValue(value, builder) {
1561
+ if (value.type === "normal") {
1562
+ return;
1563
+ } else {
1564
+ return parseLength(value.value, builder);
1565
+ }
1566
+ }
1480
1567
  export function parseTextAlign({
1481
1568
  value
1482
1569
  }, builder) {
@@ -1576,7 +1663,11 @@ export function parseDimension({
1576
1663
  }, builder) {
1577
1664
  switch (unit) {
1578
1665
  case "px":
1579
- return value;
1666
+ if (value === Infinity) {
1667
+ return 9999;
1668
+ } else {
1669
+ return value;
1670
+ }
1580
1671
  case "%":
1581
1672
  return `${value}%`;
1582
1673
  case "rnh":
@@ -1601,17 +1692,24 @@ export function parseUserSelect({
1601
1692
  }
1602
1693
  }
1603
1694
  export function parseSVGPaint({
1604
- value
1695
+ value,
1696
+ property
1605
1697
  }, builder) {
1698
+ let parsedValue;
1606
1699
  if (value.type === "none") {
1607
- return "transparent";
1700
+ parsedValue = "transparent";
1608
1701
  } else if (value.type === "color") {
1609
- return parseColor(value.value, builder);
1702
+ parsedValue = parseColor(value.value, builder);
1703
+ } else {
1704
+ return;
1610
1705
  }
1611
- return;
1706
+ builder.addMapping({
1707
+ [property]: [property]
1708
+ });
1709
+ builder.addDescriptor(property, parsedValue);
1612
1710
  }
1613
1711
  export function round(number) {
1614
- return Math.round((number + Number.EPSILON) * 100) / 100;
1712
+ return Math.round((number + Number.EPSILON) * 10000) / 10000;
1615
1713
  }
1616
1714
  export function parseDimensionPercentageFor_LengthValue(value, builder) {
1617
1715
  if (value.type === "calc") {
@@ -1622,7 +1720,7 @@ export function parseDimensionPercentageFor_LengthValue(value, builder) {
1622
1720
  return parseLength(value.value, builder);
1623
1721
  }
1624
1722
  }
1625
- const allowAuto = new Set(["pointer-events"]);
1723
+ const allowAutoProperties = new Set(["pointer-events"]);
1626
1724
  export function parseEnv(value, builder) {
1627
1725
  switch (value.name.type) {
1628
1726
  case "ua":
@@ -1631,7 +1729,7 @@ export function parseEnv(value, builder) {
1631
1729
  case "safe-area-inset-right":
1632
1730
  case "safe-area-inset-bottom":
1633
1731
  case "safe-area-inset-left":
1634
- return [{}, "var", [`--react-native-css-${value.name.value}`, parseUnparsed(value.fallback, builder)], 1];
1732
+ return [{}, "var", [`--react-native-css-${value.name.value}`, parseUnparsed(value.fallback, builder, value.name.value)], 1];
1635
1733
  case "viewport-segment-width":
1636
1734
  case "viewport-segment-height":
1637
1735
  case "viewport-segment-top":
@@ -1645,14 +1743,14 @@ export function parseEnv(value, builder) {
1645
1743
  }
1646
1744
  return;
1647
1745
  }
1648
- export function parseCalcFn(name, tokens, builder) {
1649
- const args = parseCalcArguments(tokens, builder);
1746
+ export function parseCalcFn(name, tokens, builder, property) {
1747
+ const args = parseCalcArguments(tokens, builder, property);
1650
1748
  if (args) {
1651
1749
  return [{}, name, args];
1652
1750
  }
1653
1751
  return;
1654
1752
  }
1655
- export function parseCalcArguments([...args], builder) {
1753
+ export function parseCalcArguments([...args], builder, property) {
1656
1754
  const parsed = [];
1657
1755
  let mode;
1658
1756
  for (const [currentIndex, arg] of args.entries()) {
@@ -1666,7 +1764,7 @@ export function parseCalcArguments([...args], builder) {
1666
1764
  case "function":
1667
1765
  case "unresolved-color":
1668
1766
  {
1669
- const value = parseUnparsed(arg, builder);
1767
+ const value = parseUnparsed(arg, builder, property);
1670
1768
  if (value === undefined) {
1671
1769
  return undefined;
1672
1770
  }
@@ -1735,7 +1833,7 @@ export function parseCalcArguments([...args], builder) {
1735
1833
  .splice(currentIndex, closeParenthesisIndex - currentIndex + 1)
1736
1834
  // Then drop the surrounding parenthesis
1737
1835
  .slice(1, -1);
1738
- parsed.push(parseCalcFn("calc", innerCalcArgs, builder));
1836
+ parsed.push(parseCalcFn("calc", innerCalcArgs, builder, property));
1739
1837
  break;
1740
1838
  }
1741
1839
  case "close-parenthesis":
@@ -1776,20 +1874,20 @@ export function parseTranslateProp(value, prop, builder) {
1776
1874
  }
1777
1875
  return parseLength(value[prop], builder);
1778
1876
  }
1779
- export function parseUnresolvedColor(color, builder) {
1877
+ export function parseUnresolvedColor(color, builder, property, allowAuto) {
1780
1878
  switch (color.type) {
1781
1879
  case "rgb":
1782
- return [{}, "rgba", [round(color.r * 255), round(color.g * 255), round(color.b * 255), parseUnparsed(color.alpha, builder)]];
1880
+ return [{}, "rgba", [round(color.r * 255), round(color.g * 255), round(color.b * 255), parseUnparsed(color.alpha, builder, property)]];
1783
1881
  case "hsl":
1784
- return [{}, color.type, [color.h, color.s, color.l, parseUnparsed(color.alpha, builder)]];
1882
+ return [{}, color.type, [color.h, color.s, color.l, parseUnparsed(color.alpha, builder, property)]];
1785
1883
  case "light-dark":
1786
1884
  {
1787
1885
  const extraRule = builder.extendRule({
1788
1886
  m: [["=", "prefers-color-scheme", "dark"]]
1789
1887
  });
1790
- builder.addUnnamedDescriptor(reduceParseUnparsed(color.dark, builder), false, extraRule);
1888
+ builder.addUnnamedDescriptor(reduceParseUnparsed(color.dark, builder, property, allowAuto), false, extraRule);
1791
1889
  builder.addExtraRule(extraRule);
1792
- return reduceParseUnparsed(color.light, builder);
1890
+ return reduceParseUnparsed(color.light, builder, property, allowAuto);
1793
1891
  }
1794
1892
  default:
1795
1893
  color;