peachsim 0.1.2306 → 0.1.2364

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 (917) hide show
  1. package/README.md +5 -0
  2. package/cli/cdp.ts +81 -0
  3. package/cli/cloud-box-artifact.ts +6 -1
  4. package/cli/cloud-client.ts +19 -0
  5. package/cli/command-registry.ts +1 -0
  6. package/cli/commands/box/bundle-plane.ts +28 -4
  7. package/cli/commands/box.ts +13 -8
  8. package/cli/commands/canvas.ts +752 -0
  9. package/cli/commands/cleanup.ts +2 -0
  10. package/cli/commands/control.ts +22 -6
  11. package/cli/commands/cpu-profile.ts +1 -80
  12. package/cli/commands/debug.ts +73 -5
  13. package/cli/commands/flow.ts +1 -1
  14. package/cli/commands/inspect/actions.ts +3 -1
  15. package/cli/commands/inspect/core.ts +18 -5
  16. package/cli/commands/inspect/settling.ts +20 -19
  17. package/cli/commands/inspect.ts +24 -14
  18. package/cli/commands/map.ts +31 -8
  19. package/cli/commands/platform.ts +89 -7
  20. package/cli/commands/serve.ts +66 -4
  21. package/cli/commands/shell-url.ts +25 -5
  22. package/cli/commands/task-trace.ts +234 -0
  23. package/cli/dev-build-freshness.ts +151 -49
  24. package/cli/drivers/linux-cocoapods.lock.json +303 -0
  25. package/cli/drivers/linux-cocoapods.ts +99 -0
  26. package/cli/drivers/playwright.ts +1 -5
  27. package/cli/internal-child-contract.ts +1 -0
  28. package/cli/internal-child.ts +6 -0
  29. package/cli/main.ts +6 -0
  30. package/cli/outbound-endpoints.ts +35 -2
  31. package/cli/output-redaction.ts +1 -1
  32. package/cli/remote-metro.ts +109 -0
  33. package/cli/task-trace.ts +166 -0
  34. package/cli/taskTraceContract.ts +53 -0
  35. package/cli/ws-bridge.ts +11 -4
  36. package/detox/gestures.ts +4 -4
  37. package/detox/index.ts +10 -3
  38. package/dist-lib/agent-daemon-client.cjs +1 -1
  39. package/dist-lib/agent-events.cjs +1 -1
  40. package/dist-lib/attached-projects.cjs +1 -1
  41. package/dist-lib/auth/shared-session.cjs +1 -1
  42. package/dist-lib/backend-origin.cjs +1 -1
  43. package/dist-lib/beta.cjs +1 -1
  44. package/dist-lib/beta.mjs +1 -1
  45. package/dist-lib/bridge-constants.cjs +1 -1
  46. package/dist-lib/bridge-contract-input.cjs +1 -1
  47. package/dist-lib/bridge-contract-input.mjs +1 -1
  48. package/dist-lib/bridge-contract.cjs +1 -1
  49. package/dist-lib/bridge-contract.mjs +1 -1
  50. package/dist-lib/bundle-channel.cjs +15093 -9243
  51. package/dist-lib/capture-contract.cjs +1 -1
  52. package/dist-lib/capture-contract.mjs +1 -1
  53. package/dist-lib/cloud-contract.cjs +1 -1
  54. package/dist-lib/cloud-contract.mjs +1 -1
  55. package/dist-lib/cloud-test-args.cjs +1 -1
  56. package/dist-lib/cloud-test-args.mjs +1 -1
  57. package/dist-lib/cloud.cjs +1 -1
  58. package/dist-lib/cloud.mjs +1 -1
  59. package/dist-lib/config.cjs +2 -2
  60. package/dist-lib/config.mjs +2 -2
  61. package/dist-lib/detox/index.cjs +79 -55
  62. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  63. package/dist-lib/expo-swift-bundle.cjs +12391 -7202
  64. package/dist-lib/expo-swift-metadata.cjs +3 -1
  65. package/dist-lib/expo-swift-metadata.mjs +3 -1
  66. package/dist-lib/home-paths.cjs +1 -1
  67. package/dist-lib/host/bridge-host.cjs +12498 -8638
  68. package/dist-lib/host/fetch-proxy-handler.cjs +431 -206
  69. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  70. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  71. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  72. package/dist-lib/host/websocket-proxy.cjs +17 -3
  73. package/dist-lib/index.cjs +2187 -805
  74. package/dist-lib/jump-to-source-babel.cjs +1 -1
  75. package/dist-lib/jump-to-source-native.cjs +1 -1
  76. package/dist-lib/kotlin-host.cjs +14 -12
  77. package/dist-lib/menu.cjs +1 -1
  78. package/dist-lib/menu.mjs +1 -1
  79. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  80. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  81. package/dist-lib/metro-production-bundle.cjs +1 -1
  82. package/dist-lib/metro-production-bundle.mjs +1 -1
  83. package/dist-lib/metro.cjs +2176 -791
  84. package/dist-lib/native-app-identity-project.cjs +1372 -336
  85. package/dist-lib/native-app-identity-project.mjs +1480 -437
  86. package/dist-lib/native-app-identity.cjs +11 -1
  87. package/dist-lib/native-app-identity.mjs +11 -1
  88. package/dist-lib/native-firebase-metadata.cjs +1 -1
  89. package/dist-lib/native-firebase-metadata.mjs +1 -1
  90. package/dist-lib/pdfium-raster.cjs +1 -1
  91. package/dist-lib/pdfium-raster.mjs +1 -1
  92. package/dist-lib/plist.cjs +1 -1
  93. package/dist-lib/plist.mjs +1 -1
  94. package/dist-lib/profiles.cjs +1 -1
  95. package/dist-lib/public-brand.cjs +1 -1
  96. package/dist-lib/public-origins-lib-esm.json +33 -26
  97. package/dist-lib/public-origins-lib.json +219 -124
  98. package/dist-lib/react-native-host-modules.cjs +26 -2
  99. package/dist-lib/react-native-host-modules.mjs +24 -2
  100. package/dist-lib/reap-browser.cjs +2 -2
  101. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  102. package/dist-lib/sdk.cjs +42 -28
  103. package/dist-lib/sdk.mjs +42 -28
  104. package/dist-lib/skills.cjs +13911 -9671
  105. package/dist-lib/swift-compile.cjs +2066 -1691
  106. package/dist-lib/swift-compile.mjs +1942 -1566
  107. package/dist-lib/swift-package.cjs +18 -10
  108. package/dist-lib/swift-package.mjs +18 -10
  109. package/dist-lib/swift-submit.cjs +2 -2
  110. package/dist-lib/swift-submit.mjs +2 -2
  111. package/dist-lib/swift-toolchain.cjs +20 -1
  112. package/dist-lib/swift.cjs +1 -1
  113. package/dist-lib/vite-swift.cjs +5344 -3572
  114. package/dist-lib/vite.cjs +2890 -2523
  115. package/dist-lib/worklet-executable.cjs +36 -10
  116. package/dist-lib/worklet-executable.mjs +36 -10
  117. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-gesture-handler.d.ts +2 -1
  118. package/dist-types/packages/peach-engine/src/cli-companion.d.ts +0 -1
  119. package/dist-types/packages/peach-engine/src/engine/android-stretch-effect.d.ts +0 -8
  120. package/dist-types/packages/peach-engine/src/engine/animated-driven-style.d.ts +3 -0
  121. package/dist-types/packages/peach-engine/src/engine/animated.d.ts +2 -0
  122. package/dist-types/packages/peach-engine/src/engine/animation-graph.d.ts +2 -0
  123. package/dist-types/packages/peach-engine/src/engine/audioContract.d.ts +14 -0
  124. package/dist-types/packages/peach-engine/src/engine/canvaskit-api.d.ts +7 -4
  125. package/dist-types/packages/peach-engine/src/engine/core-layout-program.d.ts +19 -0
  126. package/dist-types/packages/peach-engine/src/engine/core-layout-transition.d.ts +31 -0
  127. package/dist-types/packages/peach-engine/src/engine/debug-channels.d.ts +86 -0
  128. package/dist-types/packages/peach-engine/src/engine/fiber-debug-metadata.d.ts +1 -0
  129. package/dist-types/packages/peach-engine/src/engine/generated/node-kind-contract.d.ts +3 -0
  130. package/dist-types/packages/peach-engine/src/engine/glass-material.d.ts +3 -2
  131. package/dist-types/packages/peach-engine/src/engine/host-composite.d.ts +1 -1
  132. package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +5 -2
  133. package/dist-types/packages/peach-engine/src/engine/inspect-info.d.ts +0 -1
  134. package/dist-types/packages/peach-engine/src/engine/layout-animation-owner.d.ts +60 -0
  135. package/dist-types/packages/peach-engine/src/engine/liquid-glass-rect.d.ts +1 -0
  136. package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +8 -8
  137. package/dist-types/packages/peach-engine/src/engine/lottie-runtime.d.ts +4 -6
  138. package/dist-types/packages/peach-engine/src/engine/lottie-types.d.ts +14 -28
  139. package/dist-types/packages/peach-engine/src/engine/native-animation-driver.d.ts +5 -0
  140. package/dist-types/packages/peach-engine/src/engine/native-animation-graph.d.ts +8 -10
  141. package/dist-types/packages/peach-engine/src/engine/native-layout.d.ts +8 -1
  142. package/dist-types/packages/peach-engine/src/engine/native-node-drive.d.ts +7 -0
  143. package/dist-types/packages/peach-engine/src/engine/native-node-geometry.d.ts +34 -0
  144. package/dist-types/packages/peach-engine/src/engine/native-node-record.d.ts +62 -0
  145. package/dist-types/packages/peach-engine/src/engine/native-node-style-input.d.ts +6 -0
  146. package/dist-types/packages/peach-engine/src/engine/native-paint.d.ts +95 -0
  147. package/dist-types/packages/peach-engine/src/engine/{scroll-range.d.ts → native-scroll-geometry.d.ts} +5 -0
  148. package/dist-types/packages/peach-engine/src/engine/{scroll-platform.d.ts → native-scroll-personality.d.ts} +58 -72
  149. package/dist-types/packages/peach-engine/src/engine/native-scroll-tracker.d.ts +40 -0
  150. package/dist-types/packages/peach-engine/src/engine/native-style-store.d.ts +161 -0
  151. package/dist-types/packages/peach-engine/src/engine/native-text-style.d.ts +56 -0
  152. package/dist-types/packages/peach-engine/src/engine/native-trace.d.ts +18 -0
  153. package/dist-types/packages/peach-engine/src/engine/nativePaintContract.d.ts +68 -0
  154. package/dist-types/packages/peach-engine/src/engine/node.d.ts +53 -112
  155. package/dist-types/packages/peach-engine/src/engine/paint-boundary-types.d.ts +2 -2
  156. package/dist-types/packages/peach-engine/src/engine/portals.d.ts +20 -0
  157. package/dist-types/packages/peach-engine/src/engine/render-damage.d.ts +1 -0
  158. package/dist-types/packages/peach-engine/src/engine/rn-spring.d.ts +2 -9
  159. package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +201 -66
  160. package/dist-types/packages/peach-engine/src/engine/scroll-momentum-math.d.ts +10 -3
  161. package/dist-types/packages/peach-engine/src/engine/scroll.d.ts +5 -11
  162. package/dist-types/packages/peach-engine/src/engine/shell-owned-values.d.ts +8 -1
  163. package/dist-types/packages/peach-engine/src/engine/style-schema.d.ts +296 -0
  164. package/dist-types/packages/peach-engine/src/engine/text-line-break.d.ts +1 -0
  165. package/dist-types/packages/peach-engine/src/engine/text-metric-policy.d.ts +2 -2
  166. package/dist-types/packages/peach-engine/src/engine/text-nested.d.ts +1 -1
  167. package/dist-types/packages/peach-engine/src/engine/text-paint-receipt.d.ts +2 -3
  168. package/dist-types/packages/peach-engine/src/engine/text-paint.d.ts +4 -1
  169. package/dist-types/packages/peach-engine/src/engine/types.d.ts +18 -26
  170. package/dist-types/packages/peach-engine/src/engine/visible-frame.d.ts +1 -2
  171. package/dist-types/packages/peach-engine/src/engine/yoga-layout.d.ts +4 -2
  172. package/dist-types/packages/peach-engine/src/ios/apps/canvas-map-data.d.ts +40 -2
  173. package/dist-types/packages/peach-engine/src/ios/aux-home-scene.d.ts +1 -1
  174. package/dist-types/packages/peach-engine/src/kernel/kernel.d.ts +1 -0
  175. package/dist-types/packages/peach-engine/src/observability/types.d.ts +1 -0
  176. package/dist-types/packages/peach-engine/src/permissions/system-permission-types.d.ts +2 -3
  177. package/dist-types/packages/peach-engine/src/platform/android-back-panel.d.ts +15 -55
  178. package/dist-types/packages/peach-engine/src/platform/personality.d.ts +110 -48
  179. package/dist-types/packages/peach-engine/src/react-native/gesture-touch-metadata.d.ts +14 -0
  180. package/dist-types/packages/peach-engine/src/react-native/layout-animation.d.ts +1 -0
  181. package/dist-types/packages/peach-engine/src/remote-stream/client-config.d.ts +1 -0
  182. package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +9 -3
  183. package/dist-types/packages/peach-engine/src/render-worker/accessibilityHostContract.d.ts +65 -0
  184. package/dist-types/packages/peach-engine/src/render-worker/aux-surface-types.d.ts +33 -1
  185. package/dist-types/packages/peach-engine/src/render-worker/canvaskit-worker-init.d.ts +1 -1
  186. package/dist-types/packages/peach-engine/src/render-worker/compositor-content-readyContract.d.ts +10 -0
  187. package/dist-types/packages/peach-engine/src/render-worker/compositor-gpu.d.ts +5 -1
  188. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +81 -9
  189. package/dist-types/packages/peach-engine/src/render-worker/compositor-runtime/layer-claims.d.ts +116 -0
  190. package/dist-types/packages/peach-engine/src/render-worker/compositor-runtime/layer-fields.d.ts +57 -0
  191. package/dist-types/packages/peach-engine/src/render-worker/compositor-runtime/layer-tree.d.ts +100 -0
  192. package/dist-types/packages/peach-engine/src/render-worker/compositor-runtime/presentation-frame-layers.d.ts +42 -0
  193. package/dist-types/packages/peach-engine/src/render-worker/compositor-runtime/presentation-layers.d.ts +49 -0
  194. package/dist-types/packages/peach-engine/src/render-worker/compositor-runtime/render-tree.d.ts +1 -0
  195. package/dist-types/packages/peach-engine/src/render-worker/compositor-runtime/transition-program.d.ts +65 -0
  196. package/dist-types/packages/peach-engine/src/render-worker/gesture-arbitration-native.d.ts +17 -7
  197. package/dist-types/packages/peach-engine/src/render-worker/gesture-seam-protocol.d.ts +8 -1
  198. package/dist-types/packages/peach-engine/src/render-worker/graph-linked-value.d.ts +1 -0
  199. package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +3 -0
  200. package/dist-types/packages/peach-engine/src/render-worker/native-ui-protocol.d.ts +32 -2
  201. package/dist-types/packages/peach-engine/src/render-worker/native-widgetContract.d.ts +35 -3
  202. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +27 -3
  203. package/dist-types/packages/peach-engine/src/render-worker/scroll-mirror.d.ts +4 -3
  204. package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +14 -12
  205. package/dist-types/packages/peach-engine/src/render-worker/shell-tree-wire.d.ts +23 -3
  206. package/dist-types/packages/peach-engine/src/render-worker/test-bridge-protocol.d.ts +3 -2
  207. package/dist-types/packages/peach-engine/src/render-worker/text-inputContract.d.ts +6 -0
  208. package/dist-types/packages/peach-engine/src/render-worker/tree-sync-port.d.ts +9 -0
  209. package/dist-types/packages/peach-engine/src/render-worker/webgpu-frame-transaction.d.ts +7 -2
  210. package/dist-types/packages/peach-engine/src/render-worker/webview-capture-protocol.d.ts +1 -1
  211. package/dist-types/packages/peach-engine/src/render-worker/worker-input-runtime.d.ts +4 -6
  212. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +8 -13
  213. package/dist-types/packages/peach-engine/src/render-worker/worklet-wire.d.ts +9 -24
  214. package/dist-types/packages/peach-engine/src/settings/device-spec-bus.d.ts +1 -0
  215. package/dist-types/packages/peach-engine/src/settings/devices.d.ts +3 -0
  216. package/dist-types/packages/peach-globals/src/electronBridgeContract.d.ts +1 -0
  217. package/dist-types/packages/peach-globals/src/globalsContract.d.ts +33 -1
  218. package/dist-types/packages/peach-globals/src/imagePickerBridgeContract.d.ts +0 -1
  219. package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
  220. package/dist-types/packages/peach-globals/src/lockstepCaptureBridgeContract.d.ts +7 -0
  221. package/dist-types/packages/peach-globals/src/nativeSurfaceContract.d.ts +1 -0
  222. package/dist-types/packages/peach-globals/src/nodeContract.d.ts +3 -0
  223. package/dist-types/packages/peach-globals/src/performanceBridgeContract.d.ts +3 -1
  224. package/dist-types/packages/peach-globals/src/secure-item-store.d.ts +2 -1
  225. package/dist-types/packages/peach-globals/src/testBridgeContract.d.ts +11 -0
  226. package/dist-types/packages/peach-globals/src/timelineBridgeContract.d.ts +2 -1
  227. package/dist-types/packages/peach-globals/src/webViewBridgeContract.d.ts +65 -0
  228. package/dist-types/packages/peach-kit/src/capabilities.d.ts +24 -1
  229. package/dist-types/packages/peach-kit/src/internal.d.ts +2 -1
  230. package/dist-types/packages/peach-kit/src/runtime.d.ts +2 -2
  231. package/dist-types/packages/peach-kit/src/transitions/screen-transition-math.d.ts +29 -4
  232. package/dist-types/packages/peach-kit/src/ui/hosting-safe-area.d.ts +1 -0
  233. package/dist-types/packages/peach-kit/src/ui/{popover-placement.d.ts → native-popover.d.ts} +13 -8
  234. package/dist-types/packages/peach-kit/src/ui/native-tab-selection.d.ts +39 -0
  235. package/dist-types/packages/peach-kit/src/ui/presentationContract.d.ts +21 -0
  236. package/dist-types/packages/peach-kit/src/ui/swift-layout-contract.d.ts +33 -0
  237. package/java-platform/licenses/android.txt +4 -0
  238. package/java-platform/licenses/jzlib.txt +28 -0
  239. package/java-platform/licenses/openjdk.txt +11 -2
  240. package/kotlin/README.md +5 -2
  241. package/kotlin/fork/NOTICE +7 -1
  242. package/kotlin/sdk.tar.gz +0 -0
  243. package/kotlin/toolchain.json +9 -9
  244. package/node-runtime.d.json.ts +4 -0
  245. package/node-runtime.json +1 -0
  246. package/package.json +4 -1
  247. package/runtime-companion.json +1 -1
  248. package/sdk/ios/System/Library/Frameworks/AddressBook.framework/Headers/ABAddressBook.h +109 -0
  249. package/sdk/ios/System/Library/Frameworks/AddressBook.framework/Headers/ABGroup.h +41 -0
  250. package/sdk/ios/System/Library/Frameworks/AddressBook.framework/Headers/ABMultiValue.h +56 -0
  251. package/sdk/ios/System/Library/Frameworks/AddressBook.framework/Headers/ABPerson.h +208 -0
  252. package/sdk/ios/System/Library/Frameworks/AddressBook.framework/Headers/ABRecord.h +60 -0
  253. package/sdk/ios/System/Library/Frameworks/AddressBook.framework/Headers/ABSource.h +49 -0
  254. package/sdk/ios/System/Library/Frameworks/AddressBook.framework/Headers/AddressBook.h +53 -0
  255. package/sdk/ios/System/Library/Frameworks/AddressBook.framework/Headers/AddressBookDefines.h +24 -0
  256. package/sdk/ios/System/Library/Frameworks/AddressBook.framework/Modules/module.modulemap +5 -0
  257. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Modules/module.modulemap +13 -0
  258. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/CoreML.apinotes +95 -0
  259. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/CoreML.h +90 -0
  260. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLAllComputeDevices.h +30 -0
  261. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLArrayBatchProvider.h +33 -0
  262. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLBatchProvider.h +28 -0
  263. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLCPUComputeDevice.h +23 -0
  264. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLComputeDeviceProtocol.h +26 -0
  265. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLComputePlan.h +106 -0
  266. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLComputePlanCost.h +29 -0
  267. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLComputePlanDeviceUsage.h +29 -0
  268. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLCustomLayer.h +79 -0
  269. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLCustomModel.h +53 -0
  270. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLDictionaryConstraint.h +29 -0
  271. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLDictionaryFeatureProvider.h +39 -0
  272. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLExport.h +13 -0
  273. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLFeatureDescription.h +66 -0
  274. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLFeatureProvider.h +27 -0
  275. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLFeatureType.h +44 -0
  276. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLFeatureValue+MLImageConversion.h +96 -0
  277. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLFeatureValue.h +92 -0
  278. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLGPUComputeDevice.h +28 -0
  279. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLImageConstraint.h +40 -0
  280. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLImageSize.h +22 -0
  281. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLImageSizeConstraint.h +30 -0
  282. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLImageSizeConstraintType.h +19 -0
  283. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLKey.h +35 -0
  284. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLMetricKey.h +37 -0
  285. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModel+MLComputeDevice.h +30 -0
  286. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModel+MLModelCompilation.h +62 -0
  287. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModel+MLState.h +106 -0
  288. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModel.h +130 -0
  289. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModelAsset.h +121 -0
  290. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModelCollection.h +70 -0
  291. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModelCollectionEntry.h +72 -0
  292. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModelConfiguration.h +97 -0
  293. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModelDescription.h +83 -0
  294. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModelError.h +114 -0
  295. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModelMetadataKeys.h +31 -0
  296. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModelStructure.h +70 -0
  297. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModelStructureNeuralNetwork.h +31 -0
  298. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModelStructureNeuralNetworkLayer.h +35 -0
  299. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModelStructurePipeline.h +31 -0
  300. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModelStructureProgram.h +31 -0
  301. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModelStructureProgramArgument.h +31 -0
  302. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModelStructureProgramBinding.h +36 -0
  303. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModelStructureProgramBlock.h +36 -0
  304. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModelStructureProgramFunction.h +34 -0
  305. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModelStructureProgramNamedValueType.h +33 -0
  306. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModelStructureProgramOperation.h +38 -0
  307. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModelStructureProgramValue.h +26 -0
  308. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLModelStructureProgramValueType.h +26 -0
  309. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLMultiArray.h +316 -0
  310. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLMultiArrayConstraint.h +34 -0
  311. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLMultiArrayShapeConstraint.h +28 -0
  312. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLMultiArrayShapeConstraintType.h +19 -0
  313. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLNeuralEngineComputeDevice.h +26 -0
  314. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLNumericConstraint.h +31 -0
  315. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLOptimizationHints.h +45 -0
  316. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLParameterDescription.h +33 -0
  317. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLParameterKey.h +85 -0
  318. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLPredictionOptions.h +94 -0
  319. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLReshapeFrequencyHint.h +18 -0
  320. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLSequence.h +38 -0
  321. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLSequenceConstraint.h +30 -0
  322. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLSpecializationStrategy.h +17 -0
  323. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLState.h +64 -0
  324. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLStateConstraint.h +30 -0
  325. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLTask.h +56 -0
  326. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLUpdateContext.h +41 -0
  327. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLUpdateProgressEvent.h +25 -0
  328. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLUpdateProgressHandlers.h +34 -0
  329. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLUpdateTask.h +62 -0
  330. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Headers/MLWritable.h +22 -0
  331. package/sdk/ios/System/Library/Frameworks/CoreML.framework/Modules/module.modulemap +6 -0
  332. package/sdk/ios/System/Library/Frameworks/CoreVideo.framework/Headers/CVMetalBuffer.h +1 -1
  333. package/sdk/ios/System/Library/Frameworks/CoreVideo.framework/Headers/CVMetalBufferCache.h +1 -1
  334. package/sdk/ios/System/Library/Frameworks/CoreVideo.framework/Headers/CVMetalTexture.h +1 -1
  335. package/sdk/ios/System/Library/Frameworks/CoreVideo.framework/Headers/CVMetalTextureCache.h +2 -2
  336. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSMetadata.h +4 -4
  337. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKBaseEffect.h +159 -0
  338. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKEffectProperty.h +46 -0
  339. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKEffectPropertyFog.h +58 -0
  340. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKEffectPropertyLight.h +83 -0
  341. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKEffectPropertyMaterial.h +36 -0
  342. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKEffectPropertyTexture.h +62 -0
  343. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKEffectPropertyTransform.h +45 -0
  344. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKEffects.h +21 -0
  345. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKMath.h +19 -0
  346. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKMathTypes.h +167 -0
  347. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKMathUtils.h +48 -0
  348. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKMatrix3.h +535 -0
  349. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKMatrix4.h +1012 -0
  350. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKMatrixStack.h +130 -0
  351. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKModel.h +227 -0
  352. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKNamedEffect.h +14 -0
  353. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKQuaternion.h +340 -0
  354. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKReflectionMapEffect.h +143 -0
  355. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKSkyboxEffect.h +117 -0
  356. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKTextureLoader.h +357 -0
  357. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKVector2.h +483 -0
  358. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKVector3.h +307 -0
  359. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKVector4.h +587 -0
  360. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKView.h +129 -0
  361. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKViewController.h +102 -0
  362. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKit.apinotes +5 -0
  363. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKit.h +21 -0
  364. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Headers/GLKitBase.h +30 -0
  365. package/sdk/ios/System/Library/Frameworks/GLKit.framework/Modules/module.modulemap +6 -0
  366. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKAddCarKeyPassConfiguration.h +35 -0
  367. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKAddIdentityDocumentConfiguration.h +134 -0
  368. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKAddPassButton.h +48 -0
  369. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKAddPassesViewController.h +56 -0
  370. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKAddPaymentPassRequest.h +88 -0
  371. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKAddPaymentPassViewController.h +68 -0
  372. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKAddSecureElementPassConfiguration.h +55 -0
  373. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKAddSecureElementPassViewController.h +56 -0
  374. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKAddShareablePassConfiguration.h +134 -0
  375. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKAutomaticReloadPaymentRequest.h +57 -0
  376. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKAutomaticReloadPaymentSummaryItem.h +31 -0
  377. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKBarcodeEventMetadataRequest.h +76 -0
  378. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKConstants.h +124 -0
  379. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKContact.h +43 -0
  380. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKDateComponentsRange.h +35 -0
  381. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKDeferredPaymentRequest.h +60 -0
  382. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKDeferredPaymentSummaryItem.h +30 -0
  383. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKDisbursementRequest.h +94 -0
  384. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKDisbursementSummaryItem.h +22 -0
  385. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKError.h +95 -0
  386. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKIdentityAuthorizationController.h +52 -0
  387. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKIdentityButton.h +68 -0
  388. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKIdentityDocument.h +33 -0
  389. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKIdentityDocumentDescriptor.h +83 -0
  390. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKIdentityElement.h +130 -0
  391. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKIdentityError.h +54 -0
  392. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKIdentityIntentToStore.h +40 -0
  393. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKIdentityRequest.h +47 -0
  394. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKInstantFundsOutFeeSummaryItem.h +28 -0
  395. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKIssuerProvisioningExtensionAuthorizationProviding.h +31 -0
  396. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKIssuerProvisioningExtensionHandler.h +41 -0
  397. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKIssuerProvisioningExtensionPassEntry.h +34 -0
  398. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKIssuerProvisioningExtensionPaymentPassEntry.h +37 -0
  399. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKIssuerProvisioningExtensionStatus.h +33 -0
  400. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKLabeledValue.h +28 -0
  401. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKObject.h +23 -0
  402. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKPass.h +63 -0
  403. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKPassLibrary.h +170 -0
  404. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKPassRelevantDate.h +30 -0
  405. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKPass_Types.h +25 -0
  406. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKPayLaterValidator.h +44 -0
  407. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKPayLaterView.h +72 -0
  408. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKPayment.h +64 -0
  409. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKPaymentAuthorizationController.h +208 -0
  410. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKPaymentAuthorizationViewController.h +108 -0
  411. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKPaymentAuthorizationViewControllerDelegate.h +147 -0
  412. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKPaymentButton.h +55 -0
  413. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKPaymentInformationEventExtension.h +41 -0
  414. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKPaymentMerchantSession.h +29 -0
  415. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKPaymentMethod.h +59 -0
  416. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKPaymentPass.h +37 -0
  417. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKPaymentRequest.h +255 -0
  418. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKPaymentRequestStatus.h +171 -0
  419. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKPaymentSummaryItem.h +50 -0
  420. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKPaymentToken.h +49 -0
  421. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKPaymentTokenContext.h +59 -0
  422. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKRecurringPaymentRequest.h +60 -0
  423. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKRecurringPaymentSummaryItem.h +39 -0
  424. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKSecureElementPass.h +52 -0
  425. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKShareSecureElementPassViewController.h +81 -0
  426. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKShippingMethod.h +42 -0
  427. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKStoredValuePassBalance.h +37 -0
  428. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKStoredValuePassProperties.h +36 -0
  429. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKSuicaPassProperties.h +43 -0
  430. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKTransitPassProperties.h +34 -0
  431. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PKVehicleConnectionSession.h +71 -0
  432. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PassKit.apinotes +68 -0
  433. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Headers/PassKit.h +187 -0
  434. package/sdk/ios/System/Library/Frameworks/PassKit.framework/Modules/module.modulemap +8 -0
  435. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAAnimation.h +8 -8
  436. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAEAGLLayer.h +48 -0
  437. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAEDRMetadata.h +1 -1
  438. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CALayer.h +2 -2
  439. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTimingFunction.h +1 -1
  440. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAMetalLayer.h +1 -1
  441. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATransaction.h +1 -1
  442. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h +25 -12
  443. package/sdk/ios/System/Library/Frameworks/React.framework/Headers/React.h +1 -0
  444. package/sdk/ios/System/Library/Frameworks/Security.framework/Modules/module.modulemap +23 -2
  445. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSAdaptiveImageGlyph.h +1 -1
  446. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSAttributedString.h +1 -231
  447. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSDataAsset.h +1 -1
  448. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSItemProvider+UIKitAdditions.h +3 -3
  449. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSLayoutManager.h +1 -375
  450. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSParagraphStyle.h +1 -545
  451. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSStringDrawing.h +1 -82
  452. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSText.h +1 -74
  453. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSTextAttachment.h +3 -3
  454. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSTextContainer.h +1 -210
  455. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSTextContentManager.h +2 -2
  456. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSTextElement.h +2 -2
  457. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSTextLayoutFragment.h +1 -1
  458. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSTextLayoutManager.h +2 -2
  459. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSTextLineFragment.h +1 -1
  460. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSTextList.h +1 -194
  461. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSTextListElement.h +1 -1
  462. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSTextRange.h +2 -2
  463. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSTextSelection.h +1 -1
  464. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSTextSelectionNavigation.h +2 -2
  465. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSTextStorage.h +1 -196
  466. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSTextTable.h +3 -3
  467. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSTextViewportLayoutController.h +2 -2
  468. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSTextViewportRenderingSurface.h +2 -2
  469. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibility.h +1 -1
  470. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityAdditions.h +2 -2
  471. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityConstants.h +0 -87
  472. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityContainer.h +2 -2
  473. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityContentSizeCategoryImageAdjusting.h +1 -1
  474. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityIdentification.h +1 -1
  475. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityLocationDescriptor.h +1 -1
  476. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIActionSheet.h +2 -2
  477. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIActivity.h +1 -1
  478. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIActivityItemsConfiguration.h +1 -1
  479. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAlertView.h +2 -2
  480. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAppearance.h +2 -2
  481. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIApplicationShortcutItem.h +3 -6
  482. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIArrangementViewController.h +1 -1
  483. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAttachmentBehavior.h +1 -1
  484. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIBackgroundExtensionView.h +1 -1
  485. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIBandSelectionInteraction.h +1 -1
  486. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIBarButtonItemGroup.h +1 -1
  487. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIBarCommon.h +2 -2
  488. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UICalendarSelection.h +1 -1
  489. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UICalendarSelectionMultiDate.h +2 -2
  490. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UICalendarSelectionSingleDate.h +2 -2
  491. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UICalendarSelectionWeekOfYear.h +2 -2
  492. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UICalendarView.h +2 -2
  493. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UICanvasFeedbackGenerator.h +1 -1
  494. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UICloudSharingController.h +2 -2
  495. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UICollectionView.h +11 -11
  496. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewCompositionalLayout.h +15 -15
  497. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewController.h +1 -1
  498. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewFlowLayout.h +2 -2
  499. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewLayout.h +1 -1
  500. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewListCell.h +1 -1
  501. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewTransitionLayout.h +1 -1
  502. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UICollectionViewUpdateItem.h +1 -1
  503. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UICollisionBehavior.h +2 -2
  504. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIColorPickerViewController.h +2 -2
  505. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIColorWell.h +1 -1
  506. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UICommand.h +1 -1
  507. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIContentSizeCategoryAdjusting.h +1 -1
  508. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIContentUnavailableView.h +1 -1
  509. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIContextMenuInteraction.h +3 -3
  510. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIContextMenuSystem.h +1 -1
  511. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIContextualAction.h +1 -1
  512. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIConversationContext.h +1 -1
  513. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDataSourceTranslating.h +1 -1
  514. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDatePicker.h +1 -1
  515. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDeferredMenuElement.h +1 -1
  516. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDevice.h +2 -2
  517. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDocument.h +1 -1
  518. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentBrowserAction.h +1 -1
  519. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentBrowserViewController.h +3 -3
  520. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentInteractionController.h +2 -2
  521. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentMenuViewController.h +2 -2
  522. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentPickerExtensionViewController.h +1 -1
  523. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentPickerViewController.h +1 -1
  524. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentProperties.h +1 -1
  525. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDocumentViewController.h +1 -1
  526. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDragInteraction.h +2 -2
  527. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDragSession.h +3 -3
  528. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDropInteraction.h +1 -1
  529. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDynamicAnimator.h +2 -2
  530. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDynamicBehavior.h +2 -2
  531. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIEditMenuInteraction.h +2 -2
  532. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIEventAttribution.h +1 -1
  533. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIEventAttributionView.h +1 -1
  534. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIFieldBehavior.h +1 -1
  535. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIFindInteraction.h +1 -1
  536. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIFindSession.h +1 -1
  537. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIFocus.h +1 -1
  538. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIFocusAnimationCoordinator.h +2 -2
  539. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIFocusDebugger.h +2 -2
  540. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIFocusMovementHint.h +1 -1
  541. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIFocusSystem.h +1 -1
  542. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIFont.h +1 -86
  543. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIFontDescriptor.h +1 -198
  544. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIFontPickerViewController.h +2 -2
  545. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIGlassEffect.h +2 -2
  546. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIGraphicsPDFRenderer.h +3 -3
  547. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIGraphicsRenderer.h +3 -3
  548. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIGravityBehavior.h +1 -1
  549. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIGuidedAccess.h +1 -1
  550. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIHinge.h +1 -1
  551. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIHingeInteraction.h +2 -2
  552. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIHoverEffect.h +1 -1
  553. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIImagePickerController.h +2 -2
  554. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIInputSuggestion.h +1 -1
  555. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIInputView.h +1 -1
  556. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIInputViewController.h +1 -1
  557. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIInteraction.h +1 -1
  558. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKey.h +1 -1
  559. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKeyboardLayoutGuide.h +1 -1
  560. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKitDefines.h +1 -48
  561. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UILargeContentViewer.h +2 -2
  562. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UILetterformAwareAdjusting.h +1 -1
  563. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UILexicon.h +2 -2
  564. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIListContentConfiguration.h +1 -1
  565. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UILocalNotification.h +1 -1
  566. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UILocalizedIndexedCollation.h +1 -1
  567. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIMailConversationContext.h +1 -1
  568. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIMainMenuSystem.h +1 -1
  569. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIManagedDocument.h +1 -1
  570. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIMenuController.h +1 -1
  571. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIMenuDisplayPreferences.h +1 -1
  572. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIMenuElement.h +1 -1
  573. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIMenuLeaf.h +1 -1
  574. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIMenuSystem.h +1 -1
  575. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIMessageConversationContext.h +1 -1
  576. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIMotionEffect.h +3 -6
  577. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UINavigationBar.h +1 -1
  578. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UINavigationController.h +1 -1
  579. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIOpenURLContext.h +1 -1
  580. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPageControl.h +1 -1
  581. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPageControlProgress.h +4 -4
  582. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPageViewController.h +2 -2
  583. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPencilInteraction.h +3 -3
  584. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPhotoSearchSuggestion.h +1 -1
  585. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h +3 -3
  586. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPointerAccessory.h +1 -1
  587. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPointerInteraction.h +3 -3
  588. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPointerLockState.h +1 -1
  589. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPointerRegion.h +1 -1
  590. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPointerStyle.h +1 -1
  591. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverBackgroundView.h +2 -2
  592. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverController.h +2 -2
  593. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverPresentationController.h +2 -2
  594. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPopoverPresentationControllerSourceItem.h +1 -1
  595. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPresentationController.h +2 -2
  596. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPress.h +1 -1
  597. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPressesEvent.h +1 -1
  598. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPreviewInteraction.h +2 -2
  599. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPrintFormatter.h +4 -4
  600. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPrintInteractionController.h +2 -2
  601. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPrintPageRenderer.h +1 -1
  602. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPrintPaper.h +1 -1
  603. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPrintServiceExtension.h +2 -2
  604. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPrinter.h +1 -1
  605. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPrinterPickerController.h +2 -2
  606. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPushBehavior.h +1 -1
  607. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIReferenceLibraryViewController.h +1 -1
  608. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIResponder.h +1 -1
  609. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISceneAccessory.h +1 -1
  610. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISceneAccessoryRegistration.h +1 -1
  611. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISceneActivationConditions.h +1 -1
  612. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISceneClosureConfirmation.h +1 -1
  613. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISceneConfiguration.h +1 -1
  614. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISceneOptions.h +1 -1
  615. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISceneSession.h +1 -1
  616. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISceneSizeRestrictions.h +1 -1
  617. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISceneSystemProtectionManager.h +1 -1
  618. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISceneWindowingBehaviors.h +1 -1
  619. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIScreenMode.h +1 -1
  620. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIScreenshotService.h +2 -2
  621. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIScribbleInteraction.h +2 -2
  622. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIScrollEdgeElementContainerInteraction.h +1 -1
  623. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIScrollView.h +1 -1
  624. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISearchBar.h +2 -2
  625. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISearchContainerViewController.h +1 -1
  626. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISearchController.h +2 -2
  627. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISearchDisplayController.h +2 -2
  628. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISearchSuggestion.h +1 -1
  629. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISearchTextField.h +2 -2
  630. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISheetPresentationController.h +3 -3
  631. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISmartReplySuggestion.h +1 -1
  632. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISnapBehavior.h +1 -1
  633. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISplitViewController.h +1 -1
  634. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISpringLoadedInteraction.h +4 -4
  635. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISpringLoadedInteractionSupporting.h +1 -1
  636. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIStandardTextCursorView.h +1 -1
  637. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIStateRestoration.h +4 -4
  638. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIStatusBarManager.h +1 -1
  639. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIStepper.h +1 -1
  640. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIStoryboardPopoverSegue.h +1 -1
  641. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIStoryboardSegue.h +2 -2
  642. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISwipeActionsConfiguration.h +1 -1
  643. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISymbolContentTransition.h +1 -1
  644. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITabBar.h +1 -1
  645. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITabBarController.h +1 -1
  646. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITabBarControllerSidebar.h +3 -3
  647. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITabGroup.h +1 -1
  648. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITabSidebarItem.h +1 -1
  649. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITableView.h +13 -13
  650. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITableViewController.h +1 -1
  651. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITableViewHeaderFooterView.h +1 -1
  652. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextChecker.h +1 -1
  653. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextCursorDropPositionAnimator.h +1 -1
  654. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextCursorView.h +2 -2
  655. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextDragPreviewRenderer.h +1 -1
  656. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextDragging.h +3 -3
  657. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextDropping.h +3 -3
  658. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextFormattingCoordinator.h +3 -3
  659. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextFormattingViewController.h +1 -1
  660. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextInput.h +12 -12
  661. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextInputContext.h +1 -1
  662. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextInputTraits.h +1 -1
  663. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextInteraction.h +2 -2
  664. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextItem.h +1 -1
  665. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextLoupeSession.h +1 -1
  666. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextPasteConfigurationSupporting.h +1 -1
  667. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextPasteDelegate.h +2 -2
  668. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextSearching.h +2 -2
  669. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextSelectionDisplayInteraction.h +2 -2
  670. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextSelectionHighlightView.h +2 -2
  671. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITimingCurveProvider.h +1 -1
  672. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITimingParameters.h +1 -1
  673. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIToolTipInteraction.h +3 -3
  674. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIToolbar.h +1 -1
  675. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIToolbarAppearance.h +1 -1
  676. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITouch.h +1 -1
  677. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITrackingLayoutGuide.h +1 -1
  678. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITraitCollection.h +2 -2
  679. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIUpdateActionPhase.h +1 -1
  680. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIUpdateInfo.h +1 -1
  681. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIUpdateLink.h +1 -1
  682. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIUserNotificationSettings.h +5 -5
  683. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIVibrancyEffect.h +1 -1
  684. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIVideoEditorController.h +2 -2
  685. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewAnimating.h +2 -2
  686. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h +6 -6
  687. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewControllerTransitionCoordinator.h +2 -2
  688. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewControllerTransitioning.h +4 -4
  689. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewReservedRegion.h +3 -3
  690. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIVisualEffect.h +1 -1
  691. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIWebView.h +2 -2
  692. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIWindow.h +1 -1
  693. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIWindowScene.h +2 -2
  694. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIWindowSceneActivationAction.h +1 -1
  695. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIWindowSceneDragInteraction.h +1 -1
  696. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIWindowSceneGeometryPreferencesIOS.h +1 -1
  697. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIWritingToolsCoordinator.h +1 -1
  698. package/sdk/ios/System/Library/Frameworks/UIKitText.framework/Headers/NSAttributedString.h +231 -0
  699. package/sdk/ios/System/Library/Frameworks/UIKitText.framework/Headers/NSLayoutManager.h +375 -0
  700. package/sdk/ios/System/Library/Frameworks/UIKitText.framework/Headers/NSParagraphStyle.h +545 -0
  701. package/sdk/ios/System/Library/Frameworks/UIKitText.framework/Headers/NSStringDrawing.h +82 -0
  702. package/sdk/ios/System/Library/Frameworks/UIKitText.framework/Headers/NSText.h +74 -0
  703. package/sdk/ios/System/Library/Frameworks/UIKitText.framework/Headers/NSTextContainer.h +210 -0
  704. package/sdk/ios/System/Library/Frameworks/UIKitText.framework/Headers/NSTextList.h +194 -0
  705. package/sdk/ios/System/Library/Frameworks/UIKitText.framework/Headers/NSTextStorage.h +196 -0
  706. package/sdk/ios/System/Library/Frameworks/UIKitText.framework/Headers/UIFont.h +86 -0
  707. package/sdk/ios/System/Library/Frameworks/UIKitText.framework/Headers/UIFontDescriptor.h +198 -0
  708. package/sdk/ios/System/Library/Frameworks/UIKitText.framework/Headers/UIKitDefines.h +48 -0
  709. package/sdk/ios/System/Library/Frameworks/UIKitText.framework/Headers/UIKitText.h +11 -11
  710. package/sdk/ios/System/Library/Frameworks/UIKitText.framework/Modules/module.modulemap +11 -11
  711. package/sdk/ios/System/Library/Frameworks/UIKitTypes.framework/Headers/UIAccessibilityTraits.h +91 -0
  712. package/sdk/ios/System/Library/Frameworks/UIKitTypes.framework/Headers/UIKitTypes.apinotes +43 -0
  713. package/sdk/ios/System/Library/Frameworks/UIKitTypes.framework/Headers/UIKitTypes.h +1 -0
  714. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTBase.h +48 -0
  715. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTCompressionProperties.h +1686 -0
  716. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTCompressionSession.h +509 -0
  717. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTDecompressionProperties.h +548 -0
  718. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTDecompressionSession.h +577 -0
  719. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTErrors.h +144 -0
  720. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTFrameProcessor.h +134 -0
  721. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTFrameProcessorConfiguration.h +68 -0
  722. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTFrameProcessorErrors.h +60 -0
  723. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTFrameProcessorFrame.h +82 -0
  724. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTFrameProcessorParameters.h +48 -0
  725. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTFrameProcessor_FrameRateConversion.h +207 -0
  726. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTFrameProcessor_LowLatencyFrameInterpolation.h +171 -0
  727. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTFrameProcessor_LowLatencySuperResolutionScaler.h +143 -0
  728. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTFrameProcessor_MotionBlur.h +207 -0
  729. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTFrameProcessor_OpticalFlow.h +172 -0
  730. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTFrameProcessor_SuperResolutionScaler.h +245 -0
  731. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTFrameProcessor_TemporalNoiseFilter.h +161 -0
  732. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTFrameSilo.h +177 -0
  733. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTHDRPerFrameMetadataGenerationSession.h +116 -0
  734. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTMotionEstimationSession.h +176 -0
  735. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTMotionEstimationSessionProperties.h +76 -0
  736. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTMultiPassStorage.h +96 -0
  737. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTPixelRotationProperties.h +75 -0
  738. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTPixelRotationSession.h +111 -0
  739. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTPixelTransferProperties.h +231 -0
  740. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTPixelTransferSession.h +123 -0
  741. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTSession.h +151 -0
  742. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTUtilities.h +146 -0
  743. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VTVideoEncoderList.h +74 -0
  744. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VideoToolbox.apinotes +197 -0
  745. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Headers/VideoToolbox.h +41 -0
  746. package/sdk/ios/System/Library/Frameworks/VideoToolbox.framework/Modules/module.modulemap +6 -0
  747. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNCalculateImageAestheticsScoresRequest.h +32 -0
  748. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNClassifyImageRequest.h +69 -0
  749. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNCoreMLRequest.h +93 -0
  750. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNDefines.h +24 -0
  751. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNDetectAnimalBodyPoseRequest.h +49 -0
  752. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNDetectBarcodesRequest.h +85 -0
  753. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNDetectContoursRequest.h +60 -0
  754. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNDetectDocumentSegmentationRequest.h +33 -0
  755. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNDetectFaceCaptureQualityRequest.h +46 -0
  756. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNDetectFaceLandmarksRequest.h +61 -0
  757. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNDetectFaceRectanglesRequest.h +47 -0
  758. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNDetectHorizonRequest.h +35 -0
  759. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNDetectHumanBodyPose3DRequest.h +67 -0
  760. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNDetectHumanBodyPoseRequest.h +194 -0
  761. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNDetectHumanHandPoseRequest.h +200 -0
  762. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNDetectHumanRectanglesRequest.h +53 -0
  763. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNDetectRectanglesRequest.h +66 -0
  764. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNDetectTextRectanglesRequest.h +40 -0
  765. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNDetectTrajectoriesRequest.h +71 -0
  766. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNDetectedPoint.h +55 -0
  767. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNError.h +42 -0
  768. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNFaceLandmarks.h +188 -0
  769. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNFaceObservationAccepting.h +32 -0
  770. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNGenerateAttentionBasedSaliencyImageRequest.h +42 -0
  771. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNGenerateForegroundInstanceMaskRequest.h +34 -0
  772. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNGenerateImageFeaturePrintRequest.h +53 -0
  773. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNGenerateObjectnessBasedSaliencyImageRequest.h +41 -0
  774. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNGenerateOpticalFlowRequest.h +89 -0
  775. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNGeneratePersonInstanceMaskRequest.h +34 -0
  776. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNGeneratePersonSegmentationRequest.h +67 -0
  777. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNGeometry.h +323 -0
  778. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNGeometryUtils.h +95 -0
  779. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNHumanBodyRecognizedPoint3D.h +26 -0
  780. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNImageRegistrationRequest.h +67 -0
  781. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNObservation.h +994 -0
  782. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNRecognizeAnimalsRequest.h +61 -0
  783. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNRecognizeTextRequest.h +109 -0
  784. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNRecognizedPoint3D.h +34 -0
  785. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNRequest.h +197 -0
  786. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNRequestHandler.h +419 -0
  787. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNRequestRevisionProviding.h +26 -0
  788. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNStatefulRequest.h +49 -0
  789. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNTargetedImageRequest.h +302 -0
  790. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNTrackHomographicImageRegistrationRequest.h +46 -0
  791. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNTrackObjectRequest.h +53 -0
  792. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNTrackOpticalFlowRequest.h +106 -0
  793. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNTrackRectangleRequest.h +56 -0
  794. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNTrackTranslationalImageRegistrationRequest.h +45 -0
  795. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNTrackingRequest.h +72 -0
  796. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNTypes.h +201 -0
  797. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNUtils.h +198 -0
  798. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/VNVideoProcessor.h +133 -0
  799. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/Vision.apinotes +130 -0
  800. package/sdk/ios/System/Library/Frameworks/Vision.framework/Headers/Vision.h +67 -0
  801. package/sdk/ios/System/Library/Frameworks/Vision.framework/Modules/module.modulemap +7 -0
  802. package/sdk/ios/usr/include/AssertMacros.h +1463 -0
  803. package/sdk/ios/usr/include/_modules/_os_lock.h +33 -0
  804. package/sdk/ios/usr/include/libkern/OSCacheControl.h +66 -0
  805. package/sdk/ios/usr/include/os.modulemap +1 -1
  806. package/sdk/ios/usr/include/pthread/pthread_spis.h +105 -0
  807. package/sdk/ios/usr/include/pthread_spis.h +105 -0
  808. package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
  809. package/sdk/ios/wasm/include/pthread/sched.h +3 -0
  810. package/sdk/ios/wasm/include/pthread.h +7 -0
  811. package/sdk/ios/wasm/include/sched.h +9 -0
  812. package/sdk/ios/wasm/include/sys/mman.h +2 -2
  813. package/sdk/ios/wasm/include/sys/poll.h +3 -0
  814. package/sdk/ios/wasm/include/tgmath.h +5 -0
  815. package/sdk/ios/wasm/include/unistd.h +5 -1
  816. package/skills/contrast/SKILL.md +1 -0
  817. package/skills/peach-debug/SKILL.md +43 -1
  818. package/skills/peach-debug/references/events.md +14 -1
  819. package/src/android-autolinking.ts +5 -18
  820. package/src/answeredNativePackages.ts +24 -5
  821. package/src/app-config.ts +12 -1
  822. package/src/assetCatalogContract.ts +3 -39
  823. package/src/autolinker-process.ts +82 -0
  824. package/src/bazel-project.ts +1133 -0
  825. package/src/bridge-contract.ts +3 -0
  826. package/src/case-insensitive-header-overlay.ts +99 -0
  827. package/src/config.ts +5 -0
  828. package/src/device-catalog.ts +9 -0
  829. package/src/expo-autolinking.ts +12 -15
  830. package/src/expo-native-prebuilt.ts +28 -5
  831. package/src/expo-native-workspace.ts +91 -23
  832. package/src/expo-swift-host.ts +190 -57
  833. package/src/expo-swift-ready.ts +8 -0
  834. package/src/expo-workspace-exclusion.ts +96 -27
  835. package/src/flow-graph-layout.ts +166 -0
  836. package/src/git-repo-env.ts +7 -0
  837. package/src/host/app-package-handler.ts +5 -0
  838. package/src/host/bridge-host.ts +9 -5
  839. package/src/host/hostname-resolver.ts +55 -2
  840. package/src/host/staged-host-files.ts +17 -1
  841. package/src/host/websocket-proxy.ts +19 -2
  842. package/src/java-static-imports.ts +68 -0
  843. package/src/kotlin-jvm-sources.ts +35 -0
  844. package/src/kotlinSdkContract.ts +3 -1
  845. package/src/launchMetadataContract.ts +8 -0
  846. package/src/metro-hot-update.ts +68 -0
  847. package/src/native-app-identity-project.ts +35 -7
  848. package/src/native-app-identity.ts +32 -0
  849. package/src/native-package-slice-build.ts +35 -9
  850. package/src/native-package-slice.ts +10 -4
  851. package/src/native-slices.ts +1 -1
  852. package/src/native-static-libraries.ts +50 -22
  853. package/src/nitro-adapter.lock.json +265 -265
  854. package/src/nitro-app-providers.ts +28 -0
  855. package/src/nitro-bundle.ts +4 -41
  856. package/src/nitro-compile.ts +450 -76
  857. package/src/nitro-source.ts +585 -114
  858. package/src/nitro-superset.lock.json +4 -4
  859. package/src/node-runtime.ts +27 -0
  860. package/src/nodeRuntimeContract.ts +5 -0
  861. package/src/one-sdk-bundle.ts +15 -3
  862. package/src/one-sdk-preparation.ts +69 -9
  863. package/src/oneSdkContract.ts +13 -2
  864. package/src/podspec-sources.ts +376 -1814
  865. package/src/portable-expo-contract.ts +7 -2
  866. package/src/portable-expo-workspace.ts +7 -2
  867. package/src/process-group.ts +13 -0
  868. package/src/react-bridge-importers.ts +1 -0
  869. package/src/react-native-autolinking.ts +13 -43
  870. package/src/react-native-bridge-modules.ts +3 -3
  871. package/src/react-native-core-build.ts +6 -0
  872. package/src/react-native-host-modules.ts +37 -3
  873. package/src/reap-browser.ts +1 -0
  874. package/src/sfSymbolMetricsContract.ts +0 -53
  875. package/src/sim-client.ts +8 -2
  876. package/src/storekit-test-store.ts +49 -0
  877. package/src/stub-pattern-matcher.ts +4 -26
  878. package/src/swift-compile-budget.ts +42 -0
  879. package/src/swift-compile.ts +780 -658
  880. package/src/swift-compiler-digest.ts +2 -0
  881. package/src/swift-cxx-reachable.ts +20 -21
  882. package/src/swift-distribution.lock.json +18 -12
  883. package/src/swift-guest-compile.ts +38 -21
  884. package/src/swift-guest-image-ledger.ts +28 -19
  885. package/src/swift-guest-source-inputs.ts +5 -1
  886. package/src/swift-host.ts +90 -23
  887. package/src/swift-objc-compile.ts +117 -29
  888. package/src/swift-objc-standin.ts +12 -1
  889. package/src/swift-package-manifest.ts +18 -1
  890. package/src/swift-package.ts +26 -8
  891. package/src/swift-packages.ts +66 -27
  892. package/src/swift-resource-class-names.ts +44 -0
  893. package/src/swift-root-lock.ts +50 -15
  894. package/src/swift-shared-sdk.ts +2 -4
  895. package/src/swift-source-file.ts +6 -0
  896. package/src/swift-standin-emit.ts +10 -0
  897. package/src/swift-standins.ts +351 -66
  898. package/src/swift-submit.ts +6 -1
  899. package/src/swift-toolchain.ts +19 -0
  900. package/src/swift-wasm-prune.ts +15 -8
  901. package/src/swiftContract.ts +4 -5
  902. package/src/turbo-bundle.ts +1 -1
  903. package/src/turbo-codegen-intake.ts +8 -5
  904. package/src/turbo-compile.ts +2 -1
  905. package/src/turbo-runtime.lock.json +24 -24
  906. package/src/turbo-source.ts +2027 -271
  907. package/src/vite-plugin-swift.ts +3 -2
  908. package/src/wasm-optimize.ts +14 -10
  909. package/src/worker-system-chunks.ts +31 -3
  910. package/src/worklet-kernel.ts +56 -9
  911. package/src/worklets-babel.ts +8 -1
  912. package/src/xcode-header-search.ts +9 -0
  913. package/src/xcode-project.ts +82 -6
  914. package/dist-types/packages/peach-engine/src/engine/ios-fast-scroll.d.ts +0 -16
  915. package/dist-types/packages/peach-engine/src/engine/scroll-pan-contacts.d.ts +0 -12
  916. package/dist-types/packages/peach-engine/src/engine/scroll-velocity.d.ts +0 -15
  917. /package/dist-types/packages/{peach-engine → peach-compat}/src/react-bridge.d.ts +0 -0
