react-native-unistyles 3.0.0-beta.1 → 3.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (367) hide show
  1. package/README.md +4 -4
  2. package/Unistyles.podspec +7 -1
  3. package/android/build.gradle +6 -0
  4. package/android/src/main/cxx/NativeUnistylesModule.cpp +2 -2
  5. package/cxx/common/Constants.h +2 -0
  6. package/cxx/core/HostStyle.cpp +12 -7
  7. package/cxx/core/HostStyle.h +5 -0
  8. package/cxx/core/UnistyleData.h +3 -3
  9. package/cxx/core/UnistyleWrapper.h +8 -8
  10. package/cxx/core/UnistylesRegistry.cpp +23 -30
  11. package/cxx/core/UnistylesRegistry.h +8 -2
  12. package/cxx/hybridObjects/HybridShadowRegistry.cpp +108 -12
  13. package/cxx/hybridObjects/HybridShadowRegistry.h +21 -2
  14. package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +4 -0
  15. package/cxx/parser/Parser.cpp +182 -26
  16. package/cxx/parser/Parser.h +3 -1
  17. package/ios/UnistylesModuleOnLoad.mm +2 -2
  18. package/lib/commonjs/components/ScopedTheme.js +36 -0
  19. package/lib/commonjs/components/ScopedTheme.js.map +1 -0
  20. package/lib/commonjs/components/Variants.js +33 -0
  21. package/lib/commonjs/components/Variants.js.map +1 -0
  22. package/lib/commonjs/components/index.js +10 -3
  23. package/lib/commonjs/components/index.js.map +1 -1
  24. package/lib/commonjs/components/native/ActivityIndicator.js +10 -0
  25. package/lib/commonjs/components/native/ActivityIndicator.js.map +1 -0
  26. package/lib/commonjs/components/native/FlatList.js +10 -0
  27. package/lib/commonjs/components/native/FlatList.js.map +1 -0
  28. package/lib/commonjs/components/native/Image.js +10 -0
  29. package/lib/commonjs/components/native/Image.js.map +1 -0
  30. package/lib/commonjs/components/native/ImageBackground.js +10 -0
  31. package/lib/commonjs/components/native/ImageBackground.js.map +1 -0
  32. package/lib/commonjs/components/native/KeyboardAvoidingView.js +10 -0
  33. package/lib/commonjs/components/native/KeyboardAvoidingView.js.map +1 -0
  34. package/lib/commonjs/components/{Pressable.web.js → native/Pressable.js} +26 -66
  35. package/lib/commonjs/components/native/Pressable.js.map +1 -0
  36. package/lib/commonjs/components/native/Pressable.native.js +48 -0
  37. package/lib/commonjs/components/native/Pressable.native.js.map +1 -0
  38. package/lib/commonjs/components/native/RefreshControl.js +10 -0
  39. package/lib/commonjs/components/native/RefreshControl.js.map +1 -0
  40. package/lib/commonjs/components/native/ScrollView.js +10 -0
  41. package/lib/commonjs/components/native/ScrollView.js.map +1 -0
  42. package/lib/commonjs/components/native/SectionList.js +10 -0
  43. package/lib/commonjs/components/native/SectionList.js.map +1 -0
  44. package/lib/commonjs/components/native/Switch.js +10 -0
  45. package/lib/commonjs/components/native/Switch.js.map +1 -0
  46. package/lib/commonjs/components/native/Text.js +10 -0
  47. package/lib/commonjs/components/native/Text.js.map +1 -0
  48. package/lib/commonjs/components/native/TextInput.js +10 -0
  49. package/lib/commonjs/components/native/TextInput.js.map +1 -0
  50. package/lib/commonjs/components/native/TouchableHighlight.js +10 -0
  51. package/lib/commonjs/components/native/TouchableHighlight.js.map +1 -0
  52. package/lib/commonjs/components/native/TouchableOpacity.js +10 -0
  53. package/lib/commonjs/components/native/TouchableOpacity.js.map +1 -0
  54. package/lib/commonjs/components/native/View.js +10 -0
  55. package/lib/commonjs/components/native/View.js.map +1 -0
  56. package/lib/commonjs/components/native/VirtualizedList.js +10 -0
  57. package/lib/commonjs/components/native/VirtualizedList.js.map +1 -0
  58. package/lib/commonjs/core/createUnistylesComponent.js +5 -68
  59. package/lib/commonjs/core/createUnistylesComponent.js.map +1 -1
  60. package/lib/commonjs/core/createUnistylesElement.js +16 -0
  61. package/lib/commonjs/core/createUnistylesElement.js.map +1 -0
  62. package/lib/commonjs/core/createUnistylesImageBackground.js +27 -0
  63. package/lib/commonjs/core/createUnistylesImageBackground.js.map +1 -0
  64. package/lib/commonjs/core/index.js +20 -6
  65. package/lib/commonjs/core/index.js.map +1 -1
  66. package/lib/commonjs/core/passForwardRef.js +27 -0
  67. package/lib/commonjs/core/passForwardRef.js.map +1 -0
  68. package/lib/commonjs/core/withUnistyles/index.js +13 -0
  69. package/lib/commonjs/core/withUnistyles/index.js.map +1 -0
  70. package/lib/commonjs/core/withUnistyles/types.js +8 -0
  71. package/lib/commonjs/core/withUnistyles/types.js.map +1 -0
  72. package/lib/commonjs/core/withUnistyles/useDependencies.js +81 -0
  73. package/lib/commonjs/core/withUnistyles/useDependencies.js.map +1 -0
  74. package/lib/commonjs/core/withUnistyles/withUnistyles.js +88 -0
  75. package/lib/commonjs/core/withUnistyles/withUnistyles.js.map +1 -0
  76. package/lib/commonjs/core/withUnistyles/withUnistyles.native.js +96 -0
  77. package/lib/commonjs/core/withUnistyles/withUnistyles.native.js.map +1 -0
  78. package/lib/commonjs/hooks/useMedia.js +17 -33
  79. package/lib/commonjs/hooks/useMedia.js.map +1 -1
  80. package/lib/commonjs/hooks/useMedia.native.js +60 -0
  81. package/lib/commonjs/hooks/useMedia.native.js.map +1 -0
  82. package/lib/commonjs/index.js +33 -16
  83. package/lib/commonjs/index.js.map +1 -1
  84. package/lib/commonjs/specs/ShadowRegistry/index.js +3 -3
  85. package/lib/commonjs/specs/ShadowRegistry/index.js.map +1 -1
  86. package/lib/commonjs/specs/index.js +14 -40
  87. package/lib/commonjs/specs/index.js.map +1 -1
  88. package/lib/commonjs/specs/index.native.js +54 -0
  89. package/lib/commonjs/specs/index.native.js.map +1 -0
  90. package/lib/commonjs/web/create.js +12 -33
  91. package/lib/commonjs/web/create.js.map +1 -1
  92. package/lib/commonjs/web/index.js.map +1 -1
  93. package/lib/commonjs/web/registry.js +10 -3
  94. package/lib/commonjs/web/registry.js.map +1 -1
  95. package/lib/commonjs/web/runtime.js +3 -1
  96. package/lib/commonjs/web/runtime.js.map +1 -1
  97. package/lib/commonjs/web/shadowRegistry.js +71 -64
  98. package/lib/commonjs/web/shadowRegistry.js.map +1 -1
  99. package/lib/commonjs/web/utils/unistyle.js +3 -3
  100. package/lib/commonjs/web/utils/unistyle.js.map +1 -1
  101. package/lib/module/components/ScopedTheme.js +29 -0
  102. package/lib/module/components/ScopedTheme.js.map +1 -0
  103. package/lib/module/components/Variants.js +26 -0
  104. package/lib/module/components/Variants.js.map +1 -0
  105. package/lib/module/components/index.js +2 -1
  106. package/lib/module/components/index.js.map +1 -1
  107. package/lib/module/components/native/ActivityIndicator.js +6 -0
  108. package/lib/module/components/native/ActivityIndicator.js.map +1 -0
  109. package/lib/module/components/native/FlatList.js +6 -0
  110. package/lib/module/components/native/FlatList.js.map +1 -0
  111. package/lib/module/components/native/Image.js +6 -0
  112. package/lib/module/components/native/Image.js.map +1 -0
  113. package/lib/module/components/native/ImageBackground.js +6 -0
  114. package/lib/module/components/native/ImageBackground.js.map +1 -0
  115. package/lib/module/components/native/KeyboardAvoidingView.js +6 -0
  116. package/lib/module/components/native/KeyboardAvoidingView.js.map +1 -0
  117. package/lib/module/components/native/Pressable.js +69 -0
  118. package/lib/module/components/native/Pressable.js.map +1 -0
  119. package/lib/module/components/native/Pressable.native.js +42 -0
  120. package/lib/module/components/native/Pressable.native.js.map +1 -0
  121. package/lib/module/components/native/RefreshControl.js +6 -0
  122. package/lib/module/components/native/RefreshControl.js.map +1 -0
  123. package/lib/module/components/native/ScrollView.js +6 -0
  124. package/lib/module/components/native/ScrollView.js.map +1 -0
  125. package/lib/module/components/native/SectionList.js +6 -0
  126. package/lib/module/components/native/SectionList.js.map +1 -0
  127. package/lib/module/components/native/Switch.js +6 -0
  128. package/lib/module/components/native/Switch.js.map +1 -0
  129. package/lib/module/components/native/Text.js +6 -0
  130. package/lib/module/components/native/Text.js.map +1 -0
  131. package/lib/module/components/native/TextInput.js +6 -0
  132. package/lib/module/components/native/TextInput.js.map +1 -0
  133. package/lib/module/components/native/TouchableHighlight.js +6 -0
  134. package/lib/module/components/native/TouchableHighlight.js.map +1 -0
  135. package/lib/module/components/native/TouchableOpacity.js +6 -0
  136. package/lib/module/components/native/TouchableOpacity.js.map +1 -0
  137. package/lib/module/components/native/View.js +6 -0
  138. package/lib/module/components/native/View.js.map +1 -0
  139. package/lib/module/components/native/VirtualizedList.js +6 -0
  140. package/lib/module/components/native/VirtualizedList.js.map +1 -0
  141. package/lib/module/core/createUnistylesComponent.js +5 -66
  142. package/lib/module/core/createUnistylesComponent.js.map +1 -1
  143. package/lib/module/core/createUnistylesElement.js +10 -0
  144. package/lib/module/core/createUnistylesElement.js.map +1 -0
  145. package/lib/module/core/createUnistylesImageBackground.js +21 -0
  146. package/lib/module/core/createUnistylesImageBackground.js.map +1 -0
  147. package/lib/module/core/index.js +4 -2
  148. package/lib/module/core/index.js.map +1 -1
  149. package/lib/module/core/passForwardRef.js +22 -0
  150. package/lib/module/core/passForwardRef.js.map +1 -0
  151. package/lib/module/core/withUnistyles/index.js +4 -0
  152. package/lib/module/core/withUnistyles/index.js.map +1 -0
  153. package/lib/module/core/withUnistyles/types.js +4 -0
  154. package/lib/module/core/withUnistyles/types.js.map +1 -0
  155. package/lib/module/core/withUnistyles/useDependencies.js +75 -0
  156. package/lib/module/core/withUnistyles/useDependencies.js.map +1 -0
  157. package/lib/module/core/withUnistyles/withUnistyles.js +81 -0
  158. package/lib/module/core/withUnistyles/withUnistyles.js.map +1 -0
  159. package/lib/module/core/withUnistyles/withUnistyles.native.js +89 -0
  160. package/lib/module/core/withUnistyles/withUnistyles.native.js.map +1 -0
  161. package/lib/module/hooks/useMedia.js +19 -35
  162. package/lib/module/hooks/useMedia.js.map +1 -1
  163. package/lib/module/hooks/useMedia.native.js +55 -0
  164. package/lib/module/hooks/useMedia.native.js.map +1 -0
  165. package/lib/module/index.js +2 -2
  166. package/lib/module/index.js.map +1 -1
  167. package/lib/module/specs/ShadowRegistry/index.js +3 -3
  168. package/lib/module/specs/ShadowRegistry/index.js.map +1 -1
  169. package/lib/module/specs/index.js +2 -8
  170. package/lib/module/specs/index.js.map +1 -1
  171. package/lib/module/specs/index.native.js +11 -0
  172. package/lib/module/specs/index.native.js.map +1 -0
  173. package/lib/module/web/create.js +13 -34
  174. package/lib/module/web/create.js.map +1 -1
  175. package/lib/module/web/index.js +1 -1
  176. package/lib/module/web/index.js.map +1 -1
  177. package/lib/module/web/registry.js +11 -4
  178. package/lib/module/web/registry.js.map +1 -1
  179. package/lib/module/web/runtime.js +3 -1
  180. package/lib/module/web/runtime.js.map +1 -1
  181. package/lib/module/web/shadowRegistry.js +70 -63
  182. package/lib/module/web/shadowRegistry.js.map +1 -1
  183. package/lib/module/web/utils/unistyle.js +1 -1
  184. package/lib/module/web/utils/unistyle.js.map +1 -1
  185. package/lib/typescript/src/components/ScopedTheme.d.ts +8 -0
  186. package/lib/typescript/src/components/ScopedTheme.d.ts.map +1 -0
  187. package/lib/typescript/src/components/Variants.d.ts +7 -0
  188. package/lib/typescript/src/components/Variants.d.ts.map +1 -0
  189. package/lib/typescript/src/components/index.d.ts +2 -1
  190. package/lib/typescript/src/components/index.d.ts.map +1 -1
  191. package/lib/typescript/src/components/native/ActivityIndicator.d.ts +2 -0
  192. package/lib/typescript/src/components/native/ActivityIndicator.d.ts.map +1 -0
  193. package/lib/typescript/src/components/native/FlatList.d.ts +2 -0
  194. package/lib/typescript/src/components/native/FlatList.d.ts.map +1 -0
  195. package/lib/typescript/src/components/native/Image.d.ts +2 -0
  196. package/lib/typescript/src/components/native/Image.d.ts.map +1 -0
  197. package/lib/typescript/src/components/native/ImageBackground.d.ts +3 -0
  198. package/lib/typescript/src/components/native/ImageBackground.d.ts.map +1 -0
  199. package/lib/typescript/src/components/native/KeyboardAvoidingView.d.ts +2 -0
  200. package/lib/typescript/src/components/native/KeyboardAvoidingView.d.ts.map +1 -0
  201. package/lib/typescript/src/components/{Pressable.web.d.ts → native/Pressable.d.ts} +3 -2
  202. package/lib/typescript/src/components/native/Pressable.d.ts.map +1 -0
  203. package/lib/typescript/src/components/{Pressable.d.ts → native/Pressable.native.d.ts} +1 -3
  204. package/lib/typescript/src/components/native/Pressable.native.d.ts.map +1 -0
  205. package/lib/typescript/src/components/native/RefreshControl.d.ts +2 -0
  206. package/lib/typescript/src/components/native/RefreshControl.d.ts.map +1 -0
  207. package/lib/typescript/src/components/native/ScrollView.d.ts +2 -0
  208. package/lib/typescript/src/components/native/ScrollView.d.ts.map +1 -0
  209. package/lib/typescript/src/components/native/SectionList.d.ts +2 -0
  210. package/lib/typescript/src/components/native/SectionList.d.ts.map +1 -0
  211. package/lib/typescript/src/components/native/Switch.d.ts +2 -0
  212. package/lib/typescript/src/components/native/Switch.d.ts.map +1 -0
  213. package/lib/typescript/src/components/native/Text.d.ts +2 -0
  214. package/lib/typescript/src/components/native/Text.d.ts.map +1 -0
  215. package/lib/typescript/src/components/native/TextInput.d.ts +2 -0
  216. package/lib/typescript/src/components/native/TextInput.d.ts.map +1 -0
  217. package/lib/typescript/src/components/native/TouchableHighlight.d.ts +2 -0
  218. package/lib/typescript/src/components/native/TouchableHighlight.d.ts.map +1 -0
  219. package/lib/typescript/src/components/native/TouchableOpacity.d.ts +2 -0
  220. package/lib/typescript/src/components/native/TouchableOpacity.d.ts.map +1 -0
  221. package/lib/typescript/src/components/native/View.d.ts +2 -0
  222. package/lib/typescript/src/components/native/View.d.ts.map +1 -0
  223. package/lib/typescript/src/components/native/VirtualizedList.d.ts +2 -0
  224. package/lib/typescript/src/components/native/VirtualizedList.d.ts.map +1 -0
  225. package/lib/typescript/src/core/createUnistylesComponent.d.ts +9 -3
  226. package/lib/typescript/src/core/createUnistylesComponent.d.ts.map +1 -1
  227. package/lib/typescript/src/core/createUnistylesElement.d.ts +3 -0
  228. package/lib/typescript/src/core/createUnistylesElement.d.ts.map +1 -0
  229. package/lib/typescript/src/core/createUnistylesImageBackground.d.ts +4 -0
  230. package/lib/typescript/src/core/createUnistylesImageBackground.d.ts.map +1 -0
  231. package/lib/typescript/src/core/index.d.ts +4 -2
  232. package/lib/typescript/src/core/index.d.ts.map +1 -1
  233. package/lib/typescript/src/core/passForwardRef.d.ts +3 -0
  234. package/lib/typescript/src/core/passForwardRef.d.ts.map +1 -0
  235. package/lib/typescript/src/core/withUnistyles/index.d.ts +2 -0
  236. package/lib/typescript/src/core/withUnistyles/index.d.ts.map +1 -0
  237. package/lib/typescript/src/core/withUnistyles/types.d.ts +6 -0
  238. package/lib/typescript/src/core/withUnistyles/types.d.ts.map +1 -0
  239. package/lib/typescript/src/core/withUnistyles/useDependencies.d.ts +13 -0
  240. package/lib/typescript/src/core/withUnistyles/useDependencies.d.ts.map +1 -0
  241. package/lib/typescript/src/core/withUnistyles/withUnistyles.d.ts +11 -0
  242. package/lib/typescript/src/core/withUnistyles/withUnistyles.d.ts.map +1 -0
  243. package/lib/typescript/src/core/withUnistyles/withUnistyles.native.d.ts +8 -0
  244. package/lib/typescript/src/core/withUnistyles/withUnistyles.native.d.ts.map +1 -0
  245. package/lib/typescript/src/hooks/useMedia.d.ts +1 -1
  246. package/lib/typescript/src/hooks/useMedia.d.ts.map +1 -1
  247. package/lib/typescript/src/hooks/useMedia.native.d.ts +6 -0
  248. package/lib/typescript/src/hooks/useMedia.native.d.ts.map +1 -0
  249. package/lib/typescript/src/index.d.ts +2 -2
  250. package/lib/typescript/src/index.d.ts.map +1 -1
  251. package/lib/typescript/src/specs/ShadowRegistry/index.d.ts +7 -2
  252. package/lib/typescript/src/specs/ShadowRegistry/index.d.ts.map +1 -1
  253. package/lib/typescript/src/specs/ShadowRegistry/types.d.ts +17 -0
  254. package/lib/typescript/src/specs/ShadowRegistry/types.d.ts.map +1 -1
  255. package/lib/typescript/src/specs/index.d.ts +3 -11
  256. package/lib/typescript/src/specs/index.d.ts.map +1 -1
  257. package/lib/typescript/src/specs/index.native.d.ts +12 -0
  258. package/lib/typescript/src/specs/index.native.d.ts.map +1 -0
  259. package/lib/typescript/src/web/create.d.ts +1 -1441
  260. package/lib/typescript/src/web/create.d.ts.map +1 -1
  261. package/lib/typescript/src/web/index.d.ts +2 -1441
  262. package/lib/typescript/src/web/index.d.ts.map +1 -1
  263. package/lib/typescript/src/web/registry.d.ts +2 -3
  264. package/lib/typescript/src/web/registry.d.ts.map +1 -1
  265. package/lib/typescript/src/web/runtime.d.ts.map +1 -1
  266. package/lib/typescript/src/web/shadowRegistry.d.ts +11 -3
  267. package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -1
  268. package/lib/typescript/src/web/utils/unistyle.d.ts +1 -2
  269. package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -1
  270. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Umbrella.hpp +3 -0
  271. package/package.json +4 -4
  272. package/plugin/common.js +4 -6
  273. package/plugin/import.js +63 -26
  274. package/plugin/index.js +48 -28
  275. package/plugin/ref.js +0 -234
  276. package/plugin/style.js +4 -317
  277. package/plugin/stylesheet.js +25 -10
  278. package/plugin/variants.js +54 -1
  279. package/src/components/ScopedTheme.tsx +32 -0
  280. package/src/components/Variants.tsx +29 -0
  281. package/src/components/index.ts +2 -1
  282. package/src/components/native/ActivityIndicator.tsx +4 -0
  283. package/src/components/native/FlatList.tsx +4 -0
  284. package/src/components/native/Image.tsx +4 -0
  285. package/src/components/native/ImageBackground.tsx +4 -0
  286. package/src/components/native/KeyboardAvoidingView.tsx +4 -0
  287. package/src/components/native/Pressable.native.tsx +55 -0
  288. package/src/components/native/Pressable.tsx +98 -0
  289. package/src/components/native/RefreshControl.tsx +4 -0
  290. package/src/components/native/ScrollView.tsx +4 -0
  291. package/src/components/native/SectionList.tsx +4 -0
  292. package/src/components/native/Switch.tsx +4 -0
  293. package/src/components/native/Text.tsx +4 -0
  294. package/src/components/native/TextInput.tsx +4 -0
  295. package/src/components/native/TouchableHighlight.tsx +4 -0
  296. package/src/components/native/TouchableOpacity.tsx +4 -0
  297. package/src/components/native/View.tsx +4 -0
  298. package/src/components/native/VirtualizedList.tsx +4 -0
  299. package/src/core/createUnistylesComponent.tsx +6 -76
  300. package/src/core/createUnistylesElement.tsx +9 -0
  301. package/src/core/createUnistylesImageBackground.tsx +24 -0
  302. package/src/core/index.ts +4 -2
  303. package/src/core/passForwardRef.ts +29 -0
  304. package/src/core/withUnistyles/index.ts +1 -0
  305. package/src/core/withUnistyles/types.ts +7 -0
  306. package/src/core/withUnistyles/useDependencies.ts +93 -0
  307. package/src/core/withUnistyles/withUnistyles.native.tsx +96 -0
  308. package/src/core/withUnistyles/withUnistyles.tsx +90 -0
  309. package/src/hooks/useMedia.native.ts +65 -0
  310. package/src/hooks/useMedia.ts +19 -36
  311. package/src/index.ts +2 -2
  312. package/src/specs/ShadowRegistry/index.ts +14 -5
  313. package/src/specs/ShadowRegistry/types.ts +18 -1
  314. package/src/specs/index.native.ts +27 -0
  315. package/src/specs/index.ts +3 -27
  316. package/src/web/create.ts +14 -32
  317. package/src/web/index.ts +3 -2
  318. package/src/web/registry.ts +15 -6
  319. package/src/web/runtime.ts +3 -1
  320. package/src/web/shadowRegistry.ts +66 -52
  321. package/src/web/utils/unistyle.ts +1 -2
  322. package/lib/commonjs/components/Pressable.js +0 -74
  323. package/lib/commonjs/components/Pressable.js.map +0 -1
  324. package/lib/commonjs/components/Pressable.web.js.map +0 -1
  325. package/lib/commonjs/core/createUnistylesComponent.native.js +0 -82
  326. package/lib/commonjs/core/createUnistylesComponent.native.js.map +0 -1
  327. package/lib/commonjs/core/getBoundArgs.js +0 -18
  328. package/lib/commonjs/core/getBoundArgs.js.map +0 -1
  329. package/lib/commonjs/core/getId.js +0 -9
  330. package/lib/commonjs/core/getId.js.map +0 -1
  331. package/lib/commonjs/hooks/useMedia.web.js +0 -43
  332. package/lib/commonjs/hooks/useMedia.web.js.map +0 -1
  333. package/lib/commonjs/specs/index.web.js +0 -17
  334. package/lib/commonjs/specs/index.web.js.map +0 -1
  335. package/lib/module/components/Pressable.js +0 -68
  336. package/lib/module/components/Pressable.js.map +0 -1
  337. package/lib/module/components/Pressable.web.js +0 -109
  338. package/lib/module/components/Pressable.web.js.map +0 -1
  339. package/lib/module/core/createUnistylesComponent.native.js +0 -75
  340. package/lib/module/core/createUnistylesComponent.native.js.map +0 -1
  341. package/lib/module/core/getBoundArgs.js +0 -13
  342. package/lib/module/core/getBoundArgs.js.map +0 -1
  343. package/lib/module/core/getId.js +0 -4
  344. package/lib/module/core/getId.js.map +0 -1
  345. package/lib/module/hooks/useMedia.web.js +0 -38
  346. package/lib/module/hooks/useMedia.web.js.map +0 -1
  347. package/lib/module/specs/index.web.js +0 -4
  348. package/lib/module/specs/index.web.js.map +0 -1
  349. package/lib/typescript/src/components/Pressable.d.ts.map +0 -1
  350. package/lib/typescript/src/components/Pressable.web.d.ts.map +0 -1
  351. package/lib/typescript/src/core/createUnistylesComponent.native.d.ts +0 -8
  352. package/lib/typescript/src/core/createUnistylesComponent.native.d.ts.map +0 -1
  353. package/lib/typescript/src/core/getBoundArgs.d.ts +0 -2
  354. package/lib/typescript/src/core/getBoundArgs.d.ts.map +0 -1
  355. package/lib/typescript/src/core/getId.d.ts +0 -2
  356. package/lib/typescript/src/core/getId.d.ts.map +0 -1
  357. package/lib/typescript/src/hooks/useMedia.web.d.ts +0 -6
  358. package/lib/typescript/src/hooks/useMedia.web.d.ts.map +0 -1
  359. package/lib/typescript/src/specs/index.web.d.ts +0 -2
  360. package/lib/typescript/src/specs/index.web.d.ts.map +0 -1
  361. package/src/components/Pressable.tsx +0 -89
  362. package/src/components/Pressable.web.tsx +0 -129
  363. package/src/core/createUnistylesComponent.native.tsx +0 -83
  364. package/src/core/getBoundArgs.ts +0 -15
  365. package/src/core/getId.ts +0 -1
  366. package/src/hooks/useMedia.web.ts +0 -47
  367. package/src/specs/index.web.ts +0 -1
