@rootnative/web 0.0.0-alpha.2 → 0.0.0-alpha.4

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 (243) hide show
  1. package/CHANGELOG.md +66 -1
  2. package/dist/apis/AccessibilityInfo/index.d.ts +30 -0
  3. package/dist/apis/AccessibilityInfo/index.js +84 -0
  4. package/dist/apis/AccessibilityInfo/index.js.map +1 -0
  5. package/dist/apis/Alert/index.d.ts +22 -0
  6. package/dist/apis/Alert/index.js +141 -0
  7. package/dist/apis/Alert/index.js.map +1 -0
  8. package/dist/apis/AppState/index.d.ts +21 -0
  9. package/dist/apis/AppState/index.js +86 -0
  10. package/dist/apis/AppState/index.js.map +1 -0
  11. package/dist/apis/Appearance/index.d.ts +14 -0
  12. package/dist/apis/Appearance/index.js +39 -0
  13. package/dist/apis/Appearance/index.js.map +1 -0
  14. package/dist/apis/BackHandler/index.d.ts +10 -0
  15. package/dist/apis/BackHandler/index.js +16 -0
  16. package/dist/apis/BackHandler/index.js.map +1 -0
  17. package/dist/apis/Clipboard/index.d.ts +9 -0
  18. package/dist/apis/Clipboard/index.js +45 -0
  19. package/dist/apis/Clipboard/index.js.map +1 -0
  20. package/dist/apis/Dimensions/index.d.ts +19 -0
  21. package/dist/apis/Dimensions/index.js +66 -0
  22. package/dist/apis/Dimensions/index.js.map +1 -0
  23. package/dist/apis/I18nManager/index.d.ts +14 -0
  24. package/dist/apis/I18nManager/index.js +33 -0
  25. package/dist/apis/I18nManager/index.js.map +1 -0
  26. package/dist/apis/Keyboard/index.d.ts +36 -0
  27. package/dist/apis/Keyboard/index.js +149 -0
  28. package/dist/apis/Keyboard/index.js.map +1 -0
  29. package/dist/apis/Linking/index.d.ts +29 -0
  30. package/dist/apis/Linking/index.js +86 -0
  31. package/dist/apis/Linking/index.js.map +1 -0
  32. package/dist/apis/PanResponder/index.d.ts +50 -0
  33. package/dist/apis/PanResponder/index.js +239 -0
  34. package/dist/apis/PanResponder/index.js.map +1 -0
  35. package/dist/apis/PixelRatio/index.d.ts +8 -0
  36. package/dist/apis/PixelRatio/index.js +15 -0
  37. package/dist/apis/PixelRatio/index.js.map +1 -0
  38. package/dist/apis/Platform/index.d.ts +4 -0
  39. package/dist/apis/Platform/index.js +28 -0
  40. package/dist/apis/Platform/index.js.map +1 -0
  41. package/dist/apis/Platform/types.d.ts +19 -0
  42. package/dist/apis/Share/index.d.ts +30 -0
  43. package/dist/apis/Share/index.js +34 -0
  44. package/dist/apis/Share/index.js.map +1 -0
  45. package/dist/apis/StyleSheet/index.d.ts +23 -0
  46. package/dist/apis/StyleSheet/index.js +29 -0
  47. package/dist/apis/StyleSheet/index.js.map +1 -0
  48. package/dist/apis/StyleSheet/types.d.ts +328 -0
  49. package/dist/apis/Vibration/index.d.ts +9 -0
  50. package/dist/apis/Vibration/index.js +40 -0
  51. package/dist/apis/Vibration/index.js.map +1 -0
  52. package/dist/apis/processColor/index.d.ts +3 -0
  53. package/dist/apis/processColor/index.js +12 -0
  54. package/dist/apis/processColor/index.js.map +1 -0
  55. package/dist/apis/useColorScheme/index.d.ts +3 -0
  56. package/dist/apis/useColorScheme/index.js +13 -0
  57. package/dist/apis/useColorScheme/index.js.map +1 -0
  58. package/dist/apis/useWindowDimensions/index.d.ts +3 -0
  59. package/dist/apis/useWindowDimensions/index.js +19 -0
  60. package/dist/apis/useWindowDimensions/index.js.map +1 -0
  61. package/dist/assets-registry/index.d.ts +18 -0
  62. package/dist/assets-registry/index.js +12 -0
  63. package/dist/assets-registry/index.js.map +1 -0
  64. package/dist/bundler/index.js +30 -0
  65. package/dist/bundler/index.js.map +1 -0
  66. package/dist/bundler/inlinePlatformOS.js +121 -0
  67. package/dist/bundler/inlinePlatformOS.js.map +1 -0
  68. package/dist/bundler/worklets.js +61 -0
  69. package/dist/bundler/worklets.js.map +1 -0
  70. package/dist/compat/TurboModuleRegistry/index.d.ts +16 -0
  71. package/dist/compat/TurboModuleRegistry/index.js +14 -0
  72. package/dist/compat/TurboModuleRegistry/index.js.map +1 -0
  73. package/dist/compat/createElement/index.d.ts +9 -0
  74. package/dist/compat/createElement/index.js +40 -0
  75. package/dist/compat/createElement/index.js.map +1 -0
  76. package/dist/compat/findNodeHandle/index.d.ts +7 -0
  77. package/dist/compat/findNodeHandle/index.js +19 -0
  78. package/dist/compat/findNodeHandle/index.js.map +1 -0
  79. package/dist/components/ActivityIndicator/index.d.ts +5 -0
  80. package/dist/components/ActivityIndicator/index.js +74 -0
  81. package/dist/components/ActivityIndicator/index.js.map +1 -0
  82. package/dist/components/ActivityIndicator/types.d.ts +8 -0
  83. package/dist/components/Button/index.d.ts +5 -0
  84. package/dist/components/Button/index.js +48 -0
  85. package/dist/components/Button/index.js.map +1 -0
  86. package/dist/components/Button/types.d.ts +31 -0
  87. package/dist/components/FlatList/index.d.ts +5 -0
  88. package/dist/components/FlatList/index.js +433 -0
  89. package/dist/components/FlatList/index.js.map +1 -0
  90. package/dist/components/FlatList/types.d.ts +138 -0
  91. package/dist/components/FlatList/viewability.js +86 -0
  92. package/dist/components/FlatList/viewability.js.map +1 -0
  93. package/dist/components/Image/index.d.ts +7 -0
  94. package/dist/components/Image/index.js +301 -0
  95. package/dist/components/Image/index.js.map +1 -0
  96. package/dist/components/Image/source.js +97 -0
  97. package/dist/components/Image/source.js.map +1 -0
  98. package/dist/components/Image/types.d.ts +96 -0
  99. package/dist/components/KeyboardAvoidingView/index.d.ts +10 -0
  100. package/dist/components/KeyboardAvoidingView/index.js +118 -0
  101. package/dist/components/KeyboardAvoidingView/index.js.map +1 -0
  102. package/dist/components/KeyboardAvoidingView/types.d.ts +14 -0
  103. package/dist/components/Modal/index.d.ts +9 -0
  104. package/dist/components/Modal/index.js +271 -0
  105. package/dist/components/Modal/index.js.map +1 -0
  106. package/dist/components/Modal/types.d.ts +29 -0
  107. package/dist/components/Pressable/index.d.ts +5 -0
  108. package/dist/components/Pressable/index.js +106 -0
  109. package/dist/components/Pressable/index.js.map +1 -0
  110. package/dist/components/Pressable/types.d.ts +44 -0
  111. package/dist/components/RefreshControl/index.d.ts +5 -0
  112. package/dist/components/RefreshControl/index.js +176 -0
  113. package/dist/components/RefreshControl/index.js.map +1 -0
  114. package/dist/components/RefreshControl/pull.js +16 -0
  115. package/dist/components/RefreshControl/pull.js.map +1 -0
  116. package/dist/components/RefreshControl/types.d.ts +14 -0
  117. package/dist/components/ScrollView/index.d.ts +5 -0
  118. package/dist/components/ScrollView/index.js +318 -0
  119. package/dist/components/ScrollView/index.js.map +1 -0
  120. package/dist/components/ScrollView/snap.js +38 -0
  121. package/dist/components/ScrollView/snap.js.map +1 -0
  122. package/dist/components/ScrollView/types.d.ts +115 -0
  123. package/dist/components/StatusBar/index.d.ts +26 -0
  124. package/dist/components/StatusBar/index.js +113 -0
  125. package/dist/components/StatusBar/index.js.map +1 -0
  126. package/dist/components/Switch/index.d.ts +5 -0
  127. package/dist/components/Switch/index.js +89 -0
  128. package/dist/components/Switch/index.js.map +1 -0
  129. package/dist/components/Switch/types.d.ts +25 -0
  130. package/dist/components/Text/TextAncestorContext.d.ts +3 -0
  131. package/dist/components/Text/TextAncestorContext.js +6 -0
  132. package/dist/components/Text/TextAncestorContext.js.map +1 -0
  133. package/dist/components/Text/index.d.ts +6 -0
  134. package/dist/components/Text/index.js +133 -0
  135. package/dist/components/Text/index.js.map +1 -0
  136. package/dist/components/Text/types.d.ts +38 -0
  137. package/dist/components/TextInput/autocomplete.js +102 -0
  138. package/dist/components/TextInput/autocomplete.js.map +1 -0
  139. package/dist/components/TextInput/index.d.ts +8 -0
  140. package/dist/components/TextInput/index.js +290 -0
  141. package/dist/components/TextInput/index.js.map +1 -0
  142. package/dist/components/TextInput/types.d.ts +130 -0
  143. package/dist/components/TouchableHighlight/index.d.ts +5 -0
  144. package/dist/components/TouchableHighlight/index.js +109 -0
  145. package/dist/components/TouchableHighlight/index.js.map +1 -0
  146. package/dist/components/TouchableHighlight/types.d.ts +15 -0
  147. package/dist/components/TouchableNativeFeedback/index.d.ts +11 -0
  148. package/dist/components/TouchableNativeFeedback/index.js +29 -0
  149. package/dist/components/TouchableNativeFeedback/index.js.map +1 -0
  150. package/dist/components/TouchableNativeFeedback/types.d.ts +19 -0
  151. package/dist/components/TouchableOpacity/index.d.ts +5 -0
  152. package/dist/components/TouchableOpacity/index.js +122 -0
  153. package/dist/components/TouchableOpacity/index.js.map +1 -0
  154. package/dist/components/TouchableOpacity/types.d.ts +11 -0
  155. package/dist/components/TouchableWithoutFeedback/index.d.ts +5 -0
  156. package/dist/components/TouchableWithoutFeedback/index.js +70 -0
  157. package/dist/components/TouchableWithoutFeedback/index.js.map +1 -0
  158. package/dist/components/TouchableWithoutFeedback/types.d.ts +40 -0
  159. package/dist/components/View/index.d.ts +5 -0
  160. package/dist/components/View/index.js +50 -0
  161. package/dist/components/View/index.js.map +1 -0
  162. package/dist/components/View/types.d.ts +98 -0
  163. package/dist/dom/Head.d.ts +21 -0
  164. package/dist/dom/Head.js +53 -0
  165. package/dist/dom/Head.js.map +1 -0
  166. package/dist/dom/index.d.ts +2 -22
  167. package/dist/dom/index.js +1 -53
  168. package/dist/events/press/Pressability.d.ts +2 -0
  169. package/dist/events/press/Pressability.js +366 -0
  170. package/dist/events/press/Pressability.js.map +1 -0
  171. package/dist/events/press/cursorStyle.js +5 -0
  172. package/dist/events/press/cursorStyle.js.map +1 -0
  173. package/dist/events/press/index.d.ts +4 -0
  174. package/dist/events/press/mergeHandlers.js +30 -0
  175. package/dist/events/press/mergeHandlers.js.map +1 -0
  176. package/dist/events/press/types.d.ts +48 -0
  177. package/dist/events/press/usePressability.d.ts +4 -0
  178. package/dist/events/press/usePressability.js +18 -0
  179. package/dist/events/press/usePressability.js.map +1 -0
  180. package/dist/events/responderEvent.js +50 -0
  181. package/dist/events/responderEvent.js.map +1 -0
  182. package/dist/events/types.d.ts +33 -0
  183. package/dist/index.d.ts +66 -1009
  184. package/dist/index.js +43 -3872
  185. package/dist/reactNativeVersion.d.ts +7 -0
  186. package/dist/reactNativeVersion.js +10 -0
  187. package/dist/reactNativeVersion.js.map +1 -0
  188. package/dist/render/domProps.js +66 -0
  189. package/dist/render/domProps.js.map +1 -0
  190. package/dist/render/hitSlop.js +21 -0
  191. package/dist/render/hitSlop.js.map +1 -0
  192. package/dist/render/hostMethods.js +44 -0
  193. package/dist/render/hostMethods.js.map +1 -0
  194. package/dist/render/resolveTag.js +64 -0
  195. package/dist/render/resolveTag.js.map +1 -0
  196. package/dist/render/useElementLayout.js +25 -0
  197. package/dist/render/useElementLayout.js.map +1 -0
  198. package/dist/server/index.d.ts +2 -23
  199. package/dist/server/index.js +8 -4
  200. package/dist/server/index.js.map +1 -1
  201. package/dist/style/StyleRegistryContext.js +8 -0
  202. package/dist/style/StyleRegistryContext.js.map +1 -0
  203. package/dist/style/color.js +16 -0
  204. package/dist/style/color.js.map +1 -0
  205. package/dist/style/compile.js +72 -0
  206. package/dist/style/compile.js.map +1 -0
  207. package/dist/style/direction.js +33 -0
  208. package/dist/style/direction.js.map +1 -0
  209. package/dist/style/index.d.ts +25 -0
  210. package/dist/style/index.js +38 -0
  211. package/dist/style/index.js.map +1 -0
  212. package/dist/style/registry.d.ts +27 -0
  213. package/dist/{StyleRegistryContext-CAD45r4n.js → style/registry.js} +32 -10
  214. package/dist/style/registry.js.map +1 -0
  215. package/dist/style/resolveStyle.js +181 -0
  216. package/dist/style/resolveStyle.js.map +1 -0
  217. package/dist/style/shadow.js +87 -0
  218. package/dist/style/shadow.js.map +1 -0
  219. package/dist/style/splitLayoutProps.js +52 -0
  220. package/dist/style/splitLayoutProps.js.map +1 -0
  221. package/dist/style/transform.js +35 -0
  222. package/dist/style/transform.js.map +1 -0
  223. package/dist/style/types.d.ts +4 -0
  224. package/dist/style/units.js +21 -0
  225. package/dist/style/units.js.map +1 -0
  226. package/dist/style/webStyle.js +9 -0
  227. package/dist/style/webStyle.js.map +1 -0
  228. package/dist/{env-DK5Mt9yX.js → utils/env.js} +2 -2
  229. package/dist/utils/env.js.map +1 -0
  230. package/dist/utils/scrollLock.js +28 -0
  231. package/dist/utils/scrollLock.js.map +1 -0
  232. package/dist/utils/warn.js +11 -0
  233. package/dist/utils/warn.js.map +1 -0
  234. package/dist/vite/index.d.ts +9 -1
  235. package/dist/vite/index.js +71 -174
  236. package/dist/vite/index.js.map +1 -1
  237. package/llms.txt +203 -22
  238. package/package.json +16 -3
  239. package/dist/StyleRegistryContext-CAD45r4n.js.map +0 -1
  240. package/dist/dom/index.js.map +0 -1
  241. package/dist/env-DK5Mt9yX.js.map +0 -1
  242. package/dist/index.js.map +0 -1
  243. package/dist/types-BxTWbdj9.d.ts +0 -5
