react-native-css 3.0.0-nightly.61014be → 3.0.0-nightly.8dd703d

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 (416) 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 +26 -17
  6. package/dist/commonjs/compiler/compiler.js.map +1 -1
  7. package/dist/commonjs/compiler/declarations.js +195 -94
  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 +122 -43
  18. package/dist/commonjs/compiler/stylesheet.js.map +1 -1
  19. package/dist/commonjs/jest/index.js +33 -10
  20. package/dist/commonjs/jest/index.js.map +1 -1
  21. package/dist/commonjs/metro/index.js +1 -1
  22. package/dist/commonjs/metro/index.js.map +1 -1
  23. package/dist/commonjs/poison.pill.js +4 -1
  24. package/dist/commonjs/poison.pill.js.map +1 -1
  25. package/dist/commonjs/runtime/native/conditions/attributes.js +42 -0
  26. package/dist/commonjs/runtime/native/conditions/attributes.js.map +1 -0
  27. package/dist/commonjs/runtime/native/conditions/container-query.js +28 -21
  28. package/dist/commonjs/runtime/native/conditions/container-query.js.map +1 -1
  29. package/dist/commonjs/runtime/native/conditions/guards.js.map +1 -1
  30. package/dist/commonjs/runtime/native/conditions/index.js +10 -46
  31. package/dist/commonjs/runtime/native/conditions/index.js.map +1 -1
  32. package/dist/commonjs/runtime/native/conditions/media-query.js +19 -17
  33. package/dist/commonjs/runtime/native/conditions/media-query.js.map +1 -1
  34. package/dist/commonjs/runtime/native/injection.js +3 -2
  35. package/dist/commonjs/runtime/native/injection.js.map +1 -1
  36. package/dist/commonjs/runtime/native/react/interaction.js +10 -10
  37. package/dist/commonjs/runtime/native/react/interaction.js.map +1 -1
  38. package/dist/commonjs/runtime/native/react/rules.js +9 -9
  39. package/dist/commonjs/runtime/native/react/rules.js.map +1 -1
  40. package/dist/commonjs/runtime/native/react/useNativeCss.js +3 -2
  41. package/dist/commonjs/runtime/native/react/useNativeCss.js.map +1 -1
  42. package/dist/commonjs/runtime/native/reactivity.js +1 -12
  43. package/dist/commonjs/runtime/native/reactivity.js.map +1 -1
  44. package/dist/commonjs/runtime/native/reanimated.js +17 -0
  45. package/dist/commonjs/runtime/native/reanimated.js.map +1 -0
  46. package/dist/commonjs/runtime/native/root.js +28 -0
  47. package/dist/commonjs/runtime/native/root.js.map +1 -0
  48. package/dist/commonjs/runtime/native/styles/calculate-props.js +56 -48
  49. package/dist/commonjs/runtime/native/styles/calculate-props.js.map +1 -1
  50. package/dist/commonjs/runtime/native/styles/defaults.js +1 -1
  51. package/dist/commonjs/runtime/native/styles/defaults.js.map +1 -1
  52. package/dist/commonjs/runtime/native/styles/functions/animation-timing.js +34 -0
  53. package/dist/commonjs/runtime/native/styles/functions/animation-timing.js.map +1 -0
  54. package/dist/commonjs/runtime/native/styles/{calc.js → functions/calc.js} +1 -1
  55. package/dist/commonjs/runtime/native/styles/functions/calc.js.map +1 -0
  56. package/dist/commonjs/runtime/native/styles/{filters.js → functions/filters.js} +3 -3
  57. package/dist/commonjs/runtime/native/styles/functions/filters.js.map +1 -0
  58. package/dist/commonjs/runtime/native/styles/functions/index.js +61 -0
  59. package/dist/commonjs/runtime/native/styles/functions/index.js.map +1 -0
  60. package/dist/commonjs/runtime/native/styles/{platform-functions.js → functions/platform-functions.js} +3 -3
  61. package/dist/commonjs/runtime/native/styles/functions/platform-functions.js.map +1 -0
  62. package/dist/commonjs/runtime/native/styles/functions/transform-functions.js +83 -0
  63. package/dist/commonjs/runtime/native/styles/functions/transform-functions.js.map +1 -0
  64. package/dist/commonjs/runtime/native/styles/index.js +12 -12
  65. package/dist/commonjs/runtime/native/styles/index.js.map +1 -1
  66. package/dist/commonjs/runtime/native/styles/resolve.js +21 -44
  67. package/dist/commonjs/runtime/native/styles/resolve.js.map +1 -1
  68. package/dist/commonjs/runtime/native/styles/{shorthand.js → shorthands/_handler.js} +5 -5
  69. package/dist/commonjs/runtime/native/styles/shorthands/_handler.js.map +1 -0
  70. package/dist/commonjs/runtime/native/styles/{animation.js → shorthands/animation.js} +5 -36
  71. package/dist/commonjs/runtime/native/styles/shorthands/animation.js.map +1 -0
  72. package/dist/commonjs/runtime/native/styles/{border.js → shorthands/border.js} +2 -2
  73. package/dist/commonjs/runtime/native/styles/shorthands/border.js.map +1 -0
  74. package/dist/commonjs/runtime/native/styles/{box-shadow.js → shorthands/box-shadow.js} +3 -3
  75. package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js.map +1 -0
  76. package/dist/commonjs/runtime/native/styles/shorthands/index.js +61 -0
  77. package/dist/commonjs/runtime/native/styles/shorthands/index.js.map +1 -0
  78. package/dist/commonjs/runtime/native/styles/{text-shadow.js → shorthands/text-shadow.js} +2 -2
  79. package/dist/commonjs/runtime/native/styles/shorthands/text-shadow.js.map +1 -0
  80. package/dist/commonjs/runtime/native/styles/shorthands/transform.js.map +1 -0
  81. package/dist/commonjs/runtime/native/styles/units.js +7 -4
  82. package/dist/commonjs/runtime/native/styles/units.js.map +1 -1
  83. package/dist/commonjs/runtime/native/styles/variables.js +3 -2
  84. package/dist/commonjs/runtime/native/styles/variables.js.map +1 -1
  85. package/dist/commonjs/runtime/utils/objects.js +25 -5
  86. package/dist/commonjs/runtime/utils/objects.js.map +1 -1
  87. package/dist/commonjs/runtime/utils/specificity.js +2 -1
  88. package/dist/commonjs/runtime/utils/specificity.js.map +1 -1
  89. package/dist/module/compiler/atRules.js +16 -3
  90. package/dist/module/compiler/atRules.js.map +1 -1
  91. package/dist/module/compiler/attributes.test.js +1 -1
  92. package/dist/module/compiler/attributes.test.js.map +1 -1
  93. package/dist/module/compiler/compiler.js +26 -17
  94. package/dist/module/compiler/compiler.js.map +1 -1
  95. package/dist/module/compiler/compiler.types.js.map +1 -1
  96. package/dist/module/compiler/declarations.js +190 -90
  97. package/dist/module/compiler/declarations.js.map +1 -1
  98. package/dist/module/compiler/inheritance.test.js +7 -7
  99. package/dist/module/compiler/inheritance.test.js.map +1 -1
  100. package/dist/module/compiler/keyframes.js +1 -1
  101. package/dist/module/compiler/keyframes.js.map +1 -1
  102. package/dist/module/compiler/selector-builder.js +452 -0
  103. package/dist/module/compiler/selector-builder.js.map +1 -0
  104. package/dist/module/compiler/selectors.js +10 -6
  105. package/dist/module/compiler/selectors.js.map +1 -1
  106. package/dist/module/compiler/stylesheet.js +121 -42
  107. package/dist/module/compiler/stylesheet.js.map +1 -1
  108. package/dist/module/jest/index.js +32 -10
  109. package/dist/module/jest/index.js.map +1 -1
  110. package/dist/module/metro/index.js +1 -1
  111. package/dist/module/metro/index.js.map +1 -1
  112. package/dist/module/poison.pill.js +4 -1
  113. package/dist/module/poison.pill.js.map +1 -1
  114. package/dist/module/runtime/native/conditions/attributes.js +38 -0
  115. package/dist/module/runtime/native/conditions/attributes.js.map +1 -0
  116. package/dist/module/runtime/native/conditions/container-query.js +28 -21
  117. package/dist/module/runtime/native/conditions/container-query.js.map +1 -1
  118. package/dist/module/runtime/native/conditions/guards.js.map +1 -1
  119. package/dist/module/runtime/native/conditions/index.js +10 -46
  120. package/dist/module/runtime/native/conditions/index.js.map +1 -1
  121. package/dist/module/runtime/native/conditions/media-query.js +19 -17
  122. package/dist/module/runtime/native/conditions/media-query.js.map +1 -1
  123. package/dist/module/runtime/native/injection.js +2 -1
  124. package/dist/module/runtime/native/injection.js.map +1 -1
  125. package/dist/module/runtime/native/react/interaction.js +10 -10
  126. package/dist/module/runtime/native/react/interaction.js.map +1 -1
  127. package/dist/module/runtime/native/react/rules.js +9 -9
  128. package/dist/module/runtime/native/react/rules.js.map +1 -1
  129. package/dist/module/runtime/native/react/useNativeCss.js +2 -1
  130. package/dist/module/runtime/native/react/useNativeCss.js.map +1 -1
  131. package/dist/module/runtime/native/reactivity.js +0 -11
  132. package/dist/module/runtime/native/reactivity.js.map +1 -1
  133. package/dist/module/runtime/native/reanimated.js +13 -0
  134. package/dist/module/runtime/native/reanimated.js.map +1 -0
  135. package/dist/module/runtime/native/root.js +24 -0
  136. package/dist/module/runtime/native/root.js.map +1 -0
  137. package/dist/module/runtime/native/styles/calculate-props.js +57 -49
  138. package/dist/module/runtime/native/styles/calculate-props.js.map +1 -1
  139. package/dist/module/runtime/native/styles/defaults.js +1 -1
  140. package/dist/module/runtime/native/styles/defaults.js.map +1 -1
  141. package/dist/module/runtime/native/styles/functions/animation-timing.js +30 -0
  142. package/dist/module/runtime/native/styles/functions/animation-timing.js.map +1 -0
  143. package/dist/module/runtime/native/styles/{calc.js → functions/calc.js} +1 -1
  144. package/dist/module/runtime/native/styles/functions/calc.js.map +1 -0
  145. package/dist/module/runtime/native/styles/{filters.js → functions/filters.js} +2 -2
  146. package/dist/module/runtime/native/styles/functions/filters.js.map +1 -0
  147. package/dist/module/runtime/native/styles/functions/index.js +8 -0
  148. package/dist/module/runtime/native/styles/functions/index.js.map +1 -0
  149. package/dist/module/runtime/native/styles/{platform-functions.js → functions/platform-functions.js} +1 -1
  150. package/dist/module/runtime/native/styles/functions/platform-functions.js.map +1 -0
  151. package/dist/module/runtime/native/styles/functions/transform-functions.js +76 -0
  152. package/dist/module/runtime/native/styles/functions/transform-functions.js.map +1 -0
  153. package/dist/module/runtime/native/styles/index.js +12 -12
  154. package/dist/module/runtime/native/styles/index.js.map +1 -1
  155. package/dist/module/runtime/native/styles/resolve.js +20 -44
  156. package/dist/module/runtime/native/styles/resolve.js.map +1 -1
  157. package/dist/module/runtime/native/styles/{shorthand.js → shorthands/_handler.js} +5 -5
  158. package/dist/module/runtime/native/styles/shorthands/_handler.js.map +1 -0
  159. package/dist/module/runtime/native/styles/{animation.js → shorthands/animation.js} +3 -34
  160. package/dist/module/runtime/native/styles/shorthands/animation.js.map +1 -0
  161. package/dist/module/runtime/native/styles/{border.js → shorthands/border.js} +1 -1
  162. package/dist/module/runtime/native/styles/shorthands/border.js.map +1 -0
  163. package/dist/module/runtime/native/styles/{box-shadow.js → shorthands/box-shadow.js} +2 -2
  164. package/dist/module/runtime/native/styles/shorthands/box-shadow.js.map +1 -0
  165. package/dist/module/runtime/native/styles/shorthands/index.js +8 -0
  166. package/dist/module/runtime/native/styles/shorthands/index.js.map +1 -0
  167. package/dist/module/runtime/native/styles/{text-shadow.js → shorthands/text-shadow.js} +1 -1
  168. package/dist/module/runtime/native/styles/shorthands/text-shadow.js.map +1 -0
  169. package/dist/module/runtime/native/styles/shorthands/transform.js.map +1 -0
  170. package/dist/module/runtime/native/styles/units.js +7 -4
  171. package/dist/module/runtime/native/styles/units.js.map +1 -1
  172. package/dist/module/runtime/native/styles/variables.js +2 -1
  173. package/dist/module/runtime/native/styles/variables.js.map +1 -1
  174. package/dist/module/runtime/utils/objects.js +25 -5
  175. package/dist/module/runtime/utils/objects.js.map +1 -1
  176. package/dist/module/runtime/utils/specificity.js +2 -1
  177. package/dist/module/runtime/utils/specificity.js.map +1 -1
  178. package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -1
  179. package/dist/typescript/commonjs/src/compiler/compiler.d.ts +9 -2
  180. package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
  181. package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +5 -4
  182. package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
  183. package/dist/typescript/commonjs/src/compiler/declarations.d.ts +16 -19
  184. package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
  185. package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts +23 -0
  186. package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -0
  187. package/dist/typescript/commonjs/src/compiler/selectors.d.ts +3 -2
  188. package/dist/typescript/commonjs/src/compiler/selectors.d.ts.map +1 -1
  189. package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +21 -7
  190. package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
  191. package/dist/typescript/commonjs/src/jest/index.d.ts +20 -3
  192. package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
  193. package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
  194. package/dist/typescript/commonjs/src/poison.pill.d.ts.map +1 -1
  195. package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts +5 -0
  196. package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts.map +1 -0
  197. package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts +3 -3
  198. package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts.map +1 -1
  199. package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts +2 -2
  200. package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts.map +1 -1
  201. package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts +2 -2
  202. package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts.map +1 -1
  203. package/dist/typescript/commonjs/src/runtime/native/conditions/media-query.d.ts +2 -2
  204. package/dist/typescript/commonjs/src/runtime/native/conditions/media-query.d.ts.map +1 -1
  205. package/dist/typescript/commonjs/src/runtime/native/injection.d.ts.map +1 -1
  206. package/dist/typescript/commonjs/src/runtime/native/react/interaction.d.ts +2 -2
  207. package/dist/typescript/commonjs/src/runtime/native/react/interaction.d.ts.map +1 -1
  208. package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts +2 -1
  209. package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts.map +1 -1
  210. package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts +2 -10
  211. package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts.map +1 -1
  212. package/dist/typescript/commonjs/src/runtime/native/reanimated.d.ts +5 -0
  213. package/dist/typescript/commonjs/src/runtime/native/reanimated.d.ts.map +1 -0
  214. package/dist/typescript/commonjs/src/runtime/native/root.d.ts +11 -0
  215. package/dist/typescript/commonjs/src/runtime/native/root.d.ts.map +1 -0
  216. package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
  217. package/dist/typescript/commonjs/src/runtime/native/styles/defaults.d.ts.map +1 -1
  218. package/dist/typescript/commonjs/src/runtime/native/styles/functions/animation-timing.d.ts +4 -0
  219. package/dist/typescript/commonjs/src/runtime/native/styles/functions/animation-timing.d.ts.map +1 -0
  220. package/dist/typescript/commonjs/src/runtime/native/styles/functions/calc.d.ts +3 -0
  221. package/dist/typescript/commonjs/src/runtime/native/styles/functions/calc.d.ts.map +1 -0
  222. package/dist/typescript/commonjs/src/runtime/native/styles/{filters.d.ts → functions/filters.d.ts} +1 -1
  223. package/dist/typescript/commonjs/src/runtime/native/styles/functions/filters.d.ts.map +1 -0
  224. package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts +6 -0
  225. package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts.map +1 -0
  226. package/dist/typescript/commonjs/src/runtime/native/styles/{platform-functions.d.ts → functions/platform-functions.d.ts} +2 -2
  227. package/dist/typescript/commonjs/src/runtime/native/styles/functions/platform-functions.d.ts.map +1 -0
  228. package/dist/typescript/commonjs/src/runtime/native/styles/functions/transform-functions.d.ts +5 -0
  229. package/dist/typescript/commonjs/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -0
  230. package/dist/typescript/commonjs/src/runtime/native/styles/resolve.d.ts.map +1 -1
  231. package/dist/typescript/commonjs/src/runtime/native/styles/{shorthand.d.ts → shorthands/_handler.d.ts} +2 -2
  232. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/_handler.d.ts.map +1 -0
  233. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/animation.d.ts +4 -0
  234. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -0
  235. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/border.d.ts +2 -0
  236. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/border.d.ts.map +1 -0
  237. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts +3 -0
  238. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -0
  239. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/index.d.ts +6 -0
  240. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/index.d.ts.map +1 -0
  241. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/text-shadow.d.ts +2 -0
  242. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/text-shadow.d.ts.map +1 -0
  243. package/dist/typescript/commonjs/src/runtime/native/styles/{transform.d.ts → shorthands/transform.d.ts} +1 -1
  244. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -0
  245. package/dist/typescript/commonjs/src/runtime/native/styles/units.d.ts.map +1 -1
  246. package/dist/typescript/commonjs/src/runtime/native/styles/variables.d.ts.map +1 -1
  247. package/dist/typescript/commonjs/src/runtime/utils/objects.d.ts.map +1 -1
  248. package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts +1 -0
  249. package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts.map +1 -1
  250. package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -1
  251. package/dist/typescript/module/src/compiler/compiler.d.ts +9 -2
  252. package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
  253. package/dist/typescript/module/src/compiler/compiler.types.d.ts +5 -4
  254. package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
  255. package/dist/typescript/module/src/compiler/declarations.d.ts +16 -19
  256. package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
  257. package/dist/typescript/module/src/compiler/selector-builder.d.ts +23 -0
  258. package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -0
  259. package/dist/typescript/module/src/compiler/selectors.d.ts +3 -2
  260. package/dist/typescript/module/src/compiler/selectors.d.ts.map +1 -1
  261. package/dist/typescript/module/src/compiler/stylesheet.d.ts +21 -7
  262. package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
  263. package/dist/typescript/module/src/jest/index.d.ts +20 -3
  264. package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
  265. package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
  266. package/dist/typescript/module/src/poison.pill.d.ts.map +1 -1
  267. package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts +5 -0
  268. package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts.map +1 -0
  269. package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts +3 -3
  270. package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts.map +1 -1
  271. package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts +2 -2
  272. package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts.map +1 -1
  273. package/dist/typescript/module/src/runtime/native/conditions/index.d.ts +2 -2
  274. package/dist/typescript/module/src/runtime/native/conditions/index.d.ts.map +1 -1
  275. package/dist/typescript/module/src/runtime/native/conditions/media-query.d.ts +2 -2
  276. package/dist/typescript/module/src/runtime/native/conditions/media-query.d.ts.map +1 -1
  277. package/dist/typescript/module/src/runtime/native/injection.d.ts.map +1 -1
  278. package/dist/typescript/module/src/runtime/native/react/interaction.d.ts +2 -2
  279. package/dist/typescript/module/src/runtime/native/react/interaction.d.ts.map +1 -1
  280. package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts +2 -1
  281. package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts.map +1 -1
  282. package/dist/typescript/module/src/runtime/native/reactivity.d.ts +2 -10
  283. package/dist/typescript/module/src/runtime/native/reactivity.d.ts.map +1 -1
  284. package/dist/typescript/module/src/runtime/native/reanimated.d.ts +5 -0
  285. package/dist/typescript/module/src/runtime/native/reanimated.d.ts.map +1 -0
  286. package/dist/typescript/module/src/runtime/native/root.d.ts +11 -0
  287. package/dist/typescript/module/src/runtime/native/root.d.ts.map +1 -0
  288. package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
  289. package/dist/typescript/module/src/runtime/native/styles/defaults.d.ts.map +1 -1
  290. package/dist/typescript/module/src/runtime/native/styles/functions/animation-timing.d.ts +4 -0
  291. package/dist/typescript/module/src/runtime/native/styles/functions/animation-timing.d.ts.map +1 -0
  292. package/dist/typescript/module/src/runtime/native/styles/functions/calc.d.ts +3 -0
  293. package/dist/typescript/module/src/runtime/native/styles/functions/calc.d.ts.map +1 -0
  294. package/dist/typescript/module/src/runtime/native/styles/{filters.d.ts → functions/filters.d.ts} +1 -1
  295. package/dist/typescript/module/src/runtime/native/styles/functions/filters.d.ts.map +1 -0
  296. package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts +6 -0
  297. package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts.map +1 -0
  298. package/dist/typescript/module/src/runtime/native/styles/{platform-functions.d.ts → functions/platform-functions.d.ts} +2 -2
  299. package/dist/typescript/module/src/runtime/native/styles/functions/platform-functions.d.ts.map +1 -0
  300. package/dist/typescript/module/src/runtime/native/styles/functions/transform-functions.d.ts +5 -0
  301. package/dist/typescript/module/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -0
  302. package/dist/typescript/module/src/runtime/native/styles/resolve.d.ts.map +1 -1
  303. package/dist/typescript/module/src/runtime/native/styles/{shorthand.d.ts → shorthands/_handler.d.ts} +2 -2
  304. package/dist/typescript/module/src/runtime/native/styles/shorthands/_handler.d.ts.map +1 -0
  305. package/dist/typescript/module/src/runtime/native/styles/shorthands/animation.d.ts +4 -0
  306. package/dist/typescript/module/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -0
  307. package/dist/typescript/module/src/runtime/native/styles/shorthands/border.d.ts +2 -0
  308. package/dist/typescript/module/src/runtime/native/styles/shorthands/border.d.ts.map +1 -0
  309. package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts +3 -0
  310. package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -0
  311. package/dist/typescript/module/src/runtime/native/styles/shorthands/index.d.ts +6 -0
  312. package/dist/typescript/module/src/runtime/native/styles/shorthands/index.d.ts.map +1 -0
  313. package/dist/typescript/module/src/runtime/native/styles/shorthands/text-shadow.d.ts +2 -0
  314. package/dist/typescript/module/src/runtime/native/styles/shorthands/text-shadow.d.ts.map +1 -0
  315. package/dist/typescript/module/src/runtime/native/styles/{transform.d.ts → shorthands/transform.d.ts} +1 -1
  316. package/dist/typescript/module/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -0
  317. package/dist/typescript/module/src/runtime/native/styles/units.d.ts.map +1 -1
  318. package/dist/typescript/module/src/runtime/native/styles/variables.d.ts.map +1 -1
  319. package/dist/typescript/module/src/runtime/utils/objects.d.ts.map +1 -1
  320. package/dist/typescript/module/src/runtime/utils/specificity.d.ts +1 -0
  321. package/dist/typescript/module/src/runtime/utils/specificity.d.ts.map +1 -1
  322. package/package.json +4 -3
  323. package/src/compiler/atRules.ts +17 -3
  324. package/src/compiler/attributes.test.ts +1 -1
  325. package/src/compiler/compiler.ts +30 -31
  326. package/src/compiler/compiler.types.ts +7 -5
  327. package/src/compiler/declarations.ts +351 -114
  328. package/src/compiler/inheritance.test.ts +6 -6
  329. package/src/compiler/keyframes.ts +1 -1
  330. package/src/compiler/selector-builder.ts +531 -0
  331. package/src/compiler/selectors.ts +20 -6
  332. package/src/compiler/stylesheet.ts +168 -48
  333. package/src/jest/index.ts +41 -8
  334. package/src/metro/index.ts +6 -3
  335. package/src/poison.pill.ts +5 -1
  336. package/src/runtime/native/conditions/attributes.ts +52 -0
  337. package/src/runtime/native/conditions/container-query.ts +27 -22
  338. package/src/runtime/native/conditions/guards.ts +1 -2
  339. package/src/runtime/native/conditions/index.ts +12 -66
  340. package/src/runtime/native/conditions/media-query.ts +20 -20
  341. package/src/runtime/native/injection.ts +1 -1
  342. package/src/runtime/native/react/interaction.ts +12 -12
  343. package/src/runtime/native/react/rules.ts +9 -9
  344. package/src/runtime/native/react/useNativeCss.ts +4 -1
  345. package/src/runtime/native/reactivity.ts +2 -21
  346. package/src/runtime/native/reanimated.ts +22 -0
  347. package/src/runtime/native/root.ts +31 -0
  348. package/src/runtime/native/styles/calculate-props.ts +61 -50
  349. package/src/runtime/native/styles/defaults.ts +1 -0
  350. package/src/runtime/native/styles/functions/animation-timing.ts +44 -0
  351. package/src/runtime/native/styles/{calc.ts → functions/calc.ts} +2 -2
  352. package/src/runtime/native/styles/{filters.ts → functions/filters.ts} +3 -3
  353. package/src/runtime/native/styles/functions/index.ts +5 -0
  354. package/src/runtime/native/styles/{platform-functions.ts → functions/platform-functions.ts} +2 -2
  355. package/src/runtime/native/styles/functions/transform-functions.ts +51 -0
  356. package/src/runtime/native/styles/index.ts +12 -12
  357. package/src/runtime/native/styles/resolve.ts +20 -63
  358. package/src/runtime/native/styles/{shorthand.ts → shorthands/_handler.ts} +5 -5
  359. package/src/runtime/native/styles/{animation.ts → shorthands/animation.ts} +4 -63
  360. package/src/runtime/native/styles/{border.ts → shorthands/border.ts} +1 -1
  361. package/src/runtime/native/styles/{box-shadow.ts → shorthands/box-shadow.ts} +3 -3
  362. package/src/runtime/native/styles/shorthands/index.ts +5 -0
  363. package/src/runtime/native/styles/{text-shadow.ts → shorthands/text-shadow.ts} +1 -1
  364. package/src/runtime/native/styles/{transform.ts → shorthands/transform.ts} +1 -1
  365. package/src/runtime/native/styles/units.ts +8 -4
  366. package/src/runtime/native/styles/variables.ts +2 -6
  367. package/src/runtime/utils/objects.ts +24 -3
  368. package/src/runtime/utils/specificity.ts +1 -0
  369. package/dist/commonjs/runtime/native/styles/animation.js.map +0 -1
  370. package/dist/commonjs/runtime/native/styles/border.js.map +0 -1
  371. package/dist/commonjs/runtime/native/styles/box-shadow.js.map +0 -1
  372. package/dist/commonjs/runtime/native/styles/calc.js.map +0 -1
  373. package/dist/commonjs/runtime/native/styles/filters.js.map +0 -1
  374. package/dist/commonjs/runtime/native/styles/platform-functions.js.map +0 -1
  375. package/dist/commonjs/runtime/native/styles/shorthand.js.map +0 -1
  376. package/dist/commonjs/runtime/native/styles/text-shadow.js.map +0 -1
  377. package/dist/commonjs/runtime/native/styles/transform.js.map +0 -1
  378. package/dist/module/runtime/native/styles/animation.js.map +0 -1
  379. package/dist/module/runtime/native/styles/border.js.map +0 -1
  380. package/dist/module/runtime/native/styles/box-shadow.js.map +0 -1
  381. package/dist/module/runtime/native/styles/calc.js.map +0 -1
  382. package/dist/module/runtime/native/styles/filters.js.map +0 -1
  383. package/dist/module/runtime/native/styles/platform-functions.js.map +0 -1
  384. package/dist/module/runtime/native/styles/shorthand.js.map +0 -1
  385. package/dist/module/runtime/native/styles/text-shadow.js.map +0 -1
  386. package/dist/module/runtime/native/styles/transform.js.map +0 -1
  387. package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts +0 -9
  388. package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts.map +0 -1
  389. package/dist/typescript/commonjs/src/runtime/native/styles/border.d.ts +0 -2
  390. package/dist/typescript/commonjs/src/runtime/native/styles/border.d.ts.map +0 -1
  391. package/dist/typescript/commonjs/src/runtime/native/styles/box-shadow.d.ts +0 -3
  392. package/dist/typescript/commonjs/src/runtime/native/styles/box-shadow.d.ts.map +0 -1
  393. package/dist/typescript/commonjs/src/runtime/native/styles/calc.d.ts +0 -3
  394. package/dist/typescript/commonjs/src/runtime/native/styles/calc.d.ts.map +0 -1
  395. package/dist/typescript/commonjs/src/runtime/native/styles/filters.d.ts.map +0 -1
  396. package/dist/typescript/commonjs/src/runtime/native/styles/platform-functions.d.ts.map +0 -1
  397. package/dist/typescript/commonjs/src/runtime/native/styles/shorthand.d.ts.map +0 -1
  398. package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts +0 -2
  399. package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts.map +0 -1
  400. package/dist/typescript/commonjs/src/runtime/native/styles/transform.d.ts.map +0 -1
  401. package/dist/typescript/module/src/runtime/native/styles/animation.d.ts +0 -9
  402. package/dist/typescript/module/src/runtime/native/styles/animation.d.ts.map +0 -1
  403. package/dist/typescript/module/src/runtime/native/styles/border.d.ts +0 -2
  404. package/dist/typescript/module/src/runtime/native/styles/border.d.ts.map +0 -1
  405. package/dist/typescript/module/src/runtime/native/styles/box-shadow.d.ts +0 -3
  406. package/dist/typescript/module/src/runtime/native/styles/box-shadow.d.ts.map +0 -1
  407. package/dist/typescript/module/src/runtime/native/styles/calc.d.ts +0 -3
  408. package/dist/typescript/module/src/runtime/native/styles/calc.d.ts.map +0 -1
  409. package/dist/typescript/module/src/runtime/native/styles/filters.d.ts.map +0 -1
  410. package/dist/typescript/module/src/runtime/native/styles/platform-functions.d.ts.map +0 -1
  411. package/dist/typescript/module/src/runtime/native/styles/shorthand.d.ts.map +0 -1
  412. package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts +0 -2
  413. package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts.map +0 -1
  414. package/dist/typescript/module/src/runtime/native/styles/transform.d.ts.map +0 -1
  415. /package/dist/commonjs/runtime/native/styles/{transform.js → shorthands/transform.js} +0 -0
  416. /package/dist/module/runtime/native/styles/{transform.js → shorthands/transform.js} +0 -0
