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

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 (384) 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/components/native/ActivityIndicator/package.json +4 -0
  6. package/components/native/FlatList/package.json +4 -0
  7. package/components/native/Image/package.json +4 -0
  8. package/components/native/ImageBackground/package.json +4 -0
  9. package/components/native/KeyboardAvoidingView/package.json +4 -0
  10. package/components/native/Pressable/package.json +5 -0
  11. package/components/native/RefreshControl/package.json +4 -0
  12. package/components/native/ScrollView/package.json +4 -0
  13. package/components/native/SectionList/package.json +4 -0
  14. package/components/native/Switch/package.json +4 -0
  15. package/components/native/Text/package.json +4 -0
  16. package/components/native/TextInput/package.json +4 -0
  17. package/components/native/TouchableHighlight/package.json +4 -0
  18. package/components/native/TouchableOpacity/package.json +4 -0
  19. package/components/native/View/package.json +4 -0
  20. package/components/native/VirtualizedList/package.json +4 -0
  21. package/cxx/common/Constants.h +2 -0
  22. package/cxx/core/HostStyle.cpp +17 -7
  23. package/cxx/core/HostStyle.h +5 -0
  24. package/cxx/core/UnistyleData.h +3 -3
  25. package/cxx/core/UnistyleWrapper.h +9 -9
  26. package/cxx/core/UnistylesRegistry.cpp +23 -30
  27. package/cxx/core/UnistylesRegistry.h +8 -2
  28. package/cxx/hybridObjects/HybridShadowRegistry.cpp +117 -12
  29. package/cxx/hybridObjects/HybridShadowRegistry.h +27 -3
  30. package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +4 -0
  31. package/cxx/parser/Parser.cpp +184 -26
  32. package/cxx/parser/Parser.h +3 -1
  33. package/ios/UnistylesModuleOnLoad.mm +2 -2
  34. package/lib/commonjs/components/ScopedTheme.js +36 -0
  35. package/lib/commonjs/components/ScopedTheme.js.map +1 -0
  36. package/lib/commonjs/components/Variants.js +36 -0
  37. package/lib/commonjs/components/Variants.js.map +1 -0
  38. package/lib/commonjs/components/index.js +10 -3
  39. package/lib/commonjs/components/index.js.map +1 -1
  40. package/lib/commonjs/components/native/ActivityIndicator.js +10 -0
  41. package/lib/commonjs/components/native/ActivityIndicator.js.map +1 -0
  42. package/lib/commonjs/components/native/FlatList.js +10 -0
  43. package/lib/commonjs/components/native/FlatList.js.map +1 -0
  44. package/lib/commonjs/components/native/Image.js +10 -0
  45. package/lib/commonjs/components/native/Image.js.map +1 -0
  46. package/lib/commonjs/components/native/ImageBackground.js +10 -0
  47. package/lib/commonjs/components/native/ImageBackground.js.map +1 -0
  48. package/lib/commonjs/components/native/KeyboardAvoidingView.js +10 -0
  49. package/lib/commonjs/components/native/KeyboardAvoidingView.js.map +1 -0
  50. package/lib/commonjs/components/{Pressable.web.js → native/Pressable.js} +26 -66
  51. package/lib/commonjs/components/native/Pressable.js.map +1 -0
  52. package/lib/commonjs/components/native/Pressable.native.js +51 -0
  53. package/lib/commonjs/components/native/Pressable.native.js.map +1 -0
  54. package/lib/commonjs/components/native/RefreshControl.js +10 -0
  55. package/lib/commonjs/components/native/RefreshControl.js.map +1 -0
  56. package/lib/commonjs/components/native/ScrollView.js +10 -0
  57. package/lib/commonjs/components/native/ScrollView.js.map +1 -0
  58. package/lib/commonjs/components/native/SectionList.js +10 -0
  59. package/lib/commonjs/components/native/SectionList.js.map +1 -0
  60. package/lib/commonjs/components/native/Switch.js +10 -0
  61. package/lib/commonjs/components/native/Switch.js.map +1 -0
  62. package/lib/commonjs/components/native/Text.js +10 -0
  63. package/lib/commonjs/components/native/Text.js.map +1 -0
  64. package/lib/commonjs/components/native/TextInput.js +10 -0
  65. package/lib/commonjs/components/native/TextInput.js.map +1 -0
  66. package/lib/commonjs/components/native/TouchableHighlight.js +10 -0
  67. package/lib/commonjs/components/native/TouchableHighlight.js.map +1 -0
  68. package/lib/commonjs/components/native/TouchableOpacity.js +10 -0
  69. package/lib/commonjs/components/native/TouchableOpacity.js.map +1 -0
  70. package/lib/commonjs/components/native/View.js +10 -0
  71. package/lib/commonjs/components/native/View.js.map +1 -0
  72. package/lib/commonjs/components/native/VirtualizedList.js +10 -0
  73. package/lib/commonjs/components/native/VirtualizedList.js.map +1 -0
  74. package/lib/commonjs/core/createUnistylesComponent.js +5 -68
  75. package/lib/commonjs/core/createUnistylesComponent.js.map +1 -1
  76. package/lib/commonjs/core/createUnistylesElement.js +16 -0
  77. package/lib/commonjs/core/createUnistylesElement.js.map +1 -0
  78. package/lib/commonjs/core/createUnistylesImageBackground.js +27 -0
  79. package/lib/commonjs/core/createUnistylesImageBackground.js.map +1 -0
  80. package/lib/commonjs/core/index.js +20 -6
  81. package/lib/commonjs/core/index.js.map +1 -1
  82. package/lib/commonjs/core/passForwardRef.js +27 -0
  83. package/lib/commonjs/core/passForwardRef.js.map +1 -0
  84. package/lib/commonjs/core/withUnistyles/index.js +13 -0
  85. package/lib/commonjs/core/withUnistyles/index.js.map +1 -0
  86. package/lib/commonjs/core/withUnistyles/types.js +8 -0
  87. package/lib/commonjs/core/withUnistyles/types.js.map +1 -0
  88. package/lib/commonjs/core/withUnistyles/useDependencies.js +85 -0
  89. package/lib/commonjs/core/withUnistyles/useDependencies.js.map +1 -0
  90. package/lib/commonjs/core/withUnistyles/withUnistyles.js +88 -0
  91. package/lib/commonjs/core/withUnistyles/withUnistyles.js.map +1 -0
  92. package/lib/commonjs/core/withUnistyles/withUnistyles.native.js +97 -0
  93. package/lib/commonjs/core/withUnistyles/withUnistyles.native.js.map +1 -0
  94. package/lib/commonjs/hooks/useMedia.js +17 -33
  95. package/lib/commonjs/hooks/useMedia.js.map +1 -1
  96. package/lib/commonjs/hooks/useMedia.native.js +60 -0
  97. package/lib/commonjs/hooks/useMedia.native.js.map +1 -0
  98. package/lib/commonjs/index.js +52 -31
  99. package/lib/commonjs/index.js.map +1 -1
  100. package/lib/commonjs/specs/ShadowRegistry/index.js +3 -3
  101. package/lib/commonjs/specs/ShadowRegistry/index.js.map +1 -1
  102. package/lib/commonjs/specs/index.js +14 -40
  103. package/lib/commonjs/specs/index.js.map +1 -1
  104. package/lib/commonjs/specs/index.native.js +54 -0
  105. package/lib/commonjs/specs/index.native.js.map +1 -0
  106. package/lib/commonjs/web/create.js +9 -33
  107. package/lib/commonjs/web/create.js.map +1 -1
  108. package/lib/commonjs/web/index.js +15 -16
  109. package/lib/commonjs/web/index.js.map +1 -1
  110. package/lib/commonjs/web/registry.js +10 -3
  111. package/lib/commonjs/web/registry.js.map +1 -1
  112. package/lib/commonjs/web/runtime.js +3 -1
  113. package/lib/commonjs/web/runtime.js.map +1 -1
  114. package/lib/commonjs/web/shadowRegistry.js +66 -64
  115. package/lib/commonjs/web/shadowRegistry.js.map +1 -1
  116. package/lib/commonjs/web/utils/unistyle.js +4 -4
  117. package/lib/commonjs/web/utils/unistyle.js.map +1 -1
  118. package/lib/module/components/ScopedTheme.js +29 -0
  119. package/lib/module/components/ScopedTheme.js.map +1 -0
  120. package/lib/module/components/Variants.js +29 -0
  121. package/lib/module/components/Variants.js.map +1 -0
  122. package/lib/module/components/index.js +2 -1
  123. package/lib/module/components/index.js.map +1 -1
  124. package/lib/module/components/native/ActivityIndicator.js +6 -0
  125. package/lib/module/components/native/ActivityIndicator.js.map +1 -0
  126. package/lib/module/components/native/FlatList.js +6 -0
  127. package/lib/module/components/native/FlatList.js.map +1 -0
  128. package/lib/module/components/native/Image.js +6 -0
  129. package/lib/module/components/native/Image.js.map +1 -0
  130. package/lib/module/components/native/ImageBackground.js +6 -0
  131. package/lib/module/components/native/ImageBackground.js.map +1 -0
  132. package/lib/module/components/native/KeyboardAvoidingView.js +6 -0
  133. package/lib/module/components/native/KeyboardAvoidingView.js.map +1 -0
  134. package/lib/module/components/native/Pressable.js +69 -0
  135. package/lib/module/components/native/Pressable.js.map +1 -0
  136. package/lib/module/components/native/Pressable.native.js +45 -0
  137. package/lib/module/components/native/Pressable.native.js.map +1 -0
  138. package/lib/module/components/native/RefreshControl.js +6 -0
  139. package/lib/module/components/native/RefreshControl.js.map +1 -0
  140. package/lib/module/components/native/ScrollView.js +6 -0
  141. package/lib/module/components/native/ScrollView.js.map +1 -0
  142. package/lib/module/components/native/SectionList.js +6 -0
  143. package/lib/module/components/native/SectionList.js.map +1 -0
  144. package/lib/module/components/native/Switch.js +6 -0
  145. package/lib/module/components/native/Switch.js.map +1 -0
  146. package/lib/module/components/native/Text.js +6 -0
  147. package/lib/module/components/native/Text.js.map +1 -0
  148. package/lib/module/components/native/TextInput.js +6 -0
  149. package/lib/module/components/native/TextInput.js.map +1 -0
  150. package/lib/module/components/native/TouchableHighlight.js +6 -0
  151. package/lib/module/components/native/TouchableHighlight.js.map +1 -0
  152. package/lib/module/components/native/TouchableOpacity.js +6 -0
  153. package/lib/module/components/native/TouchableOpacity.js.map +1 -0
  154. package/lib/module/components/native/View.js +6 -0
  155. package/lib/module/components/native/View.js.map +1 -0
  156. package/lib/module/components/native/VirtualizedList.js +6 -0
  157. package/lib/module/components/native/VirtualizedList.js.map +1 -0
  158. package/lib/module/core/createUnistylesComponent.js +5 -66
  159. package/lib/module/core/createUnistylesComponent.js.map +1 -1
  160. package/lib/module/core/createUnistylesElement.js +10 -0
  161. package/lib/module/core/createUnistylesElement.js.map +1 -0
  162. package/lib/module/core/createUnistylesImageBackground.js +21 -0
  163. package/lib/module/core/createUnistylesImageBackground.js.map +1 -0
  164. package/lib/module/core/index.js +4 -2
  165. package/lib/module/core/index.js.map +1 -1
  166. package/lib/module/core/passForwardRef.js +22 -0
  167. package/lib/module/core/passForwardRef.js.map +1 -0
  168. package/lib/module/core/withUnistyles/index.js +4 -0
  169. package/lib/module/core/withUnistyles/index.js.map +1 -0
  170. package/lib/module/core/withUnistyles/types.js +4 -0
  171. package/lib/module/core/withUnistyles/types.js.map +1 -0
  172. package/lib/module/core/withUnistyles/useDependencies.js +79 -0
  173. package/lib/module/core/withUnistyles/useDependencies.js.map +1 -0
  174. package/lib/module/core/withUnistyles/withUnistyles.js +81 -0
  175. package/lib/module/core/withUnistyles/withUnistyles.js.map +1 -0
  176. package/lib/module/core/withUnistyles/withUnistyles.native.js +90 -0
  177. package/lib/module/core/withUnistyles/withUnistyles.native.js.map +1 -0
  178. package/lib/module/hooks/useMedia.js +19 -35
  179. package/lib/module/hooks/useMedia.js.map +1 -1
  180. package/lib/module/hooks/useMedia.native.js +55 -0
  181. package/lib/module/hooks/useMedia.native.js.map +1 -0
  182. package/lib/module/index.js +3 -3
  183. package/lib/module/index.js.map +1 -1
  184. package/lib/module/specs/ShadowRegistry/index.js +3 -3
  185. package/lib/module/specs/ShadowRegistry/index.js.map +1 -1
  186. package/lib/module/specs/index.js +2 -8
  187. package/lib/module/specs/index.js.map +1 -1
  188. package/lib/module/specs/index.native.js +11 -0
  189. package/lib/module/specs/index.native.js.map +1 -0
  190. package/lib/module/web/create.js +10 -34
  191. package/lib/module/web/create.js.map +1 -1
  192. package/lib/module/web/index.js +4 -3
  193. package/lib/module/web/index.js.map +1 -1
  194. package/lib/module/web/registry.js +11 -4
  195. package/lib/module/web/registry.js.map +1 -1
  196. package/lib/module/web/runtime.js +3 -1
  197. package/lib/module/web/runtime.js.map +1 -1
  198. package/lib/module/web/shadowRegistry.js +64 -62
  199. package/lib/module/web/shadowRegistry.js.map +1 -1
  200. package/lib/module/web/utils/unistyle.js +2 -2
  201. package/lib/module/web/utils/unistyle.js.map +1 -1
  202. package/lib/typescript/src/components/ScopedTheme.d.ts +8 -0
  203. package/lib/typescript/src/components/ScopedTheme.d.ts.map +1 -0
  204. package/lib/typescript/src/components/Variants.d.ts +7 -0
  205. package/lib/typescript/src/components/Variants.d.ts.map +1 -0
  206. package/lib/typescript/src/components/index.d.ts +2 -1
  207. package/lib/typescript/src/components/index.d.ts.map +1 -1
  208. package/lib/typescript/src/components/native/ActivityIndicator.d.ts +2 -0
  209. package/lib/typescript/src/components/native/ActivityIndicator.d.ts.map +1 -0
  210. package/lib/typescript/src/components/native/FlatList.d.ts +2 -0
  211. package/lib/typescript/src/components/native/FlatList.d.ts.map +1 -0
  212. package/lib/typescript/src/components/native/Image.d.ts +2 -0
  213. package/lib/typescript/src/components/native/Image.d.ts.map +1 -0
  214. package/lib/typescript/src/components/native/ImageBackground.d.ts +3 -0
  215. package/lib/typescript/src/components/native/ImageBackground.d.ts.map +1 -0
  216. package/lib/typescript/src/components/native/KeyboardAvoidingView.d.ts +2 -0
  217. package/lib/typescript/src/components/native/KeyboardAvoidingView.d.ts.map +1 -0
  218. package/lib/typescript/src/components/{Pressable.web.d.ts → native/Pressable.d.ts} +3 -2
  219. package/lib/typescript/src/components/native/Pressable.d.ts.map +1 -0
  220. package/lib/typescript/src/components/{Pressable.d.ts → native/Pressable.native.d.ts} +1 -3
  221. package/lib/typescript/src/components/native/Pressable.native.d.ts.map +1 -0
  222. package/lib/typescript/src/components/native/RefreshControl.d.ts +2 -0
  223. package/lib/typescript/src/components/native/RefreshControl.d.ts.map +1 -0
  224. package/lib/typescript/src/components/native/ScrollView.d.ts +2 -0
  225. package/lib/typescript/src/components/native/ScrollView.d.ts.map +1 -0
  226. package/lib/typescript/src/components/native/SectionList.d.ts +2 -0
  227. package/lib/typescript/src/components/native/SectionList.d.ts.map +1 -0
  228. package/lib/typescript/src/components/native/Switch.d.ts +2 -0
  229. package/lib/typescript/src/components/native/Switch.d.ts.map +1 -0
  230. package/lib/typescript/src/components/native/Text.d.ts +2 -0
  231. package/lib/typescript/src/components/native/Text.d.ts.map +1 -0
  232. package/lib/typescript/src/components/native/TextInput.d.ts +2 -0
  233. package/lib/typescript/src/components/native/TextInput.d.ts.map +1 -0
  234. package/lib/typescript/src/components/native/TouchableHighlight.d.ts +2 -0
  235. package/lib/typescript/src/components/native/TouchableHighlight.d.ts.map +1 -0
  236. package/lib/typescript/src/components/native/TouchableOpacity.d.ts +2 -0
  237. package/lib/typescript/src/components/native/TouchableOpacity.d.ts.map +1 -0
  238. package/lib/typescript/src/components/native/View.d.ts +2 -0
  239. package/lib/typescript/src/components/native/View.d.ts.map +1 -0
  240. package/lib/typescript/src/components/native/VirtualizedList.d.ts +2 -0
  241. package/lib/typescript/src/components/native/VirtualizedList.d.ts.map +1 -0
  242. package/lib/typescript/src/core/createUnistylesComponent.d.ts +9 -3
  243. package/lib/typescript/src/core/createUnistylesComponent.d.ts.map +1 -1
  244. package/lib/typescript/src/core/createUnistylesElement.d.ts +3 -0
  245. package/lib/typescript/src/core/createUnistylesElement.d.ts.map +1 -0
  246. package/lib/typescript/src/core/createUnistylesImageBackground.d.ts +4 -0
  247. package/lib/typescript/src/core/createUnistylesImageBackground.d.ts.map +1 -0
  248. package/lib/typescript/src/core/index.d.ts +4 -2
  249. package/lib/typescript/src/core/index.d.ts.map +1 -1
  250. package/lib/typescript/src/core/passForwardRef.d.ts +3 -0
  251. package/lib/typescript/src/core/passForwardRef.d.ts.map +1 -0
  252. package/lib/typescript/src/core/withUnistyles/index.d.ts +2 -0
  253. package/lib/typescript/src/core/withUnistyles/index.d.ts.map +1 -0
  254. package/lib/typescript/src/core/withUnistyles/types.d.ts +6 -0
  255. package/lib/typescript/src/core/withUnistyles/types.d.ts.map +1 -0
  256. package/lib/typescript/src/core/withUnistyles/useDependencies.d.ts +13 -0
  257. package/lib/typescript/src/core/withUnistyles/useDependencies.d.ts.map +1 -0
  258. package/lib/typescript/src/core/withUnistyles/withUnistyles.d.ts +11 -0
  259. package/lib/typescript/src/core/withUnistyles/withUnistyles.d.ts.map +1 -0
  260. package/lib/typescript/src/core/withUnistyles/withUnistyles.native.d.ts +8 -0
  261. package/lib/typescript/src/core/withUnistyles/withUnistyles.native.d.ts.map +1 -0
  262. package/lib/typescript/src/hooks/useMedia.d.ts +1 -1
  263. package/lib/typescript/src/hooks/useMedia.d.ts.map +1 -1
  264. package/lib/typescript/src/hooks/useMedia.native.d.ts +6 -0
  265. package/lib/typescript/src/hooks/useMedia.native.d.ts.map +1 -0
  266. package/lib/typescript/src/index.d.ts +3 -3
  267. package/lib/typescript/src/index.d.ts.map +1 -1
  268. package/lib/typescript/src/specs/ShadowRegistry/index.d.ts +7 -2
  269. package/lib/typescript/src/specs/ShadowRegistry/index.d.ts.map +1 -1
  270. package/lib/typescript/src/specs/ShadowRegistry/types.d.ts +17 -0
  271. package/lib/typescript/src/specs/ShadowRegistry/types.d.ts.map +1 -1
  272. package/lib/typescript/src/specs/index.d.ts +3 -11
  273. package/lib/typescript/src/specs/index.d.ts.map +1 -1
  274. package/lib/typescript/src/specs/index.native.d.ts +12 -0
  275. package/lib/typescript/src/specs/index.native.d.ts.map +1 -0
  276. package/lib/typescript/src/web/create.d.ts +1 -1441
  277. package/lib/typescript/src/web/create.d.ts.map +1 -1
  278. package/lib/typescript/src/web/index.d.ts +5 -1463
  279. package/lib/typescript/src/web/index.d.ts.map +1 -1
  280. package/lib/typescript/src/web/registry.d.ts +2 -3
  281. package/lib/typescript/src/web/registry.d.ts.map +1 -1
  282. package/lib/typescript/src/web/runtime.d.ts.map +1 -1
  283. package/lib/typescript/src/web/shadowRegistry.d.ts +11 -3
  284. package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -1
  285. package/lib/typescript/src/web/utils/unistyle.d.ts +1 -2
  286. package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -1
  287. package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Umbrella.hpp +3 -0
  288. package/package.json +20 -4
  289. package/plugin/common.js +4 -6
  290. package/plugin/import.js +63 -26
  291. package/plugin/index.js +48 -28
  292. package/plugin/ref.js +0 -234
  293. package/plugin/style.js +4 -317
  294. package/plugin/stylesheet.js +25 -10
  295. package/plugin/variants.js +60 -1
  296. package/src/components/ScopedTheme.tsx +32 -0
  297. package/src/components/Variants.tsx +30 -0
  298. package/src/components/index.ts +2 -1
  299. package/src/components/native/ActivityIndicator.tsx +4 -0
  300. package/src/components/native/FlatList.tsx +4 -0
  301. package/src/components/native/Image.tsx +4 -0
  302. package/src/components/native/ImageBackground.tsx +4 -0
  303. package/src/components/native/KeyboardAvoidingView.tsx +4 -0
  304. package/src/components/native/Pressable.native.tsx +57 -0
  305. package/src/components/native/Pressable.tsx +98 -0
  306. package/src/components/native/RefreshControl.tsx +4 -0
  307. package/src/components/native/ScrollView.tsx +4 -0
  308. package/src/components/native/SectionList.tsx +4 -0
  309. package/src/components/native/Switch.tsx +4 -0
  310. package/src/components/native/Text.tsx +4 -0
  311. package/src/components/native/TextInput.tsx +4 -0
  312. package/src/components/native/TouchableHighlight.tsx +4 -0
  313. package/src/components/native/TouchableOpacity.tsx +4 -0
  314. package/src/components/native/View.tsx +4 -0
  315. package/src/components/native/VirtualizedList.tsx +4 -0
  316. package/src/core/createUnistylesComponent.tsx +6 -76
  317. package/src/core/createUnistylesElement.tsx +9 -0
  318. package/src/core/createUnistylesImageBackground.tsx +24 -0
  319. package/src/core/index.ts +4 -2
  320. package/src/core/passForwardRef.ts +29 -0
  321. package/src/core/withUnistyles/index.ts +1 -0
  322. package/src/core/withUnistyles/types.ts +7 -0
  323. package/src/core/withUnistyles/useDependencies.ts +98 -0
  324. package/src/core/withUnistyles/withUnistyles.native.tsx +97 -0
  325. package/src/core/withUnistyles/withUnistyles.tsx +90 -0
  326. package/src/hooks/useMedia.native.ts +65 -0
  327. package/src/hooks/useMedia.ts +19 -36
  328. package/src/index.ts +3 -3
  329. package/src/specs/ShadowRegistry/index.ts +14 -5
  330. package/src/specs/ShadowRegistry/types.ts +18 -1
  331. package/src/specs/index.native.ts +27 -0
  332. package/src/specs/index.ts +3 -27
  333. package/src/web/create.ts +11 -32
  334. package/src/web/index.ts +8 -4
  335. package/src/web/registry.ts +15 -6
  336. package/src/web/runtime.ts +3 -1
  337. package/src/web/shadowRegistry.ts +59 -51
  338. package/src/web/utils/unistyle.ts +2 -3
  339. package/lib/commonjs/components/Pressable.js +0 -74
  340. package/lib/commonjs/components/Pressable.js.map +0 -1
  341. package/lib/commonjs/components/Pressable.web.js.map +0 -1
  342. package/lib/commonjs/core/createUnistylesComponent.native.js +0 -82
  343. package/lib/commonjs/core/createUnistylesComponent.native.js.map +0 -1
  344. package/lib/commonjs/core/getBoundArgs.js +0 -18
  345. package/lib/commonjs/core/getBoundArgs.js.map +0 -1
  346. package/lib/commonjs/core/getId.js +0 -9
  347. package/lib/commonjs/core/getId.js.map +0 -1
  348. package/lib/commonjs/hooks/useMedia.web.js +0 -43
  349. package/lib/commonjs/hooks/useMedia.web.js.map +0 -1
  350. package/lib/commonjs/specs/index.web.js +0 -17
  351. package/lib/commonjs/specs/index.web.js.map +0 -1
  352. package/lib/module/components/Pressable.js +0 -68
  353. package/lib/module/components/Pressable.js.map +0 -1
  354. package/lib/module/components/Pressable.web.js +0 -109
  355. package/lib/module/components/Pressable.web.js.map +0 -1
  356. package/lib/module/core/createUnistylesComponent.native.js +0 -75
  357. package/lib/module/core/createUnistylesComponent.native.js.map +0 -1
  358. package/lib/module/core/getBoundArgs.js +0 -13
  359. package/lib/module/core/getBoundArgs.js.map +0 -1
  360. package/lib/module/core/getId.js +0 -4
  361. package/lib/module/core/getId.js.map +0 -1
  362. package/lib/module/hooks/useMedia.web.js +0 -38
  363. package/lib/module/hooks/useMedia.web.js.map +0 -1
  364. package/lib/module/specs/index.web.js +0 -4
  365. package/lib/module/specs/index.web.js.map +0 -1
  366. package/lib/typescript/src/components/Pressable.d.ts.map +0 -1
  367. package/lib/typescript/src/components/Pressable.web.d.ts.map +0 -1
  368. package/lib/typescript/src/core/createUnistylesComponent.native.d.ts +0 -8
  369. package/lib/typescript/src/core/createUnistylesComponent.native.d.ts.map +0 -1
  370. package/lib/typescript/src/core/getBoundArgs.d.ts +0 -2
  371. package/lib/typescript/src/core/getBoundArgs.d.ts.map +0 -1
  372. package/lib/typescript/src/core/getId.d.ts +0 -2
  373. package/lib/typescript/src/core/getId.d.ts.map +0 -1
  374. package/lib/typescript/src/hooks/useMedia.web.d.ts +0 -6
  375. package/lib/typescript/src/hooks/useMedia.web.d.ts.map +0 -1
  376. package/lib/typescript/src/specs/index.web.d.ts +0 -2
  377. package/lib/typescript/src/specs/index.web.d.ts.map +0 -1
  378. package/src/components/Pressable.tsx +0 -89
  379. package/src/components/Pressable.web.tsx +0 -129
  380. package/src/core/createUnistylesComponent.native.tsx +0 -83
  381. package/src/core/getBoundArgs.ts +0 -15
  382. package/src/core/getId.ts +0 -1
  383. package/src/hooks/useMedia.web.ts +0 -47
  384. 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,59 @@ 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
