peachsim 0.1.2935 → 0.1.2937

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 (345) hide show
  1. package/LICENSE +6 -8
  2. package/cli/account-gate.ts +20 -3
  3. package/cli/app-bundle-resources.ts +66 -19
  4. package/cli/catalog/meta.ts +2 -106
  5. package/cli/command-agent.ts +7 -0
  6. package/cli/command-registry.ts +0 -1
  7. package/cli/commands/control.ts +13 -5
  8. package/cli/commands/daemon.ts +4 -2
  9. package/cli/commands/device.ts +78 -8
  10. package/cli/commands/do-chain.ts +11 -8
  11. package/cli/commands/inspect/core.ts +4 -9
  12. package/cli/commands/inspect/settling.ts +1 -0
  13. package/cli/commands/logout.ts +6 -1
  14. package/cli/commands/map.ts +2 -6
  15. package/cli/commands/package.ts +112 -57
  16. package/cli/commands/shell-url.ts +0 -1
  17. package/cli/download-auth.ts +2 -0
  18. package/cli/drivers/playwright-provisioning.ts +10 -38
  19. package/cli/github-workflow-identity.ts +8 -0
  20. package/cli/internal-child-contract.ts +1 -0
  21. package/cli/internal-child.ts +5 -0
  22. package/cli/main.ts +2 -10
  23. package/cli/outbound-endpoints.ts +26 -0
  24. package/detox/index.ts +227 -131
  25. package/dist-lib/agent-daemon-client.cjs +1 -1
  26. package/dist-lib/agent-events.cjs +1 -1
  27. package/dist-lib/attached-projects.cjs +1 -1
  28. package/dist-lib/auth/shared-session.cjs +1 -1
  29. package/dist-lib/backend-origin.cjs +1 -1
  30. package/dist-lib/beta.cjs +1 -1
  31. package/dist-lib/beta.mjs +2 -2
  32. package/dist-lib/bridge-constants.cjs +1 -1
  33. package/dist-lib/bridge-contract-input.cjs +47 -3
  34. package/dist-lib/bridge-contract-input.mjs +6 -6
  35. package/dist-lib/bridge-contract.cjs +10 -1
  36. package/dist-lib/bridge-contract.mjs +3 -3
  37. package/dist-lib/bundle-channel.cjs +12779 -9515
  38. package/dist-lib/capture-contract.cjs +39 -17
  39. package/dist-lib/capture-contract.mjs +3 -3
  40. package/dist-lib/cloud-contract.cjs +1 -1
  41. package/dist-lib/cloud-contract.mjs +3 -3
  42. package/dist-lib/cloud-test-args.cjs +1 -1
  43. package/dist-lib/cloud-test-args.mjs +2 -2
  44. package/dist-lib/cloud.cjs +1 -1
  45. package/dist-lib/cloud.mjs +8 -8
  46. package/dist-lib/config.cjs +1 -1
  47. package/dist-lib/config.mjs +6 -6
  48. package/dist-lib/detox/index.cjs +200 -132
  49. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  50. package/dist-lib/esm-chunks/{acorn-Q5TRRYSO.mjs → acorn-IIBLEO25.mjs} +3 -3
  51. package/dist-lib/esm-chunks/{chunk-UDWBTBVG.mjs → chunk-4FTPQKPT.mjs} +10 -1
  52. package/dist-lib/esm-chunks/chunk-4WIDTRBB.mjs +10232 -0
  53. package/dist-lib/esm-chunks/{chunk-LCMFYMT7.mjs → chunk-5QZOQ3NZ.mjs} +1 -1
  54. package/dist-lib/esm-chunks/{chunk-BJ2OGUX7.mjs → chunk-CIY67HNL.mjs} +39 -17
  55. package/dist-lib/esm-chunks/{chunk-SKQTNQYE.mjs → chunk-CQFEMJ64.mjs} +1 -1
  56. package/dist-lib/esm-chunks/{chunk-AXWVXRHX.mjs → chunk-CWVMCW23.mjs} +1 -1
  57. package/dist-lib/esm-chunks/{chunk-MTALOHQR.mjs → chunk-F6DZ4DS2.mjs} +1 -1
  58. package/dist-lib/esm-chunks/{chunk-I4R7IZRD.mjs → chunk-HJMF6O7L.mjs} +74 -46
  59. package/dist-lib/esm-chunks/chunk-I6T4PXJF.mjs +154 -0
  60. package/dist-lib/esm-chunks/{chunk-XWAUZKIA.mjs → chunk-IJU3JMWM.mjs} +1 -1
  61. package/dist-lib/esm-chunks/{chunk-CXWUIOCH.mjs → chunk-KODEPXQC.mjs} +4 -4
  62. package/dist-lib/esm-chunks/{chunk-WJE5QHSD.mjs → chunk-LD4K2VBL.mjs} +155 -36
  63. package/dist-lib/esm-chunks/{chunk-2TSM64HI.mjs → chunk-LTE7YMEG.mjs} +1 -1
  64. package/dist-lib/esm-chunks/{chunk-3GGOXUJA.mjs → chunk-M3CSKAJE.mjs} +1 -1
  65. package/dist-lib/esm-chunks/{chunk-7G5UETIG.mjs → chunk-NA6DJPB6.mjs} +43 -1
  66. package/dist-lib/esm-chunks/{chunk-MSUHMNAI.mjs → chunk-NNAX24FS.mjs} +1 -1
  67. package/dist-lib/esm-chunks/{chunk-VDJA4LP4.mjs → chunk-PZPJJBAS.mjs} +1 -1
  68. package/dist-lib/esm-chunks/{chunk-UEEEJVQA.mjs → chunk-QXSTHMWN.mjs} +1 -1
  69. package/dist-lib/esm-chunks/{chunk-S2RJB5I7.mjs → chunk-RBPVK5YI.mjs} +1 -1
  70. package/dist-lib/esm-chunks/{chunk-VRAXNGYT.mjs → chunk-SCT5OFDV.mjs} +1 -1
  71. package/dist-lib/esm-chunks/{chunk-T3M73LGP.mjs → chunk-U3CJGYSP.mjs} +50 -6
  72. package/dist-lib/esm-chunks/{chunk-SLUGTGQQ.mjs → chunk-VXTOQ522.mjs} +12 -6
  73. package/dist-lib/esm-chunks/{chunk-EL44SZMV.mjs → chunk-WMSVGYTH.mjs} +1 -1
  74. package/dist-lib/esm-chunks/{chunk-FEDEPSEV.mjs → chunk-WRWINRWK.mjs} +1 -1
  75. package/dist-lib/esm-chunks/{chunk-BNO52N2S.mjs → chunk-YZF2USRD.mjs} +1905 -8760
  76. package/dist-lib/esm-chunks/{chunk-TQLKYMVP.mjs → chunk-ZNHR6C3L.mjs} +1 -1
  77. package/dist-lib/esm-chunks/{download-auth-registry-G75MIT55.mjs → download-auth-registry-AHS5MSIB.mjs} +4 -4
  78. package/dist-lib/esm-chunks/{metro-layout-parser-FXLUDTYT.mjs → metro-layout-parser-24ZYK5UP.mjs} +3 -3
  79. package/dist-lib/esm-chunks/{swift-package-prebuilt-524D4MA2.mjs → swift-package-prebuilt-L4YNXQRD.mjs} +15 -15
  80. package/dist-lib/esm-chunks/{swift-sdk-app-module-EX544YJY.mjs → swift-sdk-app-module-RM652JSW.mjs} +87 -71
  81. package/dist-lib/esm-chunks/{swift-sdk-image-LOTMWVM7.mjs → swift-sdk-image-5PQ44UJT.mjs} +15 -15
  82. package/dist-lib/esm-chunks/{swift-sdk-image-producer-UO6B3M4U.mjs → swift-sdk-image-producer-GD3SM6YI.mjs} +5 -5
  83. package/dist-lib/esm-chunks/swift-sdk-later-data-62QYJ2KH.mjs +590 -0
  84. package/dist-lib/expo-swift-bundle.cjs +21037 -17896
  85. package/dist-lib/expo-swift-metadata.cjs +8 -2
  86. package/dist-lib/expo-swift-metadata.mjs +9 -8
  87. package/dist-lib/home-paths.cjs +1 -1
  88. package/dist-lib/host/bridge-host.cjs +22481 -18741
  89. package/dist-lib/host/fetch-proxy-handler.cjs +21079 -17980
  90. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  91. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  92. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  93. package/dist-lib/host/websocket-proxy.cjs +1 -1
  94. package/dist-lib/index.cjs +68 -38
  95. package/dist-lib/kotlin-host.cjs +97 -21
  96. package/dist-lib/menu.cjs +1 -1
  97. package/dist-lib/menu.mjs +3 -3
  98. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  99. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  100. package/dist-lib/metro-production-bundle.cjs +23 -1
  101. package/dist-lib/metro-production-bundle.mjs +24 -4
  102. package/dist-lib/native-app-identity-project.cjs +3582 -571
  103. package/dist-lib/native-app-identity-project.mjs +1024 -398
  104. package/dist-lib/native-app-identity.cjs +1 -1
  105. package/dist-lib/native-app-identity.mjs +6 -6
  106. package/dist-lib/native-firebase-metadata.cjs +1 -1
  107. package/dist-lib/native-firebase-metadata.mjs +3 -3
  108. package/dist-lib/pdfium-raster.cjs +1 -1
  109. package/dist-lib/pdfium-raster.mjs +2 -2
  110. package/dist-lib/plist.cjs +1 -1
  111. package/dist-lib/plist.mjs +3 -3
  112. package/dist-lib/profiles.cjs +1 -1
  113. package/dist-lib/public-brand.cjs +1 -1
  114. package/dist-lib/public-origins-lib-esm.json +132 -116
  115. package/dist-lib/public-origins-lib.json +215 -173
  116. package/dist-lib/react-native-host-modules.cjs +1 -1
  117. package/dist-lib/react-native-host-modules.mjs +2 -2
  118. package/dist-lib/reap-browser.cjs +17 -1
  119. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  120. package/dist-lib/sdk.cjs +6 -7
  121. package/dist-lib/sdk.mjs +13 -14
  122. package/dist-lib/skills.cjs +23216 -19650
  123. package/dist-lib/swift-compile.cjs +4337 -2905
  124. package/dist-lib/swift-compile.mjs +15 -13
  125. package/dist-lib/swift-package.cjs +1 -1
  126. package/dist-lib/swift-package.mjs +3 -3
  127. package/dist-lib/swift-submit.cjs +1 -1
  128. package/dist-lib/swift-submit.mjs +6 -6
  129. package/dist-lib/swift-svg-raster.cjs +1 -1
  130. package/dist-lib/swift-svg-raster.mjs +2 -2
  131. package/dist-lib/swift-toolchain.cjs +19 -1
  132. package/dist-lib/swift.cjs +1 -1
  133. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  134. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  135. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  136. package/dist-lib/vendor/acorn.cjs +1 -1
  137. package/dist-lib/vendor/stream-json.cjs +1 -1
  138. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  139. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  140. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  141. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  142. package/dist-lib/vendor/sucrase.cjs +1 -1
  143. package/dist-lib/vendor/terser.cjs +1 -1
  144. package/dist-lib/vendor/valibot.cjs +1 -1
  145. package/dist-lib/vendor/ws.cjs +94 -32
  146. package/dist-lib/vendor/zod.cjs +1 -1
  147. package/dist-lib/worklet-executable.cjs +8 -5
  148. package/dist-lib/worklet-executable.mjs +9 -6
  149. package/dist-types/packages/peach-engine/src/canvaskit-artifact-urls.d.ts +2 -1
  150. package/dist-types/packages/peach-engine/src/capture/compositor-presentation-recording.d.ts +1 -0
  151. package/dist-types/packages/peach-engine/src/engine/generated/canvaskit-artifact-hashes.d.ts +26 -0
  152. package/dist-types/packages/peach-engine/src/engine/guest-scene-inspect.d.ts +1 -1
  153. package/dist-types/packages/peach-engine/src/engine/inspect-info.d.ts +1 -0
  154. package/dist-types/packages/peach-engine/src/engine/metalTypes.d.ts +32 -2
  155. package/dist-types/packages/peach-engine/src/engine/portalContract.d.ts +24 -0
  156. package/dist-types/packages/peach-engine/src/engine/remote-display-protocol.d.ts +12 -2
  157. package/dist-types/packages/peach-engine/src/guest/http-cookie-storage.d.ts +73 -0
  158. package/dist-types/packages/peach-engine/src/guest/native-evaluation-lease.d.ts +5 -0
  159. package/dist-types/packages/peach-engine/src/guest/nitro-jsi-host.d.ts +3 -1
  160. package/dist-types/packages/peach-engine/src/ios/apps/canvas-map-data.d.ts +225 -9
  161. package/dist-types/packages/peach-engine/src/ios/chrome-metrics.d.ts +4 -1
  162. package/dist-types/packages/peach-engine/src/ios/duo-vertical-bar-geometry.d.ts +0 -1
  163. package/dist-types/packages/peach-engine/src/native-preview-bundle.d.ts +1 -0
  164. package/dist-types/packages/peach-engine/src/remote-stream/canvas-display-compositor.d.ts +1 -0
  165. package/dist-types/packages/peach-engine/src/remote-stream/canvas-display-contract.d.ts +44 -10
  166. package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +4 -3
  167. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +2 -4
  168. package/dist-types/packages/peach-engine/src/render-worker/metro-bundle-metadata.d.ts +2 -0
  169. package/dist-types/packages/peach-engine/src/render-worker/native-widgetContract.d.ts +1 -1
  170. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +15 -27
  171. package/dist-types/packages/peach-engine/src/render-worker/reanimated-readiness.d.ts +2 -6
  172. package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +11 -3
  173. package/dist-types/packages/peach-engine/src/settings/devices.d.ts +3 -1
  174. package/dist-types/packages/peach-engine/src/settings/duo-fold.d.ts +1 -1
  175. package/dist-types/packages/peach-engine/src/webview-automation-host.d.ts +1 -1
  176. package/dist-types/packages/peach-globals/src/app-bundle-resources.d.ts +10 -0
  177. package/dist-types/packages/peach-globals/src/compositorBridgeContract.d.ts +1 -1
  178. package/dist-types/packages/peach-globals/src/hostStorageBridgeContract.d.ts +1 -0
  179. package/dist-types/packages/peach-globals/src/index.d.ts +2 -2
  180. package/dist-types/packages/peach-globals/src/lockstepCaptureBridgeContract.d.ts +9 -6
  181. package/dist-types/packages/peach-globals/src/nodeContract.d.ts +11 -0
  182. package/dist-types/packages/peach-globals/src/oneWidgetContract.d.ts +28 -0
  183. package/package.json +2 -2
  184. package/runtime-companion.json +1 -1
  185. package/sdk/ios/System/Library/Frameworks/CoreHaptics.framework/Headers/CoreHaptics.h +251 -0
  186. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INImage.h +14 -0
  187. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntent.h +18 -0
  188. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntentIdentifiers.h +30 -0
  189. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntentResponse.h +12 -0
  190. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INInteraction.h +35 -0
  191. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectCollection.h +0 -7
  192. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectSection.h +0 -7
  193. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INOutgoingMessageType.h +7 -0
  194. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INPerson.h +36 -0
  195. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INPersonHandle.h +22 -0
  196. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSendMessageIntent+UserNotifications.h +6 -0
  197. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSendMessageIntent.h +33 -0
  198. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSpeakableString.h +24 -0
  199. package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/Intents.h +11 -7
  200. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeViewController.h +1 -1
  201. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController.h +1 -1
  202. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderCommandEncoder.h +0 -8
  203. package/sdk/ios/System/Library/Frameworks/MetalTypes.framework/Headers/MetalTypes.h +8 -0
  204. package/sdk/ios/System/Library/Frameworks/Social.framework/Headers/SLServiceTypes.h +9 -0
  205. package/sdk/ios/System/Library/Frameworks/Social.framework/Headers/Social.h +1 -0
  206. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotification.h +1 -1
  207. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAction.h +2 -2
  208. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAttachment.h +1 -1
  209. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationCategory.h +1 -1
  210. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationContent.h +2 -2
  211. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationRequest.h +1 -1
  212. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationResponse.h +2 -2
  213. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationSound.h +1 -1
  214. package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationTrigger.h +5 -5
  215. package/sdk/ios/usr/lib/swift/UIKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
  216. package/sdk/ios/wasm/include/unistd.h +1 -0
  217. package/src/acorn-program.ts +3 -0
  218. package/src/audio-codec-archives.ts +141 -0
  219. package/src/bridge-contract-input.ts +61 -1
  220. package/src/bridge-contract.ts +45 -4
  221. package/src/bundle-channel.mjs +44 -30
  222. package/src/capture-contract.ts +57 -39
  223. package/src/conformance-comparison-contract.ts +2 -0
  224. package/src/expo-discovery-cache.ts +0 -2
  225. package/src/expo-macro-host.ts +8 -3
  226. package/src/expo-native-compiler-digest.ts +0 -1
  227. package/src/expo-native-prebuilt.ts +1 -1
  228. package/src/expo-native-workspace.ts +83 -45
  229. package/src/expo-pod-prebuilt.ts +1 -0
  230. package/src/expo-swift-host.ts +158 -77
  231. package/src/expo-swift-legacy-runtime-source.ts +12 -1
  232. package/src/expo-swift-view-source.ts +51 -20
  233. package/src/expo-workspace-exclusion.ts +7 -1
  234. package/src/expoSwiftContract.ts +10 -1
  235. package/src/ffmpeg-source-build.ts +123 -59
  236. package/src/genrule-archives.ts +7 -2
  237. package/src/genrule-library-builds.ts +101 -18
  238. package/src/host/bridge-host.ts +10 -1
  239. package/src/installed-native-libraries.ts +147 -23
  240. package/src/installed-package-versions.ts +30 -0
  241. package/src/ios-rn-bundle-request.ts +3 -1
  242. package/src/ios-rn-bundle.ts +38 -27
  243. package/src/ios-rn-compile.ts +23 -6
  244. package/src/ios-rn-startup.ts +2 -1
  245. package/src/java-module-abi.ts +4 -3
  246. package/src/kotlin-host.ts +4 -4
  247. package/src/kotlin-library-sources.ts +8 -5
  248. package/src/metro-production-bundle.ts +24 -0
  249. package/src/native-firebase-config.ts +2 -0
  250. package/src/native-framework-compiler.ts +5 -0
  251. package/src/native-package-slice-build.ts +3 -0
  252. package/src/native-package-slice.ts +15 -10
  253. package/src/native-preparation.ts +4 -1
  254. package/src/native-static-libraries.ts +107 -33
  255. package/src/nativeRuntimePackageIndex.ts +1 -4
  256. package/src/nitro-adapter.lock.json +286 -286
  257. package/src/nitro-app-providers.ts +20 -8
  258. package/src/nitro-compile.ts +131 -37
  259. package/src/nitro-dependencies.ts +42 -8
  260. package/src/nitro-source.ts +40 -36
  261. package/src/nitro-superset.lock.json +4 -4
  262. package/src/nitroAdapterContract.ts +32 -7
  263. package/src/nitroContract.ts +21 -37
  264. package/src/one-direct-host-source.ts +247 -140
  265. package/src/one-fabric.ts +129 -0
  266. package/src/one-native-controls-package.ts +95 -21
  267. package/src/one-native-controls-release.ts +147 -14
  268. package/src/one-native-source.ts +4 -1
  269. package/src/one-nitro-inputs.ts +1 -1
  270. package/src/one-nitro-source.ts +45 -1
  271. package/src/one-sdk/source.ts +10 -41
  272. package/src/one-widget-metadata.ts +2 -2
  273. package/src/one-widget-package.ts +1 -1
  274. package/src/oneSdkContract.ts +3 -0
  275. package/src/playwright-browser-paths.ts +30 -0
  276. package/src/pods-install.ts +6 -2
  277. package/src/pods-post-install.ts +2 -2
  278. package/src/pods-project.ts +10 -0
  279. package/src/podspec-ruby-stdlib.ts +73 -0
  280. package/src/podspec-ruby.ts +1 -1
  281. package/src/podspec-sources.ts +31 -13
  282. package/src/process-group.ts +135 -5
  283. package/src/published-swift-sdk.ts +25 -1
  284. package/src/react-native-bridge-modules.ts +35 -3
  285. package/src/react-native-core-build.ts +14 -2
  286. package/src/react-native-core.ts +12 -2
  287. package/src/rive-runtime-dependencies.ts +178 -40
  288. package/src/serverDiscoveryContract.ts +1 -1
  289. package/src/storageSnapshotContract.ts +1 -1
  290. package/src/swift-app-data-store.ts +35 -0
  291. package/src/swift-compile.ts +403 -121
  292. package/src/swift-compiler-digest.ts +4 -0
  293. package/src/swift-darwin-records.ts +6 -0
  294. package/src/swift-distribution-mirror.ts +10 -1
  295. package/src/swift-distribution.lock.json +19 -18
  296. package/src/swift-distribution.ts +17 -1
  297. package/src/swift-entry-module.ts +1 -0
  298. package/src/swift-guest-compile.ts +8 -1
  299. package/src/swift-host.ts +79 -23
  300. package/src/swift-installed-targets.ts +51 -20
  301. package/src/swift-objc-standin.ts +60 -8
  302. package/src/swift-packages.ts +104 -24
  303. package/src/swift-project-user.ts +2 -1
  304. package/src/swift-reproducible.ts +99 -1
  305. package/src/swift-root-lock.ts +52 -46
  306. package/src/swift-sdk-app-module.ts +65 -13
  307. package/src/swift-sdk-image-producer.ts +2 -1
  308. package/src/swift-sdk-image.ts +23 -8
  309. package/src/swift-sdk-later-data.ts +294 -44
  310. package/src/swift-sdk-surface.ts +233 -55
  311. package/src/swift-shared-sdk.ts +7 -0
  312. package/src/swift-standin-builtin-behavior.ts +18 -0
  313. package/src/swift-standin-emit.ts +242 -54
  314. package/src/swift-standins.ts +184 -38
  315. package/src/swift-startup-split.ts +19 -9
  316. package/src/swift-toolchain.ts +18 -0
  317. package/src/swift-wasm-prune.ts +179 -9
  318. package/src/swift-xcframework.ts +16 -0
  319. package/src/swiftContract.ts +4 -1
  320. package/src/swiftSdkLinkContract.ts +2 -0
  321. package/src/swiftTargetContract.ts +1 -0
  322. package/src/turbo-bundle.ts +6 -3
  323. package/src/turbo-codegen-intake.ts +106 -16
  324. package/src/turbo-compile.ts +89 -68
  325. package/src/turbo-fabric-app.ts +287 -23
  326. package/src/turbo-provider-host.ts +122 -31
  327. package/src/turbo-runtime.lock.json +26 -26
  328. package/src/turbo-source.ts +374 -157
  329. package/src/vite-plugin.ts +48 -112
  330. package/src/wasm-binary-sections.ts +40 -0
  331. package/src/wasm-code-immediates.ts +35 -5
  332. package/src/widget-extension-bundle.ts +15 -1
  333. package/src/worklet-executable.ts +2 -1
  334. package/src/worklet-kernel.ts +5 -3
  335. package/src/worklets-babel.ts +2 -1
  336. package/src/xcode-project.ts +151 -53
  337. package/src/xcode-scheme-actions.ts +104 -0
  338. package/cli/commands/canvas.ts +0 -1204
  339. package/dist-lib/esm-chunks/chunk-B5QD2KEV.mjs +0 -2787
  340. package/dist-lib/vendor/magic-string.cjs +0 -1693
  341. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +0 -127
  342. package/src/appBundleResourcesContract.ts +0 -51
  343. package/src/canvas-groups.ts +0 -28
  344. package/src/canvas-map-layout.ts +0 -161
  345. package/src/oneWidgetContract.ts +0 -134
