react-native-css 3.0.0-nightly.27bd5e2 → 3.0.0-nightly.46bc0ab

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 (479) hide show
  1. package/dist/commonjs/compiler/atRules.js +16 -3
  2. package/dist/commonjs/compiler/atRules.js.map +1 -1
  3. package/dist/commonjs/compiler/attributes.test.js +1 -1
  4. package/dist/commonjs/compiler/attributes.test.js.map +1 -1
  5. package/dist/commonjs/compiler/compiler.js +57 -18
  6. package/dist/commonjs/compiler/compiler.js.map +1 -1
  7. package/dist/commonjs/compiler/declarations.js +209 -107
  8. package/dist/commonjs/compiler/declarations.js.map +1 -1
  9. package/dist/commonjs/compiler/inheritance.test.js +7 -7
  10. package/dist/commonjs/compiler/inheritance.test.js.map +1 -1
  11. package/dist/commonjs/compiler/keyframes.js +1 -1
  12. package/dist/commonjs/compiler/keyframes.js.map +1 -1
  13. package/dist/commonjs/compiler/selector-builder.js +457 -0
  14. package/dist/commonjs/compiler/selector-builder.js.map +1 -0
  15. package/dist/commonjs/compiler/selectors.js +10 -6
  16. package/dist/commonjs/compiler/selectors.js.map +1 -1
  17. package/dist/commonjs/compiler/stylesheet.js +136 -45
  18. package/dist/commonjs/compiler/stylesheet.js.map +1 -1
  19. package/dist/commonjs/components/ActivityIndicator.js +22 -0
  20. package/dist/commonjs/components/ActivityIndicator.js.map +1 -0
  21. package/dist/commonjs/components/Button.js +22 -0
  22. package/dist/commonjs/components/Button.js.map +1 -0
  23. package/dist/commonjs/components/FlatList.js +19 -0
  24. package/dist/commonjs/components/FlatList.js.map +1 -0
  25. package/dist/commonjs/components/Image.js +17 -0
  26. package/dist/commonjs/components/Image.js.map +1 -0
  27. package/dist/commonjs/components/TextInput.js +17 -0
  28. package/dist/commonjs/components/TextInput.js.map +1 -0
  29. package/dist/commonjs/components/index.js +40 -0
  30. package/dist/commonjs/components/index.js.map +1 -1
  31. package/dist/commonjs/jest/index.js +34 -28
  32. package/dist/commonjs/jest/index.js.map +1 -1
  33. package/dist/commonjs/metro/index.js +7 -5
  34. package/dist/commonjs/metro/index.js.map +1 -1
  35. package/dist/commonjs/poison.pill.js +4 -1
  36. package/dist/commonjs/poison.pill.js.map +1 -1
  37. package/dist/commonjs/runtime/native/conditions/attributes.js +42 -0
  38. package/dist/commonjs/runtime/native/conditions/attributes.js.map +1 -0
  39. package/dist/commonjs/runtime/native/conditions/container-query.js +28 -21
  40. package/dist/commonjs/runtime/native/conditions/container-query.js.map +1 -1
  41. package/dist/commonjs/runtime/native/conditions/guards.js.map +1 -1
  42. package/dist/commonjs/runtime/native/conditions/index.js +10 -46
  43. package/dist/commonjs/runtime/native/conditions/index.js.map +1 -1
  44. package/dist/commonjs/runtime/native/conditions/media-query.js +19 -17
  45. package/dist/commonjs/runtime/native/conditions/media-query.js.map +1 -1
  46. package/dist/commonjs/runtime/native/injection.js +22 -20
  47. package/dist/commonjs/runtime/native/injection.js.map +1 -1
  48. package/dist/commonjs/runtime/native/react/interaction.js +10 -10
  49. package/dist/commonjs/runtime/native/react/interaction.js.map +1 -1
  50. package/dist/commonjs/runtime/native/react/rules.js +22 -17
  51. package/dist/commonjs/runtime/native/react/rules.js.map +1 -1
  52. package/dist/commonjs/runtime/native/react/useNativeCss.js +3 -2
  53. package/dist/commonjs/runtime/native/react/useNativeCss.js.map +1 -1
  54. package/dist/commonjs/runtime/native/reactivity.js +1 -12
  55. package/dist/commonjs/runtime/native/reactivity.js.map +1 -1
  56. package/dist/commonjs/runtime/native/reanimated.js +17 -0
  57. package/dist/commonjs/runtime/native/reanimated.js.map +1 -0
  58. package/dist/commonjs/runtime/native/root.js +28 -0
  59. package/dist/commonjs/runtime/native/root.js.map +1 -0
  60. package/dist/commonjs/runtime/native/styles/calculate-props.js +56 -48
  61. package/dist/commonjs/runtime/native/styles/calculate-props.js.map +1 -1
  62. package/dist/commonjs/runtime/native/styles/defaults.js +1 -1
  63. package/dist/commonjs/runtime/native/styles/defaults.js.map +1 -1
  64. package/dist/commonjs/runtime/native/styles/functions/animation-timing.js +34 -0
  65. package/dist/commonjs/runtime/native/styles/functions/animation-timing.js.map +1 -0
  66. package/dist/commonjs/runtime/native/styles/{calc.js → functions/calc.js} +1 -1
  67. package/dist/commonjs/runtime/native/styles/functions/calc.js.map +1 -0
  68. package/dist/commonjs/runtime/native/styles/{filters.js → functions/filters.js} +3 -3
  69. package/dist/commonjs/runtime/native/styles/functions/filters.js.map +1 -0
  70. package/dist/commonjs/runtime/native/styles/functions/index.js +61 -0
  71. package/dist/commonjs/runtime/native/styles/functions/index.js.map +1 -0
  72. package/dist/commonjs/runtime/native/styles/{platform-functions.js → functions/platform-functions.js} +3 -3
  73. package/dist/commonjs/runtime/native/styles/functions/platform-functions.js.map +1 -0
  74. package/dist/commonjs/runtime/native/styles/functions/transform-functions.js +83 -0
  75. package/dist/commonjs/runtime/native/styles/functions/transform-functions.js.map +1 -0
  76. package/dist/commonjs/runtime/native/styles/index.js +12 -12
  77. package/dist/commonjs/runtime/native/styles/index.js.map +1 -1
  78. package/dist/commonjs/runtime/native/styles/resolve.js +21 -44
  79. package/dist/commonjs/runtime/native/styles/resolve.js.map +1 -1
  80. package/dist/commonjs/runtime/native/styles/{shorthand.js → shorthands/_handler.js} +5 -5
  81. package/dist/commonjs/runtime/native/styles/shorthands/_handler.js.map +1 -0
  82. package/dist/commonjs/runtime/native/styles/{animation.js → shorthands/animation.js} +5 -36
  83. package/dist/commonjs/runtime/native/styles/shorthands/animation.js.map +1 -0
  84. package/dist/commonjs/runtime/native/styles/{border.js → shorthands/border.js} +2 -2
  85. package/dist/commonjs/runtime/native/styles/shorthands/border.js.map +1 -0
  86. package/dist/commonjs/runtime/native/styles/{box-shadow.js → shorthands/box-shadow.js} +3 -3
  87. package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js.map +1 -0
  88. package/dist/commonjs/runtime/native/styles/shorthands/index.js +61 -0
  89. package/dist/commonjs/runtime/native/styles/shorthands/index.js.map +1 -0
  90. package/dist/commonjs/runtime/native/styles/{text-shadow.js → shorthands/text-shadow.js} +2 -2
  91. package/dist/commonjs/runtime/native/styles/shorthands/text-shadow.js.map +1 -0
  92. package/dist/commonjs/runtime/native/styles/shorthands/transform.js.map +1 -0
  93. package/dist/commonjs/runtime/native/styles/units.js +7 -4
  94. package/dist/commonjs/runtime/native/styles/units.js.map +1 -1
  95. package/dist/commonjs/runtime/native/styles/variables.js +3 -2
  96. package/dist/commonjs/runtime/native/styles/variables.js.map +1 -1
  97. package/dist/commonjs/runtime/utils/objects.js +14 -6
  98. package/dist/commonjs/runtime/utils/objects.js.map +1 -1
  99. package/dist/commonjs/runtime/utils/specificity.js +2 -1
  100. package/dist/commonjs/runtime/utils/specificity.js.map +1 -1
  101. package/dist/module/compiler/atRules.js +16 -3
  102. package/dist/module/compiler/atRules.js.map +1 -1
  103. package/dist/module/compiler/attributes.test.js +1 -1
  104. package/dist/module/compiler/attributes.test.js.map +1 -1
  105. package/dist/module/compiler/compiler.js +57 -18
  106. package/dist/module/compiler/compiler.js.map +1 -1
  107. package/dist/module/compiler/compiler.types.js.map +1 -1
  108. package/dist/module/compiler/declarations.js +204 -103
  109. package/dist/module/compiler/declarations.js.map +1 -1
  110. package/dist/module/compiler/inheritance.test.js +7 -7
  111. package/dist/module/compiler/inheritance.test.js.map +1 -1
  112. package/dist/module/compiler/keyframes.js +1 -1
  113. package/dist/module/compiler/keyframes.js.map +1 -1
  114. package/dist/module/compiler/selector-builder.js +452 -0
  115. package/dist/module/compiler/selector-builder.js.map +1 -0
  116. package/dist/module/compiler/selectors.js +10 -6
  117. package/dist/module/compiler/selectors.js.map +1 -1
  118. package/dist/module/compiler/stylesheet.js +135 -44
  119. package/dist/module/compiler/stylesheet.js.map +1 -1
  120. package/dist/module/components/ActivityIndicator.js +17 -0
  121. package/dist/module/components/ActivityIndicator.js.map +1 -0
  122. package/dist/module/components/Button.js +17 -0
  123. package/dist/module/components/Button.js.map +1 -0
  124. package/dist/module/components/FlatList.js +14 -0
  125. package/dist/module/components/FlatList.js.map +1 -0
  126. package/dist/module/components/Image.js +12 -0
  127. package/dist/module/components/Image.js.map +1 -0
  128. package/dist/module/components/TextInput.js +12 -0
  129. package/dist/module/components/TextInput.js.map +1 -0
  130. package/dist/module/components/index.js +5 -0
  131. package/dist/module/components/index.js.map +1 -1
  132. package/dist/module/jest/index.js +34 -13
  133. package/dist/module/jest/index.js.map +1 -1
  134. package/dist/module/metro/index.js +7 -5
  135. package/dist/module/metro/index.js.map +1 -1
  136. package/dist/module/poison.pill.js +4 -1
  137. package/dist/module/poison.pill.js.map +1 -1
  138. package/dist/module/runtime/native/conditions/attributes.js +38 -0
  139. package/dist/module/runtime/native/conditions/attributes.js.map +1 -0
  140. package/dist/module/runtime/native/conditions/container-query.js +28 -21
  141. package/dist/module/runtime/native/conditions/container-query.js.map +1 -1
  142. package/dist/module/runtime/native/conditions/guards.js.map +1 -1
  143. package/dist/module/runtime/native/conditions/index.js +10 -46
  144. package/dist/module/runtime/native/conditions/index.js.map +1 -1
  145. package/dist/module/runtime/native/conditions/media-query.js +19 -17
  146. package/dist/module/runtime/native/conditions/media-query.js.map +1 -1
  147. package/dist/module/runtime/native/injection.js +21 -19
  148. package/dist/module/runtime/native/injection.js.map +1 -1
  149. package/dist/module/runtime/native/react/interaction.js +10 -10
  150. package/dist/module/runtime/native/react/interaction.js.map +1 -1
  151. package/dist/module/runtime/native/react/rules.js +22 -17
  152. package/dist/module/runtime/native/react/rules.js.map +1 -1
  153. package/dist/module/runtime/native/react/useNativeCss.js +2 -1
  154. package/dist/module/runtime/native/react/useNativeCss.js.map +1 -1
  155. package/dist/module/runtime/native/reactivity.js +0 -11
  156. package/dist/module/runtime/native/reactivity.js.map +1 -1
  157. package/dist/module/runtime/native/reanimated.js +13 -0
  158. package/dist/module/runtime/native/reanimated.js.map +1 -0
  159. package/dist/module/runtime/native/root.js +24 -0
  160. package/dist/module/runtime/native/root.js.map +1 -0
  161. package/dist/module/runtime/native/styles/calculate-props.js +57 -49
  162. package/dist/module/runtime/native/styles/calculate-props.js.map +1 -1
  163. package/dist/module/runtime/native/styles/defaults.js +1 -1
  164. package/dist/module/runtime/native/styles/defaults.js.map +1 -1
  165. package/dist/module/runtime/native/styles/functions/animation-timing.js +30 -0
  166. package/dist/module/runtime/native/styles/functions/animation-timing.js.map +1 -0
  167. package/dist/module/runtime/native/styles/{calc.js → functions/calc.js} +1 -1
  168. package/dist/module/runtime/native/styles/functions/calc.js.map +1 -0
  169. package/dist/module/runtime/native/styles/{filters.js → functions/filters.js} +2 -2
  170. package/dist/module/runtime/native/styles/functions/filters.js.map +1 -0
  171. package/dist/module/runtime/native/styles/functions/index.js +8 -0
  172. package/dist/module/runtime/native/styles/functions/index.js.map +1 -0
  173. package/dist/module/runtime/native/styles/{platform-functions.js → functions/platform-functions.js} +1 -1
  174. package/dist/module/runtime/native/styles/functions/platform-functions.js.map +1 -0
  175. package/dist/module/runtime/native/styles/functions/transform-functions.js +76 -0
  176. package/dist/module/runtime/native/styles/functions/transform-functions.js.map +1 -0
  177. package/dist/module/runtime/native/styles/index.js +12 -12
  178. package/dist/module/runtime/native/styles/index.js.map +1 -1
  179. package/dist/module/runtime/native/styles/resolve.js +20 -44
  180. package/dist/module/runtime/native/styles/resolve.js.map +1 -1
  181. package/dist/module/runtime/native/styles/{shorthand.js → shorthands/_handler.js} +5 -5
  182. package/dist/module/runtime/native/styles/shorthands/_handler.js.map +1 -0
  183. package/dist/module/runtime/native/styles/{animation.js → shorthands/animation.js} +3 -34
  184. package/dist/module/runtime/native/styles/shorthands/animation.js.map +1 -0
  185. package/dist/module/runtime/native/styles/{border.js → shorthands/border.js} +1 -1
  186. package/dist/module/runtime/native/styles/shorthands/border.js.map +1 -0
  187. package/dist/module/runtime/native/styles/{box-shadow.js → shorthands/box-shadow.js} +2 -2
  188. package/dist/module/runtime/native/styles/shorthands/box-shadow.js.map +1 -0
  189. package/dist/module/runtime/native/styles/shorthands/index.js +8 -0
  190. package/dist/module/runtime/native/styles/shorthands/index.js.map +1 -0
  191. package/dist/module/runtime/native/styles/{text-shadow.js → shorthands/text-shadow.js} +1 -1
  192. package/dist/module/runtime/native/styles/shorthands/text-shadow.js.map +1 -0
  193. package/dist/module/runtime/native/styles/shorthands/transform.js.map +1 -0
  194. package/dist/module/runtime/native/styles/units.js +7 -4
  195. package/dist/module/runtime/native/styles/units.js.map +1 -1
  196. package/dist/module/runtime/native/styles/variables.js +2 -1
  197. package/dist/module/runtime/native/styles/variables.js.map +1 -1
  198. package/dist/module/runtime/utils/objects.js +14 -6
  199. package/dist/module/runtime/utils/objects.js.map +1 -1
  200. package/dist/module/runtime/utils/specificity.js +2 -1
  201. package/dist/module/runtime/utils/specificity.js.map +1 -1
  202. package/dist/typescript/commonjs/example/app.config.d.ts +4 -0
  203. package/dist/typescript/commonjs/example/app.config.d.ts.map +1 -0
  204. package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -1
  205. package/dist/typescript/commonjs/src/compiler/compiler.d.ts +9 -2
  206. package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
  207. package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +6 -7
  208. package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
  209. package/dist/typescript/commonjs/src/compiler/declarations.d.ts +16 -19
  210. package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
  211. package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts +23 -0
  212. package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -0
  213. package/dist/typescript/commonjs/src/compiler/selectors.d.ts +3 -2
  214. package/dist/typescript/commonjs/src/compiler/selectors.d.ts.map +1 -1
  215. package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +23 -5
  216. package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
  217. package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts +13 -0
  218. package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts.map +1 -0
  219. package/dist/typescript/commonjs/src/components/Button.d.ts +13 -0
  220. package/dist/typescript/commonjs/src/components/Button.d.ts.map +1 -0
  221. package/dist/typescript/commonjs/src/components/FlatList.d.ts +10 -0
  222. package/dist/typescript/commonjs/src/components/FlatList.d.ts.map +1 -0
  223. package/dist/typescript/commonjs/src/components/Image.d.ts +8 -0
  224. package/dist/typescript/commonjs/src/components/Image.d.ts.map +1 -0
  225. package/dist/typescript/commonjs/src/components/TextInput.d.ts +8 -0
  226. package/dist/typescript/commonjs/src/components/TextInput.d.ts.map +1 -0
  227. package/dist/typescript/commonjs/src/components/index.d.ts +5 -0
  228. package/dist/typescript/commonjs/src/components/index.d.ts.map +1 -1
  229. package/dist/typescript/commonjs/src/jest/index.d.ts +21 -5
  230. package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
  231. package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
  232. package/dist/typescript/commonjs/src/poison.pill.d.ts.map +1 -1
  233. package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts +5 -0
  234. package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts.map +1 -0
  235. package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts +3 -3
  236. package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts.map +1 -1
  237. package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts +2 -2
  238. package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts.map +1 -1
  239. package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts +2 -2
  240. package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts.map +1 -1
  241. package/dist/typescript/commonjs/src/runtime/native/conditions/media-query.d.ts +2 -2
  242. package/dist/typescript/commonjs/src/runtime/native/conditions/media-query.d.ts.map +1 -1
  243. package/dist/typescript/commonjs/src/runtime/native/injection.d.ts.map +1 -1
  244. package/dist/typescript/commonjs/src/runtime/native/react/interaction.d.ts +2 -2
  245. package/dist/typescript/commonjs/src/runtime/native/react/interaction.d.ts.map +1 -1
  246. package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts +2 -2
  247. package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts.map +1 -1
  248. package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts +2 -1
  249. package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts.map +1 -1
  250. package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts +2 -10
  251. package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts.map +1 -1
  252. package/dist/typescript/commonjs/src/runtime/native/reanimated.d.ts +5 -0
  253. package/dist/typescript/commonjs/src/runtime/native/reanimated.d.ts.map +1 -0
  254. package/dist/typescript/commonjs/src/runtime/native/root.d.ts +11 -0
  255. package/dist/typescript/commonjs/src/runtime/native/root.d.ts.map +1 -0
  256. package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
  257. package/dist/typescript/commonjs/src/runtime/native/styles/defaults.d.ts.map +1 -1
  258. package/dist/typescript/commonjs/src/runtime/native/styles/functions/animation-timing.d.ts +4 -0
  259. package/dist/typescript/commonjs/src/runtime/native/styles/functions/animation-timing.d.ts.map +1 -0
  260. package/dist/typescript/commonjs/src/runtime/native/styles/functions/calc.d.ts +3 -0
  261. package/dist/typescript/commonjs/src/runtime/native/styles/functions/calc.d.ts.map +1 -0
  262. package/dist/typescript/commonjs/src/runtime/native/styles/{filters.d.ts → functions/filters.d.ts} +1 -1
  263. package/dist/typescript/commonjs/src/runtime/native/styles/functions/filters.d.ts.map +1 -0
  264. package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts +6 -0
  265. package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts.map +1 -0
  266. package/dist/typescript/commonjs/src/runtime/native/styles/{platform-functions.d.ts → functions/platform-functions.d.ts} +2 -2
  267. package/dist/typescript/commonjs/src/runtime/native/styles/functions/platform-functions.d.ts.map +1 -0
  268. package/dist/typescript/commonjs/src/runtime/native/styles/functions/transform-functions.d.ts +5 -0
  269. package/dist/typescript/commonjs/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -0
  270. package/dist/typescript/commonjs/src/runtime/native/styles/resolve.d.ts.map +1 -1
  271. package/dist/typescript/commonjs/src/runtime/native/styles/{shorthand.d.ts → shorthands/_handler.d.ts} +2 -2
  272. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/_handler.d.ts.map +1 -0
  273. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/animation.d.ts +4 -0
  274. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -0
  275. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/border.d.ts +2 -0
  276. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/border.d.ts.map +1 -0
  277. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts +3 -0
  278. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -0
  279. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/index.d.ts +6 -0
  280. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/index.d.ts.map +1 -0
  281. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/text-shadow.d.ts +2 -0
  282. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/text-shadow.d.ts.map +1 -0
  283. package/dist/typescript/commonjs/src/runtime/native/styles/{transform.d.ts → shorthands/transform.d.ts} +1 -1
  284. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -0
  285. package/dist/typescript/commonjs/src/runtime/native/styles/units.d.ts.map +1 -1
  286. package/dist/typescript/commonjs/src/runtime/native/styles/variables.d.ts.map +1 -1
  287. package/dist/typescript/commonjs/src/runtime/utils/objects.d.ts.map +1 -1
  288. package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts +1 -0
  289. package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts.map +1 -1
  290. package/dist/typescript/module/example/app.config.d.ts +4 -0
  291. package/dist/typescript/module/example/app.config.d.ts.map +1 -0
  292. package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -1
  293. package/dist/typescript/module/src/compiler/compiler.d.ts +9 -2
  294. package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
  295. package/dist/typescript/module/src/compiler/compiler.types.d.ts +6 -7
  296. package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
  297. package/dist/typescript/module/src/compiler/declarations.d.ts +16 -19
  298. package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
  299. package/dist/typescript/module/src/compiler/selector-builder.d.ts +23 -0
  300. package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -0
  301. package/dist/typescript/module/src/compiler/selectors.d.ts +3 -2
  302. package/dist/typescript/module/src/compiler/selectors.d.ts.map +1 -1
  303. package/dist/typescript/module/src/compiler/stylesheet.d.ts +23 -5
  304. package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
  305. package/dist/typescript/module/src/components/ActivityIndicator.d.ts +13 -0
  306. package/dist/typescript/module/src/components/ActivityIndicator.d.ts.map +1 -0
  307. package/dist/typescript/module/src/components/Button.d.ts +13 -0
  308. package/dist/typescript/module/src/components/Button.d.ts.map +1 -0
  309. package/dist/typescript/module/src/components/FlatList.d.ts +10 -0
  310. package/dist/typescript/module/src/components/FlatList.d.ts.map +1 -0
  311. package/dist/typescript/module/src/components/Image.d.ts +8 -0
  312. package/dist/typescript/module/src/components/Image.d.ts.map +1 -0
  313. package/dist/typescript/module/src/components/TextInput.d.ts +8 -0
  314. package/dist/typescript/module/src/components/TextInput.d.ts.map +1 -0
  315. package/dist/typescript/module/src/components/index.d.ts +5 -0
  316. package/dist/typescript/module/src/components/index.d.ts.map +1 -1
  317. package/dist/typescript/module/src/jest/index.d.ts +21 -5
  318. package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
  319. package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
  320. package/dist/typescript/module/src/poison.pill.d.ts.map +1 -1
  321. package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts +5 -0
  322. package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts.map +1 -0
  323. package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts +3 -3
  324. package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts.map +1 -1
  325. package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts +2 -2
  326. package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts.map +1 -1
  327. package/dist/typescript/module/src/runtime/native/conditions/index.d.ts +2 -2
  328. package/dist/typescript/module/src/runtime/native/conditions/index.d.ts.map +1 -1
  329. package/dist/typescript/module/src/runtime/native/conditions/media-query.d.ts +2 -2
  330. package/dist/typescript/module/src/runtime/native/conditions/media-query.d.ts.map +1 -1
  331. package/dist/typescript/module/src/runtime/native/injection.d.ts.map +1 -1
  332. package/dist/typescript/module/src/runtime/native/react/interaction.d.ts +2 -2
  333. package/dist/typescript/module/src/runtime/native/react/interaction.d.ts.map +1 -1
  334. package/dist/typescript/module/src/runtime/native/react/rules.d.ts +2 -2
  335. package/dist/typescript/module/src/runtime/native/react/rules.d.ts.map +1 -1
  336. package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts +2 -1
  337. package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts.map +1 -1
  338. package/dist/typescript/module/src/runtime/native/reactivity.d.ts +2 -10
  339. package/dist/typescript/module/src/runtime/native/reactivity.d.ts.map +1 -1
  340. package/dist/typescript/module/src/runtime/native/reanimated.d.ts +5 -0
  341. package/dist/typescript/module/src/runtime/native/reanimated.d.ts.map +1 -0
  342. package/dist/typescript/module/src/runtime/native/root.d.ts +11 -0
  343. package/dist/typescript/module/src/runtime/native/root.d.ts.map +1 -0
  344. package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
  345. package/dist/typescript/module/src/runtime/native/styles/defaults.d.ts.map +1 -1
  346. package/dist/typescript/module/src/runtime/native/styles/functions/animation-timing.d.ts +4 -0
  347. package/dist/typescript/module/src/runtime/native/styles/functions/animation-timing.d.ts.map +1 -0
  348. package/dist/typescript/module/src/runtime/native/styles/functions/calc.d.ts +3 -0
  349. package/dist/typescript/module/src/runtime/native/styles/functions/calc.d.ts.map +1 -0
  350. package/dist/typescript/module/src/runtime/native/styles/{filters.d.ts → functions/filters.d.ts} +1 -1
  351. package/dist/typescript/module/src/runtime/native/styles/functions/filters.d.ts.map +1 -0
  352. package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts +6 -0
  353. package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts.map +1 -0
  354. package/dist/typescript/module/src/runtime/native/styles/{platform-functions.d.ts → functions/platform-functions.d.ts} +2 -2
  355. package/dist/typescript/module/src/runtime/native/styles/functions/platform-functions.d.ts.map +1 -0
  356. package/dist/typescript/module/src/runtime/native/styles/functions/transform-functions.d.ts +5 -0
  357. package/dist/typescript/module/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -0
  358. package/dist/typescript/module/src/runtime/native/styles/resolve.d.ts.map +1 -1
  359. package/dist/typescript/module/src/runtime/native/styles/{shorthand.d.ts → shorthands/_handler.d.ts} +2 -2
  360. package/dist/typescript/module/src/runtime/native/styles/shorthands/_handler.d.ts.map +1 -0
  361. package/dist/typescript/module/src/runtime/native/styles/shorthands/animation.d.ts +4 -0
  362. package/dist/typescript/module/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -0
  363. package/dist/typescript/module/src/runtime/native/styles/shorthands/border.d.ts +2 -0
  364. package/dist/typescript/module/src/runtime/native/styles/shorthands/border.d.ts.map +1 -0
  365. package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts +3 -0
  366. package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -0
  367. package/dist/typescript/module/src/runtime/native/styles/shorthands/index.d.ts +6 -0
  368. package/dist/typescript/module/src/runtime/native/styles/shorthands/index.d.ts.map +1 -0
  369. package/dist/typescript/module/src/runtime/native/styles/shorthands/text-shadow.d.ts +2 -0
  370. package/dist/typescript/module/src/runtime/native/styles/shorthands/text-shadow.d.ts.map +1 -0
  371. package/dist/typescript/module/src/runtime/native/styles/{transform.d.ts → shorthands/transform.d.ts} +1 -1
  372. package/dist/typescript/module/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -0
  373. package/dist/typescript/module/src/runtime/native/styles/units.d.ts.map +1 -1
  374. package/dist/typescript/module/src/runtime/native/styles/variables.d.ts.map +1 -1
  375. package/dist/typescript/module/src/runtime/utils/objects.d.ts.map +1 -1
  376. package/dist/typescript/module/src/runtime/utils/specificity.d.ts +1 -0
  377. package/dist/typescript/module/src/runtime/utils/specificity.d.ts.map +1 -1
  378. package/package.json +28 -4
  379. package/src/compiler/atRules.ts +17 -3
  380. package/src/compiler/attributes.test.ts +1 -1
  381. package/src/compiler/compiler.ts +63 -33
  382. package/src/compiler/compiler.types.ts +8 -8
  383. package/src/compiler/declarations.ts +374 -127
  384. package/src/compiler/inheritance.test.ts +6 -6
  385. package/src/compiler/keyframes.ts +1 -1
  386. package/src/compiler/selector-builder.ts +531 -0
  387. package/src/compiler/selectors.ts +20 -6
  388. package/src/compiler/stylesheet.ts +179 -42
  389. package/src/components/ActivityIndicator.tsx +27 -0
  390. package/src/components/Button.tsx +22 -0
  391. package/src/components/FlatList.tsx +21 -0
  392. package/src/components/Image.tsx +17 -0
  393. package/src/components/TextInput.tsx +17 -0
  394. package/src/components/index.tsx +5 -0
  395. package/src/jest/index.ts +45 -13
  396. package/src/metro/index.ts +12 -6
  397. package/src/poison.pill.ts +5 -1
  398. package/src/runtime/native/conditions/attributes.ts +52 -0
  399. package/src/runtime/native/conditions/container-query.ts +27 -22
  400. package/src/runtime/native/conditions/guards.ts +1 -2
  401. package/src/runtime/native/conditions/index.ts +12 -66
  402. package/src/runtime/native/conditions/media-query.ts +20 -20
  403. package/src/runtime/native/injection.ts +32 -31
  404. package/src/runtime/native/react/interaction.ts +12 -12
  405. package/src/runtime/native/react/rules.ts +23 -14
  406. package/src/runtime/native/react/useNativeCss.ts +4 -1
  407. package/src/runtime/native/reactivity.ts +2 -21
  408. package/src/runtime/native/reanimated.ts +22 -0
  409. package/src/runtime/native/root.ts +31 -0
  410. package/src/runtime/native/styles/calculate-props.ts +61 -50
  411. package/src/runtime/native/styles/defaults.ts +1 -0
  412. package/src/runtime/native/styles/functions/animation-timing.ts +44 -0
  413. package/src/runtime/native/styles/{calc.ts → functions/calc.ts} +2 -2
  414. package/src/runtime/native/styles/{filters.ts → functions/filters.ts} +3 -3
  415. package/src/runtime/native/styles/functions/index.ts +5 -0
  416. package/src/runtime/native/styles/{platform-functions.ts → functions/platform-functions.ts} +2 -2
  417. package/src/runtime/native/styles/functions/transform-functions.ts +51 -0
  418. package/src/runtime/native/styles/index.ts +12 -12
  419. package/src/runtime/native/styles/resolve.ts +20 -63
  420. package/src/runtime/native/styles/{shorthand.ts → shorthands/_handler.ts} +5 -5
  421. package/src/runtime/native/styles/{animation.ts → shorthands/animation.ts} +4 -63
  422. package/src/runtime/native/styles/{border.ts → shorthands/border.ts} +1 -1
  423. package/src/runtime/native/styles/{box-shadow.ts → shorthands/box-shadow.ts} +3 -3
  424. package/src/runtime/native/styles/shorthands/index.ts +5 -0
  425. package/src/runtime/native/styles/{text-shadow.ts → shorthands/text-shadow.ts} +1 -1
  426. package/src/runtime/native/styles/{transform.ts → shorthands/transform.ts} +1 -1
  427. package/src/runtime/native/styles/units.ts +8 -4
  428. package/src/runtime/native/styles/variables.ts +2 -6
  429. package/src/runtime/utils/objects.ts +14 -4
  430. package/src/runtime/utils/specificity.ts +1 -0
  431. package/types.d.ts +70 -0
  432. package/dist/commonjs/runtime/native/styles/animation.js.map +0 -1
  433. package/dist/commonjs/runtime/native/styles/border.js.map +0 -1
  434. package/dist/commonjs/runtime/native/styles/box-shadow.js.map +0 -1
  435. package/dist/commonjs/runtime/native/styles/calc.js.map +0 -1
  436. package/dist/commonjs/runtime/native/styles/filters.js.map +0 -1
  437. package/dist/commonjs/runtime/native/styles/platform-functions.js.map +0 -1
  438. package/dist/commonjs/runtime/native/styles/shorthand.js.map +0 -1
  439. package/dist/commonjs/runtime/native/styles/text-shadow.js.map +0 -1
  440. package/dist/commonjs/runtime/native/styles/transform.js.map +0 -1
  441. package/dist/module/runtime/native/styles/animation.js.map +0 -1
  442. package/dist/module/runtime/native/styles/border.js.map +0 -1
  443. package/dist/module/runtime/native/styles/box-shadow.js.map +0 -1
  444. package/dist/module/runtime/native/styles/calc.js.map +0 -1
  445. package/dist/module/runtime/native/styles/filters.js.map +0 -1
  446. package/dist/module/runtime/native/styles/platform-functions.js.map +0 -1
  447. package/dist/module/runtime/native/styles/shorthand.js.map +0 -1
  448. package/dist/module/runtime/native/styles/text-shadow.js.map +0 -1
  449. package/dist/module/runtime/native/styles/transform.js.map +0 -1
  450. package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts +0 -9
  451. package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts.map +0 -1
  452. package/dist/typescript/commonjs/src/runtime/native/styles/border.d.ts +0 -2
  453. package/dist/typescript/commonjs/src/runtime/native/styles/border.d.ts.map +0 -1
  454. package/dist/typescript/commonjs/src/runtime/native/styles/box-shadow.d.ts +0 -3
  455. package/dist/typescript/commonjs/src/runtime/native/styles/box-shadow.d.ts.map +0 -1
  456. package/dist/typescript/commonjs/src/runtime/native/styles/calc.d.ts +0 -3
  457. package/dist/typescript/commonjs/src/runtime/native/styles/calc.d.ts.map +0 -1
  458. package/dist/typescript/commonjs/src/runtime/native/styles/filters.d.ts.map +0 -1
  459. package/dist/typescript/commonjs/src/runtime/native/styles/platform-functions.d.ts.map +0 -1
  460. package/dist/typescript/commonjs/src/runtime/native/styles/shorthand.d.ts.map +0 -1
  461. package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts +0 -2
  462. package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts.map +0 -1
  463. package/dist/typescript/commonjs/src/runtime/native/styles/transform.d.ts.map +0 -1
  464. package/dist/typescript/module/src/runtime/native/styles/animation.d.ts +0 -9
  465. package/dist/typescript/module/src/runtime/native/styles/animation.d.ts.map +0 -1
  466. package/dist/typescript/module/src/runtime/native/styles/border.d.ts +0 -2
  467. package/dist/typescript/module/src/runtime/native/styles/border.d.ts.map +0 -1
  468. package/dist/typescript/module/src/runtime/native/styles/box-shadow.d.ts +0 -3
  469. package/dist/typescript/module/src/runtime/native/styles/box-shadow.d.ts.map +0 -1
  470. package/dist/typescript/module/src/runtime/native/styles/calc.d.ts +0 -3
  471. package/dist/typescript/module/src/runtime/native/styles/calc.d.ts.map +0 -1
  472. package/dist/typescript/module/src/runtime/native/styles/filters.d.ts.map +0 -1
  473. package/dist/typescript/module/src/runtime/native/styles/platform-functions.d.ts.map +0 -1
  474. package/dist/typescript/module/src/runtime/native/styles/shorthand.d.ts.map +0 -1
  475. package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts +0 -2
  476. package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts.map +0 -1
  477. package/dist/typescript/module/src/runtime/native/styles/transform.d.ts.map +0 -1
  478. /package/dist/commonjs/runtime/native/styles/{transform.js → shorthands/transform.js} +0 -0
  479. /package/dist/module/runtime/native/styles/{transform.js → shorthands/transform.js} +0 -0
