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
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.Pressable = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
- var _specs = require("../specs");
9
+ var _specs = require("../../specs");
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
11
  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); }
12
12
  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; }
@@ -15,95 +15,55 @@ const initialState = {
15
15
  hovered: false,
16
16
  focused: false
17
17
  };
18
- const events = {
19
- 'pointerdown': {
20
- pressed: true
21
- },
22
- 'pointerup': {
23
- pressed: false
24
- },
25
- 'pointerenter': {
26
- hovered: true
27
- },
28
- 'pointerleave': {
29
- hovered: false
30
- },
31
- 'focus': {
32
- focused: true
33
- },
34
- 'blur': {
35
- focused: false
36
- }
37
- };
38
- const isFunctionWithBoundArgs = fn => {
39
- return typeof fn === 'function' && 'getBoundArgs' in fn;
40
- };
41
- const extractFunctionArgs = styleResult => {
42
- return isFunctionWithBoundArgs(styleResult) ? [styleResult.getBoundArgs()] : Array.isArray(styleResult) ? styleResult.map(style => isFunctionWithBoundArgs(style) ? style.getBoundArgs() : []) : [];
43
- };
44
18
  const extractStyleResult = style => {
45
19
  return typeof style === 'function' ? [style()] : Array.isArray(style) ? style.map(style => typeof style === 'function' ? style() : style) : [style];
46
20
  };
47
21
  const updateStyles = ({
48
22
  ref,
49
23
  style,
50
- variants,
51
- state
24
+ state,
25
+ scopedTheme,
26
+ variants
52
27
  }) => {
53
28
  const styleResult = typeof style === 'function' ? style(state) : style;
54
- const fnArgs = extractFunctionArgs(styleResult);
55
29
  const extractedResult = extractStyleResult(styleResult);
56
-
57
- // @ts-expect-error - this is hidden from TS
58
- _specs.UnistylesShadowRegistry.add(ref, extractedResult, variants, fnArgs);
30
+ const previousScopedTheme = _specs.UnistylesShadowRegistry.getScopedTheme();
31
+ const previousVariants = _specs.UnistylesShadowRegistry.getVariants();
32
+ _specs.UnistylesShadowRegistry.selectVariants(variants);
33
+ _specs.UnistylesShadowRegistry.setScopedTheme(scopedTheme);
34
+ _specs.UnistylesShadowRegistry.add(ref, extractedResult);
35
+ _specs.UnistylesShadowRegistry.setScopedTheme(previousScopedTheme);
36
+ _specs.UnistylesShadowRegistry.selectVariants(previousVariants);
59
37
  };
