react-native-tvos 0.73.0-0rc3 → 0.73.1-0
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.
- package/Libraries/AppDelegate/RCTLegacyInteropComponents.mm +5 -1
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/README.md +21 -3
- package/React/Base/RCTVersion.m +2 -2
- package/React/Fabric/RCTThirdPartyFabricComponentsProvider.h +33 -0
- package/React/Fabric/RCTThirdPartyFabricComponentsProvider.mm +32 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java +0 -10
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +33 -38
- package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
- package/ReactCommon/react/renderer/components/rncore/ComponentDescriptors.h +29 -0
- package/ReactCommon/react/renderer/components/rncore/EventEmitters.cpp +134 -0
- package/ReactCommon/react/renderer/components/rncore/EventEmitters.h +171 -0
- package/ReactCommon/react/renderer/components/rncore/Props.cpp +157 -0
- package/ReactCommon/react/renderer/components/rncore/Props.h +394 -0
- package/ReactCommon/react/renderer/components/rncore/RCTComponentViewHelpers.h +257 -0
- package/ReactCommon/react/renderer/components/rncore/ShadowNodes.cpp +26 -0
- package/ReactCommon/react/renderer/components/rncore/ShadowNodes.h +111 -0
- package/ReactCommon/react/renderer/components/rncore/States.cpp +18 -0
- package/ReactCommon/react/renderer/components/rncore/States.h +141 -0
- package/ReactCommon/react/renderer/components/view/propsConversions.h +1 -2
- package/package.json +7 -7
- package/scripts/cocoapods/utils.rb +2 -1
- package/sdks/hermesc/osx-bin/hermes +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/template/ios/Podfile +23 -20
- package/template/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
/*
|
|
2
3
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
4
|
*
|
|
@@ -11,7 +12,10 @@
|
|
|
11
12
|
|
|
12
13
|
+ (NSArray<NSString *> *)legacyInteropComponents
|
|
13
14
|
{
|
|
14
|
-
return @[
|
|
15
|
+
return @[
|
|
16
|
+
@"RNTMyLegacyNativeView",
|
|
17
|
+
@"RNTMyNativeView"
|
|
18
|
+
];
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
@end
|
package/README.md
CHANGED
|
@@ -40,10 +40,10 @@ You should also install `yarn` globally, as it should be used instead of `npm` f
|
|
|
40
40
|
|
|
41
41
|
## Build changes
|
|
42
42
|
|
|
43
|
-
- _Native layer for Apple TV_: React Native Xcode projects all now have Apple TV build targets, with names ending in the string '-tvOS'.
|
|
43
|
+
- _Native layer for Apple TV_: React Native Xcode projects all now have Apple TV build targets, with names ending in the string '-tvOS'. Changes in the React Native podspecs in 0.73 now require that your application `Podfile` only have one target. This repo supports either an iOS target or a tvOS target, but both targets should not be active at the same time. The new app template now has the iOS target commented out.
|
|
44
44
|
- _Maven artifacts for Android TV_: In 0.71, the React Native Android prebuilt archives are published to Maven instead of being included in the NPM. We are following the same model, except that the Maven artifacts will be in group `io.github.react-native-tvos` instead of `com.facebook.react`. The `@react-native/gradle-plugin` module has been upgraded so that the Android dependencies will be detected correctly during build.
|
|
45
45
|
|
|
46
|
-
## New
|
|
46
|
+
## _(New)_ Project creation using the Expo CLI
|
|
47
47
|
|
|
48
48
|
> _Pitfall:_ Make sure you do not globally install `react-native` or `react-native-tvos`. If you have done this the wrong way, you may get error messages like `ld: library not found for -lPods-TestApp-tvOS`.
|
|
49
49
|
|
|
@@ -70,7 +70,25 @@ npx expo run:ios --scheme MyApp --device "iPhone 15"
|
|
|
70
70
|
npx expo run:android --device tv_api_31
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
See [this document](https://docs.expo.dev/bare/using-expo-cli/) for more details on Expo CLI functionality. (Note that many of these features require that Expo SDK modules be built into your app
|
|
73
|
+
See [this document](https://docs.expo.dev/bare/using-expo-cli/) for more details on Expo CLI functionality. (Note that many of these features require that Expo SDK modules be built into your app. Expo SDK support requires a different project configuration as described below.)
|
|
74
|
+
|
|
75
|
+
## _(New)_ Using the Expo SDK with TV apps
|
|
76
|
+
|
|
77
|
+
Starting with the Expo SDK 50 preview, and react-native-tvos 0.73.x, it will be possible to create Expo apps, and build them for TV via a new config plugin.
|
|
78
|
+
|
|
79
|
+
This functionality will be new in Expo SDK 50, and will be considered an experimental feature for now.
|
|
80
|
+
|
|
81
|
+
The fastest way to generate a new project is described in the [TV Example](https://github.com/expo/examples/tree/master/with-tv) in the Expo examples repo.
|
|
82
|
+
|
|
83
|
+
Besides most of the core Expo modules, these also work on TV:
|
|
84
|
+
|
|
85
|
+
- expo-av
|
|
86
|
+
- expo-image
|
|
87
|
+
- expo-localization
|
|
88
|
+
- expo-updates
|
|
89
|
+
|
|
90
|
+
TV does NOT support dev client (dev menu, dev launcher) at this time.
|
|
91
|
+
TV does NOT support Expo Router at this time.
|
|
74
92
|
|
|
75
93
|
## Code changes
|
|
76
94
|
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -23,8 +23,8 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
|
|
23
23
|
__rnVersion = @{
|
|
24
24
|
RCTVersionMajor: @(0),
|
|
25
25
|
RCTVersionMinor: @(73),
|
|
26
|
-
RCTVersionPatch: @(
|
|
27
|
-
RCTVersionPrerelease: @"
|
|
26
|
+
RCTVersionPatch: @(1),
|
|
27
|
+
RCTVersionPrerelease: @"0",
|
|
28
28
|
};
|
|
29
29
|
});
|
|
30
30
|
return __rnVersion;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by GenerateRCTThirdPartyFabricComponentsProviderH
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma GCC diagnostic push
|
|
12
|
+
#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage"
|
|
13
|
+
|
|
14
|
+
#import <React/RCTComponentViewProtocol.h>
|
|
15
|
+
|
|
16
|
+
#ifdef __cplusplus
|
|
17
|
+
extern "C" {
|
|
18
|
+
#endif
|
|
19
|
+
|
|
20
|
+
Class<RCTComponentViewProtocol> RCTThirdPartyFabricComponentsProvider(const char *name);
|
|
21
|
+
|
|
22
|
+
#ifndef RCT_DYNAMIC_FRAMEWORKS
|
|
23
|
+
|
|
24
|
+
Class<RCTComponentViewProtocol> RNTMyNativeViewCls(void) __attribute__((used)); // AppSpecs
|
|
25
|
+
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
#ifdef __cplusplus
|
|
29
|
+
}
|
|
30
|
+
#endif
|
|
31
|
+
|
|
32
|
+
#pragma GCC diagnostic pop
|
|
33
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by GenerateRCTThirdPartyFabricComponentsProviderCpp
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// OSS-compatibility layer
|
|
12
|
+
|
|
13
|
+
#import "RCTThirdPartyFabricComponentsProvider.h"
|
|
14
|
+
|
|
15
|
+
#import <string>
|
|
16
|
+
#import <unordered_map>
|
|
17
|
+
|
|
18
|
+
Class<RCTComponentViewProtocol> RCTThirdPartyFabricComponentsProvider(const char *name) {
|
|
19
|
+
static std::unordered_map<std::string, Class (*)(void)> sFabricComponentsClassMap = {
|
|
20
|
+
#ifndef RCT_DYNAMIC_FRAMEWORKS
|
|
21
|
+
|
|
22
|
+
{"RNTMyNativeView", RNTMyNativeViewCls}, // AppSpecs
|
|
23
|
+
#endif
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
auto p = sFabricComponentsClassMap.find(name);
|
|
27
|
+
if (p != sFabricComponentsClassMap.end()) {
|
|
28
|
+
auto classFunc = p->second;
|
|
29
|
+
return classFunc();
|
|
30
|
+
}
|
|
31
|
+
return nil;
|
|
32
|
+
}
|
package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java
CHANGED
|
@@ -75,16 +75,6 @@ public abstract class ReactTextAnchorViewManager<T extends View, C extends React
|
|
|
75
75
|
view.setAdjustFontSizeToFit(adjustsFontSizeToFit);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
@ReactProp(name = ViewProps.ALLOW_FONT_SCALING, defaultBoolean = true)
|
|
79
|
-
public void setAllowFontScaling(ReactTextView view, boolean allowFontScaling) {
|
|
80
|
-
view.setAllowFontScaling(allowFontScaling);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
@ReactProp(name = ViewProps.MAX_FONT_SIZE_MULTIPLIER, defaultFloat = Float.NaN)
|
|
84
|
-
public void setMaxFontSizeMultiplier(ReactTextView view, float maxFontSizeMultiplier) {
|
|
85
|
-
view.setMaxFontSizeMultiplier(maxFontSizeMultiplier);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
78
|
@ReactProp(name = ViewProps.FONT_SIZE)
|
|
89
79
|
public void setFontSize(ReactTextView view, float fontSize) {
|
|
90
80
|
view.setFontSize(fontSize);
|
|
@@ -58,6 +58,8 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
|
|
|
58
58
|
private int mNumberOfLines;
|
|
59
59
|
private TextUtils.TruncateAt mEllipsizeLocation;
|
|
60
60
|
private boolean mAdjustsFontSizeToFit;
|
|
61
|
+
private float mFontSize = Float.NaN;
|
|
62
|
+
private float mLetterSpacing = Float.NaN;
|
|
61
63
|
private int mLinkifyMaskType;
|
|
62
64
|
private boolean mNotifyOnInlineViewLayout;
|
|
63
65
|
private boolean mTextIsSelectable;
|
|
@@ -65,12 +67,6 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
|
|
|
65
67
|
private ReactViewBackgroundManager mReactBackgroundManager;
|
|
66
68
|
private Spannable mSpanned;
|
|
67
69
|
|
|
68
|
-
/**
|
|
69
|
-
* Used to collect some text size affecting attributes to fix some text cut-off issues when users
|
|
70
|
-
* adjust text size and font weight to the max value in system font settings.
|
|
71
|
-
*/
|
|
72
|
-
private TextAttributes mTextAttributes;
|
|
73
|
-
|
|
74
70
|
public ReactTextView(Context context) {
|
|
75
71
|
super(context);
|
|
76
72
|
|
|
@@ -102,7 +98,6 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
|
|
|
102
98
|
mEllipsizeLocation = TextUtils.TruncateAt.END;
|
|
103
99
|
|
|
104
100
|
mSpanned = null;
|
|
105
|
-
mTextAttributes = new TextAttributes();
|
|
106
101
|
}
|
|
107
102
|
|
|
108
103
|
/* package */ void recycleView() {
|
|
@@ -592,6 +587,29 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
|
|
|
592
587
|
mAdjustsFontSizeToFit = adjustsFontSizeToFit;
|
|
593
588
|
}
|
|
594
589
|
|
|
590
|
+
public void setFontSize(float fontSize) {
|
|
591
|
+
mFontSize =
|
|
592
|
+
mAdjustsFontSizeToFit
|
|
593
|
+
? (float) Math.ceil(PixelUtil.toPixelFromSP(fontSize))
|
|
594
|
+
: (float) Math.ceil(PixelUtil.toPixelFromDIP(fontSize));
|
|
595
|
+
|
|
596
|
+
applyTextAttributes();
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
public void setLetterSpacing(float letterSpacing) {
|
|
600
|
+
if (Float.isNaN(letterSpacing)) {
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
float letterSpacingPixels = PixelUtil.toPixelFromDIP(letterSpacing);
|
|
605
|
+
|
|
606
|
+
// `letterSpacingPixels` and `getEffectiveFontSize` are both in pixels,
|
|
607
|
+
// yielding an accurate em value.
|
|
608
|
+
mLetterSpacing = letterSpacingPixels / mFontSize;
|
|
609
|
+
|
|
610
|
+
applyTextAttributes();
|
|
611
|
+
}
|
|
612
|
+
|
|
595
613
|
public void setEllipsizeLocation(TextUtils.TruncateAt ellipsizeLocation) {
|
|
596
614
|
mEllipsizeLocation = ellipsizeLocation;
|
|
597
615
|
}
|
|
@@ -607,8 +625,6 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
|
|
|
607
625
|
? null
|
|
608
626
|
: mEllipsizeLocation;
|
|
609
627
|
setEllipsize(ellipsizeLocation);
|
|
610
|
-
|
|
611
|
-
applyTextAttributes();
|
|
612
628
|
}
|
|
613
629
|
|
|
614
630
|
@Override
|
|
@@ -664,37 +680,16 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
|
|
|
664
680
|
return super.dispatchHoverEvent(event);
|
|
665
681
|
}
|
|
666
682
|
|
|
667
|
-
public void setLetterSpacing(float letterSpacing) {
|
|
668
|
-
mTextAttributes.setLetterSpacing(letterSpacing);
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
public void setAllowFontScaling(boolean allowFontScaling) {
|
|
672
|
-
if (mTextAttributes.getAllowFontScaling() != allowFontScaling) {
|
|
673
|
-
mTextAttributes.setAllowFontScaling(allowFontScaling);
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
public void setFontSize(float fontSize) {
|
|
678
|
-
mTextAttributes.setFontSize(fontSize);
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
public void setMaxFontSizeMultiplier(float maxFontSizeMultiplier) {
|
|
682
|
-
if (maxFontSizeMultiplier != mTextAttributes.getMaxFontSizeMultiplier()) {
|
|
683
|
-
mTextAttributes.setMaxFontSizeMultiplier(maxFontSizeMultiplier);
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
|
|
687
683
|
private void applyTextAttributes() {
|
|
688
|
-
//
|
|
689
|
-
//
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
684
|
+
// Workaround for an issue where text can be cut off with an ellipsis when
|
|
685
|
+
// using certain font sizes and padding. Sets the provided text size and
|
|
686
|
+
// letter spacing to ensure consistent rendering and prevent cut-off.
|
|
687
|
+
if (!Float.isNaN(mFontSize)) {
|
|
688
|
+
setTextSize(TypedValue.COMPLEX_UNIT_PX, mFontSize);
|
|
689
|
+
}
|
|
694
690
|
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
super.setLetterSpacing(effectiveLetterSpacing);
|
|
691
|
+
if (!Float.isNaN(mLetterSpacing)) {
|
|
692
|
+
super.setLetterSpacing(mLetterSpacing);
|
|
698
693
|
}
|
|
699
694
|
}
|
|
700
695
|
}
|
|
@@ -17,8 +17,8 @@ namespace facebook::react {
|
|
|
17
17
|
constexpr struct {
|
|
18
18
|
int32_t Major = 0;
|
|
19
19
|
int32_t Minor = 73;
|
|
20
|
-
int32_t Patch =
|
|
21
|
-
std::string_view Prerelease = "
|
|
20
|
+
int32_t Patch = 1;
|
|
21
|
+
std::string_view Prerelease = "0";
|
|
22
22
|
} ReactNativeVersion;
|
|
23
23
|
|
|
24
24
|
} // namespace facebook::react
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateComponentDescriptorH.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include <react/renderer/components/rncore/ShadowNodes.h>
|
|
14
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
+
|
|
16
|
+
namespace facebook {
|
|
17
|
+
namespace react {
|
|
18
|
+
|
|
19
|
+
using ActivityIndicatorViewComponentDescriptor = ConcreteComponentDescriptor<ActivityIndicatorViewShadowNode>;
|
|
20
|
+
using AndroidDrawerLayoutComponentDescriptor = ConcreteComponentDescriptor<AndroidDrawerLayoutShadowNode>;
|
|
21
|
+
using AndroidSwipeRefreshLayoutComponentDescriptor = ConcreteComponentDescriptor<AndroidSwipeRefreshLayoutShadowNode>;
|
|
22
|
+
using PullToRefreshViewComponentDescriptor = ConcreteComponentDescriptor<PullToRefreshViewShadowNode>;
|
|
23
|
+
using AndroidHorizontalScrollContentViewComponentDescriptor = ConcreteComponentDescriptor<AndroidHorizontalScrollContentViewShadowNode>;
|
|
24
|
+
using SwitchComponentDescriptor = ConcreteComponentDescriptor<SwitchShadowNode>;
|
|
25
|
+
using TraceUpdateOverlayComponentDescriptor = ConcreteComponentDescriptor<TraceUpdateOverlayShadowNode>;
|
|
26
|
+
using UnimplementedNativeViewComponentDescriptor = ConcreteComponentDescriptor<UnimplementedNativeViewShadowNode>;
|
|
27
|
+
|
|
28
|
+
} // namespace react
|
|
29
|
+
} // namespace facebook
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateEventEmitterCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <react/renderer/components/rncore/EventEmitters.h>
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
namespace facebook {
|
|
15
|
+
namespace react {
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
void AndroidDrawerLayoutEventEmitter::onDrawerSlide(OnDrawerSlide $event) const {
|
|
19
|
+
dispatchEvent("drawerSlide", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
20
|
+
auto $payload = jsi::Object(runtime);
|
|
21
|
+
$payload.setProperty(runtime, "offset", $event.offset);
|
|
22
|
+
return $payload;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
void AndroidDrawerLayoutEventEmitter::onDrawerStateChanged(OnDrawerStateChanged $event) const {
|
|
28
|
+
dispatchEvent("drawerStateChanged", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
29
|
+
auto $payload = jsi::Object(runtime);
|
|
30
|
+
$payload.setProperty(runtime, "drawerState", $event.drawerState);
|
|
31
|
+
return $payload;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
void AndroidDrawerLayoutEventEmitter::onDrawerOpen(OnDrawerOpen $event) const {
|
|
37
|
+
dispatchEvent("drawerOpen", [](jsi::Runtime &runtime) {
|
|
38
|
+
auto $payload = jsi::Object(runtime);
|
|
39
|
+
|
|
40
|
+
return $payload;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
void AndroidDrawerLayoutEventEmitter::onDrawerClose(OnDrawerClose $event) const {
|
|
46
|
+
dispatchEvent("drawerClose", [](jsi::Runtime &runtime) {
|
|
47
|
+
auto $payload = jsi::Object(runtime);
|
|
48
|
+
|
|
49
|
+
return $payload;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
void AndroidSwipeRefreshLayoutEventEmitter::onRefresh(OnRefresh $event) const {
|
|
56
|
+
dispatchEvent("refresh", [](jsi::Runtime &runtime) {
|
|
57
|
+
auto $payload = jsi::Object(runtime);
|
|
58
|
+
|
|
59
|
+
return $payload;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
void PullToRefreshViewEventEmitter::onRefresh(OnRefresh $event) const {
|
|
65
|
+
dispatchEvent("refresh", [](jsi::Runtime &runtime) {
|
|
66
|
+
auto $payload = jsi::Object(runtime);
|
|
67
|
+
|
|
68
|
+
return $payload;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
void AndroidSwitchEventEmitter::onChange(OnChange $event) const {
|
|
76
|
+
dispatchEvent("change", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
77
|
+
auto $payload = jsi::Object(runtime);
|
|
78
|
+
$payload.setProperty(runtime, "value", $event.value);
|
|
79
|
+
$payload.setProperty(runtime, "target", $event.target);
|
|
80
|
+
return $payload;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
void SwitchEventEmitter::onChange(OnChange $event) const {
|
|
86
|
+
dispatchEvent("change", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
87
|
+
auto $payload = jsi::Object(runtime);
|
|
88
|
+
$payload.setProperty(runtime, "value", $event.value);
|
|
89
|
+
$payload.setProperty(runtime, "target", $event.target);
|
|
90
|
+
return $payload;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
void ModalHostViewEventEmitter::onRequestClose(OnRequestClose $event) const {
|
|
99
|
+
dispatchEvent("requestClose", [](jsi::Runtime &runtime) {
|
|
100
|
+
auto $payload = jsi::Object(runtime);
|
|
101
|
+
|
|
102
|
+
return $payload;
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
void ModalHostViewEventEmitter::onShow(OnShow $event) const {
|
|
108
|
+
dispatchEvent("show", [](jsi::Runtime &runtime) {
|
|
109
|
+
auto $payload = jsi::Object(runtime);
|
|
110
|
+
|
|
111
|
+
return $payload;
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
void ModalHostViewEventEmitter::onDismiss(OnDismiss $event) const {
|
|
117
|
+
dispatchEvent("dismiss", [](jsi::Runtime &runtime) {
|
|
118
|
+
auto $payload = jsi::Object(runtime);
|
|
119
|
+
|
|
120
|
+
return $payload;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
void ModalHostViewEventEmitter::onOrientationChange(OnOrientationChange $event) const {
|
|
126
|
+
dispatchEvent("orientationChange", [$event=std::move($event)](jsi::Runtime &runtime) {
|
|
127
|
+
auto $payload = jsi::Object(runtime);
|
|
128
|
+
$payload.setProperty(runtime, "orientation", toString($event.orientation));
|
|
129
|
+
return $payload;
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
} // namespace react
|
|
134
|
+
} // namespace facebook
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateEventEmitterH.js
|
|
9
|
+
*/
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <react/renderer/components/view/ViewEventEmitter.h>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
namespace facebook {
|
|
16
|
+
namespace react {
|
|
17
|
+
class ActivityIndicatorViewEventEmitter : public ViewEventEmitter {
|
|
18
|
+
public:
|
|
19
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
};
|
|
24
|
+
class AndroidDrawerLayoutEventEmitter : public ViewEventEmitter {
|
|
25
|
+
public:
|
|
26
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
27
|
+
|
|
28
|
+
struct OnDrawerSlide {
|
|
29
|
+
Float offset;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
struct OnDrawerStateChanged {
|
|
33
|
+
int drawerState;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
struct OnDrawerOpen {
|
|
37
|
+
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
struct OnDrawerClose {
|
|
41
|
+
|
|
42
|
+
};
|
|
43
|
+
void onDrawerSlide(OnDrawerSlide value) const;
|
|
44
|
+
|
|
45
|
+
void onDrawerStateChanged(OnDrawerStateChanged value) const;
|
|
46
|
+
|
|
47
|
+
void onDrawerOpen(OnDrawerOpen value) const;
|
|
48
|
+
|
|
49
|
+
void onDrawerClose(OnDrawerClose value) const;
|
|
50
|
+
};
|
|
51
|
+
class AndroidProgressBarEventEmitter : public ViewEventEmitter {
|
|
52
|
+
public:
|
|
53
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
};
|
|
58
|
+
class AndroidSwipeRefreshLayoutEventEmitter : public ViewEventEmitter {
|
|
59
|
+
public:
|
|
60
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
61
|
+
|
|
62
|
+
struct OnRefresh {
|
|
63
|
+
|
|
64
|
+
};
|
|
65
|
+
void onRefresh(OnRefresh value) const;
|
|
66
|
+
};
|
|
67
|
+
class PullToRefreshViewEventEmitter : public ViewEventEmitter {
|
|
68
|
+
public:
|
|
69
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
70
|
+
|
|
71
|
+
struct OnRefresh {
|
|
72
|
+
|
|
73
|
+
};
|
|
74
|
+
void onRefresh(OnRefresh value) const;
|
|
75
|
+
};
|
|
76
|
+
class SafeAreaViewEventEmitter : public ViewEventEmitter {
|
|
77
|
+
public:
|
|
78
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
};
|
|
83
|
+
class AndroidHorizontalScrollContentViewEventEmitter : public ViewEventEmitter {
|
|
84
|
+
public:
|
|
85
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
};
|
|
90
|
+
class AndroidSwitchEventEmitter : public ViewEventEmitter {
|
|
91
|
+
public:
|
|
92
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
93
|
+
|
|
94
|
+
struct OnChange {
|
|
95
|
+
bool value;
|
|
96
|
+
int target;
|
|
97
|
+
};
|
|
98
|
+
void onChange(OnChange value) const;
|
|
99
|
+
};
|
|
100
|
+
class SwitchEventEmitter : public ViewEventEmitter {
|
|
101
|
+
public:
|
|
102
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
103
|
+
|
|
104
|
+
struct OnChange {
|
|
105
|
+
bool value;
|
|
106
|
+
int target;
|
|
107
|
+
};
|
|
108
|
+
void onChange(OnChange value) const;
|
|
109
|
+
};
|
|
110
|
+
class InputAccessoryEventEmitter : public ViewEventEmitter {
|
|
111
|
+
public:
|
|
112
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
};
|
|
117
|
+
class TraceUpdateOverlayEventEmitter : public ViewEventEmitter {
|
|
118
|
+
public:
|
|
119
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
};
|
|
124
|
+
class UnimplementedNativeViewEventEmitter : public ViewEventEmitter {
|
|
125
|
+
public:
|
|
126
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
};
|
|
131
|
+
class ModalHostViewEventEmitter : public ViewEventEmitter {
|
|
132
|
+
public:
|
|
133
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
134
|
+
|
|
135
|
+
struct OnRequestClose {
|
|
136
|
+
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
struct OnShow {
|
|
140
|
+
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
struct OnDismiss {
|
|
144
|
+
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
enum class OnOrientationChangeOrientation {
|
|
148
|
+
Portrait,
|
|
149
|
+
Landscape
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
static char const *toString(const OnOrientationChangeOrientation value) {
|
|
153
|
+
switch (value) {
|
|
154
|
+
case OnOrientationChangeOrientation::Portrait: return "portrait";
|
|
155
|
+
case OnOrientationChangeOrientation::Landscape: return "landscape";
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
struct OnOrientationChange {
|
|
160
|
+
OnOrientationChangeOrientation orientation;
|
|
161
|
+
};
|
|
162
|
+
void onRequestClose(OnRequestClose value) const;
|
|
163
|
+
|
|
164
|
+
void onShow(OnShow value) const;
|
|
165
|
+
|
|
166
|
+
void onDismiss(OnDismiss value) const;
|
|
167
|
+
|
|
168
|
+
void onOrientationChange(OnOrientationChange value) const;
|
|
169
|
+
};
|
|
170
|
+
} // namespace react
|
|
171
|
+
} // namespace facebook
|