react-native-macos 0.0.0-a598ee4ef → 0.0.0-a7b72a012
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/Libraries/Alert/Alert.js +115 -6
- package/Libraries/Alert/NativeAlertManager.js +1 -19
- package/Libraries/Blob/React-RCTBlob.podspec +1 -1
- package/Libraries/Components/ScrollView/ScrollView.js +11 -45
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
- package/Libraries/Components/TextInput/TextInput.js +79 -1
- package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
- package/Libraries/Components/View/ViewPropTypes.js +10 -6
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Image/RCTImageView.mm +14 -10
- package/Libraries/Image/React-RCTImage.podspec +1 -1
- package/Libraries/LinkingIOS/RCTLinkingManager.h +1 -0
- package/Libraries/LinkingIOS/React-RCTLinking.podspec +1 -1
- package/Libraries/LinkingIOS/macos/RCTLinkingManager.mm +12 -5
- package/Libraries/Lists/FlatList.js +25 -2
- package/Libraries/Lists/VirtualizedList.js +118 -113
- package/Libraries/Lists/VirtualizedSectionList.js +9 -5
- package/{ReactCommon/react/renderer/mounting/MountingTransactionMetadata.cpp → Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.h} +6 -4
- package/Libraries/NativeAnimation/Nodes/RCTColorAnimatedNode.m +30 -0
- package/Libraries/NativeAnimation/Nodes/RCTPropsAnimatedNode.m +11 -6
- package/Libraries/NativeAnimation/Nodes/RCTStyleAnimatedNode.m +8 -4
- package/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.m +2 -0
- package/Libraries/NativeAnimation/React-RCTAnimation.podspec +2 -2
- package/Libraries/Network/React-RCTNetwork.podspec +1 -1
- package/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +1 -1
- package/Libraries/Settings/React-RCTSettings.podspec +1 -1
- package/Libraries/Text/BaseText/RCTBaseTextViewManager.m +8 -0
- package/Libraries/Text/RCTTextAttributes.h +11 -3
- package/Libraries/Text/RCTTextAttributes.m +26 -0
- package/Libraries/Text/Text/RCTDynamicTypeRamp.h +40 -0
- package/Libraries/Text/Text/RCTDynamicTypeRamp.m +77 -0
- package/Libraries/Text/Text/RCTTextView.m +123 -58
- package/Libraries/Text/Text.js +0 -14
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.h +8 -0
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputView.m +57 -2
- package/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.m +13 -0
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.h +2 -1
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.m +69 -2
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +7 -1
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +12 -3
- package/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h +3 -2
- package/Libraries/Text/TextInput/RCTBaseTextInputView.h +4 -1
- package/Libraries/Text/TextInput/RCTBaseTextInputView.m +97 -2
- package/Libraries/Text/TextInput/RCTBaseTextInputViewManager.m +6 -1
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.m +40 -0
- package/Libraries/Text/TextNativeComponent.js +2 -0
- package/Libraries/Text/TextProps.js +29 -0
- package/Libraries/TypeSafety/RCTTypeSafety.podspec +1 -1
- package/Libraries/Types/CoreEventTypes.js +0 -1
- package/Libraries/Vibration/React-RCTVibration.podspec +1 -1
- package/React/Base/RCTAssert.h +30 -15
- package/React/Base/RCTAssert.m +59 -19
- package/React/Base/RCTBridge.m +5 -3
- package/React/Base/RCTConstants.h +6 -0
- package/React/Base/RCTConstants.m +15 -0
- package/React/Base/RCTConvert.m +7 -4
- package/React/Base/RCTEventDispatcherProtocol.h +5 -0
- package/React/Base/RCTTouchHandler.m +4 -0
- package/React/Base/RCTUIKit.h +57 -13
- package/React/Base/RCTUtils.m +6 -3
- package/React/Base/RCTVersion.m +1 -1
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +0 -1
- package/React/Base/macOS/RCTUIKit.m +52 -0
- package/React/CoreModules/RCTAlertManager.mm +1 -1
- package/React/CoreModules/RCTEventDispatcher.mm +6 -1
- package/React/CoreModules/RCTLogBox.h +1 -1
- package/React/CoreModules/RCTLogBox.mm +35 -19
- package/React/CoreModules/RCTLogBoxView.h +8 -5
- package/React/CoreModules/RCTLogBoxView.mm +64 -23
- package/React/CoreModules/RCTPerfMonitor.mm +1 -1
- package/React/CoreModules/React-CoreModules.podspec +1 -1
- package/React/FBReactNativeSpec/FBReactNativeSpec.podspec +1 -1
- package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm +3 -2
- package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm +8 -8
- package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.h +2 -2
- package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryContentView.mm +3 -3
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.h +2 -1
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +75 -25
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.mm +1 -1
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.h +2 -0
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +10 -5
- package/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm +0 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +3 -3
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +4 -4
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +1 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h +4 -4
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +56 -30
- package/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Slider/RCTSliderComponentView.mm +5 -5
- package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm +3 -3
- package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Text/RCTAccessibilityElement.mm +1 -1
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.h +2 -2
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentAccessibilityProvider.mm +2 -2
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +3 -0
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +39 -5
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.h +9 -6
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +16 -4
- package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.h +2 -1
- package/React/Fabric/Mounting/ComponentViews/UnimplementedComponent/RCTUnimplementedNativeComponentView.mm +6 -4
- package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.h +1 -1
- package/React/Fabric/Mounting/ComponentViews/UnimplementedView/RCTUnimplementedViewComponentView.mm +14 -4
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h +5 -5
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +31 -23
- package/React/Fabric/Mounting/RCTComponentViewClassDescriptor.h +1 -1
- package/React/Fabric/Mounting/RCTComponentViewDescriptor.h +2 -2
- package/React/Fabric/Mounting/RCTComponentViewFactory.h +1 -1
- package/React/Fabric/Mounting/RCTComponentViewFactory.mm +12 -3
- package/React/Fabric/Mounting/RCTComponentViewProtocol.h +4 -4
- package/React/Fabric/Mounting/RCTComponentViewRegistry.h +2 -2
- package/React/Fabric/Mounting/RCTComponentViewRegistry.mm +3 -1
- package/React/Fabric/Mounting/RCTMountingManager.h +4 -4
- package/React/Fabric/Mounting/RCTMountingManager.mm +28 -19
- package/React/Fabric/Mounting/RCTMountingManagerDelegate.h +1 -1
- package/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.h +5 -3
- package/React/Fabric/Mounting/RCTMountingTransactionObserverCoordinator.mm +10 -8
- package/React/Fabric/Mounting/RCTMountingTransactionObserving.h +6 -4
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.h +6 -6
- package/React/Fabric/Mounting/UIView+ComponentViewProtocol.mm +6 -6
- package/React/Fabric/RCTConversions.h +15 -7
- package/React/Fabric/RCTImageResponseDelegate.h +1 -1
- package/React/Fabric/RCTLocalizationProvider.h +1 -1
- package/React/Fabric/RCTLocalizationProvider.mm +10 -4
- package/React/Fabric/RCTScheduler.h +8 -1
- package/React/Fabric/RCTScheduler.mm +15 -0
- package/React/Fabric/RCTSurfacePresenter.h +10 -2
- package/React/Fabric/RCTSurfacePresenter.mm +59 -27
- package/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +1 -1
- package/React/Fabric/RCTSurfaceRegistry.h +1 -1
- package/React/Fabric/RCTSurfaceTouchHandler.h +3 -3
- package/React/Fabric/RCTSurfaceTouchHandler.mm +8 -9
- package/React/Fabric/RCTTouchableComponentViewProtocol.h +1 -1
- package/React/Fabric/Surface/RCTFabricSurface.mm +1 -1
- package/React/Fabric/Utils/RCTGenericDelegateSplitter.h +1 -1
- package/React/Modules/RCTSurfacePresenterStub.h +4 -0
- package/React/Modules/RCTUIManager.m +4 -2
- package/React/React-RCTFabric.podspec +2 -2
- package/React/Views/RCTActivityIndicatorView.m +2 -1
- package/React/Views/RCTMaskedView.h +1 -1
- package/React/Views/RCTModalHostView.h +2 -2
- package/React/Views/RCTModalHostViewController.h +1 -1
- package/React/Views/RCTModalManager.h +1 -1
- package/React/Views/RCTView.h +1 -0
- package/React/Views/RCTView.m +51 -17
- package/React/Views/RCTViewKeyboardEvent.m +9 -1
- package/React/Views/RCTViewManager.m +5 -14
- package/React/Views/RCTWeakViewHolder.h +1 -1
- package/React/Views/RCTWrapperViewController.h +2 -2
- package/React/Views/RefreshControl/RCTRefreshControl.h +2 -2
- package/React/Views/RefreshControl/RCTRefreshableProtocol.h +1 -1
- package/React/Views/SafeAreaView/RCTSafeAreaView.h +1 -1
- package/React/Views/SafeAreaView/RCTSafeAreaViewLocalData.h +1 -1
- package/React/Views/ScrollView/RCTScrollContentView.h +4 -0
- package/React/Views/ScrollView/RCTScrollContentView.m +6 -0
- package/React/Views/ScrollView/RCTScrollContentViewManager.m +2 -0
- package/React/Views/ScrollView/RCTScrollView.h +2 -1
- package/React/Views/ScrollView/RCTScrollView.m +65 -93
- package/React/Views/ScrollView/RCTScrollViewManager.m +1 -1
- package/React/Views/ScrollView/RCTScrollableProtocol.h +1 -1
- package/React/Views/UIView+React.h +2 -0
- package/React/Views/UIView+React.m +22 -13
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/viewPropConversions.h +527 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/jni/Application.mk +1 -1
- package/ReactAndroid/src/main/jni/first-party/fb/BUCK +1 -1
- package/ReactAndroid/src/main/jni/react/jni/Android.mk +2 -2
- package/ReactCommon/React-Fabric.podspec +1 -1
- package/ReactCommon/React-rncore.podspec +1 -1
- package/ReactCommon/ReactCommon.podspec +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/cxxreact/tests/BUCK +1 -1
- package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +3 -3
- package/ReactCommon/microprofiler/BUCK +1 -1
- package/ReactCommon/react/debug/react_native_assert.h +1 -1
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +6 -6
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h +4 -3
- package/ReactCommon/react/renderer/animations/conversions.h +11 -11
- package/ReactCommon/react/renderer/animations/tests/LayoutAnimationTest.cpp +1 -1
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +16 -16
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +14 -14
- package/ReactCommon/react/renderer/attributedstring/conversions.h +1 -1
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +5 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +3 -3
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +7 -5
- package/ReactCommon/react/renderer/components/text/ParagraphShadowNode.h +1 -1
- package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.h +1 -1
- package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.cpp +1 -1
- package/ReactCommon/react/renderer/components/textinput/iostextinput/TextInputProps.h +1 -1
- package/ReactCommon/react/renderer/components/textinput/iostextinput/primitives.h +3 -4
- package/ReactCommon/react/renderer/components/view/AccessibilityPrimitives.h +6 -6
- package/ReactCommon/react/renderer/components/view/ViewProps.h +3 -1
- package/ReactCommon/react/renderer/components/view/ViewPropsInterpolation.h +3 -3
- package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +16 -16
- package/ReactCommon/react/renderer/components/view/conversions.h +5 -6
- package/ReactCommon/react/renderer/components/view/primitives.h +4 -3
- package/ReactCommon/react/renderer/components/view/propsConversions.h +2 -0
- package/ReactCommon/react/renderer/core/ComponentDescriptor.h +5 -5
- package/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h +7 -7
- package/ReactCommon/react/renderer/core/ConcreteShadowNode.h +2 -2
- package/ReactCommon/react/renderer/core/EventDispatcher.cpp +21 -0
- package/ReactCommon/react/renderer/core/EventDispatcher.h +15 -0
- package/ReactCommon/react/renderer/core/EventListener.cpp +39 -0
- package/ReactCommon/react/renderer/core/EventListener.h +44 -0
- package/ReactCommon/react/renderer/core/Props.h +0 -4
- package/ReactCommon/react/renderer/core/RawProps.h +1 -1
- package/ReactCommon/react/renderer/core/ShadowNode.cpp +2 -2
- package/ReactCommon/react/renderer/core/ShadowNode.h +5 -5
- package/ReactCommon/react/renderer/core/propsConversions.h +6 -5
- package/ReactCommon/react/renderer/core/tests/ComponentDescriptorTest.cpp +3 -3
- package/ReactCommon/react/renderer/debug/debugStringConvertibleUtils.h +3 -3
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +1 -1
- package/ReactCommon/react/renderer/graphics/platform/ios/Color.h +1 -1
- package/ReactCommon/react/renderer/graphics/platform/ios/RCTPlatformColorUtils.mm +9 -9
- package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImageManager.h +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTImagePrimitivesConversions.h +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/ios/RCTSyncImageManager.h +1 -1
- package/ReactCommon/react/renderer/mounting/MountingCoordinator.cpp +2 -2
- package/ReactCommon/react/renderer/mounting/MountingCoordinator.h +3 -3
- package/ReactCommon/react/renderer/mounting/MountingOverrideDelegate.h +1 -1
- package/ReactCommon/react/renderer/mounting/ShadowTreeRevision.h +0 -2
- package/ReactCommon/react/renderer/mounting/StubView.h +1 -1
- package/ReactCommon/react/renderer/mounting/StubViewTree.cpp +1 -1
- package/ReactCommon/react/renderer/mounting/TelemetryController.cpp +6 -9
- package/ReactCommon/react/renderer/mounting/TelemetryController.h +7 -7
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.cpp +3 -2
- package/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler.h +7 -1
- package/ReactCommon/react/renderer/runtimescheduler/Task.h +3 -2
- package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +19 -2
- package/ReactCommon/react/renderer/scheduler/Scheduler.h +10 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/NSTextStorage+FontScaling.h +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.h +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm +15 -15
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontProperties.h +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTFontUtils.h +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.h +1 -1
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextPrimitivesConversions.h +6 -6
- package/ReactCommon/react/utils/ContextContainer.h +2 -2
- package/ReactCommon/react/utils/ManagedObjectWrapper.h +1 -1
- package/ReactCommon/react/utils/ManagedObjectWrapper.mm +1 -3
- package/ReactCommon/react/utils/SimpleThreadSafeCache.h +2 -2
- package/ReactCommon/yoga/Yoga.podspec +1 -1
- package/index.js +0 -11
- package/local-cli/generator-macos/templates/macos/HelloWorld-macOS/ViewController.m +1 -1
- package/package.json +4 -1
- package/scripts/generate-artifacts.js +21 -17
- package/scripts/react_native_pods.rb +1 -4
- package/template/Gemfile.lock +5 -5
- package/template/package.json +1 -1
- package/Libraries/Alert/AlertMacOS.js +0 -211
- package/ReactCommon/butter/optional.h +0 -38
- package/ReactCommon/react/renderer/mounting/MountingTransactionMetadata.h +0 -32
- package/third-party-podspecs/boost-for-react-native.podspec +0 -20
|
@@ -35,7 +35,7 @@ import type {
|
|
|
35
35
|
ViewToken,
|
|
36
36
|
ViewabilityConfigCallbackPair,
|
|
37
37
|
} from './ViewabilityHelper';
|
|
38
|
-
import type {
|
|
38
|
+
import type {KeyEvent} from '../Types/CoreEventTypes'; // TODO(macOS GH#774)
|
|
39
39
|
import {
|
|
40
40
|
VirtualizedListCellContextProvider,
|
|
41
41
|
VirtualizedListContext,
|
|
@@ -109,12 +109,24 @@ type OptionalProps = {|
|
|
|
109
109
|
* this for debugging purposes. Defaults to false.
|
|
110
110
|
*/
|
|
111
111
|
disableVirtualization?: ?boolean,
|
|
112
|
+
// [TODO(macOS GH#774)
|
|
112
113
|
/**
|
|
113
|
-
*
|
|
114
|
+
* Allows you to 'select' a row using arrow keys. The selected row will have the prop `isSelected`
|
|
115
|
+
* passed in as true to it's renderItem / ListItemComponent. You can also imperatively select a row
|
|
116
|
+
* using the `selectRowAtIndex` method. You can set the initially selected row using the
|
|
117
|
+
* `initialSelectedIndex` prop.
|
|
118
|
+
* Keyboard Behavior:
|
|
119
|
+
* - ArrowUp: Select row above current selected row
|
|
120
|
+
* - ArrowDown: Select row below current selected row
|
|
121
|
+
* - Option+ArrowUp: Select the first row
|
|
122
|
+
* - Opton+ArrowDown: Select the last 'realized' row
|
|
123
|
+
* - Home: Scroll to top of list
|
|
124
|
+
* - End: Scroll to end of list
|
|
114
125
|
*
|
|
115
126
|
* @platform macos
|
|
116
127
|
*/
|
|
117
|
-
enableSelectionOnKeyPress?: ?boolean,
|
|
128
|
+
enableSelectionOnKeyPress?: ?boolean,
|
|
129
|
+
// ]TODO(macOS GH#774)
|
|
118
130
|
/**
|
|
119
131
|
* A marker property for telling the list to re-render (since it implements `PureComponent`). If
|
|
120
132
|
* any of your `renderItem`, Header, Footer, etc. functions depend on anything outside of the
|
|
@@ -145,6 +157,12 @@ type OptionalProps = {|
|
|
|
145
157
|
* `getItemLayout` to be implemented.
|
|
146
158
|
*/
|
|
147
159
|
initialScrollIndex?: ?number,
|
|
160
|
+
// [TODO(macOS GH#774)
|
|
161
|
+
/**
|
|
162
|
+
* The initially selected row, if `enableSelectionOnKeyPress` is set.
|
|
163
|
+
*/
|
|
164
|
+
initialSelectedIndex?: ?number,
|
|
165
|
+
// ]TODO(macOS GH#774)
|
|
148
166
|
/**
|
|
149
167
|
* Reverses the direction of scroll. Uses scale transforms of -1.
|
|
150
168
|
*/
|
|
@@ -782,7 +800,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
|
|
782
800
|
(this.props.initialScrollIndex || 0) +
|
|
783
801
|
initialNumToRenderOrDefault(this.props.initialNumToRender),
|
|
784
802
|
) - 1,
|
|
785
|
-
selectedRowIndex:
|
|
803
|
+
selectedRowIndex: this.props.initialSelectedIndex ?? -1, // TODO(macOS GH#774)
|
|
786
804
|
};
|
|
787
805
|
|
|
788
806
|
if (this._isNestedWithSameOrientation()) {
|
|
@@ -845,7 +863,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
|
|
845
863
|
),
|
|
846
864
|
last: Math.max(0, Math.min(prevState.last, getItemCount(data) - 1)),
|
|
847
865
|
selectedRowIndex: Math.max(
|
|
848
|
-
|
|
866
|
+
-1, // Used to indicate no row is selected
|
|
849
867
|
Math.min(prevState.selectedRowIndex, getItemCount(data)),
|
|
850
868
|
), // TODO(macOS GH#774)
|
|
851
869
|
};
|
|
@@ -961,11 +979,13 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
|
|
961
979
|
this.props;
|
|
962
980
|
const {data, horizontal} = this.props;
|
|
963
981
|
const isVirtualizationDisabled = this._isVirtualizationDisabled();
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
982
|
+
// macOS natively supports inverted lists, thus not needing an inversion style
|
|
983
|
+
const inversionStyle =
|
|
984
|
+
this.props.inverted && Platform.OS !== 'macos' // TODO(macOS GH#774)
|
|
985
|
+
? horizontalOrDefault(this.props.horizontal)
|
|
986
|
+
? styles.horizontallyInverted
|
|
987
|
+
: styles.verticallyInverted
|
|
988
|
+
: null;
|
|
969
989
|
const cells = [];
|
|
970
990
|
const stickyIndicesFromProps = new Set(this.props.stickyHeaderIndices);
|
|
971
991
|
const stickyHeaderIndices = [];
|
|
@@ -1309,14 +1329,29 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
|
|
1309
1329
|
}
|
|
1310
1330
|
|
|
1311
1331
|
_defaultRenderScrollComponent = props => {
|
|
1312
|
-
|
|
1313
|
-
if (!keyEventHandler) {
|
|
1314
|
-
keyEventHandler = this.props.enableSelectionOnKeyPress
|
|
1315
|
-
? this._handleKeyDown
|
|
1316
|
-
: null;
|
|
1317
|
-
}
|
|
1332
|
+
// [TODO(macOS GH#774)
|
|
1318
1333
|
const preferredScrollerStyleDidChangeHandler =
|
|
1319
|
-
this.props.onPreferredScrollerStyleDidChange;
|
|
1334
|
+
this.props.onPreferredScrollerStyleDidChange;
|
|
1335
|
+
const invertedDidChange = this.props.onInvertedDidChange;
|
|
1336
|
+
|
|
1337
|
+
const isFirstRowSelected = this.state.selectedRowIndex === this.state.first;
|
|
1338
|
+
const isLastRowSelected = this.state.selectedRowIndex === this.state.last;
|
|
1339
|
+
|
|
1340
|
+
// Don't pass in ArrowUp/ArrowDown at the top/bottom of the list so that keyboard event can bubble
|
|
1341
|
+
let _validKeysDown = ['Home', 'End'];
|
|
1342
|
+
if (!isFirstRowSelected) {
|
|
1343
|
+
_validKeysDown.push('ArrowUp');
|
|
1344
|
+
}
|
|
1345
|
+
if (!isLastRowSelected) {
|
|
1346
|
+
_validKeysDown.push('ArrowDown');
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
const keyboardNavigationProps = {
|
|
1350
|
+
focusable: true,
|
|
1351
|
+
validKeysDown: _validKeysDown,
|
|
1352
|
+
onKeyDown: this._handleKeyDown,
|
|
1353
|
+
};
|
|
1354
|
+
// ]TODO(macOS GH#774)
|
|
1320
1355
|
const onRefresh = props.onRefresh;
|
|
1321
1356
|
if (this._isNestedWithSameOrientation()) {
|
|
1322
1357
|
// $FlowFixMe[prop-missing] - Typing ReactNativeComponent revealed errors
|
|
@@ -1331,13 +1366,13 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
|
|
1331
1366
|
return (
|
|
1332
1367
|
// $FlowFixMe[prop-missing] Invalid prop usage
|
|
1333
1368
|
<ScrollView
|
|
1334
|
-
{...props}
|
|
1335
1369
|
// [TODO(macOS GH#774)
|
|
1336
|
-
{...(props.enableSelectionOnKeyPress &&
|
|
1337
|
-
|
|
1370
|
+
{...(props.enableSelectionOnKeyPress && keyboardNavigationProps)}
|
|
1371
|
+
onInvertedDidChange={invertedDidChange}
|
|
1338
1372
|
onPreferredScrollerStyleDidChange={
|
|
1339
1373
|
preferredScrollerStyleDidChangeHandler
|
|
1340
1374
|
} // TODO(macOS GH#774)]
|
|
1375
|
+
{...props}
|
|
1341
1376
|
refreshControl={
|
|
1342
1377
|
props.refreshControl == null ? (
|
|
1343
1378
|
<RefreshControl
|
|
@@ -1355,12 +1390,13 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
|
|
1355
1390
|
return (
|
|
1356
1391
|
// $FlowFixMe Invalid prop usage
|
|
1357
1392
|
<ScrollView
|
|
1358
|
-
|
|
1359
|
-
{...(props.enableSelectionOnKeyPress &&
|
|
1360
|
-
|
|
1393
|
+
// [TODO(macOS GH#774)
|
|
1394
|
+
{...(props.enableSelectionOnKeyPress && keyboardNavigationProps)}
|
|
1395
|
+
onInvertedDidChange={invertedDidChange}
|
|
1361
1396
|
onPreferredScrollerStyleDidChange={
|
|
1362
1397
|
preferredScrollerStyleDidChangeHandler
|
|
1363
1398
|
} // TODO(macOS GH#774)]
|
|
1399
|
+
{...props}
|
|
1364
1400
|
/>
|
|
1365
1401
|
);
|
|
1366
1402
|
}
|
|
@@ -1510,98 +1546,11 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
|
|
1510
1546
|
};
|
|
1511
1547
|
|
|
1512
1548
|
// [TODO(macOS GH#774)
|
|
1513
|
-
_selectRowAboveIndex = rowIndex => {
|
|
1514
|
-
const rowAbove = rowIndex > 0 ? rowIndex - 1 : rowIndex;
|
|
1515
|
-
this.setState(state => {
|
|
1516
|
-
return {selectedRowIndex: rowAbove};
|
|
1517
|
-
});
|
|
1518
|
-
return rowAbove;
|
|
1519
|
-
};
|
|
1520
|
-
|
|
1521
1549
|
_selectRowAtIndex = rowIndex => {
|
|
1522
|
-
this.
|
|
1523
|
-
|
|
1524
|
-
});
|
|
1525
|
-
return rowIndex;
|
|
1526
|
-
};
|
|
1527
|
-
|
|
1528
|
-
_selectRowBelowIndex = rowIndex => {
|
|
1529
|
-
if (this.props.getItemCount) {
|
|
1530
|
-
const {data} = this.props;
|
|
1531
|
-
const itemCount = this.props.getItemCount(data);
|
|
1532
|
-
const rowBelow = rowIndex < itemCount - 1 ? rowIndex + 1 : rowIndex;
|
|
1533
|
-
this.setState(state => {
|
|
1534
|
-
return {selectedRowIndex: rowBelow};
|
|
1535
|
-
});
|
|
1536
|
-
return rowBelow;
|
|
1537
|
-
} else {
|
|
1538
|
-
return rowIndex;
|
|
1539
|
-
}
|
|
1540
|
-
};
|
|
1550
|
+
const prevIndex = this.state.selectedRowIndex;
|
|
1551
|
+
const newIndex = rowIndex;
|
|
1552
|
+
this.setState({selectedRowIndex: newIndex});
|
|
1541
1553
|
|
|
1542
|
-
_handleKeyDown = (event: ScrollEvent) => {
|
|
1543
|
-
if (this.props.onScrollKeyDown) {
|
|
1544
|
-
this.props.onScrollKeyDown(event);
|
|
1545
|
-
} else {
|
|
1546
|
-
if (Platform.OS === 'macos') {
|
|
1547
|
-
// $FlowFixMe Cannot get e.nativeEvent because property nativeEvent is missing in Event
|
|
1548
|
-
const nativeEvent = event.nativeEvent;
|
|
1549
|
-
const key = nativeEvent.key;
|
|
1550
|
-
|
|
1551
|
-
let prevIndex = -1;
|
|
1552
|
-
let newIndex = -1;
|
|
1553
|
-
if ('selectedRowIndex' in this.state) {
|
|
1554
|
-
prevIndex = this.state.selectedRowIndex;
|
|
1555
|
-
}
|
|
1556
|
-
|
|
1557
|
-
// const {data, getItem} = this.props;
|
|
1558
|
-
if (key === 'UP_ARROW') {
|
|
1559
|
-
newIndex = this._selectRowAboveIndex(prevIndex);
|
|
1560
|
-
this._handleSelectionChange(prevIndex, newIndex);
|
|
1561
|
-
} else if (key === 'DOWN_ARROW') {
|
|
1562
|
-
newIndex = this._selectRowBelowIndex(prevIndex);
|
|
1563
|
-
this._handleSelectionChange(prevIndex, newIndex);
|
|
1564
|
-
} else if (key === 'ENTER') {
|
|
1565
|
-
if (this.props.onSelectionEntered) {
|
|
1566
|
-
const item = this.props.getItem(this.props.data, prevIndex);
|
|
1567
|
-
if (this.props.onSelectionEntered) {
|
|
1568
|
-
this.props.onSelectionEntered(item);
|
|
1569
|
-
}
|
|
1570
|
-
}
|
|
1571
|
-
} else if (key === 'OPTION_UP') {
|
|
1572
|
-
newIndex = this._selectRowAtIndex(0);
|
|
1573
|
-
this._handleSelectionChange(prevIndex, newIndex);
|
|
1574
|
-
} else if (key === 'OPTION_DOWN') {
|
|
1575
|
-
newIndex = this._selectRowAtIndex(this.state.last);
|
|
1576
|
-
this._handleSelectionChange(prevIndex, newIndex);
|
|
1577
|
-
} else if (key === 'PAGE_UP') {
|
|
1578
|
-
const maxY =
|
|
1579
|
-
event.nativeEvent.contentSize.height -
|
|
1580
|
-
event.nativeEvent.layoutMeasurement.height;
|
|
1581
|
-
const newOffset = Math.min(
|
|
1582
|
-
maxY,
|
|
1583
|
-
nativeEvent.contentOffset.y + -nativeEvent.layoutMeasurement.height,
|
|
1584
|
-
);
|
|
1585
|
-
this.scrollToOffset({animated: true, offset: newOffset});
|
|
1586
|
-
} else if (key === 'PAGE_DOWN') {
|
|
1587
|
-
const maxY =
|
|
1588
|
-
event.nativeEvent.contentSize.height -
|
|
1589
|
-
event.nativeEvent.layoutMeasurement.height;
|
|
1590
|
-
const newOffset = Math.min(
|
|
1591
|
-
maxY,
|
|
1592
|
-
nativeEvent.contentOffset.y + nativeEvent.layoutMeasurement.height,
|
|
1593
|
-
);
|
|
1594
|
-
this.scrollToOffset({animated: true, offset: newOffset});
|
|
1595
|
-
} else if (key === 'HOME') {
|
|
1596
|
-
this.scrollToOffset({animated: true, offset: 0});
|
|
1597
|
-
} else if (key === 'END') {
|
|
1598
|
-
this.scrollToEnd({animated: true});
|
|
1599
|
-
}
|
|
1600
|
-
}
|
|
1601
|
-
}
|
|
1602
|
-
};
|
|
1603
|
-
|
|
1604
|
-
_handleSelectionChange = (prevIndex, newIndex) => {
|
|
1605
1554
|
this.ensureItemAtIndexIsVisible(newIndex);
|
|
1606
1555
|
if (prevIndex !== newIndex) {
|
|
1607
1556
|
const item = this.props.getItem(this.props.data, newIndex);
|
|
@@ -1613,6 +1562,62 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
|
|
1613
1562
|
});
|
|
1614
1563
|
}
|
|
1615
1564
|
}
|
|
1565
|
+
|
|
1566
|
+
return newIndex;
|
|
1567
|
+
};
|
|
1568
|
+
|
|
1569
|
+
_selectRowAboveIndex = rowIndex => {
|
|
1570
|
+
const rowAbove = rowIndex > 0 ? rowIndex - 1 : rowIndex;
|
|
1571
|
+
this._selectRowAtIndex(rowAbove);
|
|
1572
|
+
};
|
|
1573
|
+
|
|
1574
|
+
_selectRowBelowIndex = rowIndex => {
|
|
1575
|
+
const rowBelow = rowIndex < this.state.last ? rowIndex + 1 : rowIndex;
|
|
1576
|
+
this._selectRowAtIndex(rowBelow);
|
|
1577
|
+
};
|
|
1578
|
+
|
|
1579
|
+
_handleKeyDown = (event: KeyEvent) => {
|
|
1580
|
+
if (Platform.OS === 'macos') {
|
|
1581
|
+
this.props.onKeyDown?.(event);
|
|
1582
|
+
if (event.defaultPrevented) {
|
|
1583
|
+
return;
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
const nativeEvent = event.nativeEvent;
|
|
1587
|
+
const key = nativeEvent.key;
|
|
1588
|
+
|
|
1589
|
+
let selectedIndex = -1;
|
|
1590
|
+
if (this.state.selectedRowIndex >= 0) {
|
|
1591
|
+
selectedIndex = this.state.selectedRowIndex;
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
if (key === 'ArrowUp') {
|
|
1595
|
+
if (nativeEvent.altKey) {
|
|
1596
|
+
// Option+Up selects the first element
|
|
1597
|
+
this._selectRowAtIndex(0);
|
|
1598
|
+
} else {
|
|
1599
|
+
this._selectRowAboveIndex(selectedIndex);
|
|
1600
|
+
}
|
|
1601
|
+
} else if (key === 'ArrowDown') {
|
|
1602
|
+
if (nativeEvent.altKey) {
|
|
1603
|
+
// Option+Down selects the last element
|
|
1604
|
+
this._selectRowAtIndex(this.state.last);
|
|
1605
|
+
} else {
|
|
1606
|
+
this._selectRowBelowIndex(selectedIndex);
|
|
1607
|
+
}
|
|
1608
|
+
} else if (key === 'Enter') {
|
|
1609
|
+
if (this.props.onSelectionEntered) {
|
|
1610
|
+
const item = this.props.getItem(this.props.data, selectedIndex);
|
|
1611
|
+
if (this.props.onSelectionEntered) {
|
|
1612
|
+
this.props.onSelectionEntered(item);
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
} else if (key === 'Home') {
|
|
1616
|
+
this.scrollToOffset({animated: true, offset: 0});
|
|
1617
|
+
} else if (key === 'End') {
|
|
1618
|
+
this.scrollToEnd({animated: true});
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1616
1621
|
};
|
|
1617
1622
|
// ]TODO(macOS GH#774)
|
|
1618
1623
|
|
|
@@ -12,7 +12,7 @@ const Platform = require('../Utilities/Platform'); // TODO(macOS GH#774)
|
|
|
12
12
|
import invariant from 'invariant';
|
|
13
13
|
import type {ViewToken} from './ViewabilityHelper';
|
|
14
14
|
import type {SelectedRowIndexPathType} from './VirtualizedList'; // TODO(macOS GH#774)
|
|
15
|
-
import type {
|
|
15
|
+
import type {KeyEvent} from '../Types/CoreEventTypes'; // TODO(macOS GH#774)
|
|
16
16
|
import {keyExtractor as defaultKeyExtractor} from './VirtualizeUtils';
|
|
17
17
|
import {View, VirtualizedList} from 'react-native';
|
|
18
18
|
import * as React from 'react';
|
|
@@ -311,8 +311,12 @@ class VirtualizedSectionList<
|
|
|
311
311
|
}
|
|
312
312
|
};
|
|
313
313
|
|
|
314
|
-
_handleKeyDown = (e:
|
|
314
|
+
_handleKeyDown = (e: KeyEvent) => {
|
|
315
315
|
if (Platform.OS === 'macos') {
|
|
316
|
+
if (e.defaultPrevented) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
|
|
316
320
|
const event = e.nativeEvent;
|
|
317
321
|
const key = event.key;
|
|
318
322
|
let prevIndexPath = this.state.selectedRowIndexPath;
|
|
@@ -320,7 +324,7 @@ class VirtualizedSectionList<
|
|
|
320
324
|
const sectionIndex = this.state.selectedRowIndexPath.sectionIndex;
|
|
321
325
|
const rowIndex = this.state.selectedRowIndexPath.rowIndex;
|
|
322
326
|
|
|
323
|
-
if (key === '
|
|
327
|
+
if (key === 'ArrowDown') {
|
|
324
328
|
nextIndexPath = this._selectRowBelowIndexPath(prevIndexPath);
|
|
325
329
|
this._ensureItemAtIndexPathIsVisible(nextIndexPath);
|
|
326
330
|
|
|
@@ -332,7 +336,7 @@ class VirtualizedSectionList<
|
|
|
332
336
|
item: item,
|
|
333
337
|
});
|
|
334
338
|
}
|
|
335
|
-
} else if (key === '
|
|
339
|
+
} else if (key === 'ArrowUp') {
|
|
336
340
|
nextIndexPath = this._selectRowAboveIndexPath(prevIndexPath);
|
|
337
341
|
this._ensureItemAtIndexPathIsVisible(nextIndexPath);
|
|
338
342
|
|
|
@@ -344,7 +348,7 @@ class VirtualizedSectionList<
|
|
|
344
348
|
item: item,
|
|
345
349
|
});
|
|
346
350
|
}
|
|
347
|
-
} else if (key === '
|
|
351
|
+
} else if (key === 'Enter') {
|
|
348
352
|
if (this.props.onSelectionEntered) {
|
|
349
353
|
const item = this.props.sections[sectionIndex].data[rowIndex];
|
|
350
354
|
this.props.onSelectionEntered(item);
|
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
#import <React/RCTAnimatedNode.h>
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
@interface RCTColorAnimatedNode : RCTAnimatedNode
|
|
11
|
+
|
|
12
|
+
@property (nonatomic, assign) int32_t color;
|
|
13
|
+
|
|
14
|
+
@end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <React/RCTColorAnimatedNode.h>
|
|
9
|
+
#import <React/RCTValueAnimatedNode.h>
|
|
10
|
+
|
|
11
|
+
@implementation RCTColorAnimatedNode
|
|
12
|
+
|
|
13
|
+
- (void)performUpdate
|
|
14
|
+
{
|
|
15
|
+
[super performUpdate];
|
|
16
|
+
|
|
17
|
+
RCTValueAnimatedNode *rNode = (RCTValueAnimatedNode *)[self.parentNodes objectForKey:self.config[@"r"]];
|
|
18
|
+
RCTValueAnimatedNode *gNode = (RCTValueAnimatedNode *)[self.parentNodes objectForKey:self.config[@"g"]];
|
|
19
|
+
RCTValueAnimatedNode *bNode = (RCTValueAnimatedNode *)[self.parentNodes objectForKey:self.config[@"b"]];
|
|
20
|
+
RCTValueAnimatedNode *aNode = (RCTValueAnimatedNode *)[self.parentNodes objectForKey:self.config[@"a"]];
|
|
21
|
+
|
|
22
|
+
_color = ((int)round(aNode.value * 255) & 0xff) << 24 |
|
|
23
|
+
((int)round(rNode.value) & 0xff) << 16 |
|
|
24
|
+
((int)round(gNode.value) & 0xff) << 8 |
|
|
25
|
+
((int)round(bNode.value) & 0xff);
|
|
26
|
+
|
|
27
|
+
// TODO (T111179606): Support platform colors for color animations
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@end
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
#import <React/RCTStyleAnimatedNode.h>
|
|
13
13
|
#import <React/RCTUIManager.h>
|
|
14
14
|
#import <React/RCTValueAnimatedNode.h>
|
|
15
|
+
#import <React/RCTColorAnimatedNode.h>
|
|
15
16
|
|
|
16
17
|
@implementation RCTPropsAnimatedNode
|
|
17
18
|
{
|
|
@@ -118,17 +119,21 @@
|
|
|
118
119
|
for (NSNumber *parentTag in self.parentNodes.keyEnumerator) {
|
|
119
120
|
RCTAnimatedNode *parentNode = [self.parentNodes objectForKey:parentTag];
|
|
120
121
|
if ([parentNode isKindOfClass:[RCTStyleAnimatedNode class]]) {
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
RCTStyleAnimatedNode *styleAnimatedNode = (RCTStyleAnimatedNode *)parentNode;
|
|
123
|
+
[_propsDictionary addEntriesFromDictionary:styleAnimatedNode.propsDictionary];
|
|
123
124
|
} else if ([parentNode isKindOfClass:[RCTValueAnimatedNode class]]) {
|
|
125
|
+
RCTValueAnimatedNode *valueAnimatedNode = (RCTValueAnimatedNode *)parentNode;
|
|
124
126
|
NSString *property = [self propertyNameForParentTag:parentTag];
|
|
125
|
-
id animatedObject =
|
|
127
|
+
id animatedObject = valueAnimatedNode.animatedObject;
|
|
126
128
|
if (animatedObject) {
|
|
127
|
-
|
|
129
|
+
_propsDictionary[property] = animatedObject;
|
|
128
130
|
} else {
|
|
129
|
-
|
|
130
|
-
self->_propsDictionary[property] = @(value);
|
|
131
|
+
_propsDictionary[property] = @(valueAnimatedNode.value);
|
|
131
132
|
}
|
|
133
|
+
} else if ([parentNode isKindOfClass:[RCTColorAnimatedNode class]]) {
|
|
134
|
+
RCTColorAnimatedNode *colorAnimatedNode = (RCTColorAnimatedNode *)parentNode;
|
|
135
|
+
NSString *property = [self propertyNameForParentTag:parentTag];
|
|
136
|
+
_propsDictionary[property] = @(colorAnimatedNode.color);
|
|
132
137
|
}
|
|
133
138
|
}
|
|
134
139
|
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
#import <React/RCTAnimationUtils.h>
|
|
10
10
|
#import <React/RCTValueAnimatedNode.h>
|
|
11
11
|
#import <React/RCTTransformAnimatedNode.h>
|
|
12
|
+
#import <React/RCTColorAnimatedNode.h>
|
|
12
13
|
|
|
13
14
|
@implementation RCTStyleAnimatedNode
|
|
14
15
|
{
|
|
@@ -38,11 +39,14 @@
|
|
|
38
39
|
RCTAnimatedNode *node = [self.parentNodes objectForKey:nodeTag];
|
|
39
40
|
if (node) {
|
|
40
41
|
if ([node isKindOfClass:[RCTValueAnimatedNode class]]) {
|
|
41
|
-
RCTValueAnimatedNode *
|
|
42
|
-
[
|
|
42
|
+
RCTValueAnimatedNode *valueAnimatedNode = (RCTValueAnimatedNode *)node;
|
|
43
|
+
_propsDictionary[property] = @(valueAnimatedNode.value);
|
|
43
44
|
} else if ([node isKindOfClass:[RCTTransformAnimatedNode class]]) {
|
|
44
|
-
RCTTransformAnimatedNode *
|
|
45
|
-
[
|
|
45
|
+
RCTTransformAnimatedNode *transformAnimatedNode = (RCTTransformAnimatedNode *)node;
|
|
46
|
+
[_propsDictionary addEntriesFromDictionary:transformAnimatedNode.propsDictionary];
|
|
47
|
+
} else if ([node isKindOfClass:[RCTColorAnimatedNode class]]) {
|
|
48
|
+
RCTColorAnimatedNode *colorAnimatedNode = (RCTColorAnimatedNode *)node;
|
|
49
|
+
_propsDictionary[property] = @(colorAnimatedNode.color);
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
}];
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
#import <React/RCTAdditionAnimatedNode.h>
|
|
13
13
|
#import <React/RCTAnimatedNode.h>
|
|
14
14
|
#import <React/RCTAnimationDriver.h>
|
|
15
|
+
#import <React/RCTColorAnimatedNode.h>
|
|
15
16
|
#import <React/RCTDiffClampAnimatedNode.h>
|
|
16
17
|
#import <React/RCTDivisionAnimatedNode.h>
|
|
17
18
|
#import <React/RCTEventAnimation.h>
|
|
@@ -86,6 +87,7 @@ static NSString *RCTNormalizeAnimatedEventName(NSString *eventName)
|
|
|
86
87
|
dispatch_once(&mapToken, ^{
|
|
87
88
|
map = @{@"style" : [RCTStyleAnimatedNode class],
|
|
88
89
|
@"value" : [RCTValueAnimatedNode class],
|
|
90
|
+
@"color" : [RCTColorAnimatedNode class],
|
|
89
91
|
@"props" : [RCTPropsAnimatedNode class],
|
|
90
92
|
@"interpolation" : [RCTInterpolationAnimatedNode class],
|
|
91
93
|
@"addition" : [RCTAdditionAnimatedNode class],
|
|
@@ -29,12 +29,12 @@ Pod::Spec.new do |s|
|
|
|
29
29
|
s.platforms = { :ios => "11.0", :osx => "10.15" } # TODO(macOS GH#214)
|
|
30
30
|
s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness'
|
|
31
31
|
s.source = source
|
|
32
|
-
s.source_files = "{
|
|
32
|
+
s.source_files = "**/*.{h,m,mm}"
|
|
33
33
|
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
|
|
34
34
|
s.header_dir = "RCTAnimation"
|
|
35
35
|
s.pod_target_xcconfig = {
|
|
36
36
|
"USE_HEADERMAP" => "YES",
|
|
37
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++
|
|
37
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
|
38
38
|
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -34,7 +34,7 @@ Pod::Spec.new do |s|
|
|
|
34
34
|
s.header_dir = "RCTNetwork"
|
|
35
35
|
s.pod_target_xcconfig = {
|
|
36
36
|
"USE_HEADERMAP" => "YES",
|
|
37
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++
|
|
37
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
|
38
38
|
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
|
|
39
39
|
}
|
|
40
40
|
s.ios.frameworks = "MobileCoreServices" # TODO(macOS GH#214) - Restrict to iOS
|
|
@@ -35,7 +35,7 @@ Pod::Spec.new do |s|
|
|
|
35
35
|
s.header_dir = "RCTPushNotification"
|
|
36
36
|
s.pod_target_xcconfig = {
|
|
37
37
|
"USE_HEADERMAP" => "YES",
|
|
38
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++
|
|
38
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
|
39
39
|
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
|
|
40
40
|
}
|
|
41
41
|
s.framework = "UserNotifications"
|
|
@@ -35,7 +35,7 @@ Pod::Spec.new do |s|
|
|
|
35
35
|
s.header_dir = "RCTSettings"
|
|
36
36
|
s.pod_target_xcconfig = {
|
|
37
37
|
"USE_HEADERMAP" => "YES",
|
|
38
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++
|
|
38
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
|
39
39
|
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\""
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
#import <React/RCTBaseTextViewManager.h>
|
|
9
|
+
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
10
|
+
#import <React/RCTCursor.h>
|
|
11
|
+
#endif // ]TODO(macOS GH#774)
|
|
9
12
|
|
|
10
13
|
@implementation RCTBaseTextViewManager
|
|
11
14
|
|
|
@@ -36,6 +39,7 @@ RCT_REMAP_SHADOW_PROPERTY(fontWeight, textAttributes.fontWeight, NSString)
|
|
|
36
39
|
RCT_REMAP_SHADOW_PROPERTY(fontStyle, textAttributes.fontStyle, NSString)
|
|
37
40
|
RCT_REMAP_SHADOW_PROPERTY(fontVariant, textAttributes.fontVariant, NSArray)
|
|
38
41
|
RCT_REMAP_SHADOW_PROPERTY(allowFontScaling, textAttributes.allowFontScaling, BOOL)
|
|
42
|
+
RCT_REMAP_SHADOW_PROPERTY(dynamicTypeRamp, textAttributes.dynamicTypeRamp, RCTDynamicTypeRamp) // TODO(macOS GH#774)
|
|
39
43
|
RCT_REMAP_SHADOW_PROPERTY(maxFontSizeMultiplier, textAttributes.maxFontSizeMultiplier, CGFloat)
|
|
40
44
|
RCT_REMAP_SHADOW_PROPERTY(letterSpacing, textAttributes.letterSpacing, CGFloat)
|
|
41
45
|
RCT_REMAP_SHADOW_PROPERTY(apple_fontSmoothing, textAttributes.fontSmoothing, RCTFontSmoothing) // TODO(OSS Candidate ISS#2710739)
|
|
@@ -55,4 +59,8 @@ RCT_REMAP_SHADOW_PROPERTY(textShadowColor, textAttributes.textShadowColor, UICol
|
|
|
55
59
|
RCT_REMAP_SHADOW_PROPERTY(isHighlighted, textAttributes.isHighlighted, BOOL)
|
|
56
60
|
RCT_REMAP_SHADOW_PROPERTY(textTransform, textAttributes.textTransform, RCTTextTransform)
|
|
57
61
|
|
|
62
|
+
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
63
|
+
RCT_REMAP_SHADOW_PROPERTY(cursor, textAttributes.cursor, RCTCursor)
|
|
64
|
+
#endif // ]TODO(macOS GH#774)
|
|
65
|
+
|
|
58
66
|
@end
|
|
@@ -6,12 +6,15 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
#import <React/RCTUIKit.h> // TODO(macOS GH#774)
|
|
9
|
-
|
|
10
9
|
#import <React/RCTTextDecorationLineType.h>
|
|
11
|
-
#import <React/
|
|
12
|
-
|
|
10
|
+
#import <React/RCTDynamicTypeRamp.h> // TODO(macOS GH#774)
|
|
11
|
+
#import <React/RCTFontSmoothing.h> // TODO(macOS GH#774)
|
|
13
12
|
#import "RCTTextTransform.h"
|
|
14
13
|
|
|
14
|
+
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
15
|
+
#import <React/RCTCursor.h>
|
|
16
|
+
#endif // ]TODO(macOS GH#774)
|
|
17
|
+
|
|
15
18
|
NS_ASSUME_NONNULL_BEGIN
|
|
16
19
|
|
|
17
20
|
extern NSString *const RCTTextAttributesIsHighlightedAttributeName;
|
|
@@ -38,6 +41,7 @@ extern NSString *const RCTTextAttributesTagAttributeName;
|
|
|
38
41
|
@property (nonatomic, copy, nullable) NSString *fontStyle;
|
|
39
42
|
@property (nonatomic, copy, nullable) NSArray<NSString *> *fontVariant;
|
|
40
43
|
@property (nonatomic, assign) BOOL allowFontScaling;
|
|
44
|
+
@property (nonatomic, assign) RCTDynamicTypeRamp dynamicTypeRamp; // TODO(macOS GH#774)
|
|
41
45
|
@property (nonatomic, assign) CGFloat letterSpacing;
|
|
42
46
|
@property (nonatomic, assign) RCTFontSmoothing fontSmoothing; // TODO(OSS Candidate ISS#2710739)
|
|
43
47
|
@property (class, nonatomic, assign) RCTFontSmoothing fontSmoothingDefault; // TODO(OSS Candidate ISS#2710739)
|
|
@@ -59,6 +63,10 @@ extern NSString *const RCTTextAttributesTagAttributeName;
|
|
|
59
63
|
@property (nonatomic, assign) UIUserInterfaceLayoutDirection layoutDirection;
|
|
60
64
|
@property (nonatomic, assign) RCTTextTransform textTransform;
|
|
61
65
|
|
|
66
|
+
#if TARGET_OS_OSX // [TODO(macOS GH#774)
|
|
67
|
+
@property (nonatomic, assign) RCTCursor cursor;
|
|
68
|
+
#endif // ]TODO(macOS GH#774)
|
|
69
|
+
|
|
62
70
|
#pragma mark - Inheritance
|
|
63
71
|
|
|
64
72
|
- (void)applyTextAttributes:(RCTTextAttributes *)textAttributes;
|