60
38
  const Pressable = exports.Pressable = /*#__PURE__*/(0, _react.forwardRef)(({
61
- variants,
62
39
  style,
63
40
  ...props
64
41
  }, passedRef) => {
65
42
  const storedRef = (0, _react.useRef)(null);
66
- const state = (0, _react.useRef)(initialState);
67
- const styleRef = (0, _react.useRef)(style);
68
- (0, _react.useEffect)(() => {
69
- styleRef.current = style;
70
- }, [style]);
71
- (0, _react.useEffect)(() => {
72
- const handler = newState => () => {
73
- state.current = {
74
- ...state.current,
75
- ...newState
76
- };
43
+ const scopedTheme = _specs.UnistylesShadowRegistry.getScopedTheme();
44
+ const variants = _specs.UnistylesShadowRegistry.getVariants();
45
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
46
+ ...props,
47
+ style: state => {
48
+ if (!storedRef.current) {
49
+ return {};
50
+ }
77
51
  updateStyles({
78
52
  ref: storedRef.current,
79
- style: styleRef.current,
53
+ style: style,
80
54
  variants,
81
- state: state.current
82
- });
83
- };
84
- if (!storedRef.current) {
85
- return;
86
- }
87
-
88
- // ref on the web is dom element
89
- const ref = storedRef.current;
90
- Object.entries(events).forEach(([event, state]) => {
91
- ref.addEventListener(event, handler(state));
92
- });
93
- return () => {
94
- Object.entries(events).forEach(([event, state]) => {
95
- ref.removeEventListener(event, handler(state));
55
+ scopedTheme,
56
+ state: state
96
57
  });
97
- };
98
- }, []);
99
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
100
- ...props,
58
+ return {};
59
+ },
101
60
  ref: ref => {
102
61
  storedRef.current = ref;
103
62
  updateStyles({
104
63
  ref,
105
64
  style: style,
106
65
  variants,
66
+ scopedTheme,
107
67
  state: initialState
108
68
  });
109
69
  if (typeof passedRef === 'object' && passedRef !== null) {
@@ -112,4 +72,4 @@ const Pressable = exports.Pressable = /*#__PURE__*/(0, _react.forwardRef)(({
112
72
  }
113
73
  });
114
74
  });
115
- //# sourceMappingURL=Pressable.web.js.map
75
+ //# sourceMappingURL=Pressable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_specs","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","initialState","pressed","hovered","focused","extractStyleResult","style","Array","isArray","map","updateStyles","ref","state","scopedTheme","variants","styleResult","extractedResult","previousScopedTheme","UnistylesShadowRegistry","getScopedTheme","previousVariants","getVariants","selectVariants","setScopedTheme","add","Pressable","exports","forwardRef","props","passedRef","storedRef","useRef","jsx","current"],"sourceRoot":"../../../../src","sources":["components/native/Pressable.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAAqD,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAI,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,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA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b,CAAE;IACFD,GAAG,EAAEA,GAAG,IAAI;MACRmB,SAAS,CAACG,OAAO,GAAGtB,GAAG;MACvBD,YAAY,CAAC;QACTC,GAAG;QACHL,KAAK,EAAEA,KAA0B;QACjCQ,QAAQ;QACRD,WAAW;QACXD,KAAK,EAAEX;MACX,CAAC,CAAC;MAEF,IAAI,OAAO4B,SAAS,KAAK,QAAQ,IAAIA,SAAS,KAAK,IAAI,EAAE;QACrDA,SAAS,CAACI,OAAO,GAAGtB,GAAG;MAC3B;IACJ;EAAE,CACL,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Pressable = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _specs = require("../../specs");
10
+ var _core = require("../../core");
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ 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); }
13
+ 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; }
14
+ const Pressable = exports.Pressable = /*#__PURE__*/(0, _react.forwardRef)(({
15
+ variants,
16
+ style,
17
+ ...props
18
+ }, forwardedRef) => {
19
+ const storedRef = (0, _react.useRef)();
20
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
21
+ ...props,
22
+ ref: ref => {
23
+ const unistyles = typeof style === 'function' ? style({
24
+ pressed: false
25
+ }) : style;
26
+ const styles = Array.isArray(unistyles) ? unistyles : [unistyles];
27
+
28
+ // @ts-expect-error - this is hidden from TS
29
+ _specs.UnistylesShadowRegistry.add(ref, styles);
30
+ storedRef.current = ref;
31
+ return (0, _core.passForwardedRef)(props, ref, forwardedRef);
32
+ },
33
+ style: state => {
34
+ _specs.UnistylesShadowRegistry.selectVariants(variants);
35
+ const unistyles = typeof style === 'function' ? style(state) : style;
36
+ const styles = Array.isArray(unistyles) ? unistyles : [unistyles];
37
+ if (storedRef.current) {
38
+ // @ts-expect-error - this is hidden from TS
39
+ _specs.UnistylesShadowRegistry.remove(storedRef.current);
40
+ // @ts-expect-error - this is hidden from TS
41
+ _specs.UnistylesShadowRegistry.add(storedRef.current, styles);
42
+ }
43
+ _specs.UnistylesShadowRegistry.selectVariants(undefined);
44
+ return unistyles;
45
+ }
46
+ });
47
+ });
48
+ //# sourceMappingURL=Pressable.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_specs","_core","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Pressable","exports","forwardRef","variants","style","props","forwardedRef","storedRef","useRef","jsx","ref","unistyles","pressed","styles","Array","isArray","UnistylesShadowRegistry","add","current","passForwardedRef","state","selectVariants","remove","undefined"],"sourceRoot":"../../../../src","sources":["components/native/Pressable.native.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAA6C,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,I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AA,CAAA8B,GAAA,EAACjC,YAAA,CAAAwB,SAA0B;IAAA,GACnBK,KAAK;IACTK,GAAG,EAAEA,GAAG,IAAI;MACR,MAAMC,SAAS,GAAG,OAAOP,KAAK,KAAK,UAAU,GACvCA,KAAK,CAAC;QAAEQ,OAAO,EAAE;MAAM,CAAC,CAAC,GACzBR,KAAK;MACX,MAAMS,MAAM,GAAGC,KAAK,CAACC,OAAO,CAACJ,SAAS,CAAC,GACjCA,SAAS,GACT,CAACA,SAAS,CAAC;;MAEjB;MACAK,8BAAuB,CAACC,GAAG,CAACP,GAAG,EAAEG,MAAM,CAAC;MAExCN,SAAS,CAACW,OAAO,GAAGR,GAAG;MAEvB,OAAO,IAAAS,sBAAgB,EAACd,KAAK,EAAEK,GAAG,EAAEJ,YAAY,CAAC;IACrD,CAAE;IACFF,KAAK,EAAEgB,KAAK,IAAI;MACZJ,8BAAuB,CAACK,cAAc,CAAClB,QAAQ,CAAC;MAEhD,MAAMQ,SAAS,GAAG,OAAOP,KAAK,KAAK,UAAU,GACvCA,KAAK,CAACgB,KAAK,CAAC,GACZhB,KAAK;MACX,MAAMS,MAAM,GAAGC,KAAK,CAACC,OAAO,CAACJ,SAAS,CAAC,GACjCA,SAAS,GACT,CAACA,SAAS,CAAC;MAEjB,IAAIJ,SAAS,CAACW,OAAO,EAAE;QACnB;QACAF,8BAAuB,CAACM,MAAM,CAACf,SAAS,CAACW,OAAO,CAAC;QACjD;QACAF,8BAAuB,CAACC,GAAG,CAACV,SAAS,CAACW,OAAO,EAAEL,MAAM,CAAC;MAC1D;MAEAG,8BAAuB,CAACK,cAAc,CAACE,SAAS,CAAC;MAEjD,OAAOZ,SAAS;IACpB;EAAE,CACL,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.RefreshControl = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _core = require("../../core");
9
+ const RefreshControl = exports.RefreshControl = (0, _core.createUnistylesElement)(_reactNative.RefreshControl);
10
+ //# sourceMappingURL=RefreshControl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_core","RefreshControl","exports","createUnistylesElement","NativeRefreshControl"],"sourceRoot":"../../../../src","sources":["components/native/RefreshControl.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,IAAAE,4BAAsB,EAACC,2BAAoB,CAAC","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ScrollView = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _core = require("../../core");
9
+ const ScrollView = exports.ScrollView = (0, _core.createUnistylesElement)(_reactNative.ScrollView);
10
+ //# sourceMappingURL=ScrollView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_core","ScrollView","exports","createUnistylesElement","NativeScrollView"],"sourceRoot":"../../../../src","sources":["components/native/ScrollView.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,IAAAE,4BAAsB,EAACC,uBAAgB,CAAC","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SectionList = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _core = require("../../core");
9
+ const SectionList = exports.SectionList = (0, _core.createUnistylesElement)(_reactNative.SectionList);
10
+ //# sourceMappingURL=SectionList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_core","SectionList","exports","createUnistylesElement","NativeSectionList"],"sourceRoot":"../../../../src","sources":["components/native/SectionList.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,IAAAE,4BAAsB,EAACC,wBAAiB,CAAC","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Switch = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _core = require("../../core");
9
+ const Switch = exports.Switch = (0, _core.createUnistylesElement)(_reactNative.Switch);
10
+ //# sourceMappingURL=Switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_core","Switch","exports","createUnistylesElement","NativeSwitch"],"sourceRoot":"../../../../src","sources":["components/native/Switch.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAG,IAAAE,4BAAsB,EAACC,mBAAY,CAAC","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Text = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _core = require("../../core");
9
+ const Text = exports.Text = (0, _core.createUnistylesElement)(_reactNative.Text);
10
+ //# sourceMappingURL=Text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_core","Text","exports","createUnistylesElement","NativeText"],"sourceRoot":"../../../../src","sources":["components/native/Text.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG,IAAAE,4BAAsB,EAACC,iBAAU,CAAC","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TextInput = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _core = require("../../core");
9
+ const TextInput = exports.TextInput = (0, _core.createUnistylesElement)(_reactNative.TextInput);
10
+ //# sourceMappingURL=TextInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_core","TextInput","exports","createUnistylesElement","NativeTextInput"],"sourceRoot":"../../../../src","sources":["components/native/TextInput.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAE,4BAAsB,EAACC,sBAAe,CAAC","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TouchableHighlight = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _core = require("../../core");
9
+ const TouchableHighlight = exports.TouchableHighlight = (0, _core.createUnistylesElement)(_reactNative.TouchableHighlight);
10
+ //# sourceMappingURL=TouchableHighlight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_core","TouchableHighlight","exports","createUnistylesElement","NativeTouchableHighlight"],"sourceRoot":"../../../../src","sources":["components/native/TouchableHighlight.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,IAAAE,4BAAsB,EAACC,+BAAwB,CAAC","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TouchableOpacity = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _core = require("../../core");
9
+ const TouchableOpacity = exports.TouchableOpacity = (0, _core.createUnistylesElement)(_reactNative.TouchableOpacity);
10
+ //# sourceMappingURL=TouchableOpacity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_core","TouchableOpacity","exports","createUnistylesElement","NativeTouchableOpacity"],"sourceRoot":"../../../../src","sources":["components/native/TouchableOpacity.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,IAAAE,4BAAsB,EAACC,6BAAsB,CAAC","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.View = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _core = require("../../core");
9
+ const View = exports.View = (0, _core.createUnistylesElement)(_reactNative.View);
10
+ //# sourceMappingURL=View.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_core","View","exports","createUnistylesElement","NativeView"],"sourceRoot":"../../../../src","sources":["components/native/View.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG,IAAAE,4BAAsB,EAACC,iBAAU,CAAC","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VirtualizedList = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _core = require("../../core");
9
+ const VirtualizedList = exports.VirtualizedList = (0, _core.createUnistylesElement)(_reactNative.VirtualizedList);
10
+ //# sourceMappingURL=VirtualizedList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_core","VirtualizedList","exports","createUnistylesElement","NativeVirtualizedList"],"sourceRoot":"../../../../src","sources":["components/native/VirtualizedList.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEO,MAAME,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,IAAAE,4BAAsB,EAACC,4BAAqB,CAAC","ignoreList":[]}
@@ -4,76 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.createUnistylesComponent = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _specs = require("../specs");
9
- var _NativePlatform = require("../specs/NativePlatform");
10
- var _listener = require("../web/listener");
11
- var _web = require("../web");
12
- var _utils = require("../web/utils");
13
- var _utils2 = require("../utils");
14
- var _jsxRuntime = require("react/jsx-runtime");
15
- 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); }
16
- 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; }
7
+ var _withUnistyles = require("./withUnistyles");
17
8
  const SUPPORTED_STYLE_PROPS = ['style', 'contentContainerStyle'];