@@ -1,10 +1,13 @@
1
1
  export const FABRIC_APP_INCLUDES = `#import <Block.h>
2
+ #import <objc/runtime.h>
2
3
  #import <React/RCTBridgeModule.h>
3
4
  #import <React/RCTBackedTextInputViewProtocol.h>
4
5
  #import <React/RCTConversions.h>
5
6
  #import <React/RCTTextInputComponentView.h>
6
7
  #import <React/RCTFabricSurface.h>
8
+ #import <React/RCTFollyConvert.h>
7
9
  #import <React/RCTSurfaceView.h>
10
+ #import <React/RCTSurfaceTouchHandler.h>
8
11
  #import <React/RCTScheduler.h>
9
12
  #import <React/RCTMountingManager.h>
10
13
  #import <React/RCTUtils.h>
@@ -22,8 +25,24 @@ export const FABRIC_APP_INCLUDES = `#import <Block.h>
22
25
  #include <react/renderer/uimanager/UIManagerBinding.h>
23
26
  `
24
27
 
25
- export const fabricAppPresenterSource = (hasCommitSource: boolean) => `
26
- namespace {
28
+ export const fabricAppPresenterSource = (
29
+ hasCommitSource: boolean,
30
+ paperTextInputs: boolean,
31
+ ) => `${
32
+ paperTextInputs
33
+ ? `
34
+ #import <React/RCTBaseTextInputShadowView.h>
35
+ #import <React/RCTBaseTextInputView.h>
36
+ #import <React/RCTComponentData.h>
37
+ #import <React/RCTEventDispatcherProtocol.h>
38
+ #import <React/RCTRawTextShadowView.h>
39
+ #import <React/RCTRawTextViewManager.h>
40
+ #import <React/RCTVirtualTextShadowView.h>
41
+ #import <React/RCTVirtualTextViewManager.h>
42
+ #include <react/utils/ManagedObjectWrapper.h>`
43
+ : ''
44
+ }
45
+ namespace {${paperTextInputs ? '\nextern std::unordered_map<std::string, Class> fabricPaperManagers;' : ''}
27
46
  std::shared_ptr<react::ShadowNode> createCompiledAppNode(const react::UIManager &manager,
28
47
  int compiled, react::Tag tag, react::SurfaceId surface, const folly::dynamic &props,
29
48
  const react::InstanceHandle::Shared &handle);
@@ -34,6 +53,10 @@ extern std::shared_ptr<react::CallInvoker> fabricInvoker;
34
53
  extern std::shared_ptr<react::RuntimeScheduler> fabricScheduler;
35
54
  }