@@ -36,6 +36,85 @@ void parser::Parser::buildUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet
36
36
  });
37
37
  }
38
38
 
39
+ jsi::Value parser::Parser::getParsedStyleSheetForScopedTheme(jsi::Runtime& rt, core::Unistyle::Shared unistyle, std::string& scopedTheme) {
40
+ // for static stylesheets and exotic styles we don't need to do anything
41
+ if (unistyle->parent == nullptr || unistyle->parent->type == StyleSheetType::Static) {
42
+ return jsi::Value::undefined();
43
+ }
44
+
45
+ auto& state = core::UnistylesRegistry::get().getState(rt);
46
+ auto jsTheme = state.getJSThemeByName(scopedTheme);
47
+
48
+ if (unistyle->parent->type == StyleSheetType::Themable) {
49
+ return unistyle->parent->rawValue
50
+ .asFunction(rt)
51
+ .call(rt, std::move(jsTheme))
52
+ .asObject(rt);
53
+ }
54
+
55
+ auto miniRuntime = this->_unistylesRuntime->getMiniRuntimeAsValue(rt, std::nullopt);
56
+
57
+ return unistyle->parent->rawValue
58
+ .asFunction(rt)
59
+ .call(rt, std::move(jsTheme), std::move(miniRuntime))
60
+ .asObject(rt);
61
+ }
62
+
63
+ void parser::Parser::rebuildUnistyleWithScopedTheme(jsi::Runtime& rt, jsi::Value& jsScopedTheme, std::shared_ptr<core::UnistyleData> unistyleData) {
64
+ auto parsedStyleSheet = jsScopedTheme.isUndefined()
65
+ ? this->getParsedStyleSheetForScopedTheme(rt, unistyleData->unistyle, unistyleData->scopedTheme.value())
66
+ : jsScopedTheme.asObject(rt);
67
+
68
+ if (parsedStyleSheet.isUndefined()) {
69
+ return;
70
+ }
71
+
72
+ // get target style
73
+ auto targetStyle = parsedStyleSheet.asObject(rt).getProperty(rt, unistyleData->unistyle->styleKey.c_str()).asObject(rt);
74
+
75
+ // for object we just need to parse it
76
+ if (unistyleData->unistyle->type == UnistyleType::Object) {
77
+ // we need to temporarly swap rawValue to enforce correct parings
78
+ auto sharedRawValue = std::move(unistyleData->unistyle->rawValue);
79
+
80
+ unistyleData->unistyle->rawValue = std::move(targetStyle);
81
+ unistyleData->parsedStyle = this->parseFirstLevel(rt, unistyleData->unistyle, unistyleData->variants);
82
+ unistyleData->unistyle->rawValue = std::move(sharedRawValue);
83
+
84
+ return;
85
+ }
86
+
87
+ // for functions we need to call them with memoized arguments
88
+ auto unistyleFn = std::dynamic_pointer_cast<UnistyleDynamicFunction>(unistyleData->unistyle);
89
+
90
+ // convert arguments to jsi::Value
91
+ std::vector<jsi::Value> args{};
92
+ auto arguments = unistyleData->dynamicFunctionMetadata.value();
93
+
94
+ args.reserve(arguments.size());
95
+
96
+ for (int i = 0; i < arguments.size(); i++) {
97
+ folly::dynamic& arg = arguments.at(i);
98
+
99
+ args.emplace_back(jsi::valueFromDynamic(rt, arg));
100
+ }
101
+
102
+ const jsi::Value *argStart = args.data();
103
+
104
+ // we need to temporarly swap unprocessed value to enforce correct parings
105
+ auto sharedUnprocessedValue = std::move(unistyleFn->unprocessedValue);
106
+
107
+ // call cached function with memoized arguments
108
+ auto functionResult = targetStyle
109
+ .asFunction(rt)
110
+ .call(rt, argStart, arguments.size())
111
+ .asObject(rt);
112
+
113
+ unistyleFn->unprocessedValue = std::move(functionResult);
114
+ unistyleData->parsedStyle = this->parseFirstLevel(rt, unistyleFn, unistyleData->variants);
115
+ unistyleFn->unprocessedValue = std::move(sharedUnprocessedValue);
116
+ }
117
+
39
118
  jsi::Object parser::Parser::unwrapStyleSheet(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, std::optional<UnistylesNativeMiniRuntime> maybeMiniRuntime) {
40
119
  // firstly we need to get object representation of user's StyleSheet
41
120
  // StyleSheet can be a function or an object
@@ -87,24 +166,57 @@ void parser::Parser::parseUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet
87
166
  }