@@ -17,10 +17,11 @@ import {
17
17
  VariableContext,
18
18
  type ContainerContextValue,
19
19
  type Effect,
20
+ type Getter,
20
21
  type VariableContextValue,
21
22
  } from "../reactivity";
23
+ import { animatedComponentFamily } from "../reanimated";
22
24
  import { getStyledProps, stylesFamily } from "../styles";
23
- import { animatedComponentFamily } from "../styles/animation";
24
25
  import { updateRules } from "./rules";
25
26
 
26
27
  export type Config = {
@@ -35,6 +36,7 @@ export type ComponentState = {
35
36
 
36
37
  /** Reactive tracking */
37
38
  ruleEffect: Effect;
39
+ ruleEffectGetter: Getter;
38
40
  styleEffect: Effect;
39
41
 
40
42
  /** The components props */
@@ -94,6 +96,7 @@ export function useNativeCss(
94
96
  return updateRules(
95
97
  {
96
98
  ruleEffect,
99
+ ruleEffectGetter: (observable) => observable.get(ruleEffect),
97
100
  styleEffect,
98
101
  configs,
99
102
  inheritedContainers,
@@ -7,7 +7,7 @@ import {
7
7
  type LayoutRectangle,
8
8
  } from "react-native";
9
9
 
10
- import type { LightDarkVariable, StyleDescriptor } from "../../compiler";
10
+ import type { StyleDescriptor } from "../../compiler";
11
11
 
12
12
  export type Effect = {
13
13
  observers: Set<Effect>;
@@ -189,25 +189,6 @@ export const VariableContext = createContext<VariableContextValue>({
189
189
  [VAR_SYMBOL]: true,
190
190
  });
191
191
 
192
- const lightDarkFamily = () => {
193
- return family<string, Observable<StyleDescriptor, LightDarkVariable>>(() => {
194
- const obs = observable<StyleDescriptor, LightDarkVariable>(
195
- (read, lightDark = [undefined, undefined]) => {
196
- const colorSchemeName =
197
- read(colorScheme) ?? Appearance.getColorScheme() ?? "light";
198
-
199
- return colorSchemeName === "dark"
200
- ? (lightDark[1] ?? lightDark[0])
201
- : lightDark[0];
202
- },
203
- );
204
-
205
- return obs;
206
- });
207
- };
208
- export const rootVariables = lightDarkFamily();
209
- export const universalVariables = lightDarkFamily();
210
-
211
192
  /** Units *********************************************************************/
212
193
 
213
194
  export const rem = observable(14);
@@ -237,7 +218,7 @@ Appearance.addChangeListener((event) => colorScheme.set(event.colorScheme));
237
218
 
238
219
  /** Containers ****************************************************************/
239
220
 
240
- export type ContainerContextValue = Record<string, Effect>;
221
+ export type ContainerContextValue = Record<string, WeakKey>;
241
222
  export const ContainerContext = createContext<ContainerContextValue>({});
242
223
 
243
224
  export const containerLayoutFamily = weakFamily(() => {
@@ -0,0 +1,22 @@
1
+ import type { ComponentType } from "react";
2
+
3
+ import { weakFamily } from "./reactivity";
4
+
5
+ export const animatedComponentFamily = weakFamily(
6
+ (component: ComponentType) => {
7
+ if (
8
+ "displayName" in component &&
9
+ component.displayName?.startsWith("Animated.")
10
+ ) {
11
+ return component;
12
+ }
13
+
14
+ const createAnimatedComponent =
15
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-member-access
16
+ require("react-native-reanimated").createAnimatedComponent as (
17
+ component: ComponentType,
18
+ ) => ComponentType;
19
+
20
+ return createAnimatedComponent(component);
21
+ },
22
+ );
@@ -0,0 +1,31 @@
1
+ import type { StyleDescriptor, VariableValue } from "react-native-css/compiler";
2
+
3
+ import { testMediaQuery } from "./conditions/media-query";
4
+ import { family, observable, type Observable } from "./reactivity";
5
+
6
+ const rootVariableFamily = () => {
7
+ return family<string, Observable<StyleDescriptor, VariableValue[]>>(() => {
8
+ const obs = observable<StyleDescriptor, VariableValue[]>(
9
+ (read, variableValue) => {
10
+ if (!variableValue) return undefined;
11
+
12
+ for (const [value, mediaQuery] of variableValue) {
13
+ if (!mediaQuery) {
14
+ return value;
15
+ }
16
+
17
+ if (testMediaQuery(mediaQuery, read)) {
18
+ return value;
19
+ }
20
+ }
21
+
22
+ return undefined;
23
+ },
24
+ );
25
+
26
+ return obs;
27
+ });
28
+ };
29
+
30
+ export const rootVariables = rootVariableFamily();
31
+ export const universalVariables = rootVariableFamily();
@@ -4,7 +4,7 @@ import type {
4
4
  StyleDeclaration,
5
5
  StyleRule,
6
6
  } from "../../../compiler";
7
- import { applyValue, Specificity as S } from "../../utils";
7
+ import { applyValue, getDeepPath, Specificity as S } from "../../utils";
8
8
  import type { RenderGuard } from "../conditions/guards";
9
9
  import {
10
10
  VAR_SYMBOL,
@@ -103,63 +103,74 @@ export function applyDeclarations(
103
103
  // Dynamic styles
104
104
  let value: any = declaration[0];
105
105
  let propPath = declaration[1];
106
- let prop = "";
106
+ let prop: string;
107
107
 
108
- if (typeof propPath === "string") {
109
- if (propPath.startsWith("^")) {
110
- propPath = propPath.slice(1);
111
- target = topLevelTarget[propPath] ??= {};
108
+ if (Array.isArray(propPath)) {
109
+ const [first, ...rest] = propPath;
110
+
111
+ if (!first) {
112
+ continue;
112
113
  }
113
- prop = propPath;
114
- } else {
115
- for (prop of propPath) {
116
- if (prop.startsWith("^")) {
117
- prop = prop.slice(1);
118
- target = topLevelTarget[prop] ??= {};
119
- } else {
120
- target = target[prop] ??= {};
114
+
115
+ const final = rest.pop();
116
+
117
+ if (final) {
118
+ if (first !== "*") {
119
+ topLevelTarget[first] ??= {};
120
+ target = topLevelTarget[first];
121
+ }
122
+
123
+ for (prop of rest) {
124
+ target[prop] ??= {};
125
+ target = target[prop];
121
126
  }
122
- }
123
- }
124
127
 
125
- if (Array.isArray(value)) {
126
- const shouldDelay = declaration[2];
127
-
128
- if (shouldDelay) {
129
- /**
130
- * We need to delay the resolution of this value until after all
131
- * styles have been calculated. But another style might override
132
- * this value. So we set a placeholder value and only override
133
- * if the placeholder is preserved
134
- *
135
- * This also ensures the props exist, so setValue will properly
136
- * mutate the props object and not create a new one
137
- */
138
- const originalValue = value;
139
- value = {};
140
- delayedStyles.push(() => {
141
- if (target[prop] === value) {
142
- delete target[prop];
143
- value = resolveValue(originalValue, get, {
144
- inlineVariables,
145
- inheritedVariables,
146
- renderGuards: guards,
147
- calculateProps,
148
- });
149
- applyValue(target, prop, value);
150
- }
151
- });
128
+ prop = final;
152
129
  } else {
153
- value = resolveValue(value, get, {
154
- inlineVariables,
155
- inheritedVariables,
156
- renderGuards: guards,
157
- calculateProps,
158
- });
130
+ target = topLevelTarget;
131
+ prop = first;
159
132
  }
133
+ } else {
134
+ prop = propPath;
135
+ }
160
136
 
161
- applyValue(target, prop, value);
137
+ const shouldDelay = declaration[2];
138
+
139
+ if (shouldDelay) {
140
+ /**
141
+ * We need to delay the resolution of this value until after all
142
+ * styles have been calculated. But another style might override
143
+ * this value. So we set a placeholder value and only override
144
+ * if the placeholder is preserved
145
+ *
146
+ * This also ensures the props exist, so setValue will properly
147
+ * mutate the props object and not create a new one
148
+ */
149
+ const originalValue = value;
150
+ // This needs to be a object with the [prop] so we can discover in transform arrays
151
+ value = { [prop]: true };
152
+ delayedStyles.push(() => {
153
+ if (getDeepPath(target, prop) === value) {
154
+ delete target[prop];
155
+ value = resolveValue(originalValue, get, {
156
+ inlineVariables,
157
+ inheritedVariables,
158
+ renderGuards: guards,
159
+ calculateProps,
160
+ });
161
+ applyValue(target, prop, value);
162
+ }
163
+ });
164
+ } else {
165
+ value = resolveValue(value, get, {
166
+ inlineVariables,
167
+ inheritedVariables,
168
+ renderGuards: guards,
169
+ calculateProps,
170
+ });
162
171
  }
172
+
173
+ applyValue(target, prop, value);
163
174
  }
164
175
  }
165
176
  }
@@ -1,5 +1,6 @@
1
1
  /* eslint-disable */
2
2
  export const transformKeys = new Set([
3
+ "translate",
3
4
  "translateX",
4
5
  "translateY",
5
6
  "scale",
@@ -0,0 +1,44 @@
1
+ import type { StyleFunctionResolver } from "../resolve";
2
+
3
+ /* eslint-disable @typescript-eslint/no-require-imports */
4
+ const advancedTimingFunctions: Record<
5
+ string,
6
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
+ () => (...args: any[]) => unknown
8
+ > = {
9
+ cubicBezier: () => {
10
+ return (
11
+ require("react-native-reanimated") as typeof import("react-native-reanimated")
12
+ ).cubicBezier;
13
+ },
14
+ steps: () => {
15
+ return (
16
+ require("react-native-reanimated") as typeof import("react-native-reanimated")
17
+ ).steps;
18
+ },
19
+ };
20
+
21
+ const timingFunctionResolver: StyleFunctionResolver = (resolveValue, value) => {
22
+ const name = value[1];
23
+ const resolver = advancedTimingFunctions[name];
24
+
25
+ if (!resolver) {
26
+ return;
27
+ }
28
+
29
+ const args = resolveValue(value[2]);
30
+
31
+ if (!Array.isArray(args)) {
32
+ return;
33
+ }
34
+
35
+ const fn = resolver();
36
+
37
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
38
+ const result = fn(...args);
39
+
40
+ return result;
41
+ };
42
+
43
+ export const cubicBezier = timingFunctionResolver;
44
+ export const steps = timingFunctionResolver;
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
- import { isStyleDescriptorArray } from "../../utils";
3
- import type { StyleFunctionResolver } from "./resolve";
2
+ import { isStyleDescriptorArray } from "../../../utils";
3
+ import type { StyleFunctionResolver } from "../resolve";
4
4
 
5
5
  const calcPrecedence: Record<string, number> = {
6
6
  "+": 1,
@@ -1,6 +1,6 @@
1
- import { isStyleDescriptorArray } from "../../utils";
2
- import type { StyleFunctionResolver } from "./resolve";
3
- import { shorthandHandler } from "./shorthand";
1
+ import { isStyleDescriptorArray } from "../../../utils";
2
+ import type { StyleFunctionResolver } from "../resolve";
3
+ import { shorthandHandler } from "../shorthands/_handler";
4
4
 
5
5
  export const blur: StyleFunctionResolver = (resolveValue, value) => {
6
6
  const args = resolveValue(value[2]);
@@ -0,0 +1,5 @@
1
+ export * from "./animation-timing";
2
+ export * from "./calc";
3
+ export * from "./filters";
4
+ export * from "./platform-functions";
5
+ export * from "./transform-functions";
@@ -1,6 +1,6 @@
1
1
  import { PixelRatio, PlatformColor, StyleSheet } from "react-native";
2
2
 
3
- import type { StyleFunctionResolver } from "./resolve";
3
+ import type { StyleFunctionResolver } from "../resolve";
4
4
 
5
5
  export const platformColor: StyleFunctionResolver = (resolveValue, value) => {
6
6
  const color: unknown = resolveValue(value[2]);
@@ -25,7 +25,7 @@ export const fontScale: StyleFunctionResolver = () => {
25
25
  return PixelRatio.getFontScale();
26
26
  };
27
27
 
28
- export const pixelSizeForLayoutSize: StyleFunctionResolver = (
28
+ export const getPixelSizeForLayoutSize: StyleFunctionResolver = (
29
29
  resolveValue,
30
30
  value,
31
31
  ) => {
@@ -0,0 +1,51 @@
1
+ import type { StyleFunctionResolver } from "../resolve";
2
+
3
+ export const scale: StyleFunctionResolver = (resolveValue, descriptor) => {
4
+ const values = resolveValue(descriptor[2]);
5
+
6
+ if (Array.isArray(values)) {
7
+ const [x, y] = values as [string | number][];
8
+
9
+ if (values.length === 2 && x === y) {
10
+ return { scale: x };
11
+ } else if (values.length === 2) {
12
+ return [{ scaleX: x }, { scaleY: y }];
13
+ } else {
14
+ return { scale: x };
15
+ }
16
+ } else {
17
+ return { scale: values };
18
+ }
19
+ };
20
+
21
+ export const rotate: StyleFunctionResolver = (resolveValue, descriptor) => {
22
+ const values = resolveValue(descriptor[2]);
23
+
24
+ if (Array.isArray(values)) {
25
+ const [x, y, z] = values as [string | number][];
26
+
27
+ if (values.length === 3 && x === y && x === z) {
28
+ return { rotate: values };
29
+ } else if (values.length === 3) {
30
+ return [{ rotateX: x }, { rotateY: y }, { rotateZ: z }];
31
+ } else if (values.length === 2) {
32
+ return [{ rotateX: x }, { rotateY: y }];
33
+ } else {
34
+ return { rotate: values };
35
+ }
36
+ } else {
37
+ return { rotate: values };
38
+ }
39
+ };
40
+
41
+ export const translate: StyleFunctionResolver = (resolveValue, descriptor) => {
42
+ const values = resolveValue(descriptor[2]);
43
+
44
+ if (Array.isArray(values)) {
45
+ const [x, y] = values as [string | number][];
46
+
47
+ return [{ translateX: x }, { translateY: y }];
48
+ } else {
49
+ return { translateX: values };
50
+ }
51
+ };
@@ -55,57 +55,57 @@ export function getStyledProps(
55
55
  }
56
56
 
57
57
  // Apply the handlers
58
- if (hoverFamily.has(state.ruleEffect)) {
58
+ if (hoverFamily.has(state.ruleEffectGetter)) {
59
59
  result ??= {};
60
60
  result.onHoverIn = getInteractionHandler(
61
- state.ruleEffect,
61
+ state.ruleEffectGetter,
62
62
  "onHoverIn",
63
63
  inline?.onHoverIn,
64
64
  );
65
65
  result.onHoverOut = getInteractionHandler(
66
- state.ruleEffect,
66
+ state.ruleEffectGetter,
67
67
  "onHoverOut",
68
68
  inline?.onHoverOut,
69
69
  );
70
70
  }
71
71
 
72
- if (activeFamily.has(state.ruleEffect)) {
72
+ if (activeFamily.has(state.ruleEffectGetter)) {
73
73
  result ??= {};
74
74
  result.onPress = getInteractionHandler(
75
- state.ruleEffect,
75
+ state.ruleEffectGetter,
76
76
  "onPress",
77
77
  inline?.onPress,
78
78
  );
79
79
  result.onPressIn = getInteractionHandler(
80
- state.ruleEffect,
80
+ state.ruleEffectGetter,
81
81
  "onPressIn",
82
82
  inline?.onPressIn,
83
83
  );
84
84
  result.onPressOut = getInteractionHandler(
85
- state.ruleEffect,
85
+ state.ruleEffectGetter,
86
86
  "onPressOut",
87
87
  inline?.onPressOut,
88
88
  );
89
89
  }
90
90
 
91
- if (focusFamily.has(state.ruleEffect)) {
91
+ if (focusFamily.has(state.ruleEffectGetter)) {
92
92
  result ??= {};
93
93
  result.onBlur = getInteractionHandler(
94
- state.ruleEffect,
94
+ state.ruleEffectGetter,
95
95
  "onBlur",
96
96
  inline?.onBlur,
97
97
  );
98
98
  result.onFocus = getInteractionHandler(
99
- state.ruleEffect,
99
+ state.ruleEffectGetter,
100
100
  "onFocus",
101
101
  inline?.onFocus,
102
102
  );
103
103
  }
104
104
 
105
- if (containerLayoutFamily.has(state.ruleEffect)) {
105
+ if (containerLayoutFamily.has(state.ruleEffectGetter)) {
106
106
  result ??= {};
107
107
  result.onLayout = getInteractionHandler(
108
- state.ruleEffect,
108
+ state.ruleEffectGetter,
109
109
  "onLayout",
110
110
  inline?.onLayout,
111
111
  );
@@ -7,34 +7,10 @@ import type {
7
7
  } from "../../../compiler";
8
8
  import type { RenderGuard } from "../conditions/guards";
9
9
  import { type Getter, type VariableContextValue } from "../reactivity";
10
- import { animation, timingFunctionResolver } from "./animation";
11
- import { border } from "./border";
12
- import { boxShadow } from "./box-shadow";
13
- import { calc } from "./calc";
14
10
  import type { calculateProps } from "./calculate-props";
15
11
  import { transformKeys } from "./defaults";
16
- import {
17
- blur,
18
- brightness,
19
- contrast,
20
- dropShadow,
21
- grayscale,
22
- hueRotate,
23
- invert,
24
- opacity,
25
- saturate,
26
- sepia,
27
- } from "./filters";
28
- import {
29
- fontScale,
30
- hairlineWidth,
31
- pixelRatio,
32
- pixelSizeForLayoutSize,
33
- platformColor,
34
- roundToNearestPixel,
35
- } from "./platform-functions";
36
- import { textShadow } from "./text-shadow";
37
- import { transform } from "./transform";
12
+ import * as functions from "./functions";
13
+ import * as shorthands from "./shorthands";
38
14
  import { em, rem, vh, vw } from "./units";
39
15
  import { varResolver } from "./variables";
40
16
 
@@ -57,34 +33,12 @@ export type StyleResolver = (
57
33
  options: ResolveValueOptions,
58
34
  ) => unknown;
59
35
 
60
- const functions: Record<string, StyleFunctionResolver> = {
61
- "@animation": animation,
62
- "@border": border,
63
- "@boxShadow": boxShadow,
64
- "@textShadow": textShadow,
65
- "@transform": transform,
66
- "animationName": animation,
67
- "cubic-bezier": timingFunctionResolver,
68
- "steps": timingFunctionResolver,
69
- "hue-rotate": hueRotate,
70
- "drop-shadow": dropShadow,
71
- blur,
72
- brightness,
73
- calc,
74
- contrast,
36
+ const functionResolvers = {
37
+ ...shorthands,
38
+ ...functions,
39
+ animationName: shorthands.animation,
75
40
  em,
76
- fontScale,
77
- grayscale,
78
- hairlineWidth,
79
- invert,
80
- opacity,
81
- pixelRatio,
82
- pixelSizeForLayoutSize,
83
- platformColor,
84
41
  rem,
85
- roundToNearestPixel,
86
- saturate,
87
- sepia,
88
42
  vh,
89
43
  vw,
90
44
  };
@@ -116,10 +70,16 @@ export function resolveValue(
116
70
  case "number":
117
71
  case "boolean":
118
72
  return value;
119
- case "string":
120
- return value.endsWith("px") // Inline vars() might set a value with a px suffix
121
- ? parseInt(value.slice(0, -2), 10)
122
- : value;
73
+ case "string": {
74
+ if (value === "unset") {
75
+ return null;
76
+ } else if (value.endsWith("px")) {
77
+ // Inline vars() might set a value with a px suffix
78
+ return parseInt(value.slice(0, -2), 10);
79
+ } else {
80
+ return value;
81
+ }
82
+ }
123
83
  case "object": {
124
84
  if (!Array.isArray(value)) {
125
85
  return value;
@@ -145,8 +105,8 @@ export function resolveValue(
145
105
 
146
106
  if (name === "var") {
147
107
  return varResolver(simpleResolve, value, get, options);
148
- } else if (name in functions) {
149
- const fn = functions[name];
108
+ } else if (name in functionResolvers) {
109
+ const fn = functionResolvers[name as keyof typeof functionResolvers];
150
110
 
151
111
  if (typeof fn !== "function") {
152
112
  throw new Error(`Unknown function: ${name}`);
@@ -160,11 +120,7 @@ export function resolveValue(
160
120
  ) as StyleDescriptor;
161
121
  } else if (transformKeys.has(name)) {
162
122
  // translate, rotate, scale, etc.
163
- const args = value[2];
164
- return simpleResolve(args, castToArray);
165
- } else if (transformKeys.has(name.slice(1))) {
166
- // @translate, @rotate, @scale, etc.
167
- return { [name.slice(1)]: simpleResolve(value[2], castToArray) };
123
+ return { [name]: simpleResolve(value[2], castToArray) };
168
124
  } else {
169
125
  let args = simpleResolve(value[2], castToArray);
170
126
 
@@ -178,6 +134,7 @@ export function resolveValue(
178
134
  }
179
135
  return arg;
180
136
  })
137
+ .filter((value) => value !== "/")
181
138
  .join(", ");
182
139
 
183
140
  if (name === "radial-gradient") {
@@ -1,9 +1,9 @@
1
1
  /* eslint-disable */
2
- import { setDeepPath } from "../../utils/objects";
3
- import { isStyleDescriptorArray } from "../../utils/style-value";
4
- import { ShortHandSymbol } from "./constants";
5
- import { defaultValues } from "./defaults";
6
- import type { StyleResolver } from "./resolve";
2
+ import { setDeepPath } from "../../../utils/objects";
3
+ import { isStyleDescriptorArray } from "../../../utils/style-value";
4
+ import { ShortHandSymbol } from "../constants";
5
+ import { defaultValues } from "../defaults";
6
+ import type { StyleResolver } from "../resolve";
7
7
 
8
8
  type ShorthandType =
9
9
  | "string"