18
- const ALL_DEPENDENCIES = Object.values(_NativePlatform.UnistyleDependency).filter(dependency => typeof dependency === 'number');
19
- const useShadowRegistry = style => {
20
- const [ref] = (0, _react.useState)(document.createElement('div'));
21
- const oldClassNames = (0, _react.useRef)([]);
22
- const classNames = (0, _react.useMemo)(() => {
23
- if (!style) {
24
- return [];
25
- }
26
- const newClassNames = _web.UnistylesShadowRegistry.add(ref, [style], undefined, []) ?? [];
27
- if ((0, _utils.equal)(oldClassNames.current, newClassNames)) {
28
- return oldClassNames.current;
29
- }
30
- oldClassNames.current = newClassNames;
31
- return newClassNames;
32
- }, [style]);
33
- (0, _react.useEffect)(() => () => {
34
- // Remove styles on unmount
35
- if (style) {
36
- _web.UnistylesShadowRegistry.add(null, [style], undefined, []);
37
- }
38
- });
39
- return classNames;
40
- };
9
+ /**
10
+ * @deprecated Use withUnistyles instead
11
+ */
41
12
  const createUnistylesComponent = (Component, mappings) => {
42
- return /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
43
- const narrowedProps = props;
44
- const [mappingsProps, setMappingsProps] = (0, _react.useState)(mappings?.(_specs.UnistylesRuntime.getTheme()));
45
- const styleClassNames = useShadowRegistry(narrowedProps.style);
46
- const contentContainerStyleClassNames = useShadowRegistry(narrowedProps.contentContainerStyle);
47
- (0, _react.useEffect)(() => {
48
- const disposeMappings = _listener.UnistylesListener.addListeners(ALL_DEPENDENCIES, () => {
49
- if (!mappings) {
50
- disposeMappings();
51
- return;
52
- }
53
- return setMappingsProps(mappings(_specs.UnistylesRuntime.getTheme()));
54
- });
55
- return () => disposeMappings();
56
- }, [mappingsProps, narrowedProps.style]);
57
- const combinedProps = {
58
- ...(0, _utils2.deepMergeObjects)(props, mappingsProps ?? {}),
59
- ...(narrowedProps.style ? {
60
- style: {
61
- $$css: true,
62
- 'unistyles': styleClassNames.join(' ')
63
- }
64
- } : {}),
65
- ...(narrowedProps.contentContainerStyle ? {
66
- style: {
67
- $$css: true,
68
- 'unistyles': contentContainerStyleClassNames.join(' ')
69
- }
70
- } : {})
71
- };
72
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
73
- ...combinedProps,
74
- ref: ref
75
- });
76
- });
13
+ return (0, _withUnistyles.withUnistyles)(Component, mappings);
77
14
  };
