react-native-unistyles 3.0.0-nightly-20250127 → 3.0.0-nightly-20250129

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 (98) hide show
  1. package/android/src/main/cxx/NativeUnistylesModule.cpp +1 -1
  2. package/android/src/main/java/com/unistyles/NativePlatform+android.kt +1 -2
  3. package/android/src/main/java/com/unistyles/NativePlatform+insets.kt +4 -0
  4. package/android/src/main/java/com/unistyles/NativePlatform+listener.kt +2 -1
  5. package/android/src/main/java/com/unistyles/UnistylesModule.kt +0 -4
  6. package/components/native/Animated/package.json +5 -0
  7. package/cxx/core/UnistylesRegistry.cpp +24 -3
  8. package/cxx/core/UnistylesRegistry.h +1 -0
  9. package/cxx/hybridObjects/HybridShadowRegistry.cpp +7 -0
  10. package/lib/commonjs/components/native/Animated.js +23 -0
  11. package/lib/commonjs/components/native/Animated.js.map +1 -0
  12. package/lib/commonjs/components/native/ImageBackground.js +3 -1
  13. package/lib/commonjs/components/native/ImageBackground.js.map +1 -1
  14. package/lib/commonjs/components/native/Pressable.native.js +15 -2
  15. package/lib/commonjs/components/native/Pressable.native.js.map +1 -1
  16. package/lib/commonjs/core/createUnistylesElement.js +26 -22
  17. package/lib/commonjs/core/createUnistylesElement.js.map +1 -1
  18. package/lib/commonjs/core/createUnistylesElement.native.js +25 -21
  19. package/lib/commonjs/core/createUnistylesElement.native.js.map +1 -1
  20. package/lib/commonjs/core/createUnistylesImageBackground.js +34 -30
  21. package/lib/commonjs/core/createUnistylesImageBackground.js.map +1 -1
  22. package/lib/commonjs/utils.js +16 -1
  23. package/lib/commonjs/utils.js.map +1 -1
  24. package/lib/commonjs/web/utils/unistyle.js +5 -1
  25. package/lib/commonjs/web/utils/unistyle.js.map +1 -1
  26. package/lib/module/components/native/Animated.js +19 -0
  27. package/lib/module/components/native/Animated.js.map +1 -0
  28. package/lib/module/components/native/ImageBackground.js +3 -1
  29. package/lib/module/components/native/ImageBackground.js.map +1 -1
  30. package/lib/module/components/native/Pressable.native.js +15 -2
  31. package/lib/module/components/native/Pressable.native.js.map +1 -1
  32. package/lib/module/core/createUnistylesElement.js +26 -22
  33. package/lib/module/core/createUnistylesElement.js.map +1 -1
  34. package/lib/module/core/createUnistylesElement.native.js +25 -21
  35. package/lib/module/core/createUnistylesElement.native.js.map +1 -1
  36. package/lib/module/core/createUnistylesImageBackground.js +34 -30
  37. package/lib/module/core/createUnistylesImageBackground.js.map +1 -1
  38. package/lib/module/utils.js +14 -0
  39. package/lib/module/utils.js.map +1 -1
  40. package/lib/module/web/utils/unistyle.js +5 -1
  41. package/lib/module/web/utils/unistyle.js.map +1 -1
  42. package/lib/typescript/src/components/native/ActivityIndicator.d.ts +1 -3
  43. package/lib/typescript/src/components/native/ActivityIndicator.d.ts.map +1 -1
  44. package/lib/typescript/src/components/native/Animated.d.ts +39 -0
  45. package/lib/typescript/src/components/native/Animated.d.ts.map +1 -0
  46. package/lib/typescript/src/components/native/FlatList.d.ts +1 -3
  47. package/lib/typescript/src/components/native/FlatList.d.ts.map +1 -1
  48. package/lib/typescript/src/components/native/Image.d.ts +1 -3
  49. package/lib/typescript/src/components/native/Image.d.ts.map +1 -1
  50. package/lib/typescript/src/components/native/ImageBackground.d.ts +1 -8
  51. package/lib/typescript/src/components/native/ImageBackground.d.ts.map +1 -1
  52. package/lib/typescript/src/components/native/ImageBackground.native.d.ts +1 -2
  53. package/lib/typescript/src/components/native/ImageBackground.native.d.ts.map +1 -1
  54. package/lib/typescript/src/components/native/KeyboardAvoidingView.d.ts +1 -3
  55. package/lib/typescript/src/components/native/KeyboardAvoidingView.d.ts.map +1 -1
  56. package/lib/typescript/src/components/native/Pressable.native.d.ts.map +1 -1
  57. package/lib/typescript/src/components/native/RefreshControl.d.ts +1 -3
  58. package/lib/typescript/src/components/native/RefreshControl.d.ts.map +1 -1
  59. package/lib/typescript/src/components/native/ScrollView.d.ts +1 -3
  60. package/lib/typescript/src/components/native/ScrollView.d.ts.map +1 -1
  61. package/lib/typescript/src/components/native/SectionList.d.ts +1 -3
  62. package/lib/typescript/src/components/native/SectionList.d.ts.map +1 -1
  63. package/lib/typescript/src/components/native/Switch.d.ts +1 -3
  64. package/lib/typescript/src/components/native/Switch.d.ts.map +1 -1
  65. package/lib/typescript/src/components/native/Text.d.ts +1 -3
  66. package/lib/typescript/src/components/native/Text.d.ts.map +1 -1
  67. package/lib/typescript/src/components/native/TextInput.d.ts +1 -3
  68. package/lib/typescript/src/components/native/TextInput.d.ts.map +1 -1
  69. package/lib/typescript/src/components/native/TouchableHighlight.d.ts +1 -3
  70. package/lib/typescript/src/components/native/TouchableHighlight.d.ts.map +1 -1
  71. package/lib/typescript/src/components/native/TouchableOpacity.d.ts +1 -3
  72. package/lib/typescript/src/components/native/TouchableOpacity.d.ts.map +1 -1
  73. package/lib/typescript/src/components/native/View.d.ts +1 -3
  74. package/lib/typescript/src/components/native/View.d.ts.map +1 -1
  75. package/lib/typescript/src/components/native/VirtualizedList.d.ts +1 -3
  76. package/lib/typescript/src/components/native/VirtualizedList.d.ts.map +1 -1
  77. package/lib/typescript/src/core/createUnistylesElement.d.ts +1 -7
  78. package/lib/typescript/src/core/createUnistylesElement.d.ts.map +1 -1
  79. package/lib/typescript/src/core/createUnistylesElement.native.d.ts +1 -2
  80. package/lib/typescript/src/core/createUnistylesElement.native.d.ts.map +1 -1
  81. package/lib/typescript/src/core/createUnistylesImageBackground.d.ts +2 -3
  82. package/lib/typescript/src/core/createUnistylesImageBackground.d.ts.map +1 -1
  83. package/lib/typescript/src/utils.d.ts +1 -0
  84. package/lib/typescript/src/utils.d.ts.map +1 -1
  85. package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -1
  86. package/package.json +3 -1
  87. package/plugin/consts.js +43 -0
  88. package/plugin/exotic.js +42 -0
  89. package/plugin/index.js +10 -30
  90. package/plugin/variants.js +1 -1
  91. package/src/components/native/Animated.tsx +17 -0
  92. package/src/components/native/ImageBackground.tsx +4 -1
  93. package/src/components/native/Pressable.native.tsx +20 -2
  94. package/src/core/createUnistylesElement.native.tsx +28 -23
  95. package/src/core/createUnistylesElement.tsx +34 -29
  96. package/src/core/createUnistylesImageBackground.tsx +38 -33
  97. package/src/utils.ts +17 -0
  98. package/src/web/utils/unistyle.ts +7 -1
