@office-iss/react-native-win32 0.73.2 → 0.74.0-preview.1
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/.eslintignore +1 -1
- package/.flowconfig +11 -3
- package/CHANGELOG.json +411 -54
- package/CHANGELOG.md +157 -30
- package/IntegrationTests/AccessibilityManagerTest.js +2 -2
- package/IntegrationTests/AppEventsTest.js +2 -2
- package/IntegrationTests/LayoutEventsTest.js +8 -10
- package/IntegrationTests/LoggingTestModule.js +1 -2
- package/IntegrationTests/websocket_integration_test_server.js +1 -1
- package/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +6 -0
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +6 -0
- package/Libraries/ActionSheetIOS/NativeActionSheetManager.js +4 -45
- package/Libraries/Alert/NativeAlertManager.js +4 -26
- package/Libraries/Animated/Animated.js +2 -2
- package/Libraries/Animated/AnimatedPlatformConfig.js +1 -1
- package/Libraries/Animated/NativeAnimatedHelper.js +14 -11
- package/Libraries/Animated/NativeAnimatedHelper.win32.js +14 -11
- package/Libraries/Animated/NativeAnimatedModule.js +4 -68
- package/Libraries/Animated/NativeAnimatedTurboModule.js +4 -69
- package/Libraries/Animated/animations/Animation.js +6 -22
- package/Libraries/Animated/components/AnimatedFlatList.js +1 -16
- package/Libraries/Animated/components/AnimatedScrollView.js +36 -31
- package/Libraries/Animated/components/AnimatedSectionList.js +1 -20
- package/Libraries/Animated/createAnimatedComponent.js +45 -40
- package/Libraries/Animated/nodes/AnimatedStyle.js +1 -1
- package/Libraries/Animated/shouldUseTurboAnimatedModule.js +1 -1
- package/Libraries/Animated/useAnimatedProps.js +21 -1
- package/Libraries/AppState/NativeAppState.js +4 -24
- package/Libraries/BatchedBridge/NativeModules.js +1 -1
- package/Libraries/Blob/Blob.js +1 -4
- package/Libraries/Blob/BlobManager.js +6 -8
- package/Libraries/Blob/File.js +1 -1
- package/Libraries/Blob/NativeBlobModule.js +4 -50
- package/Libraries/Blob/NativeFileReaderModule.js +4 -13
- package/Libraries/BugReporting/NativeBugReporting.js +4 -12
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +5 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +48 -7
- package/Libraries/Components/AccessibilityInfo/NativeAccessibilityInfo.js +3 -23
- package/Libraries/Components/AccessibilityInfo/NativeAccessibilityInfoWin32.js +11 -0
- package/Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.js +4 -57
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.android.js +3 -2
- package/Libraries/Components/AccessibilityInfo/legacySendAccessibilityEvent.win32.js +3 -2
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +9 -40
- package/Libraries/Components/ActivityIndicator/ActivityIndicatorViewNativeComponent.js +3 -43
- package/Libraries/Components/Button/ButtonWin32.Props.d.ts +36 -36
- package/Libraries/Components/Button/ButtonWin32.Props.js +2 -2
- package/Libraries/Components/Button/ButtonWin32.Props.js.map +1 -1
- package/Libraries/Components/Button/ButtonWin32.d.ts +19 -19
- package/Libraries/Components/Button/ButtonWin32.js +82 -82
- package/Libraries/Components/Button/ButtonWin32.js.map +1 -1
- package/Libraries/Components/Button.js +103 -107
- package/Libraries/Components/Button.win32.js +297 -301
- package/Libraries/Components/Clipboard/NativeClipboard.js +3 -11
- package/Libraries/Components/DrawerAndroid/AndroidDrawerLayoutNativeComponent.js +3 -114
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -5
- package/Libraries/Components/EnterString.win32.d.ts +12 -12
- package/Libraries/Components/EnterString.win32.js +81 -81
- package/Libraries/Components/EnterString.win32.js.map +1 -1
- package/Libraries/Components/Keyboard/NativeKeyboardObserver.js +3 -10
- package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.android.js +69 -0
- package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.d.ts +24 -0
- package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.js +33 -0
- package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroidNativeComponent.js +13 -0
- package/Libraries/Components/Pressable/Pressable.js +1 -1
- package/Libraries/Components/Pressable/Pressable.win32.js +1 -1
- package/Libraries/Components/Pressable/useAndroidRippleForView.js +5 -4
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidNativeComponent.js +4 -24
- package/Libraries/Components/RefreshControl/AndroidSwipeRefreshLayoutNativeComponent.js +3 -64
- package/Libraries/Components/RefreshControl/PullToRefreshViewNativeComponent.js +3 -61
- package/Libraries/Components/RefreshControl/RefreshControl.js +1 -1
- package/Libraries/Components/SafeAreaView/RCTSafeAreaViewNativeComponent.js +3 -15
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollContentViewNativeComponent.js +3 -16
- package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +1 -1
- package/Libraries/Components/ScrollView/ScrollView.d.ts +5 -6
- package/Libraries/Components/ScrollView/ScrollView.js +12 -38
- package/Libraries/Components/ScrollView/ScrollView.win32.js +12 -38
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -2
- package/Libraries/Components/Sound/NativeSoundManager.js +3 -12
- package/Libraries/Components/StatusBar/NativeStatusBarManagerAndroid.js +3 -58
- package/Libraries/Components/StatusBar/NativeStatusBarManagerIOS.js +3 -79
- package/Libraries/Components/Switch/AndroidSwitchNativeComponent.js +4 -53
- package/Libraries/Components/Switch/Switch.js +0 -2
- package/Libraries/Components/Switch/SwitchNativeComponent.js +4 -52
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +8 -0
- package/Libraries/Components/TextInput/InputAccessoryView.js +18 -20
- package/Libraries/Components/TextInput/RCTInputAccessoryViewNativeComponent.js +4 -17
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +3 -6
- package/Libraries/Components/TextInput/Tests/TextInputTest.d.ts +8 -8
- package/Libraries/Components/TextInput/Tests/TextInputTest.js +127 -127
- package/Libraries/Components/TextInput/Tests/TextInputTest.js.map +1 -1
- package/Libraries/Components/TextInput/TextInput.d.ts +16 -0
- package/Libraries/Components/TextInput/TextInput.flow.js +16 -0
- package/Libraries/Components/TextInput/TextInput.js +65 -32
- package/Libraries/Components/TextInput/TextInput.win32.js +70 -37
- package/Libraries/Components/ToastAndroid/NativeToastAndroid.js +3 -28
- package/Libraries/Components/Touchable/PooledClass.js +1 -1
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.d.ts +8 -8
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js +343 -344
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
- package/Libraries/Components/Touchable/Touchable.js +2 -3
- package/Libraries/Components/Touchable/Touchable.win32.js +2 -3
- package/Libraries/Components/Touchable/TouchableHighlight.js +4 -4
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +2 -1
- package/Libraries/Components/Touchable/TouchableOpacity.js +5 -2
- package/Libraries/Components/Touchable/TouchableWin32.Props.d.ts +37 -37
- package/Libraries/Components/Touchable/TouchableWin32.Props.js +2 -2
- package/Libraries/Components/Touchable/TouchableWin32.Props.js.map +1 -1
- package/Libraries/Components/Touchable/TouchableWin32.Types.d.ts +114 -114
- package/Libraries/Components/Touchable/TouchableWin32.Types.js +2 -2
- package/Libraries/Components/Touchable/TouchableWin32.Types.js.map +1 -1
- package/Libraries/Components/Touchable/TouchableWin32.d.ts +91 -91
- package/Libraries/Components/Touchable/TouchableWin32.js +506 -506
- package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
- package/Libraries/Components/UnimplementedViews/UnimplementedNativeViewNativeComponent.js +3 -16
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -1
- package/Libraries/Components/View/View.js +0 -11
- package/Libraries/Components/View/View.win32.js +18 -17
- package/Libraries/Components/View/ViewAccessibility.d.ts +33 -17
- package/Libraries/Components/View/ViewPropTypes.d.ts +28 -17
- package/Libraries/Components/View/ViewPropTypes.js +36 -36
- package/Libraries/Components/View/ViewPropTypes.win32.js +36 -36
- package/Libraries/Core/InitializeCore.js +1 -1
- package/Libraries/Core/NativeExceptionsManager.js +3 -93
- package/Libraries/Core/ReactNativeVersion.js +12 -6
- package/Libraries/Core/ReactNativeVersionCheck.js +6 -6
- package/Libraries/Core/ReactNativeVersionCheck.win32.js +6 -6
- package/Libraries/Core/SegmentFetcher/NativeSegmentFetcher.js +3 -18
- package/Libraries/Core/Timers/NativeTiming.js +3 -16
- package/Libraries/Core/registerCallableModule.js +42 -0
- package/Libraries/Core/setUpPerformance.js +2 -2
- package/Libraries/Core/setUpPerformanceObserver.js +3 -1
- package/Libraries/Debugging/DebuggingOverlay.js +111 -0
- package/Libraries/Debugging/DebuggingOverlayNativeComponent.js +13 -0
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +513 -0
- package/Libraries/Debugging/useSubscribeToDebuggingOverlayRegistry.js +32 -0
- package/Libraries/DevToolsSettings/NativeDevToolsSettingsManager.js +3 -14
- package/Libraries/HeapCapture/NativeJSCHeapCapture.js +3 -9
- package/Libraries/Image/AssetSourceResolver.js +5 -5
- package/Libraries/Image/AssetUtils.js +4 -5
- package/Libraries/Image/Image.android.js +146 -174
- package/Libraries/Image/Image.d.ts +1 -1
- package/Libraries/Image/Image.ios.js +53 -79
- package/Libraries/Image/Image.win32.js +52 -74
- package/Libraries/Image/ImageBackground.js +2 -2
- package/Libraries/Image/ImageInjection.js +76 -18
- package/Libraries/Image/ImageTypes.d.ts +25 -25
- package/Libraries/Image/ImageTypes.flow.js +71 -0
- package/Libraries/Image/ImageTypes.js +7 -7
- package/Libraries/Image/ImageTypes.js.map +1 -1
- package/Libraries/Image/ImageUtils.js +1 -1
- package/Libraries/Image/ImageViewNativeComponent.js +18 -0
- package/Libraries/Image/NativeImageEditor.js +3 -42
- package/Libraries/Image/NativeImageLoaderAndroid.js +4 -28
- package/Libraries/Image/NativeImageLoaderIOS.js +4 -28
- package/Libraries/Image/NativeImageLoaderWin32.js +4 -36
- package/Libraries/Image/NativeImageStoreAndroid.js +3 -16
- package/Libraries/Image/NativeImageStoreIOS.js +3 -23
- package/Libraries/Image/Tests/ImageWin32Test.d.ts +8 -8
- package/Libraries/Image/Tests/ImageWin32Test.js +21 -21
- package/Libraries/Image/Tests/ImageWin32Test.js.map +1 -1
- package/Libraries/Image/resolveAssetSource.js +59 -26
- package/Libraries/Inspector/ElementProperties.js +26 -52
- package/Libraries/Inspector/Inspector.js +122 -186
- package/Libraries/Inspector/Inspector.win32.js +118 -185
- package/Libraries/Inspector/InspectorOverlay.js +21 -33
- package/Libraries/Inspector/InspectorOverlay.win32.js +22 -33
- package/Libraries/Inspector/InspectorPanel.js +3 -17
- package/Libraries/Inspector/ReactDevToolsOverlay.js +171 -0
- package/Libraries/Inspector/getInspectorDataForViewAtPoint.js +20 -8
- package/Libraries/Interaction/FrameRateLogger.js +8 -18
- package/Libraries/Interaction/NativeFrameRateLogger.js +4 -16
- package/Libraries/IntersectionObserver/IntersectionObserver.js +1 -1
- package/Libraries/IntersectionObserver/IntersectionObserverEntry.js +20 -19
- package/Libraries/IntersectionObserver/IntersectionObserverManager.js +84 -6
- package/Libraries/IntersectionObserver/NativeIntersectionObserver.js +3 -31
- package/Libraries/IntersectionObserver/__mocks__/NativeIntersectionObserver.js +12 -2
- package/Libraries/LayoutAnimation/LayoutAnimation.js +1 -2
- package/Libraries/Linking/NativeIntentAndroid.js +3 -20
- package/Libraries/Linking/NativeLinkingManager.js +3 -17
- package/Libraries/Lists/FillRateHelper.js +1 -1
- package/Libraries/Lists/FlatList.d.ts +2 -2
- package/Libraries/Lists/FlatList.js +6 -1
- package/Libraries/Lists/SectionList.d.ts +6 -1
- package/Libraries/Lists/ViewabilityHelper.js +1 -1
- package/Libraries/Lists/VirtualizeUtils.js +1 -1
- package/Libraries/Lists/VirtualizedList.js +1 -1
- package/Libraries/Lists/VirtualizedListContext.js +1 -1
- package/Libraries/Lists/VirtualizedSectionList.js +1 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
- package/Libraries/LogBox/LogBoxInspectorContainer.js +1 -1
- package/Libraries/Modal/Modal.js +43 -11
- package/Libraries/Modal/NativeModalManager.js +3 -11
- package/Libraries/Modal/RCTModalHostViewNativeComponent.js +3 -129
- package/Libraries/MutationObserver/MutationObserver.js +1 -1
- package/Libraries/MutationObserver/MutationObserverManager.js +2 -2
- package/Libraries/MutationObserver/MutationRecord.js +12 -10
- package/Libraries/MutationObserver/NativeMutationObserver.js +3 -48
- package/Libraries/MutationObserver/__mocks__/NativeMutationObserver.js +1 -1
- package/Libraries/NativeComponent/BaseViewConfig.android.js +1 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +1 -1
- package/Libraries/NativeModules/specs/NativeAnimationsDebugModule.js +3 -10
- package/Libraries/NativeModules/specs/NativeDevMenu.js +3 -13
- package/Libraries/NativeModules/specs/NativeDevSettings.js +3 -23
- package/Libraries/NativeModules/specs/NativeDeviceEventManager.js +3 -9
- package/Libraries/NativeModules/specs/NativeDialogManagerAndroid.js +3 -38
- package/Libraries/NativeModules/specs/NativeLogBox.js +3 -10
- package/Libraries/NativeModules/specs/NativeRedBox.js +4 -11
- package/Libraries/NativeModules/specs/NativeSourceCode.js +2 -25
- package/Libraries/Network/FormData.js +3 -1
- package/Libraries/Network/NativeNetworkingAndroid.js +4 -28
- package/Libraries/Network/NativeNetworkingIOS.js +4 -28
- package/Libraries/Performance/NativeJSCSamplingProfiler.js +3 -9
- package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +4 -68
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +3 -3
- package/Libraries/PersonaCoin/PersonaCoin.d.ts +3 -3
- package/Libraries/PersonaCoin/PersonaCoin.js +14 -14
- package/Libraries/PersonaCoin/PersonaCoin.js.map +1 -1
- package/Libraries/PersonaCoin/PersonaCoinPropTypes.d.ts +2 -2
- package/Libraries/PersonaCoin/PersonaCoinPropTypes.js +19 -19
- package/Libraries/PersonaCoin/PersonaCoinPropTypes.js.map +1 -1
- package/Libraries/PersonaCoin/PersonaCoinTypes.d.ts +33 -33
- package/Libraries/PersonaCoin/PersonaCoinTypes.js +23 -23
- package/Libraries/PersonaCoin/PersonaCoinTypes.js.map +1 -1
- package/Libraries/Pressability/Pressability.js +12 -2
- package/Libraries/Pressability/Pressability.win32.js +12 -2
- package/Libraries/Pressability/usePressability.js +7 -0
- package/Libraries/PushNotificationIOS/NativePushNotificationManagerIOS.js +4 -70
- package/Libraries/PushNotificationIOS/PushNotificationIOS.js +45 -39
- package/Libraries/ReactNative/AppContainer-dev.js +192 -0
- package/Libraries/ReactNative/AppContainer-prod.js +53 -0
- package/Libraries/ReactNative/AppContainer.js +6 -149
- package/Libraries/ReactNative/AppRegistry.js +3 -1
- package/Libraries/ReactNative/BridgelessUIManager.js +375 -128
- package/Libraries/ReactNative/FabricUIManager.js +6 -0
- package/Libraries/ReactNative/NativeHeadlessJsTaskSupport.js +3 -10
- package/Libraries/ReactNative/NativeI18nManager.js +3 -18
- package/Libraries/ReactNative/NativeUIManager.js +4 -112
- package/Libraries/ReactNative/PaperUIManager.js +8 -7
- package/Libraries/ReactNative/PaperUIManager.win32.js +26 -7
- package/Libraries/ReactNative/ReactFabricInternals.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +24 -5
- package/Libraries/ReactNative/ReactNativeFeatureFlags.js +0 -45
- package/Libraries/ReactNative/RendererImplementation.js +11 -0
- package/Libraries/ReactNative/UIManager.d.ts +11 -34
- package/Libraries/ReactNative/UIManager.js +2 -23
- package/Libraries/ReactNative/UIManagerProperties.js +0 -2
- package/Libraries/ReactNative/__mocks__/FabricUIManager.js +23 -1
- package/Libraries/ReactNative/getNativeComponentAttributes.js +5 -1
- package/Libraries/ReactNative/renderApplication.js +9 -6
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +6 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +24771 -21123
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +4160 -3109
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +4384 -3322
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +25194 -21398
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +3763 -2636
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +4027 -2867
- package/Libraries/Renderer/shims/ReactNativeTypes.js +8 -9
- package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +7 -12
- package/Libraries/Settings/NativeSettingsManager.js +4 -16
- package/Libraries/Share/NativeShareModule.js +3 -13
- package/Libraries/StyleSheet/PlatformColorValueTypes.win32.js +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypesWin32.d.ts +1 -1
- package/Libraries/StyleSheet/PlatformColorValueTypesWin32.js +1 -1
- package/Libraries/StyleSheet/StyleSheet.d.ts +1 -20
- package/Libraries/StyleSheet/StyleSheet.js +5 -28
- package/Libraries/StyleSheet/StyleSheet.win32.js +5 -28
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +47 -7
- package/Libraries/StyleSheet/StyleSheetTypes.js +16 -11
- package/Libraries/StyleSheet/flattenStyle.js +2 -2
- package/Libraries/StyleSheet/normalizeColor.js +1 -1
- package/Libraries/StyleSheet/processAspectRatio.js +1 -1
- package/Libraries/StyleSheet/processFontVariant.js +1 -1
- package/Libraries/Text/Text.d.ts +5 -6
- package/Libraries/Text/Text.js +0 -6
- package/Libraries/Text/Text.win32.js +0 -6
- package/Libraries/Text/TextAncestor.js +2 -3
- package/Libraries/TurboModule/samples/NativeSampleTurboModule.js +4 -41
- package/Libraries/Types/ReactDevToolsTypes.js +58 -0
- package/Libraries/Types/UIManagerJSInterface.js +16 -0
- package/Libraries/Utilities/DebugEnvironment.js +1 -4
- package/Libraries/Utilities/Dimensions.js +8 -16
- package/Libraries/Utilities/Dimensions.win32.js +8 -16
- package/Libraries/Utilities/FocusManager.win32.js +2 -0
- package/Libraries/Utilities/GlobalPerformanceLogger.js +1 -2
- package/Libraries/Utilities/NativeAppearance.js +3 -26
- package/Libraries/Utilities/NativeDevLoadingView.js +3 -14
- package/Libraries/Utilities/NativeDeviceInfo.js +2 -47
- package/Libraries/Utilities/NativePlatformConstantsAndroid.js +3 -34
- package/Libraries/Utilities/NativePlatformConstantsIOS.js +3 -26
- package/Libraries/Utilities/NativePlatformConstantsWin.js +3 -23
- package/Libraries/Utilities/PixelRatio.d.ts +4 -4
- package/Libraries/Utilities/Platform.android.js +4 -0
- package/Libraries/Utilities/Platform.d.ts +3 -0
- package/Libraries/Utilities/Platform.flow.js +7 -0
- package/Libraries/Utilities/Platform.flow.win32.js +18 -5
- package/Libraries/Utilities/Platform.ios.js +11 -0
- package/Libraries/Utilities/Platform.win32.js +9 -1
- package/Libraries/Utilities/binaryToBase64.js +1 -1
- package/Libraries/Utilities/codegenNativeComponent.js +4 -6
- package/Libraries/Utilities/createPerformanceLogger.js +2 -74
- package/Libraries/Utilities/useMergeRefs.js +5 -9
- package/Libraries/Vibration/NativeVibration.js +3 -14
- package/Libraries/WebSocket/NativeWebSocketModule.js +4 -25
- package/Libraries/YellowBox/YellowBoxDeprecated.js +1 -1
- package/Libraries/platform-types.d.ts +2 -3
- package/Libraries/vendor/emitter/EventEmitter.js +1 -0
- package/babel.config.js +1 -1
- package/flow/jest.js +1 -1
- package/flow/react.js +15 -0
- package/index.js +66 -99
- package/index.win32.js +60 -101
- package/jest/assetFileTransformer.js +1 -1
- package/jest/local-setup.js +0 -5
- package/jest/mockModal.js +2 -1
- package/jest/mockScrollView.js +1 -2
- package/jest/renderer.js +1 -1
- package/jest/setup.js +6 -3
- package/jest.config.js +2 -1
- package/overrides.json +152 -131
- package/package.json +26 -26
- package/{Libraries/Core → src/private/core}/setUpDOM.js +2 -2
- package/src/private/featureflags/NativeReactNativeFeatureFlags.js +42 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +140 -0
- package/src/private/featureflags/ReactNativeFeatureFlagsBase.js +84 -0
- package/src/private/featureflags/__tests__/ReactNativeFeatureFlags-test.js +92 -0
- package/src/private/specs/components/ActivityIndicatorViewNativeComponent.js +53 -0
- package/src/private/specs/components/AndroidDrawerLayoutNativeComponent.js +124 -0
- package/src/private/specs/components/AndroidHorizontalScrollContentViewNativeComponent.js +26 -0
- package/src/private/specs/components/AndroidSwipeRefreshLayoutNativeComponent.js +74 -0
- package/src/private/specs/components/AndroidSwitchNativeComponent.js +62 -0
- package/src/private/specs/components/DebuggingOverlayNativeComponent.js +61 -0
- package/src/private/specs/components/PopupMenuAndroidNativeComponent.js +47 -0
- package/src/private/specs/components/ProgressBarAndroidNativeComponent.js +36 -0
- package/src/private/specs/components/PullToRefreshViewNativeComponent.js +71 -0
- package/src/private/specs/components/RCTInputAccessoryViewNativeComponent.js +26 -0
- package/src/private/specs/components/RCTModalHostViewNativeComponent.js +139 -0
- package/src/private/specs/components/RCTSafeAreaViewNativeComponent.js +25 -0
- package/src/private/specs/components/SwitchNativeComponent.js +61 -0
- package/src/private/specs/components/UnimplementedNativeViewNativeComponent.js +26 -0
- package/src/private/specs/modules/NativeAccessibilityInfo.js +33 -0
- package/src/private/specs/modules/NativeAccessibilityInfoWin32.js +39 -0
- package/src/private/specs/modules/NativeAccessibilityManager.js +66 -0
- package/src/private/specs/modules/NativeActionSheetManager.js +54 -0
- package/src/private/specs/modules/NativeAlertManager.js +35 -0
- package/src/private/specs/modules/NativeAnimatedModule.js +77 -0
- package/src/private/specs/modules/NativeAnimatedTurboModule.js +78 -0
- package/src/private/specs/modules/NativeAnimationsDebugModule.js +20 -0
- package/src/private/specs/modules/NativeAppState.js +33 -0
- package/src/private/specs/modules/NativeAppearance.js +36 -0
- package/src/private/specs/modules/NativeBlobModule.js +59 -0
- package/src/private/specs/modules/NativeBugReporting.js +20 -0
- package/src/private/specs/modules/NativeClipboard.js +21 -0
- package/src/private/specs/modules/NativeDevLoadingView.js +24 -0
- package/src/private/specs/modules/NativeDevMenu.js +23 -0
- package/src/private/specs/modules/NativeDevSettings.js +33 -0
- package/src/private/specs/modules/NativeDevToolsSettingsManager.js +24 -0
- package/src/private/specs/modules/NativeDeviceEventManager.js +19 -0
- package/src/private/specs/modules/NativeDeviceInfo.js +58 -0
- package/src/private/specs/modules/NativeDialogManagerAndroid.js +48 -0
- package/src/private/specs/modules/NativeExceptionsManager.js +103 -0
- package/src/private/specs/modules/NativeFileReaderModule.js +22 -0
- package/src/private/specs/modules/NativeFrameRateLogger.js +22 -0
- package/src/private/specs/modules/NativeHeadlessJsTaskSupport.js +20 -0
- package/src/private/specs/modules/NativeI18nManager.js +28 -0
- package/src/private/specs/modules/NativeImageEditor.js +52 -0
- package/src/private/specs/modules/NativeImageLoaderAndroid.js +30 -0
- package/src/private/specs/modules/NativeImageLoaderIOS.js +37 -0
- package/src/private/specs/modules/NativeImageLoaderWin32.js +45 -0
- package/src/private/specs/modules/NativeImageStoreAndroid.js +26 -0
- package/src/private/specs/modules/NativeImageStoreIOS.js +33 -0
- package/src/private/specs/modules/NativeIntentAndroid.js +30 -0
- package/src/private/specs/modules/NativeIntersectionObserver.js +41 -0
- package/src/private/specs/modules/NativeJSCHeapCapture.js +19 -0
- package/src/private/specs/modules/NativeJSCSamplingProfiler.js +19 -0
- package/src/private/specs/modules/NativeKeyboardObserver.js +20 -0
- package/src/private/specs/modules/NativeLinkingManager.js +27 -0
- package/src/private/specs/modules/NativeLogBox.js +20 -0
- package/src/private/specs/modules/NativeModalManager.js +21 -0
- package/src/private/specs/modules/NativeMutationObserver.js +58 -0
- package/src/private/specs/modules/NativeNetworkingAndroid.js +37 -0
- package/src/private/specs/modules/NativeNetworkingIOS.js +37 -0
- package/src/private/specs/modules/NativePermissionsAndroid.js +77 -0
- package/src/private/specs/modules/NativePlatformConstantsAndroid.js +44 -0
- package/src/private/specs/modules/NativePlatformConstantsIOS.js +37 -0
- package/src/private/specs/modules/NativePlatformConstantsWin.js +37 -0
- package/src/private/specs/modules/NativePushNotificationManagerIOS.js +107 -0
- package/src/private/specs/modules/NativeRedBox.js +20 -0
- package/src/private/specs/modules/NativeSampleTurboModule.js +53 -0
- package/src/private/specs/modules/NativeSegmentFetcher.js +28 -0
- package/src/private/specs/modules/NativeSettingsManager.js +25 -0
- package/src/private/specs/modules/NativeShareModule.js +23 -0
- package/src/private/specs/modules/NativeSoundManager.js +22 -0
- package/src/private/specs/modules/NativeSourceCode.js +36 -0
- package/src/private/specs/modules/NativeStatusBarManagerAndroid.js +68 -0
- package/src/private/specs/modules/NativeStatusBarManagerIOS.js +89 -0
- package/src/private/specs/modules/NativeTiming.js +26 -0
- package/src/private/specs/modules/NativeToastAndroid.js +38 -0
- package/src/private/specs/modules/NativeUIManager.js +118 -0
- package/src/private/specs/modules/NativeVibration.js +24 -0
- package/src/private/specs/modules/NativeWebSocketModule.js +34 -0
- package/{Libraries/DOM/Nodes → src/private/webapis/dom/nodes}/ReactNativeElement.js +6 -6
- package/{Libraries/DOM/Nodes → src/private/webapis/dom/nodes}/ReadOnlyCharacterData.js +2 -2
- package/{Libraries/DOM/Nodes → src/private/webapis/dom/nodes}/ReadOnlyElement.js +5 -5
- package/{Libraries/DOM/Nodes → src/private/webapis/dom/nodes}/ReadOnlyNode.js +19 -10
- package/{Libraries/DOM/OldStyleCollections → src/private/webapis/dom/oldstylecollections}/DOMRectList.js +1 -1
- package/src/private/webapis/dom/oldstylecollections/__tests__/DOMRectList-test.js +85 -0
- package/src/private/webapis/dom/oldstylecollections/__tests__/HTMLCollection-test.js +80 -0
- package/src/private/webapis/dom/oldstylecollections/__tests__/NodeList-test.js +161 -0
- package/{Libraries/WebPerformance → src/private/webapis/performance}/NativePerformance.js +2 -2
- package/{Libraries/WebPerformance → src/private/webapis/performance}/NativePerformanceObserver.js +3 -2
- package/{Libraries/WebPerformance → src/private/webapis/performance}/Performance.js +2 -2
- package/{Libraries/WebPerformance → src/private/webapis/performance}/PerformanceEventTiming.js +1 -1
- package/{Libraries/WebPerformance → src/private/webapis/performance}/PerformanceObserver.js +21 -2
- package/{Libraries/WebPerformance → src/private/webapis/performance}/RawPerformanceEntry.js +1 -1
- package/{Libraries/WebPerformance → src/private/webapis/performance}/__mocks__/NativePerformanceObserver.js +9 -0
- package/src/private/webapis/performance/__tests__/EventCounts-test.js +116 -0
- package/src/private/webapis/performance/__tests__/NativePerformanceMock-test.js +82 -0
- package/src/private/webapis/performance/__tests__/NativePerformanceObserverMock-test.js +108 -0
- package/src/private/webapis/performance/__tests__/Performance-test.js +117 -0
- package/src/private/webapis/performance/__tests__/PerformanceObserver-test.js +208 -0
- package/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +161 -0
- package/{src → src-win}/Libraries/Components/Button/ButtonWin32.tsx +3 -3
- package/{src → src-win}/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +9 -10
- package/{src → src-win}/Libraries/Components/View/ViewAccessibility.d.ts +33 -17
- package/{src → src-win}/Libraries/Components/View/ViewPropTypes.d.ts +28 -17
- package/{src → src-win}/Libraries/StyleSheet/PlatformColorValueTypesWin32.d.ts +1 -1
- package/{src → src-win}/Libraries/Text/Text.d.ts +5 -6
- package/{src → src-win}/Libraries/platform-types.d.ts +2 -3
- package/types/modules/globals.d.ts +1 -0
- package/Libraries/Components/Button.flow.js +0 -265
- package/Libraries/Components/ScrollView/ScrollViewViewConfig.js +0 -85
- package/Libraries/Components/Text/TextWin32.Props.d.ts +0 -63
- package/Libraries/Components/Text/TextWin32.Props.js +0 -3
- package/Libraries/Components/Text/TextWin32.Props.js.map +0 -1
- package/Libraries/Components/Text/TextWin32.d.ts +0 -6
- package/Libraries/Components/Text/TextWin32.js +0 -18
- package/Libraries/Components/Text/TextWin32.js.map +0 -1
- package/Libraries/Components/Touchable/Touchable.flow.js +0 -284
- package/Libraries/Components/TraceUpdateOverlay/TraceUpdateOverlay.js +0 -189
- package/Libraries/Components/TraceUpdateOverlay/TraceUpdateOverlayNativeComponent.js +0 -43
- package/Libraries/Image/Image.flow.js +0 -64
- package/Libraries/Inspector/DevtoolsOverlay.js +0 -223
- package/Libraries/Performance/QuickPerformanceLogger.js +0 -142
- package/src/Libraries/Components/Text/TextWin32.Props.ts +0 -82
- package/src/Libraries/Components/Text/TextWin32.tsx +0 -25
- /package/{Libraries/DOM/Geometry → src/private/webapis/dom/geometry}/DOMRect.js +0 -0
- /package/{Libraries/DOM/Geometry → src/private/webapis/dom/geometry}/DOMRectReadOnly.js +0 -0
- /package/{Libraries/DOM/Nodes → src/private/webapis/dom/nodes}/ReadOnlyText.js +0 -0
- /package/{Libraries/DOM/Nodes/Utilities → src/private/webapis/dom/nodes/utilities}/Traversal.js +0 -0
- /package/{Libraries/DOM/OldStyleCollections → src/private/webapis/dom/oldstylecollections}/ArrayLikeUtils.js +0 -0
- /package/{Libraries/DOM/OldStyleCollections → src/private/webapis/dom/oldstylecollections}/HTMLCollection.js +0 -0
- /package/{Libraries/DOM/OldStyleCollections → src/private/webapis/dom/oldstylecollections}/NodeList.js +0 -0
- /package/{Libraries/WebPerformance → src/private/webapis/performance}/EventCounts.js +0 -0
- /package/{Libraries/WebPerformance → src/private/webapis/performance}/MemoryInfo.js +0 -0
- /package/{Libraries/WebPerformance → src/private/webapis/performance}/PerformanceEntry.js +0 -0
- /package/{Libraries/WebPerformance → src/private/webapis/performance}/ReactNativeStartupTiming.js +0 -0
- /package/{Libraries/WebPerformance → src/private/webapis/performance}/__mocks__/NativePerformance.js +0 -0
- /package/{src → src-win}/Libraries/Components/Button/ButtonWin32.Props.ts +0 -0
- /package/{src → src-win}/Libraries/Components/EnterString.win32.tsx +0 -0
- /package/{src → src-win}/Libraries/Components/TextInput/Tests/TextInputTest.tsx +0 -0
- /package/{src → src-win}/Libraries/Components/Touchable/TouchableNativeFeedback.d.ts +0 -0
- /package/{src → src-win}/Libraries/Components/Touchable/TouchableWin32.Props.tsx +0 -0
- /package/{src → src-win}/Libraries/Components/Touchable/TouchableWin32.Types.tsx +0 -0
- /package/{src → src-win}/Libraries/Components/Touchable/TouchableWin32.tsx +0 -0
- /package/{src → src-win}/Libraries/Components/View/ViewWin32.d.ts +0 -0
- /package/{src → src-win}/Libraries/Image/ImageTypes.ts +0 -0
- /package/{src → src-win}/Libraries/Image/Tests/ImageWin32Test.tsx +0 -0
- /package/{src → src-win}/Libraries/Image/Tests/img/dpitest.png +0 -0
- /package/{src → src-win}/Libraries/Image/Tests/img/dpitest@1.5x.png +0 -0
- /package/{src → src-win}/Libraries/Image/Tests/img/dpitest@2x.png +0 -0
- /package/{src → src-win}/Libraries/Image/Tests/img/dpitest@3x.png +0 -0
- /package/{src → src-win}/Libraries/Image/Tests/img/en-us/dpitest.png +0 -0
- /package/{src → src-win}/Libraries/Image/Tests/img/en-us/dpitest@1.5x.png +0 -0
- /package/{src → src-win}/Libraries/Image/Tests/img/en-us/dpitest@3x.png +0 -0
- /package/{src → src-win}/Libraries/PersonaCoin/PersonaCoin.tsx +0 -0
- /package/{src → src-win}/Libraries/PersonaCoin/PersonaCoinPropTypes.ts +0 -0
- /package/{src → src-win}/Libraries/PersonaCoin/PersonaCoinTypes.ts +0 -0
- /package/{src → src-win}/Libraries/Utilities/FocusManager.win32.d.ts +0 -0
- /package/{src → src-win}/Libraries/__tests__/__snapshots__/ButtonWin32-test.js.snap +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TouchableWin32Test.js","sourceRoot":"","sources":["../../../../src/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;AAEb,kDAAyB;AACzB,+CAAgF;AAEhF,oDAAiD;AACjD,oDAAiD;AAEjD,sDAAmD;AAInD;;GAEG;AACH,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,cAAc,EAAE;QACd,MAAM,EAAE,GAAG;QACX,KAAK,EAAE,GAAG;QACV,cAAc,EAAE,eAAe;QAC/B,UAAU,EAAE,QAAQ;QACpB,aAAa,EAAE,KAAK;KACrB;IACD,cAAc,EAAE;QACd,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;QACT,c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AK,EAAE,kCAAkC;QACzC,WAAW,EAAE,8DAA8D;QAC3E,MAAM;YACJ,OAAO,8BAAC,+BAA+B,OAAG,CAAC;QAC7C,CAAC;KACF;IACD;QACE,KAAK,EAAE,4BAA4B;QACnC,WAAW,EAAE,uDAAuD;QACpE,MAAM;YACJ,OAAO,8BAAC,yBAAyB,OAAG,CAAC;QACvC,CAAC;KACF;IACD;QACE,KAAK,EAAE,4CAA4C;QACnD,WAAW,EAAE,8DAA8D;QAC3E,MAAM;YACJ,OAAO,8BAAC,qBAAqB,OAAG,CAAC;QACnC,CAAC;KACF;CACF,CAAC","sourcesContent":["'use strict';\n\nimport React from 'react'\nimport {NativeSyntheticEvent, StyleSheet, Text, ViewStyle } from 'react-native';\nimport {Insets} from 'react-native/types/public/Insets';\nimport { TextWin32 } from '../../Text/TextWin32';\nimport { ViewWin32 } from '../../View/ViewWin32';\nimport { IViewWin32Props, IKeyboardEvent } from '../../View/ViewPropTypes';\nimport { TouchableWin32 } from '../TouchableWin32';\nimport { IPressEvent, IRenderChild } from '../TouchableWin32.Types';\nimport { ITouchableWin32State } from '../TouchableWin32.Props';\n\n/**\n * Styles used across both examples\n */\nconst styles = StyleSheet.create({\n largeContainer: {\n height: 200,\n width: 600,\n justifyContent: 'space-between',\n alignItems: 'center',\n flexDirection: 'row',\n },\n smallContainer: {\n height: 90,\n width: 90,\n justifyContent: 'center',\n alignContent: 'center',\n },\n highlight: {\n height: 150,\n width: 150,\n justifyContent: 'space-around',\n alignContent: 'center',\n alignItems: 'center',\n flexDirection: 'row',\n },\n outerTouch: {\n height: 150,\n width: 150,\n justifyContent: 'space-around',\n alignContent: 'center',\n alignItems: 'center',\n flexDirection: 'row',\n },\n innerTouch: {\n height: 90,\n width: 90,\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\n/**\n * Constant press rect offset, used to demonstrate press geometry\n */\nconst PRESS_RETENTION_OFFSET: Insets = {\n top: 100,\n left: 100,\n right: 100,\n bottom: 100,\n};\n\ninterface ITouchableWin32WithoutFeedbackProps extends IViewWin32Props {\n delayLongPress?: number;\n delayPressIn?: number;\n delayPressOut?: number;\n onPress?: (e: IPressEvent) => void;\n onPressIn?: (e: IPressEvent) => void;\n onPressOut?: (e: IPressEvent) => void;\n onLongPress?: (e: IPressEvent) => void;\n pressRetentionOffset?: Insets;\n rejectResponderTermination?: boolean;\n}\n\ninterface ITouchableWin32WithoutFeedbackState {\n isFocused: boolean;\n}\n\n/**\n * Example implementation of TouchableWithoutFeedback - not meant for use outside these examples\n * This is mainly there to show the ability to respond to touches without providing visual feedback,\n * though we do show a red border on focus to know where starts start and end and whether press rect\n * offsets are respected.\n */\nclass TouchableWin32WithoutFeedback extends React.Component<ITouchableWin32WithoutFeedbackProps, ITouchableWin32WithoutFeedbackState> {\n constructor(props) {\n super(props);\n\n this.state = { isFocused: false };\n }\n\n public render() {\n return (\n <TouchableWin32\n focusable\n rejectResponderTermination={true}\n disabled={false}\n touchableHandleActivePressIn={this._touchableHandleActivePressIn}\n touchableHandleActivePressOut={this._touchableHandleActivePressOut}\n touchableHandlePress={this._touchableHandlePress}\n touchableHandleLongPress={this._touchableHandleLongPress}\n touchableGetHighlightDelayMS={this._touchableGetHighlightDelayMS}\n touchableGetPressRectOffset={this._touchableGetPressRectOffset}\n touchableGetLongPressDelayMS={this._touchableGetLongPressDelayMS}\n touchableGetPressOutDelayMS={this._touchableGetPressOutDelayMS}\n touchableGetHitSlop={this._touchableGetHitSlop}\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n renderStyle={this._generateStyle}\n >\n {React.Children.only(this.props.children)}\n </TouchableWin32>\n );\n }\n\n private readonly _touchableHandlePress = (e: IPressEvent) => {\n this.props.onPress && this.props.onPress(e);\n };\n\n private readonly _touchableHandleActivePressIn = (e: IPressEvent) => {\n this.props.onPressIn && this.props.onPressIn(e);\n };\n\n private readonly _touchableHandleActivePressOut = (e: IPressEvent) => {\n this.props.onPressOut && this.props.onPressOut(e);\n };\n\n private readonly _touchableHandleLongPress = (e: IPressEvent) => {\n this.props.onLongPress && this.props.onLongPress(e);\n };\n\n private readonly _touchableGetPressRectOffset = (): Insets => {\n return this.props.pressRetentionOffset || PRESS_RETENTION_OFFSET;\n };\n\n private readonly _touchableGetHitSlop = (): Insets => {\n return this.props.hitSlop;\n };\n\n private readonly _touchableGetHighlightDelayMS = (): number => {\n return this.props.delayPressIn || 0;\n };\n\n private readonly _touchableGetLongPressDelayMS = (): number => {\n return this.props.delayLongPress === 0 ? 0 : this.props.delayLongPress || 500;\n };\n\n private readonly _touchableGetPressOutDelayMS = (): number => {\n return this.props.delayPressOut || 0;\n };\n\n private readonly _onFocus = () => {\n this.setState({ isFocused: true });\n };\n\n private readonly _onBlur = () => {\n this.setState({ isFocused: false });\n };\n\n /**\n * The generated style uses hard-coded border width values\n */\n private readonly _generateStyle = (state: ITouchableWin32State): ViewStyle => {\n const finalStyle: ViewStyle = {\n borderWidth: state.isFocused ? 5 : 0,\n borderColor: 'red',\n };\n return Object.assign({}, this.props.style, finalStyle);\n };\n}\n\ninterface ITouchableWin32HighlightProps extends Omit <IViewWin32Props, 'children'> {\n delayLongPress?: number;\n delayLongPressIn?: number;\n delayPressOut?: number;\n onPress?: (e: IPressEvent) => void;\n onPressIn?: (e: IPressEvent) => void;\n onPressOut?: (e: IPressEvent) => void;\n onLongPress?: (e: IPressEvent) => void;\n onKeyPress?: (e: IKeyboardEvent) => void;\n onKeyPressDown?: (e: IKeyboardEvent) => void;\n pressRetentionOffset?: Insets;\n rejectResponderTermination?: boolean;\n underlayColor?: string;\n children?: IRenderChild<ITouchableWin32State>;\n}\n\ninterface ITouchableWin32HighlightComponentProps extends ITouchableWin32HighlightProps {\n // Used as an imperative handle to the TouchableWin32 interface - primarily for focus()\n innerRef?: React.Ref<TouchableWin32>;\n}\n\n/**\n * Example implementation of TouchableHighlight - not meant for use outside these examples\n * The main difference between a full TouchableHighlight implementation and this example is that\n * TouchableHighlight should manipulate the opacity of the wrapped view to display the underlay color.\n * This example merely uses hard coded color values to distinguish between different control states\n */\nclass TouchableWin32HighlightComponent extends React.Component<ITouchableWin32HighlightComponentProps, {}> {\n\n public render() {\n return (\n <TouchableWin32\n focusable\n rejectResponderTermination={this.props.rejectResponderTermination}\n disabled={false}\n touchableHandleActivePressIn={this._touchableHandleActivePressIn}\n touchableHandleActivePressOut={this._touchableHandleActivePressOut}\n touchableHandlePress={this._touchableHandlePress}\n touchableHandleLongPress={this._touchableHandleLongPress}\n touchableGetHighlightDelayMS={this._touchableGetHighlightDelayMS}\n touchableGetPressRectOffset={this._touchableGetPressRectOffset}\n touchableGetLongPressDelayMS={this._touchableGetLongPressDelayMS}\n touchableGetPressOutDelayMS={this._touchableGetPressOutDelayMS}\n touchableGetHitSlop={this._touchableGetHitSlop}\n touchableHandleKeyPress={this._touchableHandleKeyPress}\n touchableHandleKeyPressDown={this._touchableHandleKeyPressDown}\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n onMouseEnter={this._mouseEnter}\n onMouseLeave={this._mouseLeave}\n renderStyle={this._generateStyle}\n children={this.props.children}\n ref={this.props.innerRef}\n />\n );\n }\n\n private readonly _touchableHandlePress = (e: IPressEvent) => {\n this.props.onPress && this.props.onPress(e);\n this.setState({ isPressed: false });\n };\n private readonly _touchableHandleActivePressIn = (e: IPressEvent) => {\n this.props.onPressIn && this.props.onPressIn(e);\n this.setState({ isPressed: true });\n };\n private readonly _touchableHandleActivePressOut = (e: IPressEvent) => {\n this.props.onPressOut && this.props.onPressOut(e);\n this.setState({ isPressed: false });\n };\n private readonly _touchableHandleLongPress = (e: IPressEvent) => {\n this.props.onLongPress && this.props.onLongPress(e);\n };\n private readonly _touchableGetPressRectOffset = (): Insets => {\n return this.props.pressRetentionOffset || PRESS_RETENTION_OFFSET;\n };\n private readonly _touchableGetHitSlop = (): Insets => {\n return { left: 100, right: 100, top: 100, bottom: 100 };\n };\n private readonly _touchableGetHighlightDelayMS = (): number => {\n return this.props.delayLongPressIn || 0;\n };\n private readonly _touchableGetLongPressDelayMS = (): number => {\n return this.props.delayLongPress || 500;\n };\n private readonly _touchableGetPressOutDelayMS = (): number => {\n return this.props.delayPressOut || 0;\n };\n private readonly _touchableHandleKeyPress = (ev: IKeyboardEvent) => {\n this.props.onKeyPress && this.props.onKeyPress(ev);\n }\n private readonly _touchableHandleKeyPressDown = (ev: IKeyboardEvent) => {\n this.props.onKeyPressDown && this.props.onKeyPressDown(ev);\n }\n private readonly _mouseEnter = (mouseEvent): void => {\n this.props.onMouseEnter && this.props.onMouseEnter(mouseEvent);\n this.setState({ isMouseIn: true });\n };\n private readonly _mouseLeave = (mouseEvent): void => {\n this.props.onMouseLeave && this.props.onMouseLeave(mouseEvent);\n this.setState({ isMouseIn: false });\n };\n private readonly _onFocus = (ev: NativeSyntheticEvent<{}>): void => {\n this.props.onFocus && this.props.onFocus(ev);\n this.setState({ isFocused: true });\n };\n private readonly _onBlur = (ev: NativeSyntheticEvent<{}>): void => {\n this.props.onBlur && this.props.onBlur(ev);\n this.setState({ isFocused: false });\n };\n\n /**\n * The generated style uses hard-coded color values,\n * though it is trivial to pass these values as props.\n * This is an example of a render style (one that is a\n * function passed on to TouchableWin32 and resolved according\n * to the internal state of TouchableWin32).\n */\n private readonly _generateStyle = (state: ITouchableWin32State): ViewStyle => {\n const finalStyle: ViewStyle = {};\n finalStyle.borderColor = state.isFocused ? 'red' : 'blue';\n finalStyle.borderWidth = state.isFocused ? 10 : 5;\n if (state.isHovered) {\n if (state.isPressed) {\n finalStyle.backgroundColor = 'black';\n } else {\n finalStyle.backgroundColor = 'gray';\n }\n } else {\n if (state.isPressed) {\n finalStyle.backgroundColor = 'green';\n } else {\n finalStyle.backgroundColor = 'white';\n }\n }\n return Object.assign({}, this.props.style, finalStyle);\n };\n}\n\n// Demonstrating ref forwarding - forwarding a ref using an innerRef prop on a class component\nconst TouchableWin32Highlight = React.forwardRef<TouchableWin32, ITouchableWin32HighlightProps>(\n (props, ref) => {\n return (\n <TouchableWin32HighlightComponent innerRef={ref} {...props} />\n );\n }\n);\n\n/**\n * Both examples merely track number of presses\n */\ninterface IExampleState {\n numberOfPresses: number;\n}\n\n/**\n * TouchableHighlightExamples\n */\nclass TouchableWithoutFeedbackExample extends React.Component<{}, IExampleState> {\n constructor(props) {\n super(props);\n this.state = { numberOfPresses: 0 };\n }\n\n public render() {\n return (\n <ViewWin32 style={styles.largeContainer}>\n <TouchableWin32WithoutFeedback style={styles.outerTouch} onPress={this._onPress}>\n <ViewWin32>\n <TextWin32>Press me</TextWin32>\n </ViewWin32>\n </TouchableWin32WithoutFeedback>\n\n <TouchableWin32WithoutFeedback style={styles.outerTouch} onPress={this._onPress}>\n <ViewWin32 style={styles.smallContainer}>\n <TouchableWin32WithoutFeedback style={styles.innerTouch} onPress={this._onPress}>\n <ViewWin32>\n <TextWin32>You can also have nested Touchables</TextWin32>\n </ViewWin32>\n </TouchableWin32WithoutFeedback>\n </ViewWin32>\n </TouchableWin32WithoutFeedback>\n <TextWin32>{'Number of Recognized Presses: ' + this.state.numberOfPresses}</TextWin32>\n </ViewWin32>\n );\n }\n\n private readonly _onPress = () => {\n this.setState({ numberOfPresses: this.state.numberOfPresses + 1 });\n };\n}\n\n/**\n * TouchableHighlightExamples\n */\nclass TouchableHighlightExample extends React.Component<{}, IExampleState> {\n constructor(props) {\n super(props);\n this.state = { numberOfPresses: 0 };\n }\n\n public render() {\n return (\n <ViewWin32 style={styles.largeContainer}>\n <TouchableWin32Highlight style={styles.outerTouch} onPress={this._onPress}>\n <ViewWin32>\n <TextWin32>Press me</TextWin32>\n </ViewWin32>\n </TouchableWin32Highlight>\n\n <TouchableWin32Highlight style={styles.outerTouch} onPress={this._onPress}>\n <ViewWin32 style={styles.smallContainer}>\n <TouchableWin32Highlight style={styles.innerTouch} onPress={this._onPress} children={this._getChildrenOfInnerTouchable} />\n </ViewWin32>\n </TouchableWin32Highlight>\n <TextWin32 style={{ color: 'red' }} textStyle=\"None\">\n {'Number of Recognized Presses: ' + this.state.numberOfPresses}\n </TextWin32>\n </ViewWin32>\n );\n }\n\n /**\n * This is primarily to demonstrate render children as a function\n * of state, here we change text color depending on interaction state.\n */\n private readonly _getChildrenOfInnerTouchable = (state: ITouchableWin32State) => {\n return (\n <ViewWin32\n style={{\n borderColor: state.isFocused ? 'green' : 'pink',\n borderWidth: state.isHovered ? 10 : 5,\n height: 70,\n width: 70,\n }}\n >\n <TextWin32\n style={{\n color: this._pickColor(state.isHovered, state.isPressed),\n fontSize: state.isFocused ? 8 : 10,\n }}\n textStyle=\"None\"\n >\n Press Me!\n </TextWin32>\n </ViewWin32>\n );\n };\n\n private _pickColor(hovered: boolean, pressed: boolean) {\n if (hovered) {\n if (pressed) {\n return 'white';\n } else {\n return 'red';\n }\n } else {\n if (pressed) {\n return 'purple';\n } else {\n return 'black';\n }\n }\n }\n\n private readonly _onPress = () => {\n this.setState({ numberOfPresses: this.state.numberOfPresses + 1 });\n };\n}\n\nconst TouchableFocusExample = () => {\n const [focused, setFocused] = React.useState(false);\n const focusableRef = React.useRef<TouchableWin32>(null);\n\n // onPress callback\n const focusOnPress = React.useCallback(() => {\n focusableRef.current && focusableRef.current.focus();\n focused || setFocused(true);\n }, [focused]);\n\n // onFocus and onBlur callbacks\n const onFocus = React.useCallback(() => {\n setFocused(true);\n }, []);\n const onBlur = React.useCallback(() => {\n setFocused(false);\n }, []);\n\n return (\n <ViewWin32 style={styles.largeContainer}>\n <TouchableWin32Highlight onPress={focusOnPress}>\n <Text>Press me to focus my friend</Text>\n </TouchableWin32Highlight>\n\n <TouchableWin32Highlight\n ref={focusableRef}\n onFocus={onFocus}\n onBlur={onBlur}\n >\n <Text>{'Focused: ' + focused}</Text>\n </TouchableWin32Highlight>\n </ViewWin32>\n );\n}\n\nexport const displayName = 'TouchableWin32 Examples';\nexport const title = 'TouchableWin32';\nexport const description = 'Demonstration of touchable + focus + hover behavior all in one component';\n\nexport const examples = [\n {\n title: 'TouchableWithoutFeedback Example',\n description: 'A simple example implementation of without feedback behavior',\n render(): JSX.Element {\n return <TouchableWithoutFeedbackExample />;\n },\n },\n {\n title: 'TouchableHighlight Example',\n description: 'A simple example implementation of highlight behavior',\n render(): JSX.Element {\n return <TouchableHighlightExample />;\n },\n },\n {\n title: 'Imperative Focus on TouchableWin32 Example',\n description: 'A simple example implementation of imperative focus behavior',\n render(): JSX.Element {\n return <TouchableFocusExample />;\n },\n }\n];\n"]}
|
|
1
|
+
{"version":3,"file":"TouchableWin32Test.js","sourceRoot":"","sources":["../../../../src-win/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;AAEb,kDAAyB;AACzB,+CAAgF;AAEhF,oDAAiD;AAEjD,sDAAmD;AAInD;;GAEG;AACH,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,cAAc,EAAE;QACd,MAAM,EAAE,GAAG;QACX,KAAK,EAAE,GAAG;QACV,cAAc,EAAE,eAAe;QAC/B,UAAU,EAAE,QAAQ;QACpB,aAAa,EAAE,KAAK;KACrB;IACD,cAAc,EAAE;QACd,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;QACT,cAAc,EAAE,QAAQ;QACxB,YAAY,EAAE,QAAQ;KACvB;IACD,SAAS,EAAE;QACT,MAAM,EAAE,GAAG;QACX,KAAK,EAAE,GAAG;QACV,cAAc,EAAE,cAAc;QAC9B,YAAY,EAAE,QAAQ;QACtB,UAAU,EAAE,QAAQ;QACpB,aAAa,EAAE,KAAK;KACrB;IACD,UAAU,EAAE;QACV,MAAM,EAAE,GAAG;QACX,KAAK,EAAE,GAAG;QACV,cAAc,EAAE,cAAc;QAC9B,YAAY,EAAE,QAAQ;QACtB,UAAU,EAAE,QAAQ;QACpB,aAAa,EAAE,KAAK;KACrB;IACD,UAAU,EAAE;QACV,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;QACT,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;CACF,CAAC,CAAC;AAE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,GAAG,EAAE;QACrC,UAAU,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,MAAM,MAAM,GAAG,eAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACpC,UAAU,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,8BAAC,qBAAS,IAAC,KAAK,EAAE,MAAM,CAAC,cAAc;QACrC,8BAAC,uBAAuB,IAAC,OAAO,EAAE,YAAY;YAC5C,8BAAC,mBAAI,sCAAmC,CAChB;QAE1B,8BAAC,uBAAuB,IACtB,GAAG,EAAE,YAAY,EACjB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM;YAEd,8BAAC,mBAAI,QAAE,WAAW,GAAG,OAAO,CAAQ,CACZ,CAChB,CACb,CAAC;AACJ,CAAC,CAAA;AAEY,QAAA,WAAW,GAAG,yBAAyB,CAAC;AACxC,QAAA,KAAK,GAAG,gBAAgB,CAAC;AACzB,QAAA,WAAW,GAAG,0EAA0E,CAAC;AAEzF,QAAA,QAAQ,GAAG;IACtB;QACE,KAAK,EAAE,kCAAkC;QACzC,WAAW,EAAE,8DAA8D;QAC3E,MAAM;YACJ,OAAO,8BAAC,+BAA+B,OAAG,CAAC;QAC7C,CAAC;KACF;IACD;QACE,KAAK,EAAE,4BAA4B;QACnC,WAAW,EAAE,uDAAuD;QACpE,MAAM;YACJ,OAAO,8BAAC,yBAAyB,OAAG,CAAC;QACvC,CAAC;KACF;IACD;QACE,KAAK,EAAE,4CAA4C;QACnD,WAAW,EAAE,8DAA8D;QAC3E,MAAM;YACJ,OAAO,8BAAC,qBAAqB,OAAG,CAAC;QACnC,CAAC;KACF;CACF,CAAC","sourcesContent":["'use strict';\n\nimport React from 'react'\nimport {NativeSyntheticEvent, StyleSheet, Text, ViewStyle } from 'react-native';\nimport {Insets} from 'react-native/types/public/Insets';\nimport { ViewWin32 } from '../../View/ViewWin32';\nimport { IViewWin32Props, IKeyboardEvent } from '../../View/ViewPropTypes';\nimport { TouchableWin32 } from '../TouchableWin32';\nimport { IPressEvent, IRenderChild } from '../TouchableWin32.Types';\nimport { ITouchableWin32State } from '../TouchableWin32.Props';\n\n/**\n * Styles used across both examples\n */\nconst styles = StyleSheet.create({\n largeContainer: {\n height: 200,\n width: 600,\n justifyContent: 'space-between',\n alignItems: 'center',\n flexDirection: 'row',\n },\n smallContainer: {\n height: 90,\n width: 90,\n justifyContent: 'center',\n alignContent: 'center',\n },\n highlight: {\n height: 150,\n width: 150,\n justifyContent: 'space-around',\n alignContent: 'center',\n alignItems: 'center',\n flexDirection: 'row',\n },\n outerTouch: {\n height: 150,\n width: 150,\n justifyContent: 'space-around',\n alignContent: 'center',\n alignItems: 'center',\n flexDirection: 'row',\n },\n innerTouch: {\n height: 90,\n width: 90,\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\n/**\n * Constant press rect offset, used to demonstrate press geometry\n */\nconst PRESS_RETENTION_OFFSET: Insets = {\n top: 100,\n left: 100,\n right: 100,\n bottom: 100,\n};\n\ninterface ITouchableWin32WithoutFeedbackProps extends IViewWin32Props {\n delayLongPress?: number;\n delayPressIn?: number;\n delayPressOut?: number;\n onPress?: (e: IPressEvent) => void;\n onPressIn?: (e: IPressEvent) => void;\n onPressOut?: (e: IPressEvent) => void;\n onLongPress?: (e: IPressEvent) => void;\n pressRetentionOffset?: Insets;\n rejectResponderTermination?: boolean;\n}\n\ninterface ITouchableWin32WithoutFeedbackState {\n isFocused: boolean;\n}\n\n/**\n * Example implementation of TouchableWithoutFeedback - not meant for use outside these examples\n * This is mainly there to show the ability to respond to touches without providing visual feedback,\n * though we do show a red border on focus to know where starts start and end and whether press rect\n * offsets are respected.\n */\nclass TouchableWin32WithoutFeedback extends React.Component<ITouchableWin32WithoutFeedbackProps, ITouchableWin32WithoutFeedbackState> {\n constructor(props) {\n super(props);\n\n this.state = { isFocused: false };\n }\n\n public render() {\n return (\n <TouchableWin32\n focusable\n rejectResponderTermination={true}\n disabled={false}\n touchableHandleActivePressIn={this._touchableHandleActivePressIn}\n touchableHandleActivePressOut={this._touchableHandleActivePressOut}\n touchableHandlePress={this._touchableHandlePress}\n touchableHandleLongPress={this._touchableHandleLongPress}\n touchableGetHighlightDelayMS={this._touchableGetHighlightDelayMS}\n touchableGetPressRectOffset={this._touchableGetPressRectOffset}\n touchableGetLongPressDelayMS={this._touchableGetLongPressDelayMS}\n touchableGetPressOutDelayMS={this._touchableGetPressOutDelayMS}\n touchableGetHitSlop={this._touchableGetHitSlop}\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n renderStyle={this._generateStyle}\n >\n {React.Children.only(this.props.children)}\n </TouchableWin32>\n );\n }\n\n private readonly _touchableHandlePress = (e: IPressEvent) => {\n this.props.onPress && this.props.onPress(e);\n };\n\n private readonly _touchableHandleActivePressIn = (e: IPressEvent) => {\n this.props.onPressIn && this.props.onPressIn(e);\n };\n\n private readonly _touchableHandleActivePressOut = (e: IPressEvent) => {\n this.props.onPressOut && this.props.onPressOut(e);\n };\n\n private readonly _touchableHandleLongPress = (e: IPressEvent) => {\n this.props.onLongPress && this.props.onLongPress(e);\n };\n\n private readonly _touchableGetPressRectOffset = (): Insets => {\n return this.props.pressRetentionOffset || PRESS_RETENTION_OFFSET;\n };\n\n private readonly _touchableGetHitSlop = (): Insets => {\n return this.props.hitSlop as Insets;\n };\n\n private readonly _touchableGetHighlightDelayMS = (): number => {\n return this.props.delayPressIn || 0;\n };\n\n private readonly _touchableGetLongPressDelayMS = (): number => {\n return this.props.delayLongPress === 0 ? 0 : this.props.delayLongPress || 500;\n };\n\n private readonly _touchableGetPressOutDelayMS = (): number => {\n return this.props.delayPressOut || 0;\n };\n\n private readonly _onFocus = () => {\n this.setState({ isFocused: true });\n };\n\n private readonly _onBlur = () => {\n this.setState({ isFocused: false });\n };\n\n /**\n * The generated style uses hard-coded border width values\n */\n private readonly _generateStyle = (state: ITouchableWin32State): ViewStyle => {\n const finalStyle: ViewStyle = {\n borderWidth: state.isFocused ? 5 : 0,\n borderColor: 'red',\n };\n return Object.assign({}, this.props.style, finalStyle);\n };\n}\n\ninterface ITouchableWin32HighlightProps extends Omit <IViewWin32Props, 'children'> {\n delayLongPress?: number;\n delayLongPressIn?: number;\n delayPressOut?: number;\n onPress?: (e: IPressEvent) => void;\n onPressIn?: (e: IPressEvent) => void;\n onPressOut?: (e: IPressEvent) => void;\n onLongPress?: (e: IPressEvent) => void;\n onKeyPress?: (e: IKeyboardEvent) => void;\n onKeyPressDown?: (e: IKeyboardEvent) => void;\n pressRetentionOffset?: Insets;\n rejectResponderTermination?: boolean;\n underlayColor?: string;\n children?: IRenderChild<ITouchableWin32State>;\n}\n\ninterface ITouchableWin32HighlightComponentProps extends ITouchableWin32HighlightProps {\n // Used as an imperative handle to the TouchableWin32 interface - primarily for focus()\n innerRef?: React.Ref<TouchableWin32>;\n}\n\n/**\n * Example implementation of TouchableHighlight - not meant for use outside these examples\n * The main difference between a full TouchableHighlight implementation and this example is that\n * TouchableHighlight should manipulate the opacity of the wrapped view to display the underlay color.\n * This example merely uses hard coded color values to distinguish between different control states\n */\nclass TouchableWin32HighlightComponent extends React.Component<ITouchableWin32HighlightComponentProps, {}> {\n\n public render() {\n return (\n <TouchableWin32\n focusable\n rejectResponderTermination={this.props.rejectResponderTermination}\n disabled={false}\n touchableHandleActivePressIn={this._touchableHandleActivePressIn}\n touchableHandleActivePressOut={this._touchableHandleActivePressOut}\n touchableHandlePress={this._touchableHandlePress}\n touchableHandleLongPress={this._touchableHandleLongPress}\n touchableGetHighlightDelayMS={this._touchableGetHighlightDelayMS}\n touchableGetPressRectOffset={this._touchableGetPressRectOffset}\n touchableGetLongPressDelayMS={this._touchableGetLongPressDelayMS}\n touchableGetPressOutDelayMS={this._touchableGetPressOutDelayMS}\n touchableGetHitSlop={this._touchableGetHitSlop}\n touchableHandleKeyPress={this._touchableHandleKeyPress}\n touchableHandleKeyPressDown={this._touchableHandleKeyPressDown}\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n onMouseEnter={this._mouseEnter}\n onMouseLeave={this._mouseLeave}\n renderStyle={this._generateStyle}\n children={this.props.children}\n ref={this.props.innerRef}\n />\n );\n }\n\n private readonly _touchableHandlePress = (e: IPressEvent) => {\n this.props.onPress && this.props.onPress(e);\n this.setState({ isPressed: false });\n };\n private readonly _touchableHandleActivePressIn = (e: IPressEvent) => {\n this.props.onPressIn && this.props.onPressIn(e);\n this.setState({ isPressed: true });\n };\n private readonly _touchableHandleActivePressOut = (e: IPressEvent) => {\n this.props.onPressOut && this.props.onPressOut(e);\n this.setState({ isPressed: false });\n };\n private readonly _touchableHandleLongPress = (e: IPressEvent) => {\n this.props.onLongPress && this.props.onLongPress(e);\n };\n private readonly _touchableGetPressRectOffset = (): Insets => {\n return this.props.pressRetentionOffset || PRESS_RETENTION_OFFSET;\n };\n private readonly _touchableGetHitSlop = (): Insets => {\n return { left: 100, right: 100, top: 100, bottom: 100 };\n };\n private readonly _touchableGetHighlightDelayMS = (): number => {\n return this.props.delayLongPressIn || 0;\n };\n private readonly _touchableGetLongPressDelayMS = (): number => {\n return this.props.delayLongPress || 500;\n };\n private readonly _touchableGetPressOutDelayMS = (): number => {\n return this.props.delayPressOut || 0;\n };\n private readonly _touchableHandleKeyPress = (ev: IKeyboardEvent) => {\n this.props.onKeyPress && this.props.onKeyPress(ev);\n }\n private readonly _touchableHandleKeyPressDown = (ev: IKeyboardEvent) => {\n this.props.onKeyPressDown && this.props.onKeyPressDown(ev);\n }\n private readonly _mouseEnter = (mouseEvent): void => {\n this.props.onMouseEnter && this.props.onMouseEnter(mouseEvent);\n this.setState({ isMouseIn: true });\n };\n private readonly _mouseLeave = (mouseEvent): void => {\n this.props.onMouseLeave && this.props.onMouseLeave(mouseEvent);\n this.setState({ isMouseIn: false });\n };\n private readonly _onFocus = (ev: NativeSyntheticEvent<{}>): void => {\n this.props.onFocus && this.props.onFocus(ev);\n this.setState({ isFocused: true });\n };\n private readonly _onBlur = (ev: NativeSyntheticEvent<{}>): void => {\n this.props.onBlur && this.props.onBlur(ev);\n this.setState({ isFocused: false });\n };\n\n /**\n * The generated style uses hard-coded color values,\n * though it is trivial to pass these values as props.\n * This is an example of a render style (one that is a\n * function passed on to TouchableWin32 and resolved according\n * to the internal state of TouchableWin32).\n */\n private readonly _generateStyle = (state: ITouchableWin32State): ViewStyle => {\n const finalStyle: ViewStyle = {};\n finalStyle.borderColor = state.isFocused ? 'red' : 'blue';\n finalStyle.borderWidth = state.isFocused ? 10 : 5;\n if (state.isHovered) {\n if (state.isPressed) {\n finalStyle.backgroundColor = 'black';\n } else {\n finalStyle.backgroundColor = 'gray';\n }\n } else {\n if (state.isPressed) {\n finalStyle.backgroundColor = 'green';\n } else {\n finalStyle.backgroundColor = 'white';\n }\n }\n return Object.assign({}, this.props.style, finalStyle);\n };\n}\n\n// Demonstrating ref forwarding - forwarding a ref using an innerRef prop on a class component\nconst TouchableWin32Highlight = React.forwardRef<TouchableWin32, ITouchableWin32HighlightProps>(\n (props, ref) => {\n return (\n <TouchableWin32HighlightComponent innerRef={ref} {...props} />\n );\n }\n);\n\n/**\n * Both examples merely track number of presses\n */\ninterface IExampleState {\n numberOfPresses: number;\n}\n\n/**\n * TouchableHighlightExamples\n */\nclass TouchableWithoutFeedbackExample extends React.Component<{}, IExampleState> {\n constructor(props) {\n super(props);\n this.state = { numberOfPresses: 0 };\n }\n\n public render() {\n return (\n <ViewWin32 style={styles.largeContainer}>\n <TouchableWin32WithoutFeedback style={styles.outerTouch} onPress={this._onPress}>\n <ViewWin32>\n <Text>Press me</Text>\n </ViewWin32>\n </TouchableWin32WithoutFeedback>\n\n <TouchableWin32WithoutFeedback style={styles.outerTouch} onPress={this._onPress}>\n <ViewWin32 style={styles.smallContainer}>\n <TouchableWin32WithoutFeedback style={styles.innerTouch} onPress={this._onPress}>\n <ViewWin32>\n <Text>You can also have nested Touchables</Text>\n </ViewWin32>\n </TouchableWin32WithoutFeedback>\n </ViewWin32>\n </TouchableWin32WithoutFeedback>\n <Text>{'Number of Recognized Presses: ' + this.state.numberOfPresses}</Text>\n </ViewWin32>\n );\n }\n\n private readonly _onPress = () => {\n this.setState({ numberOfPresses: this.state.numberOfPresses + 1 });\n };\n}\n\n/**\n * TouchableHighlightExamples\n */\nclass TouchableHighlightExample extends React.Component<{}, IExampleState> {\n constructor(props) {\n super(props);\n this.state = { numberOfPresses: 0 };\n }\n\n public render() {\n return (\n <ViewWin32 style={styles.largeContainer}>\n <TouchableWin32Highlight style={styles.outerTouch} onPress={this._onPress}>\n <ViewWin32>\n <Text>Press me</Text>\n </ViewWin32>\n </TouchableWin32Highlight>\n\n <TouchableWin32Highlight style={styles.outerTouch} onPress={this._onPress}>\n <ViewWin32 style={styles.smallContainer}>\n <TouchableWin32Highlight style={styles.innerTouch} onPress={this._onPress} children={this._getChildrenOfInnerTouchable} />\n </ViewWin32>\n </TouchableWin32Highlight>\n <Text style={{ color: 'red' }} textStyle=\"None\">\n {'Number of Recognized Presses: ' + this.state.numberOfPresses}\n </Text>\n </ViewWin32>\n );\n }\n\n /**\n * This is primarily to demonstrate render children as a function\n * of state, here we change text color depending on interaction state.\n */\n private readonly _getChildrenOfInnerTouchable = (state: ITouchableWin32State) => {\n return (\n <ViewWin32\n style={{\n borderColor: state.isFocused ? 'green' : 'pink',\n borderWidth: state.isHovered ? 10 : 5,\n height: 70,\n width: 70,\n }}\n >\n <Text\n style={{\n color: this._pickColor(state.isHovered, state.isPressed),\n fontSize: state.isFocused ? 8 : 10,\n }}\n textStyle=\"None\"\n >\n Press Me!\n </Text>\n </ViewWin32>\n );\n };\n\n private _pickColor(hovered: boolean, pressed: boolean) {\n if (hovered) {\n if (pressed) {\n return 'white';\n } else {\n return 'red';\n }\n } else {\n if (pressed) {\n return 'purple';\n } else {\n return 'black';\n }\n }\n }\n\n private readonly _onPress = () => {\n this.setState({ numberOfPresses: this.state.numberOfPresses + 1 });\n };\n}\n\nconst TouchableFocusExample = () => {\n const [focused, setFocused] = React.useState(false);\n const focusableRef = React.useRef<TouchableWin32>(null);\n\n // onPress callback\n const focusOnPress = React.useCallback(() => {\n focusableRef.current && focusableRef.current.focus();\n focused || setFocused(true);\n }, [focused]);\n\n // onFocus and onBlur callbacks\n const onFocus = React.useCallback(() => {\n setFocused(true);\n }, []);\n const onBlur = React.useCallback(() => {\n setFocused(false);\n }, []);\n\n return (\n <ViewWin32 style={styles.largeContainer}>\n <TouchableWin32Highlight onPress={focusOnPress}>\n <Text>Press me to focus my friend</Text>\n </TouchableWin32Highlight>\n\n <TouchableWin32Highlight\n ref={focusableRef}\n onFocus={onFocus}\n onBlur={onBlur}\n >\n <Text>{'Focused: ' + focused}</Text>\n </TouchableWin32Highlight>\n </ViewWin32>\n );\n}\n\nexport const displayName = 'TouchableWin32 Examples';\nexport const title = 'TouchableWin32';\nexport const description = 'Demonstration of touchable + focus + hover behavior all in one component';\n\nexport const examples = [\n {\n title: 'TouchableWithoutFeedback Example',\n description: 'A simple example implementation of without feedback behavior',\n render(): JSX.Element {\n return <TouchableWithoutFeedbackExample />;\n },\n },\n {\n title: 'TouchableHighlight Example',\n description: 'A simple example implementation of highlight behavior',\n render(): JSX.Element {\n return <TouchableHighlightExample />;\n },\n },\n {\n title: 'Imperative Focus on TouchableWin32 Example',\n description: 'A simple example implementation of imperative focus behavior',\n render(): JSX.Element {\n return <TouchableFocusExample />;\n },\n }\n];\n"]}
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType';
|
|
12
12
|
import type {ColorValue} from '../../StyleSheet/StyleSheet';
|
|
13
13
|
import type {PressEvent} from '../../Types/CoreEventTypes';
|
|
14
|
-
import type {TouchableType} from './Touchable.flow';
|
|
15
14
|
|
|
16
15
|
import {PressabilityDebugView} from '../../Pressability/PressabilityDebug';
|
|
17
16
|
import UIManager from '../../ReactNative/UIManager';
|
|
@@ -947,7 +946,7 @@ const {
|
|
|
947
946
|
TouchableMixin.withoutDefaultFocusAndBlur =
|
|
948
947
|
TouchableMixinWithoutDefaultFocusAndBlur;
|
|
949
948
|
|
|
950
|
-
const Touchable
|
|
949
|
+
const Touchable = {
|
|
951
950
|
Mixin: TouchableMixin,
|
|
952
951
|
/**
|
|
953
952
|
* Renders a debugging overlay to visualize touch target with hitSlop (might not work on Android).
|
|
@@ -967,4 +966,4 @@ const Touchable: TouchableType = {
|
|
|
967
966
|
},
|
|
968
967
|
};
|
|
969
968
|
|
|
970
|
-
|
|
969
|
+
export default Touchable;
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType';
|
|
12
12
|
import type {ColorValue} from '../../StyleSheet/StyleSheet';
|
|
13
13
|
import type {PressEvent} from '../../Types/CoreEventTypes';
|
|
14
|
-
import type {TouchableType} from './Touchable.flow';
|
|
15
14
|
|
|
16
15
|
import {PressabilityDebugView} from '../../Pressability/PressabilityDebug';
|
|
17
16
|
import UIManager from '../../ReactNative/UIManager';
|
|
@@ -952,7 +951,7 @@ const {
|
|
|
952
951
|
TouchableMixin.withoutDefaultFocusAndBlur =
|
|
953
952
|
TouchableMixinWithoutDefaultFocusAndBlur;
|
|
954
953
|
|
|
955
|
-
const Touchable
|
|
954
|
+
const Touchable = {
|
|
956
955
|
Mixin: TouchableMixin,
|
|
957
956
|
/**
|
|
958
957
|
* Renders a debugging overlay to visualize touch target with hitSlop (might not work on Android).
|
|
@@ -972,4 +971,4 @@ const Touchable: TouchableType = {
|
|
|
972
971
|
},
|
|
973
972
|
};
|
|
974
973
|
|
|
975
|
-
|
|
974
|
+
export default Touchable;
|
|
@@ -379,12 +379,12 @@ class TouchableHighlight extends React.Component<Props, State> {
|
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
381
|
|
|
382
|
-
const Touchable
|
|
383
|
-
<TouchableHighlight {...props} hostRef={hostRef} />
|
|
384
|
-
)): React.AbstractComponent<
|
|
382
|
+
const Touchable: React.AbstractComponent<
|
|
385
383
|
$ReadOnly<$Diff<Props, {|hostRef: React.Ref<typeof View>|}>>,
|
|
386
384
|
React.ElementRef<typeof View>,
|
|
387
|
-
>)
|
|
385
|
+
> = React.forwardRef((props, hostRef) => (
|
|
386
|
+
<TouchableHighlight {...props} hostRef={hostRef} />
|
|
387
|
+
));
|
|
388
388
|
|
|
389
389
|
Touchable.displayName = 'TouchableHighlight';
|
|
390
390
|
|
|
@@ -146,6 +146,7 @@ class TouchableNativeFeedback extends React.Component<Props, State> {
|
|
|
146
146
|
);
|
|
147
147
|
return {
|
|
148
148
|
type: 'RippleAndroid',
|
|
149
|
+
// $FlowFixMe[incompatible-type]
|
|
149
150
|
color: processedColor,
|
|
150
151
|
borderless,
|
|
151
152
|
rippleRadius,
|
|
@@ -156,7 +157,7 @@ class TouchableNativeFeedback extends React.Component<Props, State> {
|
|
|
156
157
|
* Whether `useForeground` is supported.
|
|
157
158
|
*/
|
|
158
159
|
static canUseNativeForeground: () => boolean = () =>
|
|
159
|
-
Platform.OS === 'android'
|
|
160
|
+
Platform.OS === 'android';
|
|
160
161
|
|
|
161
162
|
state: State = {
|
|
162
163
|
pressability: new Pressability(this._createPressabilityConfig()),
|
|
@@ -323,9 +323,12 @@ class TouchableOpacity extends React.Component<Props, State> {
|
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
|
|
326
|
-
const Touchable
|
|
326
|
+
const Touchable: React.AbstractComponent<
|
|
327
|
+
Props,
|
|
328
|
+
React.ElementRef<typeof Animated.View>,
|
|
329
|
+
> = React.forwardRef((props, ref) => (
|
|
327
330
|
<TouchableOpacity {...props} hostRef={ref} />
|
|
328
|
-
))
|
|
331
|
+
));
|
|
329
332
|
|
|
330
333
|
Touchable.displayName = 'TouchableOpacity';
|
|
331
334
|
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { ViewStyle } from 'react-native';
|
|
2
|
-
import { Insets } from 'react-native/types/public/Insets';
|
|
3
|
-
import { IPressEvent, IRenderChild, IRenderStyle } from './TouchableWin32.Types';
|
|
4
|
-
import { IViewWin32Props, IKeyboardEvent } from '../View/ViewPropTypes';
|
|
5
|
-
export interface ITouchableWin32State {
|
|
6
|
-
isPressed: boolean;
|
|
7
|
-
isFocused: boolean;
|
|
8
|
-
isHovered: boolean;
|
|
9
|
-
}
|
|
10
|
-
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
11
|
-
export interface ITouchableWin32Props extends Omit<IViewWin32Props, 'children'> {
|
|
12
|
-
rejectResponderTermination?: boolean;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
touchableHandleActivePressIn?: (e: IPressEvent) => void;
|
|
15
|
-
touchableHandleActivePressOut?: (e: IPressEvent) => void;
|
|
16
|
-
touchableHandlePress?: (e: IPressEvent) => void;
|
|
17
|
-
touchableHandleKeyPress?: (e: IKeyboardEvent) => void;
|
|
18
|
-
touchableHandleKeyPressDown?: (e: IKeyboardEvent) => void;
|
|
19
|
-
touchableHandleLongPress?: (e: IPressEvent) => void;
|
|
20
|
-
touchableGetHighlightDelayMS?: () => number;
|
|
21
|
-
touchableGetPressRectOffset?: () => Insets;
|
|
22
|
-
touchableGetLongPressDelayMS?: () => number;
|
|
23
|
-
touchableGetPressOutDelayMS?: () => number;
|
|
24
|
-
touchableGetHitSlop?: () => Insets;
|
|
25
|
-
touchSoundDisabled?: boolean;
|
|
26
|
-
onLongPress?: () => void;
|
|
27
|
-
children?: IRenderChild<ITouchableWin32State>;
|
|
28
|
-
renderStyle?: IRenderStyle<ITouchableWin32State, ViewStyle>;
|
|
29
|
-
/**
|
|
30
|
-
* Filters keys for touchableHandleKeyPress / touchableHandleKeyPressDown events.
|
|
31
|
-
* Space and Enter keys result in touchableHandleKeyPress(Down) in the event
|
|
32
|
-
* that no filterKeys function is provided as a callback. All keyboard events
|
|
33
|
-
* will result in onKeyUp and onKeyDown getting fired regardless of filterKeys.
|
|
34
|
-
*/
|
|
35
|
-
filterKeys?: (str: string) => boolean;
|
|
36
|
-
}
|
|
37
|
-
export {};
|
|
1
|
+
import { ViewStyle } from 'react-native';
|
|
2
|
+
import { Insets } from 'react-native/types/public/Insets';
|
|
3
|
+
import { IPressEvent, IRenderChild, IRenderStyle } from './TouchableWin32.Types';
|
|
4
|
+
import { IViewWin32Props, IKeyboardEvent } from '../View/ViewPropTypes';
|
|
5
|
+
export interface ITouchableWin32State {
|
|
6
|
+
isPressed: boolean;
|
|
7
|
+
isFocused: boolean;
|
|
8
|
+
isHovered: boolean;
|
|
9
|
+
}
|
|
10
|
+
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
11
|
+
export interface ITouchableWin32Props extends Omit<IViewWin32Props, 'children'> {
|
|
12
|
+
rejectResponderTermination?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
touchableHandleActivePressIn?: (e: IPressEvent) => void;
|
|
15
|
+
touchableHandleActivePressOut?: (e: IPressEvent) => void;
|
|
16
|
+
touchableHandlePress?: (e: IPressEvent) => void;
|
|
17
|
+
touchableHandleKeyPress?: (e: IKeyboardEvent) => void;
|
|
18
|
+
touchableHandleKeyPressDown?: (e: IKeyboardEvent) => void;
|
|
19
|
+
touchableHandleLongPress?: (e: IPressEvent) => void;
|
|
20
|
+
touchableGetHighlightDelayMS?: () => number;
|
|
21
|
+
touchableGetPressRectOffset?: () => Insets;
|
|
22
|
+
touchableGetLongPressDelayMS?: () => number;
|
|
23
|
+
touchableGetPressOutDelayMS?: () => number;
|
|
24
|
+
touchableGetHitSlop?: () => Insets;
|
|
25
|
+
touchSoundDisabled?: boolean;
|
|
26
|
+
onLongPress?: () => void;
|
|
27
|
+
children?: IRenderChild<ITouchableWin32State>;
|
|
28
|
+
renderStyle?: IRenderStyle<ITouchableWin32State, ViewStyle>;
|
|
29
|
+
/**
|
|
30
|
+
* Filters keys for touchableHandleKeyPress / touchableHandleKeyPressDown events.
|
|
31
|
+
* Space and Enter keys result in touchableHandleKeyPress(Down) in the event
|
|
32
|
+
* that no filterKeys function is provided as a callback. All keyboard events
|
|
33
|
+
* will result in onKeyUp and onKeyDown getting fired regardless of filterKeys.
|
|
34
|
+
*/
|
|
35
|
+
filterKeys?: (str: string) => boolean;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=TouchableWin32.Props.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TouchableWin32.Props.js","sourceRoot":"","sources":["../../../src/Libraries/Components/Touchable/TouchableWin32.Props.tsx"],"names":[],"mappings":"","sourcesContent":["import {ViewStyle} from 'react-native';\nimport {Insets} from 'react-native/types/public/Insets';\n\nimport { IPressEvent, IRenderChild, IRenderStyle } from './TouchableWin32.Types';\nimport { IViewWin32Props, IKeyboardEvent } from '../View/ViewPropTypes';\n\nexport interface ITouchableWin32State {\n isPressed: boolean;\n isFocused: boolean;\n isHovered: boolean;\n}\n\ntype Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>\n\nexport interface ITouchableWin32Props extends Omit <IViewWin32Props, 'children'> {\n rejectResponderTermination?: boolean;\n disabled?: boolean;\n touchableHandleActivePressIn?: (e: IPressEvent) => void;\n touchableHandleActivePressOut?: (e: IPressEvent) => void;\n touchableHandlePress?: (e: IPressEvent) => void;\n touchableHandleKeyPress?: (e: IKeyboardEvent) => void;\n touchableHandleKeyPressDown?: (e: IKeyboardEvent) => void;\n touchableHandleLongPress?: (e: IPressEvent) => void;\n touchableGetHighlightDelayMS?: () => number;\n touchableGetPressRectOffset?: () => Insets;\n touchableGetLongPressDelayMS?: () => number;\n touchableGetPressOutDelayMS?: () => number;\n touchableGetHitSlop?: () => Insets;\n touchSoundDisabled?: boolean;\n onLongPress?: () => void;\n children?: IRenderChild<ITouchableWin32State>;\n // Typescript will not allow an extension of the IView* interface\n // that allows style to take on a function value. This is not a problem\n // with children, presumably because function components are valid as children.\n // As such, a renderStyle prop that takes a function value is provided\n // instead, in conjunction with the base style prop (StyleProp<ViewStyle>).\n // The style prop will only be used if a renderStyle is not provided.\n renderStyle?: IRenderStyle<ITouchableWin32State, ViewStyle>;\n /**\n * Filters keys for touchableHandleKeyPress / touchableHandleKeyPressDown events.\n * Space and Enter keys result in touchableHandleKeyPress(Down) in the event\n * that no filterKeys function is provided as a callback. All keyboard events\n * will result in onKeyUp and onKeyDown getting fired regardless of filterKeys.\n */\n filterKeys?: (str: string) => boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TouchableWin32.Props.js","sourceRoot":"","sources":["../../../src-win/Libraries/Components/Touchable/TouchableWin32.Props.tsx"],"names":[],"mappings":"","sourcesContent":["import {ViewStyle} from 'react-native';\nimport {Insets} from 'react-native/types/public/Insets';\n\nimport { IPressEvent, IRenderChild, IRenderStyle } from './TouchableWin32.Types';\nimport { IViewWin32Props, IKeyboardEvent } from '../View/ViewPropTypes';\n\nexport interface ITouchableWin32State {\n isPressed: boolean;\n isFocused: boolean;\n isHovered: boolean;\n}\n\ntype Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>\n\nexport interface ITouchableWin32Props extends Omit <IViewWin32Props, 'children'> {\n rejectResponderTermination?: boolean;\n disabled?: boolean;\n touchableHandleActivePressIn?: (e: IPressEvent) => void;\n touchableHandleActivePressOut?: (e: IPressEvent) => void;\n touchableHandlePress?: (e: IPressEvent) => void;\n touchableHandleKeyPress?: (e: IKeyboardEvent) => void;\n touchableHandleKeyPressDown?: (e: IKeyboardEvent) => void;\n touchableHandleLongPress?: (e: IPressEvent) => void;\n touchableGetHighlightDelayMS?: () => number;\n touchableGetPressRectOffset?: () => Insets;\n touchableGetLongPressDelayMS?: () => number;\n touchableGetPressOutDelayMS?: () => number;\n touchableGetHitSlop?: () => Insets;\n touchSoundDisabled?: boolean;\n onLongPress?: () => void;\n children?: IRenderChild<ITouchableWin32State>;\n // Typescript will not allow an extension of the IView* interface\n // that allows style to take on a function value. This is not a problem\n // with children, presumably because function components are valid as children.\n // As such, a renderStyle prop that takes a function value is provided\n // instead, in conjunction with the base style prop (StyleProp<ViewStyle>).\n // The style prop will only be used if a renderStyle is not provided.\n renderStyle?: IRenderStyle<ITouchableWin32State, ViewStyle>;\n /**\n * Filters keys for touchableHandleKeyPress / touchableHandleKeyPressDown events.\n * Space and Enter keys result in touchableHandleKeyPress(Down) in the event\n * that no filterKeys function is provided as a callback. All keyboard events\n * will result in onKeyUp and onKeyDown getting fired regardless of filterKeys.\n */\n filterKeys?: (str: string) => boolean;\n}\n"]}
|
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { GestureResponderEvent, StyleProp, NativeSyntheticEvent } from 'react-native';
|
|
3
|
-
/**
|
|
4
|
-
* Gesture responder states
|
|
5
|
-
*/
|
|
6
|
-
export type IState = 'NOT_RESPONDER' | 'RESPONDER_INACTIVE_PRESS_IN' | 'RESPONDER_INACTIVE_PRESS_OUT' | 'RESPONDER_ACTIVE_PRESS_IN' | 'RESPONDER_ACTIVE_PRESS_OUT' | 'RESPONDER_ACTIVE_LONG_PRESS_IN' | 'RESPONDER_ACTIVE_LONG_PRESS_OUT' | 'ERROR';
|
|
7
|
-
/**
|
|
8
|
-
* Signals into the gesture responder system
|
|
9
|
-
*/
|
|
10
|
-
export type ISignal = 'DELAY' | 'RESPONDER_GRANT' | 'RESPONDER_RELEASE' | 'RESPONDER_TERMINATED' | 'ENTER_PRESS_RECT' | 'LEAVE_PRESS_RECT' | 'LONG_PRESS_DETECTED';
|
|
11
|
-
type ISignalTransitions = {
|
|
12
|
-
[P in ISignal]: IState;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Map of State to [Signal to State],
|
|
16
|
-
* describing state transition maps
|
|
17
|
-
*/
|
|
18
|
-
export type ITransitions = {
|
|
19
|
-
[P in IState]: ISignalTransitions;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Describes lookup maps of states meeting
|
|
23
|
-
* some specified criteria
|
|
24
|
-
*/
|
|
25
|
-
export type IStateConditions = {
|
|
26
|
-
[P in IState]: boolean;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Describes the position at which an event occurred
|
|
30
|
-
*/
|
|
31
|
-
export interface IPosition {
|
|
32
|
-
left: number;
|
|
33
|
-
top: number;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Describes the height and width of a control
|
|
37
|
-
*/
|
|
38
|
-
export interface IDimensions {
|
|
39
|
-
width: number;
|
|
40
|
-
height: number;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Describes a touch
|
|
44
|
-
*/
|
|
45
|
-
export interface ITouchInfo {
|
|
46
|
-
touchActive: boolean;
|
|
47
|
-
startPageX: number;
|
|
48
|
-
startPageY: number;
|
|
49
|
-
startTimeStamp: number;
|
|
50
|
-
currentPageX: number;
|
|
51
|
-
currentPageY: number;
|
|
52
|
-
currentTimeStamp: number;
|
|
53
|
-
previousPageX: number;
|
|
54
|
-
previousPageY: number;
|
|
55
|
-
previousTimeStamp: number;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* More fully defines an event by augmenting touchHistory
|
|
59
|
-
*/
|
|
60
|
-
export interface IResponderSyntheticEvent<T> extends NativeSyntheticEvent<T> {
|
|
61
|
-
touchHistory: {
|
|
62
|
-
indexOfSingleActiveTouch: number;
|
|
63
|
-
mostRecentTimeStamp: number;
|
|
64
|
-
numberActiveTouches: number;
|
|
65
|
-
touchBank: ITouchInfo[];
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* This encompasses all information used by TouchableWin32 based controls
|
|
70
|
-
* during callbacks and in response to press events
|
|
71
|
-
*/
|
|
72
|
-
export type IPressEvent = IResponderSyntheticEvent<{
|
|
73
|
-
changedTouches: IPressEvent[];
|
|
74
|
-
force: number;
|
|
75
|
-
identifier: number;
|
|
76
|
-
locationX: number;
|
|
77
|
-
locationY: number;
|
|
78
|
-
pageX: number;
|
|
79
|
-
pageY: number;
|
|
80
|
-
target?: number;
|
|
81
|
-
timestamp: number;
|
|
82
|
-
touches: IPressEvent[];
|
|
83
|
-
}> & GestureResponderEvent;
|
|
84
|
-
/**
|
|
85
|
-
* Describes both the global and relative position of a press
|
|
86
|
-
*/
|
|
87
|
-
export interface IPressInLocation {
|
|
88
|
-
pageX: number;
|
|
89
|
-
pageY: number;
|
|
90
|
-
locationX: number;
|
|
91
|
-
locationY: number;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Used by IRenderChild, it simply describes a function that takes
|
|
95
|
-
* some generic state type T and returns a ReactNode
|
|
96
|
-
*/
|
|
97
|
-
export type IChildAsFunction<T> = (state: T) => React.ReactNode;
|
|
98
|
-
/**
|
|
99
|
-
* An IRenderChild describes children as a function that take the current
|
|
100
|
-
* state of the parent component. It is up to the parent to invoke the function
|
|
101
|
-
* and make proper use of the more typical ReactNode object that is returned
|
|
102
|
-
* This is an especially helpful construct when children of a Touchable require
|
|
103
|
-
* knowledge of the interaction state of their parent to properly render themselves
|
|
104
|
-
* (e.g. foreground color of a text child)
|
|
105
|
-
*/
|
|
106
|
-
export type IRenderChild<T> = IChildAsFunction<T> | React.ReactNode;
|
|
107
|
-
/**
|
|
108
|
-
* An IRenderStyle describes style as a function that takes the current
|
|
109
|
-
* state of the parent component. It is up to the parent to invoke the function
|
|
110
|
-
* and make proper use of the more typical StyleProp<S> object that is returned
|
|
111
|
-
* This is convenient for when styles need to be calculated depending on interaction states.
|
|
112
|
-
*/
|
|
113
|
-
export type IRenderStyle<T, S> = (state: T) => StyleProp<S>;
|
|
114
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GestureResponderEvent, StyleProp, NativeSyntheticEvent } from 'react-native';
|
|
3
|
+
/**
|
|
4
|
+
* Gesture responder states
|
|
5
|
+
*/
|
|
6
|
+
export type IState = 'NOT_RESPONDER' | 'RESPONDER_INACTIVE_PRESS_IN' | 'RESPONDER_INACTIVE_PRESS_OUT' | 'RESPONDER_ACTIVE_PRESS_IN' | 'RESPONDER_ACTIVE_PRESS_OUT' | 'RESPONDER_ACTIVE_LONG_PRESS_IN' | 'RESPONDER_ACTIVE_LONG_PRESS_OUT' | 'ERROR';
|
|
7
|
+
/**
|
|
8
|
+
* Signals into the gesture responder system
|
|
9
|
+
*/
|
|
10
|
+
export type ISignal = 'DELAY' | 'RESPONDER_GRANT' | 'RESPONDER_RELEASE' | 'RESPONDER_TERMINATED' | 'ENTER_PRESS_RECT' | 'LEAVE_PRESS_RECT' | 'LONG_PRESS_DETECTED';
|
|
11
|
+
type ISignalTransitions = {
|
|
12
|
+
[P in ISignal]: IState;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Map of State to [Signal to State],
|
|
16
|
+
* describing state transition maps
|
|
17
|
+
*/
|
|
18
|
+
export type ITransitions = {
|
|
19
|
+
[P in IState]: ISignalTransitions;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Describes lookup maps of states meeting
|
|
23
|
+
* some specified criteria
|
|
24
|
+
*/
|
|
25
|
+
export type IStateConditions = {
|
|
26
|
+
[P in IState]: boolean;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Describes the position at which an event occurred
|
|
30
|
+
*/
|
|
31
|
+
export interface IPosition {
|
|
32
|
+
left: number;
|
|
33
|
+
top: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Describes the height and width of a control
|
|
37
|
+
*/
|
|
38
|
+
export interface IDimensions {
|
|
39
|
+
width: number;
|
|
40
|
+
height: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Describes a touch
|
|
44
|
+
*/
|
|
45
|
+
export interface ITouchInfo {
|
|
46
|
+
touchActive: boolean;
|
|
47
|
+
startPageX: number;
|
|
48
|
+
startPageY: number;
|
|
49
|
+
startTimeStamp: number;
|
|
50
|
+
currentPageX: number;
|
|
51
|
+
currentPageY: number;
|
|
52
|
+
currentTimeStamp: number;
|
|
53
|
+
previousPageX: number;
|
|
54
|
+
previousPageY: number;
|
|
55
|
+
previousTimeStamp: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* More fully defines an event by augmenting touchHistory
|
|
59
|
+
*/
|
|
60
|
+
export interface IResponderSyntheticEvent<T> extends NativeSyntheticEvent<T> {
|
|
61
|
+
touchHistory: {
|
|
62
|
+
indexOfSingleActiveTouch: number;
|
|
63
|
+
mostRecentTimeStamp: number;
|
|
64
|
+
numberActiveTouches: number;
|
|
65
|
+
touchBank: ITouchInfo[];
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* This encompasses all information used by TouchableWin32 based controls
|
|
70
|
+
* during callbacks and in response to press events
|
|
71
|
+
*/
|
|
72
|
+
export type IPressEvent = IResponderSyntheticEvent<{
|
|
73
|
+
changedTouches: IPressEvent[];
|
|
74
|
+
force: number;
|
|
75
|
+
identifier: number;
|
|
76
|
+
locationX: number;
|
|
77
|
+
locationY: number;
|
|
78
|
+
pageX: number;
|
|
79
|
+
pageY: number;
|
|
80
|
+
target?: number;
|
|
81
|
+
timestamp: number;
|
|
82
|
+
touches: IPressEvent[];
|
|
83
|
+
}> & GestureResponderEvent;
|
|
84
|
+
/**
|
|
85
|
+
* Describes both the global and relative position of a press
|
|
86
|
+
*/
|
|
87
|
+
export interface IPressInLocation {
|
|
88
|
+
pageX: number;
|
|
89
|
+
pageY: number;
|
|
90
|
+
locationX: number;
|
|
91
|
+
locationY: number;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Used by IRenderChild, it simply describes a function that takes
|
|
95
|
+
* some generic state type T and returns a ReactNode
|
|
96
|
+
*/
|
|
97
|
+
export type IChildAsFunction<T> = (state: T) => React.ReactNode;
|
|
98
|
+
/**
|
|
99
|
+
* An IRenderChild describes children as a function that take the current
|
|
100
|
+
* state of the parent component. It is up to the parent to invoke the function
|
|
101
|
+
* and make proper use of the more typical ReactNode object that is returned
|
|
102
|
+
* This is an especially helpful construct when children of a Touchable require
|
|
103
|
+
* knowledge of the interaction state of their parent to properly render themselves
|
|
104
|
+
* (e.g. foreground color of a text child)
|
|
105
|
+
*/
|
|
106
|
+
export type IRenderChild<T> = IChildAsFunction<T> | React.ReactNode;
|
|
107
|
+
/**
|
|
108
|
+
* An IRenderStyle describes style as a function that takes the current
|
|
109
|
+
* state of the parent component. It is up to the parent to invoke the function
|
|
110
|
+
* and make proper use of the more typical StyleProp<S> object that is returned
|
|
111
|
+
* This is convenient for when styles need to be calculated depending on interaction states.
|
|
112
|
+
*/
|
|
113
|
+
export type IRenderStyle<T, S> = (state: T) => StyleProp<S>;
|
|
114
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=TouchableWin32.Types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TouchableWin32.Types.js","sourceRoot":"","sources":["../../../src/Libraries/Components/Touchable/TouchableWin32.Types.tsx"],"names":[],"mappings":"","sourcesContent":["import React from 'react'\nimport { GestureResponderEvent, StyleProp, NativeSyntheticEvent } from 'react-native';\n\n/**\n * Gesture responder states\n */\nexport type IState =\n | 'NOT_RESPONDER'\n | 'RESPONDER_INACTIVE_PRESS_IN'\n | 'RESPONDER_INACTIVE_PRESS_OUT'\n | 'RESPONDER_ACTIVE_PRESS_IN'\n | 'RESPONDER_ACTIVE_PRESS_OUT'\n | 'RESPONDER_ACTIVE_LONG_PRESS_IN'\n | 'RESPONDER_ACTIVE_LONG_PRESS_OUT'\n | 'ERROR';\n\n/**\n * Signals into the gesture responder system\n */\nexport type ISignal =\n | 'DELAY'\n | 'RESPONDER_GRANT'\n | 'RESPONDER_RELEASE'\n | 'RESPONDER_TERMINATED'\n | 'ENTER_PRESS_RECT'\n | 'LEAVE_PRESS_RECT'\n | 'LONG_PRESS_DETECTED';\n\ntype ISignalTransitions = { [P in ISignal]: IState };\n\n/**\n * Map of State to [Signal to State],\n * describing state transition maps\n */\nexport type ITransitions = { [P in IState]: ISignalTransitions };\n\n/**\n * Describes lookup maps of states meeting\n * some specified criteria\n */\nexport type IStateConditions = { [P in IState]: boolean };\n\n/**\n * Describes the position at which an event occurred\n */\nexport interface IPosition {\n left: number;\n top: number;\n}\n\n/**\n * Describes the height and width of a control\n */\nexport interface IDimensions {\n width: number;\n height: number;\n}\n\n/**\n * Describes a touch\n */\nexport interface ITouchInfo {\n touchActive: boolean;\n startPageX: number;\n startPageY: number;\n startTimeStamp: number;\n currentPageX: number;\n currentPageY: number;\n currentTimeStamp: number;\n previousPageX: number;\n previousPageY: number;\n previousTimeStamp: number;\n}\n\n/**\n * More fully defines an event by augmenting touchHistory\n */\nexport interface IResponderSyntheticEvent<T> extends NativeSyntheticEvent<T> {\n touchHistory: {\n indexOfSingleActiveTouch: number;\n mostRecentTimeStamp: number;\n numberActiveTouches: number;\n touchBank: ITouchInfo[];\n };\n}\n\n/**\n * This encompasses all information used by TouchableWin32 based controls\n * during callbacks and in response to press events\n */\nexport type IPressEvent = IResponderSyntheticEvent<{\n changedTouches: IPressEvent[];\n force: number;\n identifier: number;\n locationX: number;\n locationY: number;\n pageX: number;\n pageY: number;\n target?: number;\n timestamp: number;\n touches: IPressEvent[];\n}> &\n GestureResponderEvent;\n\n/**\n * Describes both the global and relative position of a press\n */\nexport interface IPressInLocation {\n pageX: number;\n pageY: number;\n locationX: number;\n locationY: number;\n}\n\n/**\n * Used by IRenderChild, it simply describes a function that takes\n * some generic state type T and returns a ReactNode\n */\nexport type IChildAsFunction<T> = (state: T) => React.ReactNode;\n\n/**\n * An IRenderChild describes children as a function that take the current\n * state of the parent component. It is up to the parent to invoke the function\n * and make proper use of the more typical ReactNode object that is returned\n * This is an especially helpful construct when children of a Touchable require\n * knowledge of the interaction state of their parent to properly render themselves\n * (e.g. foreground color of a text child)\n */\nexport type IRenderChild<T> = IChildAsFunction<T> | React.ReactNode;\n\n/**\n * An IRenderStyle describes style as a function that takes the current\n * state of the parent component. It is up to the parent to invoke the function\n * and make proper use of the more typical StyleProp<S> object that is returned\n * This is convenient for when styles need to be calculated depending on interaction states.\n */\nexport type IRenderStyle<T, S> = (state: T) => StyleProp<S>;\n"]}
|
|
1
|
+
{"version":3,"file":"TouchableWin32.Types.js","sourceRoot":"","sources":["../../../src-win/Libraries/Components/Touchable/TouchableWin32.Types.tsx"],"names":[],"mappings":"","sourcesContent":["import React from 'react'\nimport { GestureResponderEvent, StyleProp, NativeSyntheticEvent } from 'react-native';\n\n/**\n * Gesture responder states\n */\nexport type IState =\n | 'NOT_RESPONDER'\n | 'RESPONDER_INACTIVE_PRESS_IN'\n | 'RESPONDER_INACTIVE_PRESS_OUT'\n | 'RESPONDER_ACTIVE_PRESS_IN'\n | 'RESPONDER_ACTIVE_PRESS_OUT'\n | 'RESPONDER_ACTIVE_LONG_PRESS_IN'\n | 'RESPONDER_ACTIVE_LONG_PRESS_OUT'\n | 'ERROR';\n\n/**\n * Signals into the gesture responder system\n */\nexport type ISignal =\n | 'DELAY'\n | 'RESPONDER_GRANT'\n | 'RESPONDER_RELEASE'\n | 'RESPONDER_TERMINATED'\n | 'ENTER_PRESS_RECT'\n | 'LEAVE_PRESS_RECT'\n | 'LONG_PRESS_DETECTED';\n\ntype ISignalTransitions = { [P in ISignal]: IState };\n\n/**\n * Map of State to [Signal to State],\n * describing state transition maps\n */\nexport type ITransitions = { [P in IState]: ISignalTransitions };\n\n/**\n * Describes lookup maps of states meeting\n * some specified criteria\n */\nexport type IStateConditions = { [P in IState]: boolean };\n\n/**\n * Describes the position at which an event occurred\n */\nexport interface IPosition {\n left: number;\n top: number;\n}\n\n/**\n * Describes the height and width of a control\n */\nexport interface IDimensions {\n width: number;\n height: number;\n}\n\n/**\n * Describes a touch\n */\nexport interface ITouchInfo {\n touchActive: boolean;\n startPageX: number;\n startPageY: number;\n startTimeStamp: number;\n currentPageX: number;\n currentPageY: number;\n currentTimeStamp: number;\n previousPageX: number;\n previousPageY: number;\n previousTimeStamp: number;\n}\n\n/**\n * More fully defines an event by augmenting touchHistory\n */\nexport interface IResponderSyntheticEvent<T> extends NativeSyntheticEvent<T> {\n touchHistory: {\n indexOfSingleActiveTouch: number;\n mostRecentTimeStamp: number;\n numberActiveTouches: number;\n touchBank: ITouchInfo[];\n };\n}\n\n/**\n * This encompasses all information used by TouchableWin32 based controls\n * during callbacks and in response to press events\n */\nexport type IPressEvent = IResponderSyntheticEvent<{\n changedTouches: IPressEvent[];\n force: number;\n identifier: number;\n locationX: number;\n locationY: number;\n pageX: number;\n pageY: number;\n target?: number;\n timestamp: number;\n touches: IPressEvent[];\n}> &\n GestureResponderEvent;\n\n/**\n * Describes both the global and relative position of a press\n */\nexport interface IPressInLocation {\n pageX: number;\n pageY: number;\n locationX: number;\n locationY: number;\n}\n\n/**\n * Used by IRenderChild, it simply describes a function that takes\n * some generic state type T and returns a ReactNode\n */\nexport type IChildAsFunction<T> = (state: T) => React.ReactNode;\n\n/**\n * An IRenderChild describes children as a function that take the current\n * state of the parent component. It is up to the parent to invoke the function\n * and make proper use of the more typical ReactNode object that is returned\n * This is an especially helpful construct when children of a Touchable require\n * knowledge of the interaction state of their parent to properly render themselves\n * (e.g. foreground color of a text child)\n */\nexport type IRenderChild<T> = IChildAsFunction<T> | React.ReactNode;\n\n/**\n * An IRenderStyle describes style as a function that takes the current\n * state of the parent component. It is up to the parent to invoke the function\n * and make proper use of the more typical StyleProp<S> object that is returned\n * This is convenient for when styles need to be calculated depending on interaction states.\n */\nexport type IRenderStyle<T, S> = (state: T) => StyleProp<S>;\n"]}
|