@react-native-oh/react-native-harmony 0.72.82 → 0.77.18

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 (81) hide show
  1. package/LICENSE +21 -0
  2. package/LICENSE-Meta +21 -0
  3. package/Libraries/Alert/delegates/AlertDelegate.harmony.ts +84 -0
  4. package/Libraries/Alert/{AlertManager.ts → delegates/AlertManager.harmony.ts} +10 -4
  5. package/Libraries/Animated/shouldUseTurboAnimatedModule.harmony.ts +10 -0
  6. package/Libraries/Components/AccessibilityInfo/delegates/AccessibilityInfoDelegate.harmony.ts +44 -0
  7. package/Libraries/Components/AccessibilityInfo/{NativeAccessibilityInfoHarmony.ts → delegates/NativeAccessibilityInfoHarmony.harmony.ts} +9 -2
  8. package/Libraries/Components/Keyboard/delegates/KeyboardAvoidingViewDelegate.harmony.ts +42 -0
  9. package/Libraries/Components/RefreshControl/delegates/RefreshControlDelegate.harmony.tsx +29 -0
  10. package/Libraries/Components/SafeAreaView/SafeAreaView.harmony.tsx +93 -31
  11. package/Libraries/Components/ScrollView/delegates/ScrollViewDelegate.harmony.tsx +41 -0
  12. package/Libraries/Components/ScrollView/delegates/ScrollViewNativeComponentDelegate.harmony.ts +89 -0
  13. package/Libraries/Components/ScrollView/processDecelerationRate.harmony.ts +19 -0
  14. package/Libraries/Components/StatusBar/delegates/NativeStatusBarManagerHarmony.harmony.ts +53 -0
  15. package/Libraries/Components/StatusBar/delegates/StatusBarDelegate.harmony.ts +83 -0
  16. package/Libraries/Components/TextInput/delegates/TextInputDelegate.harmony.tsx +98 -0
  17. package/Libraries/Components/TextInput/delegates/TextInputStateDelegate.harmony.tsx +20 -0
  18. package/Libraries/Components/Touchable/delegates/TouchableHighlightDelegate.harmony.ts +14 -0
  19. package/Libraries/Components/Touchable/delegates/TouchableNativeFeedbackDelegate.harmony.ts +14 -0
  20. package/Libraries/Components/Touchable/delegates/TouchableWithoutFeedbackDelegate.harmony.ts +14 -0
  21. package/Libraries/Components/delegates/ButtonDelegate.harmony.ts +41 -0
  22. package/Libraries/Core/setUpPlatform.harmony.js +30 -0
  23. package/Libraries/Image/AssetSourceResolver.harmony.ts +75 -29
  24. package/Libraries/Image/Image.harmony.ts +17 -0
  25. package/Libraries/NativeComponent/BaseViewConfig.harmony.js +12 -326
  26. package/Libraries/NativeComponent/delegates/ViewConfigIgnoreDelegate.harmony.ts +13 -0
  27. package/Libraries/ReactNative/delegates/BridgelessUIManagerDelegate.harmony.ts +14 -0
  28. package/Libraries/ReactNative/delegates/I18nManagerDelegate.harmony.ts +22 -0
  29. package/Libraries/Settings/Settings.harmony.ts +20 -0
  30. package/Libraries/Share/delegates/ShareDelegate.harmony.ts +42 -0
  31. package/Libraries/StyleSheet/NativePlatformColor.harmony.ts +15 -0
  32. package/Libraries/StyleSheet/PlatformColorValueTypes.harmony.ts +8 -1
  33. package/Libraries/Utilities/BackHandler.harmony.ts +10 -0
  34. package/Libraries/Utilities/NativePlatformConstantsHarmony.harmony.ts +17 -0
  35. package/Libraries/Utilities/Platform.harmony.ts +38 -13
  36. package/Libraries/Vibration/delegates/VibrationDelegate.harmony.ts +14 -0
  37. package/NOTICE.md +846 -0
  38. package/README.md +2 -2
  39. package/index.js +53 -63
  40. package/jest.config.js +0 -7
  41. package/metro.config.d.ts +17 -0
  42. package/metro.config.js +398 -115
  43. package/package.json +58 -37
  44. package/react-native.config.js +57 -9
  45. package/react_native_openharmony.har +0 -0
  46. package/tsconfig.json +10 -4
  47. package/types/index.harmony.d.ts +99 -0
  48. package/Libraries/Alert/Alert.harmony.js +0 -77
  49. package/Libraries/Animated/NativeAnimatedHelper.harmony.js +0 -601
  50. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.harmony.js +0 -441
  51. package/Libraries/Components/Button/Button.harmony.js +0 -451
  52. package/Libraries/Components/Image/Image.flow.harmony.js +0 -53
  53. package/Libraries/Components/Image/Image.harmony.js +0 -317
  54. package/Libraries/Components/Image/NativeImageLoaderHarmony.js +0 -38
  55. package/Libraries/Components/Keyboard/KeyboardAvoidingView.harmony.js +0 -256
  56. package/Libraries/Components/RefreshControl/RefreshControl.harmony.js +0 -210
  57. package/Libraries/Components/ScrollView/ScrollView.harmony.js +0 -1951
  58. package/Libraries/Components/ScrollView/processDecelerationRate.harmony.js +0 -24
  59. package/Libraries/Components/StatusBar/NativeStatusBarManagerHarmony.js +0 -71
  60. package/Libraries/Components/StatusBar/StatusBar.harmony.js +0 -447
  61. package/Libraries/Components/TextInput/TextInput.harmony.js +0 -1716
  62. package/Libraries/Components/TextInput/TextInputState.harmony.js +0 -220
  63. package/Libraries/Components/Touchable/TouchableHighlight.harmony.js +0 -396
  64. package/Libraries/Components/Touchable/TouchableNativeFeedback.harmony.js +0 -364
  65. package/Libraries/Components/Touchable/TouchableWithoutFeedback.harmony.js +0 -227
  66. package/Libraries/Components/View/View.harmony.js +0 -149
  67. package/Libraries/Core/setUpReactDevTools.harmony.js +0 -93
  68. package/Libraries/ReactNative/I18nManager.harmony.js +0 -78
  69. package/Libraries/ReactNative/UIManager.harmony.js +0 -210
  70. package/Libraries/Settings/Settings.harmony.js +0 -15
  71. package/Libraries/Share/Share.harmony.js +0 -174
  72. package/Libraries/StyleSheet/NativePlatformColor.ts +0 -8
  73. package/Libraries/Utilities/BackHandler.harmony.js +0 -109
  74. package/Libraries/Utilities/NativePlatformConstants.harmony.ts +0 -8
  75. package/Libraries/Utilities/Platform.d.ts +0 -117
  76. package/Libraries/Utilities/createPerformanceLogger.harmony.js +0 -328
  77. package/Libraries/Vibration/Vibration.harmony.js +0 -88
  78. package/harmony/.keep +0 -0
  79. package/harmony/rnoh-hvigor-plugin-0.2.0.tgz +0 -0
  80. package/react_native_openharmony_release.har +0 -0
  81. package/types/index.d.ts +0 -108