@@ -37,12 +37,13 @@ import { iosAutolinkedDependencies } from './nitro-source'
37
37
  import { TURBO_RUNTIME_HEADER } from './nitroAdapterContract'
38
38
  import {
39
39
  loadPodspec,
40
+ podspecAttribute,
41
+ type Spec,
40
42
  podspecLinksBinaries,
41
43
  podspecMembers,
42
44
  podspecSourceFiles as specSourceFiles,
43
45
  } from './podspec-sources'
44
46
  import { readPackageFile, relativeInside } from './swift-source-file'
45
- import { MAX_SWIFT_COMPILE_SOURCE_BYTES } from './swift-submit'
46
47
  import { SWIFT_NATIVE_INPUT_ROOT, type SwiftNativeHeaderMap } from './swiftContract'
47
48
  import {
48
49
  installedFabricSources,
@@ -114,6 +115,8 @@ export interface TurboSourceCollection {
114
115
  rendererSwiftTargets: string[]
115
116
  /** the codegen component names whose views the host mounts */
116
117
  fabricComponents: string[]
118
+ /** the RCTViewManager classes whose views the host mounts through the legacy interop */
119
+ paperViewManagers: string[]
117
120
  }
118
121
 
119
122
  // a codegen component and the class RCTThirdPartyComponentsProvider maps it to
@@ -372,70 +375,53 @@ function walkFiles(root: string, base: string, into: Set<string>): void {
372
375
  }
373
376
  }
374
377
 
375
- /** a podspec attribute assigned a list of string literals, null when the
376
- * podspec does not assign it, or 'computed' for a value only CocoaPods
377
- * evaluating the Ruby could answer. */
378
- function podspecList(text: string, attribute: string): string[] | 'computed' | null {
379
- const assignments = [
380
- ...text.matchAll(new RegExp(`^\\s*\\w+\\.${attribute}\\s*=\\s*`, 'gm')),
381
- ]
382
- if (assignments.length === 0) return null
383
- if (assignments.length > 1) return 'computed'
384
- const rest = text.slice(assignments[0]!.index + assignments[0]![0].length)
385
- const bracketed = rest.startsWith('[')
386
- // a bracketed list runs to its closing bracket, a bare one to its line
387
- const end = bracketed ? rest.indexOf(']') : rest.indexOf('\n')
388
- if (bracketed && end === -1) return 'computed'
389
- const value = rest.slice(bracketed ? 1 : 0, end === -1 ? undefined : end)
390
- const items: string[] = []
391
- // string literals, separating commas and whitespace; ruby comments (# to
392
- // end of line) between elements are skipped
393
- const token = /\s+|,|#[^\n]*|("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/y
394
- for (let at = 0; at < value.length; at = token.lastIndex) {
395
- token.lastIndex = at
396
- const match = token.exec(value)
397
- if (!match) return 'computed'
398
- const literal = match[1]
399
- if (!literal) continue
400
- if (literal.startsWith('"') && literal.includes('#{')) return 'computed'
401
- items.push(literal.slice(1, -1))
402
- }
403
- return items
404
- }
378
+ const podspecList = podspecAttribute
405
379
 
406
380
  /** the external pods a podspec depends on; "subspecs" holds every requested subspec path across its dependency lines, "" for the pod itself. */
407
381
  function podspecDependencies(
408
- text: string,
382
+ pod: Pod,
409
383
  ): { name: string; requirements: string[]; subspecs: string[] }[] {
410
384
  const deps = new Map<
411
385
  string,
412
386
  { name: string; requirements: string[]; subspecs: string[] }
413
387
  >()
414
- for (const match of text.matchAll(
415
- /^\s*\w+\.dependency\s+['"]([^'"]+)['"]((?:\s*,\s*['"][^'"]+['"])*)/gm,
416
- )) {
417
- const requirements = [...match[2]!.matchAll(/['"]([^'"]+)['"]/g)].map((m) => m[1]!)
418
- const [root, ...subspec] = match[1]!.split('/')
419
- if (
420
- root === 'React' ||
421
- root === 'React-Core' ||
422
- root === 'ReactCommon' ||
423
- root!.startsWith('React-') ||
424
- root!.startsWith('RCT') ||
425
- root === 'FBLazyVector' ||
426
- root === 'DoubleConversion' ||
427
- root === 'glog' ||
428
- root === 'boost' ||
429
- root === 'fmt' ||
430
- root === 'fast_float' ||
431
- root === 'Yoga'
432
- )
433
- continue
434
- // every declaration of a pod must hold: CocoaPods intersects their requirements
435
- const dep = deps.get(root!) ?? { name: root!, requirements: [], subspecs: [] }
436
- dep.requirements.push(...requirements)
437
- dep.subspecs.push(subspec.join('/'))
438
- deps.set(root!, dep)
388
+ for (const spec of podSegments(pod)) {
389
+ const dependencies = spec.attrs.get('dependencies')
390
+ if (dependencies === undefined) continue
391
+ if (!object(dependencies))
392
+ throw new Error(`${pod.file}: invalid evaluated dependencies`)
393
+ for (const [name, requirements] of Object.entries(dependencies)) {
394
+ if (
395
+ !Array.isArray(requirements) ||
396
+ !requirements.every((item) => typeof item === 'string')
397
+ )
398
+ throw new Error(`${pod.file}: invalid requirements for ${name}`)
399
+ const [root, ...subspec] = name.split('/')
400
+ if (
401
+ root === pod.name ||
402
+ root === 'React' ||
403
+ root === 'React-Core' ||
404
+ root === 'ReactCommon' ||
405
+ root === 'ReactCodegen' ||
406
+ root === 'ReactNativeDependencies' ||
407
+ root === 'hermes-engine' ||
408
+ root!.startsWith('React-') ||
409
+ root!.startsWith('RCT') ||
410
+ root === 'FBLazyVector' ||
411
+ root === 'DoubleConversion' ||
412
+ root === 'glog' ||
413
+ root === 'boost' ||
414
+ root === 'fmt' ||
415
+ root === 'fast_float' ||
416
+ root === 'Yoga'
417
+ )
418
+ continue
419
+ // every declaration of a pod must hold: CocoaPods intersects their requirements
420
+ const dep = deps.get(root!) ?? { name: root!, requirements: [], subspecs: [] }
421
+ dep.requirements.push(...requirements)
422
+ dep.subspecs.push(subspec.join('/'))
423
+ deps.set(root!, dep)
424
+ }
439
425
  }
440
426
  return [...deps.values()]
441
427
  }
@@ -670,7 +656,6 @@ type Pod = {
670
656
  packageRoot: string
671
657
  file: string
672
658
  directory: string
673
- text: string
674
659
  name: string
675
660
  installed?: TurboInstalledPod
676
661
  }
@@ -694,90 +679,30 @@ function readPod(
694
679
  file: podspec,
695
680
  // CocoaPods resolves every glob against the podspec's own directory
696
681
  directory: path.relative(root, path.dirname(podspec)).split(path.sep).join('/'),
697
- text: readPackageFile(root, podspec, MAX_SWIFT_COMPILE_SOURCE_BYTES).toString('utf8'),
698
682
  name: path.basename(podspec, '.podspec'),
699
683
  ...(installed ? { installed } : {}),
700
684
  }
701
685
  }