+ unistyleData->parsedStyle = std::move(unistyleData->unistyle->rawValue);
172
+
173
+ return;
174
+ }
175
+
176
+ if (unistyleData->unistyle->type == UnistyleType::Object) {
177
+ unistyleData->parsedStyle = this->parseFirstLevel(rt, unistyleData->unistyle, unistyleData->variants);
178
+
179
+ return;
180
+ }
181
+
182
+ // for functions we need to call them with memoized arguments
183
+ auto unistyleFn = std::dynamic_pointer_cast<UnistyleDynamicFunction>(unistyleData->unistyle);
184
+
185
+ // convert arguments to jsi::Value
186
+ std::vector<jsi::Value> args{};
187
+ auto arguments = unistyleData->dynamicFunctionMetadata.value();
95
188
 
96
- this->rebuildUnistyle(rt, styleSheet, unistyle, variants, std::nullopt);
189
+ args.reserve(arguments.size());
190
+
191
+ for (int i = 0; i < arguments.size(); i++) {
192
+ folly::dynamic& arg = arguments.at(i);
193
+
194
+ args.emplace_back(jsi::valueFromDynamic(rt, arg));
97
195
  }
196
+
197
+ const jsi::Value *argStart = args.data();
198
+
199
+ // we need to temporarly swap unprocessed value to enforce correct parings
200
+ auto sharedUnprocessedValue = std::move(unistyleFn->unprocessedValue);
201
+
202
+ // call cached function with memoized arguments
203
+ auto functionResult = unistyleFn->rawValue
204
+ .asFunction(rt)
205
+ .call(rt, argStart, arguments.size())
206
+ .asObject(rt);
207
+
208
+ unistyleFn->unprocessedValue = std::move(functionResult);
209
+ unistyleData->parsedStyle = this->parseFirstLevel(rt, unistyleFn, unistyleData->variants);
210
+ unistyleFn->unprocessedValue = std::move(sharedUnprocessedValue);
98
211
  }
