react-native 0.82.0-nightly-20250710-586f5ba89 → 0.82.0-nightly-20250711-263ccad3c

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 (119) hide show
  1. package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +1 -0
  2. package/Libraries/Blob/React-RCTBlob.podspec +1 -0
  3. package/Libraries/Core/ReactNativeVersion.js +1 -1
  4. package/Libraries/Image/React-RCTImage.podspec +1 -0
  5. package/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm +13 -33
  6. package/Libraries/NativeAnimation/React-RCTAnimation.podspec +1 -0
  7. package/Libraries/Network/React-RCTNetwork.podspec +1 -0
  8. package/Libraries/Settings/React-RCTSettings.podspec +1 -0
  9. package/Libraries/Vibration/React-RCTVibration.podspec +1 -0
  10. package/React/Base/RCTVersion.m +1 -1
  11. package/React/CoreModules/RCTPerfMonitor.mm +1 -1
  12. package/React/CoreModules/React-CoreModules.podspec +1 -0
  13. package/React/FBReactNativeSpec/FBReactNativeSpecJSI-generated.cpp +0 -6
  14. package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +0 -9
  15. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/EventEmitters.cpp +25 -0
  16. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/EventEmitters.h +25 -0
  17. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/Props.cpp +34 -0
  18. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/Props.h +17 -0
  19. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/RCTComponentViewHelpers.h +4 -0
  20. package/React/Fabric/Mounting/ComponentViews/VirtualViewExperimental/RCTVirtualViewExperimentalComponentView.h +24 -0
  21. package/React/Fabric/Mounting/ComponentViews/VirtualViewExperimental/RCTVirtualViewExperimentalComponentView.mm +384 -0
  22. package/React/Fabric/RCTPrimitives.h +1 -1
  23. package/React/Fabric/RCTSurfaceRegistry.h +1 -1
  24. package/React/React-RCTFBReactNativeSpec.podspec +1 -0
  25. package/React/React-RCTFabric.podspec +1 -0
  26. package/React/Runtime/React-RCTRuntime.podspec +1 -0
  27. package/React-Core-prebuilt.podspec +2 -3
  28. package/React-Core.podspec +1 -4
  29. package/ReactAndroid/api/ReactAndroid.api +94 -1
  30. package/ReactAndroid/build.gradle.kts +2 -0
  31. package/ReactAndroid/gradle.properties +1 -1
  32. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +1 -0
  33. package/ReactAndroid/src/main/java/com/facebook/react/ReactAndroidHWInputDeviceHelper.kt +4 -1
  34. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +1 -7
  35. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +1 -11
  36. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +1 -3
  37. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +1 -3
  38. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +1 -12
  39. package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +1 -3
  40. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
  41. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +12 -1
  42. package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainer.kt +136 -0
  43. package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/VirtualViewMode.kt +1 -1
  44. package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/VirtualViewModeChangeEmitter.kt +19 -0
  45. package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualView.kt +3 -11
  46. package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualViewManager.kt +4 -3
  47. package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/viewexperimental/ReactVirtualViewExperimental.kt +200 -0
  48. package/ReactAndroid/src/main/java/com/facebook/react/views/virtual/viewexperimental/ReactVirtualViewExperimentalManager.kt +109 -0
  49. package/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp +3 -0
  50. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +1 -15
  51. package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +1 -4
  52. package/ReactCommon/React-Fabric.podspec +2 -1
  53. package/ReactCommon/React-FabricComponents.podspec +7 -0
  54. package/ReactCommon/React-FabricImage.podspec +1 -0
  55. package/ReactCommon/React-Mapbuffer.podspec +1 -1
  56. package/ReactCommon/ReactCommon.podspec +2 -1
  57. package/ReactCommon/cxxreact/React-cxxreact.podspec +1 -0
  58. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  59. package/ReactCommon/hermes/React-hermes.podspec +1 -0
  60. package/ReactCommon/jserrorhandler/React-jserrorhandler.podspec +2 -1
  61. package/ReactCommon/jsi/React-jsi.podspec +1 -0
  62. package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +1 -0
  63. package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +1 -0
  64. package/ReactCommon/jsinspector-modern/cdp/React-jsinspectorcdp.podspec +2 -1
  65. package/ReactCommon/jsinspector-modern/network/React-jsinspectornetwork.podspec +2 -1
  66. package/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec +2 -1
  67. package/ReactCommon/jsitooling/React-jsitooling.podspec +2 -1
  68. package/ReactCommon/logger/React-logger.podspec +1 -0
  69. package/ReactCommon/react/debug/React-debug.podspec +1 -1
  70. package/ReactCommon/react/featureflags/React-featureflags.podspec +2 -1
  71. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +1 -5
  72. package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +1 -6
  73. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +57 -75
  74. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +2 -4
  75. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +1 -5
  76. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +1 -10
  77. package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +1 -2
  78. package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +2 -1
  79. package/ReactCommon/react/nativemodule/defaults/React-defaultsnativemodule.podspec +1 -0
  80. package/ReactCommon/react/nativemodule/dom/React-domnativemodule.podspec +1 -0
  81. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +1 -6
  82. package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +1 -3
  83. package/ReactCommon/react/nativemodule/featureflags/React-featureflagsnativemodule.podspec +1 -0
  84. package/ReactCommon/react/nativemodule/idlecallbacks/React-idlecallbacksnativemodule.podspec +1 -0
  85. package/ReactCommon/react/nativemodule/microtasks/React-microtasksnativemodule.podspec +1 -0
  86. package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +1 -0
  87. package/ReactCommon/react/performance/timeline/React-performancetimeline.podspec +2 -1
  88. package/ReactCommon/react/renderer/components/virtualviewexperimental/VirtualViewExperimentalComponentDescriptor.h +20 -0
  89. package/ReactCommon/react/renderer/components/virtualviewexperimental/VirtualViewExperimentalShadowNode.h +39 -0
  90. package/ReactCommon/react/renderer/core/ShadowNodeTraits.h +9 -0
  91. package/ReactCommon/react/renderer/css/React-renderercss.podspec +2 -2
  92. package/ReactCommon/react/renderer/debug/React-rendererdebug.podspec +2 -1
  93. package/ReactCommon/react/renderer/graphics/Color.cpp +4 -4
  94. package/ReactCommon/react/renderer/graphics/Color.h +4 -4
  95. package/ReactCommon/react/renderer/graphics/React-graphics.podspec +2 -1
  96. package/ReactCommon/react/renderer/graphics/Transform.cpp +23 -20
  97. package/ReactCommon/react/renderer/graphics/Transform.h +17 -17
  98. package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +1 -0
  99. package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +2 -1
  100. package/ReactCommon/react/runtime/React-RuntimeCore.podspec +2 -1
  101. package/ReactCommon/react/runtime/React-RuntimeHermes.podspec +2 -1
  102. package/ReactCommon/react/runtime/platform/ios/React-RuntimeApple.podspec +2 -1
  103. package/ReactCommon/react/utils/React-utils.podspec +2 -1
  104. package/ReactCommon/reactperflogger/React-perflogger.podspec +1 -0
  105. package/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec +2 -1
  106. package/package.json +8 -8
  107. package/scripts/cocoapods/new_architecture.rb +1 -0
  108. package/scripts/cocoapods/rncore.rb +20 -8
  109. package/scripts/cocoapods/utils.rb +16 -8
  110. package/scripts/codegen/templates/ReactCodegen.podspec.template +1 -0
  111. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  112. package/sdks/hermesc/win64-bin/msvcp140.dll +0 -0
  113. package/sdks/hermesc/win64-bin/vcruntime140.dll +0 -0
  114. package/sdks/hermesc/win64-bin/vcruntime140_1.dll +0 -0
  115. package/src/private/animated/NativeAnimatedHelper.js +0 -1
  116. package/src/private/animated/createAnimatedPropsHook.js +1 -1
  117. package/src/private/components/virtualview/VirtualViewExperimentalNativeComponent.js +93 -0
  118. package/src/private/featureflags/ReactNativeFeatureFlags.js +1 -6
  119. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +1 -2