88
167
 
89
168
  // rebuild all unistyles in StyleSheet that depends on variants
90
- void parser::Parser::rebuildUnistylesWithVariants(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, Variants& variants) {
91
- for (const auto& [_, unistyle] : styleSheet->unistyles) {
92
- if (!unistyle->dependsOn(UnistyleDependency::VARIANTS)) {
93
- continue;
94
- }
169
+ void parser::Parser::rebuildUnistyleWithVariants(jsi::Runtime& rt, std::shared_ptr<core::UnistyleData> unistyleData) {
170
+ if (unistyleData->unistyle->styleKey == helpers::EXOTIC_STYLE_KEY) {
171
+ return;
172
+ }
173
+
174
+ if (unistyleData->unistyle->type == UnistyleType::Object) {
175
+ unistyleData->parsedStyle = this->parseFirstLevel(rt, unistyleData->unistyle, unistyleData->variants);
176
+
177
+ return;
178
+ }
179
+
180
+ // for functions we need to call them with memoized arguments
181
+ auto unistyleFn = std::dynamic_pointer_cast<UnistyleDynamicFunction>(unistyleData->unistyle);
182
+
183
+ // convert arguments to jsi::Value
184
+ std::vector<jsi::Value> args{};
185
+ auto arguments = unistyleData->dynamicFunctionMetadata.value();
186
+
187
+ args.reserve(arguments.size());
188
+
189
+ for (int i = 0; i < arguments.size(); i++) {
190
+ folly::dynamic& arg = arguments.at(i);
95
191
 
96
- this->rebuildUnistyle(rt, styleSheet, unistyle, variants, std::nullopt);
192
+ args.emplace_back(jsi::valueFromDynamic(rt, arg));
97
193
  }
194
+
195
+ const jsi::Value *argStart = args.data();
196
+
197
+ // we need to temporarly swap unprocessed value to enforce correct parings
198
+ auto sharedUnprocessedValue = std::move(unistyleFn->unprocessedValue);
199
+
200
+ // call cached function with memoized arguments
201
+ auto functionResult = unistyleFn->rawValue
202
+ .asFunction(rt)
203
+ .call(rt, argStart, arguments.size())
204
+ .asObject(rt);
205
+
206
+ unistyleFn->unprocessedValue = std::move(functionResult);
207
+ unistyleData->parsedStyle = this->parseFirstLevel(rt, unistyleFn, unistyleData->variants);
208
+ unistyleFn->unprocessedValue = std::move(sharedUnprocessedValue);
98
209
  }
99
210
 
100
211
  // rebuild all unistyles that are affected by platform event
101
212
  void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, DependencyMap& dependencyMap, std::vector<std::shared_ptr<core::StyleSheet>>& styleSheets, std::optional<UnistylesNativeMiniRuntime> maybeMiniRuntime) {
102
- std::unordered_map<std::shared_ptr<StyleSheet>, jsi::Value> parsedStyleSheets{};
213
+ std::unordered_map<std::shared_ptr<StyleSheet>, jsi::Value> parsedStyleSheetsWithDefaultTheme{};
214
+ std::unordered_map<std::string, std::unordered_map<std::shared_ptr<StyleSheet>, jsi::Value>> parsedStyleSheetsWithScopedTheme{};
103
215
  std::unordered_map<std::shared_ptr<core::Unistyle>, bool> parsedUnistyles{};
104
216
 
105
217
  // parse all stylesheets that depends on changes
106
218
  for (auto styleSheet : styleSheets) {
107
- parsedStyleSheets.emplace(styleSheet, this->unwrapStyleSheet(rt, styleSheet, maybeMiniRuntime));
219
+ parsedStyleSheetsWithDefaultTheme.emplace(styleSheet, this->unwrapStyleSheet(rt, styleSheet, maybeMiniRuntime));
108
220
  }
109
221
 
110
222
  // then parse all visible Unistyles managed by Unistyle
@@ -112,8 +224,8 @@ void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, Dependenc
112
224
  auto styleSheet = unistyles.begin()->get()->unistyle->parent;
113
225
 
114
226
  // stylesheet may be optional for exotic unistyles
115
- if (styleSheet != nullptr && !parsedStyleSheets.contains(styleSheet)) {
116
- parsedStyleSheets.emplace(styleSheet, this->unwrapStyleSheet(rt, styleSheet, maybeMiniRuntime));
227
+ if (styleSheet != nullptr && !parsedStyleSheetsWithDefaultTheme.contains(styleSheet)) {
228
+ parsedStyleSheetsWithDefaultTheme.emplace(styleSheet, this->unwrapStyleSheet(rt, styleSheet, maybeMiniRuntime));
117
229
  }
118
230
 
119
231
  for (auto& unistyleData : unistyles) {
@@ -136,18 +248,60 @@ void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, Dependenc
136
248
  auto unistyleStyleSheet = unistyle->parent;
137
249
 
138
250
  // we may hit now other StyleSheets that are referenced from affected nodes
139
- if (unistyleStyleSheet != nullptr && !parsedStyleSheets.contains(unistyleStyleSheet)) {
140
- parsedStyleSheets.emplace(unistyleStyleSheet, this->unwrapStyleSheet(rt, unistyleStyleSheet, maybeMiniRuntime));
251
+ if (unistyleStyleSheet != nullptr && !parsedStyleSheetsWithDefaultTheme.contains(unistyleStyleSheet)) {
252
+ parsedStyleSheetsWithDefaultTheme.emplace(unistyleStyleSheet, this->unwrapStyleSheet(rt, unistyleStyleSheet, maybeMiniRuntime));
141
253
  }
142
254
 
143
255
  // StyleSheet might have styles that are not affected
144
- if (!parsedStyleSheets[unistyleStyleSheet].asObject(rt).hasProperty(rt, unistyle->styleKey.c_str())) {
256
+ if (!parsedStyleSheetsWithDefaultTheme[unistyleStyleSheet].asObject(rt).hasProperty(rt, unistyle->styleKey.c_str())) {
145
257
  continue;
146
258
  }
147
259
 
148
- unistyle->rawValue = parsedStyleSheets[unistyleStyleSheet].asObject(rt).getProperty(rt, unistyle->styleKey.c_str()).asObject(rt);
149
- this->rebuildUnistyle(rt, unistyleStyleSheet, unistyle, unistyleData->variants, unistyleData->dynamicFunctionMetadata);
150
- unistyleData->parsedStyle = jsi::Value(rt, unistyle->parsedStyle.value()).asObject(rt);
260
+ // for scoped themes we need to parse unistyle exclusively
261
+ if (unistyleData->scopedTheme.has_value()) {
262
+ std::vector<folly::dynamic> arguments = {};
263
+
264
+ if (unistyleData->dynamicFunctionMetadata.has_value()) {
265
+ arguments = unistyleData->dynamicFunctionMetadata.value();
266
+ }
267
+
268
+ auto parsedStyleSheet = jsi::Value::undefined();
269
+ auto scopedThemeName = unistyleData->scopedTheme.value();
270
+
271
+ // check if we have theme in cache
272
+ if (parsedStyleSheetsWithScopedTheme.contains(scopedThemeName)) {
273
+ if (parsedStyleSheetsWithScopedTheme[scopedThemeName].contains(unistyle->parent)) {
274
+ parsedStyleSheet = jsi::Value(rt, parsedStyleSheetsWithScopedTheme[scopedThemeName][unistyle->parent]);
275
+ }
276
+ }
277
+
278
+ // if not, let's build it
279
+ if (parsedStyleSheet.isUndefined()) {
280
+ parsedStyleSheet = this->getParsedStyleSheetForScopedTheme(rt, unistyle, unistyleData->scopedTheme.value());
281
+
282
+ if (!parsedStyleSheetsWithScopedTheme.contains(scopedThemeName)) {
283
+ parsedStyleSheetsWithScopedTheme.emplace(
284
+ scopedThemeName,
285
+ std::unordered_map<std::shared_ptr<StyleSheet>, jsi::Value>{}
286
+ );
287
+ }
288
+
289
+ parsedStyleSheetsWithScopedTheme[scopedThemeName].emplace(
290
+ unistyle->parent,
291
+ jsi::Value(rt, parsedStyleSheet)
292
+ );
293
+ }
294
+
295
+ this->rebuildUnistyleWithScopedTheme(
296
+ rt,
297
+ parsedStyleSheet,
298
+ unistyleData
299
+ );
300
+ } else {
301
+ unistyle->rawValue = parsedStyleSheetsWithDefaultTheme[unistyleStyleSheet].asObject(rt).getProperty(rt, unistyle->styleKey.c_str()).asObject(rt);
302
+ this->rebuildUnistyle(rt, unistyleStyleSheet, unistyle, unistyleData->variants, unistyleData->dynamicFunctionMetadata);
303
+ unistyleData->parsedStyle = jsi::Value(rt, unistyle->parsedStyle.value()).asObject(rt);
304
+ }
151
305
 
152
306
  if (!parsedUnistyles.contains(unistyle)) {
153
307
  parsedUnistyles.emplace(unistyle, true);
@@ -160,7 +314,7 @@ void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, Dependenc
160
314
  for (auto styleSheet : styleSheets) {
161
315
  for (auto& [_, unistyle] : styleSheet->unistyles) {
162
316
  if (!parsedUnistyles.contains(unistyle)) {
163
- unistyle->rawValue = parsedStyleSheets[styleSheet].asObject(rt).getProperty(rt, unistyle->styleKey.c_str()).asObject(rt);
317
+ unistyle->rawValue = parsedStyleSheetsWithDefaultTheme[styleSheet].asObject(rt).getProperty(rt, unistyle->styleKey.c_str()).asObject(rt);
164
318
  }
165
319
  }
166
320
  }
@@ -317,7 +471,7 @@ jsi::Object parser::Parser::parseFirstLevel(jsi::Runtime& rt, Unistyle::Shared u
317
471
  parsedStyle.setProperty(rt, jsi::PropNameID::forUtf8(rt, propertyName), this->parseSecondLevel(rt, unistyle, valueFromBreakpoint));
318
472
  });
319
473
 
320
- if (shouldParseVariants && variants.has_value() && !variants.value().empty()) {
474
+ if (shouldParseVariants && variants.has_value()) {
321
475
  auto propertyValueObject = style.getProperty(rt, "variants").asObject(rt);
322
476
  auto parsedVariant = this->parseVariants(rt, unistyle, propertyValueObject, variants.value());
323
477
 
@@ -347,12 +501,12 @@ jsi::Function parser::Parser::createDynamicFunctionProxy(jsi::Runtime& rt, Unist
347
501
  ? thisVal.asObject(rt)
348
502
  : jsi::Object(rt);
349
503
  auto parser = parser::Parser(unistylesRuntime);
350
-
351
504
  // call user function
352
505
  auto result = unistyle->rawValue.asFunction(rt).call(rt, args, count);
353
506
 
354
507
  // memoize metadata to call it later
355
508
  auto unistyleFn = std::dynamic_pointer_cast<UnistyleDynamicFunction>(unistyle);
509
+ auto& registry = core::UnistylesRegistry::get();
356
510
 
357
511
  unistyleFn->unprocessedValue = jsi::Value(rt, result).asObject(rt);
358
512
 
@@ -360,7 +514,7 @@ jsi::Function parser::Parser::createDynamicFunctionProxy(jsi::Runtime& rt, Unist
360
514
  ? thisObject.getProperty(rt, helpers::STYLE_VARIANTS.c_str())
361
515
  : jsi::Value::undefined();
362
516
  std::optional<Variants> variants = rawVariants.isUndefined()
363
- ? std::nullopt
517
+ ? registry.getScopedVariants()
364
518
  : std::optional<Variants>(helpers::variantsToPairs(rt, rawVariants.asObject(rt)));
365
519
 
366
520
  unistyleFn->parsedStyle = this->parseFirstLevel(rt, unistyleFn, variants);
@@ -371,13 +525,15 @@ jsi::Function parser::Parser::createDynamicFunctionProxy(jsi::Runtime& rt, Unist
371
525
  // include dependencies for createUnistylesComponent
372
526
  style.setProperty(rt, "__proto__", generateUnistylesPrototype(rt, unistylesRuntime, unistyle, variants, helpers::functionArgumentsToArray(rt, args, count)));
373
527
 
374
- // update shadow leaf updates to indicate newest changes
375
- auto& registry = core::UnistylesRegistry::get();
376
- auto lastArg = count == 0
377
- ? jsi::Value::undefined()
378
- : jsi::Value(rt, args[count - 1]);
528
+ jsi::Object secrets = jsi::Object(rt);
529
+
530
+ secrets.setProperty(rt, helpers::ARGUMENTS.c_str(), helpers::functionArgumentsToArray(rt, args, count));
531
+
532
+ helpers::defineHiddenProperty(rt, style, helpers::SECRETS.c_str(), secrets);
533
+
534
+ auto wrappedUnistyle = std::make_shared<UnistyleWrapper>(unistyle);
379
535
 
380
- registry.shadowLeafUpdateFromUnistyle(rt, unistyle, lastArg);
536
+ style.setNativeState(rt, std::move(wrappedUnistyle));
381
537
 
382
538
  return style;
383
539
  });
@@ -23,11 +23,13 @@ struct Parser {
23
23
 
24
24
  void buildUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet);
25
25
  void parseUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet);
26
- void rebuildUnistylesWithVariants(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, Variants& variants);
26
+ void rebuildUnistyleWithVariants(jsi::Runtime& rt, std::shared_ptr<core::UnistyleData> unistyleData);
27
27
  void rebuildUnistylesInDependencyMap(jsi::Runtime& rt, core::DependencyMap& dependencyMap, std::vector<std::shared_ptr<core::StyleSheet>>& styleSheets, std::optional<UnistylesNativeMiniRuntime> maybeMiniRuntime);
28
28
  void rebuildShadowLeafUpdates(jsi::Runtime& rt, core::DependencyMap& dependencyMap);
29
29
  folly::dynamic parseStylesToShadowTreeStyles(jsi::Runtime& rt, const std::vector<std::shared_ptr<UnistyleData>>& unistyles);
30
30
  void rebuildUnistyle(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, Unistyle::Shared unistyle, const Variants& variants, std::optional<std::vector<folly::dynamic>>);
31
+ void rebuildUnistyleWithScopedTheme(jsi::Runtime& rt, jsi::Value& jsScopedTheme, std::shared_ptr<core::UnistyleData> unistyleData);
32
+ jsi::Value getParsedStyleSheetForScopedTheme(jsi::Runtime& rt, core::Unistyle::Shared unistyle, std::string& scopedTheme);
31
33
 
32
34
  private:
33
35
  jsi::Object unwrapStyleSheet(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, std::optional<UnistylesNativeMiniRuntime>);
@@ -54,8 +54,8 @@ __weak RCTSurfacePresenter* _surfacePresenter;
54
54
  HybridObjectRegistry::registerHybridObjectConstructor("UnistylesStyleSheet", [styleSheet]() -> std::shared_ptr<HybridObject>{
55
55
  return styleSheet;
56
56
  });
57
- HybridObjectRegistry::registerHybridObjectConstructor("UnistylesShadowRegistry", []() -> std::shared_ptr<HybridObject>{
58
- return std::make_shared<HybridShadowRegistry>();
57
+ HybridObjectRegistry::registerHybridObjectConstructor("UnistylesShadowRegistry", [unistylesRuntime]() -> std::shared_ptr<HybridObject>{
58
+ return std::make_shared<HybridShadowRegistry>(unistylesRuntime);
59
59
  });
60
60
  }
61
61
 
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ScopedTheme = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _specs = require("../specs");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
+ const Apply = ({
13
+ name
14
+ }) => {
15
+ _specs.UnistylesShadowRegistry.setScopedTheme(name);
16
+ (0, _react.useLayoutEffect)(() => {
17
+ _specs.UnistylesShadowRegistry.setScopedTheme(name);
18
+ });
19
+ return null;
20
+ };
21
+ const ScopedTheme = ({
22
+ name,
23
+ children
24
+ }) => {
25
+ const previousScopedTheme = _specs.UnistylesShadowRegistry.getScopedTheme();
26
+ const mappedChildren = [/*#__PURE__*/(0, _jsxRuntime.jsx)(Apply, {
27
+ name: name
28
+ }, name), children, /*#__PURE__*/(0, _jsxRuntime.jsx)(Apply, {
29
+ name: previousScopedTheme
30
+ }, 'dispose')];
31
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
32
+ children: mappedChildren
33
+ });
34
+ };
35
+ exports.ScopedTheme = ScopedTheme;
36
+ //# sourceMappingURL=ScopedTheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_specs","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Apply","name","UnistylesShadowRegistry","setScopedTheme","useLayoutEffect","ScopedTheme","children","previousScopedTheme","getScopedTheme","mappedChildren","jsx","Fragment","exports"],"sourceRoot":"../../../src","sources":["components/ScopedTheme.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAAkD,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAMlD,MAAMW,KAAK,GAAGA,CAAC;EAAEC;AAAuC,CAAC,KAAK;EAC1DC,8BAAuB,CAACC,cAAc,CAACF,IAAI,CAAC;EAE5C,IAAAG,sBAAe,EAAC,MAAM;IAClBF,8BAAuB,CAACC,cAAc,CAACF,IAAI,CAAC;EAChD,CAAC,CAAC;EAEF,OAAO,IAAI;AACf,CAAC;AAEM,MAAMI,WAAyE,GAAGA,CAAC;EAAEJ,IAAI;EAAEK;AAAS,CAAC,KAAK;EAC7G,MAAMC,mBAAmB,GAAGL,8BAAuB,CAACM,cAAc,CAAC,CAAC;EACpE,MAAMC,cAAc,GAAG,cACnB,IAAA9B,WAAA,CAAA+B,GAAA,EAACV,KAAK;IAAYC,IAAI,EAAEA;EAAK,GAAjBA,IAAmB,CAAC,EAChCK,QAAQ,eACR,IAAA3B,WAAA,CAAA+B,GAAA,EAACV,KAAK;IAAeC,IAAI,EAAEM;EAAoB,GAApC,SAAsC,CAAC,CACrD;EAED,oBACI,IAAA5B,WAAA,CAAA+B,GAAA,EAACnC,MAAA,CAAAW,OAAK,CAACyB,QAAQ;IAAAL,QAAA,EACVG;EAAc,CACH,CAAC;AAEzB,CAAC;AAAAG,OAAA,CAAAP,WAAA,GAAAA,WAAA","ignoreList":[]}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Variants = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _specs = require("../specs");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
+ const Apply = ({
13
+ variants
14
+ }) => {
15
+ _specs.UnistylesShadowRegistry.selectVariants(variants);
16
+ (0, _react.useLayoutEffect)(() => {
17
+ _specs.UnistylesShadowRegistry.selectVariants(variants);
18
+ });
19
+ return null;
20
+ };
21
+ const Variants = ({
22
+ variants,
23
+ children
24
+ }) => {
25
+ const mappedChildren = [/*#__PURE__*/(0, _jsxRuntime.jsx)(Apply, {
26
+ variants: variants
27
+ }, 'add'), children, /*#__PURE__*/(0, _jsxRuntime.jsx)(Apply, {}, 'remove')];
28
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
29
+ children: mappedChildren
30
+ });
31
+ };
32
+ exports.Variants = Variants;
33
+ //# sourceMappingURL=Variants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_specs","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Apply","variants","UnistylesShadowRegistry","selectVariants","useLayoutEffect","Variants","children","mappedChildren","jsx","Fragment","exports"],"sourceRoot":"../../../src","sources":["components/Variants.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAAkD,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAMlD,MAAMW,KAA4C,GAAGA,CAAC;EAAEC;AAAS,CAAC,KAAK;EACnEC,8BAAuB,CAACC,cAAc,CAACF,QAAQ,CAAC;EAEhD,IAAAG,sBAAe,EAAC,MAAM;IAClBF,8BAAuB,CAACC,cAAc,CAACF,QAAQ,CAAC;EACpD,CAAC,CAAC;EAEF,OAAO,IAAI;AACf,CAAC;AACM,MAAMI,QAAwE,GAAGA,CAAC;EAAEJ,QAAQ;EAAEK;AAAS,CAAC,KAAK;EAChH,MAAMC,cAAc,GAAG,cACnB,IAAA5B,WAAA,CAAA6B,GAAA,EAACR,KAAK;IAAWC,QAAQ,EAAEA;EAAS,GAAzB,KAA2B,CAAC,EACvCK,QAAQ,eACR,IAAA3B,WAAA,CAAA6B,GAAA,EAACR,KAAK,MAAK,QAAU,CAAC,CACzB;EAED,oBACI,IAAArB,WAAA,CAAA6B,GAAA,EAACjC,MAAA,CAAAW,OAAK,CAACuB,QAAQ;IAAAH,QAAA,EACVC;EAAc,CACH,CAAC;AAEzB,CAAC;AAAAG,OAAA,CAAAL,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -15,13 +15,20 @@ Object.defineProperty(exports, "Hide", {
15
15
  return _Hide.Hide;
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "Pressable", {
18
+ Object.defineProperty(exports, "ScopedTheme", {
19
19
  enumerable: true,
20
20
  get: function () {
21
- return _Pressable.Pressable;
21
+ return _ScopedTheme.ScopedTheme;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "Variants", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _Variants.Variants;
22
28
  }
23
29
  });
24
30
  var _Hide = require("./Hide");
25
31
  var _Display = require("./Display");
26
- var _Pressable = require("./Pressable");
32
+ var _Variants = require("./Variants");
33
+ var _ScopedTheme = require("./ScopedTheme");
27
34
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_Hide","require","_Display","_Pressable"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["_Hide","require","_Display","_Variants","_ScopedTheme"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ActivityIndicator = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _core = require("../../core");
9
+ const ActivityIndicator = exports.ActivityIndicator = (0, _core.createUnistylesElement)(_reactNative.ActivityIndicator);
10
+ //# sourceMappingURL=ActivityIndicator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_core","ActivityIndicator","exports","createUnistylesElement","NativeActivityIndicator"],"sourceRoot":"../../../../src","sources":["components/native/ActivityIndicator.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAAE,4BAAsB,EAACC,8BAAuB,CAAC","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.FlatList = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _core = require("../../core");
9
+ const FlatList = exports.FlatList = (0, _core.createUnistylesElement)(_reactNative.FlatList);
10
+ //# sourceMappingURL=FlatList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_core","FlatList","exports","createUnistylesElement","NativeFlatList"],"sourceRoot":"../../../../src","sources":["components/native/FlatList.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAG,IAAAE,4BAAsB,EAACC,qBAAc,CAAC","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Image = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _core = require("../../core");
9
+ const Image = exports.Image = (0, _core.createUnistylesElement)(_reactNative.Image);
10
+ //# sourceMappingURL=Image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_core","Image","exports","createUnistylesElement","NativeImage"],"sourceRoot":"../../../../src","sources":["components/native/Image.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,KAAK,GAAAC,OAAA,CAAAD,KAAA,GAAG,IAAAE,4BAAsB,EAACC,kBAAW,CAAC","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ImageBackground = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _core = require("../../core");
9
+ const ImageBackground = exports.ImageBackground = (0, _core.createUnistylesImageBackground)(_reactNative.ImageBackground);
10
+ //# sourceMappingURL=ImageBackground.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_core","ImageBackground","exports","createUnistylesImageBackground","NativeImageBackground"],"sourceRoot":"../../../../src","sources":["components/native/ImageBackground.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,IAAAE,oCAA8B,EAACC,4BAAqB,CAAC","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.KeyboardAvoidingView = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _core = require("../../core");
9
+ const KeyboardAvoidingView = exports.KeyboardAvoidingView = (0, _core.createUnistylesElement)(_reactNative.KeyboardAvoidingView);
10
+ //# sourceMappingURL=KeyboardAvoidingView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_core","KeyboardAvoidingView","exports","createUnistylesElement","NativeKeyboardAvoidingView"],"sourceRoot":"../../../../src","sources":["components/native/KeyboardAvoidingView.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,IAAAE,4BAAsB,EAACC,iCAA0B,CAAC","ignoreList":[]}