@@ -1,210 +0,0 @@
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
- * @format
8
- * @flow
9
- */
10
-
11
- const OS = "ios"; // RNOH: patch - replaced occurrences Platform.OS with OS
12
-
13
- //RNOH: patch - fix imports
14
- import type { ColorValue } from "react-native/Libraries/StyleSheet/StyleSheet";
15
- import type { ViewProps } from "react-native/Libraries/Components/View/ViewPropTypes";
16
-
17
- import AndroidSwipeRefreshLayoutNativeComponent, {
18
- Commands as AndroidSwipeRefreshLayoutCommands,
19
- } from "react-native/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent";
20
- import PullToRefreshViewNativeComponent, {
21
- Commands as PullToRefreshCommands,
22
- } from "react-native/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent";
23
-
24
- const Platform = require("../../Utilities/Platform");
25
- const React = require("react");
26
-
27
- type IOSProps = $ReadOnly<{|
28
- /**
29
- * The color of the refresh indicator.
30
- */
31
- tintColor?: ?ColorValue,
32
- /**
33
- * Title color.
34
- */
35
- titleColor?: ?ColorValue,
36
- /**
37
- * The title displayed under the refresh indicator.
38
- */
39
- title?: ?string,
40
- |}>;
41
-
42
- type AndroidProps = $ReadOnly<{|
43
- /**
44
- * Whether the pull to refresh functionality is enabled.
45
- */
46
- enabled?: ?boolean,
47
- /**
48
- * The colors (at least one) that will be used to draw the refresh indicator.
49
- */
50
- colors?: ?$ReadOnlyArray<ColorValue>,
51
- /**
52
- * The background color of the refresh indicator.
53
- */
54
- progressBackgroundColor?: ?ColorValue,
55
- /**
56
- * Size of the refresh indicator.
57
- */
58
- size?: ?("default" | "large"),
59
- |}>;
60
-
61
- export type RefreshControlProps = $ReadOnly<{|
62
- ...ViewProps,
63
- ...IOSProps,
64
- ...AndroidProps,
65
-
66
- /**
67
- * Called when the view starts refreshing.
68
- */
69
- onRefresh?: ?() => void | Promise<void>,
70
-
71
- /**
72
- * Whether the view should be indicating an active refresh.
73
- */
74
- refreshing: boolean,
75
-
76
- /**
77
- * Progress view top offset
78
- */
79
- progressViewOffset?: ?number,
80
- |}>;
81
-
82
- /**
83
- * This component is used inside a ScrollView or ListView to add pull to refresh
84
- * functionality. When the ScrollView is at `scrollY: 0`, swiping down
85
- * triggers an `onRefresh` event.
86
- *
87
- * ### Usage example
88
- *
89
- * ``` js
90
- * class RefreshableList extends Component {
91
- * constructor(props) {
92
- * super(props);
93
- * this.state = {
94
- * refreshing: false,
95
- * };
96
- * }
97
- *
98
- * _onRefresh() {
99
- * this.setState({refreshing: true});
100
- * fetchData().then(() => {
101
- * this.setState({refreshing: false});
102
- * });
103
- * }
104
- *
105
- * render() {
106
- * return (
107
- * <ListView
108
- * refreshControl={
109
- * <RefreshControl
110
- * refreshing={this.state.refreshing}
111
- * onRefresh={this._onRefresh.bind(this)}
112
- * />
113
- * }
114
- * ...
115
- * >
116
- * ...
117
- * </ListView>
118
- * );
119
- * }
120
- * ...
121
- * }
122
- * ```
123
- *
124
- * __Note:__ `refreshing` is a controlled prop, this is why it needs to be set to true
125
- * in the `onRefresh` function otherwise the refresh indicator will stop immediately.
126
- */
127
- class RefreshControl extends React.Component<RefreshControlProps> {
128
- _nativeRef: ?React.ElementRef<
129
- | typeof PullToRefreshViewNativeComponent
130
- | typeof AndroidSwipeRefreshLayoutNativeComponent
131
- >;
132
- _lastNativeRefreshing = false;
133
-
134
- componentDidMount() {
135
- this._lastNativeRefreshing = this.props.refreshing;
136
- }
137
-
138
- componentDidUpdate(prevProps: RefreshControlProps) {
139
- // RefreshControl is a controlled component so if the native refreshing
140
- // value doesn't match the current js refreshing prop update it to
141
- // the js value.
142
- if (this.props.refreshing !== prevProps.refreshing) {
143
- this._lastNativeRefreshing = this.props.refreshing;
144
- } else if (
145
- this.props.refreshing !== this._lastNativeRefreshing &&
146
- this._nativeRef
147
- ) {
148
- // RNOH: patch - replaced occurrences Platform.OS with OS
149
- if (OS === "android") {
150
- AndroidSwipeRefreshLayoutCommands.setNativeRefreshing(
151
- this._nativeRef,
152
- this.props.refreshing
153
- );
154
- } else {
155
- PullToRefreshCommands.setNativeRefreshing(
156
- this._nativeRef,
157
- this.props.refreshing
158
- );
159
- }
160
- this._lastNativeRefreshing = this.props.refreshing;
161
- }
162
- }
163
-
164
- render(): React.Node {
165
- // RNOH: patch - replaced occurrences Platform.OS with OS
166
- if (OS === "ios") {
167
- // RNOH: patch - change descructuring to pass "progressBackgroundColor", "enabled" and "size" to PullToRefreshViewNativeComponent
168
- // BEFORE: const { enabled, colors, progressBackgroundColor, size, ...props } =
169
- const {colors, ...props } =
170
- this.props;
171
- return (
172
- <PullToRefreshViewNativeComponent
173
- {...props}
174
- ref={this._setNativeRef}
175
- onRefresh={this._onRefresh}
176
- />
177
- );
178
- } else {
179
- const { tintColor, titleColor, title, ...props } = this.props;
180
- return (
181
- <AndroidSwipeRefreshLayoutNativeComponent
182
- {...props}
183
- ref={this._setNativeRef}
184
- onRefresh={this._onRefresh}
185
- />
186
- );
187
- }
188
- }
189
-
190
- _onRefresh = () => {
191
- this._lastNativeRefreshing = true;
192
-
193
- // $FlowFixMe[unused-promise]
194
- this.props.onRefresh && this.props.onRefresh();
195
-
196
- // The native component will start refreshing so force an update to
197
- // make sure it stays in sync with the js component.
198
- this.forceUpdate();
199
- };
200
-
201
- _setNativeRef = (
202
- ref: ?React.ElementRef<
203
- | typeof PullToRefreshViewNativeComponent
204
- | typeof AndroidSwipeRefreshLayoutNativeComponent
205
- >
206
- ) => {
207
- this._nativeRef = ref;
208
- };
209
- }
210
- module.exports = RefreshControl;