@@ -84,4 +84,5 @@ Pod::Spec.new do |s|
84
84
 
85
85
  depend_on_js_engine(s)
86
86
  add_rn_third_party_dependencies(s)
87
+ add_rncore_dependency(s)
87
88
  end
@@ -55,4 +55,5 @@ Pod::Spec.new do |s|
55
55
  end
56
56
 
57
57
  add_rn_third_party_dependencies(s)
58
+ add_rncore_dependency(s)
58
59
  end
@@ -18,5 +18,5 @@ export const version: $ReadOnly<{
18
18
  major: 0,
19
19
  minor: 82,
20
20
  patch: 0,
21
- prerelease: 'nightly-20250710-586f5ba89',
21
+ prerelease: 'nightly-20250711-263ccad3c',
22
22
  };
@@ -53,4 +53,5 @@ Pod::Spec.new do |s|
53
53
  add_dependency(s, "React-NativeModulesApple")
54
54
 
55
55
  add_rn_third_party_dependencies(s)
56
+ add_rncore_dependency(s)
56
57
  end
@@ -51,9 +51,7 @@ RCT_EXPORT_MODULE();
51
51
  {
52
52
  // _surfacePresenter set in setSurfacePresenter:
53
53
  _nodesManager = [[RCTNativeAnimatedNodesManager alloc] initWithBridge:nil surfacePresenter:_surfacePresenter];
54
- if (!facebook::react::ReactNativeFeatureFlags::animatedShouldSignalBatch()) {
55
- [_surfacePresenter addObserver:self];
56
- }
54
+ [_surfacePresenter addObserver:self];
57
55
  [[self.moduleRegistry moduleForName:"EventDispatcher"] addDispatchObserver:self];
58
56
  }