78
15
  exports.createUnistylesComponent = createUnistylesComponent;
79
16
  //# sourceMappingURL=createUnistylesComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_specs","_NativePlatform","_listener","_web","_utils","_utils2","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","SUPPORTED_STYLE_PROPS","ALL_DEPENDENCIES","values","UnistyleDependency","filter","dependency","useShadowRegistry","style","ref","useState","document","createElement","oldClassNames","useRef","classNames","useMemo","newClassNames","UnistylesShadowRegistry","add","undefined","equal","current","useEffect","createUnistylesComponent","Component","mappings","forwardRef","props","narrowedProps","mappingsProps","setMappingsProps","UnistylesRuntime","getTheme","styleClassNames","contentContainerStyleClassNames","contentContainerStyle","disposeMappings","UnistylesListener","addListeners","combinedProps","deepMergeObjects","$$css","join","jsx","exports"],"sourceRoot":"../../../src","sources":["core/createUnistylesComponent.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAA2C,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAQ,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,SAAAV,wBAAAU,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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AC;MAEF,OAAO,MAAMI,eAAe,CAAC,CAAC;IAClC,CAAC,EAAE,CAACP,aAAa,EAAED,aAAa,CAACrB,KAAK,CAAC,CAAC;IAExC,MAAMgC,aAAa,GAAG;MAClB,GAAG,IAAAC,wBAAgB,EAACb,KAAK,EAAGE,aAAa,IAAI,CAAC,CAAY,CAAC;MAC3D,IAAGD,aAAa,CAACrB,KAAK,GAAG;QACrBA,KAAK,EAAE;UACHkC,KAAK,EAAE,IAAI;UACX,WAAW,EAAER,eAAe,CAACS,IAAI,CAAC,GAAG;QACzC;MACJ,CAAC,GAAG,CAAC,CAAC;MACN,IAAGd,aAAa,CAACO,qBAAqB,GAAG;QACrC5B,KAAK,EAAE;UACHkC,KAAK,EAAE,IAAI;UACX,WAAW,EAAEP,+BAA+B,CAACQ,IAAI,CAAC,GAAG;QACzD;MACJ,CAAC,GAAG,CAAC,CAAC;IACV,CAAsB;IAEtB,oBAAO,IAAA/D,WAAA,CAAAgE,GAAA,EAACnB,SAAS;MAAA,GAAKe,aAAa;MAAE/B,GAAG,EAAEA;IAAI,CAAE,CAAC;EACrD,CAAC,CAAC;AACN,CAAC;AAAAoC,OAAA,CAAArB,wBAAA,GAAAA,wBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_withUnistyles","require","SUPPORTED_STYLE_PROPS","createUnistylesComponent","Component","mappings","withUnistyles","exports"],"sourceRoot":"../../../src","sources":["core/createUnistylesComponent.tsx"],"mappings":";;;;;;AAEA,IAAAA,cAAA,GAAAC,OAAA;AAEA,MAAMC,qBAAqB,GAAG,CAAC,OAAO,EAAE,uBAAuB,CAAU;AAIzE;AACA;AACA;AACO,MAAMC,wBAAwB,GAAGA,CAAmGC,SAAgC,EAAEC,QAA+C,KAAK;EAC7N,OAAO,IAAAC,4BAAa,EAACF,SAAS,EAASC,QAAe,CAAC;AAC3D,CAAC;AAAAE,OAAA,CAAAJ,wBAAA,GAAAA,wBAAA","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createUnistylesElement = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _passForwardRef = require("./passForwardRef");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ const createUnistylesElement = Component => /*#__PURE__*/_react.default.forwardRef((props, forwardedRef) => /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