@@ -1,40 +1,36 @@
1
- /* eslint-disable */
2
- import type {
3
- AttributeQuery,
4
- PseudoClassesQuery,
5
- StyleRule,
6
- } from "../../../compiler";
1
+ import type { PseudoClassesQuery, StyleRule } from "../../../compiler";
7
2
  import type { Props } from "../../runtime.types";
8
3
  import {
9
4
  activeFamily,
10
5
  focusFamily,
11
6
  hoverFamily,
12
7
  type ContainerContextValue,
13
- type Effect,
8
+ type Getter,
14
9
  } from "../reactivity";
10
+ import { testAttributes } from "./attributes";
15
11
  import { testContainerQueries } from "./container-query";
16
12
  import type { RenderGuard } from "./guards";
17
13
  import { testMediaQuery } from "./media-query";
18
14
 
19
15
  export function testRule(
20
16
  rule: StyleRule,
21
- effect: Effect,
17
+ get: Getter,
22
18
  props: Props,
23
19
  guards: RenderGuard[],
24
20
  containerContext: ContainerContextValue,
25
21
  ) {
26
- if (rule.p && !pseudoClasses(rule.p, effect)) {
22
+ if (rule.p && !pseudoClasses(rule.p, get)) {
27
23
  return false;
28
24
  }
29
- if (rule.m && !testMediaQuery(rule.m, effect)) {
25
+ if (rule.m && !testMediaQuery(rule.m, get)) {
30
26
  return false;
31
27
  }
32
- if (rule.aq && !attributes(rule.aq, props, guards)) {
28
+ if (rule.aq && !testAttributes(rule.aq, props, guards)) {
33
29
  return false;
34
30
  }
35
31
  if (
36
32
  rule.cq &&
37
- !testContainerQueries(rule.cq, containerContext, guards, effect)
33
+ !testContainerQueries(rule.cq, containerContext, guards, get)
38
34
  ) {
39
35
  return false;
40
36
  }
@@ -42,65 +38,15 @@ export function testRule(
42
38
  return true;
43
39
  }
44
40
 
45
- function pseudoClasses(query: PseudoClassesQuery, effect: Effect) {
46
- if (query.h && !hoverFamily(effect).get(effect)) {
41
+ function pseudoClasses(query: PseudoClassesQuery, get: Getter) {
42
+ if (query.h && !get(hoverFamily(get))) {
47
43
  return false;
48
44
  }
49
- if (query.a && !activeFamily(effect).get(effect)) {
45
+ if (query.a && !get(activeFamily(get))) {
50
46
  return false;
51
47
  }
52
- if (query.f && !focusFamily(effect).get(effect)) {
48
+ if (query.f && !get(focusFamily(get))) {
53
49
  return false;
54
50
  }
55
51
  return true;
56
52
  }
57
-
58
- function attributes(
59
- queries: AttributeQuery[],
60
- props: Props,
61
- guards: RenderGuard[],
62
- ) {
63
- return queries.every((query) => testAttribute(query, props, guards));
64
- }
65
-
66
- function testAttribute(
67
- query: AttributeQuery,
68
- props: Props,
69
- guards: RenderGuard[],
70
- ) {
71
- let value: any;
72
-
73
- if (query[0] === "a") {
74
- value = props?.[query[1]];
75
- } else {
76
- value = props?.dataSet?.[query[1]];
77
- }
78
-
79
- guards.push([query[0], query[1], value]);
80
-
81
- const operator = query[2];
82
-
83
- if (!operator) {
84
- return value !== undefined && value !== null && value !== false;
85
- }
86
-
87
- switch (operator) {
88
- case "!":
89
- return !value;
90
- case "=":
91
- return value == query[3];
92
- case "~=":
93
- return value?.toString().split(" ").includes(query[3]);
94
- case "|=":
95
- return value?.toString().startsWith(query[3] + "-");
96
- case "^=":
97
- return value?.toString().startsWith(query[3]);
98
- case "$=":
99
- return value?.toString().endsWith(query[3]);
100
- case "*=":
101
- return value?.toString().includes(query[3]);
102
- default:
103
- operator satisfies never;
104
- return false;
105
- }
106
- }
@@ -2,61 +2,61 @@
2
2
  import { PixelRatio, Platform } from "react-native";
3
3
 
4
4
  import type { MediaCondition } from "../../../compiler";
5
- import { colorScheme, vh, vw, type Effect } from "../reactivity";
5
+ import { colorScheme, vh, vw, type Getter } from "../reactivity";
6
6
 
7
- export function testMediaQuery(mediaQueries: MediaCondition[], effect: Effect) {
8
- return mediaQueries.every((query) => test(query, effect));
7
+ export function testMediaQuery(mediaQueries: MediaCondition[], get: Getter) {
8
+ return mediaQueries.every((query) => test(query, get));
9
9
  }
10
10
 
11
- function test(mediaQuery: MediaCondition, effect: Effect): Boolean {
11
+ function test(mediaQuery: MediaCondition, get: Getter): Boolean {
12
12
  switch (mediaQuery[0]) {
13
13
  case "[]":
14
14
  case "!!":
15
15
  return false;
16
16
  case "!":
17
- return !test(mediaQuery[1], effect);
17
+ return !test(mediaQuery[1], get);
18
18
  case "&":
19
19
  return mediaQuery[1].every((query) => {
20
- return test(query, effect);
20
+ return test(query, get);
21
21
  });
22
22
  case "|":
23
23
  return mediaQuery[1].some((query) => {
24
- return test(query, effect);
24
+ return test(query, get);
25
25
  });
26
26
  case ">":
27
27
  case ">=":
28
28
  case "<":
29
29
  case "<=":
30
30
  case "=": {
31
- return testComparison(mediaQuery, effect);
31
+ return testComparison(mediaQuery, get);
32
32
  }
33
33
  }
34
34
  }
35
35
 
36
- function testComparison(mediaQuery: MediaCondition, effect: Effect): Boolean {
36
+ function testComparison(mediaQuery: MediaCondition, get: Getter): Boolean {
37
37
  let left: number | undefined;
38
38
  const right = mediaQuery[2];
39
39
 
40
40
  switch (mediaQuery[1]) {
41
+ case "hover":
42
+ return true;
41
43
  case "platform":
42
- return right === Platform.OS;
44
+ return right === "native" || right === Platform.OS;
43
45
  case "prefers-color-scheme": {
44
- return right === colorScheme.get(effect);
46
+ return right === get(colorScheme);
45
47
  }
46
48
  case "display-mode":
47
49
  return right === "native" || Platform.OS === right;
48
50
  case "min-width":
49
- return typeof right === "number" && vw.get(effect) >= right;
51
+ return typeof right === "number" && get(vw) >= right;
50
52
  case "max-width":
51
- return typeof right === "number" && vw.get(effect) <= right;
53
+ return typeof right === "number" && get(vw) <= right;
52
54
  case "min-height":
53
- return typeof right === "number" && vh.get(effect) >= right;
55
+ return typeof right === "number" && get(vh) >= right;
54
56
  case "max-height":
55
- return typeof right === "number" && vh.get(effect) <= right;
57
+ return typeof right === "number" && get(vh) <= right;
56
58
  case "orientation":
57
- return right === "landscape"
58
- ? vh.get(effect) < vw.get(effect)
59
- : vh.get(effect) >= vw.get(effect);
59
+ return right === "landscape" ? get(vh) < get(vw) : get(vh) >= get(vw);
60
60
  }
61
61
 
62
62
  if (typeof right !== "number") {
@@ -65,10 +65,10 @@ function testComparison(mediaQuery: MediaCondition, effect: Effect): Boolean {
65
65
 
66
66
  switch (mediaQuery[1]) {
67
67
  case "width":
68
- left = vw.get(effect);
68
+ left = get(vw);
69
69
  break;
70
70
  case "height":
71
- left = vh.get(effect);
71
+ left = get(vh);
72
72
  break;
73
73
  case "resolution":
74
74
  left = PixelRatio.get();
@@ -7,9 +7,9 @@ import {
7
7
  family,
8
8
  observable,
9
9
  observableBatch,
10
- rootVariables,
11
10
  type Observable,
12
11
  } from "./reactivity";
12
+ import { rootVariables } from "./root";
13
13
 
14
14
  export function StyleCollection() {
15
15
  return null;
@@ -6,11 +6,11 @@ import {
6
6
  containerLayoutFamily,
7
7
  focusFamily,
8
8
  hoverFamily,
9
- type Effect,
9
+ type Getter as WeakKey,
10
10
  } from "../reactivity";
11
11
 
12
12
  const mainCache = new WeakMap<
13
- Effect,
13
+ WeakKey,
14
14
  WeakMap<Function, (event: any) => void>
15
15
  >();
16
16
 
@@ -38,14 +38,14 @@ const defaultHandlers: Record<InteractionType, Handler> = {
38
38
  };
39
39
 
40
40
  export function getInteractionHandler(
41
- effect: Effect,
41
+ weakKey: WeakKey,
42
42
  type: InteractionType,
43
43
  handler = defaultHandlers[type],
44
44
  ) {
45
- let cache = mainCache.get(effect);
45
+ let cache = mainCache.get(weakKey);
46
46
  if (!cache) {
47
47
  cache = new WeakMap();
48
- mainCache.set(effect, cache);
48
+ mainCache.set(weakKey, cache);
49
49
  }
50
50
 
51
51
  let cached = cache.get(handler);
@@ -57,29 +57,29 @@ export function getInteractionHandler(
57
57
 
58
58
  switch (type) {
59
59
  case "onLayout":
60
- containerLayoutFamily(effect).set(
60
+ containerLayoutFamily(weakKey).set(
61
61
  (event as LayoutChangeEvent).nativeEvent.layout,
62
62
  );
63
63
  break;
64
64
  case "onHoverIn":
65
- hoverFamily(effect).set(true);
65
+ hoverFamily(weakKey).set(true);
66
66
  break;
67
67
  case "onHoverOut":
68
- hoverFamily(effect).set(false);
68
+ hoverFamily(weakKey).set(false);
69
69
  break;
70
70
  case "onPress":
71
71
  break;
72
72
  case "onPressIn":
73
- activeFamily(effect).set(true);
73
+ activeFamily(weakKey).set(true);
74
74
  break;
75
75
  case "onPressOut":
76
- activeFamily(effect).set(false);
76
+ activeFamily(weakKey).set(false);
77
77
  break;
78
78
  case "onFocus":
79
- focusFamily(effect).set(true);
79
+ focusFamily(weakKey).set(true);
80
80
  break;
81
81
  case "onBlur":
82
- focusFamily(effect).set(false);
82
+ focusFamily(weakKey).set(false);
83
83
  break;
84
84
  }
85
85
  };
@@ -104,7 +104,7 @@ export function updateRules(
104
104
  if (
105
105
  !testRule(
106
106
  rule,
107
- state.ruleEffect,
107
+ state.ruleEffectGetter,
108
108
  currentProps,
109
109
  guards,
110
110
  inheritedContainers,
@@ -132,20 +132,20 @@ export function updateRules(
132
132
  containers = {
133
133
  ...inheritedContainers,
134
134
  // This container becomes the default container
135
- [DEFAULT_CONTAINER_NAME]: state.ruleEffect,
135
+ [DEFAULT_CONTAINER_NAME]: state.ruleEffectGetter,
136
136
  };
137
137
  }
138
138
 
139
139
  // This this component as the named container
140
140
  for (const name of rule.c) {
141
- containers![name] = state.ruleEffect;
141
+ containers![name] = state.ruleEffectGetter;
142
142
  }
143
143
 
144
144
  // Enable hover/active/focus/layout handlers
145
- hoverFamily(state.ruleEffect);
146
- activeFamily(state.ruleEffect);
147
- focusFamily(state.ruleEffect);
148
- containerLayoutFamily(state.ruleEffect);
145
+ hoverFamily(state.ruleEffectGetter);
146
+ activeFamily(state.ruleEffectGetter);
147
+ focusFamily(state.ruleEffectGetter);
148
+ containerLayoutFamily(state.ruleEffectGetter);
149
149
  }
150
150
 
151
151
  if (rule.a) {
@@ -163,7 +163,7 @@ export function updateRules(
163
163
 
164
164
  if (process.env.NODE_ENV !== "production") {
165
165
  if (isRerender) {
166
- let pressable = activeFamily.has(state.ruleEffect);
166
+ let pressable = activeFamily.has(state.ruleEffectGetter);
167
167
 
168
168
  if (Boolean(variables) !== Boolean(state.variables)) {
169
169
  console.log(
@@ -190,7 +190,7 @@ export function updateRules(
190
190
  let pressable =
191
191
  process.env.NODE_ENV === "production"
192
192
  ? undefined
193
- : activeFamily.has(state.ruleEffect);
193
+ : activeFamily.has(state.ruleEffectGetter);
194
194
 
195
195
  if (!rules.size && !state.stylesObs && !inlineVariables.size) {
196
196
  return {
@@ -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]);