react-native-css 3.0.0-nightly.8dd703d → 3.0.0-nightly.9c84741

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 (368) hide show
  1. package/dist/commonjs/compiler/compiler.js +12 -5
  2. package/dist/commonjs/compiler/compiler.js.map +1 -1
  3. package/dist/commonjs/compiler/declarations.js +89 -82
  4. package/dist/commonjs/compiler/declarations.js.map +1 -1
  5. package/dist/commonjs/compiler/inheritance.test.js +10 -10
  6. package/dist/commonjs/compiler/inheritance.test.js.map +1 -1
  7. package/dist/commonjs/compiler/pseudo-elements.js +49 -0
  8. package/dist/commonjs/compiler/pseudo-elements.js.map +1 -0
  9. package/dist/commonjs/compiler/selector-builder.js +124 -80
  10. package/dist/commonjs/compiler/selector-builder.js.map +1 -1
  11. package/dist/commonjs/compiler/stylesheet.js +18 -6
  12. package/dist/commonjs/compiler/stylesheet.js.map +1 -1
  13. package/dist/commonjs/compiler/supports.js +27 -0
  14. package/dist/commonjs/compiler/supports.js.map +1 -0
  15. package/dist/commonjs/components/ActivityIndicator.js +22 -0
  16. package/dist/commonjs/components/ActivityIndicator.js.map +1 -0
  17. package/dist/commonjs/components/Button.js +22 -0
  18. package/dist/commonjs/components/Button.js.map +1 -0
  19. package/dist/commonjs/components/FlatList.js +19 -0
  20. package/dist/commonjs/components/FlatList.js.map +1 -0
  21. package/dist/commonjs/components/Image.js +17 -0
  22. package/dist/commonjs/components/Image.js.map +1 -0
  23. package/dist/commonjs/components/Switch.js +17 -0
  24. package/dist/commonjs/components/Switch.js.map +1 -0
  25. package/dist/commonjs/components/TextInput.js +17 -0
  26. package/dist/commonjs/components/TextInput.js.map +1 -0
  27. package/dist/commonjs/components/index.js +48 -0
  28. package/dist/commonjs/components/index.js.map +1 -1
  29. package/dist/commonjs/components/react-native-safe-area-context.js +17 -0
  30. package/dist/commonjs/components/react-native-safe-area-context.js.map +1 -0
  31. package/dist/commonjs/components/react-native-safe-area-context.native.js +53 -0
  32. package/dist/commonjs/components/react-native-safe-area-context.native.js.map +1 -0
  33. package/dist/commonjs/jest/index.js +5 -5
  34. package/dist/commonjs/jest/index.js.map +1 -1
  35. package/dist/commonjs/metro/index.js +6 -3
  36. package/dist/commonjs/metro/index.js.map +1 -1
  37. package/dist/commonjs/metro/injection-code.js +5 -10
  38. package/dist/commonjs/metro/injection-code.js.map +1 -1
  39. package/dist/commonjs/metro/metro-transformer.js +18 -8
  40. package/dist/commonjs/metro/metro-transformer.js.map +1 -1
  41. package/dist/commonjs/metro/resolver.js +3 -0
  42. package/dist/commonjs/metro/resolver.js.map +1 -1
  43. package/dist/commonjs/poison.pill.js +10 -10
  44. package/dist/commonjs/runtime/native/api.js +8 -2
  45. package/dist/commonjs/runtime/native/api.js.map +1 -1
  46. package/dist/commonjs/runtime/native/conditions/index.js +4 -2
  47. package/dist/commonjs/runtime/native/conditions/index.js.map +1 -1
  48. package/dist/commonjs/runtime/native/conditions/media-query.js +14 -11
  49. package/dist/commonjs/runtime/native/conditions/media-query.js.map +1 -1
  50. package/dist/commonjs/runtime/native/react/rules.js +26 -20
  51. package/dist/commonjs/runtime/native/react/rules.js.map +1 -1
  52. package/dist/commonjs/runtime/native/reactivity.js +11 -0
  53. package/dist/commonjs/runtime/native/reactivity.js.map +1 -1
  54. package/dist/commonjs/runtime/native/styles/calculate-props.js +25 -8
  55. package/dist/commonjs/runtime/native/styles/calculate-props.js.map +1 -1
  56. package/dist/commonjs/runtime/native/styles/functions/calc.js +97 -57
  57. package/dist/commonjs/runtime/native/styles/functions/calc.js.map +1 -1
  58. package/dist/commonjs/runtime/native/styles/functions/index.js +22 -0
  59. package/dist/commonjs/runtime/native/styles/functions/index.js.map +1 -1
  60. package/dist/commonjs/runtime/native/styles/functions/numeric-functions.js +32 -0
  61. package/dist/commonjs/runtime/native/styles/functions/numeric-functions.js.map +1 -0
  62. package/dist/commonjs/runtime/native/styles/functions/string-functions.js +23 -0
  63. package/dist/commonjs/runtime/native/styles/functions/string-functions.js.map +1 -0
  64. package/dist/commonjs/runtime/native/styles/functions/transform-functions.js +91 -53
  65. package/dist/commonjs/runtime/native/styles/functions/transform-functions.js.map +1 -1
  66. package/dist/commonjs/runtime/native/styles/shorthands/animation.js +2 -2
  67. package/dist/commonjs/runtime/native/styles/shorthands/animation.js.map +1 -1
  68. package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js +14 -4
  69. package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js.map +1 -1
  70. package/dist/commonjs/runtime/native/styles/shorthands/transform.js +1 -1
  71. package/dist/commonjs/runtime/native/styles/shorthands/transform.js.map +1 -1
  72. package/dist/commonjs/runtime/native/styles/variables.js +3 -3
  73. package/dist/commonjs/runtime/native/styles/variables.js.map +1 -1
  74. package/dist/commonjs/runtime/utils/objects.js +6 -18
  75. package/dist/commonjs/runtime/utils/objects.js.map +1 -1
  76. package/dist/commonjs/runtime/web/api.js.map +1 -1
  77. package/dist/commonjs/style-collection/index.js +110 -0
  78. package/dist/commonjs/style-collection/index.js.map +1 -0
  79. package/dist/commonjs/{runtime/native → style-collection}/root.js +2 -2
  80. package/dist/commonjs/style-collection/root.js.map +1 -0
  81. package/dist/module/compiler/compiler.js +12 -5
  82. package/dist/module/compiler/compiler.js.map +1 -1
  83. package/dist/module/compiler/compiler.types.js +1 -1
  84. package/dist/module/compiler/compiler.types.js.map +1 -1
  85. package/dist/module/compiler/declarations.js +89 -82
  86. package/dist/module/compiler/declarations.js.map +1 -1
  87. package/dist/module/compiler/inheritance.test.js +10 -10
  88. package/dist/module/compiler/inheritance.test.js.map +1 -1
  89. package/dist/module/compiler/pseudo-elements.js +44 -0
  90. package/dist/module/compiler/pseudo-elements.js.map +1 -0
  91. package/dist/module/compiler/selector-builder.js +124 -80
  92. package/dist/module/compiler/selector-builder.js.map +1 -1
  93. package/dist/module/compiler/stylesheet.js +18 -6
  94. package/dist/module/compiler/stylesheet.js.map +1 -1
  95. package/dist/module/compiler/supports.js +23 -0
  96. package/dist/module/compiler/supports.js.map +1 -0
  97. package/dist/module/components/ActivityIndicator.js +17 -0
  98. package/dist/module/components/ActivityIndicator.js.map +1 -0
  99. package/dist/module/components/Button.js +17 -0
  100. package/dist/module/components/Button.js.map +1 -0
  101. package/dist/module/components/FlatList.js +14 -0
  102. package/dist/module/components/FlatList.js.map +1 -0
  103. package/dist/module/components/Image.js +12 -0
  104. package/dist/module/components/Image.js.map +1 -0
  105. package/dist/module/components/Switch.js +12 -0
  106. package/dist/module/components/Switch.js.map +1 -0
  107. package/dist/module/components/TextInput.js +12 -0
  108. package/dist/module/components/TextInput.js.map +1 -0
  109. package/dist/module/components/index.js +6 -0
  110. package/dist/module/components/index.js.map +1 -1
  111. package/dist/module/components/react-native-safe-area-context.js +4 -0
  112. package/dist/module/components/react-native-safe-area-context.js.map +1 -0
  113. package/dist/module/components/react-native-safe-area-context.native.js +36 -0
  114. package/dist/module/components/react-native-safe-area-context.native.js.map +1 -0
  115. package/dist/module/jest/index.js +2 -2
  116. package/dist/module/jest/index.js.map +1 -1
  117. package/dist/module/metro/index.js +6 -3
  118. package/dist/module/metro/index.js.map +1 -1
  119. package/dist/module/metro/injection-code.js +5 -10
  120. package/dist/module/metro/injection-code.js.map +1 -1
  121. package/dist/module/metro/metro-transformer.js +18 -8
  122. package/dist/module/metro/metro-transformer.js.map +1 -1
  123. package/dist/module/metro/resolver.js +3 -0
  124. package/dist/module/metro/resolver.js.map +1 -1
  125. package/dist/module/poison.pill.js +10 -10
  126. package/dist/module/runtime/native/api.js +2 -1
  127. package/dist/module/runtime/native/api.js.map +1 -1
  128. package/dist/module/runtime/native/conditions/index.js +4 -2
  129. package/dist/module/runtime/native/conditions/index.js.map +1 -1
  130. package/dist/module/runtime/native/conditions/media-query.js +15 -12
  131. package/dist/module/runtime/native/conditions/media-query.js.map +1 -1
  132. package/dist/module/runtime/native/react/rules.js +24 -19
  133. package/dist/module/runtime/native/react/rules.js.map +1 -1
  134. package/dist/module/runtime/native/reactivity.js +11 -0
  135. package/dist/module/runtime/native/reactivity.js.map +1 -1
  136. package/dist/module/runtime/native/styles/calculate-props.js +25 -8
  137. package/dist/module/runtime/native/styles/calculate-props.js.map +1 -1
  138. package/dist/module/runtime/native/styles/functions/calc.js +97 -56
  139. package/dist/module/runtime/native/styles/functions/calc.js.map +1 -1
  140. package/dist/module/runtime/native/styles/functions/index.js +2 -0
  141. package/dist/module/runtime/native/styles/functions/index.js.map +1 -1
  142. package/dist/module/runtime/native/styles/functions/numeric-functions.js +25 -0
  143. package/dist/module/runtime/native/styles/functions/numeric-functions.js.map +1 -0
  144. package/dist/module/runtime/native/styles/functions/string-functions.js +18 -0
  145. package/dist/module/runtime/native/styles/functions/string-functions.js.map +1 -0
  146. package/dist/module/runtime/native/styles/functions/transform-functions.js +91 -53
  147. package/dist/module/runtime/native/styles/functions/transform-functions.js.map +1 -1
  148. package/dist/module/runtime/native/styles/shorthands/animation.js +1 -1
  149. package/dist/module/runtime/native/styles/shorthands/animation.js.map +1 -1
  150. package/dist/module/runtime/native/styles/shorthands/box-shadow.js +14 -4
  151. package/dist/module/runtime/native/styles/shorthands/box-shadow.js.map +1 -1
  152. package/dist/module/runtime/native/styles/shorthands/transform.js +1 -1
  153. package/dist/module/runtime/native/styles/shorthands/transform.js.map +1 -1
  154. package/dist/module/runtime/native/styles/variables.js +1 -1
  155. package/dist/module/runtime/native/styles/variables.js.map +1 -1
  156. package/dist/module/runtime/utils/objects.js +6 -18
  157. package/dist/module/runtime/utils/objects.js.map +1 -1
  158. package/dist/module/runtime/web/api.js.map +1 -1
  159. package/dist/module/style-collection/index.js +95 -0
  160. package/dist/module/style-collection/index.js.map +1 -0
  161. package/dist/module/{runtime/native → style-collection}/root.js +2 -2
  162. package/dist/module/style-collection/root.js.map +1 -0
  163. package/dist/typescript/commonjs/src/compiler/compiler.d.ts +1 -1
  164. package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
  165. package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +11 -13
  166. package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
  167. package/dist/typescript/commonjs/src/compiler/declarations.d.ts +4 -2
  168. package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
  169. package/dist/typescript/commonjs/src/compiler/pseudo-elements.d.ts +4 -0
  170. package/dist/typescript/commonjs/src/compiler/pseudo-elements.d.ts.map +1 -0
  171. package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts +1 -0
  172. package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -1
  173. package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +2 -2
  174. package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
  175. package/dist/typescript/commonjs/src/compiler/supports.d.ts +3 -0
  176. package/dist/typescript/commonjs/src/compiler/supports.d.ts.map +1 -0
  177. package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts +13 -0
  178. package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts.map +1 -0
  179. package/dist/typescript/commonjs/src/components/Button.d.ts +13 -0
  180. package/dist/typescript/commonjs/src/components/Button.d.ts.map +1 -0
  181. package/dist/typescript/commonjs/src/components/FlatList.d.ts +10 -0
  182. package/dist/typescript/commonjs/src/components/FlatList.d.ts.map +1 -0
  183. package/dist/typescript/commonjs/src/components/Image.d.ts +8 -0
  184. package/dist/typescript/commonjs/src/components/Image.d.ts.map +1 -0
  185. package/dist/typescript/commonjs/src/components/Switch.d.ts +8 -0
  186. package/dist/typescript/commonjs/src/components/Switch.d.ts.map +1 -0
  187. package/dist/typescript/commonjs/src/components/TextInput.d.ts +8 -0
  188. package/dist/typescript/commonjs/src/components/TextInput.d.ts.map +1 -0
  189. package/dist/typescript/commonjs/src/components/index.d.ts +6 -0
  190. package/dist/typescript/commonjs/src/components/index.d.ts.map +1 -1
  191. package/dist/typescript/commonjs/src/components/react-native-safe-area-context.d.ts +2 -0
  192. package/dist/typescript/commonjs/src/components/react-native-safe-area-context.d.ts.map +1 -0
  193. package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts +4 -0
  194. package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts.map +1 -0
  195. package/dist/typescript/commonjs/src/jest/index.d.ts +3 -3
  196. package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
  197. package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
  198. package/dist/typescript/commonjs/src/metro/injection-code.d.ts +4 -7
  199. package/dist/typescript/commonjs/src/metro/injection-code.d.ts.map +1 -1
  200. package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts +4 -1
  201. package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts.map +1 -1
  202. package/dist/typescript/commonjs/src/metro/resolver.d.ts.map +1 -1
  203. package/dist/typescript/commonjs/src/runtime/native/api.d.ts +3 -1
  204. package/dist/typescript/commonjs/src/runtime/native/api.d.ts.map +1 -1
  205. package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts +2 -2
  206. package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts.map +1 -1
  207. package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts.map +1 -1
  208. package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts +1 -1
  209. package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
  210. package/dist/typescript/commonjs/src/runtime/native/styles/functions/calc.d.ts.map +1 -1
  211. package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts +2 -0
  212. package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts.map +1 -1
  213. package/dist/typescript/commonjs/src/runtime/native/styles/functions/numeric-functions.d.ts +5 -0
  214. package/dist/typescript/commonjs/src/runtime/native/styles/functions/numeric-functions.d.ts.map +1 -0
  215. package/dist/typescript/commonjs/src/runtime/native/styles/functions/string-functions.d.ts +3 -0
  216. package/dist/typescript/commonjs/src/runtime/native/styles/functions/string-functions.d.ts.map +1 -0
  217. package/dist/typescript/commonjs/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -1
  218. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -1
  219. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -1
  220. package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -1
  221. package/dist/typescript/commonjs/src/runtime/native/styles/variables.d.ts.map +1 -1
  222. package/dist/typescript/commonjs/src/runtime/utils/objects.d.ts.map +1 -1
  223. package/dist/typescript/commonjs/src/runtime/web/api.d.ts +1 -1
  224. package/dist/typescript/commonjs/src/runtime/web/api.d.ts.map +1 -1
  225. package/dist/typescript/commonjs/src/style-collection/index.d.ts +14 -0
  226. package/dist/typescript/commonjs/src/style-collection/index.d.ts.map +1 -0
  227. package/dist/typescript/commonjs/src/{runtime/native → style-collection}/root.d.ts +1 -1
  228. package/dist/typescript/commonjs/src/style-collection/root.d.ts.map +1 -0
  229. package/dist/typescript/module/src/compiler/compiler.d.ts +1 -1
  230. package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
  231. package/dist/typescript/module/src/compiler/compiler.types.d.ts +11 -13
  232. package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
  233. package/dist/typescript/module/src/compiler/declarations.d.ts +4 -2
  234. package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
  235. package/dist/typescript/module/src/compiler/pseudo-elements.d.ts +4 -0
  236. package/dist/typescript/module/src/compiler/pseudo-elements.d.ts.map +1 -0
  237. package/dist/typescript/module/src/compiler/selector-builder.d.ts +1 -0
  238. package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -1
  239. package/dist/typescript/module/src/compiler/stylesheet.d.ts +2 -2
  240. package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
  241. package/dist/typescript/module/src/compiler/supports.d.ts +3 -0
  242. package/dist/typescript/module/src/compiler/supports.d.ts.map +1 -0
  243. package/dist/typescript/module/src/components/ActivityIndicator.d.ts +13 -0
  244. package/dist/typescript/module/src/components/ActivityIndicator.d.ts.map +1 -0
  245. package/dist/typescript/module/src/components/Button.d.ts +13 -0
  246. package/dist/typescript/module/src/components/Button.d.ts.map +1 -0
  247. package/dist/typescript/module/src/components/FlatList.d.ts +10 -0
  248. package/dist/typescript/module/src/components/FlatList.d.ts.map +1 -0
  249. package/dist/typescript/module/src/components/Image.d.ts +8 -0
  250. package/dist/typescript/module/src/components/Image.d.ts.map +1 -0
  251. package/dist/typescript/module/src/components/Switch.d.ts +8 -0
  252. package/dist/typescript/module/src/components/Switch.d.ts.map +1 -0
  253. package/dist/typescript/module/src/components/TextInput.d.ts +8 -0
  254. package/dist/typescript/module/src/components/TextInput.d.ts.map +1 -0
  255. package/dist/typescript/module/src/components/index.d.ts +6 -0
  256. package/dist/typescript/module/src/components/index.d.ts.map +1 -1
  257. package/dist/typescript/module/src/components/react-native-safe-area-context.d.ts +2 -0
  258. package/dist/typescript/module/src/components/react-native-safe-area-context.d.ts.map +1 -0
  259. package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts +4 -0
  260. package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts.map +1 -0
  261. package/dist/typescript/module/src/jest/index.d.ts +3 -3
  262. package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
  263. package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
  264. package/dist/typescript/module/src/metro/injection-code.d.ts +4 -7
  265. package/dist/typescript/module/src/metro/injection-code.d.ts.map +1 -1
  266. package/dist/typescript/module/src/metro/metro-transformer.d.ts +4 -1
  267. package/dist/typescript/module/src/metro/metro-transformer.d.ts.map +1 -1
  268. package/dist/typescript/module/src/metro/resolver.d.ts.map +1 -1
  269. package/dist/typescript/module/src/runtime/native/api.d.ts +3 -1
  270. package/dist/typescript/module/src/runtime/native/api.d.ts.map +1 -1
  271. package/dist/typescript/module/src/runtime/native/react/rules.d.ts +2 -2
  272. package/dist/typescript/module/src/runtime/native/react/rules.d.ts.map +1 -1
  273. package/dist/typescript/module/src/runtime/native/reactivity.d.ts.map +1 -1
  274. package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts +1 -1
  275. package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
  276. package/dist/typescript/module/src/runtime/native/styles/functions/calc.d.ts.map +1 -1
  277. package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts +2 -0
  278. package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts.map +1 -1
  279. package/dist/typescript/module/src/runtime/native/styles/functions/numeric-functions.d.ts +5 -0
  280. package/dist/typescript/module/src/runtime/native/styles/functions/numeric-functions.d.ts.map +1 -0
  281. package/dist/typescript/module/src/runtime/native/styles/functions/string-functions.d.ts +3 -0
  282. package/dist/typescript/module/src/runtime/native/styles/functions/string-functions.d.ts.map +1 -0
  283. package/dist/typescript/module/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -1
  284. package/dist/typescript/module/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -1
  285. package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -1
  286. package/dist/typescript/module/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -1
  287. package/dist/typescript/module/src/runtime/native/styles/variables.d.ts.map +1 -1
  288. package/dist/typescript/module/src/runtime/utils/objects.d.ts.map +1 -1
  289. package/dist/typescript/module/src/runtime/web/api.d.ts +1 -1
  290. package/dist/typescript/module/src/runtime/web/api.d.ts.map +1 -1
  291. package/dist/typescript/module/src/style-collection/index.d.ts +14 -0
  292. package/dist/typescript/module/src/style-collection/index.d.ts.map +1 -0
  293. package/dist/typescript/module/src/{runtime/native → style-collection}/root.d.ts +1 -1
  294. package/dist/typescript/module/src/style-collection/root.d.ts.map +1 -0
  295. package/package.json +30 -14
  296. package/src/compiler/compiler.ts +11 -3
  297. package/src/compiler/compiler.types.ts +11 -14
  298. package/src/compiler/declarations.ts +157 -121
  299. package/src/compiler/inheritance.test.ts +9 -9
  300. package/src/compiler/pseudo-elements.ts +54 -0
  301. package/src/compiler/selector-builder.ts +136 -81
  302. package/src/compiler/stylesheet.ts +26 -11
  303. package/src/compiler/supports.ts +26 -0
  304. package/src/components/ActivityIndicator.tsx +27 -0
  305. package/src/components/Button.tsx +22 -0
  306. package/src/components/FlatList.tsx +21 -0
  307. package/src/components/Image.tsx +17 -0
  308. package/src/components/Switch.tsx +17 -0
  309. package/src/components/TextInput.tsx +17 -0
  310. package/src/components/index.tsx +6 -0
  311. package/src/components/react-native-safe-area-context.native.tsx +40 -0
  312. package/src/components/react-native-safe-area-context.tsx +1 -0
  313. package/src/jest/index.ts +3 -2
  314. package/src/metro/index.ts +8 -6
  315. package/src/metro/injection-code.ts +6 -10
  316. package/src/metro/metro-transformer.ts +27 -10
  317. package/src/metro/resolver.ts +8 -0
  318. package/src/poison.pill.ts +10 -10
  319. package/src/runtime/native/api.ts +3 -1
  320. package/src/runtime/native/conditions/index.ts +4 -2
  321. package/src/runtime/native/conditions/media-query.ts +16 -12
  322. package/src/runtime/native/react/rules.ts +27 -17
  323. package/src/runtime/native/reactivity.ts +12 -0
  324. package/src/runtime/native/styles/calculate-props.ts +27 -6
  325. package/src/runtime/native/styles/functions/calc.ts +94 -70
  326. package/src/runtime/native/styles/functions/index.ts +2 -0
  327. package/src/runtime/native/styles/functions/numeric-functions.ts +38 -0
  328. package/src/runtime/native/styles/functions/string-functions.ts +22 -0
  329. package/src/runtime/native/styles/functions/transform-functions.ts +68 -35
  330. package/src/runtime/native/styles/shorthands/animation.ts +2 -1
  331. package/src/runtime/native/styles/shorthands/box-shadow.ts +34 -14
  332. package/src/runtime/native/styles/shorthands/transform.ts +3 -1
  333. package/src/runtime/native/styles/variables.ts +5 -1
  334. package/src/runtime/utils/objects.ts +10 -19
  335. package/src/runtime/web/api.ts +1 -1
  336. package/src/style-collection/index.ts +142 -0
  337. package/src/{runtime/native → style-collection}/root.ts +6 -2
  338. package/dist/commonjs/compiler/attributes.test.js +0 -20
  339. package/dist/commonjs/compiler/attributes.test.js.map +0 -1
  340. package/dist/commonjs/doctor/index.js +0 -6
  341. package/dist/commonjs/doctor/index.js.map +0 -1
  342. package/dist/commonjs/runtime/native/injection.js +0 -99
  343. package/dist/commonjs/runtime/native/injection.js.map +0 -1
  344. package/dist/commonjs/runtime/native/root.js.map +0 -1
  345. package/dist/module/compiler/attributes.test.js +0 -20
  346. package/dist/module/compiler/attributes.test.js.map +0 -1
  347. package/dist/module/doctor/index.js +0 -4
  348. package/dist/module/doctor/index.js.map +0 -1
  349. package/dist/module/runtime/native/injection.js +0 -94
  350. package/dist/module/runtime/native/injection.js.map +0 -1
  351. package/dist/module/runtime/native/root.js.map +0 -1
  352. package/dist/typescript/commonjs/src/compiler/attributes.test.d.ts +0 -2
  353. package/dist/typescript/commonjs/src/compiler/attributes.test.d.ts.map +0 -1
  354. package/dist/typescript/commonjs/src/doctor/index.d.ts +0 -2
  355. package/dist/typescript/commonjs/src/doctor/index.d.ts.map +0 -1
  356. package/dist/typescript/commonjs/src/runtime/native/injection.d.ts +0 -16
  357. package/dist/typescript/commonjs/src/runtime/native/injection.d.ts.map +0 -1
  358. package/dist/typescript/commonjs/src/runtime/native/root.d.ts.map +0 -1
  359. package/dist/typescript/module/src/compiler/attributes.test.d.ts +0 -2
  360. package/dist/typescript/module/src/compiler/attributes.test.d.ts.map +0 -1
  361. package/dist/typescript/module/src/doctor/index.d.ts +0 -2
  362. package/dist/typescript/module/src/doctor/index.d.ts.map +0 -1
  363. package/dist/typescript/module/src/runtime/native/injection.d.ts +0 -16
  364. package/dist/typescript/module/src/runtime/native/injection.d.ts.map +0 -1
  365. package/dist/typescript/module/src/runtime/native/root.d.ts.map +0 -1
  366. package/src/compiler/attributes.test.ts +0 -28
  367. package/src/doctor/index.ts +0 -1
  368. package/src/runtime/native/injection.ts +0 -131