12
+ ...props,
13
+ ref: ref => (0, _passForwardRef.passForwardedRef)(props, ref, forwardedRef)
14
+ }));
15
+ exports.createUnistylesElement = createUnistylesElement;
16
+ //# sourceMappingURL=createUnistylesElement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_passForwardRef","_jsxRuntime","e","__esModule","default","createUnistylesElement","Component","React","forwardRef","props","forwardedRef","jsx","ref","passForwardedRef","exports"],"sourceRoot":"../../../src","sources":["core/createUnistylesElement.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAAmD,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE5C,MAAMG,sBAAsB,GAAIC,SAAc,iBAAKC,cAAK,CAACC,UAAU,CAAC,CAACC,KAAK,EAAEC,YAAY,kBAC3F,IAAAT,WAAA,CAAAU,GAAA,EAACL,SAAS;EAAA,GACFG,KAAK;EACTG,GAAG,EAAGA,GAAY,IAAK,IAAAC,gCAAgB,EAACJ,KAAK,EAAEG,GAAG,EAAEF,YAAY;AAAE,CACrE,CACJ,CAAC;AAAAI,OAAA,CAAAT,sBAAA,GAAAA,sBAAA","ignoreList":[]}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createUnistylesImageBackground = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _specs = require("../specs");
9
+ var _passForwardRef = require("./passForwardRef");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ const createUnistylesImageBackground = Component => /*#__PURE__*/_react.default.forwardRef((props, forwardedRef) => /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
13
+ ...props,
14
+ ref: ref => (0, _passForwardRef.passForwardedRef)(props, ref, forwardedRef),
15
+ imageRef: ref => {
16
+ const style = Array.isArray(props.imageStyle) ? props.imageStyle : [props.imageStyle];
17
+
18
+ // @ts-expect-error - This is hidden from TS
19
+ _specs.UnistylesShadowRegistry.add(ref, style);
20
+ return () => {
21
+ // @ts-expect-error - This is hidden from TS
22
+ _specs.UnistylesShadowRegistry.remove(ref);
23
+ };
24
+ }
25
+ }));
26
+ exports.createUnistylesImageBackground = createUnistylesImageBackground;
27
+ //# sourceMappingURL=createUnistylesImageBackground.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_specs","_passForwardRef","_jsxRuntime","e","__esModule","default","createUnistylesImageBackground","Component","React","forwardRef","props","forwardedRef","jsx","ref","passForwardedRef","imageRef","style","Array","isArray","imageStyle","UnistylesShadowRegistry","add","remove","exports"],"sourceRoot":"../../../src","sources":["core/createUnistylesImageBackground.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAAmD,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE5C,MAAMG,8BAA8B,GAAIC,SAAiC,iBAAKC,cAAK,CAACC,UAAU,CAAwC,CAACC,KAAK,EAAEC,YAAY,kBAC7J,IAAAT,WAAA,CAAAU,GAAA,EAACL,SAAS;EAAA,GACFG,KAAK;EACTG,GAAG,EAAEA,GAAG,IAAI,IAAAC,gCAAgB,EAACJ,KAAK,EAAEG,GAAG,EAAEF,YAAY,CAAE;EACvDI,QAAQ,EAAEF,GAAG,IAAI;IACb,MAAMG,KAAK,GAAGC,KAAK,CAACC,OAAO,CAACR,KAAK,CAACS,UAAU,CAAC,GACvCT,KAAK,CAACS,UAAU,GAChB,CAACT,KAAK,CAACS,UAAU,CAAC;;IAExB;IACAC,8BAAuB,CAACC,GAAG,CAACR,GAAG,EAAEG,KAAK,CAAC;IAEvC,OAAO,MAAM;MACT;MACAI,8BAAuB,CAACE,MAAM,CAACT,GAAG,CAAC;IACvC,CAAC;EACL;AAAE,CACL,CACJ,CAAC;AAAAU,OAAA,CAAAjB,8BAAA,GAAAA,8BAAA","ignoreList":[]}
@@ -9,19 +9,33 @@ Object.defineProperty(exports, "createUnistylesComponent", {
9
9
  return _createUnistylesComponent.createUnistylesComponent;
10
10
  }
11
11
  });