@@ -0,0 +1,328 @@
1
+ import { CSSProperties } from "react";
2
+ export type ImageResizeMode = "cover" | "contain" | "stretch" | "repeat" | "center";
3
+ /** A color from `PlatformColor` or `DynamicColorIOS` on native. The web has neither. */
4
+ export type NativeColorValue = symbol & {
5
+ __NativeColorValue__: string;
6
+ };
7
+ /** @deprecated Use `NativeColorValue`. */
8
+ export type OpaqueColorValue = NativeColorValue;
9
+ export type ColorValue = null | string | number | NativeColorValue;
10
+ export type DimensionValue = number | string | "auto" | null;
11
+ export type CursorValue = "auto" | "pointer";
12
+ export type PointValue = {
13
+ x: number;
14
+ y: number;
15
+ };
16
+ export type EdgeInsetsValue = {
17
+ top: number;
18
+ left: number;
19
+ right: number;
20
+ bottom: number;
21
+ };
22
+ type LayoutStyle = Readonly<{
23
+ display?: "none" | "flex" | "contents" | undefined;
24
+ width?: DimensionValue | undefined;
25
+ height?: DimensionValue | undefined;
26
+ bottom?: DimensionValue | undefined;
27
+ end?: DimensionValue | undefined;
28
+ left?: DimensionValue | undefined;
29
+ right?: DimensionValue | undefined;
30
+ start?: DimensionValue | undefined;
31
+ top?: DimensionValue | undefined;
32
+ inset?: DimensionValue | undefined;
33
+ insetBlock?: DimensionValue | undefined;
34
+ insetBlockEnd?: DimensionValue | undefined;
35
+ insetBlockStart?: DimensionValue | undefined;
36
+ insetInline?: DimensionValue | undefined;
37
+ insetInlineEnd?: DimensionValue | undefined;
38
+ insetInlineStart?: DimensionValue | undefined;
39
+ minWidth?: DimensionValue | undefined;
40
+ maxWidth?: DimensionValue | undefined;
41
+ minHeight?: DimensionValue | undefined;
42
+ maxHeight?: DimensionValue | undefined;
43
+ margin?: DimensionValue | undefined;
44
+ marginBlock?: DimensionValue | undefined;
45
+ marginBlockEnd?: DimensionValue | undefined;
46
+ marginBlockStart?: DimensionValue | undefined;
47
+ marginBottom?: DimensionValue | undefined;
48
+ marginEnd?: DimensionValue | undefined;
49
+ marginHorizontal?: DimensionValue | undefined;
50
+ marginInline?: DimensionValue | undefined;
51
+ marginInlineEnd?: DimensionValue | undefined;
52
+ marginInlineStart?: DimensionValue | undefined;
53
+ marginLeft?: DimensionValue | undefined;
54
+ marginRight?: DimensionValue | undefined;
55
+ marginStart?: DimensionValue | undefined;
56
+ marginTop?: DimensionValue | undefined;
57
+ marginVertical?: DimensionValue | undefined;
58
+ padding?: DimensionValue | undefined;
59
+ paddingBlock?: DimensionValue | undefined;
60
+ paddingBlockEnd?: DimensionValue | undefined;
61
+ paddingBlockStart?: DimensionValue | undefined;
62
+ paddingBottom?: DimensionValue | undefined;
63
+ paddingEnd?: DimensionValue | undefined;
64
+ paddingHorizontal?: DimensionValue | undefined;
65
+ paddingInline?: DimensionValue | undefined;
66
+ paddingInlineEnd?: DimensionValue | undefined;
67
+ paddingInlineStart?: DimensionValue | undefined;
68
+ paddingLeft?: DimensionValue | undefined;
69
+ paddingRight?: DimensionValue | undefined;
70
+ paddingStart?: DimensionValue | undefined;
71
+ paddingTop?: DimensionValue | undefined;
72
+ paddingVertical?: DimensionValue | undefined;
73
+ borderWidth?: number | undefined;
74
+ borderBottomWidth?: number | undefined;
75
+ borderEndWidth?: number | undefined;
76
+ borderLeftWidth?: number | undefined;
77
+ borderRightWidth?: number | undefined;
78
+ borderStartWidth?: number | undefined;
79
+ borderTopWidth?: number | undefined;
80
+ position?: "absolute" | "relative" | "static" | undefined;
81
+ flexDirection?: "row" | "row-reverse" | "column" | "column-reverse" | undefined;
82
+ flexWrap?: "wrap" | "nowrap" | "wrap-reverse" | undefined;
83
+ justifyContent?: "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "space-evenly" | undefined;
84
+ alignItems?: "flex-start" | "flex-end" | "center" | "stretch" | "baseline" | undefined;
85
+ alignSelf?: "auto" | "flex-start" | "flex-end" | "center" | "stretch" | "baseline" | undefined;
86
+ alignContent?: "flex-start" | "flex-end" | "center" | "stretch" | "space-between" | "space-around" | "space-evenly" | undefined;
87
+ overflow?: "visible" | "hidden" | "scroll" | undefined;
88
+ flex?: number | undefined;
89
+ flexGrow?: number | undefined;
90
+ flexShrink?: number | undefined;
91
+ flexBasis?: number | string | undefined;
92
+ aspectRatio?: number | string | undefined;
93
+ boxSizing?: "border-box" | "content-box" | undefined;
94
+ zIndex?: number | undefined;
95
+ direction?: "inherit" | "ltr" | "rtl" | undefined;
96
+ rowGap?: number | string | undefined;
97
+ columnGap?: number | string | undefined;
98
+ gap?: number | string | undefined;
99
+ }>;
100
+ type ShadowStyle = Readonly<{
101
+ shadowColor?: ColorValue | undefined;
102
+ shadowOffset?: Readonly<{
103
+ width?: number | undefined;
104
+ height?: number | undefined;
105
+ }> | undefined;
106
+ shadowOpacity?: number | undefined;
107
+ shadowRadius?: number | undefined;
108
+ }>;
109
+ type KeysOfUnion<T> = T extends unknown ? keyof T : never;
110
+ type ValueOfUnion<T, K> = T extends unknown ? (K extends keyof T ? T[K] : never) : never;
111
+ type MergeUnion<T> = { [K in KeysOfUnion<T>]?: ValueOfUnion<T, K>; };
112
+ type MaximumOneOf<T> = { [K in keyof T]: { [P in keyof T]?: P extends K ? T[P] : never; }; }[keyof T];
113
+ type TransformOperation = Readonly<MaximumOneOf<MergeUnion<{
114
+ readonly perspective: number;
115
+ } | {
116
+ readonly rotate: string;
117
+ } | {
118
+ readonly rotateX: string;
119
+ } | {
120
+ readonly rotateY: string;
121
+ } | {
122
+ readonly rotateZ: string;
123
+ } | {
124
+ readonly scale: number;
125
+ } | {
126
+ readonly scaleX: number;
127
+ } | {
128
+ readonly scaleY: number;
129
+ } | {
130
+ readonly translateX: number | string;
131
+ } | {
132
+ readonly translateY: number | string;
133
+ } | {
134
+ readonly translate: [number | string, number | string];
135
+ } | {
136
+ readonly skewX: string;
137
+ } | {
138
+ readonly skewY: string;
139
+ } | {
140
+ readonly matrix: ReadonlyArray<number>;
141
+ }>>>;
142
+ export type TransformsStyle = Readonly<{
143
+ transform?: ReadonlyArray<TransformOperation> | string | undefined;
144
+ transformOrigin?: [string | number, string | number, string | number] | string | undefined;
145
+ }>;
146
+ export type FilterFunction = {
147
+ brightness: number | string;
148
+ } | {
149
+ blur: number | string;
150
+ } | {
151
+ contrast: number | string;
152
+ } | {
153
+ grayscale: number | string;
154
+ } | {
155
+ hueRotate: number | string;
156
+ } | {
157
+ invert: number | string;
158
+ } | {
159
+ opacity: number | string;
160
+ } | {
161
+ saturate: number | string;
162
+ } | {
163
+ sepia: number | string;
164
+ } | {
165
+ dropShadow: DropShadowValue | string;
166
+ };
167
+ export type DropShadowValue = {
168
+ offsetX: number | string;
169
+ offsetY: number | string;
170
+ standardDeviation?: number | string | undefined;
171
+ color?: ColorValue | undefined;
172
+ };
173
+ type ColorStops = ReadonlyArray<{
174
+ color: ColorValue;
175
+ positions?: ReadonlyArray<string> | undefined;
176
+ }>;
177
+ type LinearGradientValue = {
178
+ type: "linear-gradient";
179
+ direction?: string | undefined;
180
+ colorStops: ColorStops;
181
+ };
182
+ type EdgePosition = {
183
+ top: number | string;
184
+ left: number | string;
185
+ } | {
186
+ top: number | string;
187
+ right: number | string;
188
+ } | {
189
+ bottom: number | string;
190
+ left: number | string;
191
+ } | {
192
+ bottom: number | string;
193
+ right: number | string;
194
+ };
195
+ type RadialGradientPosition = EdgePosition;
196
+ type RadialGradientShape = "circle" | "ellipse";
197
+ type RadialGradientSize = "closest-corner" | "closest-side" | "farthest-corner" | "farthest-side" | {
198
+ x: string | number;
199
+ y: string | number;
200
+ };
201
+ type RadialGradientValue = {
202
+ type: "radial-gradient";
203
+ shape: RadialGradientShape;
204
+ size: RadialGradientSize;
205
+ position: RadialGradientPosition;
206
+ colorStops: ColorStops;
207
+ };
208
+ type BackgroundImageValue = LinearGradientValue | RadialGradientValue;
209
+ type BackgroundSizeValue = {
210
+ x: string | number;
211
+ y: string | number;
212
+ };
213
+ type BackgroundRepeatKeyword = "repeat" | "space" | "round" | "no-repeat";
214
+ type BackgroundPositionValue = EdgePosition;
215
+ type BackgroundRepeatValue = {
216
+ x: BackgroundRepeatKeyword;
217
+ y: BackgroundRepeatKeyword;
218
+ };
219
+ export type BoxShadowValue = {
220
+ offsetX: number | string;
221
+ offsetY: number | string;
222
+ color?: ColorValue | undefined;
223
+ blurRadius?: number | string | undefined;
224
+ spreadDistance?: number | string | undefined;
225
+ inset?: boolean | undefined;
226
+ };
227
+ type BlendMode = "normal" | "multiply" | "screen" | "overlay" | "darken" | "lighten" | "color-dodge" | "color-burn" | "hard-light" | "soft-light" | "difference" | "exclusion" | "hue" | "saturation" | "color" | "luminosity" | "plus-lighter";
228
+ type ViewStyleBase = Readonly<{
229
+ backfaceVisibility?: "visible" | "hidden" | undefined;
230
+ backgroundColor?: ColorValue | undefined;
231
+ borderColor?: ColorValue | undefined;
232
+ borderCurve?: "circular" | "continuous" | undefined;
233
+ borderBottomColor?: ColorValue | undefined;
234
+ borderEndColor?: ColorValue | undefined;
235
+ borderLeftColor?: ColorValue | undefined;
236
+ borderRightColor?: ColorValue | undefined;
237
+ borderStartColor?: ColorValue | undefined;
238
+ borderTopColor?: ColorValue | undefined;
239
+ borderBlockColor?: ColorValue | undefined;
240
+ borderBlockEndColor?: ColorValue | undefined;
241
+ borderBlockStartColor?: ColorValue | undefined;
242
+ borderRadius?: number | string | undefined;
243
+ borderBottomEndRadius?: number | string | undefined;
244
+ borderBottomLeftRadius?: number | string | undefined;
245
+ borderBottomRightRadius?: number | string | undefined;
246
+ borderBottomStartRadius?: number | string | undefined;
247
+ borderEndEndRadius?: number | string | undefined;
248
+ borderEndStartRadius?: number | string | undefined;
249
+ borderStartEndRadius?: number | string | undefined;
250
+ borderStartStartRadius?: number | string | undefined;
251
+ borderTopEndRadius?: number | string | undefined;
252
+ borderTopLeftRadius?: number | string | undefined;
253
+ borderTopRightRadius?: number | string | undefined;
254
+ borderTopStartRadius?: number | string | undefined;
255
+ borderStyle?: "solid" | "dotted" | "dashed" | undefined;
256
+ opacity?: number | undefined;
257
+ outlineColor?: ColorValue | undefined;
258
+ outlineOffset?: number | undefined;
259
+ outlineStyle?: "solid" | "dotted" | "dashed" | undefined;
260
+ outlineWidth?: number | undefined;
261
+ elevation?: number | undefined;
262
+ pointerEvents?: "auto" | "none" | "box-none" | "box-only" | undefined;
263
+ cursor?: CursorValue | undefined;
264
+ boxShadow?: ReadonlyArray<BoxShadowValue> | string | undefined;
265
+ filter?: ReadonlyArray<FilterFunction> | string | undefined;
266
+ mixBlendMode?: BlendMode | undefined;
267
+ backgroundImage?: ReadonlyArray<BackgroundImageValue> | string | undefined;
268
+ experimental_backgroundImage?: ReadonlyArray<BackgroundImageValue> | string | undefined;
269
+ backgroundSize?: ReadonlyArray<BackgroundSizeValue> | string | undefined;
270
+ experimental_backgroundSize?: ReadonlyArray<BackgroundSizeValue> | string | undefined;
271
+ backgroundPosition?: ReadonlyArray<BackgroundPositionValue> | string | undefined;
272
+ experimental_backgroundPosition?: ReadonlyArray<BackgroundPositionValue> | string | undefined;
273
+ backgroundRepeat?: ReadonlyArray<BackgroundRepeatValue> | string | undefined;
274
+ experimental_backgroundRepeat?: ReadonlyArray<BackgroundRepeatValue> | string | undefined;
275
+ isolation?: "auto" | "isolate" | undefined;
276
+ }>;
277
+ type WebOnlyViewStyle = Readonly<{
278
+ touchAction?: CSSProperties["touchAction"] | undefined;
279
+ }>;
280
+ export interface ViewStyle extends LayoutStyle, ShadowStyle, TransformsStyle, ViewStyleBase, WebOnlyViewStyle {}
281
+ type FontWeight = "normal" | "bold" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | "ultralight" | "thin" | "light" | "medium" | "regular" | "semibold" | "condensedBold" | "condensed" | "heavy" | "black";
282
+ export type FontVariant = "small-caps" | "oldstyle-nums" | "lining-nums" | "tabular-nums" | "common-ligatures" | "no-common-ligatures" | "discretionary-ligatures" | "no-discretionary-ligatures" | "historical-ligatures" | "no-historical-ligatures" | "contextual" | "no-contextual" | "proportional-nums" | "stylistic-one" | "stylistic-two" | "stylistic-three" | "stylistic-four" | "stylistic-five" | "stylistic-six" | "stylistic-seven" | "stylistic-eight" | "stylistic-nine" | "stylistic-ten" | "stylistic-eleven" | "stylistic-twelve" | "stylistic-thirteen" | "stylistic-fourteen" | "stylistic-fifteen" | "stylistic-sixteen" | "stylistic-seventeen" | "stylistic-eighteen" | "stylistic-nineteen" | "stylistic-twenty";
283
+ type TextStyleBase = Readonly<{
284
+ color?: ColorValue | undefined;
285
+ fontFamily?: string | undefined;
286
+ fontSize?: number | undefined;
287
+ fontStyle?: "normal" | "italic" | undefined;
288
+ fontWeight?: FontWeight | undefined;
289
+ fontVariant?: ReadonlyArray<FontVariant> | string | undefined;
290
+ fontVariationSettings?: string | Readonly<{
291
+ [axis: string]: number;
292
+ }> | undefined;
293
+ textShadowOffset?: Readonly<{
294
+ width: number;
295
+ height: number;
296
+ }> | undefined;
297
+ textShadowRadius?: number | undefined;
298
+ textShadowColor?: ColorValue | undefined;
299
+ letterSpacing?: number | undefined;
300
+ lineHeight?: number | undefined;
301
+ textAlign?: "auto" | "left" | "right" | "center" | "justify" | "start" | "end" | undefined;
302
+ textAlignVertical?: "auto" | "top" | "bottom" | "center" | undefined;
303
+ includeFontPadding?: boolean | undefined;
304
+ textDecorationLine?: "none" | "underline" | "line-through" | "underline line-through" | undefined;
305
+ textDecorationStyle?: "solid" | "double" | "dotted" | "dashed" | "wavy" | undefined;
306
+ textDecorationColor?: ColorValue | undefined;
307
+ textTransform?: "none" | "capitalize" | "uppercase" | "lowercase" | undefined;
308
+ userSelect?: "auto" | "text" | "none" | "contain" | "all" | undefined;
309
+ verticalAlign?: "auto" | "top" | "bottom" | "middle" | undefined;
310
+ writingDirection?: "auto" | "ltr" | "rtl" | undefined;
311
+ }>;
312
+ export interface TextStyle extends ViewStyle, TextStyleBase {}
313
+ type ImageStyleBase = Readonly<{
314
+ resizeMode?: ImageResizeMode | undefined;
315
+ objectFit?: "cover" | "contain" | "fill" | "scale-down" | "none" | undefined;
316
+ tintColor?: ColorValue | undefined;
317
+ overlayColor?: ColorValue | undefined;
318
+ }>;
319
+ export interface ImageStyle extends Omit<ViewStyle, "overflow">, ImageStyleBase {
320
+ readonly overflow?: "visible" | "hidden" | undefined;
321
+ }
322
+ /** Every style key of every component, the type that `StyleSheet.create` checks. */
323
+ type AnyStyle = Omit<TextStyle, keyof ImageStyleBase> & ImageStyleBase;
324
+ export type NamedStyles = {
325
+ readonly [name: string]: Partial<AnyStyle>;
326
+ };
327
+ export {};
328
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Vibrates the device with `navigator.vibrate`, with Android's rules: the durations apply, and
3
+ * an array starts with a wait.
4
+ */
5
+ export declare const Vibration: {
6
+ vibrate: (pattern?: number | Array<number>, repeat?: boolean) => void;
7
+ cancel: () => void;
8
+ };
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,40 @@
1
+ import { hasDOM } from "../../utils/env.js";
2
+ // src/apis/Vibration/index.ts
3
+ const DEFAULT_LENGTH = 400;
4
+ let repeatTimer;
5
+ const canVibrate = () => hasDOM() && typeof navigator.vibrate === "function";
6
+ const stopRepeat = () => {
7
+ if (repeatTimer === void 0) return;
8
+ clearTimeout(repeatTimer);
9
+ repeatTimer = void 0;
10
+ };
11
+ /**
12
+ * Vibrates the device with `navigator.vibrate`, with Android's rules: the durations apply, and
13
+ * an array starts with a wait.
14
+ */
15
+ const Vibration = {
16
+ vibrate(pattern = DEFAULT_LENGTH, repeat = false) {
17
+ let steps;
18
+ if (typeof pattern === "number") steps = [pattern];
19
+ else if (Array.isArray(pattern)) steps = [0, ...pattern];
20
+ else throw new Error("Vibration pattern should be a number or array");
21
+ stopRepeat();
22
+ if (!canVibrate()) return;
23
+ navigator.vibrate(steps);
24
+ if (!repeat || typeof pattern === "number") return;
25
+ const total = steps.reduce((sum, step) => sum + step, 0);
26
+ if (total <= 0) return;
27
+ const again = () => {
28
+ navigator.vibrate(steps);
29
+ repeatTimer = setTimeout(again, total);
30
+ };
31
+ repeatTimer = setTimeout(again, total);
32
+ },
33
+ cancel() {
34
+ stopRepeat();
35
+ if (canVibrate()) navigator.vibrate(0);
36
+ }
37
+ };
38
+ export { Vibration };
39
+
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/apis/Vibration/index.ts"],"sourcesContent":["import { hasDOM } from '../../utils/env'\n\nconst DEFAULT_LENGTH = 400\n\nlet repeatTimer: ReturnType<typeof setTimeout> | undefined\n\n// Safari, iOS, and most desktops have no `navigator.vibrate`. There it does nothing, as on a\n// device with no motor.\nconst canVibrate = (): boolean => hasDOM() && typeof navigator.vibrate === 'function'\n\nconst stopRepeat = (): void => {\n if (repeatTimer === undefined) return\n clearTimeout(repeatTimer)\n repeatTimer = undefined\n}\n\n/**\n * Vibrates the device with `navigator.vibrate`, with Android's rules: the durations apply, and\n * an array starts with a wait.\n */\nexport const Vibration: {\n vibrate: (pattern?: number | Array<number>, repeat?: boolean) => void\n cancel: () => void\n} = {\n vibrate(pattern = DEFAULT_LENGTH, repeat = false) {\n let steps: number[]\n if (typeof pattern === 'number') steps = [pattern]\n // Android's pattern starts with a wait, the web's with a vibration.\n else if (Array.isArray(pattern)) steps = [0, ...pattern]\n else throw new Error('Vibration pattern should be a number or array')\n\n stopRepeat()\n if (!canVibrate()) return\n navigator.vibrate(steps)\n\n if (!repeat || typeof pattern === 'number') return\n const total = steps.reduce((sum, step) => sum + step, 0)\n if (total <= 0) return\n const again = (): void => {\n navigator.vibrate(steps)\n repeatTimer = setTimeout(again, total)\n }\n repeatTimer = setTimeout(again, total)\n },\n\n cancel() {\n stopRepeat()\n if (canVibrate()) navigator.vibrate(0)\n },\n}\n"],"mappings":";;AAEA,MAAM,iBAAiB;AAEvB,IAAI;AAIJ,MAAM,mBAA4B,OAAO,KAAK,OAAO,UAAU,YAAY;AAE3E,MAAM,mBAAyB;CAC7B,IAAI,gBAAgB,KAAA,GAAW;CAC/B,aAAa,WAAW;CACxB,cAAc,KAAA;AAChB;;;;;AAMA,MAAa,YAGT;CACF,QAAQ,UAAU,gBAAgB,SAAS,OAAO;EAChD,IAAI;EACJ,IAAI,OAAO,YAAY,UAAU,QAAQ,CAAC,OAAO;OAE5C,IAAI,MAAM,QAAQ,OAAO,GAAG,QAAQ,CAAC,GAAG,GAAG,OAAO;OAClD,MAAM,IAAI,MAAM,+CAA+C;EAEpE,WAAW;EACX,IAAI,CAAC,WAAW,GAAG;EACnB,UAAU,QAAQ,KAAK;EAEvB,IAAI,CAAC,UAAU,OAAO,YAAY,UAAU;EAC5C,MAAM,QAAQ,MAAM,QAAQ,KAAK,SAAS,MAAM,MAAM,CAAC;EACvD,IAAI,SAAS,GAAG;EAChB,MAAM,cAAoB;GACxB,UAAU,QAAQ,KAAK;GACvB,cAAc,WAAW,OAAO,KAAK;EACvC;EACA,cAAc,WAAW,OAAO,KAAK;CACvC;CAEA,SAAS;EACP,WAAW;EACX,IAAI,WAAW,GAAG,UAAU,QAAQ,CAAC;CACvC;AACF"}
@@ -0,0 +1,3 @@
1
+ export type ProcessedColorValue = number;
2
+ export declare const processColor: (color: unknown) => ProcessedColorValue | null | undefined;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,12 @@
1
+ import normalizeColor from "@react-native/normalize-colors";
2
+ // src/apis/processColor/index.ts
3
+ const processColor = (color) => {
4
+ if (color === void 0 || color === null) return color;
5
+ if (typeof color !== "string" && typeof color !== "number") return null;
6
+ const rgba = normalizeColor(color);
7
+ if (rgba === null || rgba === void 0) return null;
8
+ return (rgba << 24 | rgba >>> 8) >>> 0;
9
+ };
10
+ export { processColor };
11
+
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/apis/processColor/index.ts"],"sourcesContent":["import normalizeColor from '@react-native/normalize-colors'\n\nexport type ProcessedColorValue = number\n\n// A color as React Native's native side takes it: an unsigned 32-bit ARGB\n// integer, as on iOS. `null` for an invalid color, `undefined` for none.\nexport const processColor = (color: unknown): ProcessedColorValue | null | undefined => {\n if (color === undefined || color === null) return color\n if (typeof color !== 'string' && typeof color !== 'number') return null\n const rgba = normalizeColor(color)\n if (rgba === null || rgba === undefined) return null\n return ((rgba << 24) | (rgba >>> 8)) >>> 0\n}\n"],"mappings":";;AAMA,MAAa,gBAAgB,UAA2D;CACtF,IAAI,UAAU,KAAA,KAAa,UAAU,MAAM,OAAO;CAClD,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,UAAU,OAAO;CACnE,MAAM,OAAO,eAAe,KAAK;CACjC,IAAI,SAAS,QAAQ,SAAS,KAAA,GAAW,OAAO;CAChD,QAAS,QAAQ,KAAO,SAAS,OAAQ;AAC3C"}
@@ -0,0 +1,3 @@
1
+ import { ColorSchemeName } from "../Appearance/index.js";
2
+ export declare const useColorScheme: () => ColorSchemeName;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,13 @@
1
+ import { Appearance } from "../Appearance/index.js";
2
+ import { useSyncExternalStore } from "react";
3
+ // src/apis/useColorScheme/index.ts
4
+ const subscribe = (onChange) => {
5
+ const subscription = Appearance.addChangeListener(onChange);
6
+ return () => subscription.remove();
7
+ };
8
+ const getSnapshot = () => Appearance.getColorScheme();
9
+ const getServerSnapshot = () => "light";
10
+ const useColorScheme = () => useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
11
+ export { useColorScheme };
12
+
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/apis/useColorScheme/index.ts"],"sourcesContent":["import { useSyncExternalStore } from 'react'\n\nimport { Appearance, type ColorSchemeName } from '../Appearance'\n\nconst subscribe = (onChange: () => void): (() => void) => {\n const subscription = Appearance.addChangeListener(onChange)\n return () => subscription.remove()\n}\n\nconst getSnapshot = (): ColorSchemeName => Appearance.getColorScheme()\n\n// Hydration adopts the server's 'light', then React renders the real scheme.\nconst getServerSnapshot = (): ColorSchemeName => 'light'\n\nexport const useColorScheme = (): ColorSchemeName =>\n useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)\n"],"mappings":";;;AAIA,MAAM,aAAa,aAAuC;CACxD,MAAM,eAAe,WAAW,kBAAkB,QAAQ;CAC1D,aAAa,aAAa,OAAO;AACnC;AAEA,MAAM,oBAAqC,WAAW,eAAe;AAGrE,MAAM,0BAA2C;AAEjD,MAAa,uBACX,qBAAqB,WAAW,aAAa,iBAAiB"}
@@ -0,0 +1,3 @@
1
+ import { ScaledSize } from "../Dimensions/index.js";
2
+ export declare const useWindowDimensions: () => ScaledSize;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,19 @@
1
+ import { Dimensions } from "../Dimensions/index.js";
2
+ import { useSyncExternalStore } from "react";
3
+ // src/apis/useWindowDimensions/index.ts
4
+ const serverSnapshot = Object.freeze({
5
+ width: 0,
6
+ height: 0,
7
+ scale: 1,
8
+ fontScale: 1
9
+ });
10
+ const subscribe = (onChange) => {
11
+ const subscription = Dimensions.addEventListener("change", onChange);
12
+ return () => subscription.remove();
13
+ };
14
+ const getSnapshot = () => Dimensions.get("window");
15
+ const getServerSnapshot = () => serverSnapshot;
16
+ const useWindowDimensions = () => useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
17
+ export { useWindowDimensions };
18
+
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/apis/useWindowDimensions/index.ts"],"sourcesContent":["import { useSyncExternalStore } from 'react'\n\nimport { Dimensions, type ScaledSize } from '../Dimensions'\n\nconst serverSnapshot: ScaledSize = Object.freeze({ width: 0, height: 0, scale: 1, fontScale: 1 })\n\nconst subscribe = (onChange: () => void): (() => void) => {\n const subscription = Dimensions.addEventListener('change', onChange)\n return () => subscription.remove()\n}\n\nconst getSnapshot = (): ScaledSize => Dimensions.get('window')\n\nconst getServerSnapshot = (): ScaledSize => serverSnapshot\n\nexport const useWindowDimensions = (): ScaledSize =>\n useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot)\n"],"mappings":";;;AAIA,MAAM,iBAA6B,OAAO,OAAO;CAAE,OAAO;CAAG,QAAQ;CAAG,OAAO;CAAG,WAAW;AAAE,CAAC;AAEhG,MAAM,aAAa,aAAuC;CACxD,MAAM,eAAe,WAAW,iBAAiB,UAAU,QAAQ;CACnE,aAAa,aAAa,OAAO;AACnC;AAEA,MAAM,oBAAgC,WAAW,IAAI,QAAQ;AAE7D,MAAM,0BAAsC;AAE5C,MAAa,4BACX,qBAAqB,WAAW,aAAa,iBAAiB"}
@@ -0,0 +1,18 @@
1
+ /** An asset as a React Native packager registers it. */
2
+ export type PackagerAsset = {
3
+ readonly httpServerLocation: string;
4
+ readonly name: string;
5
+ readonly type: string;
6
+ readonly scales: ReadonlyArray<number>;
7
+ readonly width?: number | null;
8
+ readonly height?: number | null;
9
+ readonly hash?: string;
10
+ };
11
+ /**
12
+ * Compat entry. The Vite plugin points `@react-native/assets-registry/registry` here, because
13
+ * libraries such as `react-native-svg` import that module on the web. A web bundler gives an
14
+ * image import a URL, not a number, so the registry stays empty unless your code fills it.
15
+ */
16
+ export declare const registerAsset: (asset: PackagerAsset) => number;
17
+ export declare const getAssetByID: (assetId: number) => PackagerAsset | undefined;
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,12 @@
1
+ // src/assets-registry/index.ts
2
+ const assets = [];
3
+ /**
4
+ * Compat entry. The Vite plugin points `@react-native/assets-registry/registry` here, because
5
+ * libraries such as `react-native-svg` import that module on the web. A web bundler gives an
6
+ * image import a URL, not a number, so the registry stays empty unless your code fills it.
7
+ */
8
+ const registerAsset = (asset) => assets.push(asset);
9
+ const getAssetByID = (assetId) => assets[assetId - 1];
10
+ export { getAssetByID, registerAsset };
11
+
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/assets-registry/index.ts"],"sourcesContent":["/** An asset as a React Native packager registers it. */\nexport type PackagerAsset = {\n readonly httpServerLocation: string\n readonly name: string\n readonly type: string\n readonly scales: ReadonlyArray<number>\n readonly width?: number | null\n readonly height?: number | null\n readonly hash?: string\n}\n\nconst assets: PackagerAsset[] = []\n\n/**\n * Compat entry. The Vite plugin points `@react-native/assets-registry/registry` here, because\n * libraries such as `react-native-svg` import that module on the web. A web bundler gives an\n * image import a URL, not a number, so the registry stays empty unless your code fills it.\n */\nexport const registerAsset = (asset: PackagerAsset): number => assets.push(asset)\n\nexport const getAssetByID = (assetId: number): PackagerAsset | undefined => assets[assetId - 1]\n"],"mappings":";AAWA,MAAM,SAA0B,CAAC;;;;;;AAOjC,MAAa,iBAAiB,UAAiC,OAAO,KAAK,KAAK;AAEhF,MAAa,gBAAgB,YAA+C,OAAO,UAAU"}
@@ -0,0 +1,30 @@
1
+ import { inlinePlatformOS } from "./inlinePlatformOS.js";
2
+ import { WORKLET_CODE, createWorkletTransform } from "./worklets.js";
3
+ // src/bundler/index.ts
4
+ /** Module names that resolve to this package. Each one matches the exact name only. */
5
+ const ALIASES = {
6
+ "react-native": "@rootnative/web",
7
+ "@react-native/assets-registry/registry": "@rootnative/web/assets-registry",
8
+ "react-native-web/dist/cjs/exports/StyleSheet/compiler/createReactDOMStyle.js": "@rootnative/web/style",
9
+ "react-native-web/dist/cjs/exports/StyleSheet/preprocess.js": "@rootnative/web/style"
10
+ };
11
+ /**
12
+ * The globals that React Native code expects from its bundler, each as the code that replaces
13
+ * the name. `__DEV__` is `true` in a development build and `false` in a production build.
14
+ * `global` is React Native's name for the global object, which a browser doesn't have.
15
+ */
16
+ const globalDefines = (production) => ({
17
+ __DEV__: JSON.stringify(!production),
18
+ global: "globalThis"
19
+ });
20
+ /**
21
+ * Puts a `.web` variant of each extension first, as Metro does for the web platform. An
22
+ * import of `./Button` then finds `Button.web.tsx` before `Button.tsx`.
23
+ */
24
+ const webExtensions = (extensions) => {
25
+ const web = extensions.map((extension) => extension.startsWith(".web.") ? extension : `.web${extension}`);
26
+ return [.../* @__PURE__ */ new Set([...web, ...extensions])];
27
+ };
28
+ export { ALIASES, WORKLET_CODE, createWorkletTransform, globalDefines, inlinePlatformOS, webExtensions };
29
+
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/bundler/index.ts"],"sourcesContent":["export { inlinePlatformOS } from './inlinePlatformOS'\nexport {\n createWorkletTransform,\n WORKLET_CODE,\n type WorkletTransform,\n type WorkletTransformResult,\n} from './worklets'\n\n/** Module names that resolve to this package. Each one matches the exact name only. */\nexport const ALIASES: Readonly<Record<string, string>> = {\n 'react-native': '@rootnative/web',\n // Libraries import it on the web, and the real module is Flow source that no web bundler reads.\n '@react-native/assets-registry/registry': '@rootnative/web/assets-registry',\n // Reanimated 4 reads its web style helpers from these react-native-web internal files.\n 'react-native-web/dist/cjs/exports/StyleSheet/compiler/createReactDOMStyle.js':\n '@rootnative/web/style',\n 'react-native-web/dist/cjs/exports/StyleSheet/preprocess.js': '@rootnative/web/style',\n}\n\n/**\n * The globals that React Native code expects from its bundler, each as the code that replaces\n * the name. `__DEV__` is `true` in a development build and `false` in a production build.\n * `global` is React Native's name for the global object, which a browser doesn't have.\n */\nexport const globalDefines = (production: boolean): Record<string, string> => ({\n __DEV__: JSON.stringify(!production),\n global: 'globalThis',\n})\n\n/**\n * Puts a `.web` variant of each extension first, as Metro does for the web platform. An\n * import of `./Button` then finds `Button.web.tsx` before `Button.tsx`.\n */\nexport const webExtensions = (extensions: readonly string[]): string[] => {\n const web = extensions.map((extension) =>\n extension.startsWith('.web.') ? extension : `.web${extension}`,\n )\n return [...new Set([...web, ...extensions])]\n}\n"],"mappings":";;;;AASA,MAAa,UAA4C;CACvD,gBAAgB;CAEhB,0CAA0C;CAE1C,gFACE;CACF,8DAA8D;AAChE;;;;;;AAOA,MAAa,iBAAiB,gBAAiD;CAC7E,SAAS,KAAK,UAAU,CAAC,UAAU;CACnC,QAAQ;AACV;;;;;AAMA,MAAa,iBAAiB,eAA4C;CACxE,MAAM,MAAM,WAAW,KAAK,cAC1B,UAAU,WAAW,OAAO,IAAI,YAAY,OAAO,WACrD;CACA,OAAO,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,KAAK,GAAG,UAAU,CAAC,CAAC;AAC7C"}