@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.
Files changed (44) hide show
  1. package/Libraries/Alert/Alert.harmony.js +71 -71
  2. package/Libraries/Alert/AlertManager.ts +35 -35
  3. package/Libraries/Animated/NativeAnimatedHelper.harmony.js +601 -601
  4. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.harmony.js +445 -426
  5. package/Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.harmony.js +30 -0
  6. package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.harmony.js +26 -0
  7. package/Libraries/Components/Button/Button.harmony.js +450 -450
  8. package/Libraries/Components/Image/Image.flow.harmony.js +53 -0
  9. package/Libraries/Components/Image/Image.harmony.js +299 -0
  10. package/Libraries/Components/Image/NativeImageLoaderHarmony.js +38 -0
  11. package/Libraries/Components/RefreshControl/RefreshControl.harmony.js +210 -210
  12. package/Libraries/Components/SafeAreaView/SafeAreaView.harmony.tsx +76 -75
  13. package/Libraries/Components/ScrollView/ScrollView.harmony.js +1951 -1951
  14. package/Libraries/Components/ScrollView/processDecelerationRate.harmony.js +24 -24
  15. package/Libraries/Components/StatusBar/NativeStatusBarManagerHarmony.js +71 -68
  16. package/Libraries/Components/StatusBar/StatusBar.harmony.js +447 -447
  17. package/Libraries/Components/TextInput/TextInput.harmony.js +1707 -1707
  18. package/Libraries/Components/TextInput/TextInputState.harmony.js +220 -220
  19. package/Libraries/Components/Touchable/TouchableHighlight.harmony.js +396 -396
  20. package/Libraries/Components/Touchable/TouchableNativeFeedback.harmony.js +364 -364
  21. package/Libraries/Components/Touchable/TouchableWithoutFeedback.harmony.js +227 -227
  22. package/Libraries/Components/View/View.harmony.js +149 -149
  23. package/Libraries/Core/setUpReactDevTools.harmony.js +93 -93
  24. package/Libraries/Image/AssetSourceResolver.harmony.ts +78 -78
  25. package/Libraries/NativeComponent/BaseViewConfig.harmony.js +337 -337
  26. package/Libraries/ReactNative/UIManager.harmony.js +210 -210
  27. package/Libraries/Settings/Settings.harmony.js +15 -15
  28. package/Libraries/Share/Share.harmony.js +174 -174
  29. package/Libraries/StyleSheet/NativePlatformColor.ts +8 -8
  30. package/Libraries/StyleSheet/PlatformColorValueTypes.harmony.ts +14 -14
  31. package/Libraries/Utilities/BackHandler.harmony.js +109 -109
  32. package/Libraries/Utilities/{NativePlatformConstantsHarmony.ts → NativePlatformConstants.harmony.ts} +8 -8
  33. package/Libraries/Utilities/Platform.d.ts +117 -117
  34. package/Libraries/Utilities/Platform.harmony.ts +33 -33
  35. package/Libraries/Utilities/createPerformanceLogger.harmony.js +328 -328
  36. package/Libraries/Vibration/Vibration.harmony.js +88 -88
  37. package/index.js +212 -212
  38. package/jest.config.js +5 -5
  39. package/metro.config.js +348 -348
  40. package/package.json +57 -57
  41. package/react-native.config.js +10 -10
  42. package/react_native_openharmony.har +0 -0
  43. package/tsconfig.json +13 -13
  44. package/types/index.d.ts +101 -101
