@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,121 @@
1
+ // src/bundler/inlinePlatformOS.ts
2
+ const SOURCES = /* @__PURE__ */ new Set(["react-native", "@rootnative/web"]);
3
+ const REPLACEMENT = "\"web\"";
4
+ const LINE_BREAK = /[\n\r\u2028\u2029]/;
5
+ const isNode = (value) => typeof value === "object" && value !== null && typeof value.type === "string";
6
+ const identifierName = (node) => isNode(node) && node.type === "Identifier" && typeof node.name === "string" ? node.name : void 0;
7
+ const nodes = (value) => Array.isArray(value) ? value.filter(isNode) : isNode(value) ? [value] : [];
8
+ const collectBindings = (pattern, names) => {
9
+ if (!isNode(pattern)) return;
10
+ switch (pattern.type) {
11
+ case "Identifier": {
12
+ const name = identifierName(pattern);
13
+ if (name !== void 0) names.add(name);
14
+ return;
15
+ }
16
+ case "ObjectPattern":
17
+ for (const property of nodes(pattern.properties)) collectBindings(property.type === "RestElement" ? property.argument : property.value, names);
18
+ return;
19
+ case "ArrayPattern":
20
+ for (const element of nodes(pattern.elements)) collectBindings(element, names);
21
+ return;
22
+ case "RestElement":
23
+ collectBindings(pattern.argument, names);
24
+ return;
25
+ case "AssignmentPattern": collectBindings(pattern.left, names);
26
+ }
27
+ };
28
+ const isWriteTarget = (parent, key, grandparent) => {
29
+ switch (parent.type) {
30
+ case "AssignmentExpression":
31
+ case "AssignmentPattern":
32
+ case "ForInStatement":
33
+ case "ForOfStatement": return key === "left";
34
+ case "UpdateExpression":
35
+ case "ArrayPattern":
36
+ case "RestElement": return true;
37
+ case "UnaryExpression": return parent.operator === "delete";
38
+ case "Property": return key === "value" && grandparent?.type === "ObjectPattern";
39
+ default: return false;
40
+ }
41
+ };
42
+ const platformRead = (node) => {
43
+ if (node.computed === true || identifierName(node.property) !== "OS") return void 0;
44
+ const name = identifierName(node.object);
45
+ if (name !== void 0) return {
46
+ name,
47
+ namespace: false
48
+ };
49
+ const object = node.object;
50
+ if (isNode(object) && object.type === "MemberExpression" && object.computed !== true && identifierName(object.property) === "Platform") {
51
+ const namespace = identifierName(object.object);
52
+ if (namespace !== void 0) return {
53
+ name: namespace,
54
+ namespace: true
55
+ };
56
+ }
57
+ };
58
+ /**
59
+ * Replaces each read of `Platform.OS` with `"web"`, so a minifier can drop the branches of the
60
+ * other platforms. Only a `Platform` imported from `react-native` or `@rootnative/web` counts.
61
+ * Takes the ESTree program of `code`, with `start` and `end` offsets. Returns `null` when
62
+ * nothing changes.
63
+ */
64
+ const inlinePlatformOS = (code, program) => {
65
+ if (!isNode(program)) return null;
66
+ const named = /* @__PURE__ */ new Set();
67
+ const namespaces = /* @__PURE__ */ new Set();
68
+ const declared = /* @__PURE__ */ new Set();
69
+ const reads = [];
70
+ const visit = (node, parent, key, grandparent) => {
71
+ switch (node.type) {
72
+ case "ImportDeclaration": {
73
+ const source = isNode(node.source) ? node.source.value : void 0;
74
+ if (typeof source !== "string" || !SOURCES.has(source)) break;
75
+ for (const specifier of nodes(node.specifiers)) {
76
+ const local = identifierName(specifier.local);
77
+ if (local === void 0) continue;
78
+ if (specifier.type === "ImportNamespaceSpecifier") namespaces.add(local);
79
+ const imported = isNode(specifier.imported) ? identifierName(specifier.imported) ?? specifier.imported.value : void 0;
80
+ if (specifier.type === "ImportSpecifier" && imported === "Platform") named.add(local);
81
+ }
82
+ break;
83
+ }
84
+ case "VariableDeclarator":
85
+ collectBindings(node.id, declared);
86
+ break;
87
+ case "FunctionDeclaration":
88
+ case "FunctionExpression":
89
+ case "ArrowFunctionExpression":
90
+ collectBindings(node.id, declared);
91
+ for (const param of nodes(node.params)) collectBindings(param, declared);
92
+ break;
93
+ case "ClassDeclaration":
94
+ case "ClassExpression":
95
+ collectBindings(node.id, declared);
96
+ break;
97
+ case "CatchClause":
98
+ collectBindings(node.param, declared);
99
+ break;
100
+ case "MemberExpression": {
101
+ const read = platformRead(node);
102
+ if (read !== void 0 && (parent === void 0 || !isWriteTarget(parent, key, grandparent))) reads.push({
103
+ ...read,
104
+ start: node.start,
105
+ end: node.end
106
+ });
107
+ break;
108
+ }
109
+ }
110
+ for (const childKey of Object.keys(node)) for (const child of nodes(node[childKey])) visit(child, node, childKey, parent);
111
+ };
112
+ visit(program, void 0, "", void 0);
113
+ const edits = reads.filter((read) => (read.namespace ? namespaces : named).has(read.name) && !declared.has(read.name) && read.end - read.start >= 5 && !LINE_BREAK.test(code.slice(read.start, read.end)));
114
+ if (edits.length === 0) return null;
115
+ let output = code;
116
+ for (const { start, end } of edits) output = output.slice(0, start) + REPLACEMENT.padEnd(end - start) + output.slice(end);
117
+ return output;
118
+ };
119
+ export { inlinePlatformOS };
120
+
121
+ //# sourceMappingURL=inlinePlatformOS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inlinePlatformOS.js","names":[],"sources":["../../src/bundler/inlinePlatformOS.ts"],"sourcesContent":["interface AstNode {\n type: string\n start: number\n end: number\n [key: string]: unknown\n}\n\ninterface PlatformRead {\n start: number\n end: number\n name: string\n namespace: boolean\n}\n\nconst SOURCES = new Set(['react-native', '@rootnative/web'])\nconst REPLACEMENT = '\"web\"'\nconst LINE_BREAK = /[\\n\\r\\u2028\\u2029]/\n\nconst isNode = (value: unknown): value is AstNode =>\n typeof value === 'object' &&\n value !== null &&\n typeof (value as { type?: unknown }).type === 'string'\n\nconst identifierName = (node: unknown): string | undefined =>\n isNode(node) && node.type === 'Identifier' && typeof node.name === 'string'\n ? node.name\n : undefined\n\nconst nodes = (value: unknown): AstNode[] =>\n Array.isArray(value) ? value.filter(isNode) : isNode(value) ? [value] : []\n\nconst collectBindings = (pattern: unknown, names: Set<string>): void => {\n if (!isNode(pattern)) return\n switch (pattern.type) {\n case 'Identifier': {\n const name = identifierName(pattern)\n if (name !== undefined) names.add(name)\n return\n }\n case 'ObjectPattern':\n for (const property of nodes(pattern.properties)) {\n collectBindings(property.type === 'RestElement' ? property.argument : property.value, names)\n }\n return\n case 'ArrayPattern':\n for (const element of nodes(pattern.elements)) collectBindings(element, names)\n return\n case 'RestElement':\n collectBindings(pattern.argument, names)\n return\n case 'AssignmentPattern':\n collectBindings(pattern.left, names)\n }\n}\n\nconst isWriteTarget = (parent: AstNode, key: string, grandparent: AstNode | undefined): boolean => {\n switch (parent.type) {\n case 'AssignmentExpression':\n case 'AssignmentPattern':\n case 'ForInStatement':\n case 'ForOfStatement':\n return key === 'left'\n case 'UpdateExpression':\n case 'ArrayPattern':\n case 'RestElement':\n return true\n case 'UnaryExpression':\n return parent.operator === 'delete'\n case 'Property':\n return key === 'value' && grandparent?.type === 'ObjectPattern'\n default:\n return false\n }\n}\n\nconst platformRead = (node: AstNode): Omit<PlatformRead, 'start' | 'end'> | undefined => {\n if (node.computed === true || identifierName(node.property) !== 'OS') return undefined\n const name = identifierName(node.object)\n if (name !== undefined) return { name, namespace: false }\n const object = node.object\n if (\n isNode(object) &&\n object.type === 'MemberExpression' &&\n object.computed !== true &&\n identifierName(object.property) === 'Platform'\n ) {\n const namespace = identifierName(object.object)\n if (namespace !== undefined) return { name: namespace, namespace: true }\n }\n return undefined\n}\n\n/**\n * Replaces each read of `Platform.OS` with `\"web\"`, so a minifier can drop the branches of the\n * other platforms. Only a `Platform` imported from `react-native` or `@rootnative/web` counts.\n * Takes the ESTree program of `code`, with `start` and `end` offsets. Returns `null` when\n * nothing changes.\n */\nexport const inlinePlatformOS = (code: string, program: object): string | null => {\n if (!isNode(program)) return null\n\n const named = new Set<string>()\n const namespaces = new Set<string>()\n const declared = new Set<string>()\n const reads: PlatformRead[] = []\n\n const visit = (\n node: AstNode,\n parent: AstNode | undefined,\n key: string,\n grandparent: AstNode | undefined,\n ): void => {\n switch (node.type) {\n case 'ImportDeclaration': {\n const source = isNode(node.source) ? node.source.value : undefined\n if (typeof source !== 'string' || !SOURCES.has(source)) break\n for (const specifier of nodes(node.specifiers)) {\n const local = identifierName(specifier.local)\n if (local === undefined) continue\n if (specifier.type === 'ImportNamespaceSpecifier') namespaces.add(local)\n const imported = isNode(specifier.imported)\n ? (identifierName(specifier.imported) ?? specifier.imported.value)\n : undefined\n if (specifier.type === 'ImportSpecifier' && imported === 'Platform') named.add(local)\n }\n break\n }\n case 'VariableDeclarator':\n collectBindings(node.id, declared)\n break\n case 'FunctionDeclaration':\n case 'FunctionExpression':\n case 'ArrowFunctionExpression':\n collectBindings(node.id, declared)\n for (const param of nodes(node.params)) collectBindings(param, declared)\n break\n case 'ClassDeclaration':\n case 'ClassExpression':\n collectBindings(node.id, declared)\n break\n case 'CatchClause':\n collectBindings(node.param, declared)\n break\n case 'MemberExpression': {\n const read = platformRead(node)\n if (\n read !== undefined &&\n (parent === undefined || !isWriteTarget(parent, key, grandparent))\n ) {\n reads.push({ ...read, start: node.start, end: node.end })\n }\n break\n }\n }\n for (const childKey of Object.keys(node)) {\n for (const child of nodes(node[childKey])) visit(child, node, childKey, parent)\n }\n }\n visit(program, undefined, '', undefined)\n\n // A local binding with the same name may shadow the import in some scope. Without scope\n // analysis, skip that name in the whole module.\n const edits = reads.filter(\n (read) =>\n (read.namespace ? namespaces : named).has(read.name) &&\n !declared.has(read.name) &&\n // The replacement keeps the length and the lines of the original, so every later column\n // stays put and the source map stays exact. A shorter or a multi-line read keeps its code.\n read.end - read.start >= REPLACEMENT.length &&\n !LINE_BREAK.test(code.slice(read.start, read.end)),\n )\n if (edits.length === 0) return null\n\n // Each edit keeps its length, so the offsets of the others stay valid in any order.\n let output = code\n for (const { start, end } of edits) {\n output = output.slice(0, start) + REPLACEMENT.padEnd(end - start) + output.slice(end)\n }\n return output\n}\n"],"mappings":"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"}
@@ -0,0 +1,61 @@
1
+ // src/bundler/worklets.ts
2
+ /**
3
+ * The source of a file that can hold a worklet: a `'worklet'` directive, an import of
4
+ * Reanimated or Worklets, or a call that the Worklets Babel plugin turns into a worklet.
5
+ */
6
+ const WORKLET_CODE = /worklet|reanimated|useAnimated|useDerivedValue|useFrameCallback|runOnUI|scheduleOnUI|with(?:Timing|Spring|Decay|Repeat)\b/;
7
+ const SCRIPT_FILE = /\.[cm]?[jt]sx?$/;
8
+ const missing = (name) => /* @__PURE__ */ new Error(`[@rootnative/web] The \`worklets\` option needs \`${name}\`, and the app doesn't have it. Install it, or remove the option.`);
9
+ const loadTools = async (root) => {
10
+ const { createRequire } = await import("node:module");
11
+ const { resolve } = await import("node:path");
12
+ const fromRoot = createRequire(resolve(root, "package.json"));
13
+ let plugin;
14
+ let workletsManifest;
15
+ try {
16
+ plugin = fromRoot.resolve("react-native-worklets/plugin");
17
+ workletsManifest = fromRoot.resolve("react-native-worklets/package.json");
18
+ } catch {
19
+ throw missing("react-native-worklets");
20
+ }
21
+ for (const load of [fromRoot, createRequire(workletsManifest)]) try {
22
+ return {
23
+ babel: load("@babel/core"),
24
+ plugin
25
+ };
26
+ } catch {}
27
+ throw missing("@babel/core");
28
+ };
29
+ /**
30
+ * Makes the transform that runs the Worklets Babel plugin on one file, as the Babel preset of a
31
+ * React Native app does. It finds the plugin and Babel from the root of the app, on the first
32
+ * file that needs them.
33
+ */
34
+ const createWorkletTransform = (root) => {
35
+ let tools;
36
+ return async (code, id) => {
37
+ const file = id.split("?")[0];
38
+ if (file.startsWith("\0") || !SCRIPT_FILE.test(file) || !WORKLET_CODE.test(code)) return null;
39
+ tools ??= loadTools(root);
40
+ const { babel, plugin } = await tools;
41
+ const syntax = [];
42
+ if (/\.[cm]?tsx?$/.test(file)) syntax.push("typescript");
43
+ if (/\.[jt]sx$/.test(file)) syntax.push("jsx");
44
+ const result = await babel.transformAsync(code, {
45
+ filename: file,
46
+ babelrc: false,
47
+ configFile: false,
48
+ sourceMaps: true,
49
+ parserOpts: { plugins: syntax },
50
+ plugins: [plugin]
51
+ });
52
+ if (result?.code == null) return null;
53
+ return {
54
+ code: result.code,
55
+ map: result.map == null ? null : JSON.stringify(result.map)
56
+ };
57
+ };
58
+ };
59
+ export { WORKLET_CODE, createWorkletTransform };
60
+
61
+ //# sourceMappingURL=worklets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worklets.js","names":[],"sources":["../../src/bundler/worklets.ts"],"sourcesContent":["/**\n * The source of a file that can hold a worklet: a `'worklet'` directive, an import of\n * Reanimated or Worklets, or a call that the Worklets Babel plugin turns into a worklet.\n */\nexport const WORKLET_CODE: RegExp =\n /worklet|reanimated|useAnimated|useDerivedValue|useFrameCallback|runOnUI|scheduleOnUI|with(?:Timing|Spring|Decay|Repeat)\\b/\n\nconst SCRIPT_FILE = /\\.[cm]?[jt]sx?$/\n\n// The map is JSON text, which every bundler takes.\nexport type WorkletTransformResult = { code: string; map: string | null }\n\nexport type WorkletTransform = (code: string, id: string) => Promise<WorkletTransformResult | null>\n\ntype BabelCore = {\n transformAsync: (\n code: string,\n options: Record<string, unknown>,\n ) => Promise<{ code?: string | null; map?: object | null } | null>\n}\n\ntype Require = ((id: string) => unknown) & { resolve: (id: string) => string }\n\ntype Tools = { babel: BabelCore; plugin: string }\n\nconst missing = (name: string): Error =>\n new Error(\n `[@rootnative/web] The \\`worklets\\` option needs \\`${name}\\`, and the app doesn't have it. ` +\n `Install it, or remove the option.`,\n )\n\nconst loadTools = async (root: string): Promise<Tools> => {\n // Only Node runs this file. A dynamic import keeps the browser entries free of it.\n const { createRequire } = await import('node:module')\n const { resolve } = await import('node:path')\n const fromRoot = createRequire(resolve(root, 'package.json')) as Require\n\n let plugin: string\n let workletsManifest: string\n try {\n plugin = fromRoot.resolve('react-native-worklets/plugin')\n workletsManifest = fromRoot.resolve('react-native-worklets/package.json')\n } catch {\n throw missing('react-native-worklets')\n }\n\n // Babel is a peer of Worklets. A strict package layout links it beside Worklets, not in the app.\n for (const load of [fromRoot, createRequire(workletsManifest) as Require]) {\n try {\n return { babel: load('@babel/core') as BabelCore, plugin }\n } catch {\n // Try the next place.\n }\n }\n throw missing('@babel/core')\n}\n\n/**\n * Makes the transform that runs the Worklets Babel plugin on one file, as the Babel preset of a\n * React Native app does. It finds the plugin and Babel from the root of the app, on the first\n * file that needs them.\n */\nexport const createWorkletTransform = (root: string): WorkletTransform => {\n let tools: Promise<Tools> | undefined\n\n return async (code, id) => {\n const file = id.split('?')[0] as string\n if (file.startsWith('\\0') || !SCRIPT_FILE.test(file) || !WORKLET_CODE.test(code)) return null\n\n tools ??= loadTools(root)\n const { babel, plugin } = await tools\n\n // A library can ship TypeScript or JSX source. Babel reads the syntax and keeps it.\n const syntax: string[] = []\n if (/\\.[cm]?tsx?$/.test(file)) syntax.push('typescript')\n if (/\\.[jt]sx$/.test(file)) syntax.push('jsx')\n\n const result = await babel.transformAsync(code, {\n filename: file,\n babelrc: false,\n configFile: false,\n sourceMaps: true,\n parserOpts: { plugins: syntax },\n plugins: [plugin],\n })\n if (result?.code == null) return null\n return { code: result.code, map: result.map == null ? null : JSON.stringify(result.map) }\n }\n}\n"],"mappings":";;;;;AAIA,MAAa,eACX;AAEF,MAAM,cAAc;AAkBpB,MAAM,WAAW,yBACf,IAAI,MACF,qDAAqD,KAAK,mEAE5D;AAEF,MAAM,YAAY,OAAO,SAAiC;CAExD,MAAM,EAAE,kBAAkB,MAAM,OAAO;CACvC,MAAM,EAAE,YAAY,MAAM,OAAO;CACjC,MAAM,WAAW,cAAc,QAAQ,MAAM,cAAc,CAAC;CAE5D,IAAI;CACJ,IAAI;CACJ,IAAI;EACF,SAAS,SAAS,QAAQ,8BAA8B;EACxD,mBAAmB,SAAS,QAAQ,oCAAoC;CAC1E,QAAQ;EACN,MAAM,QAAQ,uBAAuB;CACvC;CAGA,KAAK,MAAM,QAAQ,CAAC,UAAU,cAAc,gBAAgB,CAAY,GACtE,IAAI;EACF,OAAO;GAAE,OAAO,KAAK,aAAa;GAAgB;EAAO;CAC3D,QAAQ,CAER;CAEF,MAAM,QAAQ,aAAa;AAC7B;;;;;;AAOA,MAAa,0BAA0B,SAAmC;CACxE,IAAI;CAEJ,OAAO,OAAO,MAAM,OAAO;EACzB,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,CAAC;EAC3B,IAAI,KAAK,WAAW,IAAI,KAAK,CAAC,YAAY,KAAK,IAAI,KAAK,CAAC,aAAa,KAAK,IAAI,GAAG,OAAO;EAEzF,UAAU,UAAU,IAAI;EACxB,MAAM,EAAE,OAAO,WAAW,MAAM;EAGhC,MAAM,SAAmB,CAAC;EAC1B,IAAI,eAAe,KAAK,IAAI,GAAG,OAAO,KAAK,YAAY;EACvD,IAAI,YAAY,KAAK,IAAI,GAAG,OAAO,KAAK,KAAK;EAE7C,MAAM,SAAS,MAAM,MAAM,eAAe,MAAM;GAC9C,UAAU;GACV,SAAS;GACT,YAAY;GACZ,YAAY;GACZ,YAAY,EAAE,SAAS,OAAO;GAC9B,SAAS,CAAC,MAAM;EAClB,CAAC;EACD,IAAI,QAAQ,QAAQ,MAAM,OAAO;EACjC,OAAO;GAAE,MAAM,OAAO;GAAM,KAAK,OAAO,OAAO,OAAO,OAAO,KAAK,UAAU,OAAO,GAAG;EAAE;CAC1F;AACF"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Compat type. The base type of a native module spec. A library extends it for the module that
3
+ * it reads with `TurboModuleRegistry`.
4
+ */
5
+ export interface TurboModule {
6
+ readonly getConstants?: (() => {}) | undefined;
7
+ }
8
+ /**
9
+ * Compat export. A browser has no native modules, so `get` always returns `null`. A library
10
+ * that reads its native module at import time then takes its JavaScript path.
11
+ */
12
+ export declare const TurboModuleRegistry: {
13
+ get<T = unknown>(name: string): T | null;
14
+ getEnforcing<T = unknown>(name: string): T;
15
+ };
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,14 @@
1
+ // src/compat/TurboModuleRegistry/index.ts
2
+ /**
3
+ * Compat export. A browser has no native modules, so `get` always returns `null`. A library
4
+ * that reads its native module at import time then takes its JavaScript path.
5
+ */
6
+ const TurboModuleRegistry = {
7
+ get: () => null,
8
+ getEnforcing: (name) => {
9
+ throw new Error(`TurboModuleRegistry.getEnforcing(...): '${name}' could not be found. A browser has no native modules.`);
10
+ }
11
+ };
12
+ export { TurboModuleRegistry };
13
+
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/compat/TurboModuleRegistry/index.ts"],"sourcesContent":["/**\n * Compat type. The base type of a native module spec. A library extends it for the module that\n * it reads with `TurboModuleRegistry`.\n */\nexport interface TurboModule {\n // React Native's own type for the constants.\n // oxlint-disable-next-line typescript/no-empty-object-type\n readonly getConstants?: (() => {}) | undefined\n}\n\n/**\n * Compat export. A browser has no native modules, so `get` always returns `null`. A library\n * that reads its native module at import time then takes its JavaScript path.\n */\nexport const TurboModuleRegistry: {\n get<T = unknown>(name: string): T | null\n getEnforcing<T = unknown>(name: string): T\n} = {\n get: () => null,\n getEnforcing: (name) => {\n throw new Error(\n `TurboModuleRegistry.getEnforcing(...): '${name}' could not be found. ` +\n 'A browser has no native modules.',\n )\n },\n}\n"],"mappings":";;;;;AAcA,MAAa,sBAGT;CACF,WAAW;CACX,eAAe,SAAS;EACtB,MAAM,IAAI,MACR,2CAA2C,KAAK,uDAElD;CACF;AACF"}
@@ -0,0 +1,9 @@
1
+ import { ElementType, ReactElement } from "react";
2
+ export type CreateElementProps = Readonly<Record<string, unknown>>;
3
+ /**
4
+ * Compat export. Renders `type` with React Native props: `style` compiles to class names, and
5
+ * the accessibility props become ARIA attributes. Every other prop goes to the element as it
6
+ * is. Libraries such as `react-native-svg` import it from `react-native` on the web.
7
+ */
8
+ export declare const unstable_createElement: (type: ElementType, props?: CreateElementProps | null) => ReactElement;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,40 @@
1
+ import { isNativeHandler, toDOMProps } from "../../render/domProps.js";
2
+ import { compileStyle } from "../../style/compile.js";
3
+ import { useStyleRegistry } from "../../style/StyleRegistryContext.js";
4
+ import { createElement } from "react";
5
+ // src/compat/createElement/index.tsx
6
+ const mappedProps = /* @__PURE__ */ new Set([
7
+ "focusable",
8
+ "importantForAccessibility",
9
+ "nativeID",
10
+ "testID"
11
+ ]);
12
+ const isNativeOnly = (name) => mappedProps.has(name) || name.startsWith("accessibility") || isNativeHandler(name);
13
+ function Host({ type, props }) {
14
+ const registry = useStyleRegistry();
15
+ const { className, style, ...rest } = props;
16
+ const domProps = {};
17
+ for (const name in rest) if (!isNativeOnly(name)) domProps[name] = rest[name];
18
+ Object.assign(domProps, toDOMProps(rest));
19
+ const compiled = compileStyle(style, registry);
20
+ const classes = typeof className === "string" && className !== "" ? [className] : [];
21
+ if (compiled !== "") classes.push(compiled);
22
+ if (classes.length > 0) domProps["className"] = classes.join(" ");
23
+ return createElement(type, domProps);
24
+ }
25
+ /**
26
+ * Compat export. Renders `type` with React Native props: `style` compiles to class names, and
27
+ * the accessibility props become ARIA attributes. Every other prop goes to the element as it
28
+ * is. Libraries such as `react-native-svg` import it from `react-native` on the web.
29
+ */
30
+ const unstable_createElement = (type, props) => {
31
+ const hostProps = props ?? {};
32
+ return createElement(Host, {
33
+ key: hostProps["key"],
34
+ type,
35
+ props: hostProps
36
+ });
37
+ };
38
+ export { unstable_createElement };
39
+
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/compat/createElement/index.tsx"],"sourcesContent":["import { createElement, type ElementType, type Key, type ReactElement } from 'react'\n\nimport { isNativeHandler, toDOMProps } from '../../render/domProps'\nimport { compileStyle } from '../../style/compile'\nimport { useStyleRegistry } from '../../style/StyleRegistryContext'\nimport type { FlatStyle, StyleProp } from '../../style/types'\n\nexport type CreateElementProps = Readonly<Record<string, unknown>>\n\n// `toDOMProps` turns these into DOM attributes, so the names themselves never reach the element.\nconst mappedProps = new Set(['focusable', 'importantForAccessibility', 'nativeID', 'testID'])\n\nconst isNativeOnly = (name: string): boolean =>\n mappedProps.has(name) || name.startsWith('accessibility') || isNativeHandler(name)\n\ntype HostProps = { type: ElementType; props: CreateElementProps }\n\n// The style registry comes from a context, and the caller can be a class component.\n// So the host element renders inside this component.\nfunction Host({ type, props }: HostProps): ReactElement {\n const registry = useStyleRegistry()\n const { className, style, ...rest } = props\n\n // Unlike `View`, an unknown prop stays: `d`, `fill`, and `viewBox` of an SVG element must\n // reach the element.\n const domProps: Record<string, unknown> = {}\n for (const name in rest) {\n if (!isNativeOnly(name)) domProps[name] = rest[name]\n }\n Object.assign(domProps, toDOMProps(rest as Parameters<typeof toDOMProps>[0]))\n\n const compiled = compileStyle(style as StyleProp<FlatStyle>, registry)\n const classes = typeof className === 'string' && className !== '' ? [className] : []\n if (compiled !== '') classes.push(compiled)\n if (classes.length > 0) domProps['className'] = classes.join(' ')\n\n return createElement(type, domProps)\n}\n\n/**\n * Compat export. Renders `type` with React Native props: `style` compiles to class names, and\n * the accessibility props become ARIA attributes. Every other prop goes to the element as it\n * is. Libraries such as `react-native-svg` import it from `react-native` on the web.\n */\nexport const unstable_createElement = (\n type: ElementType,\n props?: CreateElementProps | null,\n): ReactElement => {\n const hostProps = props ?? {}\n return createElement(Host, { key: hostProps['key'] as Key | undefined, type, props: hostProps })\n}\n"],"mappings":";;;;;AAUA,MAAM,8BAAc,IAAI,IAAI;CAAC;CAAa;CAA6B;CAAY;AAAQ,CAAC;AAE5F,MAAM,gBAAgB,SACpB,YAAY,IAAI,IAAI,KAAK,KAAK,WAAW,eAAe,KAAK,gBAAgB,IAAI;AAMnF,SAAS,KAAK,EAAE,MAAM,SAAkC;CACtD,MAAM,WAAW,iBAAiB;CAClC,MAAM,EAAE,WAAW,OAAO,GAAG,SAAS;CAItC,MAAM,WAAoC,CAAC;CAC3C,KAAK,MAAM,QAAQ,MACjB,IAAI,CAAC,aAAa,IAAI,GAAG,SAAS,QAAQ,KAAK;CAEjD,OAAO,OAAO,UAAU,WAAW,IAAwC,CAAC;CAE5E,MAAM,WAAW,aAAa,OAA+B,QAAQ;CACrE,MAAM,UAAU,OAAO,cAAc,YAAY,cAAc,KAAK,CAAC,SAAS,IAAI,CAAC;CACnF,IAAI,aAAa,IAAI,QAAQ,KAAK,QAAQ;CAC1C,IAAI,QAAQ,SAAS,GAAG,SAAS,eAAe,QAAQ,KAAK,GAAG;CAEhE,OAAO,cAAc,MAAM,QAAQ;AACrC;;;;;;AAOA,MAAa,0BACX,MACA,UACiB;CACjB,MAAM,YAAY,SAAS,CAAC;CAC5B,OAAO,cAAc,MAAM;EAAE,KAAK,UAAU;EAA2B;EAAM,OAAO;CAAU,CAAC;AACjG"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Compat export. On native it returns the tag of a view. On the web it returns the DOM element
3
+ * of a ref, of an element, or of a scroll component. A number comes back as it is. A class
4
+ * component instance gives `null`, because React has no `findDOMNode`.
5
+ */
6
+ export declare const findNodeHandle: (componentOrHandle: unknown) => Element | number | null;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,19 @@
1
+ // src/compat/findNodeHandle/index.ts
2
+ const isElement = (value) => value.nodeType === 1;
3
+ /**
4
+ * Compat export. On native it returns the tag of a view. On the web it returns the DOM element
5
+ * of a ref, of an element, or of a scroll component. A number comes back as it is. A class
6
+ * component instance gives `null`, because React has no `findDOMNode`.
7
+ */
8
+ const findNodeHandle = (componentOrHandle) => {
9
+ if (typeof componentOrHandle === "number") return componentOrHandle;
10
+ if (typeof componentOrHandle !== "object" || componentOrHandle === null) return null;
11
+ if (isElement(componentOrHandle)) return componentOrHandle;
12
+ const { getScrollableNode } = componentOrHandle;
13
+ if (typeof getScrollableNode === "function") return findNodeHandle(getScrollableNode.call(componentOrHandle));
14
+ if ("current" in componentOrHandle) return findNodeHandle(componentOrHandle.current);
15
+ return null;
16
+ };
17
+ export { findNodeHandle };
18
+
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/compat/findNodeHandle/index.ts"],"sourcesContent":["const isElement = (value: object): value is Element =>\n (value as { nodeType?: unknown }).nodeType === 1\n\n/**\n * Compat export. On native it returns the tag of a view. On the web it returns the DOM element\n * of a ref, of an element, or of a scroll component. A number comes back as it is. A class\n * component instance gives `null`, because React has no `findDOMNode`.\n */\nexport const findNodeHandle = (componentOrHandle: unknown): Element | number | null => {\n if (typeof componentOrHandle === 'number') return componentOrHandle\n if (typeof componentOrHandle !== 'object' || componentOrHandle === null) return null\n if (isElement(componentOrHandle)) return componentOrHandle\n\n const { getScrollableNode } = componentOrHandle as { getScrollableNode?: unknown }\n if (typeof getScrollableNode === 'function') {\n return findNodeHandle(getScrollableNode.call(componentOrHandle))\n }\n if ('current' in componentOrHandle) return findNodeHandle(componentOrHandle.current)\n return null\n}\n"],"mappings":";AAAA,MAAM,aAAa,UAChB,MAAiC,aAAa;;;;;;AAOjD,MAAa,kBAAkB,sBAAwD;CACrF,IAAI,OAAO,sBAAsB,UAAU,OAAO;CAClD,IAAI,OAAO,sBAAsB,YAAY,sBAAsB,MAAM,OAAO;CAChF,IAAI,UAAU,iBAAiB,GAAG,OAAO;CAEzC,MAAM,EAAE,sBAAsB;CAC9B,IAAI,OAAO,sBAAsB,YAC/B,OAAO,eAAe,kBAAkB,KAAK,iBAAiB,CAAC;CAEjE,IAAI,aAAa,mBAAmB,OAAO,eAAe,kBAAkB,OAAO;CACnF,OAAO;AACT"}
@@ -0,0 +1,5 @@
1
+ import { ActivityIndicatorProps } from "./types.js";
2
+ import { ReactElement } from "react";
3
+ export declare function ActivityIndicator(props: ActivityIndicatorProps): ReactElement;
4
+ export type { ActivityIndicatorProps };
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,74 @@
1
+ import { StyleSheet } from "../../apis/StyleSheet/index.js";
2
+ import { toCSSColor } from "../../style/color.js";
3
+ import { useStyleRegistry } from "../../style/StyleRegistryContext.js";
4
+ import { webStyle } from "../../style/webStyle.js";
5
+ import { View } from "../View/index.js";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ // src/components/ActivityIndicator/index.tsx
8
+ const GRAY = "#999999";
9
+ const SPIN_CLASS = "rn-activity-indicator";
10
+ const SPIN_RULES = ["@keyframes rn-activity-indicator-spin{to{transform:rotate(360deg)}}", `.${SPIN_CLASS}{animation:rn-activity-indicator-spin .75s linear infinite}`];
11
+ const hiddenStyle = webStyle({ visibility: "hidden" });
12
+ const pausedStyle = { animationPlayState: "paused" };
13
+ function ActivityIndicator(props) {
14
+ const { animating = true, color = GRAY, hidesWhenStopped = true, onLayout, ref, size = "small", style, ...rest } = props;
15
+ const spinClass = useStyleRegistry().staticClass(SPIN_CLASS, SPIN_RULES);
16
+ const stroke = toCSSColor(color) ?? GRAY;
17
+ const sizeStyle = size === "small" ? styles.sizeSmall : size === "large" ? styles.sizeLarge : {
18
+ width: size,
19
+ height: size
20
+ };
21
+ return /* @__PURE__ */ jsx(View, {
22
+ onLayout,
23
+ style: [styles.container, style],
24
+ children: /* @__PURE__ */ jsx(View, {
25
+ role: "progressbar",
26
+ ...rest,
27
+ ref,
28
+ style: [sizeStyle, !animating && hidesWhenStopped && hiddenStyle],
29
+ children: /* @__PURE__ */ jsxs("svg", {
30
+ "aria-hidden": true,
31
+ className: spinClass,
32
+ height: "100%",
33
+ style: animating ? void 0 : pausedStyle,
34
+ viewBox: "0 0 32 32",
35
+ width: "100%",
36
+ children: [/* @__PURE__ */ jsx("circle", {
37
+ cx: "16",
38
+ cy: "16",
39
+ fill: "none",
40
+ opacity: "0.2",
41
+ r: "14",
42
+ stroke,
43
+ strokeWidth: "4"
44
+ }), /* @__PURE__ */ jsx("circle", {
45
+ cx: "16",
46
+ cy: "16",
47
+ fill: "none",
48
+ r: "14",
49
+ stroke,
50
+ strokeDasharray: "80",
51
+ strokeDashoffset: "60",
52
+ strokeWidth: "4"
53
+ })]
54
+ })
55
+ })
56
+ });
57
+ }
58
+ const styles = StyleSheet.create({
59
+ container: {
60
+ alignItems: "center",
61
+ justifyContent: "center"
62
+ },
63
+ sizeSmall: {
64
+ width: 20,
65
+ height: 20
66
+ },
67
+ sizeLarge: {
68
+ width: 36,
69
+ height: 36
70
+ }
71
+ });
72
+ export { ActivityIndicator };
73
+
74
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/ActivityIndicator/index.tsx"],"sourcesContent":["import type { ReactElement } from 'react'\n\nimport { StyleSheet } from '../../apis/StyleSheet'\nimport { toCSSColor } from '../../style/color'\nimport { useStyleRegistry } from '../../style/StyleRegistryContext'\nimport { webStyle } from '../../style/webStyle'\nimport { View } from '../View'\nimport type { ActivityIndicatorProps } from './types'\n\nexport type { ActivityIndicatorProps } from './types'\n\nconst GRAY = '#999999'\n\nconst SPIN_CLASS = 'rn-activity-indicator'\nconst SPIN_RULES = [\n '@keyframes rn-activity-indicator-spin{to{transform:rotate(360deg)}}',\n `.${SPIN_CLASS}{animation:rn-activity-indicator-spin .75s linear infinite}`,\n]\n\nconst hiddenStyle = webStyle({ visibility: 'hidden' })\n\nconst pausedStyle = { animationPlayState: 'paused' }\n\nexport function ActivityIndicator(props: ActivityIndicatorProps): ReactElement {\n const {\n animating = true,\n color = GRAY,\n hidesWhenStopped = true,\n onLayout,\n ref,\n size = 'small',\n style,\n ...rest\n } = props\n\n const registry = useStyleRegistry()\n const spinClass = registry.staticClass(SPIN_CLASS, SPIN_RULES)\n const stroke = toCSSColor(color) ?? GRAY\n\n const sizeStyle =\n size === 'small'\n ? styles.sizeSmall\n : size === 'large'\n ? styles.sizeLarge\n : { width: size, height: size }\n\n // As on native: the container gets `style` and `onLayout`, the indicator gets the other props\n // and the ref.\n return (\n <View onLayout={onLayout} style={[styles.container, style]}>\n <View\n role=\"progressbar\"\n {...rest}\n ref={ref}\n style={[sizeStyle, !animating && hidesWhenStopped && hiddenStyle]}\n >\n <svg\n aria-hidden\n className={spinClass}\n height=\"100%\"\n style={animating ? undefined : pausedStyle}\n viewBox=\"0 0 32 32\"\n width=\"100%\"\n >\n <circle\n cx=\"16\"\n cy=\"16\"\n fill=\"none\"\n opacity=\"0.2\"\n r=\"14\"\n stroke={stroke}\n strokeWidth=\"4\"\n />\n <circle\n cx=\"16\"\n cy=\"16\"\n fill=\"none\"\n r=\"14\"\n stroke={stroke}\n strokeDasharray=\"80\"\n strokeDashoffset=\"60\"\n strokeWidth=\"4\"\n />\n </svg>\n </View>\n </View>\n )\n}\n\nconst styles = StyleSheet.create({\n container: { alignItems: 'center', justifyContent: 'center' },\n sizeSmall: { width: 20, height: 20 },\n sizeLarge: { width: 36, height: 36 },\n})\n"],"mappings":";;;;;;;AAWA,MAAM,OAAO;AAEb,MAAM,aAAa;AACnB,MAAM,aAAa,CACjB,uEACA,IAAI,WAAW,4DACjB;AAEA,MAAM,cAAc,SAAS,EAAE,YAAY,SAAS,CAAC;AAErD,MAAM,cAAc,EAAE,oBAAoB,SAAS;AAEnD,SAAgB,kBAAkB,OAA6C;CAC7E,MAAM,EACJ,YAAY,MACZ,QAAQ,MACR,mBAAmB,MACnB,UACA,KACA,OAAO,SACP,OACA,GAAG,SACD;CAGJ,MAAM,YADW,iBACQ,CAAC,CAAC,YAAY,YAAY,UAAU;CAC7D,MAAM,SAAS,WAAW,KAAK,KAAK;CAEpC,MAAM,YACJ,SAAS,UACL,OAAO,YACP,SAAS,UACP,OAAO,YACP;EAAE,OAAO;EAAM,QAAQ;CAAK;CAIpC,OACE,oBAAC,MAAD;EAAgB;EAAU,OAAO,CAAC,OAAO,WAAW,KAAK;EACvD,UAAA,oBAAC,MAAD;GACE,MAAK;GACL,GAAI;GACC;GACL,OAAO,CAAC,WAAW,CAAC,aAAa,oBAAoB,WAAW;GAEhE,UAAA,qBAAC,OAAD;IACE,eAAA;IACA,WAAW;IACX,QAAO;IACP,OAAO,YAAY,KAAA,IAAY;IAC/B,SAAQ;IACR,OAAM;IANR,UAAA,CAQE,oBAAC,UAAD;KACE,IAAG;KACH,IAAG;KACH,MAAK;KACL,SAAQ;KACR,GAAE;KACM;KACR,aAAY;IACb,CAAA,GACD,oBAAC,UAAD;KACE,IAAG;KACH,IAAG;KACH,MAAK;KACL,GAAE;KACM;KACR,iBAAgB;KAChB,kBAAiB;KACjB,aAAY;IACb,CAAA,CACE;;EACD,CAAA;CACF,CAAA;AAEV;AAEA,MAAM,SAAS,WAAW,OAAO;CAC/B,WAAW;EAAE,YAAY;EAAU,gBAAgB;CAAS;CAC5D,WAAW;EAAE,OAAO;EAAI,QAAQ;CAAG;CACnC,WAAW;EAAE,OAAO;EAAI,QAAQ;CAAG;AACrC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { ViewProps } from "../View/types.js";
2
+ export interface ActivityIndicatorProps extends ViewProps {
3
+ animating?: boolean | undefined;
4
+ color?: string | undefined;
5
+ hidesWhenStopped?: boolean | undefined;
6
+ size?: number | "small" | "large" | undefined;
7
+ }
8
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { ButtonProps } from "./types.js";
2
+ import { ReactElement } from "react";
3
+ export declare function Button(props: ButtonProps): ReactElement;
4
+ export type { ButtonProps };
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,48 @@
1
+ import { StyleSheet } from "../../apis/StyleSheet/index.js";
2
+ import { Text } from "../Text/index.js";
3
+ import { TouchableOpacity } from "../TouchableOpacity/index.js";
4
+ import { jsx } from "react/jsx-runtime";
5
+ // src/components/Button/index.tsx
6
+ function Button(props) {
7
+ const { accessibilityActions: _accessibilityActions, accessibilityLanguage, accessibilityState, "aria-disabled": ariaDisabled, color, importantForAccessibility, onAccessibilityAction: _onAccessibilityAction, title, ...rest } = props;
8
+ if (typeof title !== "string") throw new Error("The title prop of a Button must be a string");
9
+ const disabled = props.disabled ?? ariaDisabled ?? accessibilityState?.disabled;
10
+ const state = disabled === accessibilityState?.disabled ? accessibilityState : {
11
+ ...accessibilityState,
12
+ disabled
13
+ };
14
+ return /* @__PURE__ */ jsx(TouchableOpacity, {
15
+ ...rest,
16
+ ...accessibilityLanguage !== void 0 && { lang: accessibilityLanguage },
17
+ role: "button",
18
+ accessibilityState: state,
19
+ disabled,
20
+ importantForAccessibility: importantForAccessibility === "no" ? "no-hide-descendants" : importantForAccessibility,
21
+ style: [
22
+ styles.button,
23
+ color != null && color !== "" && { backgroundColor: color },
24
+ disabled === true && styles.buttonDisabled
25
+ ],
26
+ children: /* @__PURE__ */ jsx(Text, {
27
+ style: [styles.text, disabled === true && styles.textDisabled],
28
+ children: title
29
+ })
30
+ });
31
+ }
32
+ const styles = StyleSheet.create({
33
+ button: {
34
+ backgroundColor: "#2196F3",
35
+ borderRadius: 2
36
+ },
37
+ text: {
38
+ color: "white",
39
+ fontWeight: "500",
40
+ margin: 8,
41
+ textAlign: "center"
42
+ },
43
+ buttonDisabled: { backgroundColor: "#dfdfdf" },
44
+ textDisabled: { color: "#a1a1a1" }
45
+ });
46
+ export { Button };
47
+
48
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Button/index.tsx"],"sourcesContent":["import type { ReactElement } from 'react'\n\nimport { StyleSheet } from '../../apis/StyleSheet'\nimport { Text } from '../Text'\nimport { TouchableOpacity } from '../TouchableOpacity'\nimport type { ButtonProps } from './types'\n\nexport type { ButtonProps } from './types'\n\nexport function Button(props: ButtonProps): ReactElement {\n const {\n accessibilityActions: _accessibilityActions,\n accessibilityLanguage,\n accessibilityState,\n 'aria-disabled': ariaDisabled,\n color,\n importantForAccessibility,\n onAccessibilityAction: _onAccessibilityAction,\n title,\n ...rest\n } = props\n\n if (typeof title !== 'string') throw new Error('The title prop of a Button must be a string')\n\n const disabled = props.disabled ?? ariaDisabled ?? accessibilityState?.disabled\n // As in React Native, the state follows the resolved value, so `disabled={false}` wins.\n const state =\n disabled === accessibilityState?.disabled\n ? accessibilityState\n : { ...accessibilityState, disabled }\n\n // One element, where React Native has a View inside the touchable: a <button> takes no <div>.\n return (\n <TouchableOpacity\n {...rest}\n {...(accessibilityLanguage !== undefined && { lang: accessibilityLanguage })}\n role=\"button\"\n accessibilityState={state}\n disabled={disabled}\n // As in React Native: `no` also hides the text inside.\n importantForAccessibility={\n importantForAccessibility === 'no' ? 'no-hide-descendants' : importantForAccessibility\n }\n style={[\n styles.button,\n color != null && color !== '' && { backgroundColor: color },\n disabled === true && styles.buttonDisabled,\n ]}\n >\n <Text style={[styles.text, disabled === true && styles.textDisabled]}>{title}</Text>\n </TouchableOpacity>\n )\n}\n\n// The look of React Native's Button on Android, without the elevation.\nconst styles = StyleSheet.create({\n button: { backgroundColor: '#2196F3', borderRadius: 2 },\n text: { color: 'white', fontWeight: '500', margin: 8, textAlign: 'center' },\n buttonDisabled: { backgroundColor: '#dfdfdf' },\n textDisabled: { color: '#a1a1a1' },\n})\n"],"mappings":";;;;;AASA,SAAgB,OAAO,OAAkC;CACvD,MAAM,EACJ,sBAAsB,uBACtB,uBACA,oBACA,iBAAiB,cACjB,OACA,2BACA,uBAAuB,wBACvB,OACA,GAAG,SACD;CAEJ,IAAI,OAAO,UAAU,UAAU,MAAM,IAAI,MAAM,6CAA6C;CAE5F,MAAM,WAAW,MAAM,YAAY,gBAAgB,oBAAoB;CAEvE,MAAM,QACJ,aAAa,oBAAoB,WAC7B,qBACA;EAAE,GAAG;EAAoB;CAAS;CAGxC,OACE,oBAAC,kBAAD;EACE,GAAI;EACJ,GAAK,0BAA0B,KAAA,KAAa,EAAE,MAAM,sBAAsB;EAC1E,MAAK;EACL,oBAAoB;EACV;EAEV,2BACE,8BAA8B,OAAO,wBAAwB;EAE/D,OAAO;GACL,OAAO;GACP,SAAS,QAAQ,UAAU,MAAM,EAAE,iBAAiB,MAAM;GAC1D,aAAa,QAAQ,OAAO;EAC9B;EAEA,UAAA,oBAAC,MAAD;GAAM,OAAO,CAAC,OAAO,MAAM,aAAa,QAAQ,OAAO,YAAY;GAAI,UAAA;EAAY,CAAA;CACnE,CAAA;AAEtB;AAGA,MAAM,SAAS,WAAW,OAAO;CAC/B,QAAQ;EAAE,iBAAiB;EAAW,cAAc;CAAE;CACtD,MAAM;EAAE,OAAO;EAAS,YAAY;EAAO,QAAQ;EAAG,WAAW;CAAS;CAC1E,gBAAgB,EAAE,iBAAiB,UAAU;CAC7C,cAAc,EAAE,OAAO,UAAU;AACnC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { GestureResponderEvent } from "../../events/types.js";
2
+ import { TouchableTVProps } from "../TouchableWithoutFeedback/types.js";
3
+ import { AccessibilityState, HostInstance } from "../View/types.js";
4
+ import { Ref } from "react";
5
+ export interface ButtonProps extends TouchableTVProps {
6
+ title: string;
7
+ onPress?: ((event: GestureResponderEvent) => unknown) | undefined;
8
+ color?: string | undefined;
9
+ disabled?: boolean | undefined;
10
+ testID?: string | undefined;
11
+ ref?: Ref<HostInstance> | undefined;
12
+ accessible?: boolean | undefined;
13
+ accessibilityLabel?: string | undefined;
14
+ accessibilityHint?: string | undefined;
15
+ accessibilityLanguage?: string | undefined;
16
+ accessibilityState?: AccessibilityState | undefined;
17
+ importantForAccessibility?: "auto" | "yes" | "no" | "no-hide-descendants" | undefined;
18
+ "aria-busy"?: boolean | undefined;
19
+ "aria-checked"?: boolean | "mixed" | undefined;
20
+ "aria-disabled"?: boolean | undefined;
21
+ "aria-expanded"?: boolean | undefined;
22
+ "aria-label"?: string | undefined;
23
+ "aria-selected"?: boolean | undefined;
24
+ accessibilityActions?: ReadonlyArray<{
25
+ name: string;
26
+ label?: string | undefined;
27
+ }> | undefined;
28
+ onAccessibilityAction?: ((event: unknown) => unknown) | undefined;
29
+ touchSoundDisabled?: boolean | undefined;
30
+ }
31
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { CellRendererProps, FlatListInstance, FlatListProps, ListRenderItem, ListRenderItemInfo, ListSeparatorComponent, ListSeparatorProps, ListSeparators, ScrollToIndexParams, ScrollToItemParams, ScrollToOffsetParams, ViewToken, ViewabilityConfig, ViewabilityConfigCallbackPair, ViewabilityConfigCallbackPairs, ViewableItemsChangedInfo } from "./types.js";
2
+ import { ReactElement } from "react";
3
+ export declare function FlatList<ItemT>(props: FlatListProps<ItemT>): ReactElement;
4
+ export type { CellRendererProps, FlatListInstance, FlatListProps, ListRenderItem, ListRenderItemInfo, ListSeparatorComponent, ListSeparatorProps, ListSeparators, ScrollToIndexParams, ScrollToItemParams, ScrollToOffsetParams, ViewToken, ViewabilityConfig, ViewabilityConfigCallbackPair, ViewabilityConfigCallbackPairs, ViewableItemsChangedInfo };
5
+ //# sourceMappingURL=index.d.ts.map