99
212
 
100
213
  // rebuild all unistyles that are affected by platform event
101
214
  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{};
215
+ std::unordered_map<std::shared_ptr<StyleSheet>, jsi::Value> parsedStyleSheetsWithDefaultTheme{};
216
+ std::unordered_map<std::string, std::unordered_map<std::shared_ptr<StyleSheet>, jsi::Value>> parsedStyleSheetsWithScopedTheme{};
103
217
  std::unordered_map<std::shared_ptr<core::Unistyle>, bool> parsedUnistyles{};
104
218
 
105
219
  // parse all stylesheets that depends on changes
106
220
  for (auto styleSheet : styleSheets) {
107
- parsedStyleSheets.emplace(styleSheet, this->unwrapStyleSheet(rt, styleSheet, maybeMiniRuntime));
221
+ parsedStyleSheetsWithDefaultTheme.emplace(styleSheet, this->unwrapStyleSheet(rt, styleSheet, maybeMiniRuntime));
108
222
  }
109
223
 
110
224
  // then parse all visible Unistyles managed by Unistyle
@@ -112,8 +226,8 @@ void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, Dependenc
112
226
  auto styleSheet = unistyles.begin()->get()->unistyle->parent;
113
227
 
114
228
  // stylesheet may be optional for exotic unistyles