@@ -1,210 +1,210 @@
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
8
- * @format
9
- */
10
-
11
- // RNOH patch: imports
12
- import type {RootTag} from 'react-native/Libraries/Types/RootTagTypes';
13
- import type {Spec} from 'react-native/Libraries/ReactNative/NativeUIManager';
14
-
15
- import {getFabricUIManager} from 'react-native/Libraries/ReactNative/FabricUIManager';
16
- import nullthrows from 'nullthrows';
17
-
18
- export interface UIManagerJSInterface extends Spec {
19
- +getViewManagerConfig: (viewManagerName: string) => Object;
20
- +hasViewManagerConfig: (viewManagerName: string) => boolean;
21
- +createView: (
22
- reactTag: ?number,
23
- viewName: string,
24
- rootTag: RootTag,
25
- props: Object,
26
- ) => void;
27
- +updateView: (reactTag: number, viewName: string, props: Object) => void;
28
- +manageChildren: (
29
- containerTag: ?number,
30
- moveFromIndices: Array<number>,
31
- moveToIndices: Array<number>,
32
- addChildReactTags: Array<number>,
33
- addAtIndices: Array<number>,
34
- removeAtIndices: Array<number>,
35
- ) => void;
36
- }
37
-
38
- function isFabricReactTag(reactTag: number): boolean {
39
- // React reserves even numbers for Fabric.
40
- return reactTag % 2 === 0;
41
- }
42
-
43
- // RNOH patch: always export BridgelessUIManager properties
44
- const BridgelessUIManager: UIManagerJSInterface = require('react-native/Libraries/ReactNative/BridgelessUIManager')
45
- const PaperUIManager: UIManagerJSInterface =
46
- global.RN$Bridgeless === true
47
- ? {}
48
- : require('react-native/Libraries/ReactNative/PaperUIManager');
49
-
50
- // $FlowFixMe[cannot-spread-interface]
51
- const UIManager = {
52
- ...BridgelessUIManager,
53
- ...PaperUIManager,
54
- measure(
55
- reactTag: number,
56
- callback: (
57
- left: number,
58
- top: number,
59
- width: number,
60
- height: number,
61
- pageX: number,
62
- pageY: number,
63
- ) => void,
64
- ): void {
65
- if (isFabricReactTag(reactTag)) {
66
- const FabricUIManager = nullthrows(getFabricUIManager());
67
- const shadowNode =
68
- FabricUIManager.findShadowNodeByTag_DEPRECATED(reactTag);
69
- if (shadowNode) {
70
- FabricUIManager.measure(shadowNode, callback);
71
- } else {
72
- console.warn(`measure cannot find view with tag #${reactTag}`);
73
- // $FlowFixMe[incompatible-call]
74
- callback();
75
- }
76
- } else {
77
- // Paper
78
- UIManagerImpl.measure(reactTag, callback);
79
- }
80
- },
81
-
82
- measureInWindow(
83
- reactTag: number,
84
- callback: (
85
- left: number,
86
- top: number,
87
- width: number,
88
- height: number,
89
- ) => void,
90
- ): void {
91
- if (isFabricReactTag(reactTag)) {
92
- const FabricUIManager = nullthrows(getFabricUIManager());
93
- const shadowNode =
94
- FabricUIManager.findShadowNodeByTag_DEPRECATED(reactTag);
95
- if (shadowNode) {
96
- FabricUIManager.measureInWindow(shadowNode, callback);
97
- } else {
98
- console.warn(`measure cannot find view with tag #${reactTag}`);
99
- // $FlowFixMe[incompatible-call]
100
- callback();
101
- }
102
- } else {
103
- // Paper
104
- UIManagerImpl.measureInWindow(reactTag, callback);
105
- }
106
- },
107
-
108
- measureLayout(
109
- reactTag: number,
110
- ancestorReactTag: number,
111
- errorCallback: (error: Object) => void,
112
- callback: (
113
- left: number,
114
- top: number,
115
- width: number,
116
- height: number,
117
- ) => void,
118
- ): void {
119
- if (isFabricReactTag(reactTag)) {
120
- const FabricUIManager = nullthrows(getFabricUIManager());
121
- const shadowNode =
122
- FabricUIManager.findShadowNodeByTag_DEPRECATED(reactTag);
123
- const ancestorShadowNode =
124
- FabricUIManager.findShadowNodeByTag_DEPRECATED(ancestorReactTag);
125
-
126
- if (!shadowNode || !ancestorShadowNode) {
127
- return;
128
- }
129
-
130
- FabricUIManager.measureLayout(
131
- shadowNode,
132
- ancestorShadowNode,
133
- errorCallback,
134
- callback,
135
- );
136
- } else {
137
- // Paper
138
- UIManagerImpl.measureLayout(
139
- reactTag,
140
- ancestorReactTag,
141
- errorCallback,
142
- callback,
143
- );
144
- }
145
- },
146
-
147
- measureLayoutRelativeToParent(
148
- reactTag: number,
149
- errorCallback: (error: Object) => void,
150
- callback: (
151
- left: number,
152
- top: number,
153
- width: number,
154
- height: number,
155
- ) => void,
156
- ): void {
157
- if (isFabricReactTag(reactTag)) {
158
- console.warn(
159
- 'RCTUIManager.measureLayoutRelativeToParent method is deprecated and it will not be implemented in newer versions of RN (Fabric) - T47686450',
160
- );
161
- const FabricUIManager = nullthrows(getFabricUIManager());
162
- const shadowNode =
163
- FabricUIManager.findShadowNodeByTag_DEPRECATED(reactTag);
164
- if (shadowNode) {
165
- FabricUIManager.measure(
166
- shadowNode,
167
- (left, top, width, height, pageX, pageY) => {
168
- callback(left, top, width, height);
169
- },
170
- );
171
- }
172
- } else {
173
- // Paper
174
- UIManagerImpl.measureLayoutRelativeToParent(
175
- reactTag,
176
- errorCallback,
177
- callback,
178
- );
179
- }
180
- },
181
-
182
- dispatchViewManagerCommand(
183
- reactTag: number,
184
- commandName: number | string,
185
- commandArgs: any[],
186
- ) {
187
- if (isFabricReactTag(reactTag)) {
188
- const FabricUIManager = nullthrows(getFabricUIManager());
189
- const shadowNode =
190
- FabricUIManager.findShadowNodeByTag_DEPRECATED(reactTag);
191
- if (shadowNode) {
192
- // Transform the accidental CommandID into a CommandName which is the stringified number.
193
- // The interop layer knows how to convert this number into the right method name.
194
- // Stringify a string is a no-op, so it's safe.
195
- commandName = `${commandName}`;
196
- FabricUIManager.dispatchCommand(shadowNode, commandName, commandArgs);
197
- }
198
- } else {
199
- UIManagerImpl.dispatchViewManagerCommand(
200
- reactTag,
201
- // We have some legacy components that are actually already using strings. ¯\_(ツ)_/¯
202
- // $FlowFixMe[incompatible-call]
203
- commandName,
204
- commandArgs,
205
- );
206
- }
207
- },
208
- };
209
-
210
- module.exports = UIManager;
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
8
+ * @format
9
+ */
10
+
11
+ // RNOH patch: imports
12
+ import type {RootTag} from 'react-native/Libraries/Types/RootTagTypes';
13
+ import type {Spec} from 'react-native/Libraries/ReactNative/NativeUIManager';
14
+
15
+ import {getFabricUIManager} from 'react-native/Libraries/ReactNative/FabricUIManager';
16
+ import nullthrows from 'nullthrows';
17
+
18
+ export interface UIManagerJSInterface extends Spec {
19
+ +getViewManagerConfig: (viewManagerName: string) => Object;
20
+ +hasViewManagerConfig: (viewManagerName: string) => boolean;
21
+ +createView: (
22
+ reactTag: ?number,
23
+ viewName: string,
24
+ rootTag: RootTag,
25
+ props: Object,
26
+ ) => void;
27
+ +updateView: (reactTag: number, viewName: string, props: Object) => void;
28
+ +manageChildren: (
29
+ containerTag: ?number,
30
+ moveFromIndices: Array<number>,
31
+ moveToIndices: Array<number>,
32
+ addChildReactTags: Array<number>,
33
+ addAtIndices: Array<number>,
34
+ removeAtIndices: Array<number>,
35
+ ) => void;
36
+ }
37
+
38
+ function isFabricReactTag(reactTag: number): boolean {
39
+ // React reserves even numbers for Fabric.
40
+ return reactTag % 2 === 0;
41
+ }
42
+
43
+ // RNOH patch: always export BridgelessUIManager properties
44
+ const BridgelessUIManager: UIManagerJSInterface = require('react-native/Libraries/ReactNative/BridgelessUIManager')
45
+ const PaperUIManager: UIManagerJSInterface =
46
+ global.RN$Bridgeless === true
47
+ ? {}
48
+ : require('react-native/Libraries/ReactNative/PaperUIManager');
49
+
50
+ // $FlowFixMe[cannot-spread-interface]
51
+ const UIManager = {
52
+ ...BridgelessUIManager,
53
+ ...PaperUIManager,
54
+ measure(
55
+ reactTag: number,
56
+ callback: (
57
+ left: number,
58
+ top: number,
59
+ width: number,
60
+ height: number,
61
+ pageX: number,
62
+ pageY: number,
63
+ ) => void,
64
+ ): void {
65
+ if (isFabricReactTag(reactTag)) {
66
+ const FabricUIManager = nullthrows(getFabricUIManager());
67
+ const shadowNode =
68
+ FabricUIManager.findShadowNodeByTag_DEPRECATED(reactTag);
69
+ if (shadowNode) {
70
+ FabricUIManager.measure(shadowNode, callback);
71
+ } else {
72
+ console.warn(`measure cannot find view with tag #${reactTag}`);
73
+ // $FlowFixMe[incompatible-call]
74
+ callback();
75
+ }
76
+ } else {
77
+ // Paper
78
+ UIManagerImpl.measure(reactTag, callback);
79
+ }
80
+ },
81
+
82
+ measureInWindow(
83
+ reactTag: number,
84
+ callback: (
85
+ left: number,
86
+ top: number,
87
+ width: number,
88
+ height: number,
89
+ ) => void,
90
+ ): void {
91
+ if (isFabricReactTag(reactTag)) {
92
+ const FabricUIManager = nullthrows(getFabricUIManager());
93
+ const shadowNode =
94
+ FabricUIManager.findShadowNodeByTag_DEPRECATED(reactTag);
95
+ if (shadowNode) {
96
+ FabricUIManager.measureInWindow(shadowNode, callback);
97
+ } else {
98
+ console.warn(`measure cannot find view with tag #${reactTag}`);
99
+ // $FlowFixMe[incompatible-call]
100
+ callback();
101
+ }
102
+ } else {
103
+ // Paper
104
+ UIManagerImpl.measureInWindow(reactTag, callback);
105
+ }
106
+ },
107
+
108
+ measureLayout(
109
+ reactTag: number,
110
+ ancestorReactTag: number,
111
+ errorCallback: (error: Object) => void,
112
+ callback: (
113
+ left: number,
114
+ top: number,
115
+ width: number,
116
+ height: number,
117
+ ) => void,
118
+ ): void {
119
+ if (isFabricReactTag(reactTag)) {
120
+ const FabricUIManager = nullthrows(getFabricUIManager());
121
+ const shadowNode =
122
+ FabricUIManager.findShadowNodeByTag_DEPRECATED(reactTag);
123
+ const ancestorShadowNode =
124
+ FabricUIManager.findShadowNodeByTag_DEPRECATED(ancestorReactTag);
125
+
126
+ if (!shadowNode || !ancestorShadowNode) {
127
+ return;
128
+ }
129
+
130
+ FabricUIManager.measureLayout(
131
+ shadowNode,
132
+ ancestorShadowNode,
133
+ errorCallback,
134
+ callback,
135
+ );
136
+ } else {
137
+ // Paper
138
+ UIManagerImpl.measureLayout(
139
+ reactTag,
140
+ ancestorReactTag,
141
+ errorCallback,
142
+ callback,
143
+ );
144
+ }
145
+ },
146
+
147
+ measureLayoutRelativeToParent(
148
+ reactTag: number,
149
+ errorCallback: (error: Object) => void,
150
+ callback: (
151
+ left: number,
152
+ top: number,
153
+ width: number,
154
+ height: number,
155
+ ) => void,
156
+ ): void {
157
+ if (isFabricReactTag(reactTag)) {
158
+ console.warn(
159
+ 'RCTUIManager.measureLayoutRelativeToParent method is deprecated and it will not be implemented in newer versions of RN (Fabric) - T47686450',
160
+ );
161
+ const FabricUIManager = nullthrows(getFabricUIManager());
162
+ const shadowNode =
163
+ FabricUIManager.findShadowNodeByTag_DEPRECATED(reactTag);
164
+ if (shadowNode) {
165
+ FabricUIManager.measure(
166
+ shadowNode,
167
+ (left, top, width, height, pageX, pageY) => {
168
+ callback(left, top, width, height);
169
+ },
170
+ );
171
+ }
172
+ } else {
173
+ // Paper
174
+ UIManagerImpl.measureLayoutRelativeToParent(
175
+ reactTag,
176
+ errorCallback,
177
+ callback,
178
+ );
179
+ }
180
+ },
181
+
182
+ dispatchViewManagerCommand(
183
+ reactTag: number,
184
+ commandName: number | string,
185
+ commandArgs: any[],
186
+ ) {
187
+ if (isFabricReactTag(reactTag)) {
188
+ const FabricUIManager = nullthrows(getFabricUIManager());
189
+ const shadowNode =
190
+ FabricUIManager.findShadowNodeByTag_DEPRECATED(reactTag);
191
+ if (shadowNode) {
192
+ // Transform the accidental CommandID into a CommandName which is the stringified number.
193
+ // The interop layer knows how to convert this number into the right method name.
194
+ // Stringify a string is a no-op, so it's safe.
195
+ commandName = `${commandName}`;
196
+ FabricUIManager.dispatchCommand(shadowNode, commandName, commandArgs);
197
+ }
198
+ } else {
199
+ UIManagerImpl.dispatchViewManagerCommand(
200
+ reactTag,
201
+ // We have some legacy components that are actually already using strings. ¯\_(ツ)_/¯
202
+ // $FlowFixMe[incompatible-call]
203
+ commandName,
204
+ commandArgs,
205
+ );
206
+ }
207
+ },
208
+ };
209
+
210
+ module.exports = UIManager;
@@ -1,15 +1,15 @@
1
- const Settings = {
2
- get(key: string): mixed {
3
- return null;
4
- },
5
-
6
- set(settings: Object) {},
7
-
8
- watchKeys(keys: string | Array<string>, callback: Function): number {
9
- return -1;
10
- },
11
-
12
- clearWatch(watchId: number) {},
13
- };
14
-
15
- module.exports = Settings;
1
+ const Settings = {
2
+ get(key: string): mixed {
3
+ return null;
4
+ },
5
+
6
+ set(settings: Object) {},
7
+
8
+ watchKeys(keys: string | Array<string>, callback: Function): number {
9
+ return -1;
10
+ },
11
+
12
+ clearWatch(watchId: number) {},
13
+ };
14
+
15
+ module.exports = Settings;