react-native-windows 0.0.0-canary.992 → 0.0.0-canary.993
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/.flowconfig +3 -1
- package/Libraries/Animated/Animated.js +0 -1
- package/Libraries/Animated/Animated.js.flow +0 -1
- package/Libraries/Animated/AnimatedExports.js +0 -1
- package/Libraries/Animated/AnimatedExports.js.flow +1 -2
- package/Libraries/Animated/animations/Animation.js +5 -2
- package/Libraries/Animated/components/AnimatedScrollView.js +53 -52
- package/Libraries/Animated/createAnimatedComponent.js +37 -33
- package/Libraries/Animated/nodes/AnimatedObject.js +2 -3
- package/Libraries/Animated/nodes/AnimatedProps.js +1 -1
- package/Libraries/Animated/shouldUseTurboAnimatedModule.js +6 -1
- package/Libraries/AppState/AppState.js +6 -1
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +19 -18
- package/Libraries/Components/Button.js +2 -2
- package/Libraries/Components/Button.windows.js +2 -3
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +2 -3
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +2 -1
- package/Libraries/Components/LayoutConformance/LayoutConformance.js +0 -1
- package/Libraries/Components/Pressable/Pressable.js +9 -6
- package/Libraries/Components/Pressable/Pressable.windows.js +9 -6
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +14 -13
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +13 -1
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +29 -20
- package/Libraries/Components/ScrollView/ScrollView.d.ts +9 -5
- package/Libraries/Components/ScrollView/ScrollView.js +18 -12
- package/Libraries/Components/ScrollView/ScrollView.windows.js +19 -12
- package/Libraries/Components/ScrollView/ScrollViewContext.js +2 -1
- package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +1 -1
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +19 -6
- package/Libraries/Components/Switch/Switch.js +8 -2
- package/Libraries/Components/Switch/Switch.windows.js +8 -2
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +1 -5
- package/Libraries/Components/TextInput/TextInput.flow.js +1 -5
- package/Libraries/Components/TextInput/TextInput.flow.windows.js +1 -6
- package/Libraries/Components/TextInput/TextInput.js +26 -25
- package/Libraries/Components/TextInput/TextInput.windows.js +27 -25
- package/Libraries/Components/TextInput/WindowsTextInputNativeComponent.js +1 -5
- package/Libraries/Components/Touchable/TouchableBounce.js +9 -3
- package/Libraries/Components/Touchable/TouchableBounce.windows.js +9 -3
- package/Libraries/Components/Touchable/TouchableHighlight.js +9 -4
- package/Libraries/Components/Touchable/TouchableHighlight.windows.js +9 -4
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +2 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.windows.js +2 -1
- package/Libraries/Components/Touchable/TouchableOpacity.js +7 -3
- package/Libraries/Components/Touchable/TouchableOpacity.windows.js +7 -3
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -2
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +2 -2
- package/Libraries/Components/View/View.js +111 -25
- package/Libraries/Components/View/View.windows.js +427 -227
- package/Libraries/Core/Devtools/loadBundleFromServer.js +49 -7
- package/Libraries/Core/Devtools/loadBundleFromServer.windows.js +49 -7
- package/Libraries/Core/InitializeCore.js +1 -22
- package/Libraries/Core/ReactNativeVersion.js +3 -2
- package/Libraries/Debugging/DebuggingOverlay.js +6 -8
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +0 -1
- package/Libraries/Debugging/useSubscribeToDebuggingOverlayRegistry.js +0 -1
- package/Libraries/EventEmitter/NativeEventEmitter.js +1 -1
- package/Libraries/Image/AssetRegistry.js +4 -10
- package/Libraries/Image/AssetSourceResolver.js +17 -4
- package/Libraries/Image/AssetSourceResolver.windows.js +17 -4
- package/Libraries/Image/Image.android.js +112 -106
- package/Libraries/Image/Image.ios.js +10 -2
- package/Libraries/Image/Image.windows.js +30 -20
- package/Libraries/Image/ImageAnalyticsTagContext.js +2 -2
- package/Libraries/Image/RelativeImageStub.js +1 -0
- package/Libraries/Lists/FlatList.d.ts +9 -5
- package/Libraries/Lists/FlatList.js +1 -1
- package/Libraries/Lists/SectionListModern.js +9 -3
- package/Libraries/LogBox/UI/LogBoxButton.js +2 -1
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +2 -1
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.windows.js +2 -1
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +3 -2
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +2 -1
- package/Libraries/ReactNative/AppContainer-dev.js +4 -4
- package/Libraries/ReactNative/AppContainer-prod.js +0 -1
- package/Libraries/ReactNative/RootTag.js +2 -2
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -0
- package/Libraries/Renderer/shims/ReactNativeTypes.js +21 -25
- package/Libraries/Renderer/shims/ReactNativeTypes.windows.js +270 -0
- package/Libraries/StyleSheet/StyleSheetExports.js.flow +3 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +4 -3
- package/Libraries/StyleSheet/private/_TransformStyle.js +49 -21
- package/Libraries/StyleSheet/processBoxShadow.js +0 -1
- package/Libraries/StyleSheet/processFilter.js +0 -1
- package/Libraries/Text/Text.d.ts +1 -2
- package/Libraries/Text/Text.js +255 -244
- package/Libraries/Text/Text.windows.js +281 -300
- package/Libraries/Text/TextAncestor.js +3 -2
- package/Libraries/Text/TextProps.js +2 -34
- package/Libraries/Text/TextProps.windows.js +2 -34
- package/Libraries/Types/ReactDevToolsTypes.js +0 -1
- package/Libraries/Utilities/PerformanceLoggerContext.js +2 -2
- package/Libraries/Utilities/PlatformTypes.js +1 -1
- package/Libraries/vendor/core/ErrorUtils.js +28 -4
- package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.h +1 -1
- package/Microsoft.ReactNative/Fabric/AbiShadowNode.h +1 -1
- package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.h +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +2 -2
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +10 -9
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +21 -17
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +4 -4
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.cpp +19 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h +76 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/WindowsTextLayoutManager.cpp +6 -0
- package/Microsoft.ReactNative/Modules/PaperUIManagerModule.cpp +19 -2
- package/Microsoft.ReactNative/Utils/ThemeUtils.cpp +49 -0
- package/Microsoft.ReactNative/Utils/ThemeUtils.h +31 -0
- package/Microsoft.ReactNative/Views/ShadowNodeBase.cpp +36 -8
- package/Microsoft.ReactNative/Views/ShadowNodeRegistry.cpp +6 -2
- package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +9 -1
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Base.h +45 -34
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Bool.h +1 -1
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Bridging.h +1 -0
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Class.h +36 -33
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Number.h +10 -10
- package/PropertySheets/External/Microsoft.ReactNative.Cpp.Dependencies.props +10 -0
- package/PropertySheets/Generated/PackageVersion.g.props +2 -2
- package/PropertySheets/React.Cpp.props +1 -1
- package/ReactCommon/ReactCommon.vcxproj +10 -19
- package/ReactCommon/ReactCommon.vcxproj.filters +36 -13
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +110 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Bridging.h +1 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.cpp +19 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h +9 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/ParagraphShadowNode.cpp +459 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.h +92 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +35 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityProps.cpp +28 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/css/CSSTokenizer.h +1 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +2 -1
- package/Scripts/creaternwapp.cmd +11 -8
- package/Shared/HermesRuntimeHolder.cpp +3 -1
- package/Shared/Shared.vcxitems +5 -1
- package/Shared/Shared.vcxitems.filters +4 -0
- package/codegen/NativeDOMSpec.g.h +6 -0
- package/codegen/NativeIntersectionObserverSpec.g.h +19 -5
- package/codegen/NativeMutationObserverSpec.g.h +11 -5
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +104 -92
- package/codegen/react/components/rnwcore/States.h +8 -8
- package/codegen/rnwcoreJSI-generated.cpp +48 -3
- package/codegen/rnwcoreJSI.h +73 -10
- package/index.js +0 -1
- package/jest/mockNativeComponent.js +2 -1
- package/jest/renderer.js +0 -1
- package/jest/resolver.js +31 -0
- package/package.json +13 -13
- package/src/private/animated/NativeAnimatedHelper.js +6 -1
- package/src/private/animated/createAnimatedPropsHook.js +11 -4
- package/src/private/animated/createAnimatedPropsMemoHook.js +0 -1
- package/src/private/components/safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE.js +0 -1
- package/src/private/components/scrollview/HScrollViewNativeComponents.js +0 -1
- package/src/private/components/scrollview/VScrollViewNativeComponents.js +0 -1
- package/src/private/devsupport/rndevtools/FuseboxSessionObserver.js +0 -1
- package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.android.js +8 -9
- package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.ios.js +12 -15
- package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.windows.js +8 -9
- package/src/private/devsupport/rndevtools/setUpFuseboxReactDevToolsDispatcher.js +0 -1
- package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsRuntimeSettingsModule.js +0 -1
- package/src/private/featureflags/ReactNativeFeatureFlags.js +39 -4
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +5 -2
- package/src/private/setup/setUpDefaultReactNativeEnvironment.js +44 -0
- package/src/private/styles/composeStyles.js +12 -5
- package/src/private/webapis/dom/events/Event.js +3 -0
- package/src/private/webapis/dom/events/EventTarget.js +3 -0
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +6 -23
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +3 -1
- package/src/private/webapis/dom/nodes/specs/NativeDOM.js +38 -0
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +3 -0
- package/src/private/webapis/dom/oldstylecollections/NodeList.js +3 -0
- package/src/private/webapis/errors/DOMException.js +166 -0
- package/src/private/webapis/geometry/DOMRect.js +5 -0
- package/src/private/webapis/geometry/DOMRectList.js +3 -0
- package/src/private/webapis/geometry/DOMRectReadOnly.js +6 -0
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +15 -7
- package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +3 -0
- package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +80 -18
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +12 -0
- package/src/private/webapis/mutationobserver/MutationObserver.js +23 -33
- package/src/private/webapis/mutationobserver/MutationRecord.js +3 -0
- package/src/private/webapis/mutationobserver/internals/MutationObserverManager.js +56 -24
- package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +4 -1
- package/src/private/webapis/performance/MemoryInfo.js +4 -1
- package/src/private/webapis/performance/Performance.js +19 -8
- package/src/private/webapis/performance/PerformanceEntry.js +4 -0
- package/src/private/webapis/performance/ReactNativeStartupTiming.js +4 -1
- package/src/private/webapis/performance/internals/RawPerformanceEntry.js +2 -0
- package/src/private/webapis/structuredClone/structuredClone.js +233 -0
- package/src/private/webapis/webidl/PlatformObjects.js +59 -0
- package/src/types/globals.d.ts +42 -0
- package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +0 -1
- package/types/index.d.ts +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +0 -78
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.h +0 -196
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import type {HostInstance} from '../../src/private/types/HostInstance';
|
|
11
12
|
import type {ImageStyleProp} from '../StyleSheet/StyleSheet';
|
|
12
13
|
import type {RootTag} from '../Types/RootTagTypes';
|
|
14
|
+
import type {ImageProps} from './ImageProps';
|
|
13
15
|
import type {AbstractImageIOS, ImageIOS} from './ImageTypes.flow';
|
|
14
16
|
import type {ImageSize} from './NativeImageLoaderAndroid';
|
|
15
17
|
|
|
@@ -107,7 +109,13 @@ async function queryCache(
|
|
|
107
109
|
*
|
|
108
110
|
* See https://reactnative.dev/docs/image
|
|
109
111
|
*/
|
|
110
|
-
let BaseImage: AbstractImageIOS =
|
|
112
|
+
let BaseImage: AbstractImageIOS = ({
|
|
113
|
+
ref: forwardedRef,
|
|
114
|
+
...props
|
|
115
|
+
}: {
|
|
116
|
+
ref?: React.RefSetter<HostInstance>,
|
|
117
|
+
...ImageProps,
|
|
118
|
+
}) => {
|
|
111
119
|
const source = getImageSourcesFromImageProps(props) || {
|
|
112
120
|
uri: undefined,
|
|
113
121
|
width: undefined,
|
|
@@ -214,28 +222,30 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
|
|
|
214
222
|
} else {
|
|
215
223
|
return (
|
|
216
224
|
<ImageAnalyticsTagContext.Consumer>
|
|
217
|
-
{analyticTag =>
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
225
|
+
{analyticTag => {
|
|
226
|
+
return (
|
|
227
|
+
<ImageViewNativeComponent
|
|
228
|
+
accessibilityState={_accessibilityState}
|
|
229
|
+
{...restProps}
|
|
230
|
+
accessible={props.alt !== undefined ? true : props.accessible}
|
|
231
|
+
accessibilityLabel={accessibilityLabel ?? props.alt}
|
|
232
|
+
accessibilityLevel={accessibilityLevel} // Windows
|
|
233
|
+
accessibilityPosInSet={accessibilityPosInSet} // Windows
|
|
234
|
+
accessibilitySetSize={accessibilitySetSize} // Windows
|
|
235
|
+
ref={actualRef}
|
|
236
|
+
style={style}
|
|
237
|
+
resizeMode={resizeMode}
|
|
238
|
+
tintColor={tintColor}
|
|
239
|
+
source={sources}
|
|
240
|
+
internal_analyticTag={analyticTag}
|
|
241
|
+
/>
|
|
242
|
+
);
|
|
243
|
+
}}
|
|
234
244
|
</ImageAnalyticsTagContext.Consumer>
|
|
235
245
|
);
|
|
246
|
+
// Windows]
|
|
236
247
|
}
|
|
237
|
-
|
|
238
|
-
});
|
|
248
|
+
};
|
|
239
249
|
|
|
240
250
|
const imageComponentDecorator = unstable_getImageComponentDecorator();
|
|
241
251
|
if (imageComponentDecorator != null) {
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import * as React from 'react';
|
|
12
|
+
import {createContext} from 'react';
|
|
12
13
|
|
|
13
14
|
type ContextType = ?string;
|
|
14
15
|
|
|
15
|
-
const Context: React.Context<ContextType> =
|
|
16
|
-
React.createContext<ContextType>(null);
|
|
16
|
+
const Context: React.Context<ContextType> = createContext<ContextType>(null);
|
|
17
17
|
|
|
18
18
|
if (__DEV__) {
|
|
19
19
|
Context.displayName = 'ImageAnalyticsTagContext';
|
|
@@ -155,16 +155,20 @@ export interface FlatListProps<ItemT> extends VirtualizedListProps<ItemT> {
|
|
|
155
155
|
removeClippedSubviews?: boolean | undefined;
|
|
156
156
|
|
|
157
157
|
/**
|
|
158
|
-
*
|
|
158
|
+
* Controls the fading effect at the edges of the scroll content.
|
|
159
159
|
*
|
|
160
|
-
*
|
|
161
|
-
* to
|
|
162
|
-
*
|
|
160
|
+
* A value greater than 0 will apply the fading effect, indicating more content is available
|
|
161
|
+
* to scroll.
|
|
162
|
+
*
|
|
163
|
+
* You can specify a single number to apply the same fading length to both edges.
|
|
164
|
+
* Alternatively, use an object with `start` and `end` properties to set different
|
|
165
|
+
* fading lengths for the start and end of the scroll content.
|
|
163
166
|
*
|
|
164
167
|
* The default value is 0.
|
|
168
|
+
*
|
|
165
169
|
* @platform android
|
|
166
170
|
*/
|
|
167
|
-
fadingEdgeLength?: number | undefined;
|
|
171
|
+
fadingEdgeLength?: number | {start: number; end: number} | undefined;
|
|
168
172
|
}
|
|
169
173
|
|
|
170
174
|
export abstract class FlatListComponent<
|
|
@@ -145,7 +145,7 @@ type OptionalProps<ItemT> = {
|
|
|
145
145
|
/**
|
|
146
146
|
* See `ScrollView` for flow type and further documentation.
|
|
147
147
|
*/
|
|
148
|
-
fadingEdgeLength?: ?number,
|
|
148
|
+
fadingEdgeLength?: ?number | {start: number, end: number},
|
|
149
149
|
/**
|
|
150
150
|
* Enable an optimization to memoize the item renderer to prevent unnecessary rerenders.
|
|
151
151
|
*/
|
|
@@ -21,7 +21,7 @@ import type {
|
|
|
21
21
|
import Platform from '../Utilities/Platform';
|
|
22
22
|
import VirtualizedLists from '@react-native/virtualized-lists';
|
|
23
23
|
import * as React from 'react';
|
|
24
|
-
import {
|
|
24
|
+
import {useImperativeHandle, useRef} from 'react';
|
|
25
25
|
|
|
26
26
|
const VirtualizedSectionList = VirtualizedLists.VirtualizedSectionList;
|
|
27
27
|
|
|
@@ -168,7 +168,13 @@ export type Props<ItemT, SectionT = DefaultSectionT> = $ReadOnly<{
|
|
|
168
168
|
const SectionList: component(
|
|
169
169
|
ref?: React.RefSetter<any>,
|
|
170
170
|
...Props<any, DefaultSectionT>
|
|
171
|
-
) =
|
|
171
|
+
) = ({
|
|
172
|
+
ref,
|
|
173
|
+
...props
|
|
174
|
+
}: {
|
|
175
|
+
ref?: React.RefSetter<any>,
|
|
176
|
+
...Props<any, DefaultSectionT>,
|
|
177
|
+
}) => {
|
|
172
178
|
const propsWithDefaults = {
|
|
173
179
|
stickySectionHeadersEnabled: Platform.OS === 'ios',
|
|
174
180
|
...props,
|
|
@@ -237,6 +243,6 @@ const SectionList: component(
|
|
|
237
243
|
getItem={(items, index) => items[index]}
|
|
238
244
|
/>
|
|
239
245
|
);
|
|
240
|
-
}
|
|
246
|
+
};
|
|
241
247
|
|
|
242
248
|
export default SectionList;
|
|
@@ -17,6 +17,7 @@ import View from '../../Components/View/View';
|
|
|
17
17
|
import StyleSheet from '../../StyleSheet/StyleSheet';
|
|
18
18
|
import * as LogBoxStyle from './LogBoxStyle';
|
|
19
19
|
import * as React from 'react';
|
|
20
|
+
import {useState} from 'react';
|
|
20
21
|
|
|
21
22
|
type Props = $ReadOnly<{
|
|
22
23
|
id?: string,
|
|
@@ -31,7 +32,7 @@ type Props = $ReadOnly<{
|
|
|
31
32
|
}>;
|
|
32
33
|
|
|
33
34
|
function LogBoxButton(props: Props): React.Node {
|
|
34
|
-
const [pressed, setPressed] =
|
|
35
|
+
const [pressed, setPressed] = useState(false);
|
|
35
36
|
|
|
36
37
|
let backgroundColor = props.backgroundColor;
|
|
37
38
|
if (!backgroundColor) {
|
|
@@ -19,6 +19,7 @@ import LogBoxButton from './LogBoxButton';
|
|
|
19
19
|
import LogBoxInspectorSection from './LogBoxInspectorSection';
|
|
20
20
|
import * as LogBoxStyle from './LogBoxStyle';
|
|
21
21
|
import * as React from 'react';
|
|
22
|
+
import {useState} from 'react';
|
|
22
23
|
|
|
23
24
|
type Props = $ReadOnly<{
|
|
24
25
|
log: LogBoxLog,
|
|
@@ -49,7 +50,7 @@ function getPrettyFileName(path: string) {
|
|
|
49
50
|
return fileName;
|
|
50
51
|
}
|
|
51
52
|
function LogBoxInspectorReactFrames(props: Props): React.Node {
|
|
52
|
-
const [collapsed, setCollapsed] =
|
|
53
|
+
const [collapsed, setCollapsed] = useState(true);
|
|
53
54
|
if (
|
|
54
55
|
props.log.getAvailableComponentStack() == null ||
|
|
55
56
|
props.log.getAvailableComponentStack().length < 1
|
|
@@ -19,6 +19,7 @@ import LogBoxButton from './LogBoxButton';
|
|
|
19
19
|
import LogBoxInspectorSection from './LogBoxInspectorSection';
|
|
20
20
|
import * as LogBoxStyle from './LogBoxStyle';
|
|
21
21
|
import * as React from 'react';
|
|
22
|
+
import {useState} from 'react';
|
|
22
23
|
|
|
23
24
|
type Props = $ReadOnly<{
|
|
24
25
|
log: LogBoxLog,
|
|
@@ -49,7 +50,7 @@ function getPrettyFileName(path: string) {
|
|
|
49
50
|
return fileName;
|
|
50
51
|
}
|
|
51
52
|
function LogBoxInspectorReactFrames(props: Props): React.Node {
|
|
52
|
-
const [collapsed, setCollapsed] =
|
|
53
|
+
const [collapsed, setCollapsed] = useState(true);
|
|
53
54
|
if (
|
|
54
55
|
props.log.getAvailableComponentStack() == null ||
|
|
55
56
|
props.log.getAvailableComponentStack().length < 1
|
|
@@ -17,6 +17,7 @@ import Text from '../../Text/Text';
|
|
|
17
17
|
import LogBoxButton from './LogBoxButton';
|
|
18
18
|
import * as LogBoxStyle from './LogBoxStyle';
|
|
19
19
|
import * as React from 'react';
|
|
20
|
+
import {useEffect, useState} from 'react';
|
|
20
21
|
|
|
21
22
|
type Props = $ReadOnly<{
|
|
22
23
|
onPress?: ?(event: GestureResponderEvent) => void,
|
|
@@ -24,12 +25,12 @@ type Props = $ReadOnly<{
|
|
|
24
25
|
}>;
|
|
25
26
|
|
|
26
27
|
function LogBoxInspectorSourceMapStatus(props: Props): React.Node {
|
|
27
|
-
const [state, setState] =
|
|
28
|
+
const [state, setState] = useState({
|
|
28
29
|
animation: null,
|
|
29
30
|
rotate: null,
|
|
30
31
|
});
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
useEffect(() => {
|
|
33
34
|
if (props.status === 'PENDING') {
|
|
34
35
|
if (state.animation == null) {
|
|
35
36
|
const animated = new Animated.Value(0);
|
|
@@ -22,6 +22,7 @@ import LogBoxInspectorSourceMapStatus from './LogBoxInspectorSourceMapStatus';
|
|
|
22
22
|
import LogBoxInspectorStackFrame from './LogBoxInspectorStackFrame';
|
|
23
23
|
import * as LogBoxStyle from './LogBoxStyle';
|
|
24
24
|
import * as React from 'react';
|
|
25
|
+
import {useState} from 'react';
|
|
25
26
|
|
|
26
27
|
type Props = $ReadOnly<{
|
|
27
28
|
log: LogBoxLog,
|
|
@@ -65,7 +66,7 @@ export function getCollapseMessage(
|
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
function LogBoxInspectorStackFrames(props: Props): React.Node {
|
|
68
|
-
const [collapsed, setCollapsed] =
|
|
69
|
+
const [collapsed, setCollapsed] = useState(() => {
|
|
69
70
|
// Only collapse frames initially if some frames are not collapsed.
|
|
70
71
|
return props.log.getAvailableStack().some(({collapse}) => !collapse);
|
|
71
72
|
});
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @flow strict-local
|
|
8
8
|
* @format
|
|
9
|
-
* @oncall react_native
|
|
10
9
|
*/
|
|
11
10
|
|
|
12
11
|
import type {
|
|
@@ -24,6 +23,7 @@ import LogBoxNotificationContainer from '../LogBox/LogBoxNotificationContainer';
|
|
|
24
23
|
import StyleSheet from '../StyleSheet/StyleSheet';
|
|
25
24
|
import {RootTagContext, createRootTag} from './RootTag';
|
|
26
25
|
import * as React from 'react';
|
|
26
|
+
import {useRef} from 'react';
|
|
27
27
|
|
|
28
28
|
const {useEffect, useState, useCallback} = React;
|
|
29
29
|
|
|
@@ -95,9 +95,9 @@ const AppContainer = ({
|
|
|
95
95
|
WrapperComponent,
|
|
96
96
|
rootViewStyle,
|
|
97
97
|
}: Props): React.Node => {
|
|
98
|
-
const appContainerRootViewRef: AppContainerRootViewRef =
|
|
99
|
-
const innerViewRef: InspectedViewRef =
|
|
100
|
-
const debuggingOverlayRef: DebuggingOverlayRef =
|
|
98
|
+
const appContainerRootViewRef: AppContainerRootViewRef = useRef(null);
|
|
99
|
+
const innerViewRef: InspectedViewRef = useRef(null);
|
|
100
|
+
const debuggingOverlayRef: DebuggingOverlayRef = useRef(null);
|
|
101
101
|
|
|
102
102
|
useSubscribeToDebuggingOverlayRegistry(
|
|
103
103
|
appContainerRootViewRef,
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import * as React from 'react';
|
|
12
|
+
import {createContext} from 'react';
|
|
12
13
|
|
|
13
14
|
export opaque type RootTag = number;
|
|
14
15
|
|
|
15
|
-
export const RootTagContext: React.Context<RootTag> =
|
|
16
|
-
React.createContext<RootTag>(0);
|
|
16
|
+
export const RootTagContext: React.Context<RootTag> = createContext<RootTag>(0);
|
|
17
17
|
|
|
18
18
|
if (__DEV__) {
|
|
19
19
|
RootTagContext.displayName = 'RootTagContext';
|
|
@@ -51,6 +51,7 @@ export type {PublicRootInstance} from '../ReactNative/ReactFabricPublicInstance/
|
|
|
51
51
|
export type PublicTextInstance = ReturnType<createPublicTextInstance>;
|
|
52
52
|
|
|
53
53
|
// flowlint unsafe-getters-setters:off
|
|
54
|
+
// eslint-disable-next-line lint/no-commonjs-exports
|
|
54
55
|
module.exports = {
|
|
55
56
|
get BatchedBridge(): BatchedBridge {
|
|
56
57
|
return require('../BatchedBridge/BatchedBridge').default;
|
|
@@ -7,25 +7,21 @@
|
|
|
7
7
|
* @noformat
|
|
8
8
|
* @nolint
|
|
9
9
|
* @flow strict
|
|
10
|
-
* @generated SignedSource<<
|
|
10
|
+
* @generated SignedSource<<4216c04f5a8c40a833b0146588fab5fa>>
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import type {
|
|
14
|
-
Component as ReactComponent,
|
|
15
|
-
ElementRef,
|
|
16
|
-
ElementType,
|
|
17
|
-
MixedElement,
|
|
18
|
-
} from 'react';
|
|
19
13
|
import type {
|
|
20
14
|
// $FlowFixMe[nonstrict-import] TODO(@rubennorte)
|
|
21
|
-
|
|
15
|
+
HostInstance as PublicInstance,
|
|
22
16
|
// $FlowFixMe[nonstrict-import] TODO(@rubennorte)
|
|
23
|
-
|
|
17
|
+
MeasureOnSuccessCallback,
|
|
24
18
|
// $FlowFixMe[nonstrict-import] TODO(@rubennorte)
|
|
25
19
|
PublicRootInstance,
|
|
26
20
|
// $FlowFixMe[nonstrict-import] TODO(@rubennorte)
|
|
27
21
|
PublicTextInstance,
|
|
28
|
-
} from 'react-native
|
|
22
|
+
} from 'react-native';
|
|
23
|
+
|
|
24
|
+
import * as React from 'react';
|
|
29
25
|
|
|
30
26
|
export type AttributeType<T, V> =
|
|
31
27
|
| true
|
|
@@ -97,8 +93,8 @@ type InspectorDataProps = $ReadOnly<{
|
|
|
97
93
|
}>;
|
|
98
94
|
|
|
99
95
|
type InspectorDataGetter = (
|
|
100
|
-
<TElementType: ElementType>(
|
|
101
|
-
componentOrHandle: ElementRef<TElementType> | number,
|
|
96
|
+
<TElementType: React.ElementType>(
|
|
97
|
+
componentOrHandle: React.ElementRef<TElementType> | number,
|
|
102
98
|
) => ?number,
|
|
103
99
|
) => $ReadOnly<{
|
|
104
100
|
measure: (callback: MeasureOnSuccessCallback) => void,
|
|
@@ -141,7 +137,7 @@ export type RenderRootOptions = {
|
|
|
141
137
|
+componentStack?: ?string,
|
|
142
138
|
// $FlowFixMe[unclear-type] unknown props and state.
|
|
143
139
|
// $FlowFixMe[value-as-type] Component in react repo is any-typed, but it will be well typed externally.
|
|
144
|
-
+errorBoundary?: ?
|
|
140
|
+
+errorBoundary?: ?React.Component<any, any>,
|
|
145
141
|
},
|
|
146
142
|
) => void,
|
|
147
143
|
onRecoverableError?: (
|
|
@@ -155,11 +151,11 @@ export type RenderRootOptions = {
|
|
|
155
151
|
* Provide minimal Flow typing for the high-level RN API and call it a day.
|
|
156
152
|
*/
|
|
157
153
|
export type ReactNativeType = {
|
|
158
|
-
findHostInstance_DEPRECATED<TElementType: ElementType>(
|
|
159
|
-
componentOrHandle: ?(ElementRef<TElementType> | number),
|
|
154
|
+
findHostInstance_DEPRECATED<TElementType: React.ElementType>(
|
|
155
|
+
componentOrHandle: ?(React.ElementRef<TElementType> | number),
|
|
160
156
|
): ?PublicInstance,
|
|
161
|
-
findNodeHandle<TElementType: ElementType>(
|
|
162
|
-
componentOrHandle: ?(ElementRef<TElementType> | number),
|
|
157
|
+
findNodeHandle<TElementType: React.ElementType>(
|
|
158
|
+
componentOrHandle: ?(React.ElementRef<TElementType> | number),
|
|
163
159
|
): ?number,
|
|
164
160
|
isChildPublicInstance(parent: PublicInstance, child: PublicInstance): boolean,
|
|
165
161
|
dispatchCommand(
|
|
@@ -169,11 +165,11 @@ export type ReactNativeType = {
|
|
|
169
165
|
): void,
|
|
170
166
|
sendAccessibilityEvent(handle: PublicInstance, eventType: string): void,
|
|
171
167
|
render(
|
|
172
|
-
element: MixedElement,
|
|
168
|
+
element: React.MixedElement,
|
|
173
169
|
containerTag: number,
|
|
174
170
|
callback: ?() => void,
|
|
175
171
|
options: ?RenderRootOptions,
|
|
176
|
-
): ?ElementRef<ElementType>,
|
|
172
|
+
): ?React.ElementRef<React.ElementType>,
|
|
177
173
|
unmountComponentAtNode(containerTag: number): void,
|
|
178
174
|
unmountComponentAtNodeAndRemoveContainer(containerTag: number): void,
|
|
179
175
|
+unstable_batchedUpdates: <T>(fn: (T) => void, bookkeeping: T) => void,
|
|
@@ -184,11 +180,11 @@ export opaque type Node = mixed;
|
|
|
184
180
|
export opaque type InternalInstanceHandle = mixed;
|
|
185
181
|
|
|
186
182
|
export type ReactFabricType = {
|
|
187
|
-
findHostInstance_DEPRECATED<TElementType: ElementType>(
|
|
188
|
-
componentOrHandle: ?(ElementRef<TElementType> | number),
|
|
183
|
+
findHostInstance_DEPRECATED<TElementType: React.ElementType>(
|
|
184
|
+
componentOrHandle: ?(React.ElementRef<TElementType> | number),
|
|
189
185
|
): ?PublicInstance,
|
|
190
|
-
findNodeHandle<TElementType: ElementType>(
|
|
191
|
-
componentOrHandle: ?(ElementRef<TElementType> | number),
|
|
186
|
+
findNodeHandle<TElementType: React.ElementType>(
|
|
187
|
+
componentOrHandle: ?(React.ElementRef<TElementType> | number),
|
|
192
188
|
): ?number,
|
|
193
189
|
dispatchCommand(
|
|
194
190
|
handle: PublicInstance,
|
|
@@ -198,12 +194,12 @@ export type ReactFabricType = {
|
|
|
198
194
|
isChildPublicInstance(parent: PublicInstance, child: PublicInstance): boolean,
|
|
199
195
|
sendAccessibilityEvent(handle: PublicInstance, eventType: string): void,
|
|
200
196
|
render(
|
|
201
|
-
element: MixedElement,
|
|
197
|
+
element: React.MixedElement,
|
|
202
198
|
containerTag: number,
|
|
203
199
|
callback: ?() => void,
|
|
204
200
|
concurrentRoot: ?boolean,
|
|
205
201
|
options: ?RenderRootOptions,
|
|
206
|
-
): ?ElementRef<ElementType>,
|
|
202
|
+
): ?React.ElementRef<React.ElementType>,
|
|
207
203
|
unmountComponentAtNode(containerTag: number): void,
|
|
208
204
|
getNodeFromInternalInstanceHandle(
|
|
209
205
|
internalInstanceHandle: InternalInstanceHandle,
|