115
- if (styleSheet != nullptr && !parsedStyleSheets.contains(styleSheet)) {
116
- parsedStyleSheets.emplace(styleSheet, this->unwrapStyleSheet(rt, styleSheet, maybeMiniRuntime));
229
+ if (styleSheet != nullptr && !parsedStyleSheetsWithDefaultTheme.contains(styleSheet)) {
230
+ parsedStyleSheetsWithDefaultTheme.emplace(styleSheet, this->unwrapStyleSheet(rt, styleSheet, maybeMiniRuntime));
117
231
  }
118
232
 
119
233
  for (auto& unistyleData : unistyles) {
@@ -136,18 +250,60 @@ void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, Dependenc
136
250
  auto unistyleStyleSheet = unistyle->parent;
137
251
 
138
252
  // 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));
253
+ if (unistyleStyleSheet != nullptr && !parsedStyleSheetsWithDefaultTheme.contains(unistyleStyleSheet)) {
254
+ parsedStyleSheetsWithDefaultTheme.emplace(unistyleStyleSheet, this->unwrapStyleSheet(rt, unistyleStyleSheet, maybeMiniRuntime));
141
255
  }
142
256
 
143
257
  // StyleSheet might have styles that are not affected
144
- if (!parsedStyleSheets[unistyleStyleSheet].asObject(rt).hasProperty(rt, unistyle->styleKey.c_str())) {
258
+ if (!parsedStyleSheetsWithDefaultTheme[unistyleStyleSheet].asObject(rt).hasProperty(rt, unistyle->styleKey.c_str())) {
145
259
  continue;
146
260
  }
147
261
 
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);
262
+ // for scoped themes we need to parse unistyle exclusively
263
+ if (unistyleData->scopedTheme.has_value()) {
264
+ std::vector<folly::dynamic> arguments = {};
265
+
266
+ if (unistyleData->dynamicFunctionMetadata.has_value()) {
267
+ arguments = unistyleData->dynamicFunctionMetadata.value();
268
+ }
269
+
270
+ auto parsedStyleSheet = jsi::Value::undefined();
271
+ auto scopedThemeName = unistyleData->scopedTheme.value();
272
+
273
+ // check if we have theme in cache
274
+ if (parsedStyleSheetsWithScopedTheme.contains(scopedThemeName)) {
275
+ if (parsedStyleSheetsWithScopedTheme[scopedThemeName].contains(unistyle->parent)) {
276
+ parsedStyleSheet = jsi::Value(rt, parsedStyleSheetsWithScopedTheme[scopedThemeName][unistyle->parent]);
277
+ }
278
+ }
279
+
280
+ // if not, let's build it
281
+ if (parsedStyleSheet.isUndefined()) {
282
+ parsedStyleSheet = this->getParsedStyleSheetForScopedTheme(rt, unistyle, unistyleData->scopedTheme.value());
283
+
284
+ if (!parsedStyleSheetsWithScopedTheme.contains(scopedThemeName)) {
285
+ parsedStyleSheetsWithScopedTheme.emplace(
286
+ scopedThemeName,
287
+ std::unordered_map<std::shared_ptr<StyleSheet>, jsi::Value>{}
288
+ );
289
+ }
290
+
291
+ parsedStyleSheetsWithScopedTheme[scopedThemeName].emplace(
292
+ unistyle->parent,
293
+ jsi::Value(rt, parsedStyleSheet)
294
+ );
295
+ }
296
+
297
+ this->rebuildUnistyleWithScopedTheme(
298
+ rt,
299
+ parsedStyleSheet,
300
+ unistyleData
301
+ );
302
+ } else {
303
+ unistyle->rawValue = parsedStyleSheetsWithDefaultTheme[unistyleStyleSheet].asObject(rt).getProperty(rt, unistyle->styleKey.c_str()).asObject(rt);
304
+ this->rebuildUnistyle(rt, unistyleStyleSheet, unistyle, unistyleData->variants, unistyleData->dynamicFunctionMetadata);
305
+ unistyleData->parsedStyle = jsi::Value(rt, unistyle->parsedStyle.value()).asObject(rt);
306
+ }
151
307
 
152
308
  if (!parsedUnistyles.contains(unistyle)) {
153
309
  parsedUnistyles.emplace(unistyle, true);
@@ -160,7 +316,7 @@ void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, Dependenc
160
316
  for (auto styleSheet : styleSheets) {
161
317
  for (auto& [_, unistyle] : styleSheet->unistyles) {
162
318
  if (!parsedUnistyles.contains(unistyle)) {
163
- unistyle->rawValue = parsedStyleSheets[styleSheet].asObject(rt).getProperty(rt, unistyle->styleKey.c_str()).asObject(rt);
319
+ unistyle->rawValue = parsedStyleSheetsWithDefaultTheme[styleSheet].asObject(rt).getProperty(rt, unistyle->styleKey.c_str()).asObject(rt);
164
320
  }
165
321
  }
166
322
  }
@@ -317,7 +473,7 @@ jsi::Object parser::Parser::parseFirstLevel(jsi::Runtime& rt, Unistyle::Shared u
317
473
  parsedStyle.setProperty(rt, jsi::PropNameID::forUtf8(rt, propertyName), this->parseSecondLevel(rt, unistyle, valueFromBreakpoint));
318
474
  });
319
475
 
320
- if (shouldParseVariants && variants.has_value() && !variants.value().empty()) {
476
+ if (shouldParseVariants && variants.has_value()) {
321
477
  auto propertyValueObject = style.getProperty(rt, "variants").asObject(rt);
322
478
  auto parsedVariant = this->parseVariants(rt, unistyle, propertyValueObject, variants.value());
323
479
 
@@ -347,12 +503,12 @@ jsi::Function parser::Parser::createDynamicFunctionProxy(jsi::Runtime& rt, Unist
347
503
  ? thisVal.asObject(rt)
348
504
  : jsi::Object(rt);
349
505
  auto parser = parser::Parser(unistylesRuntime);
350
-
351
506
  // call user function
352
507
  auto result = unistyle->rawValue.asFunction(rt).call(rt, args, count);
353
508
 
354
509
  // memoize metadata to call it later
355
510
  auto unistyleFn = std::dynamic_pointer_cast<UnistyleDynamicFunction>(unistyle);
511
+ auto& registry = core::UnistylesRegistry::get();
356
512
 
357
513
  unistyleFn->unprocessedValue = jsi::Value(rt, result).asObject(rt);
358
514
 
@@ -360,7 +516,7 @@ jsi::Function parser::Parser::createDynamicFunctionProxy(jsi::Runtime& rt, Unist
360
516
  ? thisObject.getProperty(rt, helpers::STYLE_VARIANTS.c_str())
361
517
  : jsi::Value::undefined();
362
518
  std::optional<Variants> variants = rawVariants.isUndefined()
363
- ? std::nullopt
519
+ ? registry.getScopedVariants()
364
520
  : std::optional<Variants>(helpers::variantsToPairs(rt, rawVariants.asObject(rt)));
365
521
 
366
522
  unistyleFn->parsedStyle = this->parseFirstLevel(rt, unistyleFn, variants);
@@ -371,13 +527,15 @@ jsi::Function parser::Parser::createDynamicFunctionProxy(jsi::Runtime& rt, Unist
371
527
  // include dependencies for createUnistylesComponent
372
528
  style.setProperty(rt, "__proto__", generateUnistylesPrototype(rt, unistylesRuntime, unistyle, variants, helpers::functionArgumentsToArray(rt, args, count)));
373
529
 
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]);
530
+ jsi::Object secrets = jsi::Object(rt);
531
+
532
+ secrets.setProperty(rt, helpers::ARGUMENTS.c_str(), helpers::functionArgumentsToArray(rt, args, count));
533
+
534
+ helpers::defineHiddenProperty(rt, style, helpers::SECRETS.c_str(), secrets);
535
+
536
+ auto wrappedUnistyle = std::make_shared<UnistyleWrapper>(unistyle);
379
537
 
380
- registry.shadowLeafUpdateFromUnistyle(rt, unistyle, lastArg);
538
+ style.setNativeState(rt, std::move(wrappedUnistyle));
381
539
 
382
540
  return style;
383
541
  });
@@ -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,36 @@
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 previousScopedVariants = _specs.UnistylesShadowRegistry.getVariants();
26
+ const mappedChildren = [/*#__PURE__*/(0, _jsxRuntime.jsx)(Apply, {
27
+ variants: variants
28
+ }, 'add'), children, /*#__PURE__*/(0, _jsxRuntime.jsx)(Apply, {
29
+ variants: previousScopedVariants
30
+ }, 'remove')];
31
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
32
+ children: mappedChildren
33
+ });
34
+ };
35
+ exports.Variants = Variants;
36
+ //# 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","previousScopedVariants","getVariants","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,sBAAsB,GAAGL,8BAAuB,CAACM,WAAW,CAAC,CAAC;EACpE,MAAMC,cAAc,GAAG,cACnB,IAAA9B,WAAA,CAAA+B,GAAA,EAACV,KAAK;IAAWC,QAAQ,EAAEA;EAAS,GAAzB,KAA2B,CAAC,EACvCK,QAAQ,eACR,IAAA3B,WAAA,CAAA+B,GAAA,EAACV,KAAK;IAAcC,QAAQ,EAAEM;EAAuB,GAA1C,QAA4C,CAAC,CAC3D;EAED,oBACI,IAAA5B,WAAA,CAAA+B,GAAA,EAACnC,MAAA,CAAAW,OAAK,CAACyB,QAAQ;IAAAL,QAAA,EACVG;EAAc,CACH,CAAC;AAEzB,CAAC;AAAAG,OAAA,CAAAP,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":[]}