@react-native-oh/react-native-harmony 0.61.16

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 (82) hide show
  1. package/Libraries/ART/ReactNativeART.js +43 -0
  2. package/Libraries/Animated/Animated.js +154 -0
  3. package/Libraries/Animated/delegates/createAnimatedComponentDelegate.js +20 -0
  4. package/Libraries/Animated/src/Easing.js +20 -0
  5. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +15 -0
  6. package/Libraries/Components/AppleTV/TVEventHandler.js +13 -0
  7. package/Libraries/Components/CheckBox/CheckBox.tsx +182 -0
  8. package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.tsx +32 -0
  9. package/Libraries/Components/DatePickerIOS/DatePickerIOS.tsx +285 -0
  10. package/Libraries/Components/MaskedView/MaskedView.tsx +32 -0
  11. package/Libraries/Components/Picker/Picker.tsx +303 -0
  12. package/Libraries/Components/PickerIOS/PickerIOS.tsx +175 -0
  13. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.tsx +156 -0
  14. package/Libraries/Components/ProgressViewIOS/ProgressViewIOS.tsx +65 -0
  15. package/Libraries/Components/PushNotificationIOS/PushNotificationIOS.tsx +609 -0
  16. package/Libraries/Components/RefreshControl/RefreshControl.tsx +54 -0
  17. package/Libraries/Components/ScrollView/ScrollView.js +34 -0
  18. package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.tsx +79 -0
  19. package/Libraries/Components/Slider/Slider.tsx +204 -0
  20. package/Libraries/Components/TextInput/TextInput.js +24 -0
  21. package/Libraries/Components/TimePickerAndroid/TimePickerAndroid.tsx +20 -0
  22. package/Libraries/Components/Touchable/TouchableOpacity.js +90 -0
  23. package/Libraries/Components/View/ViewPropTypes.js +16 -0
  24. package/Libraries/Components/View/delegate/ViewDelegate.js +49 -0
  25. package/Libraries/Core/ReactNativeVersion.js +21 -0
  26. package/Libraries/Core/polyfillPromise.js +18 -0
  27. package/Libraries/Core/setUpPlatform.js +13 -0
  28. package/Libraries/DeprecatedPropTypes/DeprecatedColorPropType.js +16 -0
  29. package/Libraries/DeprecatedPropTypes/DeprecatedEdgeInsetsPropType.js +16 -0
  30. package/Libraries/DeprecatedPropTypes/DeprecatedImagePropType.js +15 -0
  31. package/Libraries/DeprecatedPropTypes/DeprecatedImageSourcePropType.js +16 -0
  32. package/Libraries/DeprecatedPropTypes/DeprecatedImageStylePropTypes.js +15 -0
  33. package/Libraries/DeprecatedPropTypes/DeprecatedLayoutPropTypes.js +15 -0
  34. package/Libraries/DeprecatedPropTypes/DeprecatedPointPropType.js +16 -0
  35. package/Libraries/DeprecatedPropTypes/DeprecatedShadowPropTypesIOS.js +15 -0
  36. package/Libraries/DeprecatedPropTypes/DeprecatedStyleSheetPropType.js +16 -0
  37. package/Libraries/DeprecatedPropTypes/DeprecatedTVViewPropTypes.js +15 -0
  38. package/Libraries/DeprecatedPropTypes/DeprecatedTextInputPropTypes.js +15 -0
  39. package/Libraries/DeprecatedPropTypes/DeprecatedTextPropTypes.js +16 -0
  40. package/Libraries/DeprecatedPropTypes/DeprecatedTextStylePropTypes.js +15 -0
  41. package/Libraries/DeprecatedPropTypes/DeprecatedTransformPropTypes.js +15 -0
  42. package/Libraries/DeprecatedPropTypes/DeprecatedViewAccessibility.js +15 -0
  43. package/Libraries/DeprecatedPropTypes/DeprecatedViewPropTypes.js +16 -0
  44. package/Libraries/DeprecatedPropTypes/DeprecatedViewStylePropTypes.js +15 -0
  45. package/Libraries/DeprecatedPropTypes/deprecatedCreateStrictShapeTypeChecker.js +20 -0
  46. package/Libraries/EventEmitter/NativeEventEmitter.js +50 -0
  47. package/Libraries/Image/Image.tsx +88 -0
  48. package/Libraries/Promise.js +50 -0
  49. package/Libraries/Storage/AsyncStorage.ts +216 -0
  50. package/Libraries/Storage/helpers.ts +36 -0
  51. package/Libraries/Storage/hooks.ts +19 -0
  52. package/Libraries/Storage/index.ts +5 -0
  53. package/Libraries/Storage/types.ts +43 -0
  54. package/Libraries/StyleSheet/EdgeInsetsPropType.js +15 -0
  55. package/Libraries/StyleSheet/PointPropType.js +15 -0
  56. package/Libraries/Utilities/Platform.harmony.ts +68 -0
  57. package/Libraries/Utilities/setAndForwardRef.js +71 -0
  58. package/README.dev.md +55 -0
  59. package/README.md +146 -0
  60. package/compat/ensurePropTypes.js +45 -0
  61. package/compat/getNoopPropType.js +42 -0
  62. package/compat/restoreRemoveListener.js +117 -0
  63. package/index.js +348 -0
  64. package/package.json +45 -0
  65. package/patched-virtualized-list/VirtualizedList.js +87 -0
  66. package/polyfills/dateSlash.js +89 -0
  67. package/react_native_harmony.har +0 -0
  68. package/src/private/specs/AsyncStorage.ts +37 -0
  69. package/src/private/specs/NativeDatePickerAndroid.ts +27 -0
  70. package/src/private/specs/NativeTimePickerAndroid.ts +28 -0
  71. package/src/private/specs/PushNotificationIOS.ts +167 -0
  72. package/src/private/specs/components/CheckBoxNativeComponent.ts +35 -0
  73. package/src/private/specs/components/DatePickerNativeComponent.ts +40 -0
  74. package/src/private/specs/components/MaskedViewNativeComponent.ts +17 -0
  75. package/src/private/specs/components/PickerIOSNativeComponent.ts +53 -0
  76. package/src/private/specs/components/PickerNativeComponent.ts +67 -0
  77. package/src/private/specs/components/ProgressBarNativeComponent.ts +24 -0
  78. package/src/private/specs/components/ProgressViewNativeComponent.ts +24 -0
  79. package/src/private/specs/components/ProgressWheelNativeComponent.ts +18 -0
  80. package/src/private/specs/components/RNSliderNativeComponent.ts +44 -0
  81. package/src/private/specs/components/SegmentedControlNativeComponent.ts +38 -0
  82. package/src/private/specs/components/TimePickerNativeComponent.ts +40 -0
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Copyright (c) 2025 Huawei Technologies Co., Ltd.
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 * as React from 'react';
9
+ import StyleSheet from '@react-native-oh/react-native-harmony/Libraries/StyleSheet/StyleSheet';
10
+ import {
11
+ processColor,
12
+ type StyleSheet as StyleSheetType,
13
+ } from '@react-native-oh/react-native-harmony';
14
+ // import type {OnChangeEvent} from '../../../src/private/specs/components/SegmentedControlNativeComponent';
15
+ import type { ViewProps } from '@react-native-oh/react-native-harmony/Libraries/components/View/ViewPropTypes';
16
+ import RCTSegmentedControlNativeComponent from '../../../src/private/specs/components/SegmentedControlNativeComponent';
17
+ import type { NativeSyntheticEvent } from '@react-native-oh/react-native-harmony/Libraries/Types/CoreEventTypes';
18
+
19
+ type OnChangeEvent = any;
20
+
21
+ type SegmentedControlIOSProps = ViewProps &
22
+ Readonly<{
23
+ values: ReadonlyArray<string>;
24
+ selectedIndex?: number | undefined;
25
+ enabled?: boolean;
26
+ tintColor?: string | undefined;
27
+ momentary?: boolean | undefined;
28
+ onChange?:
29
+ | ((event: NativeSyntheticEvent<OnChangeEvent>) => void)
30
+ | undefined;
31
+ onValueChange?: (value: string) => any;
32
+ }>;
33
+
34
+ const SegmentedControlIOSWithRef = React.forwardRef(
35
+ (
36
+ props: SegmentedControlIOSProps,
37
+ forwardedRef: React.Ref<typeof RCTSegmentedControlNativeComponent>
38
+ ) => {
39
+ const {
40
+ values,
41
+ selectedIndex,
42
+ enabled,
43
+ onChange,
44
+ onValueChange,
45
+ style,
46
+ ...otherProps
47
+ } = props;
48
+ return (
49
+ <RCTSegmentedControlNativeComponent
50
+ {...otherProps}
51
+ style={[styles.segmentedControl, style]}
52
+ options={{
53
+ buttons: values.map((value) => ({ text: value })),
54
+ selectedBackgroundColor:
55
+ props.tintColor !== undefined
56
+ ? processColor(props.tintColor) ?? undefined
57
+ : undefined,
58
+ }}
59
+ selectedIndexes={
60
+ selectedIndex === undefined ? undefined : [selectedIndex]
61
+ }
62
+ enabled={enabled ?? true}
63
+ ref={forwardedRef as any}
64
+ onChange={(e) => {
65
+ onChange?.(e);
66
+ onValueChange?.(values[e.nativeEvent.selectedSegmentIndex]);
67
+ }}
68
+ />
69
+ );
70
+ }
71
+ );
72
+
73
+ const styles = (StyleSheet as any as typeof StyleSheetType).create({
74
+ segmentedControl: {
75
+ height: 28,
76
+ },
77
+ });
78
+
79
+ module.exports = SegmentedControlIOSWithRef;
@@ -0,0 +1,204 @@
1
+ /**
2
+ * Copyright (c) 2025 Huawei Technologies Co., Ltd.
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 React from 'react';
9
+ import {
10
+ Image,
11
+ Platform,
12
+ StyleSheet,
13
+ ViewProps,
14
+ ViewStyle,
15
+ ColorValue,
16
+ NativeSyntheticEvent,
17
+ StyleProp,
18
+ processColor,
19
+ } from 'react-native';
20
+ import RCTSliderNativeComponent from '../../../src/private/specs/components/RNSliderNativeComponent';
21
+ //@ts-ignore
22
+ import type { ImageSource } from 'react-native/Libraries/Image/ImageSource';
23
+
24
+ import type { Ref } from 'react';
25
+
26
+ const LIMIT_MIN_VALUE = Number.MIN_SAFE_INTEGER;
27
+ const LIMIT_MAX_VALUE = Number.MAX_SAFE_INTEGER;
28
+
29
+ type Event = NativeSyntheticEvent<
30
+ Readonly<{
31
+ value: number;
32
+ /**
33
+ * Android Only.
34
+ */
35
+ fromUser?: boolean;
36
+ }>
37
+ >;
38
+
39
+ type Props = ViewProps &
40
+ Readonly<{
41
+ /**
42
+ * Used to style and layout the `Slider`. See `StyleSheet.js` and
43
+ * `DeprecatedViewStylePropTypes.js` for more info.
44
+ */
45
+ style?: StyleProp<ViewStyle>;
46
+
47
+ /**
48
+ * Write-only property representing the value of the slider.
49
+ * Can be used to programmatically control the position of the thumb.
50
+ * Entered once at the beginning still acts as an initial value.
51
+ * The value should be between minimumValue and maximumValue,
52
+ * which default to 0 and 1 respectively.
53
+ * Default value is 0.
54
+ *
55
+ * This is not a controlled component, you don't need to update the
56
+ * value during dragging.
57
+ */
58
+ value?: number;
59
+
60
+ /**
61
+ * Step value of the slider. The value should be
62
+ * between 0 and (maximumValue - minimumValue).
63
+ * Default value is 0.
64
+ */
65
+ step?: number;
66
+
67
+ /**
68
+ * Initial minimum value of the slider. Default value is 0.
69
+ */
70
+ minimumValue?: number;
71
+
72
+ /**
73
+ * Initial maximum value of the slider. Default value is 1.
74
+ */
75
+ maximumValue?: number;
76
+
77
+ /**
78
+ * The color used for the track to the left of the button.
79
+ * Overrides the default blue gradient image on iOS.
80
+ */
81
+ minimumTrackTintColor?: ColorValue;
82
+
83
+ /**
84
+ * The color used for the track to the right of the button.
85
+ * Overrides the default blue gradient image on iOS.
86
+ */
87
+ maximumTrackTintColor?: ColorValue;
88
+ /**
89
+ * The color used to tint the default thumb images on iOS, or the
90
+ * color of the foreground switch grip on Android.
91
+ */
92
+ thumbTintColor?: ColorValue;
93
+
94
+ /**
95
+ * If true the user won't be able to move the slider.
96
+ * Default value is false.
97
+ */
98
+ disabled?: boolean;
99
+
100
+ /**
101
+ * Callback continuously called while the user is dragging the slider.
102
+ */
103
+ onValueChange?: (value: number) => void;
104
+
105
+ /**
106
+ * Callback that is called when the user releases the slider,
107
+ * regardless if the value has changed. The current value is passed
108
+ * as an argument to the callback handler.
109
+ */
110
+ onSlidingComplete?: (value: number) => void;
111
+
112
+ /**
113
+ * Used to locate this view in UI automation tests.
114
+ */
115
+ testID?: string;
116
+
117
+ /**
118
+ * Sets an image for the thumb. Only static images are supported.
119
+ */
120
+ thumbImage?: ImageSource;
121
+
122
+ /**
123
+ * If true the slider will be inverted.
124
+ * Default value is false.
125
+ */
126
+ inverted?: boolean;
127
+ }>;
128
+
129
+ const SliderComponent = (
130
+ props: Props,
131
+ forwardedRef?: Ref<typeof RCTSliderNativeComponent>,
132
+ ) => {
133
+ const style = !props.style?.height ? StyleSheet.compose(props.style, styles.slider) : StyleSheet.compose(props.style, {});
134
+ const {
135
+ onValueChange,
136
+ onSlidingComplete,
137
+ minimumTrackTintColor,
138
+ maximumTrackTintColor,
139
+ thumbTintColor,
140
+ ...localProps
141
+ } = props;
142
+
143
+ const onValueChangeEvent = onValueChange
144
+ ? (event: Event) => {
145
+ onValueChange(event.nativeEvent.value);
146
+ }
147
+ : null;
148
+
149
+ const onSlidingCompleteEvent = onSlidingComplete
150
+ ? (event: Event) => {
151
+ onSlidingComplete(event.nativeEvent.value);
152
+ }
153
+ : null;
154
+
155
+ const value =
156
+ Number.isNaN(props.value) || !props.value ? undefined : props.value;
157
+
158
+ const processedColors = {
159
+ minimumTrackTintColor: processColor(minimumTrackTintColor),
160
+ maximumTrackTintColor: processColor(maximumTrackTintColor),
161
+ thumbTintColor: processColor(thumbTintColor),
162
+ }
163
+
164
+ return (
165
+ <RCTSliderNativeComponent
166
+ {...localProps}
167
+ {...processedColors}
168
+ value={value}
169
+ thumbImage={
170
+ Platform.OS === 'web'
171
+ ? props.thumbImage
172
+ : props.thumbImage
173
+ ? Image.resolveAssetSource(props.thumbImage)
174
+ : undefined
175
+ }
176
+ ref={forwardedRef}
177
+ style={style}
178
+ onChange={onValueChangeEvent}
179
+ onRNSliderSlidingComplete={onSlidingCompleteEvent}
180
+ onRNSliderValueChange={onValueChangeEvent}
181
+ disabled={!!props.disabled}
182
+ onStartShouldSetResponder={() => true}
183
+ onResponderTerminationRequest={() => false}
184
+ />
185
+ );
186
+ };
187
+
188
+ const SliderWithRef = React.forwardRef(SliderComponent);
189
+
190
+ SliderWithRef.defaultProps = {
191
+ value: 0,
192
+ minimumValue: 0,
193
+ maximumValue: 1,
194
+ step: 0.01,
195
+ inverted: false,
196
+ };
197
+
198
+ let styles = StyleSheet.create({
199
+ slider: {
200
+ height: 40
201
+ },
202
+ });
203
+
204
+ export default SliderWithRef;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Copyright (c) 2025 Huawei Technologies Co., Ltd.
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 React, { forwardRef } from 'react';
9
+ import RNOHTextInput from '@react-native-oh/react-native-harmony/Libraries/Components/TextInput/TextInput';
10
+
11
+ /**
12
+ * Wraps RNOHTextInput to alias autoCompleteType prop as autoComplete
13
+ */
14
+ const TextInput = forwardRef((props, ref) => {
15
+ const { autoCompleteType, ...otherProps } = props;
16
+
17
+ const autoComplete = autoCompleteType ? autoCompleteType : props.autoComplete;
18
+
19
+ return <RNOHTextInput ref={ref} {...otherProps} autoComplete={autoComplete} />;
20
+ });
21
+
22
+ TextInput.displayName = 'TextInput';
23
+
24
+ export default TextInput;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) 2025 Huawei Technologies Co., Ltd.
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
+ /**
9
+ * Implements a module with the interface of [TimePickerAndroid](https://reactnative-archive-august-2023.netlify.app/docs/0.61/datepickerandroid)
10
+ * mode='clock' is not supported since the platform doesn't provide a directly analogous component.
11
+ * This is, however, purely cosmetic and no functional features are missing.
12
+ */
13
+
14
+ import NativeTimePickerAndroid from "../../../src/private/specs/NativeTimePickerAndroid";
15
+
16
+ export default {
17
+ open: NativeTimePickerAndroid.open,
18
+ timeSetAction: "timeSetAction",
19
+ dismissedAction: "dismissedAction",
20
+ };
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Copyright (c) 2025 Huawei Technologies Co., Ltd.
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
+ 'use strict';
9
+
10
+ /**
11
+ * Interop‑61: restore RN 0.61 public `setOpacityTo(toValue, duration)` on Harmony 0.77+.
12
+ *
13
+ * Context:
14
+ * - In RN 0.61, `TouchableOpacity` exposed public `setOpacityTo`; later it became private (`_setOpacityTo`) and disappeared from the ref.
15
+ * - RNOH exports `TouchableOpacity` as a forwardRef; the class instance is not on the ref. We added a non‑breaking named export `.TouchableOpacity` (the class) via a small patch.
16
+ *
17
+ * Strategy:
18
+ * - Prefer the class export and expose legacy `setOpacityTo` by delegating to `_setOpacityTo`.
19
+ * - Keep a minimal ref passthrough so common view methods (`setNativeProps`, `measure`, `measureInWindow`) work; forward other unknown members to the underlying Animated.View via a small Proxy.
20
+ * - Fallback: when the class export is unavailable, render the default forwardRef and surface `setOpacityTo` as a dev‑warning no‑op.
21
+ *
22
+ * Note: we do not reimplement `TouchableOpacity`; the shim is minimal and idempotent.
23
+ */
24
+
25
+ const React = require('react');
26
+
27
+ const HarmonyTouchableModule = require('@react-native-oh/react-native-harmony/Libraries/Components/Touchable/TouchableOpacity');
28
+ const TouchableOpacityClass = HarmonyTouchableModule.TouchableOpacity; // the class (if patched)
29
+ const TouchableDefault = HarmonyTouchableModule; // the default export (forwardRef)
30
+
31
+ const Touchable = React.forwardRef((props, forwardedRef) => {
32
+ const hostRef = React.useRef(null);
33
+ const classRef = React.useRef(null);
34
+
35
+ // Keep upstream behavior: pass the native ref down as `hostRef`
36
+ // (used by Animated.View). Additionally, hold `classRef` to call setOpacityTo.
37
+ React.useImperativeHandle(forwardedRef, () => {
38
+ const host = hostRef.current;
39
+ const klass = classRef.current;
40
+ const api = {
41
+ // RN 0.61 legacy API:
42
+ setOpacityTo: (toValue, duration) => {
43
+ if (klass && typeof klass._setOpacityTo === 'function') {
44
+ klass._setOpacityTo(toValue, duration);
45
+ } else if (__DEV__) {
46
+ // eslint-disable-next-line no-console
47
+ console.warn(
48
+ '[interop-61] TouchableOpacity: setOpacityTo is a no-op (class export unavailable)',
49
+ );
50
+ }
51
+ },
52
+ // Common proxies to host ref:
53
+ setNativeProps: host?.setNativeProps?.bind(host),
54
+ measure: host?.measure?.bind(host),
55
+ measureInWindow: host?.measureInWindow?.bind(host),
56
+ // Debug/escape hatch:
57
+ __nativeRef: host,
58
+ __instanceRef: klass,
59
+ };
60
+
61
+ // Minimal proxy: forward unknown properties/methods to host ref
62
+ // (the Animated.View ref that TouchableOpacity renders).
63
+ if (typeof Proxy === 'function') {
64
+ return new Proxy(api, {
65
+ get(target, prop, receiver) {
66
+ if (prop in target) {
67
+ return Reflect.get(target, prop, receiver);
68
+ }
69
+ const currentHost = hostRef.current;
70
+ if (!currentHost) return undefined;
71
+ const value = currentHost[prop];
72
+ return typeof value === 'function' ? value.bind(currentHost) : value;
73
+ },
74
+ });
75
+ }
76
+
77
+ return api;
78
+ });
79
+
80
+ if (TouchableOpacityClass) {
81
+ return React.createElement(TouchableOpacityClass, {...props, hostRef, ref: classRef});
82
+ }
83
+ // Fallback: render default forwardRef (no class instance available)
84
+ return React.createElement(TouchableDefault, {...props, ref: hostRef});
85
+ });
86
+
87
+ Touchable.displayName = 'TouchableOpacity';
88
+
89
+ module.exports = Touchable;
90
+ module.exports.default = module.exports;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright (c) 2025 Huawei Technologies Co., Ltd.
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
+ 'use strict';
8
+
9
+ /**
10
+ * Deep-import alias for RN 0.61 compatibility
11
+ */
12
+
13
+ const getNoopPropType = require('../../../compat/getNoopPropType');
14
+
15
+ module.exports = { style: getNoopPropType('style') };
16
+ module.exports.default = module.exports;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Copyright (c) 2025 Huawei Technologies Co., Ltd.
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
+ /**
9
+ * Map legacy RN61 accessibilityStates array to modern accessibilityState object.
10
+ * If both are provided, values from accessibilityState take precedence.
11
+ */
12
+ export function convertAccessibilityStates(props) {
13
+ const statesSupportedIn61 = [
14
+ 'selected',
15
+ 'disabled',
16
+ 'checked',
17
+ 'unchecked',
18
+ 'busy',
19
+ 'expanded',
20
+ 'collapsed',
21
+ 'hasPopup',
22
+ ];
23
+
24
+ if (!props) {
25
+ return props;
26
+ }
27
+
28
+ const { accessibilityStates, accessibilityState, ...rest } = props;
29
+ const isActivatedByStateName =
30
+ Array.isArray(accessibilityStates) && accessibilityStates.length
31
+ ? accessibilityStates
32
+ .filter((state) => statesSupportedIn61.includes(state))
33
+ .reduce((acc, state) => {
34
+ acc[state] = true;
35
+ return acc;
36
+ }, {})
37
+ : undefined;
38
+
39
+ if (isActivatedByStateName || accessibilityState) {
40
+ return {
41
+ ...rest,
42
+ accessibilityState: {
43
+ ...(isActivatedByStateName || {}),
44
+ ...(accessibilityState || {}),
45
+ },
46
+ };
47
+ }
48
+ return rest;
49
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright (c) 2025 Huawei Technologies Co., Ltd.
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
+ 'use strict';
8
+
9
+ /**
10
+ * Reports the React Native version expected by 61 interop apps.
11
+ * Keep in sync with Platform.harmony.ts
12
+ **/
13
+
14
+ const version = {
15
+ major: 0,
16
+ minor: 61,
17
+ patch: 5,
18
+ prerelease: null,
19
+ };
20
+
21
+ module.exports = {version};
@@ -0,0 +1,18 @@
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
+ * @flow strict
8
+ * @format
9
+ */
10
+
11
+ 'use strict';
12
+
13
+ const {
14
+ polyfillGlobal,
15
+ } = require('@react-native-oh/react-native-harmony/Libraries/Utilities/PolyfillFunctions');
16
+
17
+ // RNOH 0.61 PATCH: use polyfilled promise, so that done() is supported
18
+ polyfillGlobal('Promise', () => require('../Promise'));
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright (c) 2025 Huawei Technologies Co., Ltd.
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
+ 'use strict';
8
+
9
+ // Load polyfills as early as possible in RN bootstrap (InitializeCore)
10
+ require('../../polyfills/dateSlash');
11
+
12
+ // Delegate to Harmony's original setUpPlatform
13
+ module.exports = require('@react-native-oh/react-native-harmony/Libraries/Core/setUpPlatform');
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright (c) 2025 Huawei Technologies Co., Ltd.
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
+ 'use strict';
8
+
9
+ /**
10
+ * Deep-import alias for RN 0.61 compatibility
11
+ */
12
+
13
+ const getNoopPropType = require('../../compat/getNoopPropType');
14
+
15
+ module.exports = getNoopPropType('ColorPropType');
16
+ module.exports.default = module.exports;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright (c) 2025 Huawei Technologies Co., Ltd.
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
+ 'use strict';
8
+
9
+ /**
10
+ * Deep-import alias for RN 0.61 compatibility
11
+ */
12
+
13
+ const getNoopPropType = require('../../compat/getNoopPropType');
14
+
15
+ module.exports = getNoopPropType('EdgeInsetsPropType');
16
+ module.exports.default = module.exports;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright (c) 2025 Huawei Technologies Co., Ltd.
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
+ 'use strict';
8
+
9
+ /**
10
+ * Deep-import alias for RN 0.61 compatibility
11
+ * Returns empty object as a no-op replacement for legacy PropTypes maps
12
+ */
13
+
14
+ module.exports = {};
15
+ module.exports.default = module.exports;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright (c) 2025 Huawei Technologies Co., Ltd.
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
+ 'use strict';
8
+
9
+ /**
10
+ * Deep-import alias for RN 0.61 compatibility
11
+ */
12
+
13
+ const getNoopPropType = require('../../compat/getNoopPropType');
14
+
15
+ module.exports = getNoopPropType('ImageSourcePropType');
16
+ module.exports.default = module.exports;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright (c) 2025 Huawei Technologies Co., Ltd.
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
+ 'use strict';
8
+
9
+ /**
10
+ * Deep-import alias for RN 0.61 compatibility
11
+ * Returns empty object as a no-op replacement for legacy PropTypes maps
12
+ */
13
+
14
+ module.exports = {};
15
+ module.exports.default = module.exports;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright (c) 2025 Huawei Technologies Co., Ltd.
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
+ 'use strict';
8
+
9
+ /**
10
+ * Deep-import alias for RN 0.61 compatibility
11
+ * Returns empty object as a no-op replacement for legacy PropTypes maps
12
+ */
13
+
14
+ module.exports = {};
15
+ module.exports.default = module.exports;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright (c) 2025 Huawei Technologies Co., Ltd.
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
+ 'use strict';
8
+
9
+ /**
10
+ * Deep-import alias for RN 0.61 compatibility
11
+ */
12
+
13
+ const getNoopPropType = require('../../compat/getNoopPropType');
14
+
15
+ module.exports = getNoopPropType('PointPropType');
16
+ module.exports.default = module.exports;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright (c) 2025 Huawei Technologies Co., Ltd.
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
+ 'use strict';
8
+
9
+ /**
10
+ * Deep-import alias for RN 0.61 compatibility
11
+ * Returns empty object as a no-op replacement for legacy PropTypes maps
12
+ */
13
+
14
+ module.exports = {};
15
+ module.exports.default = module.exports;