12
- Object.defineProperty(exports, "getBoundArgs", {
12
+ Object.defineProperty(exports, "createUnistylesElement", {
13
13
  enumerable: true,
14
14
  get: function () {
15
- return _getBoundArgs.getBoundArgs;
15
+ return _createUnistylesElement.createUnistylesElement;
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "getId", {
18
+ Object.defineProperty(exports, "createUnistylesImageBackground", {
19
19
  enumerable: true,
20
20
  get: function () {
21
- return _getId.getId;
21
+ return _createUnistylesImageBackground.createUnistylesImageBackground;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "passForwardedRef", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _passForwardRef.passForwardedRef;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "withUnistyles", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _withUnistyles.withUnistyles;
22
34
  }
23
35
  });
24
36
  var _createUnistylesComponent = require("./createUnistylesComponent");
25
- var _getBoundArgs = require("./getBoundArgs");
26
- var _getId = require("./getId");
37
+ var _createUnistylesElement = require("./createUnistylesElement");
38
+ var _createUnistylesImageBackground = require("./createUnistylesImageBackground");
39
+ var _withUnistyles = require("./withUnistyles");
40
+ var _passForwardRef = require("./passForwardRef");
27
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_createUnistylesComponent","require","_getBoundArgs","_getId"],"sourceRoot":"../../../src","sources":["core/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["_createUnistylesComponent","require","_createUnistylesElement","_createUnistylesImageBackground","_withUnistyles","_passForwardRef"],"sourceRoot":"../../../src","sources":["core/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AACA,IAAAE,+BAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA","ignoreList":[]}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.passForwardedRef = void 0;
7
+ var _specs = require("../specs");
8
+ const passForwardedRef = (props, ref, forwardedRef) => {
9
+ const passForwardedRef = () => {
10
+ if (typeof forwardedRef === 'function') {
11
+ return forwardedRef(ref);
12
+ }
13
+ if (forwardedRef) {
14
+ forwardedRef.current = ref;
15
+ }
16
+ return () => {};
17
+ };
18
+ const forwardedRefReturnFn = passForwardedRef();
19
+ _specs.UnistylesShadowRegistry.add(ref, props.style);
20
+ return () => {
21
+ // @ts-expect-error - This is hidden from TS
22
+ _specs.UnistylesShadowRegistry.remove(ref);
23
+ forwardedRefReturnFn?.();
24
+ };
25
+ };
26
+ exports.passForwardedRef = passForwardedRef;
27
+ //# sourceMappingURL=passForwardRef.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_specs","require","passForwardedRef","props","ref","forwardedRef","current","forwardedRefReturnFn","UnistylesShadowRegistry","add","style","remove","exports"],"sourceRoot":"../../../src","sources":["core/passForwardRef.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,gBAAgB,GAAGA,CAC5BC,KAAU,EACVC,GAAM,EACNC,YAAmC,KAClC;EACD,MAAMH,gBAAgB,GAAGA,CAAA,KAAM;IAC3B,IAAI,OAAOG,YAAY,KAAK,UAAU,EAAE;MACpC,OAAOA,YAAY,CAACD,GAAG,CAAC;IAC5B;IAEA,IAAIC,YAAY,EAAE;MACdA,YAAY,CAACC,OAAO,GAAGF,GAAG;IAC9B;IAEA,OAAO,MAAM,CAAC,CAAC;EACnB,CAAC;EACD,MAAMG,oBAAoB,GAAGL,gBAAgB,CAAC,CAAC;EAE/CM,8BAAuB,CAACC,GAAG,CAACL,GAAG,EAAED,KAAK,CAACO,KAAK,CAAC;EAE7C,OAAO,MAAM;IACT;IACAF,8BAAuB,CAACG,MAAM,CAACP,GAAG,CAAC;IACnCG,oBAAoB,GAAG,CAAC;EAC5B,CAAC;AACL,CAAC;AAAAK,OAAA,CAAAV,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "withUnistyles", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _withUnistyles.withUnistyles;
10
+ }
11
+ });
12
+ var _withUnistyles = require("./withUnistyles");
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_withUnistyles","require"],"sourceRoot":"../../../../src","sources":["core/withUnistyles/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SUPPORTED_STYLE_PROPS = void 0;
7
+ const SUPPORTED_STYLE_PROPS = exports.SUPPORTED_STYLE_PROPS = ['style', 'contentContainerStyle'];
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["SUPPORTED_STYLE_PROPS","exports"],"sourceRoot":"../../../../src","sources":["core/withUnistyles/types.ts"],"mappings":";;;;;;AAGO,MAAMA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG,CAAC,OAAO,EAAE,uBAAuB,CAAU","ignoreList":[]}