package/src/utils.ts CHANGED
@@ -24,3 +24,20 @@ export const deepMergeObjects = <T extends Record<PropertyKey, any>>(...sources:
24
24
 
25
25
  return target
26
26
  }
27
+
28
+ export const copyComponentProperties = (Component: any, UnistylesComponent: any) => {
29
+ Object.entries(Component).forEach(([key, value]) => {
30
+ // Filter out the keys we don't want to copy
31
+ if (['$$typeof', 'render'].includes(key)) {
32
+ return
33
+ }
34
+
35
+ UnistylesComponent[key] = value
36
+ })
37
+
38
+ // Those are not enumerable, so we need to copy them manually
39
+ UnistylesComponent.displayName = Component.displayName
40
+ UnistylesComponent.name = Component.name
41
+
42
+ return UnistylesComponent
43
+ }
@@ -49,7 +49,13 @@ export const extractSecrets = (object: any) => {
49
49
  return undefined
50
50
  }
51
51
 
52
- return reduceObject(Object.getOwnPropertyDescriptors(secrets), secret => secret.value)
52
+ const hiddenSecrets = Object.getOwnPropertyDescriptors(secrets)
53
+
54
+ if (Object.keys(hiddenSecrets).length === 0) {
55
+ return undefined
56
+ }
57
+
58
+ return reduceObject(hiddenSecrets, secret => secret.value)
53
59
  }
54
60
 
55
61
  export const removeInlineStyles = (values: UnistylesValues) => {