702
686
 
703
- // the text CocoaPods installs by default: the pod's own attributes plus the
704
- // subspecs it names in default_subspecs, or every subspec when it names none
705
- function podSegments(pod: Pod): string[] {
706
- const walk = (lines: string[]): string[] => {
707
- const blocks = new Map<string, string[]>()
708
- const own: string[] = []
709
- for (let at = 0; at < lines.length; at++) {
710
- const open = /^(\s*)\w+\.subspec\s+['"]([^'"]+)['"]\s+do\b/.exec(lines[at]!)
711
- if (!open) {
712
- own.push(lines[at]!)
713
- continue
714
- }
715
- const body: string[] = []
716
- const close = new RegExp(`^${open[1]}end\\b`)
717
- for (at++; at < lines.length && !close.test(lines[at]!); at++) body.push(lines[at]!)
718
- blocks.set(open[2]!, body)
719
- }
720
- const ownText = own.join('\n')
721
- if (blocks.size === 0) return [ownText]
722
- const named =
723
- podspecList(ownText, 'default_subspecs') ?? podspecList(ownText, 'default_subspec')
724
- if (named === 'computed')
725
- throw new Error(`${pod.name}.podspec: default_subspecs is computed by Ruby`)
726
- return [
727
- ownText,
728
- ...(named ?? [...blocks.keys()]).flatMap((name) => {
729
- const block = blocks.get(name)
730
- if (!block)
731
- throw new Error(`${pod.name}.podspec: default subspec ${name} is not defined`)
732
- return walk(block)
733
- }),
734
- ]
735
- }
736
- return walk(pod.text.split('\n'))
687
+ function podSegments(pod: Pod, requested: string[] = ['']): Spec[] {
688
+ return podspecMembers(loadPodspec(pod.file, pod.appRoot), requested)
737
689
  }
738
690
 
739
- // literal pod globs select directly; computed membership is evaluated from the podspec.
740
- function podGlobFiles(pod: Pod): string[] | null {
741
- const segments = podSegments(pod)
742
- const lists = (attribute: string) =>
743
- segments.map((text) => podspecList(text, attribute))
744
- const allSources = lists('source_files')
745
- const allExcludes = lists('exclude_files')
746
- if ([...allSources, ...allExcludes].includes('computed')) {
747
- const directory = path.dirname(pod.file)
748
- const root = fs.realpathSync(pod.root)
749
- return [
750
- ...new Set(
751
- podspecMembers(loadPodspec(pod.file, pod.appRoot)).flatMap((member) =>
752
- specSourceFiles(directory, member).map((file) =>
753
- path
754
- .relative(root, fs.realpathSync(path.join(directory, file)))
755
- .split(path.sep)
756
- .join('/'),
757
- ),
691
+ function podGlobFiles(pod: Pod, requested: string[] = ['']): string[] {
692
+ const directory = path.dirname(pod.file)
693
+ const root = fs.realpathSync(pod.root)
694
+ return [
695
+ ...new Set(
696
+ podSegments(pod, requested).flatMap((member) =>
697
+ specSourceFiles(directory, member).map((file) =>
698
+ path
699
+ .relative(root, fs.realpathSync(path.join(directory, file)))
700
+ .split(path.sep)
701
+ .join('/'),
758
702
  ),
759
703
  ),
760
- ].sort()
761
- }
762
- const flat = (all: (string[] | 'computed' | null)[]) =>
763
- all.flatMap((list) => (Array.isArray(list) ? list : []))
764
- const sources = flat(allSources)
765
- const excludes = flat(allExcludes)
766
- if (allSources.every((list) => list === null)) return null
767
- const prefix = pod.directory ? `${pod.directory}/` : ''
768
- const candidates = new Set<string>()
769
- for (const glob of sources) walkFiles(pod.root, prefix + globBase(glob), candidates)
770
- const included = sources.map(globRegex)
771
- const excluded = excludes.map(globRegex)
772
- return [...candidates]
773
- .filter((file) => {
774
- const relative = file.slice(prefix.length)
775
- return (
776
- included.some((glob) => glob.test(relative)) &&
777
- !excluded.some((glob) => glob.test(relative))
778
- )
779
- })
780
- .sort()
704
+ ),
705
+ ].sort()
781
706
  }
782
707
 
783
708
  // where CocoaPods places the headers of a podspec segment that sets
@@ -786,10 +711,10 @@ function podGlobFiles(pod: Pod): string[] | null {
786
711
  function podHeaderMappings(pod: Pod): { dir: string; headerDir: string }[] {
787
712
  const segments = podSegments(pod)
788
713
  const prefix = pod.directory ? `${pod.directory}/` : ''
789
- const single = (text: string, attribute: string) => {
714
+ const single = (text: Spec, attribute: string) => {
790
715
  const value = podspecList(text, attribute)
791
- if (value === 'computed' || (value && value.length !== 1))
792
- throw new Error(`${pod.name}.podspec: ${attribute} is computed by Ruby`)
716
+ if (value && value.length !== 1)
717
+ throw new Error(`${pod.name}.podspec: ${attribute} must have one evaluated value`)
793
718
  return value?.[0]
794
719
  }
795
720
  const ownHeaderDir = single(segments[0]!, 'header_dir')
@@ -807,22 +732,14 @@ function podHeaderMappings(pod: Pod): { dir: string; headerDir: string }[] {
807
732
 
808
733
  // the files a provider's podspec compiles, refused when the pod ships binaries
809
734
  // this reading cannot follow
810
- function podFiles(pod: Pod): string[] {
735
+ function podFiles(pod: Pod, requested: string[] = ['']): string[] {
811
736
  if (pod.installed) return pod.installed.files
812
737
  const file = `${pod.name}.podspec`
813
- // a binary named in a branch the podspec does not take is not linked, so the
814
- // evaluated membership decides, as CocoaPods' own evaluation would
815
- const named = ['vendored_frameworks', 'vendored_libraries'].filter((binary) =>
816
- new RegExp(`\\.${binary}\\s*=`).test(pod.text),
817
- )
818
- if (
819
- named.length > 0 &&
820
- podspecMembers(loadPodspec(pod.file, pod.appRoot)).some(podspecLinksBinaries)
821
- )
738
+ if (podSegments(pod, requested).some(podspecLinksBinaries))
822
739
  throw new Error(
823
- `${file}: the pod links prebuilt ${named.join(' and ')}, which only its own wasm build can replace`,
740
+ `${file}: the pod links prebuilt binaries, which only its own wasm build can replace`,
824
741
  )
825
- const files = podGlobFiles(pod)
742
+ const files = podGlobFiles(pod, requested)
826
743
  if (!files?.length) throw new Error(`${file}: no source_files`)
827
744
  return files
828
745
  }
@@ -841,9 +758,7 @@ function podPublicHeaders(pod: Pod, files: string[]): Set<string> {
841
758
  const privatePatterns = segments.map((text) =>
842
759
  podspecList(text, 'private_header_files'),
843
760
  )
844
- if ([...publicPatterns, ...privatePatterns].includes('computed'))
845
- throw new Error(`${pod.name}.podspec: header visibility is computed by Ruby`)
846
- const globs = (patterns: (string[] | 'computed' | null)[]) =>
761
+ const globs = (patterns: (string[] | null)[]) =>
847
762
  patterns.flatMap((value) => (Array.isArray(value) ? value.map(globRegex) : []))
848
763
  const publicGlobs = globs(publicPatterns)
849
764
  const privateGlobs = globs(privatePatterns)
@@ -852,7 +767,7 @@ function podPublicHeaders(pod: Pod, files: string[]): Set<string> {
852
767
  const relative = pod.directory ? file.slice(pod.directory.length + 1) : file
853
768
  return (
854
769
  HEADER.test(file) &&
855
- (publicPatterns.every((value) => value === null) ||
770
+ (publicPatterns.every((value) => !value?.length) ||
856
771
  publicGlobs.some((glob) => glob.test(relative))) &&
857
772
  !privateGlobs.some((glob) => glob.test(relative))
858
773
  )
@@ -864,6 +779,110 @@ function stripComments(text: string): string {
864
779
  return text.replace(/\/\*[\s\S]*?\*\//g, '').replace(/\/\/[^\n]*/g, '')
865
780
  }
866
781
 
782
+ /**
783
+ * collects `ComponentName[]` external definitions inside `namespace facebook::react`
784
+ * so `ShadowNodes.cpp` drops symbols the pod's own sources already emit.
785
+ */
786
+ export function definedFacebookReactComponentNames(source: string): Set<string> {
787
+ const out = new Set<string>()
788
+ let masked = ''
789
+ let i = 0
790
+ while (i < source.length) {
791
+ const ch = source[i]!
792
+ const next = source[i + 1]
793
+ if (ch === '/' && next === '/') {
794
+ while (i < source.length && source[i] !== '\n') i++
795
+ masked += ' '
796
+ } else if (ch === '/' && next === '*') {
797
+ i += 2
798
+ while (i < source.length && !(source[i] === '*' && source[i + 1] === '/')) i++
799
+ i += 2
800
+ masked += ' '
801
+ } else if (ch === 'R' && next === '"') {
802
+ const delimMatch = /^R"([^\s()\\]{0,16})\(/.exec(source.slice(i))
803
+ if (delimMatch) {
804
+ const closing = `)${delimMatch[1]}"`
805
+ const end = source.indexOf(closing, i + delimMatch[0].length)
806
+ i = end === -1 ? source.length : end + closing.length
807
+ masked += '""'
808
+ continue
809
+ }
810
+ masked += ch
811
+ i++
812
+ } else if (ch === '"' || ch === "'") {
813
+ const quote = ch
814
+ i++
815
+ while (i < source.length) {
816
+ if (source[i] === '\\') i += 2
817
+ else if (source[i] === quote) {
818
+ i++
819
+ break
820
+ } else i++
821
+ }
822
+ masked += quote + quote
823
+ } else {
824
+ masked += ch
825
+ i++
826
+ }
827
+ }
828
+
829
+ type Scope =
830
+ | { kind: 'ns'; parts: string[] }
831
+ | { kind: 'anon' }
832
+ | { kind: 'block' }
833
+ | { kind: 'linkage' }
834
+ const stack: Scope[] = []
835
+ const inFacebookReact = () => {
836
+ const names: string[] = []
837
+ for (const scope of stack) {
838
+ if (scope.kind === 'block' || scope.kind === 'anon') return false
839
+ if (scope.kind === 'ns') names.push(...scope.parts)
840
+ }
841
+ return names.length === 2 && names[0] === 'facebook' && names[1] === 'react'
842
+ }
843
+
844
+ let stmtStart = 0
845
+ for (let pos = 0; pos < masked.length; pos++) {
846
+ const ch = masked[pos]!
847
+ if (ch === '{') {
848
+ const header = masked.slice(stmtStart, pos).trim()
849
+ if (/\bnamespace\s*$/.test(header)) {
850
+ stack.push({ kind: 'anon' })
851
+ } else {
852
+ const nsMatch = /\bnamespace\s+([A-Za-z_]\w*(?:::[A-Za-z_]\w*)*)\s*$/.exec(header)
853
+ if (nsMatch) {
854
+ stack.push({ kind: 'ns', parts: nsMatch[1]!.split('::') })
855
+ } else if (/^extern(?:\s+"")?$/.test(header)) {
856
+ stack.push({ kind: 'linkage' })
857
+ } else {
858
+ stack.push({ kind: 'block' })
859
+ }
860
+ }
861
+ stmtStart = pos + 1
862
+ } else if (ch === '}') {
863
+ stack.pop()
864
+ stmtStart = pos + 1
865
+ } else if (ch === ';') {
866
+ if (inFacebookReact()) {
867
+ const stmt = masked.slice(stmtStart, pos)
868
+ const eq = stmt.indexOf('=')
869
+ if (eq !== -1) {
870
+ const lhs = stmt.slice(0, eq)
871
+ if (!/\bstatic\b/.test(lhs)) {
872
+ const match =
873
+ /(?:(?:const\s+|constexpr\s+)+char|char\s+(?:const|constexpr)(?:\s+(?:const|constexpr))?)\s+(\w+ComponentName)\s*\[\s*\]\s*$/.exec(
874
+ lhs,
875
+ )
876
+ if (match) out.add(match[1]!)
877
+ }
878
+ }
879
+ }
880
+ stmtStart = pos + 1
881
+ }
882
+ }
883
+ return out
884
+ }
885
+
867
886
  /** the C++ an Objective-C file runs, when the file is only a class whose
868
887
  * +load registers C++ TurboModules: its includes, using-directives and the
869
888
  * +load body. any other Objective-C needs the Objective-C runtime. */
@@ -940,6 +959,29 @@ function viewManagers(root: string, files: Iterable<string>): Set<string> {
940
959
  return managers
941
960
  }
942
961
 
962
+ /** the RCTViewManager subclasses a pod registers (RCT_EXPORT_MODULE in its
963
+ * @implementation, or a Swift manager's RCT_EXTERN_MODULE): Fabric mounts
964
+ * each through React Native's legacy view manager interop. */
965
+ function paperViewManagers(root: string, files: Iterable<string>): string[] {
966
+ const sources = [...files]
967
+ const managers = viewManagers(root, sources)
968
+ const exported = new Set<string>()
969
+ for (const file of sources) {
970
+ if (!OBJC.test(file)) continue
971
+ const text = stripComments(fs.readFileSync(path.join(root, file), 'utf8'))
972
+ for (const [, name, body] of text.matchAll(
973
+ /@implementation\s+(\w+)\b([\s\S]*?)@end/g,
974
+ ))
975
+ if (name !== 'RCTViewManager' && managers.has(name!) && OBJC_REGISTERED.test(body!))
976
+ exported.add(name!)
977
+ for (const [, name, parent] of text.matchAll(
978
+ /\bRCT_EXTERN_(?:REMAP_MODULE\s*\(\s*\w*\s*,\s*|MODULE\s*\(\s*)(\w+)\s*,\s*(\w+)/g,
979
+ ))
980
+ if (managers.has(parent!)) exported.add(name!)
981
+ }
982
+ return [...exported].sort()
983
+ }
984
+
943
985
  function registers(root: string, files: Iterable<string>, objc = true): boolean {
944
986
  const sources = [...files]
945
987
  const managers = objc ? viewManagers(root, sources) : new Set<string>()
@@ -963,9 +1005,11 @@ function registers(root: string, files: Iterable<string>, objc = true): boolean
963
1005
  return false
964
1006
  }
965
1007
 
966
- export async function turboProviderCandidates(appRoot: string) {
1008
+ export async function turboProviderCandidates(
1009
+ appRoot: string,
1010
+ answered = peachAnsweredNativePackages(),
1011
+ ) {
967
1012
  const candidates: { provider: TurboProvider; fabric: boolean; expo: boolean }[] = []
968
- const answered = peachAnsweredNativePackages()
969
1013
  const autolinked = await iosAutolinkedDependencies(appRoot)
970
1014
  // the React Native autolinker leaves out Expo modules, whose Objective-C
971
1015
  // can still register with React Native
@@ -993,9 +1037,10 @@ export async function discoverTurboProviders(
993
1037
  projectRoot?: string,
994
1038
  iosTarget?: string,
995
1039
  answered: ReadonlySet<string> = new Set(),
1040
+ answeredPackages?: ReadonlySet<string>,
996
1041
  ): Promise<TurboProvider[]> {
997
1042
  const providers: TurboProvider[] = []
998
- const candidates = await turboProviderCandidates(appRoot)
1043
+ const candidates = await turboProviderCandidates(appRoot, answeredPackages)
999
1044
  const installed =
1000
1045
  projectRoot && installedXcodeWorkspace(projectRoot)
1001
1046
  ? installedNativeSources(
@@ -1011,7 +1056,11 @@ export async function discoverTurboProviders(
1011
1056
  : { root: pod.root, files: fabric ? null : podGlobFiles(pod) }
1012
1057
  if (!sources) continue
1013
1058
  const { root, files } = sources
1014
- if (fabric || (files !== null && registers(root, files))) {
1059
+ if (
1060
+ fabric ||
1061
+ (files !== null &&
1062
+ (registers(root, files) || paperViewManagers(root, files).length > 0))
1063
+ ) {
1015
1064
  const nameFiles = files ?? podGlobFiles(pod)
1016
1065
  if (
1017
1066
  answered.size > 0 &&
@@ -1020,7 +1069,7 @@ export async function discoverTurboProviders(
1020
1069
  )
1021
1070
  continue
1022
1071
  const dependencies = await Promise.all(
1023
- podspecDependencies(pod.text).map((dep) =>
1072
+ podspecDependencies(pod).map((dep) =>
1024
1073
  resolveExternalTurboPod(dep.name, dep.requirements, dep.subspecs),
1025
1074
  ),
1026
1075
  )
@@ -1116,7 +1165,7 @@ export async function collectTurboSources(options: {
1116
1165
  const reactNative = packageInfo(options.reactNativeRoot)
1117
1166
  if (reactNative.name !== 'react-native')
1118
1167
  throw new Error(`${options.reactNativeRoot} is not react-native`)
1119
- const providers = options.providers
1168
+ const rawProviders = options.providers
1120
1169
  .map((provider) => ({ ...provider, info: packageInfo(provider.root) }))
1121
1170
  .sort((a, b) => a.info.name.localeCompare(b.info.name))
1122
1171
  const installedHeaderPods = (
@@ -1128,6 +1177,100 @@ export async function collectTurboSources(options: {
1128
1177
  )
1129
1178
  let codegen: string | null = null
1130
1179
  let moduleProviders = false
1180
+ let codegenState: {
1181
+ generated: string
1182
+ owned: Set<string>
1183
+ thirdPartyComponentOwners: Set<string>
1184
+ } | null = null
1185
+ const loadCodegen = async () => {
1186
+ if (codegenState) return codegenState
1187
+ codegen = (await runInstalledTurboCodegen(options.appRoot, options.codegenDir))
1188
+ .generatedRoot
1189
+ const generated = codegenSpecRoot(codegen)
1190
+ const owned = new Set<string>()
1191
+ walkFiles(generated, '', owned)
1192
+ const thirdPartyComponentOwners = new Set<string>()
1193
+ const thirdParty = path.join(generated, 'RCTThirdPartyComponentsProvider.mm')
1194
+ if (fs.existsSync(thirdParty)) {
1195
+ for (const [, , , owner] of fs
1196
+ .readFileSync(thirdParty, 'utf8')
1197
+ .matchAll(/@"([^"]+)": NSClassFromString\(@"([^"]+)"\), \/\/ (\S+)/g)) {
1198
+ if (owner) thirdPartyComponentOwners.add(owner)
1199
+ }
1200
+ }
1201
+ codegenState = { generated, owned, thirdPartyComponentOwners }
1202
+ return codegenState
1203
+ }
1204
+ const providers: ((typeof rawProviders)[number] & { providerFabric: boolean })[] = []
1205
+ for (const provider of rawProviders) {
1206
+ if (!fabricComponents(provider.root)) {
1207
+ providers.push({ ...provider, providerFabric: false })
1208
+ continue
1209
+ }
1210
+ const manifest = packageManifest(provider.root)
1211
+ const codegenConfig =
1212
+ manifest && object(manifest.codegenConfig) ? manifest.codegenConfig : null
1213
+ const spec =
1214
+ codegenConfig && codegenConfig.includesGeneratedCode !== true
1215
+ ? codegenConfig.name
1216
+ : null
1217
+ if (
1218
+ codegenConfig &&
1219
+ codegenConfig.includesGeneratedCode !== true &&
1220
+ typeof spec !== 'string'
1221
+ )
1222
+ throw new Error(`${provider.info.name}: codegenConfig has no name`)
1223
+ const cg = await loadCodegen()
1224
+ const pod = readPod(
1225
+ provider,
1226
+ options.appRoot,
1227
+ options.installedPods?.get(provider.name),
1228
+ )
1229
+ const allPodFiles = podFiles(pod)
1230
+ let providerFabric =
1231
+ cg.thirdPartyComponentOwners.has(provider.info.name) ||
1232
+ cg.thirdPartyComponentOwners.has(provider.name)
1233
+ if (!providerFabric) {
1234
+ if (typeof spec === 'string') {
1235
+ const shadowNodesFile = `react/renderer/components/${spec}/ShadowNodes.cpp`
1236
+ const descriptorsFile = `react/renderer/components/${spec}/ComponentDescriptors.cpp`
1237
+ providerFabric =
1238
+ (cg.owned.has(shadowNodesFile) &&
1239
+ definedFacebookReactComponentNames(
1240
+ fs.readFileSync(path.join(cg.generated, shadowNodesFile), 'utf8'),
1241
+ ).size > 0) ||
1242
+ (cg.owned.has(descriptorsFile) &&
1243
+ /\bregistry->add\s*\(/.test(
1244
+ stripComments(
1245
+ fs.readFileSync(path.join(cg.generated, descriptorsFile), 'utf8'),
1246
+ ),
1247
+ ))
1248
+ } else {
1249
+ providerFabric = allPodFiles.some(
1250
+ (file) =>
1251
+ file.includes('react/renderer/components/') ||
1252
+ (OBJC.test(file) &&
1253
+ /\bRCTComponentViewProtocol\b/.test(
1254
+ fs.readFileSync(path.join(pod.root, file), 'utf8'),
1255
+ )),
1256
+ )
1257
+ }
1258
+ }
1259
+ if (!providerFabric) {
1260
+ const filteredFiles = allPodFiles.filter((file) => {
1261
+ if (!provider.reactModulesOnly || HEADER.test(file)) return true
1262
+ if (!OBJC.test(file)) return false
1263
+ const text = fs.readFileSync(path.join(pod.root, file), 'utf8')
1264
+ return registersReactModule(text) || CODEGEN_OBJC.test(text)
1265
+ })
1266
+ if (
1267
+ !registers(pod.root, filteredFiles) &&
1268
+ paperViewManagers(pod.root, filteredFiles).length === 0
1269
+ )
1270
+ continue
1271
+ }
1272
+ providers.push({ ...provider, providerFabric })
1273
+ }
1131
1274
  const installedCodegenNames = new Set(
1132
1275
  installedHeaderPods.flatMap((pod) => {
1133
1276
  const manifest = packageManifest(pod.packageRoot)
@@ -1175,7 +1318,10 @@ export async function collectTurboSources(options: {
1175
1318
  externalPodSources: [],
1176
1319
  rendererSwiftTargets: [],
1177
1320
  fabricComponents: [],
1321
+ paperViewManagers: [],
1178
1322
  }
1323
+ if (providers.length === 0 && !options.reactNativeProvider && !options.reactNativeCore)
1324
+ return result
1179
1325
  const sharedLibrary = [...(options.installedPods?.values() ?? [])].find(
1180
1326
  (pod) => pod.sharedLibrary,
1181
1327
  )?.sharedLibrary
@@ -1255,11 +1401,18 @@ export async function collectTurboSources(options: {
1255
1401
  name: targetName,
1256
1402
  deploymentTarget: null,
1257
1403
  headers: [],
1258
- publicHeaders: [],
1404
+ publicHeaders:
1405
+ targetName === TURBO_CORE_TARGET
1406
+ ? [
1407
+ `${targetPath(targetName)}/${TURBO_CORE_PUBLIC_HEADERS}/${TURBO_ENTRY_HEADER}`,
1408
+ ]
1409
+ : [],
1259
1410
  flattensPublicHeaders: false,
1260
1411
  bridgingHeader: null,
1261
1412
  prefixHeader,
1262
- headerSearchPaths: [`${targetPath(targetName)}/include`],
1413
+ headerSearchPaths: [
1414
+ `${targetPath(targetName)}/${targetName === TURBO_CORE_TARGET ? TURBO_CORE_PUBLIC_HEADERS : 'include'}`,
1415
+ ],
1263
1416
  userHeaderSearchPaths: [],
1264
1417
  frameworkSearchPaths: [],
1265
1418
  headerMaps: [],
@@ -1338,7 +1491,6 @@ export async function collectTurboSources(options: {
1338
1491
  },
1339
1492
  options.appRoot,
1340
1493
  )
1341
- if (!/\.header_dir\s*=\s*['"]['"]/.test(pod.text)) continue
1342
1494
  for (const segment of podSegments(pod)) {
1343
1495
  const mapping = podspecList(segment, 'header_mappings_dir')
1344
1496
  const headerDir = podspecList(segment, 'header_dir')
@@ -1354,13 +1506,7 @@ export async function collectTurboSources(options: {
1354
1506
  const excluded = podspecList(segment, 'exclude_files')
1355
1507
  const publicFiles = podspecList(segment, 'public_header_files')
1356
1508
  const privateFiles = podspecList(segment, 'private_header_files')
1357
- if (
1358
- !Array.isArray(sources) ||
1359
- excluded === 'computed' ||
1360
- publicFiles === 'computed' ||
1361
- privateFiles === 'computed'
1362
- )
1363
- continue
1509
+ if (!Array.isArray(sources)) continue
1364
1510
  const base = path.posix.normalize(path.posix.join(pod.directory, mapping[0]!))
1365
1511
  const candidates = new Set<string>()
1366
1512
  for (const glob of sources)
@@ -1418,12 +1564,15 @@ export async function collectTurboSources(options: {
1418
1564
  // directory, then the search paths CocoaPods gives a module pod. unresolved
1419
1565
  // names are the SDK's own headers.
1420
1566
  const podFileLists = new Map<string, Set<string>>()
1567
+ // header lookup takes regular files only, so <ios> passes over an ios directory
1568
+ const isHeaderFile = (file: string) =>
1569
+ fs.statSync(file, { throwIfNoEntry: false })?.isFile() ?? false
1421
1570
  const resolve = (from: Scan, include: string, quoted: boolean) => {
1422
1571
  if (quoted) {
1423
1572
  const relative = path.posix.normalize(
1424
1573
  path.posix.join(path.posix.dirname(from.relative), include),
1425
1574
  )
1426
- if (!relative.startsWith('../') && fs.existsSync(path.join(from.root, relative))) {
1575
+ if (!relative.startsWith('../') && isHeaderFile(path.join(from.root, relative))) {
1427
1576
  original(from.targetName, from.label, from.root, relative, false)
1428
1577
  return
1429
1578
  }
@@ -1443,7 +1592,7 @@ export async function collectTurboSources(options: {
1443
1592
  for (const directory of pod.searchPaths) {
1444
1593
  const file = path.resolve(pod.root, directory, include)
1445
1594
  const relative = relativeInside(pod.root, file)
1446
- if (relative === null || !fs.existsSync(file)) continue
1595
+ if (relative === null || !isHeaderFile(file)) continue
1447
1596
  alias(own, original(from.targetName, pod.label, pod.root, relative, false))
1448
1597
  return
1449
1598
  }
@@ -1452,12 +1601,10 @@ export async function collectTurboSources(options: {
1452
1601
  if (!publicHeaders) {
1453
1602
  publicHeaders = new Map()
1454
1603
  for (const pod of installedHeaderPods) {
1455
- // only read pods which can expose this namespace. other podspecs may
1456
- // use Ruby-computed attributes unrelated to this include.
1457
1604
  if (
1458
1605
  pod.name !== namespace &&
1459
- ![...pod.text.matchAll(/\.header_dir\s*=\s*['"]([^'"]+)['"]/g)].some(
1460
- (match) => match[1] === namespace,
1606
+ !podSegments(pod).some((spec) =>
1607
+ podspecList(spec, 'header_dir')?.includes(namespace),
1461
1608
  )
1462
1609
  )
1463
1610
  continue
@@ -1466,7 +1613,7 @@ export async function collectTurboSources(options: {
1466
1613
  const visible = podPublicHeaders(pod, files)
1467
1614
  const mappings = podHeaderMappings(pod)
1468
1615
  const headerDir = podspecList(segments[0]!, 'header_dir')
1469
- if (headerDir === 'computed' || (headerDir && headerDir.length !== 1))
1616
+ if (headerDir && headerDir.length !== 1)
1470
1617
  throw new Error(`${pod.name}.podspec: header_dir is computed by Ruby`)
1471
1618
  for (const file of files) {
1472
1619
  if (!visible.has(file)) continue
@@ -1514,7 +1661,7 @@ export async function collectTurboSources(options: {
1514
1661
  if (
1515
1662
  !relative.startsWith('../') &&
1516
1663
  !path.posix.isAbsolute(relative) &&
1517
- fs.existsSync(path.join(generated, relative))
1664
+ isHeaderFile(path.join(generated, relative))
1518
1665
  ) {
1519
1666
  alias(own, original(from.targetName, 'ReactCodegen', generated, relative))
1520
1667
  return
@@ -1538,7 +1685,7 @@ export async function collectTurboSources(options: {
1538
1685
  }
1539
1686
  for (const base of REACT_NATIVE_INCLUDE_ROOTS) {
1540
1687
  const relative = `${base}/${include}`
1541
- if (!fs.existsSync(path.join(reactNative.root, relative))) continue
1688
+ if (!isHeaderFile(path.join(reactNative.root, relative))) continue
1542
1689
  alias(
1543
1690
  `${core}/include/${include}`,
1544
1691
  original(TURBO_CORE_TARGET, 'react-native', reactNative.root, relative),
@@ -1548,7 +1695,7 @@ export async function collectTurboSources(options: {
1548
1695
  if (
1549
1696
  hermesHeaders &&
1550
1697
  include.startsWith('hermes/') &&
1551
- fs.existsSync(path.join(hermesHeaders, include))
1698
+ isHeaderFile(path.join(hermesHeaders, include))
1552
1699
  ) {
1553
1700
  alias(
1554
1701
  `${core}/include/${include}`,
@@ -1733,6 +1880,9 @@ export async function collectTurboSources(options: {
1733
1880
  const fabricPackages = new Set<string>()
1734
1881
  const fabricViews: FabricComponent[] = []
1735
1882
  let fabricTarget: { targetName: string; label: string; root: string } | null = null
1883
+ // the RCTViewManager classes the providers register, mounted through the interop
1884
+ const paperClasses: string[] = []
1885
+ let paperTarget: { targetName: string; label: string; root: string } | null = null
1736
1886
  let legacyBridge = false
1737
1887
  let hermesHeaders: string | null = null
1738
1888
  const objcClasses = new Set<string>()
@@ -1767,7 +1917,7 @@ export async function collectTurboSources(options: {
1767
1917
  { tool: 'cxx', flags: pod.installed.preprocessorFlags.cxx },
1768
1918
  ]
1769
1919
  const root = pod.root
1770
- if (fabricComponents(provider.root)) {
1920
+ if (provider.providerFabric) {
1771
1921
  fabric = true
1772
1922
  fabricPackages.add(provider.name)
1773
1923
  fabricTarget ??= { targetName, label, root: provider.root }
@@ -1787,6 +1937,13 @@ export async function collectTurboSources(options: {
1787
1937
  return registersReactModule(text) || CODEGEN_OBJC.test(text)
1788
1938
  })
1789
1939
  const managers = viewManagers(root, files)
1940
+ const paper = paperViewManagers(root, files)
1941
+ if (paper.length > 0) {
1942
+ // RCTLegacyViewManagerInteropComponentView, from the renderer pods, mounts them
1943
+ fabric = true
1944
+ paperClasses.push(...paper)
1945
+ paperTarget ??= { targetName, label, root: provider.root }
1946
+ }
1790
1947
  const headers = new Map<string, { label: string; root: string; relative: string }>()
1791
1948
  podHeaders.set(targetName, {
1792
1949
  headers,
@@ -1796,11 +1953,15 @@ export async function collectTurboSources(options: {
1796
1953
  // name under the pod directory
1797
1954
  searchPaths:
1798
1955
  pod.installed?.headerSearchPaths ??
1799
- [...pod.text.matchAll(/HEADER_SEARCH_PATHS['"]?\s*=>\s*(.+)/g)].flatMap((line) =>
1800
- [...line[1]!.matchAll(/\$\(PODS_TARGET_SRCROOT\)\/([^\s"'\\)]+)/g)].map(
1801
- (match) => match[1]!,
1802
- ),
1803
- ),
1956
+ podSegments(pod).flatMap((spec) => {
1957
+ const config = spec.attrs.get('pod_target_xcconfig')
1958
+ if (!object(config) || typeof config.HEADER_SEARCH_PATHS !== 'string') return []
1959
+ return [
1960
+ ...config.HEADER_SEARCH_PATHS.matchAll(
1961
+ /\$\(PODS_TARGET_SRCROOT\)\/([^\s"'\\)]+)/g,
1962
+ ),
1963
+ ].map((match) => match[1]!)
1964
+ }),
1804
1965
  dependencySearchPaths: pod.installed?.dependencySearchPaths ?? [],
1805
1966
  reactHeaderMaps: (pod.installed?.reactHeaderMaps ?? []).map(
1806
1967
  ({ flag, entries }) => ({
@@ -1912,13 +2073,13 @@ export async function collectTurboSources(options: {
1912
2073
  files: string[]
1913
2074
  }[] = []
1914
2075
  const externalDefines: string[] = []
1915
- for (const dep of podspecDependencies(pod.text)) {
2076
+ for (const dep of podspecDependencies(pod)) {
1916
2077
  const installed = installedHeaderPods.find(
1917
2078
  (candidate) => candidate.name === dep.name,
1918
2079
  )
1919
- const moduleNames = installed ? podspecList(installed.text, 'module_name') : null
1920
- if (moduleNames === 'computed')
1921
- throw new Error(`${dep.name}: module_name must come from the installed pod`)
2080
+ const moduleNames = installed
2081
+ ? podspecList(podSegments(installed)[0]!, 'module_name')
2082
+ : null
1922
2083
  const installedTarget = installedTargets.find(
1923
2084
  (target) => target.name === dep.name && target.podRoot,
1924
2085
  )
@@ -1948,7 +2109,7 @@ export async function collectTurboSources(options: {
1948
2109
  name: installed.name,
1949
2110
  moduleName: moduleNames?.[0] ?? installed.name,
1950
2111
  root: installed.root,
1951
- files: podFiles(installed),
2112
+ files: podFiles(installed, dep.subspecs),
1952
2113
  defines: [],
1953
2114
  }
1954
2115
  : await resolveExternalTurboPod(dep.name, dep.requirements, dep.subspecs)
@@ -2032,7 +2193,7 @@ export async function collectTurboSources(options: {
2032
2193
  }
2033
2194
  }
2034
2195
  if (swiftSources.length > 0 || depSwiftPods.length > 0) {
2035
- const moduleName = podspecList(pod.text, 'module_name')
2196
+ const moduleName = podspecList(podSegments(pod)[0]!, 'module_name')
2036
2197
  const swiftModule =
2037
2198
  (Array.isArray(moduleName) ? moduleName[0] : undefined) ??
2038
2199
  pod.name.replace(/[^A-Za-z0-9_]/g, '_').replace(/^[0-9]/, '_')
@@ -2073,7 +2234,12 @@ export async function collectTurboSources(options: {
2073
2234
  ].join('\n'),
2074
2235
  )
2075
2236
  }
2076
- if (loads.length === 0 && !registers(root, files) && !fabricComponents(provider.root))
2237
+ if (
2238
+ loads.length === 0 &&
2239
+ !registers(root, files) &&
2240
+ !provider.providerFabric &&
2241
+ paper.length === 0
2242
+ )
2077
2243
  throw new Error(`${label}: its pod sources register no TurboModule`)
2078
2244
  objc ||= providerObjC
2079
2245
  if (codegenConfig && codegenConfig.includesGeneratedCode !== true) {
@@ -2089,13 +2255,14 @@ export async function collectTurboSources(options: {
2089
2255
  const getDefinedComponentNames = () => {
2090
2256
  if (definedComponentNames) return definedComponentNames
2091
2257
  definedComponentNames = new Set()
2092
- const pattern =
2093
- /\b(?:const\s+char|char\s+const)\s+(\w+ComponentName)\s*\[\s*\]\s*=/g
2094
2258
  for (const sourceFile of sources) {
2095
- const text = readPackageFile(root, path.join(root, sourceFile), Infinity)
2096
- .toString('utf8')
2097
- .replace(/\/\/[^\n]*/g, '')
2098
- for (const match of text.matchAll(pattern)) definedComponentNames.add(match[1]!)
2259
+ const text = readPackageFile(
2260
+ root,
2261
+ path.join(root, sourceFile),
2262
+ Infinity,
2263
+ ).toString('utf8')
2264
+ for (const name of definedFacebookReactComponentNames(text))
2265
+ definedComponentNames.add(name)
2099
2266
  }
2100
2267
  return definedComponentNames
2101
2268
  }
@@ -2104,13 +2271,14 @@ export async function collectTurboSources(options: {
2104
2271
  // the Objective-C spec classes only an Objective-C module reaches
2105
2272
  const objcSpec = providerObjC && file.startsWith(`${spec}/`)
2106
2273
  // the Fabric component sources, named by the path codegen gives them
2107
- const component = file.startsWith(`react/renderer/components/${spec}/`)
2274
+ const component =
2275
+ provider.providerFabric && file.startsWith(`react/renderer/components/${spec}/`)
2108
2276
  if (!base.startsWith(`${spec}JSI`) && !objcSpec && !component) continue
2109
2277
  // CocoaPods searches a pod's own mapped headers before ReactCodegen.
2110
2278
  if (component && HEADER.test(base) && headers.has(file)) continue
2111
2279
  if (HEADER.test(base))
2112
2280
  header(
2113
- component
2281
+ (component
2114
2282
  ? [file]
2115
2283
  : [
2116
2284
  base,
@@ -2118,7 +2286,8 @@ export async function collectTurboSources(options: {
2118
2286
  `ReactCodegen/${base}`,
2119
2287
  `ReactCodegen/${file}`,
2120
2288
  `${spec}/${base}`,
2121
- ],
2289
+ ]
2290
+ ).filter((name) => headers.get(name)?.label !== label),
2122
2291
  {
2123
2292
  label: 'ReactCodegen',
2124
2293
  root: generated,
@@ -2135,17 +2304,12 @@ export async function collectTurboSources(options: {
2135
2304
  Infinity,
2136
2305
  ).toString('utf8')
2137
2306
  const filtered = source.replace(
2138
- /^[ \t]*(?:extern[ \t]+)?(?:const[ \t]+char|char[ \t]+const)[ \t]+(\w+ComponentName)[ \t]*\[[ \t]*\][ \t]*=[^;]*;[ \t]*\r?\n?/gm,
2307
+ /^[ \t]*(?:(?:JSI_EXPORT|extern)[ \t]+)*(?:(?:const[ \t]+|constexpr[ \t]+)+char|char[ \t]+(?:const|constexpr)(?:[ \t]+(?:const|constexpr))?)[ \t]+(\w+ComponentName)[ \t]*\[[ \t]*\][ \t]*=[^;]*;[ \t]*\r?\n?/gm,
2139
2308
  (line, name: string) => (defined.has(name) ? '' : line),
2140
2309
  )
2141
2310
  if (filtered !== source) {
2142
2311
  // a pod's own Fabric node sources can already define ComponentName[], clashing with codegen's ShadowNodes.cpp
2143
- if (
2144
- !/\b(?:const\s+char|char\s+const)\s+\w+ComponentName\s*\[\s*\]\s*=/.test(
2145
- filtered,
2146
- )
2147
- )
2148
- continue
2312
+ if (definedFacebookReactComponentNames(filtered).size === 0) continue
2149
2313
  const key = original(targetName, 'ReactCodegen', generated, file)
2150
2314
  result.files[key] = filtered
2151
2315
  continue
@@ -2234,27 +2398,26 @@ export async function collectTurboSources(options: {
2234
2398
  )
2235
2399
  let decoratorHasPerformanceLogger = false
2236
2400
  let managerHasDevMenuDecorator = false
2237
- if (objc || fabric) {
2238
- // both the module manager and Fabric renderer reach the configured glog pod.
2239
- for (const { relative, source, text, sha256, configured } of glogSources()) {
2240
- const key = `${core}/dependencies/glog/${relative}`
2241
- add(key, text)
2242
- result.sources.push({
2243
- file: key,
2244
- source,
2245
- sha256,
2246
- ...(configured && { configured }),
2247
- })
2248
- if (relative.startsWith('src/glog/'))
2249
- alias(`${core}/include/${relative.slice('src/'.length)}`, key)
2250
- }
2251
- // the pod's header search path is src/, which base/mutex.h's "config.h"
2252
- // reaches
2253
- alias(
2254
- `${core}/dependencies/glog/src/base/config.h`,
2255
- `${core}/dependencies/glog/src/config.h`,
2256
- )
2401
+ // fabric renderer units call ObjCTurboModule and RCTBridging helpers compiled under objc.
2402
+ if (fabric) objc = true
2403
+ // c++ modules, the module manager and fabric all reach the configured glog pod.
2404
+ for (const { relative, source, text, sha256, configured } of glogSources()) {
2405
+ const key = `${core}/dependencies/glog/${relative}`
2406
+ add(key, text)
2407
+ result.sources.push({
2408
+ file: key,
2409
+ source,
2410
+ sha256,
2411
+ ...(configured && { configured }),
2412
+ })
2413
+ if (relative.startsWith('src/glog/'))
2414
+ alias(`${core}/include/${relative.slice('src/'.length)}`, key)
2257
2415
  }
2416
+ // the pod's header search path is src/, which base/mutex.h's "config.h" reaches
2417
+ alias(
2418
+ `${core}/dependencies/glog/src/base/config.h`,
2419
+ `${core}/dependencies/glog/src/config.h`,
2420
+ )
2258
2421
  if (objc) {
2259
2422
  // the installed react native declaration owns this ABI, including for
2260
2423
  // unpublished workspace versions whose package version is 1000.0.0.
@@ -2299,6 +2462,9 @@ export async function collectTurboSources(options: {
2299
2462
  [
2300
2463
  '#pragma once',
2301
2464
  '#include <ctype.h>',
2465
+ '#ifdef __cplusplus',
2466
+ '#include <string>',
2467
+ '#endif',
2302
2468
  '#define DISABLE_INIT_WITH_INFO_PLIST 1',
2303
2469
  '#ifdef __OBJC__',
2304
2470
  '#import <UIKit/UIKit.h>',
@@ -2354,6 +2520,15 @@ export async function collectTurboSources(options: {
2354
2520
  '#pragma once\n#import <Foundation/Foundation.h>\n',
2355
2521
  )
2356
2522
  addUnits(REACT_NATIVE_OBJC_UNITS)
2523
+ // Legacy modules occasionally declare scalar pointer args (e.g. BOOL *) that
2524
+ // RCTModuleMethod handles via _C_PTR; handle them using RCTConvert's return type.
2525
+ const interopKey = `${core}/upstream/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.mm`
2526
+ if (result.files[interopKey]) {
2527
+ result.files[interopKey] = result.files[interopKey]!.replace(
2528
+ ` if (objCArgType == @encode(void *)) {\n void *arg = RCTConvertTo<void *>(selector, objCArg);\n [inv setArgument:&arg atIndex:(index) + 2];\n return;\n }`,
2529
+ ` if (objCArgType == @encode(void *)) {\n void *arg = RCTConvertTo<void *>(selector, objCArg);\n [inv setArgument:&arg atIndex:(index) + 2];\n return;\n }\n if (objCArgType[0] == _C_PTR) {\n const char *retType = [[RCTConvert methodSignatureForSelector:selector] methodReturnType];\n uintptr_t ptrVal = 0;\n if (retType && (retType[0] == _C_BOOL || retType[0] == _C_CHR || retType[0] == _C_UCHR)) {\n ptrVal = RCTConvertTo<BOOL>(selector, objCArg) ? 1 : 0;\n } else if (retType && (retType[0] == _C_INT || retType[0] == _C_UINT || retType[0] == _C_LNG || retType[0] == _C_ULNG)) {\n ptrVal = (uintptr_t)RCTConvertTo<NSInteger>(selector, objCArg);\n } else {\n void *arg = RCTConvertTo<void *>(selector, objCArg);\n [inv setArgument:&arg atIndex:(index) + 2];\n return;\n }\n void *arg = (void *)ptrVal;\n [inv setArgument:&arg atIndex:(index) + 2];\n return;\n }`,
2530
+ )
2531
+ }
2357
2532
  addUnits(REACT_NATIVE_OBJC_VERSIONED_UNITS, true)
2358
2533
  // releases 0.78 through 0.86 compile the inspector host delegate and the
2359
2534
  // legacy bridge class into RCTBridge.mm
@@ -2391,17 +2566,57 @@ export async function collectTurboSources(options: {
2391
2566
  fabricViews.push({ name: name!, className: className! })
2392
2567
  // the host compiles with the first Fabric package's own settings, which
2393
2568
  // reach the React Fabric headers its component views include
2394
- if (fabricViews.length > 0 && fabricTarget) {
2569
+ const hostTarget =
2570
+ (fabricViews.length > 0 ? fabricTarget : null) ??
2571
+ (paperClasses.length > 0 ? paperTarget : null)
2572
+ if (hostTarget) {
2395
2573
  result.fabricComponents = fabricViews.map(({ name }) => name)
2396
- const unit = `${targetPath(fabricTarget.targetName)}/PeachFabricHost.mm`
2397
- add(unit, fabricHostSource(fabricViews))
2574
+ result.paperViewManagers = [...new Set(paperClasses)].sort()
2575
+ if (result.paperViewManagers.length > 0) {
2576
+ const PAPER_BRIDGE_TARGET = 'PeachPaperUIKitBridge'
2577
+ if (!result.targets.some((entry) => entry.name === PAPER_BRIDGE_TARGET)) {
2578
+ result.targets.push({
2579
+ ...target(PAPER_BRIDGE_TARGET, []),
2580
+ languageMode: 5,
2581
+ cxxInterop: false,
2582
+ })
2583
+ result.rendererSwiftTargets.push(PAPER_BRIDGE_TARGET)
2584
+ add(
2585
+ `${targetPath(PAPER_BRIDGE_TARGET)}/PeachPaperUIKitBridge.swift`,
2586
+ PAPER_UIKIT_BRIDGE_SWIFT,
2587
+ )
2588
+ }
2589
+ const hostManifestTarget = result.targets.find(
2590
+ (entry) => entry.name === hostTarget.targetName,
2591
+ )
2592
+ if (hostManifestTarget) {
2593
+ hostManifestTarget.dependencies ??= []
2594
+ if (
2595
+ !hostManifestTarget.dependencies.some(
2596
+ (dependency) => dependency.name === PAPER_BRIDGE_TARGET,
2597
+ )
2598
+ ) {
2599
+ hostManifestTarget.dependencies.push({
2600
+ kind: 'target',
2601
+ name: PAPER_BRIDGE_TARGET,
2602
+ })
2603
+ }
2604
+ }
2605
+ }
2606
+ const unit = `${targetPath(hostTarget.targetName)}/PeachFabricHost.mm`
2607
+ add(unit, fabricHostSource(fabricViews, result.paperViewManagers))
2398
2608
  scanText(
2399
- { key: unit, ...fabricTarget, relative: 'PeachFabricHost.mm' },
2609
+ { key: unit, ...hostTarget, relative: 'PeachFabricHost.mm' },
2400
2610
  result.files[unit]!,
2401
2611
  )
2402
2612
  }
2403
2613
  }
2614
+ let hasEventDispatcher = false
2404
2615
  if (fabric || legacyBridge) {
2616
+ hasEventDispatcher = fs.existsSync(
2617
+ path.join(reactNative.root, 'React/CoreModules/RCTEventDispatcher.mm'),
2618
+ )
2619
+ addUnits(['React/CoreModules/RCTEventDispatcher.mm'], true)
2405
2620
  // React-Core's own compiler_flags select the Hermes executor factory,
2406
2621
  // which React-hermes builds against the installed hermes-engine headers.
2407
2622
  // hermes-engine's binary owns the crash managers' out-of-line
@@ -2462,9 +2677,13 @@ export async function collectTurboSources(options: {
2462
2677
  )
2463
2678
  }
2464
2679
  addPodSources(
2465
- installedFabricSources(reactNative.root, { legacyBridge, bridgeOnly: !fabric }),
2680
+ installedFabricSources(reactNative.root, {
2681
+ legacyBridge,
2682
+ bridgeOnly: !fabric,
2683
+ appRoot: options.appRoot,
2684
+ }),
2466
2685
  )
2467
- const patterns = installedRendererDependencyGlobs(reactNative.root)
2686
+ const patterns = installedRendererDependencyGlobs(reactNative.root, options.appRoot)
2468
2687
  const matchers = new Map(
2469
2688
  Object.entries(patterns).map(([name, globs]) => [name, globs.map(globRegex)]),
2470
2689
  )
@@ -2521,6 +2740,7 @@ export async function collectTurboSources(options: {
2521
2740
  managerHasDevMenuDecorator,
2522
2741
  moduleProviders,
2523
2742
  fabric || legacyBridge,
2743
+ hasEventDispatcher,
2524
2744
  )
2525
2745
  : turboHostSource(withRuntime),
2526
2746
  )
@@ -2667,6 +2887,7 @@ function turboObjCHostSource(
2667
2887
  moduleProviders: boolean,
2668
2888
  // React-Core's Default subspec compiles, which holds RCTBridgeProxy
2669
2889
  bridgeProxy: boolean,
2890
+ hasEventDispatcher: boolean,
2670
2891
  ): string {
2671
2892
  const classNamesList = objcClasses.map((name) => `@${JSON.stringify(name)}`).join(', ')
2672
2893
  const unregisteredList = unregisteredClasses
@@ -2687,7 +2908,9 @@ function turboObjCHostSource(
2687
2908
  #import <React/RCTBridge+Private.h>
2688
2909
  #import <React/RCTBridge.h>
2689
2910
  #import <React/RCTBridgeModuleDecorator.h>
2690
- ${bridgeProxy ? '#import <React/RCTBridgeProxy.h>\n#import <React/RCTBridgeProxy+Cxx.h>' : ''}
2911
+ #import <React/RCTJSThread.h>
2912
+ ${bridgeProxy ? '#import <React/RCTBridgeProxy.h>\n#import <React/RCTBridgeProxy+Cxx.h>\n#import <React/RCTUIManager.h>\n#import <React/RCTUIManagerUtils.h>' : ''}
2913
+ ${bridgeProxy && hasEventDispatcher ? '#import <React/RCTEventDispatcher.h>' : ''}
2691
2914
  ${decoratorHasPerformanceLogger ? '#import <React/RCTPerformanceLogger.h>' : ''}
2692
2915
  #import <React/RCTBridgeModule.h>
2693
2916
  #import <React/RCTEventDispatcherProtocol.h>
@@ -2830,6 +3053,33 @@ RCT_EXPORT_MODULE()
2830
3053
  completionHandler:(void (^)(NSError *error, UIImage *image))completionHandler;
2831
3054
  @end
2832
3055
 
3056
+ extern "C" BOOL peachLoadRegisteredImageURL(
3057
+ NSURL *url,
3058
+ CGSize size,
3059
+ CGFloat scale,
3060
+ NSInteger resizeMode,
3061
+ void (^progressHandler)(int64_t progress, int64_t total),
3062
+ void (^partialLoadHandler)(UIImage *image),
3063
+ void (^completionHandler)(NSError *error, UIImage *image),
3064
+ dispatch_block_t *cancelOut) {
3065
+ if (!url) return NO;
3066
+ for (Class moduleClass in RCTGetModuleClasses()) {
3067
+ if (![moduleClass instancesRespondToSelector:@selector(canLoadImageURL:)]) continue;
3068
+ id<PeachImageURLLoader> loader = [moduleClass new];
3069
+ if (![loader canLoadImageURL:url]) continue;
3070
+ dispatch_block_t cancel = [loader loadImageForURL:url
3071
+ size:size
3072
+ scale:scale
3073
+ resizeMode:resizeMode
3074
+ progressHandler:progressHandler
3075
+ partialLoadHandler:partialLoadHandler
3076
+ completionHandler:completionHandler];
3077
+ if (cancelOut) *cancelOut = cancel;
3078
+ return YES;
3079
+ }
3080
+ return NO;
3081
+ }
3082
+
2833
3083
  @interface PeachImageURLLoading : NSObject <RCTBridgeModule>
2834
3084
  @end
2835
3085
 
@@ -2840,21 +3090,11 @@ RCT_EXPORT_METHOD(load:(NSString *)uri
2840
3090
  reject:(RCTPromiseRejectBlock)reject)
2841
3091
  {
2842
3092
  NSURL *url = [NSURL URLWithString:uri];
2843
- for (Class moduleClass in RCTGetModuleClasses()) {
2844
- if (![moduleClass instancesRespondToSelector:@selector(canLoadImageURL:)]) continue;
2845
- id<PeachImageURLLoader> loader = [moduleClass new];
2846
- if (![loader canLoadImageURL:url]) continue;
2847
- [loader loadImageForURL:url
2848
- size:CGSizeZero
2849
- scale:1
2850
- resizeMode:0
2851
- progressHandler:nil
2852
- partialLoadHandler:nil
2853
- completionHandler:^(NSError *error, UIImage *image) {
2854
- NSData *png = image ? UIImagePNGRepresentation(image) : nil;
2855
- if (png) resolve([png base64EncodedStringWithOptions:0]);
2856
- else reject(@"E_IMAGE_LOAD", error.localizedDescription ?: @"image URL loader returned no image", error);
2857
- }];
3093
+ if (peachLoadRegisteredImageURL(url, CGSizeZero, 1, 0, nil, nil, ^(NSError *error, UIImage *image) {
3094
+ NSData *png = image ? UIImagePNGRepresentation(image) : nil;
3095
+ if (png) resolve([png base64EncodedStringWithOptions:0]);
3096
+ else reject(@"E_IMAGE_LOAD", error.localizedDescription ?: @"image URL loader returned no image", error);
3097
+ }, nil)) {
2858
3098
  return;
2859
3099
  }
2860
3100
  resolve(nil);
@@ -2924,13 +3164,36 @@ ${
2924
3164
 
2925
3165
  @end
2926
3166
 
2927
- // an app's Fabric component views, which its own Fabric host defines
2928
- void peachInstallFabricViews(facebook::jsi::Runtime &runtime, std::shared_ptr<facebook::react::CallInvoker> invoker) __attribute__((weak));
3167
+ // an app's Fabric component views, which its own Fabric host defines. the
3168
+ // bridge proxy and module decorator are what RCTInstance gives the renderer's
3169
+ // context container, where the legacy view manager interop reads them
3170
+ void peachInstallFabricViews(facebook::jsi::Runtime &runtime, std::shared_ptr<facebook::react::CallInvoker> invoker, id bridgeProxy, id moduleDecorator) __attribute__((weak));
2929
3171
  void peachTeardownFabricViews() __attribute__((weak));
2930
3172
 
2931
3173
  // UIKitCore: the key window and root view controller an app delegate makes at launch
2932
3174
  extern "C" void PeachLaunchReactNativeWindow(void);
3175
+ ${
3176
+ bridgeProxy
3177
+ ? `
3178
+ // React Native 0.88's bridgeless RCTUIManager stub omits -methodQueue while
3179
+ // RCTUIManagerProxy asks RCTUIManager for method signatures; legacy view
3180
+ // managers reading _bridge.uiManager.methodQueue trap without it
3181
+ @interface RCTUIManager (PeachPaperMethodQueue)
3182
+ - (dispatch_queue_t)methodQueue;
3183
+ @end
3184
+
3185
+ @implementation RCTUIManager (PeachPaperMethodQueue)
3186
+ - (dispatch_queue_t)methodQueue {
3187
+ return RCTGetUIManagerQueue();
3188
+ }
3189
+ @end
2933
3190
 
3191
+ static dispatch_queue_t peachUIManagerProxyMethodQueue(id, SEL) {
3192
+ return RCTGetUIManagerQueue();
3193
+ }
3194
+ `
3195
+ : ''
3196
+ }
2934
3197
  extern "C" void peachTurboInitialize() {
2935
3198
  objc_create_block_classes_as_subclasses_of([NSObject class]);
2936
3199
  if (Class blockClass = NSClassFromString(@"_NSBlock")) {
@@ -2944,6 +3207,17 @@ extern "C" void peachTurboInitialize() {
2944
3207
  static_cast<uint32_t *>((__bridge void *)mainQueueClass)[4] &= ~2048u;
2945
3208
  *reinterpret_cast<void **>(&_dispatch_main_q) = (__bridge void *)mainQueueClass;
2946
3209
  }
3210
+ ${
3211
+ bridgeProxy
3212
+ ? ` if (Class uiManagerProxyClass = NSClassFromString(@"RCTUIManagerProxy")) {
3213
+ if (!class_getInstanceMethod(uiManagerProxyClass, @selector(methodQueue))) {
3214
+ const char *types = method_getTypeEncoding(class_getInstanceMethod([RCTUIManager class], @selector(methodQueue))) ?: "@@:";
3215
+ class_addMethod(uiManagerProxyClass, @selector(methodQueue), (IMP)peachUIManagerProxyMethodQueue, types);
3216
+ }
3217
+ }
3218
+ ${hasEventDispatcher ? ' if (![RCTGetModuleClasses() containsObject:[RCTEventDispatcher class]])\n RCTRegisterModule([RCTEventDispatcher class]);\n' : ''}`
3219
+ : ''
3220
+ } _RCTInitializeJSThreadConstantInternal();
2947
3221
  PeachLaunchReactNativeWindow();
2948
3222
  auto& runtime = peach::jsi_runtime::create(
2949
3223
  [] { invoker->drain(); },
@@ -3010,7 +3284,7 @@ ${
3010
3284
  }];
3011
3285
  [decorator.moduleRegistry setTurboModuleRegistry:manager];
3012
3286
  [manager installJSBindings:runtime];
3013
- if (peachInstallFabricViews) peachInstallFabricViews(runtime, invoker);
3287
+ if (peachInstallFabricViews) peachInstallFabricViews(runtime, invoker, ${bridgeProxy ? 'bridgeProxy' : 'nil'}, decorator);
3014
3288
  }
3015
3289
 
3016
3290
  // the screenshot the device took, as UIKit posts it to every observer in the
@@ -3036,7 +3310,7 @@ extern "C" __attribute__((export_name("peach_turbo_module_names"))) const char*
3036
3310
  ${moduleProviders ? ' [found addObjectsFromArray:RCTModuleProviders.moduleProviders.allKeys];' : ''}
3037
3311
  for (Class moduleClass in RCTGetModuleClasses())
3038
3312
  if (moduleClass != [PeachTurboRegistry class] &&
3039
- moduleClass != [PeachImageURLLoading class] &&
3313
+ moduleClass != [PeachImageURLLoading class] &&${bridgeProxy && hasEventDispatcher ? '\n moduleClass != [RCTEventDispatcher class] &&' : ''}
3040
3314
  ([moduleClass conformsToProtocol:@protocol(RCTTurboModule)] ||
3041
3315
  [moduleClass conformsToProtocol:@protocol(RCTBridgeModule)]))
3042
3316
  [found addObject:RCTBridgeModuleNameForClass(moduleClass)];
@@ -3058,6 +3332,9 @@ ${moduleProviders ? ' [found addObjectsFromArray:RCTModuleProviders.moduleProvi
3058
3332
  }
3059
3333
 
3060
3334
  const FABRIC_HOST_INCLUDES = `#import <Foundation/Foundation.h>
3335
+ #import <UIKit/UIKit.h>
3336
+ #import <QuartzCore/QuartzCore.h>
3337
+ #import <React/RCTUtils.h>
3061
3338
  #import <React/RCTComponentViewFactory.h>
3062
3339
  #import <React/RCTComponentViewProtocol.h>
3063
3340
  #import <React/RCTComponentViewRegistry.h>
@@ -3078,11 +3355,521 @@ const FABRIC_HOST_INCLUDES = `#import <Foundation/Foundation.h>
3078
3355
  #include <cstdlib>
3079
3356
  #include <optional>
3080
3357
  #include <unordered_map>
3358
+ #include <vector>
3081
3359
  #include <jsi/jsi.h>
3082
3360
 
3083
3361
  using namespace facebook;
3084
3362
  `
3085
3363
 
3364
+ // what the legacy view manager interop reads: the bridge proxy and module
3365
+ // decorator RCTInstance puts in the context container, each manager's
3366
+ // RCTComponentData view config, and the state its shadow node adopts
3367
+ const FABRIC_HOST_PAPER_INCLUDES = `#import <UIKit/UIKit.h>
3368
+ #import <objc/message.h>
3369
+ #import <objc/runtime.h>
3370
+ #import <React/RCTBridge+Private.h>
3371
+ #import <React/RCTBridgeModule.h>
3372
+ #import <React/RCTBridgeModuleDecorator.h>
3373
+ #import <React/RCTBridgeProxy.h>
3374
+ #import <React/RCTComponentData.h>
3375
+ #import <React/RCTEventDispatcherProtocol.h>
3376
+ #import <React/RCTUIManager.h>
3377
+ #import <React/RCTUtils.h>
3378
+ #import <React/RCTViewManager.h>
3379
+ #include <react/renderer/components/view/ViewEventEmitter.h>
3380
+ #include <react/renderer/core/ShadowNodeFragment.h>
3381
+ #include <react/utils/FollyConvert.h>
3382
+ #include <react/utils/ManagedObjectWrapper.h>
3383
+ #include <cmath>
3384
+ #include <cstdio>
3385
+ #include <mutex>
3386
+ #include <unordered_set>
3387
+ `
3388
+
3389
+ // UIKitCore omits @objc on a subset of UIKit properties/methods that Objective-C
3390
+ // Paper view managers call or export. Bridge them dynamically to the real Swift
3391
+ // UIKitCore implementations when absent from the Objective-C method lists.
3392
+ const PAPER_UIKIT_BRIDGE_SWIFT = `import Foundation
3393
+ import UIKit
3394
+
3395
+ @inline(__always) private func unretained<T: AnyObject>(_ ptr: UnsafeMutableRawPointer, as _: T.Type) -> T {
3396
+ Unmanaged<T>.fromOpaque(ptr).takeUnretainedValue()
3397
+ }
3398
+
3399
+ @inline(__always) private func retained(_ obj: AnyObject?) -> UnsafeMutableRawPointer? {
3400
+ obj.map { Unmanaged.passRetained($0).toOpaque() }
3401
+ }
3402
+
3403
+ @MainActor
3404
+ private final class PeachPaperAppDelegate: NSObject, UIApplicationDelegate {
3405
+ @objc var window: UIWindow? { UIApplication.shared.keyWindow }
3406
+ }
3407
+
3408
+ @MainActor private var peachPaperAppDelegateRef: PeachPaperAppDelegate?
3409
+
3410
+ @_cdecl("peach_paper_ensure_app_delegate")
3411
+ public func peach_paper_ensure_app_delegate() {
3412
+ MainActor.assumeIsolated {
3413
+ guard UIApplication.shared.delegate == nil else { return }
3414
+ let delegate = PeachPaperAppDelegate()
3415
+ peachPaperAppDelegateRef = delegate
3416
+ UIApplication.shared.delegate = delegate
3417
+ }
3418
+ }
3419
+
3420
+ @_cdecl("peach_paper_uiimage_with_data")
3421
+ public func peach_paper_uiimage_with_data(_ dataPtr: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3422
+ let data = unretained(dataPtr, as: NSData.self)
3423
+ return retained(UIImage(data: data as Data))
3424
+ }
3425
+
3426
+ @_cdecl("peach_paper_uiimage_get_size")
3427
+ public func peach_paper_uiimage_get_size(_ imgPtr: UnsafeMutableRawPointer, _ wOut: UnsafeMutablePointer<Double>, _ hOut: UnsafeMutablePointer<Double>) {
3428
+ let img = unretained(imgPtr, as: UIImage.self)
3429
+ wOut.pointee = Double(img.size.width)
3430
+ hOut.pointee = Double(img.size.height)
3431
+ }
3432
+
3433
+ @_cdecl("peach_paper_uiimage_get_scale")
3434
+ public func peach_paper_uiimage_get_scale(_ imgPtr: UnsafeMutableRawPointer) -> Double {
3435
+ Double(unretained(imgPtr, as: UIImage.self).scale)
3436
+ }
3437
+
3438
+ @_cdecl("peach_paper_uiview_appearance")
3439
+ public func peach_paper_uiview_appearance(_ clsNamePtr: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3440
+ MainActor.assumeIsolated {
3441
+ let name = unretained(clsNamePtr, as: NSString.self) as String
3442
+ guard let cls = NSClassFromString(name) as? UIView.Type else { return nil }
3443
+ return retained(cls.appearance())
3444
+ }
3445
+ }
3446
+
3447
+ @_cdecl("peach_paper_uiview_get_tint_color")
3448
+ public func peach_paper_uiview_get_tint_color(_ p: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3449
+ MainActor.assumeIsolated { retained(unretained(p, as: UIView.self).tintColor) }
3450
+ }
3451
+ @_cdecl("peach_paper_uiview_set_tint_color")
3452
+ public func peach_paper_uiview_set_tint_color(_ p: UnsafeMutableRawPointer, _ c: UnsafeMutableRawPointer?) {
3453
+ MainActor.assumeIsolated { unretained(p, as: UIView.self).tintColor = c.map { unretained($0, as: UIColor.self) } }
3454
+ }
3455
+ @_cdecl("peach_paper_uiview_get_window")
3456
+ public func peach_paper_uiview_get_window(_ p: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3457
+ MainActor.assumeIsolated { retained(unretained(p, as: UIView.self).window) }
3458
+ }
3459
+ @_cdecl("peach_paper_uiview_get_next")
3460
+ public func peach_paper_uiview_get_next(_ p: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3461
+ MainActor.assumeIsolated { retained(unretained(p, as: UIView.self).next) }
3462
+ }
3463
+ @_cdecl("peach_paper_uiview_get_superview")
3464
+ public func peach_paper_uiview_get_superview(_ p: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3465
+ MainActor.assumeIsolated { retained(unretained(p, as: UIView.self).superview) }
3466
+ }
3467
+ @_cdecl("peach_paper_uiview_get_subviews")
3468
+ public func peach_paper_uiview_get_subviews(_ p: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3469
+ MainActor.assumeIsolated { retained(unretained(p, as: UIView.self).subviews as NSArray) }
3470
+ }
3471
+ @_cdecl("peach_paper_uiview_get_tag")
3472
+ public func peach_paper_uiview_get_tag(_ p: UnsafeMutableRawPointer) -> Int32 {
3473
+ MainActor.assumeIsolated { Int32(unretained(p, as: UIView.self).tag) }
3474
+ }
3475
+ @_cdecl("peach_paper_uiview_set_tag")
3476
+ public func peach_paper_uiview_set_tag(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3477
+ MainActor.assumeIsolated { unretained(p, as: UIView.self).tag = Int(v) }
3478
+ }
3479
+ @_cdecl("peach_paper_uiview_get_autoresizes_subviews")
3480
+ public func peach_paper_uiview_get_autoresizes_subviews(_ p: UnsafeMutableRawPointer) -> Int32 {
3481
+ MainActor.assumeIsolated { unretained(p, as: UIView.self).autoresizesSubviews ? 1 : 0 }
3482
+ }
3483
+ @_cdecl("peach_paper_uiview_set_autoresizes_subviews")
3484
+ public func peach_paper_uiview_set_autoresizes_subviews(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3485
+ MainActor.assumeIsolated { unretained(p, as: UIView.self).autoresizesSubviews = v != 0 }
3486
+ }
3487
+ @_cdecl("peach_paper_uiview_get_translates_autoresizing")
3488
+ public func peach_paper_uiview_get_translates_autoresizing(_ p: UnsafeMutableRawPointer) -> Int32 {
3489
+ MainActor.assumeIsolated { unretained(p, as: UIView.self).translatesAutoresizingMaskIntoConstraints ? 1 : 0 }
3490
+ }
3491
+ @_cdecl("peach_paper_uiview_set_translates_autoresizing")
3492
+ public func peach_paper_uiview_set_translates_autoresizing(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3493
+ MainActor.assumeIsolated { unretained(p, as: UIView.self).translatesAutoresizingMaskIntoConstraints = v != 0 }
3494
+ }
3495
+
3496
+ @_cdecl("peach_paper_uibaritem_appearance")
3497
+ public func peach_paper_uibaritem_appearance(_ clsNamePtr: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3498
+ MainActor.assumeIsolated {
3499
+ let name = unretained(clsNamePtr, as: NSString.self) as String
3500
+ guard let cls = NSClassFromString(name) as? UIBarItem.Type else { return nil }
3501
+ return retained(cls.appearance())
3502
+ }
3503
+ }
3504
+ @_cdecl("peach_paper_uibaritem_get_title")
3505
+ public func peach_paper_uibaritem_get_title(_ p: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3506
+ MainActor.assumeIsolated { retained(unretained(p, as: UIBarItem.self).title as NSString?) }
3507
+ }
3508
+ @_cdecl("peach_paper_uibaritem_set_title")
3509
+ public func peach_paper_uibaritem_set_title(_ p: UnsafeMutableRawPointer, _ v: UnsafeMutableRawPointer?) {
3510
+ MainActor.assumeIsolated { unretained(p, as: UIBarItem.self).title = v.map { unretained($0, as: NSString.self) as String } }
3511
+ }
3512
+ @_cdecl("peach_paper_uibaritem_get_enabled")
3513
+ public func peach_paper_uibaritem_get_enabled(_ p: UnsafeMutableRawPointer) -> Int32 {
3514
+ MainActor.assumeIsolated { unretained(p, as: UIBarItem.self).isEnabled ? 1 : 0 }
3515
+ }
3516
+ @_cdecl("peach_paper_uibaritem_set_enabled")
3517
+ public func peach_paper_uibaritem_set_enabled(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3518
+ MainActor.assumeIsolated { unretained(p, as: UIBarItem.self).isEnabled = v != 0 }
3519
+ }
3520
+
3521
+ @_cdecl("peach_paper_uitextfield_get_text")
3522
+ public func peach_paper_uitextfield_get_text(_ p: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3523
+ MainActor.assumeIsolated { retained(unretained(p, as: UITextField.self).text as NSString?) }
3524
+ }
3525
+ @_cdecl("peach_paper_uitextfield_set_text")
3526
+ public func peach_paper_uitextfield_set_text(_ p: UnsafeMutableRawPointer, _ v: UnsafeMutableRawPointer?) {
3527
+ MainActor.assumeIsolated { unretained(p, as: UITextField.self).text = v.map { unretained($0, as: NSString.self) as String } }
3528
+ }
3529
+ @_cdecl("peach_paper_uitextfield_get_placeholder")
3530
+ public func peach_paper_uitextfield_get_placeholder(_ p: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3531
+ MainActor.assumeIsolated { retained(unretained(p, as: UITextField.self).placeholder as NSString?) }
3532
+ }
3533
+ @_cdecl("peach_paper_uitextfield_set_placeholder")
3534
+ public func peach_paper_uitextfield_set_placeholder(_ p: UnsafeMutableRawPointer, _ v: UnsafeMutableRawPointer?) {
3535
+ MainActor.assumeIsolated { unretained(p, as: UITextField.self).placeholder = v.map { unretained($0, as: NSString.self) as String } }
3536
+ }
3537
+ @_cdecl("peach_paper_uitextfield_get_text_color")
3538
+ public func peach_paper_uitextfield_get_text_color(_ p: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3539
+ MainActor.assumeIsolated { retained(unretained(p, as: UITextField.self).textColor) }
3540
+ }
3541
+ @_cdecl("peach_paper_uitextfield_set_text_color")
3542
+ public func peach_paper_uitextfield_set_text_color(_ p: UnsafeMutableRawPointer, _ v: UnsafeMutableRawPointer?) {
3543
+ MainActor.assumeIsolated { unretained(p, as: UITextField.self).textColor = v.map { unretained($0, as: UIColor.self) } }
3544
+ }
3545
+ @_cdecl("peach_paper_uitextfield_set_default_text_attributes")
3546
+ public func peach_paper_uitextfield_set_default_text_attributes(_ p: UnsafeMutableRawPointer, _ d: UnsafeMutableRawPointer?) {
3547
+ MainActor.assumeIsolated {
3548
+ guard let d else { return }
3549
+ let tf = unretained(p, as: UITextField.self)
3550
+ let dict = unretained(d, as: NSDictionary.self)
3551
+ if let color = (dict[NSAttributedString.Key.foregroundColor.rawValue] ?? dict["NSColor"]) as? UIColor {
3552
+ tf.textColor = color
3553
+ }
3554
+ if let font = (dict[NSAttributedString.Key.font.rawValue] ?? dict["NSFont"]) as? UIFont {
3555
+ tf.font = font
3556
+ }
3557
+ }
3558
+ }
3559
+
3560
+ @_cdecl("peach_paper_uisearchbar_get_placeholder")
3561
+ public func peach_paper_uisearchbar_get_placeholder(_ p: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3562
+ MainActor.assumeIsolated { retained(unretained(p, as: UISearchBar.self).placeholder as NSString?) }
3563
+ }
3564
+ @_cdecl("peach_paper_uisearchbar_set_placeholder")
3565
+ public func peach_paper_uisearchbar_set_placeholder(_ p: UnsafeMutableRawPointer, _ v: UnsafeMutableRawPointer?) {
3566
+ MainActor.assumeIsolated { unretained(p, as: UISearchBar.self).placeholder = v.map { unretained($0, as: NSString.self) as String } }
3567
+ }
3568
+ @_cdecl("peach_paper_uisearchbar_get_text")
3569
+ public func peach_paper_uisearchbar_get_text(_ p: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3570
+ MainActor.assumeIsolated { retained(unretained(p, as: UISearchBar.self).text as NSString?) }
3571
+ }
3572
+ @_cdecl("peach_paper_uisearchbar_set_text")
3573
+ public func peach_paper_uisearchbar_set_text(_ p: UnsafeMutableRawPointer, _ v: UnsafeMutableRawPointer?) {
3574
+ MainActor.assumeIsolated { unretained(p, as: UISearchBar.self).text = v.map { unretained($0, as: NSString.self) as String } }
3575
+ }
3576
+ @_cdecl("peach_paper_uisearchbar_get_prompt")
3577
+ public func peach_paper_uisearchbar_get_prompt(_ p: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3578
+ MainActor.assumeIsolated { retained(unretained(p, as: UISearchBar.self).prompt as NSString?) }
3579
+ }
3580
+ @_cdecl("peach_paper_uisearchbar_set_prompt")
3581
+ public func peach_paper_uisearchbar_set_prompt(_ p: UnsafeMutableRawPointer, _ v: UnsafeMutableRawPointer?) {
3582
+ MainActor.assumeIsolated { unretained(p, as: UISearchBar.self).prompt = v.map { unretained($0, as: NSString.self) as String } }
3583
+ }
3584
+ @_cdecl("peach_paper_uisearchbar_get_bar_tint_color")
3585
+ public func peach_paper_uisearchbar_get_bar_tint_color(_ p: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3586
+ MainActor.assumeIsolated { retained(unretained(p, as: UISearchBar.self).barTintColor) }
3587
+ }
3588
+ @_cdecl("peach_paper_uisearchbar_set_bar_tint_color")
3589
+ public func peach_paper_uisearchbar_set_bar_tint_color(_ p: UnsafeMutableRawPointer, _ v: UnsafeMutableRawPointer?) {
3590
+ MainActor.assumeIsolated {
3591
+ unretained(p, as: UISearchBar.self).barTintColor = v.map { unretained($0, as: UIColor.self) }
3592
+ }
3593
+ }
3594
+ @_cdecl("peach_paper_uisearchbar_get_bar_style")
3595
+ public func peach_paper_uisearchbar_get_bar_style(_ p: UnsafeMutableRawPointer) -> Int32 {
3596
+ MainActor.assumeIsolated { Int32(unretained(p, as: UISearchBar.self).barStyle.rawValue) }
3597
+ }
3598
+ @_cdecl("peach_paper_uisearchbar_set_bar_style")
3599
+ public func peach_paper_uisearchbar_set_bar_style(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3600
+ MainActor.assumeIsolated { unretained(p, as: UISearchBar.self).barStyle = UIBarStyle(rawValue: Int(v)) ?? .default }
3601
+ }
3602
+ @_cdecl("peach_paper_uisearchbar_get_search_bar_style")
3603
+ public func peach_paper_uisearchbar_get_search_bar_style(_ p: UnsafeMutableRawPointer) -> Int32 {
3604
+ MainActor.assumeIsolated { Int32(unretained(p, as: UISearchBar.self).searchBarStyle.rawValue) }
3605
+ }
3606
+ @_cdecl("peach_paper_uisearchbar_set_search_bar_style")
3607
+ public func peach_paper_uisearchbar_set_search_bar_style(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3608
+ MainActor.assumeIsolated {
3609
+ let raw = v >= 0 ? UInt(v) : 0
3610
+ unretained(p, as: UISearchBar.self).searchBarStyle = UISearchBar.Style(rawValue: raw) ?? .default
3611
+ }
3612
+ }
3613
+ @_cdecl("peach_paper_uisearchbar_get_translucent")
3614
+ public func peach_paper_uisearchbar_get_translucent(_ p: UnsafeMutableRawPointer) -> Int32 {
3615
+ MainActor.assumeIsolated { unretained(p, as: UISearchBar.self).isTranslucent ? 1 : 0 }
3616
+ }
3617
+ @_cdecl("peach_paper_uisearchbar_set_translucent")
3618
+ public func peach_paper_uisearchbar_set_translucent(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3619
+ MainActor.assumeIsolated { unretained(p, as: UISearchBar.self).isTranslucent = v != 0 }
3620
+ }
3621
+ @_cdecl("peach_paper_uisearchbar_get_shows_cancel")
3622
+ public func peach_paper_uisearchbar_get_shows_cancel(_ p: UnsafeMutableRawPointer) -> Int32 {
3623
+ MainActor.assumeIsolated { unretained(p, as: UISearchBar.self).showsCancelButton ? 1 : 0 }
3624
+ }
3625
+ @_cdecl("peach_paper_uisearchbar_set_shows_cancel")
3626
+ public func peach_paper_uisearchbar_set_shows_cancel(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3627
+ MainActor.assumeIsolated {
3628
+ let bar = unretained(p, as: UISearchBar.self)
3629
+ bar.showsCancelButton = v != 0
3630
+ bar.setNeedsLayout()
3631
+ }
3632
+ }
3633
+ @_cdecl("peach_paper_uisearchbar_set_shows_cancel_animated")
3634
+ public func peach_paper_uisearchbar_set_shows_cancel_animated(_ p: UnsafeMutableRawPointer, _ v: Int32, _ anim: Int32) {
3635
+ MainActor.assumeIsolated {
3636
+ let bar = unretained(p, as: UISearchBar.self)
3637
+ bar.setShowsCancelButton(v != 0, animated: anim != 0)
3638
+ bar.setNeedsLayout()
3639
+ }
3640
+ }
3641
+ @_cdecl("peach_paper_uisearchbar_get_shows_bookmark")
3642
+ public func peach_paper_uisearchbar_get_shows_bookmark(_ p: UnsafeMutableRawPointer) -> Int32 {
3643
+ MainActor.assumeIsolated { unretained(p, as: UISearchBar.self).showsBookmarkButton ? 1 : 0 }
3644
+ }
3645
+ @_cdecl("peach_paper_uisearchbar_set_shows_bookmark")
3646
+ public func peach_paper_uisearchbar_set_shows_bookmark(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3647
+ MainActor.assumeIsolated { unretained(p, as: UISearchBar.self).showsBookmarkButton = v != 0 }
3648
+ }
3649
+ @_cdecl("peach_paper_uisearchbar_get_shows_results")
3650
+ public func peach_paper_uisearchbar_get_shows_results(_ p: UnsafeMutableRawPointer) -> Int32 {
3651
+ MainActor.assumeIsolated { unretained(p, as: UISearchBar.self).showsSearchResultsButton ? 1 : 0 }
3652
+ }
3653
+ @_cdecl("peach_paper_uisearchbar_set_shows_results")
3654
+ public func peach_paper_uisearchbar_set_shows_results(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3655
+ MainActor.assumeIsolated { unretained(p, as: UISearchBar.self).showsSearchResultsButton = v != 0 }
3656
+ }
3657
+ @_cdecl("peach_paper_uisearchbar_get_background_image")
3658
+ public func peach_paper_uisearchbar_get_background_image(_ p: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3659
+ MainActor.assumeIsolated { retained(unretained(p, as: UISearchBar.self).backgroundImage) }
3660
+ }
3661
+ @_cdecl("peach_paper_uisearchbar_set_background_image")
3662
+ public func peach_paper_uisearchbar_set_background_image(_ p: UnsafeMutableRawPointer, _ v: UnsafeMutableRawPointer?) {
3663
+ MainActor.assumeIsolated { unretained(p, as: UISearchBar.self).backgroundImage = v.map { unretained($0, as: UIImage.self) } }
3664
+ }
3665
+ @_cdecl("peach_paper_uisearchbar_set_search_field_bg_image")
3666
+ public func peach_paper_uisearchbar_set_search_field_bg_image(_ p: UnsafeMutableRawPointer, _ img: UnsafeMutableRawPointer?, _ _: Int32) {
3667
+ MainActor.assumeIsolated {
3668
+ unretained(p, as: UISearchBar.self).searchTextField.background = img.map { unretained($0, as: UIImage.self) }
3669
+ }
3670
+ }
3671
+ @_cdecl("peach_paper_uisearchbar_set_text_adjustment")
3672
+ public func peach_paper_uisearchbar_set_text_adjustment(_ p: UnsafeMutableRawPointer, _ h: Double, _ v: Double) {
3673
+ MainActor.assumeIsolated {
3674
+ unretained(p, as: UISearchBar.self).searchTextPositionAdjustment = UIOffset(horizontal: CGFloat(h), vertical: CGFloat(v))
3675
+ }
3676
+ }
3677
+ @_cdecl("peach_paper_uisearchbar_get_delegate")
3678
+ public func peach_paper_uisearchbar_get_delegate(_ p: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3679
+ MainActor.assumeIsolated { retained(unretained(p, as: UISearchBar.self).delegate as AnyObject?) }
3680
+ }
3681
+ @_cdecl("peach_paper_uisearchbar_set_delegate")
3682
+ public func peach_paper_uisearchbar_set_delegate(_ p: UnsafeMutableRawPointer, _ d: UnsafeMutableRawPointer?) {
3683
+ MainActor.assumeIsolated {
3684
+ let bar = unretained(p, as: UISearchBar.self)
3685
+ bar.delegate = d.flatMap { unretained($0, as: AnyObject.self) as? any UISearchBarDelegate }
3686
+ }
3687
+ }
3688
+ @_cdecl("peach_paper_uisearchbar_get_search_text_field")
3689
+ public func peach_paper_uisearchbar_get_search_text_field(_ p: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3690
+ MainActor.assumeIsolated {
3691
+ let bar = unretained(p, as: UISearchBar.self)
3692
+ return retained(bar.searchTextField)
3693
+ }
3694
+ }
3695
+ @_cdecl("peach_paper_uisearchbar_get_autocapitalization")
3696
+ public func peach_paper_uisearchbar_get_autocapitalization(_ p: UnsafeMutableRawPointer) -> Int32 {
3697
+ MainActor.assumeIsolated { Int32(unretained(p, as: UISearchBar.self).autocapitalizationType.rawValue) }
3698
+ }
3699
+ @_cdecl("peach_paper_uisearchbar_set_autocapitalization")
3700
+ public func peach_paper_uisearchbar_set_autocapitalization(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3701
+ MainActor.assumeIsolated { unretained(p, as: UISearchBar.self).autocapitalizationType = UITextAutocapitalizationType(rawValue: Int(v)) ?? .sentences }
3702
+ }
3703
+ @_cdecl("peach_paper_uisearchbar_get_autocorrection")
3704
+ public func peach_paper_uisearchbar_get_autocorrection(_ p: UnsafeMutableRawPointer) -> Int32 {
3705
+ MainActor.assumeIsolated { Int32(unretained(p, as: UISearchBar.self).autocorrectionType.rawValue) }
3706
+ }
3707
+ @_cdecl("peach_paper_uisearchbar_set_autocorrection")
3708
+ public func peach_paper_uisearchbar_set_autocorrection(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3709
+ MainActor.assumeIsolated { unretained(p, as: UISearchBar.self).autocorrectionType = UITextAutocorrectionType(rawValue: Int(v)) ?? .default }
3710
+ }
3711
+ @_cdecl("peach_paper_uisearchbar_get_spell_checking")
3712
+ public func peach_paper_uisearchbar_get_spell_checking(_ p: UnsafeMutableRawPointer) -> Int32 {
3713
+ MainActor.assumeIsolated { Int32(unretained(p, as: UISearchBar.self).spellCheckingType.rawValue) }
3714
+ }
3715
+ @_cdecl("peach_paper_uisearchbar_set_spell_checking")
3716
+ public func peach_paper_uisearchbar_set_spell_checking(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3717
+ MainActor.assumeIsolated { unretained(p, as: UISearchBar.self).spellCheckingType = UITextSpellCheckingType(rawValue: Int(v)) ?? .default }
3718
+ }
3719
+ @_cdecl("peach_paper_uisearchbar_get_enables_return")
3720
+ public func peach_paper_uisearchbar_get_enables_return(_ p: UnsafeMutableRawPointer) -> Int32 {
3721
+ MainActor.assumeIsolated { unretained(p, as: UISearchBar.self).enablesReturnKeyAutomatically ? 1 : 0 }
3722
+ }
3723
+ @_cdecl("peach_paper_uisearchbar_set_enables_return")
3724
+ public func peach_paper_uisearchbar_set_enables_return(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3725
+ MainActor.assumeIsolated { unretained(p, as: UISearchBar.self).enablesReturnKeyAutomatically = v != 0 }
3726
+ }
3727
+ @_cdecl("peach_paper_uisearchbar_get_return_key")
3728
+ public func peach_paper_uisearchbar_get_return_key(_ p: UnsafeMutableRawPointer) -> Int32 {
3729
+ MainActor.assumeIsolated { Int32(unretained(p, as: UISearchBar.self).returnKeyType.rawValue) }
3730
+ }
3731
+ @_cdecl("peach_paper_uisearchbar_set_return_key")
3732
+ public func peach_paper_uisearchbar_set_return_key(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3733
+ MainActor.assumeIsolated { unretained(p, as: UISearchBar.self).returnKeyType = UIReturnKeyType(rawValue: Int(v)) ?? .default }
3734
+ }
3735
+ @_cdecl("peach_paper_uisearchbar_get_keyboard_type")
3736
+ public func peach_paper_uisearchbar_get_keyboard_type(_ p: UnsafeMutableRawPointer) -> Int32 {
3737
+ MainActor.assumeIsolated { Int32(unretained(p, as: UISearchBar.self).keyboardType.rawValue) }
3738
+ }
3739
+ @_cdecl("peach_paper_uisearchbar_set_keyboard_type")
3740
+ public func peach_paper_uisearchbar_set_keyboard_type(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3741
+ MainActor.assumeIsolated { unretained(p, as: UISearchBar.self).keyboardType = UIKeyboardType(rawValue: Int(v)) ?? .default }
3742
+ }
3743
+ @_cdecl("peach_paper_uisearchbar_get_keyboard_appearance")
3744
+ public func peach_paper_uisearchbar_get_keyboard_appearance(_ p: UnsafeMutableRawPointer) -> Int32 {
3745
+ MainActor.assumeIsolated { Int32(unretained(p, as: UISearchBar.self).keyboardAppearance.rawValue) }
3746
+ }
3747
+ @_cdecl("peach_paper_uisearchbar_set_keyboard_appearance")
3748
+ public func peach_paper_uisearchbar_set_keyboard_appearance(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3749
+ MainActor.assumeIsolated { unretained(p, as: UISearchBar.self).keyboardAppearance = UIKeyboardAppearance(rawValue: Int(v)) ?? .default }
3750
+ }
3751
+ @_cdecl("peach_paper_uiscrollview_get_delegate")
3752
+ public func peach_paper_uiscrollview_get_delegate(_ p: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3753
+ MainActor.assumeIsolated { retained(unretained(p, as: UIScrollView.self).delegate as AnyObject?) }
3754
+ }
3755
+ @_cdecl("peach_paper_uiscrollview_set_delegate")
3756
+ public func peach_paper_uiscrollview_set_delegate(_ p: UnsafeMutableRawPointer, _ d: UnsafeMutableRawPointer?) {
3757
+ MainActor.assumeIsolated {
3758
+ unretained(p, as: UIScrollView.self).delegate = d.flatMap { unretained($0, as: AnyObject.self) as? any UIScrollViewDelegate }
3759
+ }
3760
+ }
3761
+ @_cdecl("peach_paper_uiscrollview_get_shows_h")
3762
+ public func peach_paper_uiscrollview_get_shows_h(_ p: UnsafeMutableRawPointer) -> Int32 {
3763
+ MainActor.assumeIsolated { unretained(p, as: UIScrollView.self).showsHorizontalScrollIndicator ? 1 : 0 }
3764
+ }
3765
+ @_cdecl("peach_paper_uiscrollview_set_shows_h")
3766
+ public func peach_paper_uiscrollview_set_shows_h(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3767
+ MainActor.assumeIsolated { unretained(p, as: UIScrollView.self).showsHorizontalScrollIndicator = v != 0 }
3768
+ }
3769
+ @_cdecl("peach_paper_uiscrollview_get_shows_v")
3770
+ public func peach_paper_uiscrollview_get_shows_v(_ p: UnsafeMutableRawPointer) -> Int32 {
3771
+ MainActor.assumeIsolated { unretained(p, as: UIScrollView.self).showsVerticalScrollIndicator ? 1 : 0 }
3772
+ }
3773
+ @_cdecl("peach_paper_uiscrollview_set_shows_v")
3774
+ public func peach_paper_uiscrollview_set_shows_v(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3775
+ MainActor.assumeIsolated { unretained(p, as: UIScrollView.self).showsVerticalScrollIndicator = v != 0 }
3776
+ }
3777
+ @_cdecl("peach_paper_uiscrollview_get_min_zoom")
3778
+ public func peach_paper_uiscrollview_get_min_zoom(_ p: UnsafeMutableRawPointer) -> Double {
3779
+ MainActor.assumeIsolated { Double(unretained(p, as: UIScrollView.self).minimumZoomScale) }
3780
+ }
3781
+ @_cdecl("peach_paper_uiscrollview_set_min_zoom")
3782
+ public func peach_paper_uiscrollview_set_min_zoom(_ p: UnsafeMutableRawPointer, _ v: Double) {
3783
+ MainActor.assumeIsolated { unretained(p, as: UIScrollView.self).minimumZoomScale = CGFloat(v) }
3784
+ }
3785
+ @_cdecl("peach_paper_uiscrollview_get_max_zoom")
3786
+ public func peach_paper_uiscrollview_get_max_zoom(_ p: UnsafeMutableRawPointer) -> Double {
3787
+ MainActor.assumeIsolated { Double(unretained(p, as: UIScrollView.self).maximumZoomScale) }
3788
+ }
3789
+ @_cdecl("peach_paper_uiscrollview_set_max_zoom")
3790
+ public func peach_paper_uiscrollview_set_max_zoom(_ p: UnsafeMutableRawPointer, _ v: Double) {
3791
+ MainActor.assumeIsolated { unretained(p, as: UIScrollView.self).maximumZoomScale = CGFloat(v) }
3792
+ }
3793
+ @_cdecl("peach_paper_uiscrollview_get_bounces")
3794
+ public func peach_paper_uiscrollview_get_bounces(_ p: UnsafeMutableRawPointer) -> Int32 {
3795
+ MainActor.assumeIsolated { unretained(p, as: UIScrollView.self).bounces ? 1 : 0 }
3796
+ }
3797
+ @_cdecl("peach_paper_uiscrollview_set_bounces")
3798
+ public func peach_paper_uiscrollview_set_bounces(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3799
+ MainActor.assumeIsolated { unretained(p, as: UIScrollView.self).bounces = v != 0 }
3800
+ }
3801
+ @_cdecl("peach_paper_uiscrollview_get_bounces_zoom")
3802
+ public func peach_paper_uiscrollview_get_bounces_zoom(_ p: UnsafeMutableRawPointer) -> Int32 {
3803
+ MainActor.assumeIsolated { unretained(p, as: UIScrollView.self).bouncesZoom ? 1 : 0 }
3804
+ }
3805
+ @_cdecl("peach_paper_uiscrollview_set_bounces_zoom")
3806
+ public func peach_paper_uiscrollview_set_bounces_zoom(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3807
+ MainActor.assumeIsolated { unretained(p, as: UIScrollView.self).bouncesZoom = v != 0 }
3808
+ }
3809
+ @_cdecl("peach_paper_uiscrollview_get_deceleration_rate")
3810
+ public func peach_paper_uiscrollview_get_deceleration_rate(_ p: UnsafeMutableRawPointer) -> Double {
3811
+ MainActor.assumeIsolated { Double(unretained(p, as: UIScrollView.self).decelerationRate.rawValue) }
3812
+ }
3813
+ @_cdecl("peach_paper_uiscrollview_set_deceleration_rate")
3814
+ public func peach_paper_uiscrollview_set_deceleration_rate(_ p: UnsafeMutableRawPointer, _ v: Double) {
3815
+ MainActor.assumeIsolated { unretained(p, as: UIScrollView.self).decelerationRate = UIScrollView.DecelerationRate(rawValue: CGFloat(v)) }
3816
+ }
3817
+
3818
+ @_cdecl("peach_paper_uiimageview_get_highlighted_image")
3819
+ public func peach_paper_uiimageview_get_highlighted_image(_ p: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3820
+ MainActor.assumeIsolated { retained(unretained(p, as: UIImageView.self).highlightedImage) }
3821
+ }
3822
+ @_cdecl("peach_paper_uiimageview_set_highlighted_image")
3823
+ public func peach_paper_uiimageview_set_highlighted_image(_ p: UnsafeMutableRawPointer, _ v: UnsafeMutableRawPointer?) {
3824
+ MainActor.assumeIsolated { unretained(p, as: UIImageView.self).highlightedImage = v.map { unretained($0, as: UIImage.self) } }
3825
+ }
3826
+ @_cdecl("peach_paper_uiimageview_get_is_highlighted")
3827
+ public func peach_paper_uiimageview_get_is_highlighted(_ p: UnsafeMutableRawPointer) -> Int32 {
3828
+ MainActor.assumeIsolated { unretained(p, as: UIImageView.self).isHighlighted ? 1 : 0 }
3829
+ }
3830
+ @_cdecl("peach_paper_uiimageview_set_is_highlighted")
3831
+ public func peach_paper_uiimageview_set_is_highlighted(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3832
+ MainActor.assumeIsolated { unretained(p, as: UIImageView.self).isHighlighted = v != 0 }
3833
+ }
3834
+
3835
+ @_cdecl("peach_paper_uiactivity_get_style")
3836
+ public func peach_paper_uiactivity_get_style(_ p: UnsafeMutableRawPointer) -> Int32 {
3837
+ MainActor.assumeIsolated { Int32(unretained(p, as: UIActivityIndicatorView.self).style.rawValue) }
3838
+ }
3839
+ @_cdecl("peach_paper_uiactivity_set_style")
3840
+ public func peach_paper_uiactivity_set_style(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3841
+ MainActor.assumeIsolated { unretained(p, as: UIActivityIndicatorView.self).style = UIActivityIndicatorView.Style(rawValue: Int(v)) ?? .medium }
3842
+ }
3843
+ @_cdecl("peach_paper_uiactivity_get_color")
3844
+ public func peach_paper_uiactivity_get_color(_ p: UnsafeMutableRawPointer) -> UnsafeMutableRawPointer? {
3845
+ MainActor.assumeIsolated { retained(unretained(p, as: UIActivityIndicatorView.self).color) }
3846
+ }
3847
+ @_cdecl("peach_paper_uiactivity_set_color")
3848
+ public func peach_paper_uiactivity_set_color(_ p: UnsafeMutableRawPointer, _ v: UnsafeMutableRawPointer?) {
3849
+ MainActor.assumeIsolated { unretained(p, as: UIActivityIndicatorView.self).color = v.map { unretained($0, as: UIColor.self) } }
3850
+ }
3851
+ @_cdecl("peach_paper_uiactivity_get_hides")
3852
+ public func peach_paper_uiactivity_get_hides(_ p: UnsafeMutableRawPointer) -> Int32 {
3853
+ MainActor.assumeIsolated { unretained(p, as: UIActivityIndicatorView.self).hidesWhenStopped ? 1 : 0 }
3854
+ }
3855
+ @_cdecl("peach_paper_uiactivity_set_hides")
3856
+ public func peach_paper_uiactivity_set_hides(_ p: UnsafeMutableRawPointer, _ v: Int32) {
3857
+ MainActor.assumeIsolated { unretained(p, as: UIActivityIndicatorView.self).hidesWhenStopped = v != 0 }
3858
+ }
3859
+ @_cdecl("peach_paper_uiactivity_is_animating")
3860
+ public func peach_paper_uiactivity_is_animating(_ p: UnsafeMutableRawPointer) -> Int32 {
3861
+ MainActor.assumeIsolated { unretained(p, as: UIActivityIndicatorView.self).isAnimating ? 1 : 0 }
3862
+ }
3863
+ @_cdecl("peach_paper_uiactivity_start")
3864
+ public func peach_paper_uiactivity_start(_ p: UnsafeMutableRawPointer) {
3865
+ MainActor.assumeIsolated { unretained(p, as: UIActivityIndicatorView.self).startAnimating() }
3866
+ }
3867
+ @_cdecl("peach_paper_uiactivity_stop")
3868
+ public func peach_paper_uiactivity_stop(_ p: UnsafeMutableRawPointer) {
3869
+ MainActor.assumeIsolated { unretained(p, as: UIActivityIndicatorView.self).stopAnimating() }
3870
+ }
3871
+ `
3872
+
3086
3873
  // the app's codegen components mounted as React Native's RCTMountingManager
3087
3874
  // mounts them (RCTPerformMountInstructions): the component view factory with
3088
3875
  // the app's third-party components, one registry dequeuing and recycling
@@ -3092,15 +3879,21 @@ using namespace facebook;
3092
3879
  // the engine as UIManagerBinding::dispatchEventToJS calls React, and its state
3093
3880
  // updates reach the view as UIManager::updateState's commit would. the engine
3094
3881
  // lays the view out and paints its style; the view is the content of a root of
3095
- // this process.
3096
- function fabricHostSource(views: readonly FabricComponent[]): string {
3882
+ // this process. a provider's RCTViewManager registers no component class: the
3883
+ // factory falls back to RCTLegacyViewManagerInteropComponentView for it, and
3884
+ // its view config is the one RCTLegacyUIManagerConstantsProvider gives JS.
3885
+ function fabricHostSource(
3886
+ views: readonly FabricComponent[],
3887
+ paperClasses: readonly string[],
3888
+ ): string {
3097
3889
  const entries = views
3098
3890
  .map(
3099
3891
  ({ name, className }) =>
3100
3892
  `@${JSON.stringify(name)}: NSClassFromString(@${JSON.stringify(className)})`,
3101
3893
  )
3102
3894
  .join(', ')
3103
- return `${FABRIC_HOST_INCLUDES}
3895
+ const paper = paperClasses.length > 0
3896
+ return `${FABRIC_HOST_INCLUDES}${paper ? FABRIC_HOST_PAPER_INCLUDES : ''}
3104
3897
  @interface PeachFabricComponents : NSObject <RCTComponentViewFactoryComponentProvider>
3105
3898
  @end
3106
3899
 
@@ -3111,6 +3904,485 @@ function fabricHostSource(views: readonly FabricComponent[]): string {
3111
3904
  }
3112
3905
  @end
3113
3906
 
3907
+ ${
3908
+ paper
3909
+ ? `extern "C" {
3910
+ void peach_paper_ensure_app_delegate(void);
3911
+ void *peach_paper_uiimage_with_data(void *dataPtr);
3912
+ void peach_paper_uiimage_get_size(void *imgPtr, double *wOut, double *hOut);
3913
+ double peach_paper_uiimage_get_scale(void *imgPtr);
3914
+ void *peach_paper_uiview_appearance(void *clsNamePtr);
3915
+ void *peach_paper_uiview_get_tint_color(void *p);
3916
+ void peach_paper_uiview_set_tint_color(void *p, void *c);
3917
+ void *peach_paper_uiview_get_window(void *p);
3918
+ void *peach_paper_uiview_get_next(void *p);
3919
+ void *peach_paper_uiview_get_superview(void *p);
3920
+ void *peach_paper_uiview_get_subviews(void *p);
3921
+ int32_t peach_paper_uiview_get_tag(void *p);
3922
+ void peach_paper_uiview_set_tag(void *p, int32_t v);
3923
+ int32_t peach_paper_uiview_get_autoresizes_subviews(void *p);
3924
+ void peach_paper_uiview_set_autoresizes_subviews(void *p, int32_t v);
3925
+ int32_t peach_paper_uiview_get_translates_autoresizing(void *p);
3926
+ void peach_paper_uiview_set_translates_autoresizing(void *p, int32_t v);
3927
+ void *peach_paper_uibaritem_appearance(void *clsNamePtr);
3928
+ void *peach_paper_uibaritem_get_title(void *p);
3929
+ void peach_paper_uibaritem_set_title(void *p, void *v);
3930
+ int32_t peach_paper_uibaritem_get_enabled(void *p);
3931
+ void peach_paper_uibaritem_set_enabled(void *p, int32_t v);
3932
+ void *peach_paper_uitextfield_get_text(void *p);
3933
+ void peach_paper_uitextfield_set_text(void *p, void *v);
3934
+ void *peach_paper_uitextfield_get_placeholder(void *p);
3935
+ void peach_paper_uitextfield_set_placeholder(void *p, void *v);
3936
+ void *peach_paper_uitextfield_get_text_color(void *p);
3937
+ void peach_paper_uitextfield_set_text_color(void *p, void *v);
3938
+ void peach_paper_uitextfield_set_default_text_attributes(void *p, void *d);
3939
+ void *peach_paper_uisearchbar_get_placeholder(void *p);
3940
+ void peach_paper_uisearchbar_set_placeholder(void *p, void *v);
3941
+ void *peach_paper_uisearchbar_get_text(void *p);
3942
+ void peach_paper_uisearchbar_set_text(void *p, void *v);
3943
+ void *peach_paper_uisearchbar_get_prompt(void *p);
3944
+ void peach_paper_uisearchbar_set_prompt(void *p, void *v);
3945
+ void *peach_paper_uisearchbar_get_bar_tint_color(void *p);
3946
+ void peach_paper_uisearchbar_set_bar_tint_color(void *p, void *v);
3947
+ int32_t peach_paper_uisearchbar_get_bar_style(void *p);
3948
+ void peach_paper_uisearchbar_set_bar_style(void *p, int32_t v);
3949
+ int32_t peach_paper_uisearchbar_get_search_bar_style(void *p);
3950
+ void peach_paper_uisearchbar_set_search_bar_style(void *p, int32_t v);
3951
+ int32_t peach_paper_uisearchbar_get_translucent(void *p);
3952
+ void peach_paper_uisearchbar_set_translucent(void *p, int32_t v);
3953
+ int32_t peach_paper_uisearchbar_get_shows_cancel(void *p);
3954
+ void peach_paper_uisearchbar_set_shows_cancel(void *p, int32_t v);
3955
+ void peach_paper_uisearchbar_set_shows_cancel_animated(void *p, int32_t v, int32_t anim);
3956
+ int32_t peach_paper_uisearchbar_get_shows_bookmark(void *p);
3957
+ void peach_paper_uisearchbar_set_shows_bookmark(void *p, int32_t v);
3958
+ int32_t peach_paper_uisearchbar_get_shows_results(void *p);
3959
+ void peach_paper_uisearchbar_set_shows_results(void *p, int32_t v);
3960
+ void *peach_paper_uisearchbar_get_background_image(void *p);
3961
+ void peach_paper_uisearchbar_set_background_image(void *p, void *v);
3962
+ void peach_paper_uisearchbar_set_search_field_bg_image(void *p, void *img, int32_t state);
3963
+ void peach_paper_uisearchbar_set_text_adjustment(void *p, double h, double v);
3964
+ void *peach_paper_uisearchbar_get_delegate(void *p);
3965
+ void peach_paper_uisearchbar_set_delegate(void *p, void *d);
3966
+ void *peach_paper_uisearchbar_get_search_text_field(void *p);
3967
+ int32_t peach_paper_uisearchbar_get_autocapitalization(void *p);
3968
+ void peach_paper_uisearchbar_set_autocapitalization(void *p, int32_t v);
3969
+ int32_t peach_paper_uisearchbar_get_autocorrection(void *p);
3970
+ void peach_paper_uisearchbar_set_autocorrection(void *p, int32_t v);
3971
+ int32_t peach_paper_uisearchbar_get_spell_checking(void *p);
3972
+ void peach_paper_uisearchbar_set_spell_checking(void *p, int32_t v);
3973
+ int32_t peach_paper_uisearchbar_get_enables_return(void *p);
3974
+ void peach_paper_uisearchbar_set_enables_return(void *p, int32_t v);
3975
+ int32_t peach_paper_uisearchbar_get_return_key(void *p);
3976
+ void peach_paper_uisearchbar_set_return_key(void *p, int32_t v);
3977
+ int32_t peach_paper_uisearchbar_get_keyboard_type(void *p);
3978
+ void peach_paper_uisearchbar_set_keyboard_type(void *p, int32_t v);
3979
+ int32_t peach_paper_uisearchbar_get_keyboard_appearance(void *p);
3980
+ void peach_paper_uisearchbar_set_keyboard_appearance(void *p, int32_t v);
3981
+ void *peach_paper_uiscrollview_get_delegate(void *p);
3982
+ void peach_paper_uiscrollview_set_delegate(void *p, void *d);
3983
+ int32_t peach_paper_uiscrollview_get_shows_h(void *p);
3984
+ void peach_paper_uiscrollview_set_shows_h(void *p, int32_t v);
3985
+ int32_t peach_paper_uiscrollview_get_shows_v(void *p);
3986
+ void peach_paper_uiscrollview_set_shows_v(void *p, int32_t v);
3987
+ double peach_paper_uiscrollview_get_min_zoom(void *p);
3988
+ void peach_paper_uiscrollview_set_min_zoom(void *p, double v);
3989
+ double peach_paper_uiscrollview_get_max_zoom(void *p);
3990
+ void peach_paper_uiscrollview_set_max_zoom(void *p, double v);
3991
+ int32_t peach_paper_uiscrollview_get_bounces(void *p);
3992
+ void peach_paper_uiscrollview_set_bounces(void *p, int32_t v);
3993
+ int32_t peach_paper_uiscrollview_get_bounces_zoom(void *p);
3994
+ void peach_paper_uiscrollview_set_bounces_zoom(void *p, int32_t v);
3995
+ double peach_paper_uiscrollview_get_deceleration_rate(void *p);
3996
+ void peach_paper_uiscrollview_set_deceleration_rate(void *p, double v);
3997
+ void *peach_paper_uiimageview_get_highlighted_image(void *p);
3998
+ void peach_paper_uiimageview_set_highlighted_image(void *p, void *v);
3999
+ int32_t peach_paper_uiimageview_get_is_highlighted(void *p);
4000
+ void peach_paper_uiimageview_set_is_highlighted(void *p, int32_t v);
4001
+ int32_t peach_paper_uiactivity_get_style(void *p);
4002
+ void peach_paper_uiactivity_set_style(void *p, int32_t v);
4003
+ void *peach_paper_uiactivity_get_color(void *p);
4004
+ void peach_paper_uiactivity_set_color(void *p, void *v);
4005
+ int32_t peach_paper_uiactivity_get_hides(void *p);
4006
+ void peach_paper_uiactivity_set_hides(void *p, int32_t v);
4007
+ int32_t peach_paper_uiactivity_is_animating(void *p);
4008
+ void peach_paper_uiactivity_start(void *p);
4009
+ void peach_paper_uiactivity_stop(void *p);
4010
+ }
4011
+
4012
+ extern "C" BOOL peachLoadRegisteredImageURL(
4013
+ NSURL *url,
4014
+ CGSize size,
4015
+ CGFloat scale,
4016
+ NSInteger resizeMode,
4017
+ void (^progressHandler)(int64_t progress, int64_t total),
4018
+ void (^partialLoadHandler)(UIImage *image),
4019
+ void (^completionHandler)(NSError *error, UIImage *image),
4020
+ dispatch_block_t *cancelOut);
4021
+
4022
+ @interface PeachPaperImageLoader : NSObject
4023
+ - (dispatch_block_t)loadImageWithURLRequest:(NSURLRequest *)imageURLRequest
4024
+ size:(CGSize)size
4025
+ scale:(CGFloat)scale
4026
+ clipped:(BOOL)clipped
4027
+ resizeMode:(NSInteger)resizeMode
4028
+ progressBlock:(void (^)(int64_t progress, int64_t total))progressBlock
4029
+ partialLoadBlock:(void (^)(UIImage *image))partialLoadBlock
4030
+ completionBlock:(void (^)(NSError *error, UIImage *image))completionBlock;
4031
+ @end
4032
+
4033
+ @implementation PeachPaperImageLoader
4034
+ - (dispatch_block_t)loadImageWithURLRequest:(NSURLRequest *)imageURLRequest
4035
+ size:(CGSize)size
4036
+ scale:(CGFloat)scale
4037
+ clipped:(BOOL)clipped
4038
+ resizeMode:(NSInteger)resizeMode
4039
+ progressBlock:(void (^)(int64_t progress, int64_t total))progressBlock
4040
+ partialLoadBlock:(void (^)(UIImage *image))partialLoadBlock
4041
+ completionBlock:(void (^)(NSError *error, UIImage *image))completionBlock
4042
+ {
4043
+ (void)clipped;
4044
+ NSURL *url = imageURLRequest.URL;
4045
+ if (!url) {
4046
+ if (completionBlock) completionBlock([NSError errorWithDomain:@"PeachImageLoader" code:1 userInfo:nil], nil);
4047
+ return ^{};
4048
+ }
4049
+ dispatch_block_t registeredCancel = nil;
4050
+ if (peachLoadRegisteredImageURL(url, size, scale, resizeMode, progressBlock, partialLoadBlock, completionBlock, &registeredCancel)) {
4051
+ return registeredCancel ?: ^{};
4052
+ }
4053
+ if ([url.scheme isEqualToString:@"data"]) {
4054
+ NSString *abs = url.absoluteString;
4055
+ NSRange comma = [abs rangeOfString:@","];
4056
+ NSData *data = nil;
4057
+ if (comma.location != NSNotFound) {
4058
+ NSString *meta = [abs substringToIndex:comma.location];
4059
+ NSString *payload = [abs substringFromIndex:comma.location + 1];
4060
+ if ([meta containsString:@";base64"]) {
4061
+ data = [[NSData alloc] initWithBase64EncodedString:payload options:NSDataBase64DecodingIgnoreUnknownCharacters];
4062
+ } else {
4063
+ NSString *decoded = [payload stringByRemovingPercentEncoding] ?: payload;
4064
+ data = [decoded dataUsingEncoding:NSUTF8StringEncoding];
4065
+ }
4066
+ }
4067
+ dispatch_async(dispatch_get_main_queue(), ^{
4068
+ UIImage *img = data ? [UIImage imageWithData:data] : nil;
4069
+ if (completionBlock) {
4070
+ completionBlock(img ? nil : [NSError errorWithDomain:@"PeachImageLoader" code:2 userInfo:nil], img);
4071
+ }
4072
+ });
4073
+ return ^{};
4074
+ }
4075
+ if ([url.scheme isEqualToString:@"file"]) {
4076
+ NSData *data = [NSData dataWithContentsOfURL:url];
4077
+ dispatch_async(dispatch_get_main_queue(), ^{
4078
+ UIImage *img = data ? [UIImage imageWithData:data] : nil;
4079
+ if (completionBlock) {
4080
+ completionBlock(img ? nil : [NSError errorWithDomain:@"PeachImageLoader" code:3 userInfo:nil], img);
4081
+ }
4082
+ });
4083
+ return ^{};
4084
+ }
4085
+ static NSURLSession *directSession;
4086
+ if (!directSession) {
4087
+ NSURLSessionConfiguration *config = [NSURLSessionConfiguration ephemeralSessionConfiguration];
4088
+ config.protocolClasses = @[];
4089
+ directSession = [NSURLSession sessionWithConfiguration:config];
4090
+ }
4091
+ NSURLSessionDataTask *task = [directSession
4092
+ dataTaskWithRequest:imageURLRequest
4093
+ completionHandler:^(NSData *data, NSURLResponse *, NSError *error) {
4094
+ dispatch_async(dispatch_get_main_queue(), ^{
4095
+ UIImage *img = data ? [UIImage imageWithData:data] : nil;
4096
+ if (completionBlock) {
4097
+ completionBlock(img ? nil : (error ?: [NSError errorWithDomain:@"PeachImageLoader" code:4 userInfo:nil]), img);
4098
+ }
4099
+ });
4100
+ }];
4101
+ [task resume];
4102
+ return ^{ [task cancel]; };
4103
+ }
4104
+ @end
4105
+
4106
+ static char peachURLProtocolPropertiesKey;
4107
+ static std::mutex peachURLProtocolPropertiesMutex;
4108
+ static id peachURLProtocolPropertyForKey(id, SEL, NSString *key, id request) {
4109
+ if (!request || !key) return nil;
4110
+ std::lock_guard<std::mutex> lock(peachURLProtocolPropertiesMutex);
4111
+ NSMutableDictionary *dict = objc_getAssociatedObject(request, &peachURLProtocolPropertiesKey);
4112
+ return dict ? dict[key] : nil;
4113
+ }
4114
+ static void peachURLProtocolSetProperty(id, SEL, id value, NSString *key, id request) {
4115
+ if (!request || !key) return;
4116
+ std::lock_guard<std::mutex> lock(peachURLProtocolPropertiesMutex);
4117
+ NSMutableDictionary *dict = objc_getAssociatedObject(request, &peachURLProtocolPropertiesKey);
4118
+ if (!dict) {
4119
+ dict = [NSMutableDictionary dictionary];
4120
+ objc_setAssociatedObject(request, &peachURLProtocolPropertiesKey, dict, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
4121
+ }
4122
+ if (value) {
4123
+ dict[key] = value;
4124
+ } else {
4125
+ [dict removeObjectForKey:key];
4126
+ }
4127
+ }
4128
+ static void peachURLProtocolRemoveProperty(id, SEL, NSString *key, id request) {
4129
+ if (!request || !key) return;
4130
+ std::lock_guard<std::mutex> lock(peachURLProtocolPropertiesMutex);
4131
+ NSMutableDictionary *dict = objc_getAssociatedObject(request, &peachURLProtocolPropertiesKey);
4132
+ [dict removeObjectForKey:key];
4133
+ }
4134
+
4135
+ static IMP peachOrigNSURLFileSystemRepresentation = nullptr;
4136
+ static const char *peachNSURLFileSystemRepresentation(id self, SEL _cmd) {
4137
+ if (![(NSURL *)self isFileURL]) return nullptr;
4138
+ return peachOrigNSURLFileSystemRepresentation
4139
+ ? ((const char *(*)(id, SEL))peachOrigNSURLFileSystemRepresentation)(self, _cmd)
4140
+ : nullptr;
4141
+ }
4142
+
4143
+ static char peachUIViewIsAXElementKey;
4144
+ static IMP peachOrigUIViewIsAccessibilityElement = nullptr;
4145
+ static IMP peachOrigUIViewSetIsAccessibilityElement = nullptr;
4146
+ static void peachUIViewSetIsAccessibilityElement(id self, SEL _cmd, BOOL v) {
4147
+ static Class segCls = NSClassFromString(@"UISegmentedControl");
4148
+ if (!segCls || ![self isKindOfClass:segCls]) {
4149
+ objc_setAssociatedObject(self, &peachUIViewIsAXElementKey, @(v), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
4150
+ }
4151
+ if (peachOrigUIViewSetIsAccessibilityElement) {
4152
+ ((void (*)(id, SEL, BOOL))peachOrigUIViewSetIsAccessibilityElement)(self, _cmd, v);
4153
+ }
4154
+ }
4155
+ static BOOL peachUIViewIsAccessibilityElement(id self, SEL _cmd) {
4156
+ if (NSNumber *overrideVal = objc_getAssociatedObject(self, &peachUIViewIsAXElementKey)) {
4157
+ return overrideVal.boolValue;
4158
+ }
4159
+ static Class labelCls = NSClassFromString(@"UILabel");
4160
+ static Class switchCls = NSClassFromString(@"UISwitch");
4161
+ static Class tfCls = NSClassFromString(@"UITextField");
4162
+ static Class tvCls = NSClassFromString(@"UITextView");
4163
+ static Class btnCls = NSClassFromString(@"UIButton");
4164
+ static Class sliderCls = NSClassFromString(@"UISlider");
4165
+ static Class segCls = NSClassFromString(@"UISegmentedControl");
4166
+ static Class uiViewCls = NSClassFromString(@"UIView");
4167
+ Class cls = object_getClass(self);
4168
+ if (cls == uiViewCls ||
4169
+ (labelCls && [self isKindOfClass:labelCls]) ||
4170
+ (switchCls && [self isKindOfClass:switchCls]) ||
4171
+ (tfCls && [self isKindOfClass:tfCls]) ||
4172
+ (tvCls && [self isKindOfClass:tvCls]) ||
4173
+ (btnCls && [self isKindOfClass:btnCls]) ||
4174
+ (sliderCls && [self isKindOfClass:sliderCls]) ||
4175
+ (segCls && [self isKindOfClass:segCls])) {
4176
+ return peachOrigUIViewIsAccessibilityElement
4177
+ ? ((BOOL (*)(id, SEL))peachOrigUIViewIsAccessibilityElement)(self, _cmd)
4178
+ : NO;
4179
+ }
4180
+ return NO;
4181
+ }
4182
+
4183
+ static id peachBridgeProxyImageLoader(id, SEL) {
4184
+ static PeachPaperImageLoader *loader;
4185
+ if (!loader) loader = [PeachPaperImageLoader new];
4186
+ return loader;
4187
+ }
4188
+
4189
+ static IMP peachOrigUIScrollViewSetZoomScale = nullptr;
4190
+ static IMP peachOrigUIScrollViewSetZoomScaleAnimated = nullptr;
4191
+ static void peachUIScrollViewSetZoomScale(id self, SEL _cmd, CGFloat scale) {
4192
+ if (!std::isfinite(scale) || scale <= 0) return;
4193
+ if (peachOrigUIScrollViewSetZoomScale) {
4194
+ ((void (*)(id, SEL, CGFloat))peachOrigUIScrollViewSetZoomScale)(self, _cmd, scale);
4195
+ }
4196
+ }
4197
+ static void peachUIScrollViewSetZoomScaleAnimated(id self, SEL _cmd, CGFloat scale, BOOL animated) {
4198
+ (void)animated;
4199
+ if (!std::isfinite(scale) || scale <= 0) return;
4200
+ if (peachOrigUIScrollViewSetZoomScaleAnimated) {
4201
+ ((void (*)(id, SEL, CGFloat, BOOL))peachOrigUIScrollViewSetZoomScaleAnimated)(self, _cmd, scale, NO);
4202
+ }
4203
+ }
4204
+
4205
+ static char peachLayerAllowsGroupOpacityKey;
4206
+ static BOOL peachLayerAllowsGroupOpacity(id self, SEL) {
4207
+ NSNumber *value = objc_getAssociatedObject(self, &peachLayerAllowsGroupOpacityKey);
4208
+ return value ? value.boolValue : YES;
4209
+ }
4210
+ static void peachLayerSetAllowsGroupOpacity(id self, SEL, BOOL enabled) {
4211
+ objc_setAssociatedObject(self, &peachLayerAllowsGroupOpacityKey, @(enabled), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
4212
+ }
4213
+ static id peachAppearanceInClasses(Class self, SEL, id) {
4214
+ return [self respondsToSelector:@selector(appearance)] ? ((id (*)(id, SEL))objc_msgSend)(self, @selector(appearance)) : nil;
4215
+ }
4216
+ static id peachAppearanceWhenContainedIn(Class self, SEL, id, ...) {
4217
+ return [self respondsToSelector:@selector(appearance)] ? ((id (*)(id, SEL))objc_msgSend)(self, @selector(appearance)) : nil;
4218
+ }
4219
+ static id peachUIViewAppearance(Class self, SEL) {
4220
+ return (__bridge_transfer id)peach_paper_uiview_appearance((__bridge void *)NSStringFromClass(self));
4221
+ }
4222
+ static id peachUIBarItemAppearance(Class self, SEL) {
4223
+ return (__bridge_transfer id)peach_paper_uibaritem_appearance((__bridge void *)NSStringFromClass(self));
4224
+ }
4225
+ static id peachUIImageWithData(Class, SEL, NSData *data) {
4226
+ return data ? (__bridge_transfer id)peach_paper_uiimage_with_data((__bridge void *)data) : nil;
4227
+ }
4228
+ static CGSize peachUIImageSize(id self, SEL) {
4229
+ double w = 0, h = 0;
4230
+ peach_paper_uiimage_get_size((__bridge void *)self, &w, &h);
4231
+ return CGSizeMake(w, h);
4232
+ }
4233
+ static CGFloat peachUIImageScale(id self, SEL) {
4234
+ return (CGFloat)peach_paper_uiimage_get_scale((__bridge void *)self);
4235
+ }
4236
+
4237
+ #define PEACH_BRIDGE_OBJ_PROP(clsName, getterSel, setterSel, getFn, setFn) \\
4238
+ static id clsName##_##getterSel(id self, SEL) { return (__bridge_transfer id)getFn((__bridge void *)self); } \\
4239
+ static void clsName##_set_##getterSel(id self, SEL, id v) { setFn((__bridge void *)self, (__bridge void *)v); }
4240
+ #define PEACH_BRIDGE_OBJ_GET(clsName, getterSel, getFn) \\
4241
+ static id clsName##_##getterSel(id self, SEL) { return (__bridge_transfer id)getFn((__bridge void *)self); }
4242
+ #define PEACH_BRIDGE_BOOL_PROP(clsName, getterSel, getFn, setFn) \\
4243
+ static BOOL clsName##_##getterSel(id self, SEL) { return getFn((__bridge void *)self) != 0; } \\
4244
+ static void clsName##_set_##getterSel(id self, SEL, BOOL v) { setFn((__bridge void *)self, v ? 1 : 0); }
4245
+ #define PEACH_BRIDGE_INT_PROP(clsName, getterSel, getFn, setFn) \\
4246
+ static NSInteger clsName##_##getterSel(id self, SEL) { return (NSInteger)getFn((__bridge void *)self); } \\
4247
+ static void clsName##_set_##getterSel(id self, SEL, NSInteger v) { setFn((__bridge void *)self, (int32_t)v); }
4248
+ #define PEACH_BRIDGE_FLOAT_PROP(clsName, getterSel, getFn, setFn) \\
4249
+ static CGFloat clsName##_##getterSel(id self, SEL) { return (CGFloat)getFn((__bridge void *)self); } \\
4250
+ static void clsName##_set_##getterSel(id self, SEL, CGFloat v) { setFn((__bridge void *)self, (double)v); }
4251
+
4252
+ PEACH_BRIDGE_OBJ_PROP(peachUIView, tintColor, setTintColor:, peach_paper_uiview_get_tint_color, peach_paper_uiview_set_tint_color)
4253
+ PEACH_BRIDGE_OBJ_GET(peachUIView, window, peach_paper_uiview_get_window)
4254
+ PEACH_BRIDGE_OBJ_GET(peachUIView, nextResponder, peach_paper_uiview_get_next)
4255
+ PEACH_BRIDGE_OBJ_GET(peachUIView, superview, peach_paper_uiview_get_superview)
4256
+ PEACH_BRIDGE_OBJ_GET(peachUIView, subviews, peach_paper_uiview_get_subviews)
4257
+ PEACH_BRIDGE_INT_PROP(peachUIView, tag, peach_paper_uiview_get_tag, peach_paper_uiview_set_tag)
4258
+ PEACH_BRIDGE_BOOL_PROP(peachUIView, autoresizesSubviews, peach_paper_uiview_get_autoresizes_subviews, peach_paper_uiview_set_autoresizes_subviews)
4259
+ PEACH_BRIDGE_BOOL_PROP(peachUIView, translatesAutoresizingMaskIntoConstraints, peach_paper_uiview_get_translates_autoresizing, peach_paper_uiview_set_translates_autoresizing)
4260
+
4261
+ static char peachUIViewReactTagKey;
4262
+ static char peachUIViewRootTagKey;
4263
+ static char peachUIViewNativeIDKey;
4264
+ static char peachUIViewReactSubviewsKey;
4265
+ static id peachUIView_reactTag(id self, SEL) { return objc_getAssociatedObject(self, &peachUIViewReactTagKey); }
4266
+ static void peachUIView_set_reactTag(id self, SEL, id tag) {
4267
+ objc_setAssociatedObject(self, &peachUIViewReactTagKey, tag, OBJC_ASSOCIATION_COPY_NONATOMIC);
4268
+ }
4269
+ static id peachUIView_rootTag(id self, SEL) { return objc_getAssociatedObject(self, &peachUIViewRootTagKey); }
4270
+ static void peachUIView_set_rootTag(id self, SEL, id tag) {
4271
+ objc_setAssociatedObject(self, &peachUIViewRootTagKey, tag, OBJC_ASSOCIATION_COPY_NONATOMIC);
4272
+ }
4273
+ static id peachUIView_nativeID(id self, SEL) { return objc_getAssociatedObject(self, &peachUIViewNativeIDKey); }
4274
+ static void peachUIView_set_nativeID(id self, SEL, id nativeID) {
4275
+ objc_setAssociatedObject(self, &peachUIViewNativeIDKey, nativeID, OBJC_ASSOCIATION_COPY_NONATOMIC);
4276
+ }
4277
+ static id peachUIView_reactSubviews(id self, SEL) { return objc_getAssociatedObject(self, &peachUIViewReactSubviewsKey); }
4278
+ static id peachUIView_reactSuperview(id self, SEL) { return ((id (*)(id, SEL))objc_msgSend)(self, @selector(superview)); }
4279
+ static BOOL peachUIView_isReactRootView(id self, SEL) {
4280
+ NSNumber *tag = peachUIView_reactTag(self, nullptr);
4281
+ return tag && tag.integerValue > 0 && (tag.integerValue % 10 == 1);
4282
+ }
4283
+ static id peachUIView_reactTagAtPoint(id self, SEL, CGPoint point) {
4284
+ id view = ((id (*)(id, SEL, CGPoint, id))objc_msgSend)(self, @selector(hitTest:withEvent:), point, nil);
4285
+ while (view) {
4286
+ NSNumber *tag = ((id (*)(id, SEL))objc_msgSend)(view, @selector(reactTag));
4287
+ if (tag) return tag;
4288
+ view = ((id (*)(id, SEL))objc_msgSend)(view, @selector(superview));
4289
+ }
4290
+ return nil;
4291
+ }
4292
+ static void peachUIView_insertReactSubview(id self, SEL, id subview, NSInteger index) {
4293
+ NSMutableArray *subviews = objc_getAssociatedObject(self, &peachUIViewReactSubviewsKey);
4294
+ if (!subviews) {
4295
+ subviews = [NSMutableArray new];
4296
+ objc_setAssociatedObject(self, &peachUIViewReactSubviewsKey, subviews, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
4297
+ }
4298
+ if (subview && index >= 0 && (NSUInteger)index <= subviews.count) {
4299
+ [subviews insertObject:subview atIndex:(NSUInteger)index];
4300
+ }
4301
+ }
4302
+ static void peachUIView_removeReactSubview(id self, SEL, id subview) {
4303
+ NSMutableArray *subviews = objc_getAssociatedObject(self, &peachUIViewReactSubviewsKey);
4304
+ [subviews removeObject:subview];
4305
+ ((void (*)(id, SEL))objc_msgSend)(subview, @selector(removeFromSuperview));
4306
+ }
4307
+ static void peachUIView_didUpdateReactSubviews(id self, SEL) {
4308
+ NSArray *subviews = ((id (*)(id, SEL))objc_msgSend)(self, @selector(reactSubviews));
4309
+ for (id subview in subviews) {
4310
+ ((void (*)(id, SEL, id))objc_msgSend)(self, @selector(addSubview:), subview);
4311
+ }
4312
+ }
4313
+ static void peachUIView_didSetProps(id, SEL, id) {}
4314
+ static void peachUIView_reactSetFrame(id self, SEL, CGRect frame) {
4315
+ ((void (*)(id, SEL, CGRect))objc_msgSend)(self, @selector(setFrame:), frame);
4316
+ }
4317
+
4318
+ PEACH_BRIDGE_OBJ_PROP(peachUIBarItem, title, setTitle:, peach_paper_uibaritem_get_title, peach_paper_uibaritem_set_title)
4319
+ PEACH_BRIDGE_BOOL_PROP(peachUIBarItem, enabled, peach_paper_uibaritem_get_enabled, peach_paper_uibaritem_set_enabled)
4320
+
4321
+ PEACH_BRIDGE_OBJ_PROP(peachUITextField, text, setText:, peach_paper_uitextfield_get_text, peach_paper_uitextfield_set_text)
4322
+ PEACH_BRIDGE_OBJ_PROP(peachUITextField, placeholder, setPlaceholder:, peach_paper_uitextfield_get_placeholder, peach_paper_uitextfield_set_placeholder)
4323
+ PEACH_BRIDGE_OBJ_PROP(peachUITextField, textColor, setTextColor:, peach_paper_uitextfield_get_text_color, peach_paper_uitextfield_set_text_color)
4324
+ static void peachUITextField_setDefaultTextAttributes(id self, SEL, NSDictionary *attrs) {
4325
+ peach_paper_uitextfield_set_default_text_attributes((__bridge void *)self, (__bridge void *)attrs);
4326
+ }
4327
+
4328
+ PEACH_BRIDGE_OBJ_PROP(peachUISearchBar, placeholder, setPlaceholder:, peach_paper_uisearchbar_get_placeholder, peach_paper_uisearchbar_set_placeholder)
4329
+ PEACH_BRIDGE_OBJ_PROP(peachUISearchBar, text, setText:, peach_paper_uisearchbar_get_text, peach_paper_uisearchbar_set_text)
4330
+ PEACH_BRIDGE_OBJ_PROP(peachUISearchBar, prompt, setPrompt:, peach_paper_uisearchbar_get_prompt, peach_paper_uisearchbar_set_prompt)
4331
+ PEACH_BRIDGE_OBJ_PROP(peachUISearchBar, barTintColor, setBarTintColor:, peach_paper_uisearchbar_get_bar_tint_color, peach_paper_uisearchbar_set_bar_tint_color)
4332
+ PEACH_BRIDGE_OBJ_PROP(peachUISearchBar, backgroundImage, setBackgroundImage:, peach_paper_uisearchbar_get_background_image, peach_paper_uisearchbar_set_background_image)
4333
+ PEACH_BRIDGE_OBJ_PROP(peachUISearchBar, delegate, setDelegate:, peach_paper_uisearchbar_get_delegate, peach_paper_uisearchbar_set_delegate)
4334
+ PEACH_BRIDGE_OBJ_GET(peachUISearchBar, searchTextField, peach_paper_uisearchbar_get_search_text_field)
4335
+ PEACH_BRIDGE_INT_PROP(peachUISearchBar, barStyle, peach_paper_uisearchbar_get_bar_style, peach_paper_uisearchbar_set_bar_style)
4336
+ PEACH_BRIDGE_INT_PROP(peachUISearchBar, searchBarStyle, peach_paper_uisearchbar_get_search_bar_style, peach_paper_uisearchbar_set_search_bar_style)
4337
+ PEACH_BRIDGE_BOOL_PROP(peachUISearchBar, translucent, peach_paper_uisearchbar_get_translucent, peach_paper_uisearchbar_set_translucent)
4338
+ PEACH_BRIDGE_BOOL_PROP(peachUISearchBar, showsCancelButton, peach_paper_uisearchbar_get_shows_cancel, peach_paper_uisearchbar_set_shows_cancel)
4339
+ PEACH_BRIDGE_BOOL_PROP(peachUISearchBar, showsBookmarkButton, peach_paper_uisearchbar_get_shows_bookmark, peach_paper_uisearchbar_set_shows_bookmark)
4340
+ PEACH_BRIDGE_BOOL_PROP(peachUISearchBar, showsSearchResultsButton, peach_paper_uisearchbar_get_shows_results, peach_paper_uisearchbar_set_shows_results)
4341
+ PEACH_BRIDGE_INT_PROP(peachUISearchBar, autocapitalizationType, peach_paper_uisearchbar_get_autocapitalization, peach_paper_uisearchbar_set_autocapitalization)
4342
+ PEACH_BRIDGE_INT_PROP(peachUISearchBar, autocorrectionType, peach_paper_uisearchbar_get_autocorrection, peach_paper_uisearchbar_set_autocorrection)
4343
+ PEACH_BRIDGE_INT_PROP(peachUISearchBar, spellCheckingType, peach_paper_uisearchbar_get_spell_checking, peach_paper_uisearchbar_set_spell_checking)
4344
+ PEACH_BRIDGE_BOOL_PROP(peachUISearchBar, enablesReturnKeyAutomatically, peach_paper_uisearchbar_get_enables_return, peach_paper_uisearchbar_set_enables_return)
4345
+ PEACH_BRIDGE_INT_PROP(peachUISearchBar, returnKeyType, peach_paper_uisearchbar_get_return_key, peach_paper_uisearchbar_set_return_key)
4346
+ PEACH_BRIDGE_INT_PROP(peachUISearchBar, keyboardType, peach_paper_uisearchbar_get_keyboard_type, peach_paper_uisearchbar_set_keyboard_type)
4347
+ PEACH_BRIDGE_INT_PROP(peachUISearchBar, keyboardAppearance, peach_paper_uisearchbar_get_keyboard_appearance, peach_paper_uisearchbar_set_keyboard_appearance)
4348
+ static void peachUISearchBar_setShowsCancelAnimated(id self, SEL, BOOL shows, BOOL animated) {
4349
+ peach_paper_uisearchbar_set_shows_cancel_animated((__bridge void *)self, shows ? 1 : 0, animated ? 1 : 0);
4350
+ }
4351
+ static void peachUISearchBar_setSearchFieldBgImage(id self, SEL, UIImage *img, NSUInteger state) {
4352
+ peach_paper_uisearchbar_set_search_field_bg_image((__bridge void *)self, (__bridge void *)img, (int32_t)state);
4353
+ }
4354
+ static void peachUISearchBar_setSearchTextAdjustment(id self, SEL, UIOffset offset) {
4355
+ peach_paper_uisearchbar_set_text_adjustment((__bridge void *)self, (double)offset.horizontal, (double)offset.vertical);
4356
+ }
4357
+ PEACH_BRIDGE_OBJ_PROP(peachUIScrollView, delegate, setDelegate:, peach_paper_uiscrollview_get_delegate, peach_paper_uiscrollview_set_delegate)
4358
+ PEACH_BRIDGE_BOOL_PROP(peachUIScrollView, showsHorizontalScrollIndicator, peach_paper_uiscrollview_get_shows_h, peach_paper_uiscrollview_set_shows_h)
4359
+ PEACH_BRIDGE_BOOL_PROP(peachUIScrollView, showsVerticalScrollIndicator, peach_paper_uiscrollview_get_shows_v, peach_paper_uiscrollview_set_shows_v)
4360
+ PEACH_BRIDGE_FLOAT_PROP(peachUIScrollView, minimumZoomScale, peach_paper_uiscrollview_get_min_zoom, peach_paper_uiscrollview_set_min_zoom)
4361
+ PEACH_BRIDGE_FLOAT_PROP(peachUIScrollView, maximumZoomScale, peach_paper_uiscrollview_get_max_zoom, peach_paper_uiscrollview_set_max_zoom)
4362
+ PEACH_BRIDGE_BOOL_PROP(peachUIScrollView, bounces, peach_paper_uiscrollview_get_bounces, peach_paper_uiscrollview_set_bounces)
4363
+ PEACH_BRIDGE_BOOL_PROP(peachUIScrollView, bouncesZoom, peach_paper_uiscrollview_get_bounces_zoom, peach_paper_uiscrollview_set_bounces_zoom)
4364
+ PEACH_BRIDGE_FLOAT_PROP(peachUIScrollView, decelerationRate, peach_paper_uiscrollview_get_deceleration_rate, peach_paper_uiscrollview_set_deceleration_rate)
4365
+
4366
+ PEACH_BRIDGE_OBJ_PROP(peachUIImageView, highlightedImage, setHighlightedImage:, peach_paper_uiimageview_get_highlighted_image, peach_paper_uiimageview_set_highlighted_image)
4367
+ PEACH_BRIDGE_BOOL_PROP(peachUIImageView, highlighted, peach_paper_uiimageview_get_is_highlighted, peach_paper_uiimageview_set_is_highlighted)
4368
+
4369
+ PEACH_BRIDGE_INT_PROP(peachUIActivity, style, peach_paper_uiactivity_get_style, peach_paper_uiactivity_set_style)
4370
+ PEACH_BRIDGE_OBJ_PROP(peachUIActivity, color, setColor:, peach_paper_uiactivity_get_color, peach_paper_uiactivity_set_color)
4371
+ PEACH_BRIDGE_BOOL_PROP(peachUIActivity, hidesWhenStopped, peach_paper_uiactivity_get_hides, peach_paper_uiactivity_set_hides)
4372
+ static BOOL peachUIActivity_isAnimating(id self, SEL) { return peach_paper_uiactivity_is_animating((__bridge void *)self) != 0; }
4373
+ static void peachUIActivity_start(id self, SEL) { peach_paper_uiactivity_start((__bridge void *)self); }
4374
+ static void peachUIActivity_stop(id self, SEL) { peach_paper_uiactivity_stop((__bridge void *)self); }
4375
+
4376
+ static void peachAddInstanceMethod(Class cls, SEL sel, IMP imp, const char *types) {
4377
+ if (cls && !class_getInstanceMethod(cls, sel)) class_addMethod(cls, sel, imp, types);
4378
+ }
4379
+ static void peachAddClassMethod(Class cls, SEL sel, IMP imp, const char *types) {
4380
+ if (!cls || class_getClassMethod(cls, sel)) return;
4381
+ if (Class meta = object_getClass(cls)) class_addMethod(meta, sel, imp, types);
4382
+ }
4383
+ `
4384
+ : ''
4385
+ }
3114
4386
  namespace {
3115
4387
  struct PeachFabricView {
3116
4388
  react::ComponentHandle handle;
@@ -3119,6 +4391,10 @@ struct PeachFabricView {
3119
4391
  react::Props::Shared props;
3120
4392
  react::State::Shared state;
3121
4393
  react::LayoutMetrics layoutMetrics;
4394
+ UIView *slotView = nil;
4395
+ UIView *positionView = nil;
4396
+ double windowX = 0;
4397
+ double windowY = 0;
3122
4398
  };
3123
4399
  PeachFabricComponents *fabricComponents;
3124
4400
  RCTComponentViewRegistry *fabricRegistry;
@@ -3130,8 +4406,23 @@ std::shared_ptr<const void> fabricOwner;
3130
4406
  std::shared_ptr<const react::EventDispatcher> fabricDispatcher;
3131
4407
  std::optional<jsi::Function> fabricEventHandler;
3132
4408
  std::unordered_map<int, PeachFabricView> fabricViews;
4409
+ std::unordered_map<int, int> fabricTagAliases;
3133
4410
  int nextFabricView = 1;
3134
- std::string fabricNames = ${JSON.stringify(views.map(({ name }) => name).join('\n'))};
4411
+ UITextField *fabricFocusField = nil;
4412
+ bool fabricFocusActive = false;
4413
+ int fabricFocusParentTag = 0;
4414
+ CGRect fabricFocusWindowRect = CGRectZero;
4415
+ const char *fabricCodegenNames = ${JSON.stringify(views.map(({ name }) => name).join('\n'))};
4416
+ std::string fabricNames = fabricCodegenNames;
4417
+ ${
4418
+ paper
4419
+ ? `// the providers' RCTViewManager classes, and the component names
4420
+ // RCTViewManagerModuleNameForClass gives the ones linked
4421
+ NSArray<NSString *> *fabricPaperClasses = @[${paperClasses.map((name) => `@${JSON.stringify(name)}`).join(', ')}];
4422
+ std::unordered_set<std::string> fabricPaperNames;
4423
+ `
4424
+ : ''
4425
+ }
3135
4426
 
3136
4427
  PeachFabricView &fabricView(int tag) {
3137
4428
  auto found = fabricViews.find(tag);
@@ -3142,6 +4433,52 @@ PeachFabricView &fabricView(int tag) {
3142
4433
  return found->second;
3143
4434
  }
3144
4435
 
4436
+ void applyFabricFocus() {
4437
+ if (!fabricFocusActive) {
4438
+ if (fabricFocusField) {
4439
+ [fabricFocusField resignFirstResponder];
4440
+ [fabricFocusField removeFromSuperview];
4441
+ }
4442
+ return;
4443
+ }
4444
+ UIView *container = nil;
4445
+ UIWindow *keyWindow = UIApplication.sharedApplication.keyWindow ?: RCTKeyWindow();
4446
+ if (fabricFocusParentTag > 0) {
4447
+ auto found = fabricViews.find(fabricFocusParentTag);
4448
+ if (found != fabricViews.end()) {
4449
+ container = [fabricRegistry componentViewDescriptorWithTag:fabricFocusParentTag].view;
4450
+ }
4451
+ } else {
4452
+ container = keyWindow.rootViewController.view;
4453
+ }
4454
+ if (!container) return;
4455
+ if (!fabricFocusField) {
4456
+ fabricFocusField = [[UITextField alloc] initWithFrame:CGRectZero];
4457
+ fabricFocusField.backgroundColor = nil;
4458
+ fabricFocusField.opaque = NO;
4459
+ fabricFocusField.hidden = NO;
4460
+ fabricFocusField.userInteractionEnabled = YES;
4461
+ }
4462
+ if (fabricFocusField.superview != container) {
4463
+ [container addSubview:fabricFocusField];
4464
+ }
4465
+ if (container.window != nil) {
4466
+ fabricFocusField.frame = [container convertRect:fabricFocusWindowRect fromView:container.window];
4467
+ if (!fabricFocusField.isFirstResponder) {
4468
+ [fabricFocusField becomeFirstResponder];
4469
+ }
4470
+ } else if (fabricFocusParentTag > 0) {
4471
+ auto found = fabricViews.find(fabricFocusParentTag);
4472
+ if (found != fabricViews.end()) {
4473
+ fabricFocusField.frame = CGRectMake(
4474
+ fabricFocusWindowRect.origin.x - found->second.windowX,
4475
+ fabricFocusWindowRect.origin.y - found->second.windowY,
4476
+ fabricFocusWindowRect.size.width,
4477
+ fabricFocusWindowRect.size.height);
4478
+ }
4479
+ }
4480
+ }
4481
+
3145
4482
  react::Props::Shared fabricCloneProps(jsi::Runtime &rt, const PeachFabricView &view, const jsi::Value &props) {
3146
4483
  react::PropsParserContext context{-1, *fabricContext};
3147
4484
  return view.descriptor->cloneProps(context, view.props, react::RawProps(rt, props));
@@ -3211,7 +4548,44 @@ void fabricUpdateState(const react::StateUpdate &update) {
3211
4548
 
3212
4549
  } // namespace
3213
4550
 
3214
- void peachInstallFabricViews(jsi::Runtime &rt, std::shared_ptr<react::CallInvoker> invoker) {
4551
+ ${
4552
+ paper
4553
+ ? `static IMP peachOrigEventDispatcherDispatchEvent = nullptr;
4554
+ static void peachEventDispatcherDispatchEvent(id self, SEL _cmd, id<RCTEvent> event) {
4555
+ if (event.viewTag && fabricViews.find(event.viewTag.intValue) != fabricViews.end()) {
4556
+ NSString *moduleDotMethod = [[event class] moduleDotMethod];
4557
+ if ([moduleDotMethod hasPrefix:@"RCTEventEmitter."]) return;
4558
+ }
4559
+ if (peachOrigEventDispatcherDispatchEvent) {
4560
+ ((void (*)(id, SEL, id))peachOrigEventDispatcherDispatchEvent)(self, _cmd, event);
4561
+ }
4562
+ }
4563
+
4564
+ @interface PeachPaperEventObserver : NSObject <RCTEventDispatcherObserver>
4565
+ @end
4566
+
4567
+ @implementation PeachPaperEventObserver
4568
+ - (void)eventDispatcherWillDispatchEvent:(id<RCTEvent>)event
4569
+ {
4570
+ NSNumber *reactTag = event.viewTag;
4571
+ if (!reactTag) return;
4572
+ auto found = fabricViews.find(reactTag.intValue);
4573
+ if (found == fabricViews.end() || !found->second.family) return;
4574
+ NSArray *args = [event arguments];
4575
+ NSString *eventName = args.count >= 2 && [args[1] isKindOfClass:[NSString class]]
4576
+ ? args[1]
4577
+ : RCTNormalizeInputEventName(event.eventName);
4578
+ NSDictionary *body = args.count >= 3 && [args[2] isKindOfClass:[NSDictionary class]] ? args[2] : @{};
4579
+ auto emitter = found->second.family->getEventEmitter();
4580
+ if (!emitter || !eventName) return;
4581
+ static_cast<const react::ViewEventEmitter &>(*emitter).dispatchEvent(
4582
+ std::string(eventName.UTF8String),
4583
+ react::convertIdToFollyDynamic(body));
4584
+ }
4585
+ @end
4586
+ `
4587
+ : ''
4588
+ }void peachInstallFabricViews(jsi::Runtime &rt, std::shared_ptr<react::CallInvoker> invoker, id bridgeProxy, id moduleDecorator) {
3215
4589
  fabricInvoker = std::move(invoker);
3216
4590
  fabricComponents = [PeachFabricComponents new];
3217
4591
  RCTComponentViewFactory *factory = [RCTComponentViewFactory currentComponentViewFactory];
@@ -3221,7 +4595,256 @@ void peachInstallFabricViews(jsi::Runtime &rt, std::shared_ptr<react::CallInvoke
3221
4595
  fabricScheduler = std::make_shared<react::RuntimeScheduler>(
3222
4596
  [](std::function<void(jsi::Runtime &)> &&work) { fabricInvoker->invokeAsync(std::move(work)); });
3223
4597
  fabricContext->insert(react::RuntimeSchedulerKey, std::weak_ptr<react::RuntimeScheduler>(fabricScheduler));
3224
- fabricOwner = std::make_shared<int>(0);
4598
+ ${
4599
+ paper
4600
+ ? ` // Register missing Objective-C selectors on UIKit/QuartzCore classes and
4601
+ // RCTBridgeProxy when UIKitCore/QuartzCore omit @objc on members Paper calls.
4602
+ static char getBoolTypes[] = {*@encode(BOOL), '@', ':', 0};
4603
+ static char setBoolTypes[] = {'v', '@', ':', *@encode(BOOL), 0};
4604
+ static char getIntTypes[] = {*@encode(NSInteger), '@', ':', 0};
4605
+ static char setIntTypes[] = {'v', '@', ':', *@encode(NSInteger), 0};
4606
+ static char getFloatTypes[] = {*@encode(CGFloat), '@', ':', 0};
4607
+ static char setFloatTypes[] = {'v', '@', ':', *@encode(CGFloat), 0};
4608
+ static char getSizeTypes[64];
4609
+ std::snprintf(getSizeTypes, sizeof(getSizeTypes), "%s@:", @encode(CGSize));
4610
+ static char setOffsetTypes[64];
4611
+ std::snprintf(setOffsetTypes, sizeof(setOffsetTypes), "v@:%s", @encode(UIOffset));
4612
+ static char setBoolBoolTypes[] = {'v', '@', ':', *@encode(BOOL), *@encode(BOOL), 0};
4613
+ static char setIdUIntTypes[] = {'v', '@', ':', '@', *@encode(NSUInteger), 0};
4614
+ static char insertSubviewTypes[] = {'v', '@', ':', '@', *@encode(NSInteger), 0};
4615
+ static char getPointIdTypes[64];
4616
+ std::snprintf(getPointIdTypes, sizeof(getPointIdTypes), "@@:%s", @encode(CGPoint));
4617
+ static char setRectTypes[64];
4618
+ std::snprintf(setRectTypes, sizeof(setRectTypes), "v@:%s", @encode(CGRect));
4619
+
4620
+ if (Class urlClass = NSClassFromString(@"NSURL")) {
4621
+ if (Method m = class_getInstanceMethod(urlClass, @selector(fileSystemRepresentation))) {
4622
+ IMP current = method_getImplementation(m);
4623
+ if (current != (IMP)peachNSURLFileSystemRepresentation) {
4624
+ peachOrigNSURLFileSystemRepresentation = method_setImplementation(m, (IMP)peachNSURLFileSystemRepresentation);
4625
+ }
4626
+ }
4627
+ }
4628
+ if (Class urlProtoClass = NSClassFromString(@"NSURLProtocol")) {
4629
+ if (Class meta = object_getClass(urlProtoClass)) {
4630
+ class_replaceMethod(meta, @selector(propertyForKey:inRequest:), (IMP)peachURLProtocolPropertyForKey, "@@:@@");
4631
+ class_replaceMethod(meta, @selector(setProperty:forKey:inRequest:), (IMP)peachURLProtocolSetProperty, "v@:@@@");
4632
+ class_replaceMethod(meta, @selector(removePropertyForKey:inRequest:), (IMP)peachURLProtocolRemoveProperty, "v@:@@");
4633
+ }
4634
+ }
4635
+ if (Class bpClass = NSClassFromString(@"RCTBridgeProxy")) {
4636
+ class_replaceMethod(bpClass, @selector(imageLoader), (IMP)peachBridgeProxyImageLoader, "@@:");
4637
+ }
4638
+ if (Class layerClass = NSClassFromString(@"CALayer")) {
4639
+ peachAddInstanceMethod(layerClass, @selector(allowsGroupOpacity), (IMP)peachLayerAllowsGroupOpacity, getBoolTypes);
4640
+ peachAddInstanceMethod(layerClass, @selector(setAllowsGroupOpacity:), (IMP)peachLayerSetAllowsGroupOpacity, setBoolTypes);
4641
+ }
4642
+ if (Class imgClass = NSClassFromString(@"UIImage")) {
4643
+ peachAddClassMethod(imgClass, @selector(imageWithData:), (IMP)peachUIImageWithData, "@@:@");
4644
+ peachAddInstanceMethod(imgClass, @selector(size), (IMP)peachUIImageSize, getSizeTypes);
4645
+ peachAddInstanceMethod(imgClass, @selector(scale), (IMP)peachUIImageScale, getFloatTypes);
4646
+ }
4647
+ if (Class barItemClass = NSClassFromString(@"UIBarItem")) {
4648
+ peachAddClassMethod(barItemClass, @selector(appearance), (IMP)peachUIBarItemAppearance, "@@:");
4649
+ peachAddClassMethod(barItemClass, @selector(appearanceWhenContainedInInstancesOfClasses:), (IMP)peachAppearanceInClasses, "@@:@");
4650
+ peachAddClassMethod(barItemClass, @selector(appearanceWhenContainedIn:), (IMP)peachAppearanceWhenContainedIn, "@@:@");
4651
+ peachAddInstanceMethod(barItemClass, @selector(title), (IMP)peachUIBarItem_title, "@@:");
4652
+ peachAddInstanceMethod(barItemClass, @selector(setTitle:), (IMP)peachUIBarItem_set_title, "v@:@");
4653
+ peachAddInstanceMethod(barItemClass, @selector(isEnabled), (IMP)peachUIBarItem_enabled, getBoolTypes);
4654
+ peachAddInstanceMethod(barItemClass, @selector(enabled), (IMP)peachUIBarItem_enabled, getBoolTypes);
4655
+ peachAddInstanceMethod(barItemClass, @selector(setEnabled:), (IMP)peachUIBarItem_set_enabled, setBoolTypes);
4656
+ }
4657
+ if (Class viewClass = NSClassFromString(@"UIView")) {
4658
+ peachAddClassMethod(viewClass, @selector(appearance), (IMP)peachUIViewAppearance, "@@:");
4659
+ peachAddClassMethod(viewClass, @selector(appearanceWhenContainedInInstancesOfClasses:), (IMP)peachAppearanceInClasses, "@@:@");
4660
+ peachAddClassMethod(viewClass, @selector(appearanceWhenContainedIn:), (IMP)peachAppearanceWhenContainedIn, "@@:@");
4661
+ peachAddInstanceMethod(viewClass, @selector(tintColor), (IMP)peachUIView_tintColor, "@@:");
4662
+ peachAddInstanceMethod(viewClass, @selector(setTintColor:), (IMP)peachUIView_set_tintColor, "v@:@");
4663
+ peachAddInstanceMethod(viewClass, @selector(window), (IMP)peachUIView_window, "@@:");
4664
+ peachAddInstanceMethod(viewClass, @selector(nextResponder), (IMP)peachUIView_nextResponder, "@@:");
4665
+ peachAddInstanceMethod(viewClass, @selector(superview), (IMP)peachUIView_superview, "@@:");
4666
+ peachAddInstanceMethod(viewClass, @selector(subviews), (IMP)peachUIView_subviews, "@@:");
4667
+ peachAddInstanceMethod(viewClass, @selector(tag), (IMP)peachUIView_tag, getIntTypes);
4668
+ peachAddInstanceMethod(viewClass, @selector(setTag:), (IMP)peachUIView_set_tag, setIntTypes);
4669
+ peachAddInstanceMethod(viewClass, @selector(autoresizesSubviews), (IMP)peachUIView_autoresizesSubviews, getBoolTypes);
4670
+ peachAddInstanceMethod(viewClass, @selector(setAutoresizesSubviews:), (IMP)peachUIView_set_autoresizesSubviews, setBoolTypes);
4671
+ peachAddInstanceMethod(viewClass, @selector(translatesAutoresizingMaskIntoConstraints), (IMP)peachUIView_translatesAutoresizingMaskIntoConstraints, getBoolTypes);
4672
+ peachAddInstanceMethod(viewClass, @selector(setTranslatesAutoresizingMaskIntoConstraints:), (IMP)peachUIView_set_translatesAutoresizingMaskIntoConstraints, setBoolTypes);
4673
+ class_replaceMethod(viewClass, @selector(reactTag), (IMP)peachUIView_reactTag, "@@:");
4674
+ class_replaceMethod(viewClass, @selector(setReactTag:), (IMP)peachUIView_set_reactTag, "v@:@");
4675
+ class_replaceMethod(viewClass, @selector(rootTag), (IMP)peachUIView_rootTag, "@@:");
4676
+ class_replaceMethod(viewClass, @selector(setRootTag:), (IMP)peachUIView_set_rootTag, "v@:@");
4677
+ class_replaceMethod(viewClass, @selector(nativeID), (IMP)peachUIView_nativeID, "@@:");
4678
+ class_replaceMethod(viewClass, @selector(setNativeID:), (IMP)peachUIView_set_nativeID, "v@:@");
4679
+ class_replaceMethod(viewClass, @selector(reactSubviews), (IMP)peachUIView_reactSubviews, "@@:");
4680
+ class_replaceMethod(viewClass, @selector(reactSuperview), (IMP)peachUIView_reactSuperview, "@@:");
4681
+ class_replaceMethod(viewClass, @selector(isReactRootView), (IMP)peachUIView_isReactRootView, getBoolTypes);
4682
+ class_replaceMethod(viewClass, @selector(reactTagAtPoint:), (IMP)peachUIView_reactTagAtPoint, getPointIdTypes);
4683
+ class_replaceMethod(viewClass, @selector(insertReactSubview:atIndex:), (IMP)peachUIView_insertReactSubview, insertSubviewTypes);
4684
+ class_replaceMethod(viewClass, @selector(removeReactSubview:), (IMP)peachUIView_removeReactSubview, "v@:@");
4685
+ class_replaceMethod(viewClass, @selector(didUpdateReactSubviews), (IMP)peachUIView_didUpdateReactSubviews, "v@:");
4686
+ class_replaceMethod(viewClass, @selector(didSetProps:), (IMP)peachUIView_didSetProps, "v@:@");
4687
+ class_replaceMethod(viewClass, @selector(reactSetFrame:), (IMP)peachUIView_reactSetFrame, setRectTypes);
4688
+ if (Method m = class_getInstanceMethod(viewClass, @selector(setIsAccessibilityElement:))) {
4689
+ IMP current = method_getImplementation(m);
4690
+ if (current != (IMP)peachUIViewSetIsAccessibilityElement) {
4691
+ peachOrigUIViewSetIsAccessibilityElement = method_setImplementation(m, (IMP)peachUIViewSetIsAccessibilityElement);
4692
+ }
4693
+ }
4694
+ if (Method m = class_getInstanceMethod(viewClass, @selector(isAccessibilityElement))) {
4695
+ IMP current = method_getImplementation(m);
4696
+ if (current != (IMP)peachUIViewIsAccessibilityElement) {
4697
+ peachOrigUIViewIsAccessibilityElement = method_setImplementation(m, (IMP)peachUIViewIsAccessibilityElement);
4698
+ }
4699
+ }
4700
+ }
4701
+ if (Class tfClass = NSClassFromString(@"UITextField")) {
4702
+ peachAddInstanceMethod(tfClass, @selector(text), (IMP)peachUITextField_text, "@@:");
4703
+ peachAddInstanceMethod(tfClass, @selector(setText:), (IMP)peachUITextField_set_text, "v@:@");
4704
+ peachAddInstanceMethod(tfClass, @selector(placeholder), (IMP)peachUITextField_placeholder, "@@:");
4705
+ peachAddInstanceMethod(tfClass, @selector(setPlaceholder:), (IMP)peachUITextField_set_placeholder, "v@:@");
4706
+ peachAddInstanceMethod(tfClass, @selector(textColor), (IMP)peachUITextField_textColor, "@@:");
4707
+ peachAddInstanceMethod(tfClass, @selector(setTextColor:), (IMP)peachUITextField_set_textColor, "v@:@");
4708
+ peachAddInstanceMethod(tfClass, @selector(setDefaultTextAttributes:), (IMP)peachUITextField_setDefaultTextAttributes, "v@:@");
4709
+ }
4710
+ if (Class sbClass = NSClassFromString(@"UISearchBar")) {
4711
+ peachAddInstanceMethod(sbClass, @selector(placeholder), (IMP)peachUISearchBar_placeholder, "@@:");
4712
+ peachAddInstanceMethod(sbClass, @selector(setPlaceholder:), (IMP)peachUISearchBar_set_placeholder, "v@:@");
4713
+ peachAddInstanceMethod(sbClass, @selector(text), (IMP)peachUISearchBar_text, "@@:");
4714
+ peachAddInstanceMethod(sbClass, @selector(setText:), (IMP)peachUISearchBar_set_text, "v@:@");
4715
+ peachAddInstanceMethod(sbClass, @selector(prompt), (IMP)peachUISearchBar_prompt, "@@:");
4716
+ peachAddInstanceMethod(sbClass, @selector(setPrompt:), (IMP)peachUISearchBar_set_prompt, "v@:@");
4717
+ peachAddInstanceMethod(sbClass, @selector(barTintColor), (IMP)peachUISearchBar_barTintColor, "@@:");
4718
+ peachAddInstanceMethod(sbClass, @selector(setBarTintColor:), (IMP)peachUISearchBar_set_barTintColor, "v@:@");
4719
+ peachAddInstanceMethod(sbClass, @selector(backgroundImage), (IMP)peachUISearchBar_backgroundImage, "@@:");
4720
+ peachAddInstanceMethod(sbClass, @selector(setBackgroundImage:), (IMP)peachUISearchBar_set_backgroundImage, "v@:@");
4721
+ peachAddInstanceMethod(sbClass, @selector(delegate), (IMP)peachUISearchBar_delegate, "@@:");
4722
+ peachAddInstanceMethod(sbClass, @selector(setDelegate:), (IMP)peachUISearchBar_set_delegate, "v@:@");
4723
+ peachAddInstanceMethod(sbClass, @selector(searchTextField), (IMP)peachUISearchBar_searchTextField, "@@:");
4724
+ peachAddInstanceMethod(sbClass, @selector(barStyle), (IMP)peachUISearchBar_barStyle, getIntTypes);
4725
+ peachAddInstanceMethod(sbClass, @selector(setBarStyle:), (IMP)peachUISearchBar_set_barStyle, setIntTypes);
4726
+ peachAddInstanceMethod(sbClass, @selector(searchBarStyle), (IMP)peachUISearchBar_searchBarStyle, getIntTypes);
4727
+ peachAddInstanceMethod(sbClass, @selector(setSearchBarStyle:), (IMP)peachUISearchBar_set_searchBarStyle, setIntTypes);
4728
+ peachAddInstanceMethod(sbClass, @selector(isTranslucent), (IMP)peachUISearchBar_translucent, getBoolTypes);
4729
+ peachAddInstanceMethod(sbClass, @selector(translucent), (IMP)peachUISearchBar_translucent, getBoolTypes);
4730
+ peachAddInstanceMethod(sbClass, @selector(setTranslucent:), (IMP)peachUISearchBar_set_translucent, setBoolTypes);
4731
+ peachAddInstanceMethod(sbClass, @selector(showsCancelButton), (IMP)peachUISearchBar_showsCancelButton, getBoolTypes);
4732
+ peachAddInstanceMethod(sbClass, @selector(setShowsCancelButton:), (IMP)peachUISearchBar_set_showsCancelButton, setBoolTypes);
4733
+ peachAddInstanceMethod(sbClass, @selector(setShowsCancelButton:animated:), (IMP)peachUISearchBar_setShowsCancelAnimated, setBoolBoolTypes);
4734
+ peachAddInstanceMethod(sbClass, @selector(showsBookmarkButton), (IMP)peachUISearchBar_showsBookmarkButton, getBoolTypes);
4735
+ peachAddInstanceMethod(sbClass, @selector(setShowsBookmarkButton:), (IMP)peachUISearchBar_set_showsBookmarkButton, setBoolTypes);
4736
+ peachAddInstanceMethod(sbClass, @selector(showsSearchResultsButton), (IMP)peachUISearchBar_showsSearchResultsButton, getBoolTypes);
4737
+ peachAddInstanceMethod(sbClass, @selector(setShowsSearchResultsButton:), (IMP)peachUISearchBar_set_showsSearchResultsButton, setBoolTypes);
4738
+ peachAddInstanceMethod(sbClass, @selector(setSearchFieldBackgroundImage:forState:), (IMP)peachUISearchBar_setSearchFieldBgImage, setIdUIntTypes);
4739
+ peachAddInstanceMethod(sbClass, @selector(setSearchTextPositionAdjustment:), (IMP)peachUISearchBar_setSearchTextAdjustment, setOffsetTypes);
4740
+ peachAddInstanceMethod(sbClass, @selector(autocapitalizationType), (IMP)peachUISearchBar_autocapitalizationType, getIntTypes);
4741
+ peachAddInstanceMethod(sbClass, @selector(setAutocapitalizationType:), (IMP)peachUISearchBar_set_autocapitalizationType, setIntTypes);
4742
+ peachAddInstanceMethod(sbClass, @selector(autocorrectionType), (IMP)peachUISearchBar_autocorrectionType, getIntTypes);
4743
+ peachAddInstanceMethod(sbClass, @selector(setAutocorrectionType:), (IMP)peachUISearchBar_set_autocorrectionType, setIntTypes);
4744
+ peachAddInstanceMethod(sbClass, @selector(spellCheckingType), (IMP)peachUISearchBar_spellCheckingType, getIntTypes);
4745
+ peachAddInstanceMethod(sbClass, @selector(setSpellCheckingType:), (IMP)peachUISearchBar_set_spellCheckingType, setIntTypes);
4746
+ peachAddInstanceMethod(sbClass, @selector(enablesReturnKeyAutomatically), (IMP)peachUISearchBar_enablesReturnKeyAutomatically, getBoolTypes);
4747
+ peachAddInstanceMethod(sbClass, @selector(setEnablesReturnKeyAutomatically:), (IMP)peachUISearchBar_set_enablesReturnKeyAutomatically, setBoolTypes);
4748
+ peachAddInstanceMethod(sbClass, @selector(returnKeyType), (IMP)peachUISearchBar_returnKeyType, getIntTypes);
4749
+ peachAddInstanceMethod(sbClass, @selector(setReturnKeyType:), (IMP)peachUISearchBar_set_returnKeyType, setIntTypes);
4750
+ peachAddInstanceMethod(sbClass, @selector(keyboardType), (IMP)peachUISearchBar_keyboardType, getIntTypes);
4751
+ peachAddInstanceMethod(sbClass, @selector(setKeyboardType:), (IMP)peachUISearchBar_set_keyboardType, setIntTypes);
4752
+ peachAddInstanceMethod(sbClass, @selector(keyboardAppearance), (IMP)peachUISearchBar_keyboardAppearance, getIntTypes);
4753
+ peachAddInstanceMethod(sbClass, @selector(setKeyboardAppearance:), (IMP)peachUISearchBar_set_keyboardAppearance, setIntTypes);
4754
+ }
4755
+ if (Class svClass = NSClassFromString(@"UIScrollView")) {
4756
+ peachAddInstanceMethod(svClass, @selector(delegate), (IMP)peachUIScrollView_delegate, "@@:");
4757
+ peachAddInstanceMethod(svClass, @selector(setDelegate:), (IMP)peachUIScrollView_set_delegate, "v@:@");
4758
+ peachAddInstanceMethod(svClass, @selector(showsHorizontalScrollIndicator), (IMP)peachUIScrollView_showsHorizontalScrollIndicator, getBoolTypes);
4759
+ peachAddInstanceMethod(svClass, @selector(setShowsHorizontalScrollIndicator:), (IMP)peachUIScrollView_set_showsHorizontalScrollIndicator, setBoolTypes);
4760
+ peachAddInstanceMethod(svClass, @selector(showsVerticalScrollIndicator), (IMP)peachUIScrollView_showsVerticalScrollIndicator, getBoolTypes);
4761
+ peachAddInstanceMethod(svClass, @selector(setShowsVerticalScrollIndicator:), (IMP)peachUIScrollView_set_showsVerticalScrollIndicator, setBoolTypes);
4762
+ peachAddInstanceMethod(svClass, @selector(minimumZoomScale), (IMP)peachUIScrollView_minimumZoomScale, getFloatTypes);
4763
+ peachAddInstanceMethod(svClass, @selector(setMinimumZoomScale:), (IMP)peachUIScrollView_set_minimumZoomScale, setFloatTypes);
4764
+ peachAddInstanceMethod(svClass, @selector(maximumZoomScale), (IMP)peachUIScrollView_maximumZoomScale, getFloatTypes);
4765
+ peachAddInstanceMethod(svClass, @selector(setMaximumZoomScale:), (IMP)peachUIScrollView_set_maximumZoomScale, setFloatTypes);
4766
+ peachAddInstanceMethod(svClass, @selector(bounces), (IMP)peachUIScrollView_bounces, getBoolTypes);
4767
+ peachAddInstanceMethod(svClass, @selector(setBounces:), (IMP)peachUIScrollView_set_bounces, setBoolTypes);
4768
+ peachAddInstanceMethod(svClass, @selector(bouncesZoom), (IMP)peachUIScrollView_bouncesZoom, getBoolTypes);
4769
+ peachAddInstanceMethod(svClass, @selector(setBouncesZoom:), (IMP)peachUIScrollView_set_bouncesZoom, setBoolTypes);
4770
+ peachAddInstanceMethod(svClass, @selector(decelerationRate), (IMP)peachUIScrollView_decelerationRate, getFloatTypes);
4771
+ peachAddInstanceMethod(svClass, @selector(setDecelerationRate:), (IMP)peachUIScrollView_set_decelerationRate, setFloatTypes);
4772
+ if (Method m = class_getInstanceMethod(svClass, @selector(setZoomScale:))) {
4773
+ IMP current = method_getImplementation(m);
4774
+ if (current != (IMP)peachUIScrollViewSetZoomScale) {
4775
+ peachOrigUIScrollViewSetZoomScale = method_setImplementation(m, (IMP)peachUIScrollViewSetZoomScale);
4776
+ }
4777
+ }
4778
+ if (Method m = class_getInstanceMethod(svClass, @selector(setZoomScale:animated:))) {
4779
+ IMP current = method_getImplementation(m);
4780
+ if (current != (IMP)peachUIScrollViewSetZoomScaleAnimated) {
4781
+ peachOrigUIScrollViewSetZoomScaleAnimated = method_setImplementation(m, (IMP)peachUIScrollViewSetZoomScaleAnimated);
4782
+ }
4783
+ }
4784
+ }
4785
+ if (Class ivClass = NSClassFromString(@"UIImageView")) {
4786
+ peachAddInstanceMethod(ivClass, @selector(highlightedImage), (IMP)peachUIImageView_highlightedImage, "@@:");
4787
+ peachAddInstanceMethod(ivClass, @selector(setHighlightedImage:), (IMP)peachUIImageView_set_highlightedImage, "v@:@");
4788
+ peachAddInstanceMethod(ivClass, @selector(isHighlighted), (IMP)peachUIImageView_highlighted, getBoolTypes);
4789
+ peachAddInstanceMethod(ivClass, @selector(highlighted), (IMP)peachUIImageView_highlighted, getBoolTypes);
4790
+ peachAddInstanceMethod(ivClass, @selector(setHighlighted:), (IMP)peachUIImageView_set_highlighted, setBoolTypes);
4791
+ }
4792
+ if (Class actClass = NSClassFromString(@"UIActivityIndicatorView")) {
4793
+ peachAddInstanceMethod(actClass, @selector(style), (IMP)peachUIActivity_style, getIntTypes);
4794
+ peachAddInstanceMethod(actClass, @selector(setStyle:), (IMP)peachUIActivity_set_style, setIntTypes);
4795
+ peachAddInstanceMethod(actClass, @selector(activityIndicatorViewStyle), (IMP)peachUIActivity_style, getIntTypes);
4796
+ peachAddInstanceMethod(actClass, @selector(setActivityIndicatorViewStyle:), (IMP)peachUIActivity_set_style, setIntTypes);
4797
+ peachAddInstanceMethod(actClass, @selector(color), (IMP)peachUIActivity_color, "@@:");
4798
+ peachAddInstanceMethod(actClass, @selector(setColor:), (IMP)peachUIActivity_set_color, "v@:@");
4799
+ peachAddInstanceMethod(actClass, @selector(hidesWhenStopped), (IMP)peachUIActivity_hidesWhenStopped, getBoolTypes);
4800
+ peachAddInstanceMethod(actClass, @selector(setHidesWhenStopped:), (IMP)peachUIActivity_set_hidesWhenStopped, setBoolTypes);
4801
+ peachAddInstanceMethod(actClass, @selector(isAnimating), (IMP)peachUIActivity_isAnimating, getBoolTypes);
4802
+ peachAddInstanceMethod(actClass, @selector(startAnimating), (IMP)peachUIActivity_start, "v@:");
4803
+ peachAddInstanceMethod(actClass, @selector(stopAnimating), (IMP)peachUIActivity_stop, "v@:");
4804
+ }
4805
+ peach_paper_ensure_app_delegate();
4806
+ fabricContext->insert("RCTBridgeModuleDecorator", react::wrapManagedObject(moduleDecorator));
4807
+ fabricContext->insert("RCTBridgeProxy", react::wrapManagedObject(bridgeProxy));
4808
+ if ([moduleDecorator respondsToSelector:@selector(viewRegistry_DEPRECATED)]) {
4809
+ RCTViewRegistry *viewRegistry = [moduleDecorator viewRegistry_DEPRECATED];
4810
+ [viewRegistry setBridgelessComponentViewProvider:^UIView *(NSNumber *reactTag) {
4811
+ if (!reactTag) return nil;
4812
+ int raw = reactTag.intValue;
4813
+ auto alias = fabricTagAliases.find(raw);
4814
+ int tag = alias != fabricTagAliases.end() ? alias->second : raw;
4815
+ return [fabricRegistry findComponentViewWithTag:tag];
4816
+ }];
4817
+ }
4818
+ if (id eventDispatcher = [bridgeProxy eventDispatcher]) {
4819
+ fabricContext->insert("RCTEventDispatcher", react::wrapManagedObject(eventDispatcher));
4820
+ static PeachPaperEventObserver *paperEventObserver;
4821
+ static std::once_flag paperEventObserverOnce;
4822
+ std::call_once(paperEventObserverOnce, ^{
4823
+ paperEventObserver = [PeachPaperEventObserver new];
4824
+ });
4825
+ if ([eventDispatcher respondsToSelector:@selector(addDispatchObserver:)]) {
4826
+ [eventDispatcher addDispatchObserver:paperEventObserver];
4827
+ }
4828
+ if (Method m = class_getInstanceMethod(object_getClass(eventDispatcher), @selector(dispatchEvent:))) {
4829
+ IMP current = method_getImplementation(m);
4830
+ if (current != (IMP)peachEventDispatcherDispatchEvent) {
4831
+ peachOrigEventDispatcherDispatchEvent = method_setImplementation(m, (IMP)peachEventDispatcherDispatchEvent);
4832
+ }
4833
+ }
4834
+ }
4835
+ fabricNames = fabricCodegenNames;
4836
+ fabricPaperNames.clear();
4837
+ for (NSString *className in fabricPaperClasses) {
4838
+ Class managerClass = NSClassFromString(className);
4839
+ if (!managerClass) continue;
4840
+ std::string name = RCTViewManagerModuleNameForClass(managerClass).UTF8String;
4841
+ fabricPaperNames.insert(name);
4842
+ if (!fabricNames.empty()) fabricNames += '\\n';
4843
+ fabricNames += name;
4844
+ }
4845
+ `
4846
+ : ''
4847
+ } fabricOwner = std::make_shared<int>(0);
3225
4848
  auto box = std::make_shared<react::EventBeat::OwnerBox>();
3226
4849
  box->owner = fabricOwner;
3227
4850
  auto conclusion = [](jsi::Runtime &rt) { fabricScheduler->callExpiredTasks(rt); };
@@ -3234,22 +4857,63 @@ void peachInstallFabricViews(jsi::Runtime &rt, std::shared_ptr<react::CallInvoke
3234
4857
  fabricDescriptors = [factory createComponentDescriptorRegistryWithParameters:parameters];
3235
4858
  auto views = jsi::Object(rt);
3236
4859
  auto method = [&](const char *name, unsigned count, jsi::HostFunctionType body) {
3237
- views.setProperty(rt, name, jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, name), count, std::move(body)));
4860
+ views.setProperty(
4861
+ rt,
4862
+ name,
4863
+ jsi::Function::createFromHostFunction(
4864
+ rt,
4865
+ jsi::PropNameID::forAscii(rt, name),
4866
+ count,
4867
+ [name = std::string(name), body = std::move(body)](
4868
+ jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *args, size_t count) -> jsi::Value {
4869
+ @try {
4870
+ try {
4871
+ return body(rt, thisVal, args, count);
4872
+ } catch (const jsi::JSError &) {
4873
+ throw;
4874
+ } catch (const std::exception &e) {
4875
+ throw jsi::JSError(rt, name + ": " + e.what());
4876
+ }
4877
+ } @catch (NSException *e) {
4878
+ throw jsi::JSError(rt, name + ": " + (e.name.UTF8String ?: "NSException") + ": " + (e.reason.UTF8String ?: ""));
4879
+ }
4880
+ }));
3238
4881
  };
3239
4882
  // create(name, instanceHandle, props), Create then Insert: the family the
3240
4883
  // handle's events resolve through, the first props, the initial state, and
3241
4884
  // the layout the view has before the engine measures it
3242
4885
  method("create", 3, [](jsi::Runtime &rt, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
3243
- const auto &descriptor = fabricDescriptors->at(args[0].asString(rt).utf8(rt));
4886
+ std::string name = args[0].asString(rt).utf8(rt);
4887
+ const auto &descriptor = fabricDescriptors->at(name);
3244
4888
  int tag = nextFabricView++;
3245
4889
  auto family = descriptor.createFamily(
3246
4890
  {.tag = tag, .surfaceId = -1, .instanceHandle = std::make_shared<const react::InstanceHandle>(rt, args[1], tag)});
3247
- auto &view = fabricViews.emplace(tag, PeachFabricView{descriptor.getComponentHandle(), &descriptor, family, nullptr, nullptr, {}}).first->second;
4891
+ auto &view = fabricViews.emplace(tag, PeachFabricView{descriptor.getComponentHandle(), &descriptor, family, nullptr, nullptr, {}, nil, nil, 0, 0}).first->second;
3248
4892
  view.props = fabricCloneProps(rt, view, args[2]);
3249
4893
  view.state = descriptor.createInitialState(view.props, family);
3250
- family->getEventEmitter()->setEnabled(true);
4894
+ ${
4895
+ paper
4896
+ ? ` // the interop's state carries its coordinator, which only the shadow
4897
+ // node's adopt gives it
4898
+ if (fabricPaperNames.count(name))
4899
+ view.state = descriptor.createShadowNode({.props = view.props, .state = view.state}, family)->getState();
4900
+ `
4901
+ : ''
4902
+ } family->getEventEmitter()->setEnabled(true);
3251
4903
  UIView<RCTComponentViewProtocol> *componentView =
3252
4904
  [fabricRegistry dequeueComponentViewWithComponentHandle:view.handle tag:tag].view;
4905
+ UIView *slotView = [[UIView alloc] initWithFrame:CGRectZero];
4906
+ slotView.clipsToBounds = NO;
4907
+ slotView.opaque = NO;
4908
+ slotView.backgroundColor = nil;
4909
+ UIView *positionView = [[UIView alloc] initWithFrame:CGRectZero];
4910
+ positionView.clipsToBounds = NO;
4911
+ positionView.opaque = NO;
4912
+ positionView.backgroundColor = nil;
4913
+ [slotView addSubview:positionView];
4914
+ [positionView addSubview:componentView];
4915
+ view.slotView = slotView;
4916
+ view.positionView = positionView;
3253
4917
  [componentView updateProps:view.props oldProps:nullptr];
3254
4918
  [componentView updateEventEmitter:family->getEventEmitter()];
3255
4919
  [componentView updateState:view.state oldState:nullptr];
@@ -3268,13 +4932,24 @@ void peachInstallFabricViews(jsi::Runtime &rt, std::shared_ptr<react::CallInvoke
3268
4932
  [componentView finalizeUpdates:RNComponentViewUpdateMaskProps];
3269
4933
  return jsi::Value::undefined();
3270
4934
  });
3271
- // Update with the size and scale the engine laid the view out at
3272
- method("layout", 4, [](jsi::Runtime &, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
4935
+ // Update with the size, scale, and window origin the engine laid the view out at
4936
+ method("layout", 6, [](jsi::Runtime &, const jsi::Value &, const jsi::Value *args, size_t argc) -> jsi::Value {
3273
4937
  int tag = static_cast<int>(args[0].asNumber());
3274
4938
  auto &view = fabricView(tag);
4939
+ double width = args[1].asNumber();
4940
+ double height = args[2].asNumber();
4941
+ double scale = args[3].asNumber();
4942
+ double winX = argc >= 5 && args[4].isNumber() ? args[4].asNumber() : view.windowX;
4943
+ double winY = argc >= 6 && args[5].isNumber() ? args[5].asNumber() : view.windowY;
4944
+ if (winX != view.windowX || winY != view.windowY ||
4945
+ view.positionView.frame.size.width != width || view.positionView.frame.size.height != height) {
4946
+ view.windowX = winX;
4947
+ view.windowY = winY;
4948
+ view.positionView.frame = CGRectMake(winX, winY, width, height);
4949
+ }
3275
4950
  auto metrics = view.layoutMetrics;
3276
- metrics.frame = react::Rect{{0, 0}, {static_cast<react::Float>(args[1].asNumber()), static_cast<react::Float>(args[2].asNumber())}};
3277
- metrics.pointScaleFactor = static_cast<react::Float>(args[3].asNumber());
4951
+ metrics.frame = react::Rect{{0, 0}, {static_cast<react::Float>(width), static_cast<react::Float>(height)}};
4952
+ metrics.pointScaleFactor = static_cast<react::Float>(scale);
3278
4953
  if (metrics == view.layoutMetrics) return jsi::Value::undefined();
3279
4954
  UIView<RCTComponentViewProtocol> *componentView = [fabricRegistry componentViewDescriptorWithTag:tag].view;
3280
4955
  [componentView updateLayoutMetrics:metrics oldLayoutMetrics:view.layoutMetrics];
@@ -3287,22 +4962,96 @@ void peachInstallFabricViews(jsi::Runtime &rt, std::shared_ptr<react::CallInvoke
3287
4962
  method("drop", 1, [](jsi::Runtime &, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
3288
4963
  int tag = static_cast<int>(args[0].asNumber());
3289
4964
  auto &view = fabricView(tag);
4965
+ if (fabricFocusParentTag == tag) {
4966
+ fabricFocusParentTag = 0;
4967
+ if (fabricFocusField) {
4968
+ [fabricFocusField resignFirstResponder];
4969
+ [fabricFocusField removeFromSuperview];
4970
+ }
4971
+ }
3290
4972
  view.family->getEventEmitter()->setEnabled(false);
3291
4973
  RCTComponentViewDescriptor descriptor = [fabricRegistry componentViewDescriptorWithTag:tag];
3292
4974
  [descriptor.view removeFromSuperview];
4975
+ [view.positionView removeFromSuperview];
4976
+ [view.slotView removeFromSuperview];
3293
4977
  [fabricRegistry enqueueComponentViewWithComponentHandle:view.handle tag:tag componentViewDescriptor:descriptor];
3294
4978
  fabricViews.erase(tag);
4979
+ for (auto it = fabricTagAliases.begin(); it != fabricTagAliases.end();) {
4980
+ if (it->second == tag) it = fabricTagAliases.erase(it);
4981
+ else ++it;
4982
+ }
3295
4983
  return jsi::Value::undefined();
3296
4984
  });
3297
- // RCTMountingManager::dispatchCommand: the view's handleCommand:args:
4985
+ method("bindTag", 2, [](jsi::Runtime &, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
4986
+ int tag = static_cast<int>(args[0].asNumber());
4987
+ int nodeTag = static_cast<int>(args[1].asNumber());
4988
+ fabricTagAliases[nodeTag] = tag;
4989
+ return jsi::Value::undefined();
4990
+ });
4991
+ // RCTMountingManager::dispatchCommand: the view's handleCommand:args:. a
4992
+ // Paper command arrives as the index its view config's Commands gave it
3298
4993
  method("command", 3, [](jsi::Runtime &rt, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
3299
4994
  int tag = static_cast<int>(args[0].asNumber());
3300
4995
  fabricView(tag);
3301
4996
  NSArray *commandArgs = react::TurboModuleConvertUtils::convertJSIValueToObjCObject(rt, args[2], fabricInvoker);
3302
- [[fabricRegistry componentViewDescriptorWithTag:tag].view handleCommand:@(args[1].asString(rt).utf8(rt).c_str())
3303
- args:commandArgs];
4997
+ NSString *command = args[1].isNumber() ? [@(args[1].asNumber()) stringValue] : @(args[1].asString(rt).utf8(rt).c_str());
4998
+ [[fabricRegistry componentViewDescriptorWithTag:tag].view handleCommand:command args:commandArgs];
3304
4999
  return jsi::Value::undefined();
3305
5000
  });
5001
+ method("syncFocus", 6, [](jsi::Runtime &, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
5002
+ fabricFocusActive = args[0].isBool() ? args[0].getBool() : (args[0].asNumber() != 0);
5003
+ fabricFocusParentTag = static_cast<int>(args[1].asNumber());
5004
+ fabricFocusWindowRect = CGRectMake(args[2].asNumber(), args[3].asNumber(), args[4].asNumber(), args[5].asNumber());
5005
+ applyFabricFocus();
5006
+ return jsi::Value::undefined();
5007
+ });
5008
+ method("readOffsets", 0, [](jsi::Runtime &rt, const jsi::Value &, const jsi::Value *, size_t) -> jsi::Value {
5009
+ applyFabricFocus();
5010
+ std::vector<double> packed;
5011
+ packed.reserve(fabricViews.size() * 3 + 3);
5012
+ for (const auto &entry : fabricViews) {
5013
+ int tag = entry.first;
5014
+ UIView<RCTComponentViewProtocol> *componentView = [fabricRegistry componentViewDescriptorWithTag:tag].view;
5015
+ if (!componentView) continue;
5016
+ CALayer *shown = componentView.layer.presentationLayer;
5017
+ CGRect shownFrame = shown ? shown.frame : componentView.frame;
5018
+ double dx = shownFrame.origin.x - entry.second.layoutMetrics.frame.origin.x;
5019
+ double dy = shownFrame.origin.y - entry.second.layoutMetrics.frame.origin.y;
5020
+ packed.push_back(static_cast<double>(tag));
5021
+ packed.push_back(dx);
5022
+ packed.push_back(dy);
5023
+ }
5024
+ UIWindow *kw = UIApplication.sharedApplication.keyWindow ?: RCTKeyWindow();
5025
+ UIView *rootView = kw ? kw.rootViewController.viewIfLoaded : nil;
5026
+ CALayer *rootShown = rootView ? rootView.layer.presentationLayer : nil;
5027
+ CGRect rootFrame = rootShown ? rootShown.frame : (rootView ? rootView.frame : CGRectZero);
5028
+ packed.push_back(0.0);
5029
+ packed.push_back(rootFrame.origin.x);
5030
+ packed.push_back(rootFrame.origin.y);
5031
+ jsi::Array out(rt, packed.size());
5032
+ for (size_t i = 0; i < packed.size(); i++) {
5033
+ out.setValueAtIndex(rt, i, jsi::Value(packed[i]));
5034
+ }
5035
+ return out;
5036
+ });
5037
+ // the constants RCTLegacyUIManagerConstantsProvider gives a registered view
5038
+ // manager's name, which JS reads as UIManager.getViewManagerConfig(name)
5039
+ method("viewConfig", 1, [](jsi::Runtime &rt, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
5040
+ ${
5041
+ paper
5042
+ ? ` NSString *name = @(args[0].asString(rt).utf8(rt).c_str());
5043
+ for (Class moduleClass in RCTGetModuleClasses()) {
5044
+ if (![moduleClass isSubclassOfClass:RCTViewManager.class] || ![RCTViewManagerModuleNameForClass(moduleClass) isEqualToString:name])
5045
+ continue;
5046
+ NSDictionary *constants = RCTModuleConstantsForDestructuredComponent(
5047
+ [NSMutableDictionary new], [NSMutableDictionary new], moduleClass, name,
5048
+ [RCTComponentData viewConfigForViewMangerClass:moduleClass]);
5049
+ return react::TurboModuleConvertUtils::convertObjCObjectToJSIValue(rt, constants);
5050
+ }
5051
+ `
5052
+ : ''
5053
+ } return jsi::Value::null();
5054
+ });
3306
5055
  // the function React's dispatchEvent stands for: (instanceHandle, type, payload)
3307
5056
  method("setEventHandler", 1, [](jsi::Runtime &rt, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
3308
5057
  fabricEventHandler = args[0].asObject(rt).asFunction(rt);
@@ -3313,12 +5062,19 @@ void peachInstallFabricViews(jsi::Runtime &rt, std::shared_ptr<react::CallInvoke
3313
5062
 
3314
5063
  // the runtime's functions go before the runtime does
3315
5064
  void peachTeardownFabricViews() {
5065
+ if (fabricFocusField) {
5066
+ [fabricFocusField resignFirstResponder];
5067
+ [fabricFocusField removeFromSuperview];
5068
+ fabricFocusField = nil;
5069
+ }
5070
+ fabricFocusActive = false;
5071
+ fabricFocusParentTag = 0;
3316
5072
  fabricOwner.reset();
3317
5073
  fabricEventHandler.reset();
3318
5074
  }
3319
5075
 
3320
5076
  extern "C" void *peach_fabric_view_content(int tag) {
3321
- return (__bridge_retained void *)[fabricRegistry componentViewDescriptorWithTag:tag].view;
5077
+ return (__bridge_retained void *)fabricView(tag).slotView;
3322
5078
  }
3323
5079
 
3324
5080
  // the component names the host registers as views, newline separated