@office-iss/react-native-win32 0.0.0-canary.258 → 0.0.0-canary.260
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 +2 -4
- package/CHANGELOG.json +31 -1
- package/CHANGELOG.md +24 -8
- package/Libraries/Alert/Alert.js +3 -0
- package/Libraries/Animated/AnimatedImplementation.js +7 -7
- package/Libraries/Animated/animations/Animation.js +10 -0
- package/Libraries/Animated/animations/TimingAnimation.js +1 -0
- package/Libraries/Animated/components/AnimatedScrollView.js +2 -2
- package/Libraries/Animated/createAnimatedComponent.js +1 -1
- package/Libraries/Animated/nodes/AnimatedValue.js +1 -0
- package/Libraries/Animated/useAnimatedProps.js +138 -6
- package/Libraries/BatchedBridge/NativeModules.js +2 -0
- package/Libraries/Blob/FileReader.js +1 -1
- package/Libraries/Blob/URL.js +2 -62
- package/Libraries/Blob/URLSearchParams.js +71 -0
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -1
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +1 -1
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +3 -0
- package/Libraries/Components/ScrollView/ScrollView.js +5 -5
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +3 -0
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
- package/Libraries/Components/StatusBar/StatusBar.js +3 -1
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +3 -0
- package/Libraries/Components/TextInput/TextInput.d.ts +32 -2
- package/Libraries/Components/TextInput/TextInput.js +220 -80
- package/Libraries/Components/TextInput/TextInput.win32.js +220 -86
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +22 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.js +2 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +2 -0
- package/Libraries/Components/View/ViewAccessibility.d.ts +15 -0
- package/Libraries/Components/View/ViewNativeComponent.js +6 -0
- package/Libraries/Components/View/ViewPropTypes.js +14 -0
- package/Libraries/Components/View/ViewPropTypes.win32.js +14 -0
- package/Libraries/Core/ExceptionsManager.js +2 -0
- package/Libraries/Core/InitializeCore.js +1 -1
- package/Libraries/Core/ReactFiberErrorDialog.js +3 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpErrorHandling.js +7 -1
- package/Libraries/Core/setUpReactRefresh.js +0 -4
- package/Libraries/Image/AssetSourceResolver.js +28 -1
- package/Libraries/Image/Image.android.js +9 -14
- package/Libraries/Image/Image.ios.js +11 -22
- package/Libraries/Image/Image.win32.js +10 -21
- package/Libraries/Image/ImageBackground.js +1 -8
- package/Libraries/Image/ImageUtils.js +9 -9
- package/Libraries/Image/ImageViewNativeComponent.js +4 -0
- package/Libraries/Inspector/NetworkOverlay.js +1 -1
- package/Libraries/Interaction/TaskQueue.js +1 -0
- package/Libraries/Lists/FlatList.js +1 -1
- package/Libraries/Lists/SectionList.js +2 -2
- package/Libraries/Lists/SectionListModern.js +1 -1
- package/Libraries/LogBox/Data/LogBoxData.js +31 -4
- package/Libraries/NativeComponent/BaseViewConfig.android.js +2 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +7 -0
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +7 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +9 -2
- package/Libraries/Network/XMLHttpRequest.js +4 -2
- package/Libraries/ReactNative/BridgelessUIManager.js +1 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +5 -5
- package/Libraries/ReactNative/RendererImplementation.js +24 -2
- package/Libraries/ReactNative/getNativeComponentAttributes.js +8 -0
- package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -1
- package/Libraries/StyleSheet/StyleSheet.js +1 -1
- package/Libraries/StyleSheet/StyleSheet.win32.js +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +57 -19
- package/Libraries/StyleSheet/StyleSheetTypes.js +60 -23
- package/Libraries/StyleSheet/processBackgroundImage.js +286 -0
- package/Libraries/StyleSheet/processBoxShadow.js +211 -0
- package/Libraries/StyleSheet/processFilter.js +24 -14
- package/Libraries/Text/Text.js +395 -212
- package/Libraries/Text/Text.win32.js +443 -245
- package/Libraries/Text/TextNativeComponent.js +7 -0
- package/Libraries/Text/TextNativeComponent.win32.js +7 -0
- package/Libraries/TurboModule/TurboModuleRegistry.js +13 -50
- package/Libraries/Types/CodegenTypes.js +3 -1
- package/Libraries/Utilities/HMRClient.js +1 -0
- package/Libraries/Utilities/Platform.android.js +1 -1
- package/Libraries/Utilities/Platform.d.ts +1 -1
- package/Libraries/Utilities/Platform.flow.js +2 -2
- package/Libraries/Utilities/Platform.flow.win32.js +3 -3
- package/Libraries/Utilities/Platform.ios.js +1 -1
- package/Libraries/Utilities/Platform.win32.js +1 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
- package/Libraries/WebSocket/WebSocket.js +1 -1
- package/Libraries/vendor/emitter/EventEmitter.js +1 -0
- package/flow/jest.js +2 -2
- package/index.js +1 -0
- package/index.win32.js +1 -0
- package/jest/mockModal.js +1 -3
- package/jest/mockScrollView.js +1 -1
- package/jest/renderer.js +2 -2
- package/jest/setup.js +16 -9
- package/overrides.json +16 -16
- package/package.json +15 -15
- package/src/private/{core/components → components}/HScrollViewNativeComponents.js +8 -8
- package/src/private/{core/components → components}/VScrollViewNativeComponents.js +7 -7
- package/src/private/{core/components → components}/useSyncOnScroll.js +2 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +143 -19
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +25 -5
- package/src/private/hooks/DebouncedEffectImplementation.js +148 -0
- package/src/private/hooks/useDebouncedEffect.js +23 -0
- package/{Libraries/Core → src/private/renderer/errorhandling}/ErrorHandlers.js +14 -4
- package/src/private/setup/setUpDOM.js +28 -0
- package/src/private/setup/setUpIntersectionObserver.js +27 -0
- package/src/private/setup/setUpMutationObserver.js +26 -0
- package/src/private/setup/setUpPerformanceObserver.js +64 -0
- package/src/private/specs/modules/NativeDebuggerSessionObserver.js +23 -0
- package/src/private/specs/modules/NativeLinkingManager.js +1 -1
- package/src/private/specs/modules/NativePlatformConstantsAndroid.js +1 -1
- package/src/private/specs/modules/NativePlatformConstantsIOS.js +1 -1
- package/src/private/specs/modules/NativePlatformConstantsWin.js +8 -1
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +6 -4
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserver.js +1 -1
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverEntry.js +3 -3
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverManager.js +5 -8
- package/src/private/{specs/modules → webapis/intersectionobserver/specs}/NativeIntersectionObserver.js +2 -2
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver/specs}/__mocks__/NativeIntersectionObserver.js +4 -4
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserver.js +1 -1
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserverManager.js +5 -5
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationRecord.js +4 -6
- package/src/private/{specs/modules → webapis/mutationobserver/specs}/NativeMutationObserver.js +2 -2
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver/specs}/__mocks__/NativeMutationObserver.js +5 -5
- package/src/private/webapis/performance/{EventCounts.js → EventTiming.js} +65 -3
- package/src/private/webapis/performance/LongTasks.js +39 -0
- package/src/private/webapis/performance/Performance.js +22 -9
- package/src/private/webapis/performance/PerformanceEntry.js +36 -18
- package/src/private/webapis/performance/PerformanceObserver.js +29 -43
- package/src/private/webapis/performance/RawPerformanceEntry.js +24 -1
- package/src/private/webapis/performance/UserTiming.js +17 -12
- package/src/private/webapis/performance/specs/NativePerformanceObserver.js +1 -1
- package/src-win/Libraries/Components/View/ViewAccessibility.d.ts +15 -0
- package/types/experimental.d.ts +20 -1
- package/Libraries/Core/setUpIntersectionObserver.js +0 -16
- package/Libraries/Core/setUpMutationObserver.js +0 -16
- package/Libraries/Core/setUpPerformanceObserver.js +0 -18
- package/Libraries/IntersectionObserver/NativeIntersectionObserver.js +0 -13
- package/Libraries/MutationObserver/NativeMutationObserver.js +0 -13
- package/Libraries/Text/TextOptimized.js +0 -538
- package/src/private/core/setUpDOM.js +0 -18
- package/src/private/webapis/performance/PerformanceEventTiming.js +0 -55
- /package/src/private/{core → styles}/composeStyles.js +0 -0
|
@@ -150,24 +150,20 @@ let BaseImage: AbstractImageAndroid = React.forwardRef(
|
|
|
150
150
|
);
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
let style;
|
|
153
|
+
let style: ImageStyleProp;
|
|
154
154
|
let sources;
|
|
155
155
|
if (Array.isArray(source)) {
|
|
156
|
-
style =
|
|
156
|
+
style = [styles.base, props.style];
|
|
157
157
|
sources = source;
|
|
158
158
|
} else {
|
|
159
159
|
const {uri} = source;
|
|
160
|
-
const width = source.width ?? props.width;
|
|
161
|
-
const height = source.height ?? props.height;
|
|
162
|
-
style = flattenStyle<ImageStyleProp>([
|
|
163
|
-
{width, height},
|
|
164
|
-
styles.base,
|
|
165
|
-
props.style,
|
|
166
|
-
]);
|
|
167
|
-
sources = [source];
|
|
168
160
|
if (uri === '') {
|
|
169
161
|
console.warn('source.uri should not be an empty string');
|
|
170
162
|
}
|
|
163
|
+
const width = source.width ?? props.width;
|
|
164
|
+
const height = source.height ?? props.height;
|
|
165
|
+
style = [{width, height}, styles.base, props.style];
|
|
166
|
+
sources = [source];
|
|
171
167
|
}
|
|
172
168
|
|
|
173
169
|
const {height, width, ...restProps} = props;
|
|
@@ -203,11 +199,10 @@ let BaseImage: AbstractImageAndroid = React.forwardRef(
|
|
|
203
199
|
},
|
|
204
200
|
};
|
|
205
201
|
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
: null;
|
|
202
|
+
const flattenedStyle = flattenStyle<ImageStyleProp>(style);
|
|
203
|
+
const objectFit = convertObjectFitToResizeMode(flattenedStyle?.objectFit);
|
|
209
204
|
const resizeMode =
|
|
210
|
-
objectFit || props.resizeMode ||
|
|
205
|
+
objectFit || props.resizeMode || flattenedStyle?.resizeMode || 'cover';
|
|
211
206
|
|
|
212
207
|
const actualRef = useWrapRefWithImageAttachedCallbacks(forwardedRef);
|
|
213
208
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {
|
|
11
|
+
import type {ImageStyleProp} from '../StyleSheet/StyleSheet';
|
|
12
12
|
import type {RootTag} from '../Types/RootTagTypes';
|
|
13
13
|
import type {AbstractImageIOS, ImageIOS} from './ImageTypes.flow';
|
|
14
14
|
import type {ImageSize} from './NativeImageLoaderAndroid';
|
|
@@ -112,38 +112,27 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
|
|
|
112
112
|
height: undefined,
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
+
let style: ImageStyleProp;
|
|
115
116
|
let sources;
|
|
116
|
-
let style: ImageStyle;
|
|
117
|
-
|
|
118
117
|
if (Array.isArray(source)) {
|
|
119
|
-
style =
|
|
120
|
-
flattenStyle<ImageStyleProp>([styles.base, props.style]) ||
|
|
121
|
-
({}: ImageStyle);
|
|
118
|
+
style = [styles.base, props.style];
|
|
122
119
|
sources = source;
|
|
123
120
|
} else {
|
|
124
121
|
const {uri} = source;
|
|
125
|
-
const width = source.width ?? props.width;
|
|
126
|
-
const height = source.height ?? props.height;
|
|
127
|
-
style =
|
|
128
|
-
flattenStyle<ImageStyleProp>([
|
|
129
|
-
{width, height},
|
|
130
|
-
styles.base,
|
|
131
|
-
props.style,
|
|
132
|
-
]) || ({}: ImageStyle);
|
|
133
|
-
sources = [source];
|
|
134
|
-
|
|
135
122
|
if (uri === '') {
|
|
136
123
|
console.warn('source.uri should not be an empty string');
|
|
137
124
|
}
|
|
125
|
+
const width = source.width ?? props.width;
|
|
126
|
+
const height = source.height ?? props.height;
|
|
127
|
+
style = [{width, height}, styles.base, props.style];
|
|
128
|
+
sources = [source];
|
|
138
129
|
}
|
|
139
130
|
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
? convertObjectFitToResizeMode(style.objectFit)
|
|
143
|
-
: null;
|
|
131
|
+
const flattenedStyle = flattenStyle<ImageStyleProp>(style);
|
|
132
|
+
const objectFit = convertObjectFitToResizeMode(flattenedStyle?.objectFit);
|
|
144
133
|
const resizeMode =
|
|
145
|
-
objectFit || props.resizeMode ||
|
|
146
|
-
const tintColor = props.tintColor ??
|
|
134
|
+
objectFit || props.resizeMode || flattenedStyle?.resizeMode || 'cover';
|
|
135
|
+
const tintColor = props.tintColor ?? flattenedStyle?.tintColor;
|
|
147
136
|
|
|
148
137
|
if (props.children != null) {
|
|
149
138
|
throw new Error(
|
|
@@ -131,38 +131,27 @@ let BaseImage: AbstractImageIOS = React.forwardRef((props, forwardedRef) => {
|
|
|
131
131
|
height: undefined,
|
|
132
132
|
};
|
|
133
133
|
|
|
134
|
+
let style: ImageStyleProp;
|
|
134
135
|
let sources;
|
|
135
|
-
let style: ImageStyle;
|
|
136
|
-
|
|
137
136
|
if (Array.isArray(source)) {
|
|
138
|
-
style =
|
|
139
|
-
flattenStyle<ImageStyleProp>([styles.base, props.style]) ||
|
|
140
|
-
({}: ImageStyle);
|
|
137
|
+
style = [styles.base, props.style];
|
|
141
138
|
sources = source;
|
|
142
139
|
} else {
|
|
143
140
|
const {uri} = source;
|
|
144
|
-
const width = source.width ?? props.width;
|
|
145
|
-
const height = source.height ?? props.height;
|
|
146
|
-
style =
|
|
147
|
-
flattenStyle<ImageStyleProp>([
|
|
148
|
-
{width, height},
|
|
149
|
-
styles.base,
|
|
150
|
-
props.style,
|
|
151
|
-
]) || ({}: ImageStyle);
|
|
152
|
-
sources = [source];
|
|
153
|
-
|
|
154
141
|
if (uri === '') {
|
|
155
142
|
console.warn('source.uri should not be an empty string');
|
|
156
143
|
}
|
|
144
|
+
const width = source.width ?? props.width;
|
|
145
|
+
const height = source.height ?? props.height;
|
|
146
|
+
style = [{width, height}, styles.base, props.style];
|
|
147
|
+
sources = [source];
|
|
157
148
|
}
|
|
158
149
|
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
? convertObjectFitToResizeMode(style.objectFit)
|
|
162
|
-
: null;
|
|
150
|
+
const flattenedStyle = flattenStyle<ImageStyleProp>(style);
|
|
151
|
+
const objectFit = convertObjectFitToResizeMode(flattenedStyle?.objectFit);
|
|
163
152
|
const resizeMode =
|
|
164
|
-
objectFit || props.resizeMode ||
|
|
165
|
-
const tintColor = props.tintColor ??
|
|
153
|
+
objectFit || props.resizeMode || flattenedStyle?.resizeMode || 'cover';
|
|
154
|
+
const tintColor = props.tintColor ?? flattenedStyle?.tintColor;
|
|
166
155
|
|
|
167
156
|
if (props.children != null) {
|
|
168
157
|
throw new Error(
|
|
@@ -55,14 +55,7 @@ class ImageBackground extends React.Component<ImageBackgroundProps> {
|
|
|
55
55
|
|
|
56
56
|
_viewRef: ?React.ElementRef<typeof View> = null;
|
|
57
57
|
|
|
58
|
-
_captureRef = (
|
|
59
|
-
ref: null | React$ElementRef<
|
|
60
|
-
React$AbstractComponent<
|
|
61
|
-
ViewProps,
|
|
62
|
-
React.ElementRef<HostComponent<ViewProps>>,
|
|
63
|
-
>,
|
|
64
|
-
>,
|
|
65
|
-
) => {
|
|
58
|
+
_captureRef = (ref: null | React.ElementRef<HostComponent<ViewProps>>) => {
|
|
66
59
|
this._viewRef = ref;
|
|
67
60
|
};
|
|
68
61
|
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
type ResizeMode = 'cover' | 'contain' | 'stretch' | 'repeat' | 'center';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return objectFitMap[objectFit];
|
|
13
|
+
const objectFitMap: {[string]: ResizeMode} = {
|
|
14
|
+
contain: 'contain',
|
|
15
|
+
cover: 'cover',
|
|
16
|
+
fill: 'stretch',
|
|
17
|
+
'scale-down': 'contain',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export function convertObjectFitToResizeMode(objectFit: ?string): ?ResizeMode {
|
|
21
|
+
return objectFit != null ? objectFitMap[objectFit] : undefined;
|
|
22
22
|
}
|
|
@@ -50,6 +50,7 @@ interface NativeCommands {
|
|
|
50
50
|
+setIsVisible_EXPERIMENTAL: (
|
|
51
51
|
viewRef: ElementRef<HostComponent<mixed>>,
|
|
52
52
|
isVisible: boolean,
|
|
53
|
+
time: number,
|
|
53
54
|
) => void;
|
|
54
55
|
}
|
|
55
56
|
|
|
@@ -112,6 +113,9 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
|
|
|
112
113
|
borderBottomRightRadius: true,
|
|
113
114
|
borderTopRightRadius: true,
|
|
114
115
|
loadingIndicatorSrc: true,
|
|
116
|
+
experimental_boxShadow: {
|
|
117
|
+
process: require('../StyleSheet/processBoxShadow').default,
|
|
118
|
+
},
|
|
115
119
|
},
|
|
116
120
|
}
|
|
117
121
|
: {
|
|
@@ -335,7 +335,7 @@ class NetworkOverlay extends React.Component<Props, State> {
|
|
|
335
335
|
_renderItem = ({
|
|
336
336
|
item,
|
|
337
337
|
index,
|
|
338
|
-
}: RenderItemProps<NetworkRequestInfo>): React.
|
|
338
|
+
}: RenderItemProps<NetworkRequestInfo>): React.MixedElement => {
|
|
339
339
|
const tableRowViewStyle = [
|
|
340
340
|
styles.tableRow,
|
|
341
341
|
index % 2 === 1 ? styles.tableRowOdd : styles.tableRowEven,
|
|
@@ -617,7 +617,7 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
|
|
|
617
617
|
}
|
|
618
618
|
|
|
619
619
|
_renderer = (
|
|
620
|
-
ListItemComponent: ?(React.ComponentType<any> | React.
|
|
620
|
+
ListItemComponent: ?(React.ComponentType<any> | React.MixedElement),
|
|
621
621
|
renderItem: ?RenderItemType<ItemT>,
|
|
622
622
|
columnWrapperStyle: ?ViewStyleProp,
|
|
623
623
|
numColumns: ?number,
|
|
@@ -33,7 +33,7 @@ type RequiredProps<SectionT: SectionBase<any>> = {|
|
|
|
33
33
|
*
|
|
34
34
|
* sections: $ReadOnlyArray<{
|
|
35
35
|
* data: $ReadOnlyArray<SectionItem>,
|
|
36
|
-
* renderItem?: ({item: SectionItem, ...}) => ?React.
|
|
36
|
+
* renderItem?: ({item: SectionItem, ...}) => ?React.MixedElement,
|
|
37
37
|
* ItemSeparatorComponent?: ?ReactClass<{highlighted: boolean, ...}>,
|
|
38
38
|
* }>
|
|
39
39
|
*/
|
|
@@ -55,7 +55,7 @@ type OptionalProps<SectionT: SectionBase<any>> = {|
|
|
|
55
55
|
...
|
|
56
56
|
},
|
|
57
57
|
...
|
|
58
|
-
}) => null | React.
|
|
58
|
+
}) => null | React.Node,
|
|
59
59
|
/**
|
|
60
60
|
* A marker property for telling the list to re-render (since it implements `PureComponent`). If
|
|
61
61
|
* any of your `renderItem`, Header, Footer, etc. functions depend on anything outside of the
|
|
@@ -34,7 +34,7 @@ type RequiredProps<SectionT: SectionBase<any>> = {|
|
|
|
34
34
|
*
|
|
35
35
|
* sections: $ReadOnlyArray<{
|
|
36
36
|
* data: $ReadOnlyArray<SectionItem>,
|
|
37
|
-
* renderItem?: ({item: SectionItem, ...}) => ?React.
|
|
37
|
+
* renderItem?: ({item: SectionItem, ...}) => ?React.MixedElement,
|
|
38
38
|
* ItemSeparatorComponent?: ?ReactClass<{highlighted: boolean, ...}>,
|
|
39
39
|
* }>
|
|
40
40
|
*/
|
|
@@ -18,6 +18,7 @@ import type {
|
|
|
18
18
|
Message,
|
|
19
19
|
} from './parseLogBoxLog';
|
|
20
20
|
|
|
21
|
+
import NativeDebuggerSessionObserver from '../../../src/private/specs/modules/NativeDebuggerSessionObserver';
|
|
21
22
|
import parseErrorStack from '../../Core/Devtools/parseErrorStack';
|
|
22
23
|
import NativeDevSettings from '../../NativeModules/specs/NativeDevSettings';
|
|
23
24
|
import NativeLogBox from '../../NativeModules/specs/NativeLogBox';
|
|
@@ -75,6 +76,7 @@ let updateTimeout: $FlowFixMe | null = null;
|
|
|
75
76
|
let _isDisabled = false;
|
|
76
77
|
let _selectedIndex = -1;
|
|
77
78
|
let hasShownFuseboxWarningsMigrationMessage = false;
|
|
79
|
+
let hostTargetSessionObserverSubscription = null;
|
|
78
80
|
|
|
79
81
|
let warningFilter: WarningFilter = function (format) {
|
|
80
82
|
return {
|
|
@@ -196,11 +198,36 @@ function appendNewLog(newLog: LogBoxLog) {
|
|
|
196
198
|
}
|
|
197
199
|
|
|
198
200
|
export function addLog(log: LogData): void {
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
|
|
201
|
+
if (
|
|
202
|
+
hostTargetSessionObserverSubscription == null &&
|
|
203
|
+
NativeDebuggerSessionObserver != null
|
|
204
|
+
) {
|
|
205
|
+
hostTargetSessionObserverSubscription =
|
|
206
|
+
NativeDebuggerSessionObserver.subscribe(hasActiveSession => {
|
|
207
|
+
if (hasActiveSession) {
|
|
208
|
+
clearWarnings();
|
|
209
|
+
} else {
|
|
210
|
+
// Reset the flag so that we can show the message again if new warning was emitted
|
|
211
|
+
hasShownFuseboxWarningsMigrationMessage = false;
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// If Host has Fusebox support
|
|
217
|
+
if (
|
|
218
|
+
log.level === 'warn' &&
|
|
219
|
+
global.__FUSEBOX_HAS_FULL_CONSOLE_SUPPORT__ &&
|
|
220
|
+
NativeDebuggerSessionObserver != null
|
|
221
|
+
) {
|
|
222
|
+
// And there is no active debugging session
|
|
223
|
+
if (!NativeDebuggerSessionObserver.hasActiveSession()) {
|
|
224
|
+
showFuseboxWarningsMigrationMessageOnce();
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Don't show LogBox warnings when Host has active debugging session
|
|
202
228
|
return;
|
|
203
229
|
}
|
|
230
|
+
|
|
204
231
|
const errorForStackTrace = new Error();
|
|
205
232
|
|
|
206
233
|
// Parsing logs are expensive so we schedule this
|
|
@@ -419,6 +446,7 @@ export function withSubscription(
|
|
|
419
446
|
componentDidCatch(err: Error, errorInfo: {componentStack: string, ...}) {
|
|
420
447
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for
|
|
421
448
|
* this parameters */
|
|
449
|
+
// $FlowFixMe[incompatible-call]
|
|
422
450
|
reportLogBoxError(err, errorInfo.componentStack);
|
|
423
451
|
}
|
|
424
452
|
|
|
@@ -483,7 +511,6 @@ function showFuseboxWarningsMigrationMessageOnce() {
|
|
|
483
511
|
if (NativeDevSettings.openDebugger) {
|
|
484
512
|
NativeDevSettings.openDebugger();
|
|
485
513
|
}
|
|
486
|
-
clearWarnings();
|
|
487
514
|
},
|
|
488
515
|
}),
|
|
489
516
|
);
|
|
@@ -169,6 +169,8 @@ const validAttributesForNonEventProps = {
|
|
|
169
169
|
experimental_filter: {
|
|
170
170
|
process: require('../StyleSheet/processFilter').default,
|
|
171
171
|
},
|
|
172
|
+
experimental_mixBlendMode: true,
|
|
173
|
+
isolation: true,
|
|
172
174
|
opacity: true,
|
|
173
175
|
elevation: true,
|
|
174
176
|
shadowColor: {process: require('../StyleSheet/processColor').default},
|
|
@@ -193,6 +193,8 @@ const validAttributesForNonEventProps = {
|
|
|
193
193
|
accessibilityViewIsModal: true,
|
|
194
194
|
accessibilityElementsHidden: true,
|
|
195
195
|
accessibilityIgnoresInvertColors: true,
|
|
196
|
+
accessibilityShowsLargeContentViewer: true,
|
|
197
|
+
accessibilityLargeContentTitle: true,
|
|
196
198
|
testID: true,
|
|
197
199
|
backgroundColor: {process: require('../StyleSheet/processColor').default},
|
|
198
200
|
backfaceVisibility: true,
|
|
@@ -223,6 +225,11 @@ const validAttributesForNonEventProps = {
|
|
|
223
225
|
experimental_filter: {
|
|
224
226
|
process: require('../StyleSheet/processFilter').default,
|
|
225
227
|
},
|
|
228
|
+
experimental_boxShadow: {
|
|
229
|
+
process: require('../StyleSheet/processBoxShadow').default,
|
|
230
|
+
},
|
|
231
|
+
experimental_mixBlendMode: true,
|
|
232
|
+
isolation: true,
|
|
226
233
|
|
|
227
234
|
borderTopWidth: true,
|
|
228
235
|
borderTopColor: {process: require('../StyleSheet/processColor').default},
|
|
@@ -193,6 +193,8 @@ const validAttributesForNonEventProps = {
|
|
|
193
193
|
accessibilityViewIsModal: true,
|
|
194
194
|
accessibilityElementsHidden: true,
|
|
195
195
|
accessibilityIgnoresInvertColors: true,
|
|
196
|
+
accessibilityShowsLargeContentViewer: true,
|
|
197
|
+
accessibilityLargeContentTitle: true,
|
|
196
198
|
testID: true,
|
|
197
199
|
backgroundColor: {process: require('../StyleSheet/processColor').default},
|
|
198
200
|
backfaceVisibility: true,
|
|
@@ -223,6 +225,11 @@ const validAttributesForNonEventProps = {
|
|
|
223
225
|
experimental_filter: {
|
|
224
226
|
process: require('../StyleSheet/processFilter').default,
|
|
225
227
|
},
|
|
228
|
+
experimental_boxShadow: {
|
|
229
|
+
process: require('../StyleSheet/processBoxShadow').default,
|
|
230
|
+
},
|
|
231
|
+
experimental_mixBlendMode: true,
|
|
232
|
+
isolation: true,
|
|
226
233
|
|
|
227
234
|
borderTopWidth: true,
|
|
228
235
|
borderTopColor: {process: require('../StyleSheet/processColor').default},
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import type {
|
|
12
12
|
HostComponent,
|
|
13
13
|
PartialViewConfig,
|
|
14
|
+
ViewConfig,
|
|
14
15
|
} from '../Renderer/shims/ReactNativeTypes';
|
|
15
16
|
|
|
16
17
|
import getNativeComponentAttributes from '../ReactNative/getNativeComponentAttributes';
|
|
@@ -60,7 +61,7 @@ export function get<Config>(
|
|
|
60
61
|
verify: false,
|
|
61
62
|
};
|
|
62
63
|
|
|
63
|
-
let viewConfig;
|
|
64
|
+
let viewConfig: ViewConfig;
|
|
64
65
|
if (native) {
|
|
65
66
|
viewConfig =
|
|
66
67
|
getNativeComponentAttributes(name) ??
|
|
@@ -81,7 +82,13 @@ export function get<Config>(
|
|
|
81
82
|
const nativeViewConfig = native
|
|
82
83
|
? viewConfig
|
|
83
84
|
: getNativeComponentAttributes(name);
|
|
84
|
-
|
|
85
|
+
|
|
86
|
+
if (nativeViewConfig == null) {
|
|
87
|
+
// Defer to static view config if native view config is missing.
|
|
88
|
+
return viewConfig;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const staticViewConfig: ViewConfig = native
|
|
85
92
|
? createViewConfig(viewConfigProvider())
|
|
86
93
|
: viewConfig;
|
|
87
94
|
|
|
@@ -78,7 +78,9 @@ const REQUEST_EVENTS = [
|
|
|
78
78
|
|
|
79
79
|
const XHR_EVENTS = REQUEST_EVENTS.concat('readystatechange');
|
|
80
80
|
|
|
81
|
-
class XMLHttpRequestEventTarget extends (EventTarget(
|
|
81
|
+
class XMLHttpRequestEventTarget extends (EventTarget(
|
|
82
|
+
...REQUEST_EVENTS,
|
|
83
|
+
): typeof EventTarget) {
|
|
82
84
|
onload: ?Function;
|
|
83
85
|
onloadstart: ?Function;
|
|
84
86
|
onprogress: ?Function;
|
|
@@ -91,7 +93,7 @@ class XMLHttpRequestEventTarget extends (EventTarget(...REQUEST_EVENTS): any) {
|
|
|
91
93
|
/**
|
|
92
94
|
* Shared base for platform-specific XMLHttpRequest implementations.
|
|
93
95
|
*/
|
|
94
|
-
class XMLHttpRequest extends (EventTarget(...XHR_EVENTS):
|
|
96
|
+
class XMLHttpRequest extends (EventTarget(...XHR_EVENTS): typeof EventTarget) {
|
|
95
97
|
static UNSENT: number = UNSENT;
|
|
96
98
|
static OPENED: number = OPENED;
|
|
97
99
|
static HEADERS_RECEIVED: number = HEADERS_RECEIVED;
|
|
@@ -20,7 +20,7 @@ import type {
|
|
|
20
20
|
import type {ElementRef} from 'react';
|
|
21
21
|
|
|
22
22
|
import TextInputState from '../../Components/TextInput/TextInputState';
|
|
23
|
-
import {getNodeFromInternalInstanceHandle} from '../../
|
|
23
|
+
import {getNodeFromInternalInstanceHandle} from '../../ReactNative/RendererProxy';
|
|
24
24
|
import {getFabricUIManager} from '../FabricUIManager';
|
|
25
25
|
import {create} from './ReactNativeAttributePayload';
|
|
26
26
|
import warnForStyleProps from './warnForStyleProps';
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
import type ReactNativeElement from '../../../src/private/webapis/dom/nodes/ReactNativeElement';
|
|
17
17
|
import type ReadOnlyText from '../../../src/private/webapis/dom/nodes/ReadOnlyText';
|
|
18
|
-
import typeof
|
|
18
|
+
import typeof * as RendererProxyT from '../../ReactNative/RendererProxy';
|
|
19
19
|
import type {
|
|
20
20
|
InternalInstanceHandle,
|
|
21
21
|
Node,
|
|
@@ -32,7 +32,7 @@ let PublicInstanceClass:
|
|
|
32
32
|
let ReadOnlyTextClass: Class<ReadOnlyText>;
|
|
33
33
|
|
|
34
34
|
// Lazy loaded to avoid evaluating the module when using the legacy renderer.
|
|
35
|
-
let
|
|
35
|
+
let RendererProxy: RendererProxyT;
|
|
36
36
|
|
|
37
37
|
export function createPublicInstance(
|
|
38
38
|
tag: number,
|
|
@@ -78,10 +78,10 @@ export function getNodeFromPublicInstance(
|
|
|
78
78
|
return null;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
if (
|
|
82
|
-
|
|
81
|
+
if (RendererProxy == null) {
|
|
82
|
+
RendererProxy = require('../../ReactNative/RendererProxy');
|
|
83
83
|
}
|
|
84
|
-
return
|
|
84
|
+
return RendererProxy.getNodeFromInternalInstanceHandle(
|
|
85
85
|
publicInstance.__internalInstanceHandle,
|
|
86
86
|
);
|
|
87
87
|
}
|
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
* @flow strict-local
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {
|
|
11
|
+
import type {
|
|
12
|
+
HostComponent,
|
|
13
|
+
InternalInstanceHandle,
|
|
14
|
+
Node,
|
|
15
|
+
} from '../Renderer/shims/ReactNativeTypes';
|
|
12
16
|
import type ReactFabricHostComponent from './ReactFabricPublicInstance/ReactFabricHostComponent';
|
|
13
17
|
import type {Element, ElementRef, ElementType} from 'react';
|
|
14
18
|
|
|
@@ -16,7 +20,7 @@ import {
|
|
|
16
20
|
onCaughtError,
|
|
17
21
|
onRecoverableError,
|
|
18
22
|
onUncaughtError,
|
|
19
|
-
} from '
|
|
23
|
+
} from '../../src/private/renderer/errorhandling/ErrorHandlers';
|
|
20
24
|
import {type RootTag} from './RootTag';
|
|
21
25
|
export function renderElement({
|
|
22
26
|
element,
|
|
@@ -139,3 +143,21 @@ export function isChildPublicInstance(
|
|
|
139
143
|
childInstance,
|
|
140
144
|
);
|
|
141
145
|
}
|
|
146
|
+
|
|
147
|
+
export function getNodeFromInternalInstanceHandle(
|
|
148
|
+
internalInstanceHandle: InternalInstanceHandle,
|
|
149
|
+
): ?Node {
|
|
150
|
+
// This is only available in Fabric
|
|
151
|
+
return require('../Renderer/shims/ReactFabric').getNodeFromInternalInstanceHandle(
|
|
152
|
+
internalInstanceHandle,
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export function getPublicInstanceFromInternalInstanceHandle(
|
|
157
|
+
internalInstanceHandle: InternalInstanceHandle,
|
|
158
|
+
): mixed /*PublicInstance | PublicTextInstance | null*/ {
|
|
159
|
+
// This is only available in Fabric
|
|
160
|
+
return require('../Renderer/shims/ReactFabric').getPublicInstanceFromInternalInstanceHandle(
|
|
161
|
+
internalInstanceHandle,
|
|
162
|
+
);
|
|
163
|
+
}
|
|
@@ -10,8 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
+
import processBoxShadow from '../StyleSheet/processBoxShadow';
|
|
14
|
+
|
|
13
15
|
const ReactNativeStyleAttributes = require('../Components/View/ReactNativeStyleAttributes');
|
|
14
16
|
const resolveAssetSource = require('../Image/resolveAssetSource');
|
|
17
|
+
const processBackgroundImage =
|
|
18
|
+
require('../StyleSheet/processBackgroundImage').default;
|
|
15
19
|
const processColor = require('../StyleSheet/processColor').default;
|
|
16
20
|
const processColorArray = require('../StyleSheet/processColorArray');
|
|
17
21
|
const processFilter = require('../StyleSheet/processFilter').default;
|
|
@@ -191,8 +195,12 @@ function getProcessorForType(typeName: string): ?(nextProp: any) => any {
|
|
|
191
195
|
return processColorArray;
|
|
192
196
|
case 'Filter':
|
|
193
197
|
return processFilter;
|
|
198
|
+
case 'BackgroundImage':
|
|
199
|
+
return processBackgroundImage;
|
|
194
200
|
case 'ImageSource':
|
|
195
201
|
return resolveAssetSource;
|
|
202
|
+
case 'BoxShadow':
|
|
203
|
+
return processBoxShadow;
|
|
196
204
|
}
|
|
197
205
|
return null;
|
|
198
206
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @noformat
|
|
8
8
|
* @nolint
|
|
9
9
|
* @flow strict
|
|
10
|
-
* @generated SignedSource<<
|
|
10
|
+
* @generated SignedSource<<4405023a5d82ddc01db31d8eb46a7aa0>>
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import type {ElementRef, ElementType, Element, AbstractComponent} from 'react';
|
|
@@ -86,6 +86,7 @@ export type ViewConfig = $ReadOnly<{
|
|
|
86
86
|
}>,
|
|
87
87
|
...
|
|
88
88
|
}>,
|
|
89
|
+
supportsRawText?: boolean,
|
|
89
90
|
uiViewClassName: string,
|
|
90
91
|
validAttributes: AttributeConfiguration,
|
|
91
92
|
}>;
|
|
@@ -93,6 +94,7 @@ export type ViewConfig = $ReadOnly<{
|
|
|
93
94
|
export type PartialViewConfig = $ReadOnly<{
|
|
94
95
|
bubblingEventTypes?: $PropertyType<ViewConfig, 'bubblingEventTypes'>,
|
|
95
96
|
directEventTypes?: $PropertyType<ViewConfig, 'directEventTypes'>,
|
|
97
|
+
supportsRawText?: boolean,
|
|
96
98
|
uiViewClassName: string,
|
|
97
99
|
validAttributes?: PartialAttributeConfiguration,
|
|
98
100
|
}>;
|
|
@@ -23,7 +23,7 @@ import type {
|
|
|
23
23
|
____ViewStyleProp_Internal,
|
|
24
24
|
} from './StyleSheetTypes';
|
|
25
25
|
|
|
26
|
-
import composeStyles from '../../src/private/
|
|
26
|
+
import composeStyles from '../../src/private/styles/composeStyles';
|
|
27
27
|
|
|
28
28
|
const ReactNativeStyleAttributes = require('../Components/View/ReactNativeStyleAttributes');
|
|
29
29
|
const PixelRatio = require('../Utilities/PixelRatio').default;
|
|
@@ -23,7 +23,7 @@ import type {
|
|
|
23
23
|
____ViewStyleProp_Internal,
|
|
24
24
|
} from './StyleSheetTypes';
|
|
25
25
|
|
|
26
|
-
import composeStyles from '../../src/private/
|
|
26
|
+
import composeStyles from '../../src/private/styles/composeStyles';
|
|
27
27
|
|
|
28
28
|
const ReactNativeStyleAttributes = require('../Components/View/ReactNativeStyleAttributes');
|
|
29
29
|
const PixelRatio = require('../Utilities/PixelRatio').default;
|