36
55
 
56
+ @interface UIGestureRecognizer (PeachMountedCancellation)
57
+ - (void)_peachForwardCancellation;
58
+ @end
59
+
37
60
  @interface UIView (PeachMountedInput)
38
61
  + (void)_peachObserveGestureOwners:(void (^)(UIView *))observer;
39
62
  + (uint64_t)_peachUpdateMountedInput:(UIView *)view reference:(uint64_t)reference;
@@ -135,6 +158,8 @@ class RNAppShadowTree {
135
158
  presenter_.mountingManager.componentViewRegistry = registry;
136
159
  __weak RNAppViewRegistry *weakRegistry = registry;
137
160
  [UIView _peachObserveGestureOwners:^(UIView *changed) {
161
+ for (UIGestureRecognizer *recognizer in changed.gestureRecognizers)
162
+ if ([recognizer isKindOfClass:[RCTSurfaceTouchHandler class]]) [recognizer _peachForwardCancellation];
138
163
  RNAppViewRegistry *owner = weakRegistry;
139
164
  if (!owner) return;
140
165
  for (UIView *view = changed; view; view = view.superview) {
@@ -165,10 +190,32 @@ class RNAppShadowTree {
165
190
  auto *registry = (RNAppViewRegistry *)presenter_.mountingManager.componentViewRegistry;
166
191
  if (auto input = registry->inputs.extract(tag); !input.empty())
167
192
  [UIView _peachUpdateMountedInput:nil reference:input.mapped()];
193
+ if (const auto entry = instances_.find(tag); entry != instances_.end())
194
+ setChildPlacements(entry->second, 0, {}, registry);
168
195
  nodes_.erase(tag);
169
196
  instances_.erase(tag);
170
197
  }
171
198
 
199
+ void updatePaperView(NSNumber *reactTag, NSDictionary *updates) {
200
+ const auto tag = reactTag.intValue;
201
+ const auto found = nodes_.find(tag);
202
+ if (found == nodes_.end()) return;
203
+ auto *registry = (RNAppViewRegistry *)presenter_.mountingManager.componentViewRegistry;
204
+ auto *view = [registry projectedViewWithTag:tag];
205
+ if (!view) return;
206
+ const auto previous = [view props];
207
+ [presenter_ synchronouslyUpdateViewOnUIThread:reactTag props:updates];
208
+ const auto updated = [view props];
209
+ if (updated == previous) return;
210
+ auto &native = instances_.at(tag).paperProps;
211
+ if (native && native != previous) {
212
+ native = found->second->getComponentDescriptor().cloneProps({surface_, *fabricContext}, native,
213
+ react::RawProps(react::convertIdToFollyDynamic(updates)));
214
+ } else {
215
+ native = updated;
216
+ }
217
+ }
218
+
172
219
  void commit(react::SurfaceId surface, double width, double height, double scale, bool rtl,
173
220
  const std::vector<uint8_t> &bytes) {
174
221
  react::LayoutConstraints constraints;
@@ -243,6 +290,10 @@ class RNAppShadowTree {
243
290
  };
244
291
  for (auto it = rows.rbegin(); it != rows.rend(); ++it) {
245
292
  auto &instance = instances_.at(it->tag);
293
+ if (instance.parent != it->parent) {
294
+ instance.detached = false;
295
+ instance.mountedOffset = CGPointZero;
296
+ }
246
297
  instance.parent = it->parent;
247
298
  auto children = childrenOf(it->children);
248
299
  const auto previous = nodes_.find(it->tag);
@@ -253,8 +304,14 @@ class RNAppShadowTree {
253
304
  diff = initial ? props : react::diffDynamicProps(instance.props, props);
254
305
  instance.props = std::move(props);
255
306
  }
307
+ // paper updates individual props, and a fabric mount replaces the view's entire props snapshot.
308
+ if (!initial && instance.paperProps && !diff.empty()) {
309
+ instance.paperProps = previous->second->getComponentDescriptor().cloneProps(
310
+ {surface_, *fabricContext}, instance.paperProps, react::RawProps(diff));
311
+ }
256
312
  AppNode view;
257
313
  if (initial) {
314
+ instance.paperProps.reset();
258
315
  const auto *marker = instance.props.get_ptr("__peachFabricHost");
259
316
  instance.compiled = marker && marker->isNumber() ? int(marker->asDouble()) : 0;
260
317
  auto created = instance.compiled
@@ -262,10 +319,13 @@ class RNAppShadowTree {
262
319
  : manager_->createNode(it->tag, instance.component, surface_, react::RawProps(instance.props), instance.handle);
263
320
  for (const auto &child : *children) manager_->appendChild(created, child);
264
321
  view = std::move(created);
265
- } else if (diff.empty() && previous->second->getChildren() == *children) {
266
- view = previous->second;
267
322
  } else {
268
- view = manager_->cloneNode(*previous->second, children, react::RawProps(std::move(diff)));
323
+ const bool sameProps = diff.empty();
324
+ const bool sameChildren = previous->second->getChildren() == *children;
325
+ view = sameProps && sameChildren
326
+ ? previous->second
327
+ : manager_->cloneNode(*previous->second, sameChildren ? nullptr : children,
328
+ sameProps ? react::RawProps{} : react::RawProps(std::move(diff)));
269
329
  }
270
330
  next.emplace(it->tag, std::move(view));
271
331
  }
@@ -288,15 +348,65 @@ class RNAppShadowTree {
288
348
  auto *registry = (RNAppViewRegistry *)presenter_.mountingManager.componentViewRegistry;
289
349
  std::unordered_set<react::Tag> changed;
290
350
  changed.swap(registry->touched);
351
+ // a compiled parent that mounts some of its children into its own UIKit tree and
352
+ // leaves others out, as a page view controller does with its offscreen pages,
353
+ // does not display those children, nor does a text input that takes its children as text
354
+ for (auto &[tag, entry] : instances_) {
355
+ if (!entry.compiled) continue;
356
+ const auto found = nodes_.find(tag);
357
+ UIView *component = mountedFabricView([registry projectedViewWithTag:tag]);
358
+ if (found == nodes_.end() || !component) continue;
359
+ ${paperTextInputs ? 'const bool consumesText = syncPaperTextInput(tag, entry, found->second, [registry projectedViewWithTag:tag]);' : 'constexpr bool consumesText = false;'}
360
+ const auto host = fabricContentHosts.find(tag);
361
+ UIView *content = host == fabricContentHosts.end() ? nil : host->second;
362
+ const auto &children = found->second->getChildren();
363
+ bool mounts = false;
364
+ for (const auto &child : children) {
365
+ UIView *view = mountedFabricView([registry projectedViewWithTag:child->getTag()]);
366
+ if (view && [view isDescendantOfView:component]) {
367
+ mounts = true;
368
+ break;
369
+ }
370
+ }
371
+ for (const auto &child : children) {
372
+ auto instance = instances_.find(child->getTag());
373
+ if (instance == instances_.end()) continue;
374
+ auto &mounted = instance->second;
375
+ UIView *view = mountedFabricView([registry projectedViewWithTag:child->getTag()]);
376
+ const bool inComponent = [view isDescendantOfView:component];
377
+ const bool detached = consumesText || (mounts && view && !inComponent);
378
+ CGPoint offset = CGPointZero;
379
+ if (content && view.superview == content && !mounted.compiled) {
380
+ auto current = manager_->getNewestCloneOfShadowNode(*child);
381
+ const auto *node = dynamic_cast<const react::LayoutableShadowNode *>(current.get());
382
+ if (node) {
383
+ // a native container can place an authored child in its own coordinate space.
384
+ const auto frame = node->getLayoutMetrics().frame;
385
+ const auto size = view.bounds.size;
386
+ const auto position = view.layer.position;
387
+ const auto anchor = view.layer.anchorPoint;
388
+ offset = {position.x - size.width * anchor.x - frame.origin.x,
389
+ position.y - size.height * anchor.y - frame.origin.y};
390
+ }
391
+ }
392
+ if (mounted.detached == detached && CGPointEqualToPoint(mounted.mountedOffset, offset)) continue;
393
+ mounted.detached = detached;
394
+ mounted.mountedOffset = offset;
395
+ changed.insert(child->getTag());
396
+ }
397
+ }
291
398
  for (const auto tag : changed) {
292
399
  const auto found = nodes_.find(tag);
293
400
  if (found == nodes_.end()) continue;
294
401
  const auto &authored = found->second;
295
402
  auto *view = [registry projectedViewWithTag:tag];
296
- const auto props = view ? [view props] : react::Props::Shared{};
403
+ auto &entry = instances_.at(tag);
404
+ const auto props = view ? (entry.paperProps ? entry.paperProps : [view props]) : react::Props::Shared{};
297
405
  const auto *actual = dynamic_cast<const react::BaseViewProps *>(props.get());
298
406
  const auto *base = dynamic_cast<const react::BaseViewProps *>(authored->getProps().get());
299
- auto &entry = instances_.at(tag);
407
+ const bool placedChild = entry.placementOwner != 0;
408
+ if (placedChild) markFabricChildPlacement(tag, entry.placementOwner, view);
409
+ const bool placementChanged = std::exchange(entry.placedChild, placedChild) != placedChild;
300
410
  std::optional<folly::dynamic> drawing;
301
411
  if (entry.compiled) {
302
412
  auto current = manager_->getNewestCloneOfShadowNode(*authored);
@@ -308,9 +418,32 @@ class RNAppShadowTree {
308
418
  const auto parent = instances_.find(entry.parent);
309
419
  const auto owner = projectCompiledPeer(entry.compiled, view, *layout,
310
420
  parent != instances_.end() && parent->second.compiled);
311
- if (owner) tagFabricContentHost(tag, owner, view, authored->getChildren(), [registry](const AppNode &child) {
312
- return [registry projectedViewWithTag:child->getTag()];
313
- });
421
+ if (owner) {
422
+ std::unordered_set<react::Tag> childPlacements;
423
+ std::vector<std::pair<react::Tag, UIView *>> mountedChildren;
424
+ auto collectMountedChildren = [&](auto &&collect, const react::ShadowNode &node) -> void {
425
+ if (auto *child = [registry projectedViewWithTag:node.getTag()]) {
426
+ mountedChildren.emplace_back(node.getTag(), child);
427
+ return;
428
+ }
429
+ for (const auto &child : node.getChildren()) collect(collect, *child);
430
+ };
431
+ // fabric can mount a layout-only child's descendants directly in this component.
432
+ for (const auto &child : current->getChildren()) collectMountedChildren(collectMountedChildren, *child);
433
+ // per-child hosts can move or detach between layout passes without a fabric unmount.
434
+ const bool hasChildPlacements = entry.placementHost == owner && !entry.childPlacements.empty();
435
+ if (hasChildPlacements ||
436
+ !tagFabricContentHost(tag, owner, view, mountedChildren, [](const auto &child) { return child.second; })) {
437
+ for (const auto &[childTag, child] : mountedChildren) {
438
+ const auto childEntry = instances_.find(childTag);
439
+ if (childEntry != instances_.end() && !childEntry->second.compiled &&
440
+ (childEntry->second.placementOwner == owner ||
441
+ !child.superview || [child.superview isDescendantOfView:view]))
442
+ childPlacements.insert(childTag);
443
+ }
444
+ }
445
+ setChildPlacements(entry, owner, std::move(childPlacements), registry);
446
+ }
314
447
  const bool box = metrics.displayType == react::DisplayType::Contents;
315
448
  if (box || entry.projectedFrame) {
316
449
  const auto &frame = metrics.frame;
@@ -344,7 +477,14 @@ class RNAppShadowTree {
344
477
  } else {
345
478
  entry.displayedText.reset();
346
479
  }
347
- if (!drawing && !inputChanged && !changedText && entry.mounted == props && entry.authored == authored->getProps() && CGSizeEqualToSize(entry.size, size)) continue;
480
+ const bool detached = entry.detached && !placedChild;
481
+ const auto offset = placedChild ? CGPointZero : entry.mountedOffset;
482
+ const bool offsetChanged = !CGPointEqualToPoint(offset, entry.projectedOffset);
483
+ if (!drawing && !inputChanged && !changedText && !placementChanged && !offsetChanged && entry.mounted == props &&
484
+ detached == entry.detachedProjected && entry.authored == authored->getProps() &&
485
+ CGSizeEqualToSize(entry.size, size)) continue;
486
+ entry.detachedProjected = detached;
487
+ entry.projectedOffset = offset;
348
488
  entry.size = size;
349
489
  entry.mounted = props;
350
490
  entry.authored = authored->getProps();
@@ -430,17 +570,18 @@ class RNAppShadowTree {
430
570
  radius("borderEndStartRadius", &R::endStart);
431
571
  radius("borderEndEndRadius", &R::endEnd);
432
572
  }
433
- if (actual->transform != base->transform || actual->transformOrigin != base->transformOrigin) {
434
- react::LayoutMetrics metrics;
435
- metrics.frame.size = {static_cast<react::Float>(view.bounds.size.width), static_cast<react::Float>(view.bounds.size.height)};
436
- const auto transform = actual->resolveTransform(metrics);
437
- auto matrix = folly::dynamic::array();
438
- for (const auto v : transform.matrix) matrix.push_back(v);
439
- paint["transform"] = folly::dynamic::array(folly::dynamic::object("matrix", std::move(matrix)));
440
- }
441
573
  }
442
- const bool active = !layout.empty() || !paint.empty();
443
- if (!active && !entry.projected && !changedText && !inputChanged && !drawing) continue;
574
+ const bool translated = !CGPointEqualToPoint(offset, CGPointZero);
575
+ if (actual && base && (translated || actual->transform != base->transform || actual->transformOrigin != base->transformOrigin)) {
576
+ react::LayoutMetrics metrics;
577
+ metrics.frame.size = {static_cast<react::Float>(size.width), static_cast<react::Float>(size.height)};
578
+ const auto transform = react::Transform::Translate(offset.x, offset.y, 0) * actual->resolveTransform(metrics);
579
+ auto matrix = folly::dynamic::array();
580
+ for (const auto v : transform.matrix) matrix.push_back(v);
581
+ paint["transform"] = folly::dynamic::array(folly::dynamic::object("matrix", std::move(matrix)));
582
+ }
583
+ const bool active = !layout.empty() || !paint.empty() || detached;
584
+ if (!active && !entry.projected && !changedText && !inputChanged && !drawing && !placementChanged) continue;
444
585
  entry.projected = active;
445
586
  folly::dynamic projected = folly::dynamic::object("layout", std::move(layout))("paint", std::move(paint));
446
587
  if (drawing) projected["drawing"] = std::move(*drawing);
@@ -449,9 +590,18 @@ class RNAppShadowTree {
449
590
  FabricProjectionRow row{};
450
591
  row.tag = tag;
451
592
  row.kind = 1;
593
+ // a view its compiled parent left out of the window keeps its frame but is not drawn or hit
594
+ row.hidden = placedChild || detached;
452
595
  row.packet = {uint32_t(reinterpret_cast<uintptr_t>(packet.data())), uint32_t(packet.size()), inputReference};
453
596
  rows.push_back(row);
454
597
  }
598
+ // contacts are converted against this projection until the next one is published.
599
+ if (!rows.empty()) {
600
+ for (const auto &[tag, reference] : registry->inputs) {
601
+ if (auto *view = [registry projectedViewWithTag:tag])
602
+ [UIView _peachUpdateMountedInput:view reference:reference];
603
+ }
604
+ }
455
605
  }
456
606
 
457
607
  private:
@@ -473,15 +623,113 @@ class RNAppShadowTree {
473
623
  react::InstanceHandle::Shared handle;
474
624
  std::string component;
475
625
  folly::dynamic props = folly::dynamic::object();
476
- react::Props::Shared mounted, authored;
626
+ react::Props::Shared mounted, authored, paperProps;
477
627
  CGSize size{};
628
+ CGPoint mountedOffset{}, projectedOffset{};
478
629
  bool projected = false;
630
+ bool detached = false;
631
+ bool detachedProjected = false;
632
+ bool placedChild = false;
479
633
  int compiled = 0;
480
634
  react::Tag parent = 0;
481
635
  std::optional<react::Rect> projectedFrame;
482
636
  uint64_t inputReference = 0;
483
- std::optional<std::string> displayedText;
637
+ uint64_t placementOwner = 0, placementHost = 0;
638
+ std::unordered_set<react::Tag> childPlacements;
639
+ std::optional<std::string> displayedText;${
640
+ paperTextInputs
641
+ ? `
642
+ RCTBaseTextInputShadowView *textShadow = nil;
643
+ AppNode textSource;
644
+ folly::dynamic textProps = folly::dynamic::object();`
645
+ : ''
646
+ }
484
647
  };
648
+ ${
649
+ paperTextInputs
650
+ ? `
651
+ // paper keeps an RCTBaseTextInputShadowView for each text input: its manager's shadow
652
+ // props become the input's text attributes, and its text children become the attributed
653
+ // text the view shows, handed over as the UI manager mounts. the bridgeless core runs no
654
+ // shadow views, so the app's own shadow view is driven here from the committed tree
655
+ bool syncPaperTextInput(react::Tag tag, Instance &entry, const AppNode &authored, UIView *component) {
656
+ if (![component isKindOfClass:[RCTLegacyViewManagerInteropComponentView class]]) return false;
657
+ UIView *view = ((RCTLegacyViewManagerInteropComponentView *)component).contentView;
658
+ if (![view isKindOfClass:[RCTBaseTextInputView class]]) return false;
659
+ if (entry.textSource == authored) return true;
660
+ const auto current = manager_->getNewestCloneOfShadowNode(*authored);
661
+ const auto *layout = dynamic_cast<const react::LayoutableShadowNode *>(current.get());
662
+ if (!layout) return true;
663
+ entry.textSource = authored;
664
+ if (!paperBridge_) {
665
+ paperBridge_ = react::unwrapManagedObject(*fabricContext->find<std::shared_ptr<void>>("RCTBridgeProxy"));
666
+ virtualText_ = [[RCTComponentData alloc] initWithManagerClass:[RCTVirtualTextViewManager class]
667
+ bridge:paperBridge_
668
+ eventDispatcher:paperBridge_.eventDispatcher];
669
+ rawText_ = [[RCTComponentData alloc] initWithManagerClass:[RCTRawTextViewManager class]
670
+ bridge:paperBridge_
671
+ eventDispatcher:paperBridge_.eventDispatcher];
672
+ }
673
+ auto &data = paperInputs_[authored->getComponentName()];
674
+ if (!data)
675
+ data = [[RCTComponentData alloc] initWithManagerClass:fabricPaperManagers.at(authored->getComponentName())
676
+ bridge:paperBridge_
677
+ eventDispatcher:paperBridge_.eventDispatcher];
678
+ if (!entry.textShadow) {
679
+ entry.textShadow = (RCTBaseTextInputShadowView *)[data.manager shadowView];
680
+ entry.textShadow.reactTag = @(tag);
681
+ }
682
+ RCTBaseTextInputShadowView *shadow = entry.textShadow;
683
+ const auto changed = react::diffDynamicProps(entry.textProps, entry.props);
684
+ entry.textProps = entry.props;
685
+ if (!changed.empty()) [data setProps:react::convertFollyDynamicToId(changed) forShadowView:shadow];
686
+ for (RCTShadowView *child in [shadow.reactSubviews copy]) [shadow removeReactSubview:child];
687
+ NSInteger index = 0;
688
+ for (const auto &child : authored->getChildren()) [shadow insertReactSubview:paperTextShadow(*child) atIndex:index++];
689
+ const auto &metrics = layout->getLayoutMetrics();
690
+ YGNodeCalculateLayout(shadow.yogaNode, metrics.frame.size.width, metrics.frame.size.height,
691
+ metrics.layoutDirection == react::LayoutDirection::RightToLeft ? YGDirectionRTL : YGDirectionLTR);
692
+ [shadow uiManagerWillPerformMounting];
693
+ return true;
694
+ }
695
+
696
+ RCTShadowView *paperTextShadow(const react::ShadowNode &node) {
697
+ const auto &instance = instances_.at(node.getTag());
698
+ const bool raw = instance.component == "RCTRawText";
699
+ RCTShadowView *shadow = raw ? [RCTRawTextShadowView new] : [RCTVirtualTextShadowView new];
700
+ shadow.reactTag = @(node.getTag());
701
+ [raw ? rawText_ : virtualText_ setProps:react::convertFollyDynamicToId(instance.props) forShadowView:shadow];
702
+ NSInteger index = 0;
703
+ for (const auto &child : node.getChildren()) [shadow insertReactSubview:paperTextShadow(*child) atIndex:index++];
704
+ return shadow;
705
+ }
706
+
707
+ RCTBridge *paperBridge_ = nil;
708
+ RCTComponentData *virtualText_ = nil, *rawText_ = nil;
709
+ std::unordered_map<std::string, RCTComponentData *> paperInputs_;
710
+ `
711
+ : ''
712
+ }
713
+ void setChildPlacements(Instance &entry, uint64_t owner, std::unordered_set<react::Tag> next,
714
+ RNAppViewRegistry *registry) {
715
+ auto place = [&](react::Tag tag, Instance &child, uint64_t placement) {
716
+ if (child.placementOwner == placement) return;
717
+ child.placementOwner = placement;
718
+ retireFabricContentHost(tag);
719
+ if (placement) markFabricChildPlacement(tag, placement, [registry projectedViewWithTag:tag]);
720
+ registry->touched.insert(tag);
721
+ };
722
+ for (const auto tag : entry.childPlacements) {
723
+ if (owner == entry.placementHost && next.contains(tag)) continue;
724
+ const auto child = instances_.find(tag);
725
+ if (child != instances_.end() && child->second.placementOwner == entry.placementHost)
726
+ place(tag, child->second, 0);
727
+ }
728
+ for (const auto tag : next) place(tag, instances_.at(tag), owner);
729
+ entry.placementHost = owner;
730
+ entry.childPlacements = std::move(next);
731
+ }
732
+
485
733
  RNAppSurfacePresenter *presenter_;
486
734
  RCTFabricSurface *fabricSurface_ = nil;
487
735
  std::deque<std::string> packets_;
@@ -531,6 +779,22 @@ export const FABRIC_APP_INSTALL = `
531
779
  appShadowTree = std::make_unique<RNAppShadowTree>(appSurfacePresenter);
532
780
  `
533
781
 
782
+ // a Paper module updates views through bridge.uiManager, which on this bridgeless
783
+ // core is RCTUIManagerProxy. RCTUIManager's direct prop updates reach the mounted
784
+ // component view as RCTSurfacePresenter applies them on the new architecture.
785
+ export const FABRIC_APP_PAPER_UI_MANAGER = `
786
+ if (Class proxy = NSClassFromString(@"RCTUIManagerProxy")) {
787
+ const auto update = (IMP)+[](id, SEL, NSNumber *tag, NSString *, NSDictionary *props) {
788
+ __weak RNAppSurfacePresenter *presenter = appSurfacePresenter;
789
+ RCTExecuteOnMainQueue(^{
790
+ if (appShadowTree && presenter == appSurfacePresenter) appShadowTree->updatePaperView(tag, props);
791
+ });
792
+ };
793
+ class_addMethod(proxy, sel_registerName("synchronouslyUpdateViewOnUIThread:viewName:props:"), update, "v@:@@@");
794
+ class_addMethod(proxy, sel_registerName("updateView:viewName:props:"), update, "v@:@@@");
795
+ }
796
+ `
797
+
534
798
  export const FABRIC_APP_METHODS = `
535
799
  method("prepareAppInstance", 3, [](jsi::Runtime &rt, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
536
800
  appShadowTree->prepare(rt, static_cast<react::Tag>(args[0].asNumber()), args[1], args[2].asString(rt).utf8(rt));