@office-iss/react-native-win32 0.69.0 → 0.70.0
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/.eslintrc.js +0 -1
- package/.flowconfig +5 -1
- package/CHANGELOG.json +241 -31
- package/CHANGELOG.md +97 -18
- package/IntegrationTests/AsyncStorageTest.js +20 -4
- package/IntegrationTests/BUCK +2 -2
- package/IntegrationTests/LayoutEventsTest.js +4 -1
- package/IntegrationTests/{launchWebSocketServer.command → launchWebSocketServer.sh} +3 -9
- package/Libraries/Alert/Alert.js +18 -4
- package/Libraries/Alert/Alert.win32.js +2 -0
- package/Libraries/Alert/NativeAlertManager.js +1 -0
- package/Libraries/Animated/Animated.js +2 -2
- package/Libraries/Animated/AnimatedEvent.js +7 -4
- package/Libraries/Animated/AnimatedImplementation.js +17 -3
- package/Libraries/Animated/AnimatedMock.js +7 -2
- package/Libraries/Animated/NativeAnimatedHelper.js +220 -95
- package/Libraries/Animated/NativeAnimatedModule.js +3 -0
- package/Libraries/Animated/NativeAnimatedTurboModule.js +3 -0
- package/Libraries/Animated/animations/SpringAnimation.js +3 -3
- package/Libraries/Animated/animations/TimingAnimation.js +3 -3
- package/Libraries/Animated/createAnimatedComponent.js +8 -1
- package/Libraries/Animated/nodes/AnimatedAddition.js +3 -1
- package/Libraries/Animated/nodes/AnimatedColor.js +50 -29
- package/Libraries/Animated/nodes/AnimatedDiffClamp.js +3 -1
- package/Libraries/Animated/nodes/AnimatedDivision.js +3 -1
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +22 -21
- package/Libraries/Animated/nodes/AnimatedModulo.js +3 -1
- package/Libraries/Animated/nodes/AnimatedMultiplication.js +3 -2
- package/Libraries/Animated/nodes/AnimatedProps.js +20 -12
- package/Libraries/Animated/nodes/AnimatedStyle.js +19 -16
- package/Libraries/Animated/nodes/AnimatedSubtraction.js +3 -1
- package/Libraries/Animated/nodes/AnimatedTransform.js +5 -5
- package/Libraries/Animated/nodes/AnimatedValue.js +14 -5
- package/Libraries/Animated/nodes/AnimatedValueXY.js +28 -1
- package/Libraries/Animated/useAnimatedProps.js +1 -0
- package/Libraries/AppState/AppState.js +0 -32
- package/Libraries/BatchedBridge/MessageQueue.js +21 -15
- package/Libraries/BatchedBridge/NativeModules.js +3 -4
- package/Libraries/Blob/FileReader.js +0 -6
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +0 -20
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +0 -20
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -0
- package/Libraries/Components/Keyboard/Keyboard.js +0 -11
- package/Libraries/Components/Pressable/Pressable.js +2 -0
- package/Libraries/Components/Pressable/Pressable.win32.js +2 -0
- package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +1 -3
- package/Libraries/Components/SafeAreaView/SafeAreaView.js +3 -30
- package/Libraries/Components/SafeAreaView/SafeAreaView.win32.js +4 -32
- package/Libraries/Components/ScrollView/ScrollView.js +13 -11
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +5 -3
- package/Libraries/Components/StatusBar/StatusBar.js +10 -7
- package/Libraries/Components/TextInput/InputAccessoryView.js +14 -13
- package/Libraries/Components/TextInput/TextInput.js +12 -2
- package/Libraries/Components/Touchable/PooledClass.js +16 -4
- package/Libraries/Components/Touchable/Touchable.js +50 -1
- package/Libraries/Components/Touchable/Touchable.win32.js +972 -0
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +6 -2
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +0 -7
- package/Libraries/Components/View/ViewPropTypes.js +3 -8
- package/Libraries/Components/View/ViewPropTypes.win32.js +3 -8
- package/Libraries/Components/View/ViewWin32.Props.d.ts +1 -1
- package/Libraries/Components/View/ViewWin32.Props.js.map +1 -1
- package/Libraries/Core/ExceptionsManager.js +2 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/Timers/JSTimers.js +2 -2
- package/Libraries/Core/polyfillPromise.js +0 -32
- package/Libraries/Core/setUpBatchedBridge.js +5 -1
- package/Libraries/Core/setUpPerformance.js +1 -1
- package/Libraries/EventEmitter/NativeEventEmitter.js +0 -13
- package/Libraries/Image/AssetSourceResolver.js +2 -2
- package/Libraries/Image/Image.android.js +5 -3
- package/Libraries/Image/Image.ios.js +6 -3
- package/Libraries/Image/Image.win32.js +6 -3
- package/Libraries/Image/ImageSource.js +7 -5
- package/Libraries/Inspector/ElementBox.js +2 -2
- package/Libraries/Inspector/NetworkOverlay.js +13 -8
- package/Libraries/Interaction/PanResponder.js +16 -14
- package/Libraries/Linking/Linking.js +0 -11
- package/Libraries/Lists/FlatList.js +3 -2
- package/Libraries/Lists/SectionList.js +2 -0
- package/Libraries/Lists/ViewabilityHelper.js +7 -3
- package/Libraries/Lists/VirtualizeUtils.js +33 -20
- package/Libraries/Lists/VirtualizedList.js +93 -47
- package/Libraries/Lists/VirtualizedListContext.js +1 -0
- package/Libraries/Lists/VirtualizedSectionList.js +14 -9
- package/Libraries/Lists/__tests__/VirtualizeUtils-test.js +19 -18
- package/Libraries/Lists/__tests__/VirtualizedList-test.js +10 -6
- package/Libraries/LogBox/Data/LogBoxData.js +1 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
- package/Libraries/LogBox/LogBox.js +3 -1
- package/Libraries/LogBox/UI/AnsiHighlight.js +2 -0
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +3 -0
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +0 -3
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +8 -3
- package/Libraries/NativeComponent/BaseViewConfig.android.js +9 -18
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +26 -12
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +26 -12
- package/Libraries/Network/XMLHttpRequest.js +9 -11
- package/Libraries/Performance/PureComponentDebug.js +1 -0
- package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +9 -1
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +16 -0
- package/Libraries/Pressability/Pressability.js +26 -16
- package/Libraries/Pressability/Pressability.win32.js +26 -16
- package/Libraries/Promise.js +0 -1
- package/Libraries/ReactNative/AppRegistry.js +16 -13
- package/Libraries/ReactNative/BridgelessUIManager.js +2 -0
- package/Libraries/ReactNative/PaperUIManager.js +9 -9
- package/Libraries/ReactNative/PaperUIManager.win32.js +7 -8
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +12 -0
- package/Libraries/ReactNative/ReactNativeRuntimeDiagnostics.js +68 -0
- package/Libraries/ReactNative/getNativeComponentAttributes.js +6 -7
- package/Libraries/ReactNative/renderApplication.js +1 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +4443 -3615
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +1496 -1170
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +1694 -1356
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +4439 -3588
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1583 -1249
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1719 -1372
- package/Libraries/Storage/AsyncStorage.js +7 -1
- package/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +8 -0
- package/Libraries/StyleSheet/flattenStyle.js +1 -1
- package/Libraries/StyleSheet/processTransform.js +2 -0
- package/Libraries/StyleSheet/splitLayoutProps.js +2 -0
- package/Libraries/Text/Text.js +15 -7
- package/Libraries/Types/CoreEventTypes.js +137 -11
- package/Libraries/Types/CoreEventTypes.win32.js +147 -22
- package/Libraries/Utilities/Dimensions.js +0 -13
- package/Libraries/Utilities/Dimensions.win32.js +0 -9
- package/Libraries/Utilities/HMRClient.js +3 -3
- package/Libraries/Utilities/Platform.ios.js +0 -7
- package/Libraries/Utilities/ReactNativeTestTools.js +3 -1
- package/Libraries/Utilities/codegenNativeCommands.js +11 -2
- package/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js +2 -0
- package/Libraries/Utilities/stringifySafe.js +3 -1
- package/Libraries/Utilities/truncate.js +1 -1
- package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +2 -2
- package/Libraries/Vibration/Vibration.js +1 -1
- package/Libraries/WebSocket/WebSocket.js +1 -0
- package/Libraries/vendor/emitter/EventEmitter.js +105 -12
- package/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js +73 -117
- package/flow/JSITimerInternalType.js +30 -0
- package/jest/assetFileTransformer.js +3 -2
- package/jest/setup.js +4 -0
- package/jest.config.js +0 -1
- package/overrides.json +23 -16
- package/package.json +21 -22
- package/rntypes/index.d.ts +0 -1
- package/src/Libraries/Components/View/ViewWin32.Props.ts +2 -1
- package/src/rntypes/index.d.ts +0 -1
- package/Libraries/vendor/emitter/EventSubscription.js +0 -19
- package/Libraries/vendor/emitter/_EmitterSubscription.js +0 -62
- package/Libraries/vendor/emitter/_EventEmitter.js +0 -184
- package/Libraries/vendor/emitter/_EventSubscription.js +0 -45
- package/Libraries/vendor/emitter/_EventSubscriptionVendor.js +0 -108
- package/jest/preprocessor.js +0 -40
- package/jest/preprocessor_DO_NOT_USE.js +0 -122
- package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizeUtils-test.js.snap +0 -3
|
@@ -312,11 +312,15 @@ class TouchableNativeFeedback extends React.Component<Props, State> {
|
|
|
312
312
|
|
|
313
313
|
const getBackgroundProp =
|
|
314
314
|
Platform.OS === 'android'
|
|
315
|
-
? (
|
|
315
|
+
? /* $FlowFixMe[missing-local-annot] The type annotation(s) required by
|
|
316
|
+
* Flow's LTI update could not be added via codemod */
|
|
317
|
+
(background, useForeground: boolean) =>
|
|
316
318
|
useForeground && TouchableNativeFeedback.canUseNativeForeground()
|
|
317
319
|
? {nativeForegroundAndroid: background}
|
|
318
320
|
: {nativeBackgroundAndroid: background}
|
|
319
|
-
: (
|
|
321
|
+
: /* $FlowFixMe[missing-local-annot] The type annotation(s) required by
|
|
322
|
+
* Flow's LTI update could not be added via codemod */
|
|
323
|
+
(background, useForeground: boolean) => null;
|
|
320
324
|
|
|
321
325
|
TouchableNativeFeedback.displayName = 'TouchableNativeFeedback';
|
|
322
326
|
|
|
@@ -85,14 +85,7 @@ const ReactNativeStyleAttributes: {[string]: AnyAttributeType, ...} = {
|
|
|
85
85
|
/**
|
|
86
86
|
* Transform
|
|
87
87
|
*/
|
|
88
|
-
decomposedMatrix: true, // @deprecated
|
|
89
|
-
rotation: true, // @deprecated
|
|
90
|
-
scaleX: true, // @deprecated
|
|
91
|
-
scaleY: true, // @deprecated
|
|
92
88
|
transform: {process: processTransform},
|
|
93
|
-
transformMatrix: true, // @deprecated
|
|
94
|
-
translateX: true, // @deprecated
|
|
95
|
-
translateY: true, // @deprecated
|
|
96
89
|
|
|
97
90
|
/**
|
|
98
91
|
* View
|
|
@@ -92,22 +92,17 @@ type MouseEventProps = $ReadOnly<{|
|
|
|
92
92
|
// Experimental/Work in Progress Pointer Event Callbacks (not yet ready for use)
|
|
93
93
|
type PointerEventProps = $ReadOnly<{|
|
|
94
94
|
onPointerEnter?: ?(event: PointerEvent) => void,
|
|
95
|
+
onPointerEnterCapture?: ?(event: PointerEvent) => void,
|
|
95
96
|
onPointerLeave?: ?(event: PointerEvent) => void,
|
|
97
|
+
onPointerLeaveCapture?: ?(event: PointerEvent) => void,
|
|
96
98
|
onPointerMove?: ?(event: PointerEvent) => void,
|
|
99
|
+
onPointerMoveCapture?: ?(event: PointerEvent) => void,
|
|
97
100
|
onPointerCancel?: ?(e: PointerEvent) => void,
|
|
98
101
|
onPointerCancelCapture?: ?(e: PointerEvent) => void,
|
|
99
102
|
onPointerDown?: ?(e: PointerEvent) => void,
|
|
100
103
|
onPointerDownCapture?: ?(e: PointerEvent) => void,
|
|
101
104
|
onPointerUp?: ?(e: PointerEvent) => void,
|
|
102
105
|
onPointerUpCapture?: ?(e: PointerEvent) => void,
|
|
103
|
-
|
|
104
|
-
// FIXME: these events are temporary while we converge pointer event handling
|
|
105
|
-
onPointerEnter2?: ?(e: PointerEvent) => void,
|
|
106
|
-
onPointerEnter2Capture?: ?(e: PointerEvent) => void,
|
|
107
|
-
onPointerLeave2?: ?(e: PointerEvent) => void,
|
|
108
|
-
onPointerLeave2Capture?: ?(e: PointerEvent) => void,
|
|
109
|
-
onPointerMove2?: ?(e: PointerEvent) => void,
|
|
110
|
-
onPointerMove2Capture?: ?(e: PointerEvent) => void,
|
|
111
106
|
|}>;
|
|
112
107
|
|
|
113
108
|
type TouchEventProps = $ReadOnly<{|
|
|
@@ -93,22 +93,17 @@ type MouseEventProps = $ReadOnly<{|
|
|
|
93
93
|
// Experimental/Work in Progress Pointer Event Callbacks (not yet ready for use)
|
|
94
94
|
type PointerEventProps = $ReadOnly<{|
|
|
95
95
|
onPointerEnter?: ?(event: PointerEvent) => void,
|
|
96
|
+
onPointerEnterCapture?: ?(event: PointerEvent) => void,
|
|
96
97
|
onPointerLeave?: ?(event: PointerEvent) => void,
|
|
98
|
+
onPointerLeaveCapture?: ?(event: PointerEvent) => void,
|
|
97
99
|
onPointerMove?: ?(event: PointerEvent) => void,
|
|
100
|
+
onPointerMoveCapture?: ?(event: PointerEvent) => void,
|
|
98
101
|
onPointerCancel?: ?(e: PointerEvent) => void,
|
|
99
102
|
onPointerCancelCapture?: ?(e: PointerEvent) => void,
|
|
100
103
|
onPointerDown?: ?(e: PointerEvent) => void,
|
|
101
104
|
onPointerDownCapture?: ?(e: PointerEvent) => void,
|
|
102
105
|
onPointerUp?: ?(e: PointerEvent) => void,
|
|
103
106
|
onPointerUpCapture?: ?(e: PointerEvent) => void,
|
|
104
|
-
|
|
105
|
-
// FIXME: these events are temporary while we converge pointer event handling
|
|
106
|
-
onPointerEnter2?: ?(e: PointerEvent) => void,
|
|
107
|
-
onPointerEnter2Capture?: ?(e: PointerEvent) => void,
|
|
108
|
-
onPointerLeave2?: ?(e: PointerEvent) => void,
|
|
109
|
-
onPointerLeave2Capture?: ?(e: PointerEvent) => void,
|
|
110
|
-
onPointerMove2?: ?(e: PointerEvent) => void,
|
|
111
|
-
onPointerMove2Capture?: ?(e: PointerEvent) => void,
|
|
112
107
|
|}>;
|
|
113
108
|
|
|
114
109
|
type TouchEventProps = $ReadOnly<{|
|
|
@@ -34,7 +34,7 @@ export declare type AccessibilityAnnotationInfo = Readonly<{
|
|
|
34
34
|
dateTime?: string;
|
|
35
35
|
target?: string;
|
|
36
36
|
}>;
|
|
37
|
-
export declare type AccessibilityActionName = RN.AccessibilityActionName | 'AddToSelection' | 'RemoveFromSelection' | 'Select' | 'Expand' | 'Collapse';
|
|
37
|
+
export declare type AccessibilityActionName = RN.AccessibilityActionName | 'AddToSelection' | 'RemoveFromSelection' | 'Select' | 'Expand' | 'Collapse' | 'Toggle';
|
|
38
38
|
export declare type Cursor = 'auto' | 'default' | 'pointer' | 'help' | 'not-allowed' | 'wait' | 'move' | 'nesw-resize' | 'ns-resize' | 'nwse-resize' | 'we-resize' | 'text';
|
|
39
39
|
export declare type AccessibilityActionInfo = Readonly<{
|
|
40
40
|
name: AccessibilityActionName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewWin32.Props.js","sourceRoot":"","sources":["../../../src/Libraries/Components/View/ViewWin32.Props.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAeb,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,2CAAI,CAAA;IACJ,qDAAS,CAAA;IACT,mDAAQ,CAAA;IACR,mDAAQ,CAAA;AACV,CAAC,EALW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAKrB","sourcesContent":["'use strict';\nimport React from 'react'\nimport RN = require('react-native');\n\n// removes from interface T the members of interface K\ntype Omit<T, K> = Pick<T, Exclude<keyof T, keyof K>>;\n\n// All of T becomes optional except for Keys\ntype PartiallyRequired<T, Keys extends keyof T = keyof T> = Pick<Partial<T>, Exclude<keyof T, Keys>> & Pick<T, Keys>;\n\n/**\n * All of TOrigin except Key from TUse\n */\nexport type UseFrom<TOrigin, TUse, Key extends keyof TUse> = Pick<TOrigin, Exclude<keyof TOrigin, Key>> & Pick<TUse, Key>;\n\nexport enum EventPhase {\n None,\n Capturing,\n AtTarget,\n Bubbling\n}\n\nexport interface INativeKeyboardEvent {\n altKey: boolean;\n ctrlKey: boolean;\n metaKey: boolean;\n shiftKey: boolean;\n key: string;\n eventPhase: EventPhase;\n}\nexport type IKeyboardEvent = RN.NativeSyntheticEvent<INativeKeyboardEvent>;\nexport type IHandledKeyboardEvent = PartiallyRequired<INativeKeyboardEvent, 'key'>;\n\nexport interface IViewWin32 {\n focus: () => void;\n}\n\nexport type ARIARole =\n | 'alert'\n | 'alertdialog'\n | 'application'\n | 'button'\n | 'checkbox'\n | 'combobox'\n | 'dialog'\n | 'group'\n | 'link'\n | 'listitem'\n | 'menu'\n | 'menubar'\n | 'menuitem'\n | 'none'\n | 'presentation'\n | 'progressbar'\n | 'radio'\n | 'radiogroup'\n | 'scrollbar'\n | 'search'\n | 'spinbutton'\n | 'switch'\n | 'tab'\n | 'tablist'\n | 'tabpanel'\n | 'textbox'\n | 'timer'\n | 'toolbar'\n | 'tree'\n | 'treeitem';\n\nexport type AnnotationType =\n | 'AdvanceProofingIssue'\n | 'Author'\n | 'CircularReferenceError'\n | 'Comment'\n | 'ConflictingChange'\n | 'DataValidationError'\n | 'DeletionChange'\n | 'EditingLockedChange'\n | 'Endnote'\n | 'ExternalChange'\n | 'Footer'\n | 'Footnote'\n | 'FormatChange'\n | 'FormulaError'\n | 'GrammarError'\n | 'Header'\n | 'Highlighted'\n | 'InsertionChange'\n | 'Mathematics'\n | 'MoveChange'\n | 'SpellingError'\n | 'TrackChanges'\n | 'Unknown'\n | 'UnsyncedChange';\n\nexport type AccessibilityAnnotationInfo = Readonly<{\n typeID: AnnotationType;\n typeName?: string;\n author?: string;\n dateTime?: string;\n target?: string;\n}>;\n\nexport type AccessibilityActionName =\n | RN.AccessibilityActionName\n | 'AddToSelection'\n | 'RemoveFromSelection'\n | 'Select'\n | 'Expand'\n | 'Collapse';\n\nexport type Cursor =\n | 'auto'\n | 'default'\n | 'pointer'\n | 'help'\n | 'not-allowed'\n | 'wait'\n | 'move'\n | 'nesw-resize'\n | 'ns-resize'\n | 'nwse-resize'\n | 'we-resize'\n | 'text'\n\nexport type AccessibilityActionInfo = Readonly<{\n name: AccessibilityActionName;\n label?: string;\n}>;\n\nexport type AccessibilityState = RN.AccessibilityState & { multiselectable?: boolean, required?: boolean };\n\nexport type SharedAccessibilityPropsIOSandWin32 = {\n onAccessibilityTap?: () => void;\n};\n\nexport type OmittedAccessibilityPropsWin32 = {\n accessibilityActions?: ReadonlyArray<RN.AccessibilityActionInfo>;\n accessibilityRole?: RN.AccessibilityRole;\n accessibilityState?: RN.AccessibilityState;\n};\n\nexport type BasePropsWin32 = {\n /**\n * Tells a person using a screen reader the type of element they are focused on.\n *\n * Overrides the `accessibilityRole` prop on React Native to accept a subset of ARIA roles.\n *\n * Possible values for ARIARole are: alert, alertdialog, application, button, checkbox,\n * comobox, dialog, group, link, menu, menubar, menuitem, none, presentation, progressbar,\n * radio, radiogroup, scrollbar, search, spinbutton, switch, tab, tablist, tabpanel, textbox,\n * timer, toolbar, tree, and treeitem.\n */\n accessibilityRole?: RN.AccessibilityRole | ARIARole;\n accessibilityState?: AccessibilityState;\n accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>;\n\n /**\n * Windows Accessibility extensions for allowing other DOM elements to label or describe a given element.\n *\n * Defined as a reference to another DOM element inheriting from the primary base classes of React-Native elements.\n * The reference will be converted to a native reference (tag) before passing to the native platform.\n */\n accessibilityDescribedBy?: React.RefObject<any>;\n accessibilityLabeledBy?: React.RefObject<any>;\n\n /**\n * Identifies the element whose contents or presence are controlled by another element. \n * \n * This is mainly used for a Textbox with a Dropdown PeoplePicker-type list. This allows an \n * accessibility tool to query those other providers for properties and listen to their events.\n */\n accessibilityControls?: React.RefObject<any>; \n\n /**\n * Identifies the ItemType property, which is a text string describing the type of the automation element.\n * ItemType is used to obtain information about items in a list, tree view, or data grid. For example, an item in a file directory view might be a \"Document File\" or a \"Folder\".\n */\n accessibilityItemType?: string;\n};\n\nexport type ViewWin32OmitTypes = RN.ViewPropsAndroid &\n RN.ViewPropsIOS &\n RN.AccessibilityPropsAndroid &\n Omit<RN.AccessibilityPropsIOS, SharedAccessibilityPropsIOSandWin32> &\n OmittedAccessibilityPropsWin32;\n\n/**\n * Properties for ViewWin32 component\n */\nexport interface IViewWin32Props extends Omit<RN.ViewProps, ViewWin32OmitTypes>, BasePropsWin32 {\n type?: React.ElementType;\n children?: React.ReactNode;\n accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>;\n /**\n * Tells a person using a screen reader what kind of annotation they\n * have selected. If available, it will also tell a person the author of the annotation and\n * the date and time the annotation was posted.\n *\n * Note: If typeID is 'Unknown', a typeName must be provided.\n */\n accessibilityAnnotation?: AccessibilityAnnotationInfo;\n /**\n * accessibilityDescription provides more detailed information specific to the element (i.e. last edit date, full location for a file)\n * while accessibilityHint provides infomation on what will happen when they perform an action.\n *\n */\n accessibilityDescription?: string;\n accessibilityLevel?: number;\n accessibilityPositionInSet?: number;\n\n accessibilitySetSize?: number;\n animationClass?: string;\n focusable?: boolean;\n enableFocusRing?: boolean;\n\n /**\n * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React\n * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onBlur?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React\n * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onBlurCapture?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React\n * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onFocus?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React\n * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onFocusCapture?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n\n onKeyDown?: (args: IKeyboardEvent) => void;\n onKeyDownCapture?: (args: IKeyboardEvent) => void;\n onKeyUp?: (args: IKeyboardEvent) => void;\n onKeyUpCapture?: (args: IKeyboardEvent) => void;\n\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n\n keyDownEvents?: IHandledKeyboardEvent[];\n keyUpEvents?: IHandledKeyboardEvent[];\n\n /**\n * Provides a screentip to be used on hover of the view\n */\n tooltip?: string;\n cursor?: Cursor;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ViewWin32.Props.js","sourceRoot":"","sources":["../../../src/Libraries/Components/View/ViewWin32.Props.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAeb,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,2CAAI,CAAA;IACJ,qDAAS,CAAA;IACT,mDAAQ,CAAA;IACR,mDAAQ,CAAA;AACV,CAAC,EALW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAKrB","sourcesContent":["'use strict';\nimport React from 'react'\nimport RN = require('react-native');\n\n// removes from interface T the members of interface K\ntype Omit<T, K> = Pick<T, Exclude<keyof T, keyof K>>;\n\n// All of T becomes optional except for Keys\ntype PartiallyRequired<T, Keys extends keyof T = keyof T> = Pick<Partial<T>, Exclude<keyof T, Keys>> & Pick<T, Keys>;\n\n/**\n * All of TOrigin except Key from TUse\n */\nexport type UseFrom<TOrigin, TUse, Key extends keyof TUse> = Pick<TOrigin, Exclude<keyof TOrigin, Key>> & Pick<TUse, Key>;\n\nexport enum EventPhase {\n None,\n Capturing,\n AtTarget,\n Bubbling\n}\n\nexport interface INativeKeyboardEvent {\n altKey: boolean;\n ctrlKey: boolean;\n metaKey: boolean;\n shiftKey: boolean;\n key: string;\n eventPhase: EventPhase;\n}\nexport type IKeyboardEvent = RN.NativeSyntheticEvent<INativeKeyboardEvent>;\nexport type IHandledKeyboardEvent = PartiallyRequired<INativeKeyboardEvent, 'key'>;\n\nexport interface IViewWin32 {\n focus: () => void;\n}\n\nexport type ARIARole =\n | 'alert'\n | 'alertdialog'\n | 'application'\n | 'button'\n | 'checkbox'\n | 'combobox'\n | 'dialog'\n | 'group'\n | 'link'\n | 'listitem'\n | 'menu'\n | 'menubar'\n | 'menuitem'\n | 'none'\n | 'presentation'\n | 'progressbar'\n | 'radio'\n | 'radiogroup'\n | 'scrollbar'\n | 'search'\n | 'spinbutton'\n | 'switch'\n | 'tab'\n | 'tablist'\n | 'tabpanel'\n | 'textbox'\n | 'timer'\n | 'toolbar'\n | 'tree'\n | 'treeitem';\n\nexport type AnnotationType =\n | 'AdvanceProofingIssue'\n | 'Author'\n | 'CircularReferenceError'\n | 'Comment'\n | 'ConflictingChange'\n | 'DataValidationError'\n | 'DeletionChange'\n | 'EditingLockedChange'\n | 'Endnote'\n | 'ExternalChange'\n | 'Footer'\n | 'Footnote'\n | 'FormatChange'\n | 'FormulaError'\n | 'GrammarError'\n | 'Header'\n | 'Highlighted'\n | 'InsertionChange'\n | 'Mathematics'\n | 'MoveChange'\n | 'SpellingError'\n | 'TrackChanges'\n | 'Unknown'\n | 'UnsyncedChange';\n\nexport type AccessibilityAnnotationInfo = Readonly<{\n typeID: AnnotationType;\n typeName?: string;\n author?: string;\n dateTime?: string;\n target?: string;\n}>;\n\nexport type AccessibilityActionName =\n | RN.AccessibilityActionName\n | 'AddToSelection'\n | 'RemoveFromSelection'\n | 'Select'\n | 'Expand'\n | 'Collapse'\n | 'Toggle';\n\nexport type Cursor =\n | 'auto'\n | 'default'\n | 'pointer'\n | 'help'\n | 'not-allowed'\n | 'wait'\n | 'move'\n | 'nesw-resize'\n | 'ns-resize'\n | 'nwse-resize'\n | 'we-resize'\n | 'text'\n\nexport type AccessibilityActionInfo = Readonly<{\n name: AccessibilityActionName;\n label?: string;\n}>;\n\nexport type AccessibilityState = RN.AccessibilityState & { multiselectable?: boolean, required?: boolean };\n\nexport type SharedAccessibilityPropsIOSandWin32 = {\n onAccessibilityTap?: () => void;\n};\n\nexport type OmittedAccessibilityPropsWin32 = {\n accessibilityActions?: ReadonlyArray<RN.AccessibilityActionInfo>;\n accessibilityRole?: RN.AccessibilityRole;\n accessibilityState?: RN.AccessibilityState;\n};\n\nexport type BasePropsWin32 = {\n /**\n * Tells a person using a screen reader the type of element they are focused on.\n *\n * Overrides the `accessibilityRole` prop on React Native to accept a subset of ARIA roles.\n *\n * Possible values for ARIARole are: alert, alertdialog, application, button, checkbox,\n * comobox, dialog, group, link, menu, menubar, menuitem, none, presentation, progressbar,\n * radio, radiogroup, scrollbar, search, spinbutton, switch, tab, tablist, tabpanel, textbox,\n * timer, toolbar, tree, and treeitem.\n */\n accessibilityRole?: RN.AccessibilityRole | ARIARole;\n accessibilityState?: AccessibilityState;\n accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>;\n\n /**\n * Windows Accessibility extensions for allowing other DOM elements to label or describe a given element.\n *\n * Defined as a reference to another DOM element inheriting from the primary base classes of React-Native elements.\n * The reference will be converted to a native reference (tag) before passing to the native platform.\n */\n accessibilityDescribedBy?: React.RefObject<any>;\n accessibilityLabeledBy?: React.RefObject<any>;\n\n /**\n * Identifies the element whose contents or presence are controlled by another element. \n * \n * This is mainly used for a Textbox with a Dropdown PeoplePicker-type list. This allows an \n * accessibility tool to query those other providers for properties and listen to their events.\n */\n accessibilityControls?: React.RefObject<any>; \n\n /**\n * Identifies the ItemType property, which is a text string describing the type of the automation element.\n * ItemType is used to obtain information about items in a list, tree view, or data grid. For example, an item in a file directory view might be a \"Document File\" or a \"Folder\".\n */\n accessibilityItemType?: string;\n};\n\nexport type ViewWin32OmitTypes = RN.ViewPropsAndroid &\n RN.ViewPropsIOS &\n RN.AccessibilityPropsAndroid &\n Omit<RN.AccessibilityPropsIOS, SharedAccessibilityPropsIOSandWin32> &\n OmittedAccessibilityPropsWin32;\n\n/**\n * Properties for ViewWin32 component\n */\nexport interface IViewWin32Props extends Omit<RN.ViewProps, ViewWin32OmitTypes>, BasePropsWin32 {\n type?: React.ElementType;\n children?: React.ReactNode;\n accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>;\n /**\n * Tells a person using a screen reader what kind of annotation they\n * have selected. If available, it will also tell a person the author of the annotation and\n * the date and time the annotation was posted.\n *\n * Note: If typeID is 'Unknown', a typeName must be provided.\n */\n accessibilityAnnotation?: AccessibilityAnnotationInfo;\n /**\n * accessibilityDescription provides more detailed information specific to the element (i.e. last edit date, full location for a file)\n * while accessibilityHint provides infomation on what will happen when they perform an action.\n *\n */\n accessibilityDescription?: string;\n accessibilityLevel?: number;\n accessibilityPositionInSet?: number;\n\n accessibilitySetSize?: number;\n animationClass?: string;\n focusable?: boolean;\n enableFocusRing?: boolean;\n\n /**\n * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React\n * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onBlur?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React\n * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onBlurCapture?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React\n * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onFocus?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React\n * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onFocusCapture?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n\n onKeyDown?: (args: IKeyboardEvent) => void;\n onKeyDownCapture?: (args: IKeyboardEvent) => void;\n onKeyUp?: (args: IKeyboardEvent) => void;\n onKeyUpCapture?: (args: IKeyboardEvent) => void;\n\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n\n keyDownEvents?: IHandledKeyboardEvent[];\n keyUpEvents?: IHandledKeyboardEvent[];\n\n /**\n * Provides a screentip to be used on hover of the view\n */\n tooltip?: string;\n cursor?: Cursor;\n}\n"]}
|
|
@@ -144,6 +144,8 @@ function handleException(e: mixed, isFatal: boolean) {
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
+
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
|
|
148
|
+
* LTI update could not be added via codemod */
|
|
147
149
|
function reactConsoleErrorHandler(...args) {
|
|
148
150
|
// bubble up to any original handlers
|
|
149
151
|
console._errorOriginal(...args);
|
|
@@ -274,7 +274,7 @@ const JSTimers = {
|
|
|
274
274
|
const timeout = options && options.timeout;
|
|
275
275
|
const id = _allocateCallback(
|
|
276
276
|
timeout != null
|
|
277
|
-
? deadline => {
|
|
277
|
+
? (deadline: any) => {
|
|
278
278
|
const timeoutId = requestIdleCallbackTimeouts[id];
|
|
279
279
|
if (timeoutId) {
|
|
280
280
|
JSTimers.clearTimeout(timeoutId);
|
|
@@ -364,7 +364,7 @@ const JSTimers = {
|
|
|
364
364
|
// error one at a time
|
|
365
365
|
for (let ii = 1; ii < errorCount; ii++) {
|
|
366
366
|
JSTimers.setTimeout(
|
|
367
|
-
(error => {
|
|
367
|
+
((error: Error) => {
|
|
368
368
|
throw error;
|
|
369
369
|
}).bind(null, errors[ii]),
|
|
370
370
|
0,
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
13
|
const {polyfillGlobal} = require('../Utilities/PolyfillFunctions');
|
|
14
|
-
const warnOnce = require('../Utilities/warnOnce');
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
16
|
* Set up Promise. The native Promise implementation throws the following error:
|
|
@@ -37,34 +36,3 @@ if (global?.HermesInternal?.hasPromise?.()) {
|
|
|
37
36
|
} else {
|
|
38
37
|
polyfillGlobal('Promise', () => require('../Promise'));
|
|
39
38
|
}
|
|
40
|
-
|
|
41
|
-
if (__DEV__) {
|
|
42
|
-
// $FlowFixMe
|
|
43
|
-
const done = Promise.prototype.done;
|
|
44
|
-
if (done != null) {
|
|
45
|
-
let depth = 0;
|
|
46
|
-
/* eslint-disable no-extend-native */
|
|
47
|
-
// $FlowFixMe
|
|
48
|
-
Promise.prototype.done = function () {
|
|
49
|
-
++depth;
|
|
50
|
-
try {
|
|
51
|
-
// Avoid infinite recursion if done() happens to be triggered by warnOnce.
|
|
52
|
-
if (depth === 1) {
|
|
53
|
-
// Warn once per unique call stack. Not super efficient, but we're in
|
|
54
|
-
// __DEV__ and .done() calls are rare to begin with.
|
|
55
|
-
const key = new Error().stack;
|
|
56
|
-
warnOnce(
|
|
57
|
-
key,
|
|
58
|
-
'Promise.prototype.done(): This nonstandard polyfill ' +
|
|
59
|
-
'has been deprecated and will be removed in a future release. ' +
|
|
60
|
-
'Please instead use `.then()`.',
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
} finally {
|
|
64
|
-
--depth;
|
|
65
|
-
}
|
|
66
|
-
return done.apply(this, arguments);
|
|
67
|
-
};
|
|
68
|
-
/* eslint-enable no-extend-native */
|
|
69
|
-
}
|
|
70
|
-
}
|
|
@@ -27,12 +27,16 @@ if (global.RN$Bridgeless === true && global.RN$registerCallableModule) {
|
|
|
27
27
|
| $TEMPORARY$string<'RCTNativeAppEventEmitter'>
|
|
28
28
|
| $TEMPORARY$string<'SamplingProfiler'>
|
|
29
29
|
| $TEMPORARY$string<'Systrace'>,
|
|
30
|
+
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by
|
|
31
|
+
* Flow's LTI update could not be added via codemod */
|
|
30
32
|
factory,
|
|
31
33
|
) => BatchedBridge.registerLazyCallableModule(moduleName, factory);
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
registerModule('Systrace', () => require('../Performance/Systrace'));
|
|
35
|
-
|
|
37
|
+
if (!(global.RN$Bridgeless === true)) {
|
|
38
|
+
registerModule('JSTimers', () => require('./Timers/JSTimers'));
|
|
39
|
+
}
|
|
36
40
|
registerModule('HeapCapture', () => require('../HeapCapture/HeapCapture'));
|
|
37
41
|
registerModule('SamplingProfiler', () =>
|
|
38
42
|
require('../Performance/SamplingProfiler'),
|
|
@@ -95,19 +95,6 @@ export default class NativeEventEmitter<TEventToArgsMap: {...}>
|
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
/**
|
|
99
|
-
* @deprecated Use `remove` on the EventSubscription from `addListener`.
|
|
100
|
-
*/
|
|
101
|
-
removeListener<TEvent: $Keys<TEventToArgsMap>>(
|
|
102
|
-
eventType: TEvent,
|
|
103
|
-
listener: (...args: $ElementType<TEventToArgsMap, TEvent>) => mixed,
|
|
104
|
-
): void {
|
|
105
|
-
this._nativeModule?.removeListeners(1);
|
|
106
|
-
// NOTE: This will report a deprecation notice via `console.error`.
|
|
107
|
-
// $FlowFixMe[prop-missing] - `removeListener` exists but is deprecated.
|
|
108
|
-
RCTDeviceEventEmitter.removeListener(eventType, listener);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
98
|
emit<TEvent: $Keys<TEventToArgsMap>>(
|
|
112
99
|
eventType: TEvent,
|
|
113
100
|
...args: $ElementType<TEventToArgsMap, TEvent>
|
|
@@ -35,7 +35,7 @@ const {
|
|
|
35
35
|
/**
|
|
36
36
|
* Returns a path like 'assets/AwesomeModule/icon@2x.png'
|
|
37
37
|
*/
|
|
38
|
-
function getScaledAssetPath(asset): string {
|
|
38
|
+
function getScaledAssetPath(asset: PackagerAsset): string {
|
|
39
39
|
const scale = pickScale(asset.scales, PixelRatio.get());
|
|
40
40
|
const scaleSuffix = scale === 1 ? '' : '@' + scale + 'x';
|
|
41
41
|
const assetDir = getBasePath(asset);
|
|
@@ -45,7 +45,7 @@ function getScaledAssetPath(asset): string {
|
|
|
45
45
|
/**
|
|
46
46
|
* Returns a path like 'drawable-mdpi/icon.png'
|
|
47
47
|
*/
|
|
48
|
-
function getAssetPathInDrawableFolder(asset): string {
|
|
48
|
+
function getAssetPathInDrawableFolder(asset: PackagerAsset): string {
|
|
49
49
|
const scale = pickScale(asset.scales, PixelRatio.get());
|
|
50
50
|
const drawbleFolder = getAndroidResourceFolderName(asset, scale);
|
|
51
51
|
const fileName = getAndroidResourceIdentifier(asset);
|
|
@@ -123,7 +123,9 @@ export type ImageComponentStatics = $ReadOnly<{|
|
|
|
123
123
|
*
|
|
124
124
|
* See https://reactnative.dev/docs/image
|
|
125
125
|
*/
|
|
126
|
-
|
|
126
|
+
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
|
|
127
|
+
* LTI update could not be added via codemod */
|
|
128
|
+
const BaseImage = (props: ImagePropsType, forwardedRef) => {
|
|
127
129
|
let source = resolveAssetSource(props.source);
|
|
128
130
|
const defaultSource = resolveAssetSource(props.defaultSource);
|
|
129
131
|
const loadingIndicatorSource = resolveAssetSource(
|
|
@@ -221,11 +223,11 @@ let Image = (props: ImagePropsType, forwardedRef) => {
|
|
|
221
223
|
);
|
|
222
224
|
};
|
|
223
225
|
|
|
224
|
-
Image = React.forwardRef<
|
|
226
|
+
let Image = React.forwardRef<
|
|
225
227
|
ImagePropsType,
|
|
226
228
|
| React.ElementRef<typeof TextInlineImageNativeComponent>
|
|
227
229
|
| React.ElementRef<typeof ImageViewNativeComponent>,
|
|
228
|
-
>(
|
|
230
|
+
>(BaseImage);
|
|
229
231
|
|
|
230
232
|
if (ImageInjection.unstable_createImageComponent != null) {
|
|
231
233
|
Image = ImageInjection.unstable_createImageComponent(Image);
|
|
@@ -102,7 +102,9 @@ export type ImageComponentStatics = $ReadOnly<{|
|
|
|
102
102
|
*
|
|
103
103
|
* See https://reactnative.dev/docs/image
|
|
104
104
|
*/
|
|
105
|
-
|
|
105
|
+
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
|
|
106
|
+
* LTI update could not be added via codemod */
|
|
107
|
+
const BaseImage = (props: ImagePropsType, forwardedRef) => {
|
|
106
108
|
const source = resolveAssetSource(props.source) || {
|
|
107
109
|
uri: undefined,
|
|
108
110
|
width: undefined,
|
|
@@ -158,11 +160,12 @@ let Image = (props: ImagePropsType, forwardedRef) => {
|
|
|
158
160
|
);
|
|
159
161
|
};
|
|
160
162
|
|
|
161
|
-
|
|
163
|
+
const ImageForwardRef = React.forwardRef<
|
|
162
164
|
ImagePropsType,
|
|
163
165
|
React.ElementRef<typeof ImageViewNativeComponent>,
|
|
164
|
-
>(
|
|
166
|
+
>(BaseImage);
|
|
165
167
|
|
|
168
|
+
let Image = ImageForwardRef;
|
|
166
169
|
if (ImageInjection.unstable_createImageComponent != null) {
|
|
167
170
|
Image = ImageInjection.unstable_createImageComponent(Image);
|
|
168
171
|
}
|
|
@@ -124,7 +124,9 @@ export type ImageComponentStatics = $ReadOnly<{|
|
|
|
124
124
|
*
|
|
125
125
|
* See https://reactnative.dev/docs/image
|
|
126
126
|
*/
|
|
127
|
-
|
|
127
|
+
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
|
|
128
|
+
* LTI update could not be added via codemod */
|
|
129
|
+
const BaseImage = (props: ImagePropsType, forwardedRef) => {
|
|
128
130
|
const source = resolveAssetSource(props.source) || {
|
|
129
131
|
uri: undefined,
|
|
130
132
|
width: undefined,
|
|
@@ -193,11 +195,12 @@ let Image = (props: ImagePropsType, forwardedRef) => {
|
|
|
193
195
|
);
|
|
194
196
|
};
|
|
195
197
|
|
|
196
|
-
|
|
198
|
+
const ImageForwardRef = React.forwardRef<
|
|
197
199
|
ImagePropsType,
|
|
198
200
|
React.ElementRef<typeof ImageViewNativeComponent>,
|
|
199
|
-
>(
|
|
201
|
+
>(BaseImage);
|
|
200
202
|
|
|
203
|
+
let Image = ImageForwardRef;
|
|
201
204
|
if (ImageInjection.unstable_createImageComponent != null) {
|
|
202
205
|
Image = ImageInjection.unstable_createImageComponent(Image);
|
|
203
206
|
}
|
|
@@ -91,9 +91,7 @@ export type ImageSource =
|
|
|
91
91
|
| ImageURISource
|
|
92
92
|
| $ReadOnlyArray<ImageURISource>;
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
imageSource: ImageURISource,
|
|
96
|
-
): $ReadOnly<{
|
|
94
|
+
type ImageSourceProperties = {
|
|
97
95
|
body?: ?string,
|
|
98
96
|
bundle?: ?string,
|
|
99
97
|
cache?: ?('default' | 'reload' | 'force-cache' | 'only-if-cached'),
|
|
@@ -104,8 +102,12 @@ export function getImageSourceProperties(
|
|
|
104
102
|
uri?: ?string,
|
|
105
103
|
width?: ?number,
|
|
106
104
|
...
|
|
107
|
-
}
|
|
108
|
-
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export function getImageSourceProperties(
|
|
108
|
+
imageSource: ImageURISource,
|
|
109
|
+
): $ReadOnly<ImageSourceProperties> {
|
|
110
|
+
const object: ImageSourceProperties = {};
|
|
109
111
|
if (imageSource.body != null) {
|
|
110
112
|
object.body = imageSource.body;
|
|
111
113
|
}
|
|
@@ -26,7 +26,7 @@ class ElementBox extends React.Component<$FlowFixMeProps> {
|
|
|
26
26
|
let padding = resolveBoxStyle('padding', style);
|
|
27
27
|
|
|
28
28
|
const frameStyle = {...this.props.frame};
|
|
29
|
-
const contentStyle = {
|
|
29
|
+
const contentStyle: {width: number, height: number} = {
|
|
30
30
|
width: this.props.frame.width,
|
|
31
31
|
height: this.props.frame.height,
|
|
32
32
|
};
|
|
@@ -102,7 +102,7 @@ type Style = {
|
|
|
102
102
|
* @return a modified copy
|
|
103
103
|
*/
|
|
104
104
|
function resolveRelativeSizes(style: $ReadOnly<Style>): Style {
|
|
105
|
-
let resolvedStyle =
|
|
105
|
+
let resolvedStyle = {...style};
|
|
106
106
|
resolveSizeInPlace(resolvedStyle, 'top', 'height');
|
|
107
107
|
resolveSizeInPlace(resolvedStyle, 'right', 'width');
|
|
108
108
|
resolveSizeInPlace(resolvedStyle, 'bottom', 'height');
|
|
@@ -10,15 +10,17 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
import type {RenderItemProps} from '../Lists/VirtualizedList';
|
|
14
|
+
|
|
15
15
|
const ScrollView = require('../Components/ScrollView/ScrollView');
|
|
16
|
-
const StyleSheet = require('../StyleSheet/StyleSheet');
|
|
17
|
-
const Text = require('../Text/Text');
|
|
18
16
|
const TouchableHighlight = require('../Components/Touchable/TouchableHighlight');
|
|
19
17
|
const View = require('../Components/View/View');
|
|
20
|
-
const
|
|
18
|
+
const FlatList = require('../Lists/FlatList');
|
|
21
19
|
const XHRInterceptor = require('../Network/XHRInterceptor');
|
|
20
|
+
const StyleSheet = require('../StyleSheet/StyleSheet');
|
|
21
|
+
const Text = require('../Text/Text');
|
|
22
|
+
const WebSocketInterceptor = require('../WebSocket/WebSocketInterceptor');
|
|
23
|
+
const React = require('react');
|
|
22
24
|
|
|
23
25
|
const LISTVIEW_CELL_HEIGHT = 15;
|
|
24
26
|
|
|
@@ -100,7 +102,7 @@ class NetworkOverlay extends React.Component<Props, State> {
|
|
|
100
102
|
};
|
|
101
103
|
|
|
102
104
|
// Map of `socketId` -> `index in `this.state.requests`.
|
|
103
|
-
_socketIdMap = {};
|
|
105
|
+
_socketIdMap: {[string]: number} = {};
|
|
104
106
|
// Map of `xhr._index` -> `index in `this.state.requests`.
|
|
105
107
|
_xhrIdMap: {[key: number]: number, ...} = {};
|
|
106
108
|
|
|
@@ -326,7 +328,10 @@ class NetworkOverlay extends React.Component<Props, State> {
|
|
|
326
328
|
WebSocketInterceptor.disableInterception();
|
|
327
329
|
}
|
|
328
330
|
|
|
329
|
-
_renderItem = ({
|
|
331
|
+
_renderItem = ({
|
|
332
|
+
item,
|
|
333
|
+
index,
|
|
334
|
+
}: RenderItemProps<NetworkRequestInfo>): React.Element<any> => {
|
|
330
335
|
const tableRowViewStyle = [
|
|
331
336
|
styles.tableRow,
|
|
332
337
|
index % 2 === 1 ? styles.tableRowOdd : styles.tableRowEven,
|
|
@@ -358,7 +363,7 @@ class NetworkOverlay extends React.Component<Props, State> {
|
|
|
358
363
|
);
|
|
359
364
|
};
|
|
360
365
|
|
|
361
|
-
_renderItemDetail(id) {
|
|
366
|
+
_renderItemDetail(id: number) {
|
|
362
367
|
const requestItem = this.state.requests[id];
|
|
363
368
|
const details = Object.keys(requestItem).map(key => {
|
|
364
369
|
if (key === 'id') {
|
|
@@ -190,6 +190,21 @@ type ActiveCallback = (
|
|
|
190
190
|
|
|
191
191
|
type PassiveCallback = (event: PressEvent, gestureState: GestureState) => mixed;
|
|
192
192
|
|
|
193
|
+
type PanHandlers = {|
|
|
194
|
+
onMoveShouldSetResponder: (event: PressEvent) => boolean,
|
|
195
|
+
onMoveShouldSetResponderCapture: (event: PressEvent) => boolean,
|
|
196
|
+
onResponderEnd: (event: PressEvent) => void,
|
|
197
|
+
onResponderGrant: (event: PressEvent) => boolean,
|
|
198
|
+
onResponderMove: (event: PressEvent) => void,
|
|
199
|
+
onResponderReject: (event: PressEvent) => void,
|
|
200
|
+
onResponderRelease: (event: PressEvent) => void,
|
|
201
|
+
onResponderStart: (event: PressEvent) => void,
|
|
202
|
+
onResponderTerminate: (event: PressEvent) => void,
|
|
203
|
+
onResponderTerminationRequest: (event: PressEvent) => boolean,
|
|
204
|
+
onStartShouldSetResponder: (event: PressEvent) => boolean,
|
|
205
|
+
onStartShouldSetResponderCapture: (event: PressEvent) => boolean,
|
|
206
|
+
|};
|
|
207
|
+
|
|
193
208
|
type PanResponderConfig = $ReadOnly<{|
|
|
194
209
|
onMoveShouldSetPanResponder?: ?ActiveCallback,
|
|
195
210
|
onMoveShouldSetPanResponderCapture?: ?ActiveCallback,
|
|
@@ -385,20 +400,7 @@ const PanResponder = {
|
|
|
385
400
|
*/
|
|
386
401
|
create(config: PanResponderConfig): $TEMPORARY$object<{|
|
|
387
402
|
getInteractionHandle: () => ?number,
|
|
388
|
-
panHandlers:
|
|
389
|
-
onMoveShouldSetResponder: (event: PressEvent) => boolean,
|
|
390
|
-
onMoveShouldSetResponderCapture: (event: PressEvent) => boolean,
|
|
391
|
-
onResponderEnd: (event: PressEvent) => void,
|
|
392
|
-
onResponderGrant: (event: PressEvent) => boolean,
|
|
393
|
-
onResponderMove: (event: PressEvent) => void,
|
|
394
|
-
onResponderReject: (event: PressEvent) => void,
|
|
395
|
-
onResponderRelease: (event: PressEvent) => void,
|
|
396
|
-
onResponderStart: (event: PressEvent) => void,
|
|
397
|
-
onResponderTerminate: (event: PressEvent) => void,
|
|
398
|
-
onResponderTerminationRequest: (event: PressEvent) => boolean,
|
|
399
|
-
onStartShouldSetResponder: (event: PressEvent) => boolean,
|
|
400
|
-
onStartShouldSetResponderCapture: (event: PressEvent) => boolean,
|
|
401
|
-
|}>,
|
|
403
|
+
panHandlers: PanHandlers,
|
|
402
404
|
|}> {
|
|
403
405
|
const interactionState = {
|
|
404
406
|
handle: (null: ?number),
|
|
@@ -46,17 +46,6 @@ class Linking extends NativeEventEmitter<LinkingEventDefinitions> {
|
|
|
46
46
|
return this.addListener(eventType, listener);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
/**
|
|
50
|
-
* @deprecated Use `remove` on the EventSubscription from `addEventListener`.
|
|
51
|
-
*/
|
|
52
|
-
removeEventListener<K: $Keys<LinkingEventDefinitions>>(
|
|
53
|
-
eventType: K,
|
|
54
|
-
listener: (...$ElementType<LinkingEventDefinitions, K>) => mixed,
|
|
55
|
-
): void {
|
|
56
|
-
// NOTE: This will report a deprecation notice via `console.error`.
|
|
57
|
-
this.removeListener(eventType, listener);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
49
|
/**
|
|
61
50
|
* Try to open the given `url` with any of the installed apps.
|
|
62
51
|
*
|
|
@@ -459,7 +459,7 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
|
|
|
459
459
|
_listRef: ?React.ElementRef<typeof VirtualizedList>;
|
|
460
460
|
_virtualizedListPairs: Array<ViewabilityConfigCallbackPair> = [];
|
|
461
461
|
|
|
462
|
-
_captureRef = ref => {
|
|
462
|
+
_captureRef = (ref: ?React.ElementRef<typeof VirtualizedList>) => {
|
|
463
463
|
this._listRef = ref;
|
|
464
464
|
};
|
|
465
465
|
|
|
@@ -596,7 +596,7 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
|
|
|
596
596
|
? 'ListItemComponent'
|
|
597
597
|
: 'renderItem';
|
|
598
598
|
|
|
599
|
-
const renderer = (props): React.Node => {
|
|
599
|
+
const renderer = (props: RenderItemProps<ItemT>): React.Node => {
|
|
600
600
|
if (ListItemComponent) {
|
|
601
601
|
// $FlowFixMe[not-a-component] Component isn't valid
|
|
602
602
|
// $FlowFixMe[incompatible-type-arg] Component isn't valid
|
|
@@ -625,6 +625,7 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
|
|
|
625
625
|
<View style={StyleSheet.compose(styles.row, columnWrapperStyle)}>
|
|
626
626
|
{item.map((it, kk) => {
|
|
627
627
|
const element = renderer({
|
|
628
|
+
// $FlowFixMe[incompatible-call]
|
|
628
629
|
item: it,
|
|
629
630
|
index: index * cols + kk,
|
|
630
631
|
separators: info.separators,
|
|
@@ -255,6 +255,8 @@ export default class SectionList<
|
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
_wrapperListRef: ?React.ElementRef<typeof VirtualizedSectionList>;
|
|
258
|
+
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
|
|
259
|
+
* LTI update could not be added via codemod */
|
|
258
260
|
_captureRef = ref => {
|
|
259
261
|
this._wrapperListRef = ref;
|
|
260
262
|
};
|
|
@@ -259,9 +259,13 @@ class ViewabilityHelper {
|
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
_onUpdateSync(
|
|
262
|
-
viewableIndicesToCheck
|
|
263
|
-
onViewableItemsChanged
|
|
264
|
-
|
|
262
|
+
viewableIndicesToCheck: Array<number>,
|
|
263
|
+
onViewableItemsChanged: ({
|
|
264
|
+
changed: Array<ViewToken>,
|
|
265
|
+
viewableItems: Array<ViewToken>,
|
|
266
|
+
...
|
|
267
|
+
}) => void,
|
|
268
|
+
createViewToken: (index: number, isViewable: boolean) => ViewToken,
|
|
265
269
|
) {
|
|
266
270
|
// Filter out indices that have gone out of view since this call was scheduled.
|
|
267
271
|
viewableIndicesToCheck = viewableIndicesToCheck.filter(ii =>
|