@@ -1,7 +1,11 @@
1
1
  import type { StyleDescriptor, VariableValue } from "react-native-css/compiler";
2
2
 
3
- import { testMediaQuery } from "./conditions/media-query";
4
- import { family, observable, type Observable } from "./reactivity";
3
+ import { testMediaQuery } from "../runtime/native/conditions/media-query";
4
+ import {
5
+ family,
6
+ observable,
7
+ type Observable,
8
+ } from "../runtime/native/reactivity";
5
9
 
6
10
  const rootVariableFamily = () => {
7
11
  return family<string, Observable<StyleDescriptor, VariableValue[]>>(() => {
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- var _index = require("../compiler/index.js");
4
- test("multiple classes", () => {
5
- const compiled = (0, _index.compile)(`
6
- .my-class.test {
7
- color: red;
8
- }`);
9
- expect(compiled.stylesheet()).toStrictEqual({
10
- s: [["test", [{
11
- aq: [["a", "className", "*=", "my-class"]],
12
- d: [{
13
- color: "#f00"
14
- }],
15
- s: [1, 2],
16
- v: [["__rn-css-color", "#f00"]]
17
- }]]]
18
- });
19
- });
20
- //# sourceMappingURL=attributes.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_index","require","test","compiled","compile","expect","stylesheet","toStrictEqual","s","aq","d","color","v"],"sourceRoot":"../../../src","sources":["compiler/attributes.test.ts"],"mappings":";;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEAC,IAAI,CAAC,kBAAkB,EAAE,MAAM;EAC7B,MAAMC,QAAQ,GAAG,IAAAC,cAAO,EAAC;AAC3B;AACA;AACA,EAAE,CAAC;EAEDC,MAAM,CAACF,QAAQ,CAACG,UAAU,CAAC,CAAC,CAAC,CAACC,aAAa,CAAC;IAC1CC,CAAC,EAAE,CACD,CACE,MAAM,EACN,CACE;MACEC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;MAC1CC,CAAC,EAAE,CACD;QACEC,KAAK,EAAE;MACT,CAAC,CACF;MACDH,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;MACTI,CAAC,EAAE,CAAC,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAChC,CAAC,CACF,CACF;EAEL,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,6 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["doctor/index.ts"],"mappings":"","ignoreList":[]}
@@ -1,99 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.StyleCollection = StyleCollection;
7
- exports.inlineStylesMap = void 0;
8
- var _reactivity = require("./reactivity.js");
9
- var _root = require("./root.js");
10
- function StyleCollection() {
11
- return null;
12
- }
13
- const inlineStylesMap = exports.inlineStylesMap = new WeakMap();
14
- StyleCollection.styles = (0, _reactivity.family)(() => {
15
- return (0, _reactivity.observable)([], isDeepEqual);
16
- });
17
- StyleCollection.keyframes = (0, _reactivity.family)(() => {
18
- return (0, _reactivity.observable)([], isDeepEqual);
19
- });
20
- StyleCollection.inject = function (options) {
21
- _reactivity.observableBatch.current = new Set();
22
- if (options.s) {
23
- for (const style of options.s) {
24
- StyleCollection.styles(style[0]).set(style[1]);
25
- }
26
- }
27
- if (options.k) {
28
- for (const keyframes of options.k) {
29
- StyleCollection.keyframes(keyframes[0]).set(keyframes[1]);
30
- }
31
- }
32
- if (options.vr) {
33
- for (const entry of options.vr) {
34
- (0, _root.rootVariables)(entry[0]).set(entry[1]);
35
- }
36
- }
37
- if (options.vu) {
38
- for (const entry of options.vu) {
39
- (0, _root.rootVariables)(entry[0]).set(entry[1]);
40
- }
41
- }
42
- for (const effect of _reactivity.observableBatch.current) {
43
- effect.run();
44
- }
45
- _reactivity.observableBatch.current = undefined;
46
- };
47
- function isDeepEqual(a, b) {
48
- const aArray = Array.isArray(a);
49
- const bArray = Array.isArray(b);
50
- const requiresKeyComparison = typeof a === "object" && typeof b === "object" && aArray === bArray;
51
-
52
- // Only compare keys when both are an object or array
53
- // This does not account for complex types like Date/Regex, because we don't use them
54
- if (!requiresKeyComparison) return a === b;
55
-
56
- // Make either are not null
57
- if (!a || !b) {
58
- return a === b;
59
- }
60
-
61
- // Shortcut for arrays
62
- if (aArray && bArray && a.length !== b.length) {
63
- return false;
64
- }
65
-
66
- // Compare a to b
67
- for (const key in a) {
68
- if (!isDeepEqual(a[key], b[key])) {
69
- return false;
70
- }
71
- }
72
-
73
- // Compare b to a
74
- for (const key in b) {
75
- if (!(key in a)) {
76
- return false;
77
- }
78
- }
79
- return true;
80
- }
81
- StyleCollection.styles("will-change-variable").set([{
82
- s: [0],
83
- v: []
84
- }]);
85
- StyleCollection.styles("will-change-container").set([{
86
- s: [0],
87
- c: []
88
- }]);
89
- StyleCollection.styles("will-change-animation").set([{
90
- s: [0],
91
- a: true
92
- }]);
93
- StyleCollection.styles("will-change-pressable").set([{
94
- s: [0],
95
- p: {
96
- h: 1
97
- }
98
- }]);
99
- //# sourceMappingURL=injection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactivity","require","_root","StyleCollection","inlineStylesMap","exports","WeakMap","styles","family","observable","isDeepEqual","keyframes","inject","options","observableBatch","current","Set","s","style","set","k","vr","entry","rootVariables","vu","effect","run","undefined","a","b","aArray","Array","isArray","bArray","requiresKeyComparison","length","key","v","c","p","h"],"sourceRoot":"../../../../src","sources":["runtime/native/injection.ts"],"mappings":";;;;;;;AAKA,IAAAA,WAAA,GAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AAEO,SAASE,eAAeA,CAAA,EAAG;EAChC,OAAO,IAAI;AACb;AAEO,MAAMC,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,IAAIE,OAAO,CAAC,CAAC;AAE5CH,eAAe,CAACI,MAAM,GAAG,IAAAC,kBAAM,EAAmC,MAAM;EACtE,OAAO,IAAAC,sBAAU,EAAC,EAAE,EAAEC,WAAW,CAAC;AACpC,CAAC,CAAC;AACFP,eAAe,CAACQ,SAAS,GAAG,IAAAH,kBAAM,EAA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,CAAC,CAClD;EACEF,CAAC,EAAE,CAAC,CAAC,CAAC;EACNW,CAAC,EAAE;AACL,CAAC,CACF,CAAC;AAEFzB,eAAe,CAACI,MAAM,CAAC,uBAAuB,CAAC,CAACY,GAAG,CAAC,CAClD;EACEF,CAAC,EAAE,CAAC,CAAC,CAAC;EACNsB,CAAC,EAAE;IACDC,CAAC,EAAE;EACL;AACF,CAAC,CACF,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["_mediaQuery","require","_reactivity","rootVariableFamily","family","obs","observable","read","variableValue","undefined","value","mediaQuery","testMediaQuery","rootVariables","exports","universalVariables"],"sourceRoot":"../../../../src","sources":["runtime/native/root.ts"],"mappings":";;;;;;AAEA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA,MAAME,kBAAkB,GAAGA,CAAA,KAAM;EAC/B,OAAO,IAAAC,kBAAM,EAAuD,MAAM;IACxE,MAAMC,GAAG,GAAG,IAAAC,sBAAU,EACpB,CAACC,IAAI,EAAEC,aAAa,KAAK;MACvB,IAAI,CAACA,aAAa,EAAE,OAAOC,SAAS;MAEpC,KAAK,MAAM,CAACC,KAAK,EAAEC,UAAU,CAAC,IAAIH,aAAa,EAAE;QAC/C,IAAI,CAACG,UAAU,EAAE;UACf,OAAOD,KAAK;QACd;QAEA,IAAI,IAAAE,0BAAc,EAACD,UAAU,EAAEJ,IAAI,CAAC,EAAE;UACpC,OAAOG,KAAK;QACd;MACF;MAEA,OAAOD,SAAS;IAClB,CACF,CAAC;IAED,OAAOJ,GAAG;EACZ,CAAC,CAAC;AACJ,CAAC;AAEM,MAAMQ,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAGV,kBAAkB,CAAC,CAAC;AAC1C,MAAMY,kBAAkB,GAAAD,OAAA,CAAAC,kBAAA,GAAGZ,kBAAkB,CAAC,CAAC","ignoreList":[]}
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- import { compile } from "../compiler/index.js";
4
- test("multiple classes", () => {
5
- const compiled = compile(`
6
- .my-class.test {
7
- color: red;
8
- }`);
9
- expect(compiled.stylesheet()).toStrictEqual({
10
- s: [["test", [{
11
- aq: [["a", "className", "*=", "my-class"]],
12
- d: [{
13
- color: "#f00"
14
- }],
15
- s: [1, 2],
16
- v: [["__rn-css-color", "#f00"]]
17
- }]]]
18
- });
19
- });
20
- //# sourceMappingURL=attributes.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["compile","test","compiled","expect","stylesheet","toStrictEqual","s","aq","d","color","v"],"sourceRoot":"../../../src","sources":["compiler/attributes.test.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,sBAAa;AAErCC,IAAI,CAAC,kBAAkB,EAAE,MAAM;EAC7B,MAAMC,QAAQ,GAAGF,OAAO,CAAC;AAC3B;AACA;AACA,EAAE,CAAC;EAEDG,MAAM,CAACD,QAAQ,CAACE,UAAU,CAAC,CAAC,CAAC,CAACC,aAAa,CAAC;IAC1CC,CAAC,EAAE,CACD,CACE,MAAM,EACN,CACE;MACEC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;MAC1CC,CAAC,EAAE,CACD;QACEC,KAAK,EAAE;MACT,CAAC,CACF;MACDH,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;MACTI,CAAC,EAAE,CAAC,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAChC,CAAC,CACF,CACF;EAEL,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- "use strict";
2
-
3
- export {};
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["doctor/index.ts"],"mappings":";;AAAA","ignoreList":[]}
@@ -1,94 +0,0 @@
1
- "use strict";
2
-
3
- import { family, observable, observableBatch } from "./reactivity.js";
4
- import { rootVariables } from "./root.js";
5
- export function StyleCollection() {
6
- return null;
7
- }
8
- export const inlineStylesMap = new WeakMap();
9
- StyleCollection.styles = family(() => {
10
- return observable([], isDeepEqual);
11
- });
12
- StyleCollection.keyframes = family(() => {
13
- return observable([], isDeepEqual);
14
- });
15
- StyleCollection.inject = function (options) {
16
- observableBatch.current = new Set();
17
- if (options.s) {
18
- for (const style of options.s) {
19
- StyleCollection.styles(style[0]).set(style[1]);
20
- }
21
- }
22
- if (options.k) {
23
- for (const keyframes of options.k) {
24
- StyleCollection.keyframes(keyframes[0]).set(keyframes[1]);
25
- }
26
- }
27
- if (options.vr) {
28
- for (const entry of options.vr) {
29
- rootVariables(entry[0]).set(entry[1]);
30
- }
31
- }
32
- if (options.vu) {
33
- for (const entry of options.vu) {
34
- rootVariables(entry[0]).set(entry[1]);
35
- }
36
- }
37
- for (const effect of observableBatch.current) {
38
- effect.run();
39
- }
40
- observableBatch.current = undefined;
41
- };
42
- function isDeepEqual(a, b) {
43
- const aArray = Array.isArray(a);
44
- const bArray = Array.isArray(b);
45
- const requiresKeyComparison = typeof a === "object" && typeof b === "object" && aArray === bArray;
46
-
47
- // Only compare keys when both are an object or array
48
- // This does not account for complex types like Date/Regex, because we don't use them
49
- if (!requiresKeyComparison) return a === b;
50
-
51
- // Make either are not null
52
- if (!a || !b) {
53
- return a === b;
54
- }
55
-
56
- // Shortcut for arrays
57
- if (aArray && bArray && a.length !== b.length) {
58
- return false;
59
- }
60
-
61
- // Compare a to b
62
- for (const key in a) {
63
- if (!isDeepEqual(a[key], b[key])) {
64
- return false;
65
- }
66
- }
67
-
68
- // Compare b to a
69
- for (const key in b) {
70
- if (!(key in a)) {
71
- return false;
72
- }
73
- }
74
- return true;
75
- }
76
- StyleCollection.styles("will-change-variable").set([{
77
- s: [0],
78
- v: []
79
- }]);
80
- StyleCollection.styles("will-change-container").set([{
81
- s: [0],
82
- c: []
83
- }]);
84
- StyleCollection.styles("will-change-animation").set([{
85
- s: [0],
86
- a: true
87
- }]);
88
- StyleCollection.styles("will-change-pressable").set([{
89
- s: [0],
90
- p: {
91
- h: 1
92
- }
93
- }]);
94
- //# sourceMappingURL=injection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["family","observable","observableBatch","rootVariables","StyleCollection","inlineStylesMap","WeakMap","styles","isDeepEqual","keyframes","inject","options","current","Set","s","style","set","k","vr","entry","vu","effect","run","undefined","a","b","aArray","Array","isArray","bArray","requiresKeyComparison","length","key","v","c","p","h"],"sourceRoot":"../../../../src","sources":["runtime/native/injection.ts"],"mappings":";;AAKA,SACEA,MAAM,EACNC,UAAU,EACVC,eAAe,QAEV,iBAAc;AACrB,SAASC,aAAa,QAAQ,WAAQ;AAEtC,OAAO,SAASC,eAAeA,CAAA,EAAG;EAChC,OAAO,IAAI;AACb;AAEA,OAAO,MAAMC,eAAe,GAAG,IAAIC,OAAO,CAAC,CAAC;AAE5CF,eAAe,CAACG,MAAM,GAAGP,MAAM,CAAmC,MAAM;EACtE,OAAOC,UAAU,CAAC,EAAE,EAAEO,WAAW,CAAC;AACpC,CAAC,CAAC;AACFJ,eAAe,CAACK,SAAS,GAAGT,MAAM,CAAsC,MAAM;EAC5E,OAAOC,UAAU,CAAC,EAAE,EAAEO,WAAW,CAAC;AACpC,CAAC,CAAC;AAEFJ,eAAe,CAACM,MAAM,GAAG,UAAUC,OAAiC,EAAE;EACpET,eAAe,CAACU,OAAO,GAAG,IAAIC,GAAG,CAAC,CAAC;EAEnC,IAAIF,OAAO,CAACG,CAAC,EAAE;IACb,KAAK,MAAMC,KAAK,IAAIJ,OAAO,CAACG,CAAC,EAAE;MAC7BV,eAAe,CAACG,MAAM,CAACQ,KAAK,CAAC,CAAC,CAAC,CAAC,CAACC,GAAG,CAACD,KAAK,CAAC,CAAC,CAAC,CAAC;IAChD;EACF;EAEA,IAAIJ,OAAO,CAACM,CAAC,EAAE;IACb,KAAK,MAAMR,SAAS,IAAIE,OAAO,CAACM,CAAC,EAAE;MACjCb,eAAe,CAACK,SAAS,CAACA,SAA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AK,MAAMC,GAAG,IAAIR,CAAC,EAAE;IACnB,IACE,CAAChB,WAAW,CACTgB,CAAC,CAA6BQ,GAAG,CAAC,EAClCP,CAAC,CAA6BO,GAAG,CACpC,CAAC,EACD;MACA,OAAO,KAAK;IACd;EACF;;EAEA;EACA,KAAK,MAAMA,GAAG,IAAIP,CAAC,EAAE;IACnB,IAAI,EAAEO,GAAG,IAAIR,CAAC,CAAC,EAAE;MACf,OAAO,KAAK;IACd;EACF;EAEA,OAAO,IAAI;AACb;AAEApB,eAAe,CAACG,MAAM,CAAC,sBAAsB,CAAC,CAACS,GAAG,CAAC,CACjD;EACEF,CAAC,EAAE,CAAC,CAAC,CAAC;EACNmB,CAAC,EAAE;AACL,CAAC,CACF,CAAC;AAEF7B,eAAe,CAACG,MAAM,CAAC,uBAAuB,CAAC,CAACS,GAAG,CAAC,CAClD;EACEF,CAAC,EAAE,CAAC,CAAC,CAAC;EACNoB,CAAC,EAAE;AACL,CAAC,CACF,CAAC;AAEF9B,eAAe,CAACG,MAAM,CAAC,uBAAuB,CAAC,CAACS,GAAG,CAAC,CAClD;EACEF,CAAC,EAAE,CAAC,CAAC,CAAC;EACNU,CAAC,EAAE;AACL,CAAC,CACF,CAAC;AAEFpB,eAAe,CAACG,MAAM,CAAC,uBAAuB,CAAC,CAACS,GAAG,CAAC,CAClD;EACEF,CAAC,EAAE,CAAC,CAAC,CAAC;EACNqB,CAAC,EAAE;IACDC,CAAC,EAAE;EACL;AACF,CAAC,CACF,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["testMediaQuery","family","observable","rootVariableFamily","obs","read","variableValue","undefined","value","mediaQuery","rootVariables","universalVariables"],"sourceRoot":"../../../../src","sources":["runtime/native/root.ts"],"mappings":";;AAEA,SAASA,cAAc,QAAQ,6BAA0B;AACzD,SAASC,MAAM,EAAEC,UAAU,QAAyB,iBAAc;AAElE,MAAMC,kBAAkB,GAAGA,CAAA,KAAM;EAC/B,OAAOF,MAAM,CAAuD,MAAM;IACxE,MAAMG,GAAG,GAAGF,UAAU,CACpB,CAACG,IAAI,EAAEC,aAAa,KAAK;MACvB,IAAI,CAACA,aAAa,EAAE,OAAOC,SAAS;MAEpC,KAAK,MAAM,CAACC,KAAK,EAAEC,UAAU,CAAC,IAAIH,aAAa,EAAE;QAC/C,IAAI,CAACG,UAAU,EAAE;UACf,OAAOD,KAAK;QACd;QAEA,IAAIR,cAAc,CAACS,UAAU,EAAEJ,IAAI,CAAC,EAAE;UACpC,OAAOG,KAAK;QACd;MACF;MAEA,OAAOD,SAAS;IAClB,CACF,CAAC;IAED,OAAOH,GAAG;EACZ,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,MAAMM,aAAa,GAAGP,kBAAkB,CAAC,CAAC;AACjD,OAAO,MAAMQ,kBAAkB,GAAGR,kBAAkB,CAAC,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=attributes.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attributes.test.d.ts","sourceRoot":"","sources":["../../../../../src/compiler/attributes.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/doctor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC"}
@@ -1,16 +0,0 @@
1
- import type { ReactNativeCssStyleSheet, StyleRuleSet } from "../../compiler";
2
- import { type Observable } from "./reactivity";
3
- export declare function StyleCollection(): null;
4
- export declare namespace StyleCollection {
5
- var styles: ((key: string, args: void) => Observable<StyleRuleSet>) & {
6
- delete(key: string): boolean;
7
- clear(): void;
8
- };
9
- var keyframes: ((key: string, args: void) => Observable<import("../../compiler").AnimationKeyframes_V2[]>) & {
10
- delete(key: string): boolean;
11
- clear(): void;
12
- };
13
- var inject: (options: ReactNativeCssStyleSheet) => void;
14
- }
15
- export declare const inlineStylesMap: WeakMap<WeakKey, any>;
16
- //# sourceMappingURL=injection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injection.d.ts","sourceRoot":"","sources":["../../../../../../src/runtime/native/injection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,wBAAwB,EACxB,YAAY,EACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AAGtB,wBAAgB,eAAe,SAE9B;yBAFe,eAAe;;;;;;;;;0BAaa,wBAAwB;;AATpE,eAAO,MAAM,eAAe,uBAAgB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../../../../../src/runtime/native/root.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAGhF,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AA0BnE,eAAO,MAAM,aAAa;;;CAAuB,CAAC;AAClD,eAAO,MAAM,kBAAkB;;;CAAuB,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=attributes.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attributes.test.d.ts","sourceRoot":"","sources":["../../../../../src/compiler/attributes.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/doctor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC"}
@@ -1,16 +0,0 @@
1
- import type { ReactNativeCssStyleSheet, StyleRuleSet } from "../../compiler";
2
- import { type Observable } from "./reactivity";
3
- export declare function StyleCollection(): null;
4
- export declare namespace StyleCollection {
5
- var styles: ((key: string, args: void) => Observable<StyleRuleSet>) & {
6
- delete(key: string): boolean;
7
- clear(): void;
8
- };
9
- var keyframes: ((key: string, args: void) => Observable<import("../../compiler").AnimationKeyframes_V2[]>) & {
10
- delete(key: string): boolean;
11
- clear(): void;
12
- };
13
- var inject: (options: ReactNativeCssStyleSheet) => void;
14
- }
15
- export declare const inlineStylesMap: WeakMap<WeakKey, any>;
16
- //# sourceMappingURL=injection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injection.d.ts","sourceRoot":"","sources":["../../../../../../src/runtime/native/injection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,wBAAwB,EACxB,YAAY,EACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AAGtB,wBAAgB,eAAe,SAE9B;yBAFe,eAAe;;;;;;;;;0BAaa,wBAAwB;;AATpE,eAAO,MAAM,eAAe,uBAAgB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../../../../../src/runtime/native/root.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAGhF,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AA0BnE,eAAO,MAAM,aAAa;;;CAAuB,CAAC;AAClD,eAAO,MAAM,kBAAkB;;;CAAuB,CAAC"}
@@ -1,28 +0,0 @@
1
- import { compile } from "../compiler";
2
-
3
- test("multiple classes", () => {
4
- const compiled = compile(`
5
- .my-class.test {
6
- color: red;
7
- }`);
8
-
9
- expect(compiled.stylesheet()).toStrictEqual({
10
- s: [
11
- [
12
- "test",
13
- [
14
- {
15
- aq: [["a", "className", "*=", "my-class"]],
16
- d: [
17
- {
18
- color: "#f00",
19
- },
20
- ],
21
- s: [1, 2],
22
- v: [["__rn-css-color", "#f00"]],
23
- },
24
- ],
25
- ],
26
- ],
27
- });
28
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,131 +0,0 @@
1
- import type {
2
- Animation_V2,
3
- ReactNativeCssStyleSheet,
4
- StyleRuleSet,
5
- } from "../../compiler";
6
- import {
7
- family,
8
- observable,
9
- observableBatch,
10
- type Observable,
11
- } from "./reactivity";
12
- import { rootVariables } from "./root";
13
-
14
- export function StyleCollection() {
15
- return null;
16
- }
17
-
18
- export const inlineStylesMap = new WeakMap();
19
-
20
- StyleCollection.styles = family<string, Observable<StyleRuleSet>>(() => {
21
- return observable([], isDeepEqual);
22
- });
23
- StyleCollection.keyframes = family<string, Observable<Animation_V2[1]>>(() => {
24
- return observable([], isDeepEqual);
25
- });
26
-
27
- StyleCollection.inject = function (options: ReactNativeCssStyleSheet) {
28
- observableBatch.current = new Set();
29
-
30
- if (options.s) {
31
- for (const style of options.s) {
32
- StyleCollection.styles(style[0]).set(style[1]);
33
- }
34
- }
35
-
36
- if (options.k) {
37
- for (const keyframes of options.k) {
38
- StyleCollection.keyframes(keyframes[0]).set(keyframes[1]);
39
- }
40
- }
41
-
42
- if (options.vr) {
43
- for (const entry of options.vr) {
44
- rootVariables(entry[0]).set(entry[1]);
45
- }
46
- }
47
-
48
- if (options.vu) {
49
- for (const entry of options.vu) {
50
- rootVariables(entry[0]).set(entry[1]);
51
- }
52
- }
53
-
54
- for (const effect of observableBatch.current) {
55
- effect.run();
56
- }
57
-
58
- observableBatch.current = undefined;
59
- };
60
-
61
- function isDeepEqual(a: unknown, b: unknown): boolean {
62
- const aArray = Array.isArray(a);
63
- const bArray = Array.isArray(b);
64
- const requiresKeyComparison =
65
- typeof a === "object" && typeof b === "object" && aArray === bArray;
66
-
67
- // Only compare keys when both are an object or array
68
- // This does not account for complex types like Date/Regex, because we don't use them
69
- if (!requiresKeyComparison) return a === b;
70
-
71
- // Make either are not null
72
- if (!a || !b) {
73
- return a === b;
74
- }
75
-
76
- // Shortcut for arrays
77
- if (aArray && bArray && a.length !== b.length) {
78
- return false;
79
- }
80
-
81
- // Compare a to b
82
- for (const key in a) {
83
- if (
84
- !isDeepEqual(
85
- (a as Record<string, unknown>)[key],
86
- (b as Record<string, unknown>)[key],
87
- )
88
- ) {
89
- return false;
90
- }
91
- }
92
-
93
- // Compare b to a
94
- for (const key in b) {
95
- if (!(key in a)) {
96
- return false;
97
- }
98
- }
99
-
100
- return true;
101
- }
102
-
103
- StyleCollection.styles("will-change-variable").set([
104
- {
105
- s: [0],
106
- v: [],
107
- },
108
- ]);
109
-
110
- StyleCollection.styles("will-change-container").set([
111
- {
112
- s: [0],
113
- c: [],
114
- },
115
- ]);
116
-
117
- StyleCollection.styles("will-change-animation").set([
118
- {
119
- s: [0],
120
- a: true,
121
- },
122
- ]);
123
-
124
- StyleCollection.styles("will-change-pressable").set([
125
- {
126
- s: [0],
127
- p: {
128
- h: 1,
129
- },
130
- },
131
- ]);