59
57
 
@@ -62,9 +60,7 @@ RCT_EXPORT_MODULE();
62
60
  [super invalidate];
63
61
  [_nodesManager stopAnimationLoop];
64
62
  [[self.moduleRegistry moduleForName:"EventDispatcher"] removeDispatchObserver:self];
65
- if (!facebook::react::ReactNativeFeatureFlags::animatedShouldSignalBatch()) {
66
- [_surfacePresenter removeObserver:self];
67
- }
63
+ [_surfacePresenter removeObserver:self];
68
64
  }
69
65
 
70
66
  /*
@@ -80,11 +76,7 @@ RCT_EXPORT_MODULE();
80
76
 
81
77
  RCT_EXPORT_METHOD(startOperationBatch) {}
82
78
 
83
- RCT_EXPORT_METHOD(finishOperationBatch)
84
- {
85
- // This method is only called from JS when animatedShouldSignalBatch is enabled.
86
- [self flushOperationQueues];
87
- }
79
+ RCT_EXPORT_METHOD(finishOperationBatch) {}
88
80
 
89
81
  RCT_EXPORT_METHOD(createAnimatedNode : (double)tag config : (NSDictionary<NSString *, id> *)config)
90
82
  {
@@ -259,39 +251,27 @@ RCT_EXPORT_METHOD(queueAndExecuteBatchedOperations : (NSArray *)operationsAndArg
259
251
 
260
252
  - (void)queueFlushedOperationBlock:(AnimatedOperation)operation
261
253
  {
262
- if (facebook::react::ReactNativeFeatureFlags::animatedShouldSignalBatch()) {
254
+ dispatch_async(RCTGetUIManagerQueue(), ^{
263
255
  [self addOperationBlock:operation];
264
- } else {
265
- dispatch_async(RCTGetUIManagerQueue(), ^{
266
- [self addOperationBlock:operation];
267
- // In Bridge, flushing of native animations is done from RCTCxxBridge batchDidComplete().
268
- // Since RCTCxxBridge doesn't exist in Bridgeless, and components are not remounted in Fabric for native
269
- // animations, flush here for changes in Animated.Value for Animated.event.
270
- [self flushOperationQueues];
271
- });
272
- }
256
+ // In Bridge, flushing of native animations is done from RCTCxxBridge batchDidComplete().
257
+ // Since RCTCxxBridge doesn't exist in Bridgeless, and components are not remounted in Fabric for native
258
+ // animations, flush here for changes in Animated.Value for Animated.event.
259
+ [self flushOperationQueues];
260
+ });
273
261
  }
274
262
 
275
263
  - (void)queueOperationBlock:(AnimatedOperation)operation
276
264
  {
277
- if (facebook::react::ReactNativeFeatureFlags::animatedShouldSignalBatch()) {
265
+ dispatch_async(RCTGetUIManagerQueue(), ^{
278
266
  [self addOperationBlock:operation];
279
- } else {
280
- dispatch_async(RCTGetUIManagerQueue(), ^{
281
- [self addOperationBlock:operation];
282
- });
283
- }
267
+ });
284
268
  }
285
269
 
286
270
  - (void)queuePreOperationBlock:(AnimatedOperation)operation
287
271
  {
288
- if (facebook::react::ReactNativeFeatureFlags::animatedShouldSignalBatch()) {
272
+ dispatch_async(RCTGetUIManagerQueue(), ^{
289
273
  [self addPreOperationBlock:operation];
290
- } else {
291
- dispatch_async(RCTGetUIManagerQueue(), ^{
292
- [self addPreOperationBlock:operation];
293
- });
294
- }
274
+ });
295
275
  }
296
276
 
297
277
  - (void)addOperationBlock:(AnimatedOperation)operation
@@ -50,4 +50,5 @@ Pod::Spec.new do |s|
50
50
  add_dependency(s, "React-featureflags")
51
51
 
52
52
  add_rn_third_party_dependencies(s)
53
+ add_rncore_dependency(s)
53
54
  end
@@ -52,4 +52,5 @@ Pod::Spec.new do |s|
52
52
  add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
53
53
 
54
54
  add_rn_third_party_dependencies(s)
55
+ add_rncore_dependency(s)
55
56
  end
@@ -49,4 +49,5 @@ Pod::Spec.new do |s|
49
49
  add_dependency(s, "React-NativeModulesApple", :additional_framework_paths => ["build/generated/ios"])
50
50
 
51
51
  add_rn_third_party_dependencies(s)
52
+ add_rncore_dependency(s)
52
53
  end
@@ -49,4 +49,5 @@ Pod::Spec.new do |s|
49
49
  add_dependency(s, "React-NativeModulesApple")
50
50
 
51
51
  add_rn_third_party_dependencies(s)
52
+ add_rncore_dependency(s)
52
53
  end
@@ -24,7 +24,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(82),
26
26
  RCTVersionPatch: @(0),
27
- RCTVersionPrerelease: @"nightly-20250710-586f5ba89",
27
+ RCTVersionPrerelease: @"nightly-20250711-263ccad3c",
28
28
  };
29
29
  });
30
30
  return __rnVersion;
@@ -39,7 +39,7 @@ static NSString *const RCTPerfMonitorCellIdentifier = @"RCTPerfMonitorCellIdenti
39
39
  static const CGFloat RCTPerfMonitorBarHeight = 50;
40
40
  static const CGFloat RCTPerfMonitorExpandHeight = 250;
41
41
 
42
- typedef BOOL (*RCTJSCSetOptionType)(const char *);
42
+ using RCTJSCSetOptionType = BOOL (*)(const char *);
43
43
 
44
44
  NSArray<NSString *> *LabelsForRCTPerformanceLoggerTags();
45
45
 
@@ -63,4 +63,5 @@ Pod::Spec.new do |s|
63
63
  add_dependency(s, "React-NativeModulesApple")
64
64
 
65
65
  add_rn_third_party_dependencies(s)
66
+ add_rncore_dependency(s)
66
67
  end
@@ -92,11 +92,6 @@ static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_commonT
92
92
  rt
93
93
  );
94
94
  }
95
- static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_animatedShouldSignalBatch(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
96
- return static_cast<NativeReactNativeFeatureFlagsCxxSpecJSI *>(&turboModule)->animatedShouldSignalBatch(
97
- rt
98
- );
99
- }
100
95
  static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_cxxNativeAnimatedEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
101
96
  return static_cast<NativeReactNativeFeatureFlagsCxxSpecJSI *>(&turboModule)->cxxNativeAnimatedEnabled(
102
97
  rt
@@ -382,7 +377,6 @@ NativeReactNativeFeatureFlagsCxxSpecJSI::NativeReactNativeFeatureFlagsCxxSpecJSI
382
377
  : TurboModule("NativeReactNativeFeatureFlagsCxx", jsInvoker) {
383
378
  methodMap_["commonTestFlag"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_commonTestFlag};
384
379
  methodMap_["commonTestFlagWithoutNativeImplementation"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_commonTestFlagWithoutNativeImplementation};
385
- methodMap_["animatedShouldSignalBatch"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_animatedShouldSignalBatch};
386
380
  methodMap_["cxxNativeAnimatedEnabled"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_cxxNativeAnimatedEnabled};
387
381
  methodMap_["cxxNativeAnimatedRemoveJsSync"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_cxxNativeAnimatedRemoveJsSync};
388
382
  methodMap_["disableMainQueueSyncDispatchIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_disableMainQueueSyncDispatchIOS};
@@ -328,7 +328,6 @@ protected:
328
328
  public:
329
329
  virtual bool commonTestFlag(jsi::Runtime &rt) = 0;
330
330
  virtual bool commonTestFlagWithoutNativeImplementation(jsi::Runtime &rt) = 0;
331
- virtual bool animatedShouldSignalBatch(jsi::Runtime &rt) = 0;
332
331
  virtual bool cxxNativeAnimatedEnabled(jsi::Runtime &rt) = 0;
333
332
  virtual bool cxxNativeAnimatedRemoveJsSync(jsi::Runtime &rt) = 0;
334
333
  virtual bool disableMainQueueSyncDispatchIOS(jsi::Runtime &rt) = 0;
@@ -431,14 +430,6 @@ private:
431
430
  return bridging::callFromJs<bool>(
432
431
  rt, &T::commonTestFlagWithoutNativeImplementation, jsInvoker_, instance_);
433
432
  }
434
- bool animatedShouldSignalBatch(jsi::Runtime &rt) override {
435
- static_assert(
436
- bridging::getParameterCount(&T::animatedShouldSignalBatch) == 1,
437
- "Expected animatedShouldSignalBatch(...) to have 1 parameters");
438
-
439
- return bridging::callFromJs<bool>(
440
- rt, &T::animatedShouldSignalBatch, jsInvoker_, instance_);
441
- }
442
433
  bool cxxNativeAnimatedEnabled(jsi::Runtime &rt) override {
443
434
  static_assert(
444
435
  bridging::getParameterCount(&T::cxxNativeAnimatedEnabled) == 1,
@@ -13,6 +13,31 @@
13
13
 
14
14
  namespace facebook::react {
15
15
 
16
+ void VirtualViewExperimentalEventEmitter::onModeChange(OnModeChange event) const {
17
+ dispatchEvent("modeChange", [event=std::move(event)](jsi::Runtime &runtime) {
18
+ auto payload = jsi::Object(runtime);
19
+ payload.setProperty(runtime, "mode", event.mode);
20
+ {
21
+ auto targetRect = jsi::Object(runtime);
22
+ targetRect.setProperty(runtime, "x", event.targetRect.x);
23
+ targetRect.setProperty(runtime, "y", event.targetRect.y);
24
+ targetRect.setProperty(runtime, "width", event.targetRect.width);
25
+ targetRect.setProperty(runtime, "height", event.targetRect.height);
26
+ payload.setProperty(runtime, "targetRect", targetRect);
27
+ }
28
+ {
29
+ auto thresholdRect = jsi::Object(runtime);
30
+ thresholdRect.setProperty(runtime, "x", event.thresholdRect.x);
31
+ thresholdRect.setProperty(runtime, "y", event.thresholdRect.y);
32
+ thresholdRect.setProperty(runtime, "width", event.thresholdRect.width);
33
+ thresholdRect.setProperty(runtime, "height", event.thresholdRect.height);
34
+ payload.setProperty(runtime, "thresholdRect", thresholdRect);
35
+ }
36
+ return payload;
37
+ });
38
+ }
39
+
40
+
16
41
  void VirtualViewEventEmitter::onModeChange(OnModeChange event) const {
17
42
  dispatchEvent("modeChange", [event=std::move(event)](jsi::Runtime &runtime) {
18
43
  auto payload = jsi::Object(runtime);
@@ -13,6 +13,31 @@
13
13
 
14
14
 
15
15
  namespace facebook::react {
16
+ class VirtualViewExperimentalEventEmitter : public ViewEventEmitter {
17
+ public:
18
+ using ViewEventEmitter::ViewEventEmitter;
19
+
20
+ struct OnModeChangeTargetRect {
21
+ double x;
22
+ double y;
23
+ double width;
24
+ double height;
25
+ };
26
+
27
+ struct OnModeChangeThresholdRect {
28
+ double x;
29
+ double y;
30
+ double width;
31
+ double height;
32
+ };
33
+
34
+ struct OnModeChange {
35
+ int mode;
36
+ OnModeChangeTargetRect targetRect;
37
+ OnModeChangeThresholdRect thresholdRect;
38
+ };
39
+ void onModeChange(OnModeChange value) const;
40
+ };
16
41
  class VirtualViewEventEmitter : public ViewEventEmitter {
17
42
  public:
18
43
  using ViewEventEmitter::ViewEventEmitter;
@@ -14,6 +14,40 @@
14
14
 
15
15
  namespace facebook::react {
16
16
 
17
+ VirtualViewExperimentalProps::VirtualViewExperimentalProps(
18
+ const PropsParserContext &context,
19
+ const VirtualViewExperimentalProps &sourceProps,
20
+ const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
21
+
22
+ initialHidden(convertRawProp(context, rawProps, "initialHidden", sourceProps.initialHidden, {false})),
23
+ renderState(convertRawProp(context, rawProps, "renderState", sourceProps.renderState, {0})) {}
24
+
25
+ #ifdef RN_SERIALIZABLE_STATE
26
+ ComponentName VirtualViewExperimentalProps::getDiffPropsImplementationTarget() const {
27
+ return "VirtualViewExperimental";
28
+ }
29
+
30
+ folly::dynamic VirtualViewExperimentalProps::getDiffProps(
31
+ const Props* prevProps) const {
32
+ static const auto defaultProps = VirtualViewExperimentalProps();
33
+ const VirtualViewExperimentalProps* oldProps = prevProps == nullptr
34
+ ? &defaultProps
35
+ : static_cast<const VirtualViewExperimentalProps*>(prevProps);
36
+ if (this == oldProps) {
37
+ return folly::dynamic::object();
38
+ }
39
+ folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
40
+
41
+ if (initialHidden != oldProps->initialHidden) {
42
+ result["initialHidden"] = initialHidden;
43
+ }
44
+
45
+ if (renderState != oldProps->renderState) {
46
+ result["renderState"] = renderState;
47
+ }
48
+ return result;
49
+ }
50
+ #endif
17
51
  VirtualViewProps::VirtualViewProps(
18
52
  const PropsParserContext &context,
19
53
  const VirtualViewProps &sourceProps,
@@ -17,6 +17,23 @@
17
17
 
18
18
  namespace facebook::react {
19
19
 
20
+ class VirtualViewExperimentalProps final : public ViewProps {
21
+ public:
22
+ VirtualViewExperimentalProps() = default;
23
+ VirtualViewExperimentalProps(const PropsParserContext& context, const VirtualViewExperimentalProps &sourceProps, const RawProps &rawProps);
24
+
25
+ #pragma mark - Props
26
+
27
+ bool initialHidden{false};
28
+ int renderState{0};
29
+
30
+ #ifdef RN_SERIALIZABLE_STATE
31
+ ComponentName getDiffPropsImplementationTarget() const override;
32
+
33
+ folly::dynamic getDiffProps(const Props* prevProps) const override;
34
+ #endif
35
+ };
36
+
20
37
  class VirtualViewProps final : public ViewProps {
21
38
  public:
22
39
  VirtualViewProps() = default;
@@ -13,6 +13,10 @@
13
13
 
14
14
  NS_ASSUME_NONNULL_BEGIN
15
15
 
16
+ @protocol RCTVirtualViewExperimentalViewProtocol <NSObject>
17
+
18
+ @end
19
+
16
20
  @protocol RCTVirtualViewViewProtocol <NSObject>
17
21
 
18
22
  @end
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #import <UIKit/UIKit.h>
9
+
10
+ #import <React/RCTViewComponentView.h>
11
+
12
+ NS_ASSUME_NONNULL_BEGIN
13
+
14
+ @interface RCTVirtualViewExperimentalComponentView : RCTViewComponentView
15
+
16
+ + (instancetype)new NS_UNAVAILABLE;
17
+ - (instancetype)init NS_UNAVAILABLE;
18
+ - (instancetype)initWithCoder:(NSCoder *)coder NS_UNAVAILABLE;
19
+
20
+ - (instancetype)initWithFrame:(CGRect)frame NS_DESIGNATED_INITIALIZER;
21
+
22
+ @end
23
+
24
+ NS_ASSUME_NONNULL_END