@react-native-oh/react-native-harmony 0.72.23-3 → 0.72.27
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/Alert/Alert.harmony.js +71 -71
- package/Libraries/Alert/AlertManager.ts +35 -35
- package/Libraries/Animated/NativeAnimatedHelper.harmony.js +601 -601
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.harmony.js +445 -426
- package/Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.harmony.js +30 -0
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.harmony.js +26 -0
- package/Libraries/Components/Button/Button.harmony.js +450 -450
- package/Libraries/Components/Image/Image.flow.harmony.js +53 -0
- package/Libraries/Components/Image/Image.harmony.js +299 -0
- package/Libraries/Components/Image/NativeImageLoaderHarmony.js +38 -0
- package/Libraries/Components/RefreshControl/RefreshControl.harmony.js +210 -210
- package/Libraries/Components/SafeAreaView/SafeAreaView.harmony.tsx +76 -75
- package/Libraries/Components/ScrollView/ScrollView.harmony.js +1951 -1951
- package/Libraries/Components/ScrollView/processDecelerationRate.harmony.js +24 -24
- package/Libraries/Components/StatusBar/NativeStatusBarManagerHarmony.js +71 -68
- package/Libraries/Components/StatusBar/StatusBar.harmony.js +447 -447
- package/Libraries/Components/TextInput/TextInput.harmony.js +1707 -1707
- package/Libraries/Components/TextInput/TextInputState.harmony.js +220 -220
- package/Libraries/Components/Touchable/TouchableHighlight.harmony.js +396 -396
- package/Libraries/Components/Touchable/TouchableNativeFeedback.harmony.js +364 -364
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.harmony.js +227 -227
- package/Libraries/Components/View/View.harmony.js +149 -149
- package/Libraries/Core/setUpReactDevTools.harmony.js +93 -93
- package/Libraries/Image/AssetSourceResolver.harmony.ts +78 -78
- package/Libraries/NativeComponent/BaseViewConfig.harmony.js +337 -337
- package/Libraries/ReactNative/UIManager.harmony.js +210 -210
- package/Libraries/Settings/Settings.harmony.js +15 -15
- package/Libraries/Share/Share.harmony.js +174 -174
- package/Libraries/StyleSheet/NativePlatformColor.ts +8 -8
- package/Libraries/StyleSheet/PlatformColorValueTypes.harmony.ts +14 -14
- package/Libraries/Utilities/BackHandler.harmony.js +109 -109
- package/Libraries/Utilities/{NativePlatformConstantsHarmony.ts → NativePlatformConstants.harmony.ts} +8 -8
- package/Libraries/Utilities/Platform.d.ts +117 -117
- package/Libraries/Utilities/Platform.harmony.ts +33 -33
- package/Libraries/Utilities/createPerformanceLogger.harmony.js +328 -328
- package/Libraries/Vibration/Vibration.harmony.js +88 -88
- package/index.js +212 -212
- package/jest.config.js +5 -5
- package/metro.config.js +348 -348
- package/package.json +57 -57
- package/react-native.config.js +10 -10
- package/react_native_openharmony.har +0 -0
- package/tsconfig.json +13 -13
- package/types/index.d.ts +101 -101
|
@@ -1,117 +1,117 @@
|
|
|
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
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @see https://reactnative.dev/docs/platform-specific-code#content
|
|
12
|
-
*/
|
|
13
|
-
export type PlatformOSType =
|
|
14
|
-
| 'ios'
|
|
15
|
-
| 'android'
|
|
16
|
-
| 'macos'
|
|
17
|
-
| 'windows'
|
|
18
|
-
| 'web'
|
|
19
|
-
| "harmony" // RNOH: patch
|
|
20
|
-
| 'native';
|
|
21
|
-
type PlatformConstants = {
|
|
22
|
-
isTesting: boolean;
|
|
23
|
-
reactNativeVersion: {
|
|
24
|
-
major: number;
|
|
25
|
-
minor: number;
|
|
26
|
-
patch: number;
|
|
27
|
-
prerelease?: number | null | undefined;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
interface PlatformStatic {
|
|
31
|
-
isTV: boolean;
|
|
32
|
-
isTesting: boolean;
|
|
33
|
-
Version: number | string;
|
|
34
|
-
constants: PlatformConstants;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* @see https://reactnative.dev/docs/platform-specific-code#content
|
|
38
|
-
*/
|
|
39
|
-
select<T>(
|
|
40
|
-
specifics:
|
|
41
|
-
| ({ [platform in PlatformOSType]?: T } & { default: T; })
|
|
42
|
-
| { [platform in PlatformOSType]: T },
|
|
43
|
-
): T;
|
|
44
|
-
select<T>(specifics: { [platform in PlatformOSType]?: T }): T | undefined;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
interface PlatformIOSStatic extends PlatformStatic {
|
|
48
|
-
constants: PlatformConstants & {
|
|
49
|
-
forceTouchAvailable: boolean;
|
|
50
|
-
interfaceIdiom: string;
|
|
51
|
-
osVersion: string;
|
|
52
|
-
systemName: string;
|
|
53
|
-
};
|
|
54
|
-
OS: 'ios';
|
|
55
|
-
isPad: boolean;
|
|
56
|
-
isTV: boolean;
|
|
57
|
-
Version: string;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
interface PlatformAndroidStatic extends PlatformStatic {
|
|
61
|
-
constants: PlatformConstants & {
|
|
62
|
-
Version: number;
|
|
63
|
-
Release: string;
|
|
64
|
-
Serial: string;
|
|
65
|
-
Fingerprint: string;
|
|
66
|
-
Model: string;
|
|
67
|
-
Brand: string;
|
|
68
|
-
Manufacturer: string;
|
|
69
|
-
ServerHost?: string | undefined;
|
|
70
|
-
uiMode: 'car' | 'desk' | 'normal' | 'tv' | 'watch' | 'unknown';
|
|
71
|
-
};
|
|
72
|
-
OS: 'android';
|
|
73
|
-
Version: number;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
interface PlatformMacOSStatic extends PlatformStatic {
|
|
77
|
-
OS: 'macos';
|
|
78
|
-
Version: string;
|
|
79
|
-
constants: PlatformConstants & {
|
|
80
|
-
osVersion: string;
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
interface PlatformWindowsOSStatic extends PlatformStatic {
|
|
85
|
-
OS: 'windows';
|
|
86
|
-
Version: number;
|
|
87
|
-
constants: PlatformConstants & {
|
|
88
|
-
osVersion: number;
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
interface PlatformWebStatic extends PlatformStatic {
|
|
93
|
-
OS: 'web';
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// begin RNOH: patch
|
|
97
|
-
export type PlatformHarmonyConstants = PlatformConstants & {
|
|
98
|
-
deviceType: "default" | "phone" | "wearable" | "liteWearable" | "tablet" | "tv" | "car" | "smartVision";
|
|
99
|
-
osFullName: string;
|
|
100
|
-
Model: string;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export interface PlatformHarmonyStatic extends PlatformStatic {
|
|
104
|
-
OS: 'harmony';
|
|
105
|
-
constants: PlatformHarmonyConstants;
|
|
106
|
-
}
|
|
107
|
-
// end RNOH: patch
|
|
108
|
-
|
|
109
|
-
export type Platform =
|
|
110
|
-
| PlatformIOSStatic
|
|
111
|
-
| PlatformAndroidStatic
|
|
112
|
-
| PlatformWindowsOSStatic
|
|
113
|
-
| PlatformMacOSStatic
|
|
114
|
-
| PlatformWebStatic
|
|
115
|
-
| PlatformHarmonyStatic; // RNOH: patch
|
|
116
|
-
|
|
117
|
-
export const Platform: Platform;
|
|
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
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @see https://reactnative.dev/docs/platform-specific-code#content
|
|
12
|
+
*/
|
|
13
|
+
export type PlatformOSType =
|
|
14
|
+
| 'ios'
|
|
15
|
+
| 'android'
|
|
16
|
+
| 'macos'
|
|
17
|
+
| 'windows'
|
|
18
|
+
| 'web'
|
|
19
|
+
| "harmony" // RNOH: patch
|
|
20
|
+
| 'native';
|
|
21
|
+
type PlatformConstants = {
|
|
22
|
+
isTesting: boolean;
|
|
23
|
+
reactNativeVersion: {
|
|
24
|
+
major: number;
|
|
25
|
+
minor: number;
|
|
26
|
+
patch: number;
|
|
27
|
+
prerelease?: number | null | undefined;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
interface PlatformStatic {
|
|
31
|
+
isTV: boolean;
|
|
32
|
+
isTesting: boolean;
|
|
33
|
+
Version: number | string;
|
|
34
|
+
constants: PlatformConstants;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @see https://reactnative.dev/docs/platform-specific-code#content
|
|
38
|
+
*/
|
|
39
|
+
select<T>(
|
|
40
|
+
specifics:
|
|
41
|
+
| ({ [platform in PlatformOSType]?: T } & { default: T; })
|
|
42
|
+
| { [platform in PlatformOSType]: T },
|
|
43
|
+
): T;
|
|
44
|
+
select<T>(specifics: { [platform in PlatformOSType]?: T }): T | undefined;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface PlatformIOSStatic extends PlatformStatic {
|
|
48
|
+
constants: PlatformConstants & {
|
|
49
|
+
forceTouchAvailable: boolean;
|
|
50
|
+
interfaceIdiom: string;
|
|
51
|
+
osVersion: string;
|
|
52
|
+
systemName: string;
|
|
53
|
+
};
|
|
54
|
+
OS: 'ios';
|
|
55
|
+
isPad: boolean;
|
|
56
|
+
isTV: boolean;
|
|
57
|
+
Version: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
interface PlatformAndroidStatic extends PlatformStatic {
|
|
61
|
+
constants: PlatformConstants & {
|
|
62
|
+
Version: number;
|
|
63
|
+
Release: string;
|
|
64
|
+
Serial: string;
|
|
65
|
+
Fingerprint: string;
|
|
66
|
+
Model: string;
|
|
67
|
+
Brand: string;
|
|
68
|
+
Manufacturer: string;
|
|
69
|
+
ServerHost?: string | undefined;
|
|
70
|
+
uiMode: 'car' | 'desk' | 'normal' | 'tv' | 'watch' | 'unknown';
|
|
71
|
+
};
|
|
72
|
+
OS: 'android';
|
|
73
|
+
Version: number;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
interface PlatformMacOSStatic extends PlatformStatic {
|
|
77
|
+
OS: 'macos';
|
|
78
|
+
Version: string;
|
|
79
|
+
constants: PlatformConstants & {
|
|
80
|
+
osVersion: string;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
interface PlatformWindowsOSStatic extends PlatformStatic {
|
|
85
|
+
OS: 'windows';
|
|
86
|
+
Version: number;
|
|
87
|
+
constants: PlatformConstants & {
|
|
88
|
+
osVersion: number;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
interface PlatformWebStatic extends PlatformStatic {
|
|
93
|
+
OS: 'web';
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// begin RNOH: patch
|
|
97
|
+
export type PlatformHarmonyConstants = PlatformConstants & {
|
|
98
|
+
deviceType: "default" | "phone" | "wearable" | "liteWearable" | "tablet" | "tv" | "car" | "smartVision";
|
|
99
|
+
osFullName: string;
|
|
100
|
+
Model: string;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export interface PlatformHarmonyStatic extends PlatformStatic {
|
|
104
|
+
OS: 'harmony';
|
|
105
|
+
constants: PlatformHarmonyConstants;
|
|
106
|
+
}
|
|
107
|
+
// end RNOH: patch
|
|
108
|
+
|
|
109
|
+
export type Platform =
|
|
110
|
+
| PlatformIOSStatic
|
|
111
|
+
| PlatformAndroidStatic
|
|
112
|
+
| PlatformWindowsOSStatic
|
|
113
|
+
| PlatformMacOSStatic
|
|
114
|
+
| PlatformWebStatic
|
|
115
|
+
| PlatformHarmonyStatic; // RNOH: patch
|
|
116
|
+
|
|
117
|
+
export const Platform: Platform;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { NativePlatformConstantsHarmony } from "./
|
|
2
|
-
import type { PlatformHarmonyStatic, PlatformHarmonyConstants, PlatformOSType } from "./Platform";
|
|
3
|
-
|
|
4
|
-
const Platform = {
|
|
5
|
-
__constants: undefined as undefined | PlatformHarmonyConstants,
|
|
6
|
-
OS: 'harmony' as const,
|
|
7
|
-
get constants() {
|
|
8
|
-
if (this.__constants == null) {
|
|
9
|
-
this.__constants = NativePlatformConstantsHarmony.getConstants();
|
|
10
|
-
}
|
|
11
|
-
return this.__constants;
|
|
12
|
-
},
|
|
13
|
-
get Version() {
|
|
14
|
-
return this.constants.osFullName;
|
|
15
|
-
},
|
|
16
|
-
get isPad() {
|
|
17
|
-
return this.constants.deviceType === 'tablet';
|
|
18
|
-
},
|
|
19
|
-
get isTV() {
|
|
20
|
-
return this.constants.deviceType === 'tv';
|
|
21
|
-
},
|
|
22
|
-
get isTesting() {
|
|
23
|
-
if (__DEV__) {
|
|
24
|
-
return this.constants.isTesting;
|
|
25
|
-
}
|
|
26
|
-
return false;
|
|
27
|
-
},
|
|
28
|
-
select<T>(spec: ({ [platform in PlatformOSType]?: T } & { default: T; }) | { [platform in PlatformOSType]: T }) {
|
|
29
|
-
return 'harmony' in spec ? spec.harmony : 'native' in spec ? spec.native : spec.default;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
module.exports = Platform as PlatformHarmonyStatic;
|
|
1
|
+
import { NativePlatformConstantsHarmony } from "./NativePlatformConstants";
|
|
2
|
+
import type { PlatformHarmonyStatic, PlatformHarmonyConstants, PlatformOSType } from "./Platform";
|
|
3
|
+
|
|
4
|
+
const Platform = {
|
|
5
|
+
__constants: undefined as undefined | PlatformHarmonyConstants,
|
|
6
|
+
OS: 'harmony' as const,
|
|
7
|
+
get constants() {
|
|
8
|
+
if (this.__constants == null) {
|
|
9
|
+
this.__constants = NativePlatformConstantsHarmony.getConstants();
|
|
10
|
+
}
|
|
11
|
+
return this.__constants;
|
|
12
|
+
},
|
|
13
|
+
get Version() {
|
|
14
|
+
return this.constants.osFullName;
|
|
15
|
+
},
|
|
16
|
+
get isPad() {
|
|
17
|
+
return this.constants.deviceType === 'tablet';
|
|
18
|
+
},
|
|
19
|
+
get isTV() {
|
|
20
|
+
return this.constants.deviceType === 'tv';
|
|
21
|
+
},
|
|
22
|
+
get isTesting() {
|
|
23
|
+
if (__DEV__) {
|
|
24
|
+
return this.constants.isTesting;
|
|
25
|
+
}
|
|
26
|
+
return false;
|
|
27
|
+
},
|
|
28
|
+
select<T>(spec: ({ [platform in PlatformOSType]?: T } & { default: T; }) | { [platform in PlatformOSType]: T }) {
|
|
29
|
+
return 'harmony' in spec ? spec.harmony : 'native' in spec ? spec.native : spec.default;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
module.exports = Platform as PlatformHarmonyStatic;
|